Use ID::to_s() in libardour instead of ID::print()
authorTim Mayberry <mojofunk@gmail.com>
Fri, 19 Aug 2016 11:40:53 +0000 (21:40 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Tue, 18 Apr 2017 21:49:58 +0000 (07:49 +1000)
13 files changed:
libs/ardour/audio_track.cc
libs/ardour/diskstream.cc
libs/ardour/io.cc
libs/ardour/location.cc
libs/ardour/midi_track.cc
libs/ardour/playlist.cc
libs/ardour/playlist_source.cc
libs/ardour/processor.cc
libs/ardour/region.cc
libs/ardour/route.cc
libs/ardour/route_group.cc
libs/ardour/session_state.cc
libs/ardour/source.cc

index f0303dbd369c60672e35d77c8519af0877365bcd..9dc21bcf3ac05a163a9b270992dc549b2747301e 100644 (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);
index d95fa109dbd1b84a3034c1b3a8b51d6dd6ad8515..cf6db56af98fe4688cc54b329155a9c53dd8eab8 100644 (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));
index 66aaaee68e39b20f6e8185a1f8de20651b5d3cf5..d9f73b6d8a33de04b1224c8f270192e14cb28f64 100644 (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());
 
index 77177391b05ae30898491874736951bc7d8fb876..23e5f32076edd394979c550424b31132a8fb9d8e 100644 (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);
index a4c14e4f625fab397ca83e03543f626e5439ddb5..66ad74068ecdee41197f06e893d2d4ebc7de25bb 100644 (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);
index 19c02051c04b0582d5682e835846eca4a39c3423..8191982156813ab48c5e0d9fc2994cd0d95c959f 100644 (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();
index 07f72331bb8f136798760b0a744d07e7ed3c10ea..b0c451604093601b3b13cff24877b10b9fdd97a6 100644 (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);
index 60a23376b6c4c5d15bcd2002dc74899aa349f836..8a66df0ec92149822c4019229194e1d87ab82a08 100644 (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");
 
index 8640b53a6e4cd3f798ea2ea6cab0b2e561458fd3..86e52b8e7cf2b5676b95e6b89fe3bcdd7efc98be 100644 (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
index 6c56fb60e9fc250e59afe07ffc12ec5db768a3dd..5d823e1545c3c35c55948605ae1c53d5f781b76e 100644 (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());
                }
        }
 
index d965f180e80d0eff048f3a31de37924203db6a42..d4a85161be1d79bd27a88b32a89be3950804d9d2 100644 (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);
 
index edca09ff144511832a3c8565f8fce0b548c3dbb7..e8db05dc6bd149bb371229406d36c415cebdbc6e 100644 (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);
                        }
                }
index f9772ec9eddbd4c2210c486e2b1581ac91ba7bad..1dcf6125882f334e219eefac7529d15ab553f999 100644 (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);