fix up mess with unassigned Playlist::orig_track_id
git-svn-id: svn://localhost/ardour2/branches/3.0@10998 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
9f897d097a
commit
88d49cdb57
|
@ -42,7 +42,7 @@ class AudioTrack : public Track
|
|||
int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
|
||||
int declick, bool& need_butler);
|
||||
|
||||
void use_new_diskstream ();
|
||||
boost::shared_ptr<Diskstream> create_diskstream ();
|
||||
void set_diskstream (boost::shared_ptr<Diskstream>);
|
||||
|
||||
DataType data_type () const {
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
void realtime_handle_transport_stopped ();
|
||||
void realtime_locate ();
|
||||
|
||||
void use_new_diskstream ();
|
||||
boost::shared_ptr<Diskstream> create_diskstream ();
|
||||
void set_diskstream (boost::shared_ptr<Diskstream>);
|
||||
void set_record_enabled (bool yn, void *src);
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ public:
|
|||
void lower_region_to_bottom (boost::shared_ptr<Region>);
|
||||
|
||||
const PBD::ID& get_orig_track_id () const { return _orig_track_id; }
|
||||
void set_orig_track_id (const PBD::ID& did) { _orig_track_id = did; }
|
||||
void set_orig_track_id (const PBD::ID& did);
|
||||
|
||||
/* destructive editing */
|
||||
|
||||
|
|
|
@ -69,7 +69,8 @@ class Track : public Route, public PublicDiskstream
|
|||
|
||||
bool can_record();
|
||||
|
||||
virtual void use_new_diskstream () = 0;
|
||||
void use_new_diskstream ();
|
||||
virtual boost::shared_ptr<Diskstream> create_diskstream() = 0;
|
||||
virtual void set_diskstream (boost::shared_ptr<Diskstream>);
|
||||
|
||||
void set_latency_compensation (framecnt_t);
|
||||
|
|
|
@ -61,8 +61,8 @@ AudioTrack::~AudioTrack ()
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
AudioTrack::use_new_diskstream ()
|
||||
boost::shared_ptr<Diskstream>
|
||||
AudioTrack::create_diskstream ()
|
||||
{
|
||||
AudioDiskstream::Flag dflags = AudioDiskstream::Flag (0);
|
||||
|
||||
|
@ -78,13 +78,7 @@ AudioTrack::use_new_diskstream ()
|
|||
dflags = AudioDiskstream::Flag(dflags | AudioDiskstream::NonLayered);
|
||||
}
|
||||
|
||||
AudioDiskstream* dsp (new AudioDiskstream (_session, name(), dflags));
|
||||
boost::shared_ptr<AudioDiskstream> ds (dsp);
|
||||
|
||||
ds->do_refill_with_alloc ();
|
||||
ds->set_block_size (_session.get_block_size ());
|
||||
|
||||
set_diskstream (ds);
|
||||
return boost::shared_ptr<AudioDiskstream> (new AudioDiskstream (_session, name(), dflags));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -77,8 +77,8 @@ MidiTrack::init ()
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
MidiTrack::use_new_diskstream ()
|
||||
boost::shared_ptr<Diskstream>
|
||||
MidiTrack::create_diskstream ()
|
||||
{
|
||||
MidiDiskstream::Flag dflags = MidiDiskstream::Flag (0);
|
||||
|
||||
|
@ -90,13 +90,10 @@ MidiTrack::use_new_diskstream ()
|
|||
|
||||
assert(_mode != Destructive);
|
||||
|
||||
boost::shared_ptr<MidiDiskstream> ds (new MidiDiskstream (_session, name(), dflags));
|
||||
ds->do_refill_with_alloc ();
|
||||
ds->set_block_size (_session.get_block_size ());
|
||||
|
||||
set_diskstream (ds);
|
||||
return boost::shared_ptr<Diskstream> (new MidiDiskstream (_session, name(), dflags));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MidiTrack::set_record_enabled (bool yn, void *src)
|
||||
{
|
||||
|
|
|
@ -3391,3 +3391,9 @@ Playlist::count_joined_regions () const
|
|||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
void
|
||||
Playlist::set_orig_track_id (const PBD::ID& id)
|
||||
{
|
||||
_orig_track_id = id;
|
||||
}
|
||||
|
|
|
@ -67,6 +67,18 @@ Track::init ()
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
Track::use_new_diskstream ()
|
||||
{
|
||||
boost::shared_ptr<Diskstream> ds = create_diskstream ();
|
||||
|
||||
ds->do_refill_with_alloc ();
|
||||
ds->set_block_size (_session.get_block_size ());
|
||||
ds->playlist()->set_orig_track_id (id());
|
||||
|
||||
set_diskstream (ds);
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
Track::get_state ()
|
||||
{
|
||||
|
@ -692,7 +704,11 @@ Track::playlist_modified ()
|
|||
int
|
||||
Track::use_playlist (boost::shared_ptr<Playlist> p)
|
||||
{
|
||||
return _diskstream->use_playlist (p);
|
||||
int ret = _diskstream->use_playlist (p);
|
||||
if (ret == 0) {
|
||||
p->set_orig_track_id (id());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in New Issue