likely fixes for problems loading templates with destructive tracks. Note that old...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 11 Apr 2006 03:15:57 +0000 (03:15 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 11 Apr 2006 03:15:57 +0000 (03:15 +0000)
git-svn-id: svn://localhost/trunk/ardour2@452 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/arval
libs/ardour/ardour/audio_track.h
libs/ardour/ardour/route.h
libs/ardour/audio_track.cc
libs/ardour/diskstream.cc

index 5254ad4df046587e3fd89968f650626e3eb9a487..dcbef15a0f4e32f17efa8f6504f84ef6dff51cc9 100755 (executable)
@@ -1,3 +1,3 @@
 #!/bin/sh
 source ardev_common.sh
-exec valgrind --num-callers=12 --tool=memcheck ./ardour.bin --novst $*
+exec valgrind --num-callers=15 --tool=memcheck ./ardour.bin --novst $*
index 4dae06eeffe19c77adb469d0b1dfe7b202b1bbf1..c7af9fc5d81794e0bf6651b9024b4d57677a75b2 100644 (file)
@@ -85,6 +85,7 @@ class AudioTrack : public Route
        void bounce_range (jack_nframes_t start, jack_nframes_t end, InterThreadInfo&);
 
        XMLNode& get_state();
+       XMLNode& get_template();
        int set_state(const XMLNode& node);
 
        MIDI::Controllable& midi_rec_enable_control() {
@@ -102,6 +103,8 @@ class AudioTrack : public Route
        MeterPoint _saved_meter_point;
        TrackMode _mode;
 
+       XMLNode& state (bool full);
+
        void passthru_silence (jack_nframes_t start_frame, jack_nframes_t end_frame, 
                               jack_nframes_t nframes, jack_nframes_t offset, int declick,
                               bool meter);
@@ -144,8 +147,6 @@ class AudioTrack : public Route
        sigc::connection recenable_connection;
        sigc::connection ic_connection;
 
-       XMLNode& state(bool);
-
        int deprecated_use_diskstream_connections ();
        void set_state_part_two ();
        void set_state_part_three ();
index b6cc90c42c77f8e8b770e3a1d3bcda975f6a8105..8a707eb902223099bf0a8080bda03e8325356ef6 100644 (file)
@@ -200,7 +200,7 @@ class Route : public IO
 
        XMLNode& get_state();
        int set_state(const XMLNode& node);
-       XMLNode& get_template();
+       virtual XMLNode& get_template();
 
        sigc::signal<void,void*> SelectedChanged;
 
index ae3d1719c7b144d132b9de40da9030be993f6526..702d167a4f56fbc8b01a114dd2bf703db398edbe 100644 (file)
@@ -243,24 +243,6 @@ AudioTrack::set_meter_point (MeterPoint p, void *src)
        Route::set_meter_point (p, src);
 }
 
-XMLNode&
-AudioTrack::state(bool full_state)
-{
-       XMLNode& track_state (Route::state (full_state));
-       char buf[64];
-
-       /* we don't return diskstream state because we don't
-          own the diskstream exclusively. control of the diskstream
-          state is ceded to the Session, even if we create the
-          diskstream.
-       */
-
-       snprintf (buf, sizeof (buf), "%" PRIu64, diskstream->id());
-       track_state.add_property ("diskstream-id", buf);
-
-       return track_state;
-}
-
 int
 AudioTrack::set_state (const XMLNode& node)
 {
@@ -363,10 +345,22 @@ AudioTrack::set_state (const XMLNode& node)
        return 0;
 }
 
+XMLNode&
+AudioTrack::get_template ()
+{
+       return state (false);
+}
+
+XMLNode&
+AudioTrack::get_state ()
+{
+       return state (true);
+}
+
 XMLNode& 
-AudioTrack::get_state()
+AudioTrack::state(bool full_state)
 {
-       XMLNode& root (Route::get_state());
+       XMLNode& root (Route::state(full_state));
        XMLNode* freeze_node;
        char buf[32];
 
@@ -441,6 +435,15 @@ AudioTrack::get_state()
                break;
        }
 
+       /* we don't return diskstream state because we don't
+          own the diskstream exclusively. control of the diskstream
+          state is ceded to the Session, even if we create the
+          diskstream.
+       */
+
+       snprintf (buf, sizeof (buf), "%" PRIu64, diskstream->id());
+       root.add_property ("diskstream-id", buf);
+
        return root;
 }
 
index 542ff29e9a7dd4b1c77d5205979b10f4f5affef5..66b719da868c9a9925231be9f6e833d0798beb59 100644 (file)
@@ -470,7 +470,8 @@ DiskStream::use_destructive_playlist ()
        Playlist::RegionList* rl = _playlist->regions_at (0);
 
        if (rl->empty()) {
-               throw failed_constructor();
+               reset_write_sources (false, true);
+               return;
        }
 
        AudioRegion* region = dynamic_cast<AudioRegion*> (rl->front());