id_t becomes a fully-fledged object, UUID's used for IDs, generic MIDI now owns bindi...
[ardour.git] / libs / ardour / crossfade.cc
index 5d36c63f011818558a33499f5fecc2bbdaecde9c..bbe0c63b0a0f5d0d308eabbc0de8d450848036f8 100644 (file)
@@ -112,7 +112,6 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
 {
        Region* r;
        XMLProperty* prop;
-       id_t id;
        LocaleGuard lg (X_("POSIX"));
 
        /* we have to find the in/out regions before we can do anything else */
@@ -122,7 +121,7 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
                throw failed_constructor();
        }
        
-       sscanf (prop->value().c_str(), "%" PRIu64, &id);
+       PBD::ID id (prop->value());
 
        if ((r = playlist.find_region (id)) == 0) {
                error << string_compose (_("Crossfade: no \"in\" region %1 found in playlist %2"), id, playlist.name())
@@ -139,10 +138,10 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
                throw failed_constructor();
        }
 
-       sscanf (prop->value().c_str(), "%" PRIu64, &id);
+       PBD::ID id2 (prop->value());
 
-       if ((r = playlist.find_region (id)) == 0) {
-               error << string_compose (_("Crossfade: no \"out\" region %1 found in playlist %2"), id, playlist.name())
+       if ((r = playlist.find_region (id2)) == 0) {
+               error << string_compose (_("Crossfade: no \"out\" region %1 found in playlist %2"), id2, playlist.name())
                      << endmsg;
                throw failed_constructor();
        }
@@ -680,9 +679,9 @@ Crossfade::get_state ()
        char buf[64];
        LocaleGuard lg (X_("POSIX"));
 
-       snprintf (buf, sizeof(buf), "%" PRIu64, _out->id());
+       _out->id().print (buf);
        node->add_property ("out", buf);
-       snprintf (buf, sizeof(buf), "%" PRIu64, _in->id());
+       _in->id().print (buf);
        node->add_property ("in", buf);
        node->add_property ("active", (_active ? "yes" : "no"));
        node->add_property ("follow-overlap", (_follow_overlap ? "yes" : "no"));