Use ID::to_s() in libardour instead of ID::print()

This commit is contained in:
Tim Mayberry 2016-08-19 21:40:53 +10:00
parent 4dd0203f01
commit 334ec95e43
13 changed files with 17 additions and 38 deletions

View File

@ -241,7 +241,6 @@ AudioTrack::state (bool full_state)
{
XMLNode& root (Track::state(full_state));
XMLNode* freeze_node;
char buf[64];
if (_freeze_record.playlist) {
XMLNode* inode;
@ -252,8 +251,7 @@ AudioTrack::state (bool full_state)
for (vector<FreezeRecordProcessorInfo*>::iterator i = _freeze_record.processor_info.begin(); i != _freeze_record.processor_info.end(); ++i) {
inode = new XMLNode (X_("processor"));
(*i)->id.print (buf, sizeof (buf));
inode->add_property (X_("id"), buf);
inode->add_property (X_ ("id"), (*i)->id.to_s ());
inode->add_child_copy ((*i)->state);
freeze_node->add_child_nocopy (*inode);

View File

@ -482,8 +482,7 @@ Diskstream::get_state ()
node->add_property ("flags", enum_2_string (_flags));
node->add_property ("playlist", _playlist->name());
node->add_property("name", _name);
id().print (buf, sizeof (buf));
node->add_property("id", buf);
node->add_property ("id", id ().to_s ());
snprintf (buf, sizeof(buf), "%f", _visible_speed);
node->add_property ("speed", buf);
node->add_property ("capture-alignment", enum_2_string (_alignment_choice));

View File

@ -557,8 +557,7 @@ IO::state (bool /*full_state*/)
Glib::Threads::Mutex::Lock lm (io_lock);
node->add_property("name", _name);
id().print (buf, sizeof (buf));
node->add_property("id", buf);
node->add_property ("id", id ().to_s ());
node->add_property ("direction", enum_2_string (_direction));
node->add_property ("default-type", _default_type.to_string());

View File

@ -575,8 +575,7 @@ Location::get_state ()
node->add_child_nocopy(cd_info_node(m->first, m->second));
}
id().print (buf, sizeof (buf));
node->add_property("id", buf);
node->add_property ("id", id ().to_s ());
node->add_property ("name", name());
snprintf (buf, sizeof (buf), "%" PRId64, start());
node->add_property ("start", buf);

View File

@ -248,8 +248,7 @@ MidiTrack::state(bool full_state)
for (vector<FreezeRecordProcessorInfo*>::iterator i = _freeze_record.processor_info.begin(); i != _freeze_record.processor_info.end(); ++i) {
inode = new XMLNode (X_("processor"));
(*i)->id.print (buf, sizeof(buf));
inode->add_property (X_("id"), buf);
inode->add_property (X_("id"), id().to_s ());
inode->add_child_copy ((*i)->state);
freeze_node->add_child_nocopy (*inode);

View File

@ -2333,8 +2333,7 @@ Playlist::state (bool full_state)
node->add_property (X_("name"), _name);
node->add_property (X_("type"), _type.to_string());
_orig_track_id.print (buf, sizeof (buf));
node->add_property (X_("orig-track-id"), buf);
node->add_property (X_("orig-track-id"), _orig_track_id.to_s ());
string shared_ids;
list<PBD::ID>::const_iterator it = _shared_with_ids.begin();

View File

@ -77,8 +77,7 @@ PlaylistSource::add_state (XMLNode& node)
{
char buf[64];
_playlist->id().print (buf, sizeof (buf));
node.add_property ("playlist", buf);
node.add_property ("playlist", _playlist->id ().to_s ());
snprintf (buf, sizeof (buf), "%" PRIi64, _playlist_offset);
node.add_property ("offset", buf);
snprintf (buf, sizeof (buf), "%" PRIu64, _playlist_length);

View File

@ -113,8 +113,7 @@ Processor::state (bool full_state)
XMLNode* node = new XMLNode (state_node_name);
char buf[64];
id().print (buf, sizeof (buf));
node->add_property("id", buf);
node->add_property("id", id().to_s ());
node->add_property("name", _name);
node->add_property("active", active() ? "yes" : "no");

View File

@ -1255,7 +1255,6 @@ XMLNode&
Region::state ()
{
XMLNode *node = new XMLNode ("Region");
char buf[64];
char buf2[64];
LocaleGuard lg;
const char* fe = NULL;
@ -1273,8 +1272,7 @@ Region::state ()
i->second->get_value (*node);
}
id().print (buf, sizeof (buf));
node->add_property ("id", buf);
node->add_property ("id", id ().to_s ());
node->add_property ("type", _type.to_string());
switch (_first_edit) {
@ -1298,14 +1296,12 @@ Region::state ()
for (uint32_t n=0; n < _sources.size(); ++n) {
snprintf (buf2, sizeof(buf2), "source-%d", n);
_sources[n]->id().print (buf, sizeof(buf));
node->add_property (buf2, buf);
node->add_property (buf2, _sources[n]->id().to_s ());
}
for (uint32_t n=0; n < _master_sources.size(); ++n) {
snprintf (buf2, sizeof(buf2), "master-source-%d", n);
_master_sources[n]->id().print (buf, sizeof (buf));
node->add_property (buf2, buf);
node->add_property (buf2, _master_sources[n]->id ().to_s ());
}
/* Only store nested sources for the whole-file region that acts

View File

@ -2318,8 +2318,7 @@ Route::state(bool full_state)
ProcessorList::iterator i;
char buf[32];
id().print (buf, sizeof (buf));
node->add_property("id", buf);
node->add_property ("id", id ().to_s ());
node->add_property ("name", _name);
node->add_property("default-type", _default_type.to_string());
node->add_property ("strict-io", _strict_io);
@ -2393,8 +2392,7 @@ Route::state(bool full_state)
if (_custom_meter_position_noted) {
boost::shared_ptr<Processor> after = _processor_after_last_custom_meter.lock ();
if (after) {
after->id().print (buf, sizeof (buf));
node->add_property (X_("processor-after-last-custom-meter"), buf);
node->add_property (X_("processor-after-last-custom-meter"), after->id().to_s());
}
}

View File

@ -239,9 +239,7 @@ RouteGroup::get_state ()
{
XMLNode *node = new XMLNode ("RouteGroup");
char buf[64];
id().print (buf, sizeof (buf));
node->add_property ("id", buf);
node->add_property ("id", id().to_s());
add_properties (*node);

View File

@ -1274,12 +1274,9 @@ Session::state (bool full_state)
XMLNode* ca = node->add_child (X_("CompoundAssociations"));
for (RegionFactory::CompoundAssociations::iterator i = cassocs.begin(); i != cassocs.end(); ++i) {
char buf[64];
XMLNode* can = new XMLNode (X_("CompoundAssociation"));
i->first->id().print (buf, sizeof (buf));
can->add_property (X_("copy"), buf);
i->second->id().print (buf, sizeof (buf));
can->add_property (X_("original"), buf);
can->add_property (X_("copy"), i->first->id().to_s());
can->add_property (X_("original"), i->second->id().to_s());
ca->add_child_nocopy (*can);
}
}

View File

@ -99,8 +99,7 @@ Source::get_state ()
node->add_property ("name", name());
node->add_property ("type", _type.to_string());
node->add_property (X_("flags"), enum_2_string (_flags));
id().print (buf, sizeof (buf));
node->add_property ("id", buf);
node->add_property ("id", id().to_s());
if (_timestamp != 0) {
snprintf (buf, sizeof (buf), "%ld", _timestamp);