Don't try to load separate diskstreams in 3.0 session files. Fix a few uses of Diskstream outside Track.

git-svn-id: svn://localhost/ardour2/branches/3.0@6946 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-04-21 21:29:15 +00:00
parent 061a85191c
commit 950ac6ef2b
7 changed files with 47 additions and 27 deletions

View file

@ -42,8 +42,6 @@ class AudioTrack : public Track
int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
int declick, bool can_record, bool rec_monitors_input, bool& need_butler);
boost::shared_ptr<AudioDiskstream> audio_diskstream() const;
void use_new_diskstream ();
void set_diskstream (boost::shared_ptr<Diskstream>);
@ -60,6 +58,7 @@ class AudioTrack : public Track
boost::shared_ptr<AudioFileSource> write_source (uint32_t n = 0);
protected:
boost::shared_ptr<AudioDiskstream> audio_diskstream () const;
XMLNode& state (bool full);
int _set_state (const XMLNode&, int, bool call_base);

View file

@ -44,8 +44,6 @@ public:
void handle_transport_stopped (bool abort, bool did_locate, bool flush_processors);
boost::shared_ptr<MidiDiskstream> midi_diskstream() const;
void use_new_diskstream ();
void set_diskstream (boost::shared_ptr<Diskstream>);
@ -92,6 +90,10 @@ public:
void set_midi_thru (bool yn);
boost::shared_ptr<SMFSource> write_source (uint32_t n = 0);
void set_channel_mode (ChannelMode, uint16_t);
ChannelMode get_channel_mode ();
uint16_t get_channel_mask ();
boost::shared_ptr<MidiPlaylist> midi_playlist ();
protected:
XMLNode& state (bool full);
@ -99,6 +101,8 @@ protected:
int _set_state (const XMLNode&, int, bool call_base);
private:
boost::shared_ptr<MidiDiskstream> midi_diskstream () const;
void write_out_of_band_data (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
void set_state_part_two ();

View file

@ -570,7 +570,29 @@ MidiTrack::set_midi_thru (bool yn)
boost::shared_ptr<SMFSource>
MidiTrack::write_source (uint32_t n)
{
boost::shared_ptr<MidiDiskstream> ds = boost::dynamic_pointer_cast<MidiDiskstream> (_diskstream);
assert (ds);
return ds->write_source ();
return midi_diskstream()->write_source ();
}
void
MidiTrack::set_channel_mode (ChannelMode mode, uint16_t mask)
{
midi_diskstream()->set_channel_mode (mode, mask);
}
ChannelMode
MidiTrack::get_channel_mode ()
{
return midi_diskstream()->get_channel_mode ();
}
uint16_t
MidiTrack::get_channel_mask ()
{
return midi_diskstream()->get_channel_mask ();
}
boost::shared_ptr<MidiPlaylist>
MidiTrack::midi_playlist ()
{
return midi_diskstream()->midi_playlist ();
}

View file

@ -1461,7 +1461,7 @@ Session::new_midi_track (TrackMode mode, RouteGroup* route_group, uint32_t how_m
auto_connect_route (track, existing_inputs, existing_outputs);
track->midi_diskstream()->non_realtime_input_change();
track->non_realtime_input_change();
if (route_group) {
route_group->add (track);
}
@ -1630,7 +1630,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
route_group->add (track);
}
track->audio_diskstream()->non_realtime_input_change();
track->non_realtime_input_change();
track->DiskstreamChanged.connect_same_thread (*this, boost::bind (&Session::resort_routes, this));
track->set_remote_control_id (control_id);
@ -3327,7 +3327,7 @@ Session::write_one_track (AudioTrack& track, nframes_t start, nframes_t end,
boost::shared_ptr<AudioFileSource> fsource;
uint32_t x;
char buf[PATH_MAX+1];
ChanCount nchans(track.audio_diskstream()->n_channels());
ChanCount nchans(track.n_channels());
nframes_t position;
nframes_t this_chunk;
nframes_t to_do;

View file

@ -1300,11 +1300,13 @@ Session::set_state (const XMLNode& node, int version)
goto out;
}
if (version < 3000 && ((child = find_named_node (node, X_("DiskStreams"))) == 0)) {
error << _("Session: XML state has no diskstreams section") << endmsg;
goto out;
} else if (load_diskstreams_2X (*child, version)) {
goto out;
if (version < 3000) {
if ((child = find_named_node (node, X_("DiskStreams"))) == 0) {
error << _("Session: XML state has no diskstreams section") << endmsg;
goto out;
} else if (load_diskstreams_2X (*child, version)) {
goto out;
}
}
if ((child = find_named_node (node, "Routes")) == 0) {