48 if (!(routes = root->
child (
"Routes"))) {
53 for (XMLNodeList::const_iterator it = route_list.begin(); it != route_list.end(); ++it) {
54 const XMLProperty* type = (*it)->property(
"default-type");
55 if ( (!type || type->
value() ==
"audio") && ((*it)->property (
"diskstream") != 0 || (*it)->property (
"diskstream-id") != 0)) {
68 return _(
"Audio Tracks");
80 track_handler (track_handler),
82 pl_handler (pl_handler)
95 for (XMLNodeList::const_iterator it = controllables.begin(); it != controllables.end(); ++it) {
100 if (remote_control && (prop = remote_control->
property (
"id"))) {
122 for (XMLPropertyList::const_iterator it = props.begin(); it != props.end(); ++it) {
123 string prop = (*it)->name();
124 if (!prop.compare (
"default-type") || !prop.compare (
"flags") ||
125 !prop.compare (
"active") || !prop.compare (
"muted") ||
126 !prop.compare (
"soloed") || !prop.compare (
"phase-invert") ||
127 !prop.compare (
"denormal-protection") || !prop.compare(
"mute-affects-pre-fader") ||
128 !prop.compare (
"mute-affects-post-fader") || !prop.compare(
"mute-affects-control-outs") ||
129 !prop.compare (
"mute-affects-main-outs") || !prop.compare(
"mode")) {
131 }
else if (!prop.compare(
"diskstream-id")) {
136 std::cerr <<
string_compose (
X_(
"AudioTrackImporter: did not recognise XML-property \"%1\""), prop) <<
endmsg;
141 error <<
X_(
"AudioTrackImporter: did not find necessary XML-property \"diskstream-id\"") <<
endmsg;
152 bool name_ok =
false;
161 for (XMLPropertyList::const_iterator it = props.begin(); it != props.end(); ++it) {
162 string prop = (*it)->name();
163 if (!prop.compare (
"gain") || !prop.compare (
"iolimits")) {
165 }
else if (!prop.compare(
"name")) {
166 name = (*it)->value();
168 }
else if (!prop.compare(
"id")) {
170 (*it)->set_value (
id.to_s());
172 }
else if (!prop.compare(
"inputs")) {
175 uint32_t num_inputs = std::count ((*it)->value().begin(), (*it)->value().end(),
'{');
177 for (uint32_t i = 0; i < num_inputs; i++) { value +=
"{}"; }
178 (*it)->set_value (value);
179 }
else if (!prop.compare(
"outputs")) {
181 uint32_t num_outputs = std::count ((*it)->value().begin(), (*it)->value().end(),
'{');
183 for (uint32_t i = 0; i < num_outputs; i++) { value +=
"{}"; }
184 (*it)->set_value (value);
186 std::cerr <<
string_compose (
X_(
"AudioTrackImporter: did not recognise XML-property \"%1\""), prop) <<
endmsg;
191 error <<
X_(
"AudioTrackImporter: did not find necessary XML-property \"name\"") <<
endmsg;
196 error <<
X_(
"AudioTrackImporter: did not find necessary XML-property \"id\"") <<
endmsg;
201 for (XMLNodeList::const_iterator it = controllables.begin(); it != controllables.end(); ++it) {
206 for (XMLNodeList::const_iterator it = processors.begin(); it != processors.end(); ++it) {
211 for (XMLNodeList::const_iterator it = automations.begin(); it != automations.end(); ++it) {
234 if (!(*it)->prepare_move ()) {
244 std::pair<bool, string> rename_pair = *
Rename (
_(
"A playlist with this name already exists, please rename it."),
name);
245 if (!rename_pair.first) {
248 name = rename_pair.second;
253 error <<
_(
"badly-formed XML in imported track") <<
endmsg;
259 error <<
_(
"badly-formed XML in imported track") <<
endmsg;
283 string xpath =
"/Session/DiskStreams/AudioDiskstream[@id='" +
old_ds_id.
to_s() +
"']";
286 if (ds_node_list->size() != 1) {
303 for (PlaylistList::const_iterator it =
playlists.begin(); it !=
playlists.end(); ++it) {
330 if ((prop = node.
property (
"id"))) {
345 for (XMLNodeList::const_iterator it = lists.begin(); it != lists.end(); ++it) {
348 if ((prop = (*it)->property (
"id"))) {
353 if (!(*it)->name().compare (
"events")) {
370 if (content_node->
content().empty()) {
374 std::stringstream str (content_node->
content());
375 std::ostringstream new_content;
396 error <<
X_(
"AudioTrackImporter: error in rate converting automation events") <<
endmsg;
void playlists_by_diskstream(PBD::ID const &id, PlaylistList &list) const
void _cancel_move()
Cancel move.
std::string to_string(T t, std::ios_base &(*f)(std::ios_base &))
const XMLPropertyList & properties() const
std::string name
Name of element.
const std::string & content() const
const std::string & value() const
virtual std::string get_info() const
virtual bool set_name(const std::string &str)
AudioPlaylistImportHandler & pl_handler
boost::shared_ptr< XMLSharedNodeList > find(const std::string xpath, XMLNode *=0) const
bool parse_automation(XMLNode &node)
std::list< XMLProperty * > XMLPropertyList
bool parse_controllable(XMLNode &node)
XMLNode * add_child_copy(const XMLNode &)
LIBPBD_API Transmitter error
const XMLNodeList & children(const std::string &str=std::string()) const
bool parse_processor(XMLNode &node)
AudioTrackImporter(XMLTree const &source, Session &session, AudioTrackImportHandler &track_handler, XMLNode const &node, AudioPlaylistImportHandler &pl_handler)
std::ostream & endmsg(std::ostream &ostr)
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::list< XMLNode * > XMLNodeList
Virtual interface class for element importers.
XMLProperty * property(const char *)
bool rate_convert_events(XMLNode &node)
std::string get_info() const
static const std::string xml_node_name
Virtual interface class for element import handlers.
ElementList elements
Elements this handler handles.
pframes_t get_block_size() const
boost::shared_ptr< Route > route_by_name(std::string)
void remove_name(const std::string &name)
Removes name from the list of used names.
XMLTree const & source
Source XML-tree.
void add_name(std::string name)
Adds name to the list of used names.
void remove_property(const std::string &)
const std::string & set_content(const std::string &)
virtual int do_refill_with_alloc()=0
XMLNode * child(const char *) const
int load_routes(const XMLNode &, int)
const std::string & set_value(const std::string &v)
void remove_nodes_and_delete(const std::string &)
AudioTrackImportHandler & track_handler
virtual void set_block_size(pframes_t)=0
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)