43 region_handler (region_handler)
48 if (!(playlists = root->
child (nodename))) {
53 for (XMLNodeList::const_iterator it = pl_children.begin(); it != pl_children.end(); ++it) {
55 if ( !type || type->
value() ==
"audio" ) {
68 return _(
"Audio Playlists");
88 for (ElementList::const_iterator it =
elements.begin(); it !=
elements.end(); ++it) {
110 for (XMLPropertyList::const_iterator it = props.begin(); it != props.end(); ++it) {
111 string prop = (*it)->name();
112 if (!prop.compare(
"type") || !prop.compare(
"frozen")) {
114 }
else if (!prop.compare(
"name")) {
115 name = (*it)->value();
116 }
else if (!prop.compare(
"orig-diskstream-id")) {
120 std::cerr <<
string_compose (
X_(
"AudioPlaylistImporter did not recognise XML-property \"%1\""), prop) <<
endmsg;
132 handler (other.handler),
133 orig_node (other.orig_node),
134 xml_playlist (other.xml_playlist),
135 orig_diskstream_id (other.orig_diskstream_id)
150 std::ostringstream oss;
152 for (
XMLNodeIterator it = children.begin(); it != children.end(); it++) {
153 if ((*it)->name() ==
"Region") {
158 oss << regions <<
" ";
174 std::pair<bool, string> rename_pair = *
Rename (
_(
"A playlist with this name already exists, please rename it."),
name);
175 if (!rename_pair.first) {
178 name = rename_pair.second;
183 error <<
_(
"badly-formed XML in imported playlist") <<
endmsg;
209 for (RegionList::iterator it =
regions.begin(); it !=
regions.end(); ++it) {
211 (*it)->add_sources_to_session();
212 if ((*it)->broken()) {
221 for (
XMLNodeIterator it = crossfades.begin(); it != crossfades.end(); ++it) {
259 for (ElementImportHandler::ElementList::iterator it = elements.begin(); it != elements.end(); ++it) {
260 regions.push_back (boost::dynamic_pointer_cast<AudioRegionImporter> (*it));
267 return _(
"Audio Playlists (unused)");
AudioRegionImportHandler & region_handler
void playlists_by_diskstream(PBD::ID const &id, PlaylistList &list) const
PBD::ID orig_diskstream_id
PBD::ID const & get_new_id(PBD::ID &old_id) const
std::string get_info() const
void update_region_id(XMLProperty *id_prop)
XMLNodeList::iterator XMLNodeIterator
const XMLPropertyList & properties() const
std::string name
Name of element.
const std::string & value() const
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
std::list< PlaylistPtr > PlaylistList
std::list< XMLProperty * > XMLPropertyList
void populate_region_list()
XMLNode * add_child_copy(const XMLNode &)
LIBPBD_API Transmitter error
const XMLNodeList & children(const std::string &str=std::string()) const
std::ostream & endmsg(std::ostream &ostr)
AudioPlaylistImporter(XMLTree const &source, Session &session, AudioPlaylistImportHandler &handler, XMLNode const &node)
ARDOUR::Session & session
Target session.
framecnt_t rate_convert_samples(framecnt_t samples) const
Converts samples so that times match the sessions sample rate.
static PBD::Signal2< std::pair< bool, std::string >, std::string, std::string > Rename
Signal that requests for anew name.
std::string get_info() const
std::list< XMLNode * > XMLNodeList
PBD::ID const & orig_diskstream() const
Virtual interface class for element importers.
XMLProperty * property(const char *)
void set_diskstream(PBD::ID const &id)
AudioPlaylistImportHandler & handler
virtual std::string get_info() const
void remove_nodes(const std::string &)
Virtual interface class for element import handlers.
std::list< ElementPtr > ElementList
void _cancel_move()
Cancel move.
ElementList elements
Elements this handler handles.
void remove_name(const std::string &name)
Removes name from the list of used names.
void add_name(std::string name)
Adds name to the list of used names.
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > position
void get_regions(XMLNode const &node, ElementList &list) const
void set_broken()
Set element broken.
XMLNode * child(const char *) const
boost::shared_ptr< SessionPlaylists > playlists
void create_regions_from_children(XMLNode const &node, ElementList &list)
const std::string & set_value(const std::string &v)
static boost::shared_ptr< Playlist > create(Session &, const XMLNode &, bool hidden=false, bool unused=false)
static void set_dirty()
Sets handler dirty.
bool check_name(const std::string &name) const
std::string string_compose(const std::string &fmt, const T1 &o1)
LIBARDOUR_API PBD::PropertyDescriptor< framecnt_t > length
XMLNode const & orig_node