summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-04-21 20:42:22 +0000
committerCarl Hetherington <carl@carlh.net>2010-04-21 20:42:22 +0000
commit061a85191c301ac18f2e8ca59d43127a4499ba96 (patch)
tree469688f4dea1853c91372319a899b2efc71b30d5 /gtk2_ardour
parentd9cebc2edf8accded23c6f2a1caab73eb47a50fd (diff)
Move Diskstream ownership to Track, so that Session no longer holds lists of Diskstreams. Breaks 3.0 file format again.
git-svn-id: svn://localhost/ardour2/branches/3.0@6945 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui.cc8
-rw-r--r--gtk2_ardour/audio_region_view.cc9
-rw-r--r--gtk2_ardour/audio_streamview.cc52
-rw-r--r--gtk2_ardour/audio_streamview.h9
-rw-r--r--gtk2_ardour/audio_time_axis.cc1
-rw-r--r--gtk2_ardour/audio_time_axis.h1
-rw-r--r--gtk2_ardour/automation_streamview.cc4
-rw-r--r--gtk2_ardour/automation_streamview.h2
-rw-r--r--gtk2_ardour/editor.cc30
-rw-r--r--gtk2_ardour/editor.h1
-rw-r--r--gtk2_ardour/editor_audio_import.cc6
-rw-r--r--gtk2_ardour/editor_canvas.cc2
-rw-r--r--gtk2_ardour/editor_canvas_events.cc3
-rw-r--r--gtk2_ardour/editor_drag.cc16
-rw-r--r--gtk2_ardour/editor_export_audio.cc4
-rw-r--r--gtk2_ardour/editor_mouse.cc12
-rw-r--r--gtk2_ardour/editor_ops.cc44
-rw-r--r--gtk2_ardour/editor_routes.cc3
-rw-r--r--gtk2_ardour/editor_selection.cc13
-rw-r--r--gtk2_ardour/editor_timefx.cc5
-rw-r--r--gtk2_ardour/midi_region_view.cc9
-rw-r--r--gtk2_ardour/midi_streamview.cc29
-rw-r--r--gtk2_ardour/midi_streamview.h5
-rw-r--r--gtk2_ardour/midi_time_axis.cc9
-rw-r--r--gtk2_ardour/mixer_strip.cc2
-rw-r--r--gtk2_ardour/mixer_ui.cc1
-rw-r--r--gtk2_ardour/mixer_ui.h1
-rw-r--r--gtk2_ardour/playlist_selector.cc38
-rw-r--r--gtk2_ardour/playlist_selector.h4
-rw-r--r--gtk2_ardour/processor_box.cc1
-rw-r--r--gtk2_ardour/route_time_axis.cc147
-rw-r--r--gtk2_ardour/route_time_axis.h2
-rw-r--r--gtk2_ardour/route_ui.cc16
-rw-r--r--gtk2_ardour/route_ui.h2
-rw-r--r--gtk2_ardour/streamview.cc56
-rw-r--r--gtk2_ardour/streamview.h12
-rw-r--r--gtk2_ardour/tape_region_view.cc1
-rw-r--r--gtk2_ardour/time_fx_dialog.cc1
38 files changed, 257 insertions, 304 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 0944686f4e..2613faa11e 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -934,7 +934,7 @@ void
ARDOUR_UI::count_recenabled_streams (Route& route)
{
Track* track = dynamic_cast<Track*>(&route);
- if (track && track->diskstream()->record_enabled()) {
+ if (track && track->record_enabled()) {
rec_enabled_streams += track->n_inputs().n_total();
}
}
@@ -1701,7 +1701,7 @@ ARDOUR_UI::toggle_record_enable (uint32_t dstream)
Track* t;
if ((t = dynamic_cast<Track*>(r.get())) != 0) {
- t->diskstream()->set_record_enabled (!t->diskstream()->record_enabled());
+ t->set_record_enabled (!t->record_enabled());
}
}
if (_session == 0) {
@@ -2102,7 +2102,7 @@ ARDOUR_UI::transport_rec_enable_blink (bool onoff)
}
Session::RecordState const r = _session->record_status ();
- bool const h = _session->have_rec_enabled_diskstream ();
+ bool const h = _session->have_rec_enabled_track ();
if (r == Session::Enabled || (r == Session::Recording && !h)) {
if (onoff) {
@@ -3399,7 +3399,7 @@ ARDOUR_UI::record_state_changed ()
}
Session::RecordState const r = _session->record_status ();
- bool const h = _session->have_rec_enabled_diskstream ();
+ bool const h = _session->have_rec_enabled_track ();
if (r == Session::Recording && h) {
big_clock.set_widget_name ("BigClockRecording");
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index 13e21b9a63..394751b88c 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -27,7 +27,6 @@
#include "ardour/playlist.h"
#include "ardour/audioregion.h"
#include "ardour/audiosource.h"
-#include "ardour/audio_diskstream.h"
#include "ardour/profile.h"
#include "ardour/session.h"
@@ -847,11 +846,11 @@ AudioRegionView::create_waves ()
// cerr << "AudioRegionView::create_waves() called on " << this << endl;//DEBUG
RouteTimeAxisView& atv (*(dynamic_cast<RouteTimeAxisView*>(&trackview))); // ick
- if (!atv.get_diskstream()) {
+ if (!atv.track()) {
return;
}
- ChanCount nchans = atv.get_diskstream()->n_channels();
+ ChanCount nchans = atv.track()->n_channels();
// cerr << "creating waves for " << _region->name() << " with wfd = " << wait_for_data
// << " and channels = " << nchans.n_audio() << endl;
@@ -894,7 +893,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
{
//cerr << "AudioRegionView::create_one_wave() called which: " << which << " this: " << this << endl;//DEBUG
RouteTimeAxisView& atv (*(dynamic_cast<RouteTimeAxisView*>(&trackview))); // ick
- uint32_t nchans = atv.get_diskstream()->n_channels().n_audio();
+ uint32_t nchans = atv.track()->n_channels().n_audio();
uint32_t n;
uint32_t nwaves = std::min (nchans, audio_region()->n_channels());
gdouble ht;
@@ -1163,7 +1162,7 @@ AudioRegionView::add_ghost (TimeAxisView& tv)
AudioGhostRegion* ghost = new AudioGhostRegion (tv, trackview, unit_position);
uint32_t nchans;
- nchans = rtv->get_diskstream()->n_channels().n_audio();
+ nchans = rtv->track()->n_channels().n_audio();
for (uint32_t n = 0; n < nchans; ++n) {
diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc
index 80498f5a7e..7c76cd7876 100644
--- a/gtk2_ardour/audio_streamview.cc
+++ b/gtk2_ardour/audio_streamview.cc
@@ -29,7 +29,6 @@
#include "ardour/audioplaylist.h"
#include "ardour/audioregion.h"
#include "ardour/audiofilesource.h"
-#include "ardour/audio_diskstream.h"
#include "ardour/audio_track.h"
#include "ardour/source.h"
#include "ardour/region_factory.h"
@@ -230,9 +229,9 @@ AudioStreamView::remove_region_view (boost::weak_ptr<Region> weak_r)
}
void
-AudioStreamView::undisplay_diskstream ()
+AudioStreamView::undisplay_track ()
{
- StreamView::undisplay_diskstream();
+ StreamView::undisplay_track ();
for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
delete i->second;
@@ -242,15 +241,15 @@ AudioStreamView::undisplay_diskstream ()
}
void
-AudioStreamView::playlist_layered (boost::weak_ptr<Diskstream> wds)
+AudioStreamView::playlist_layered (boost::weak_ptr<Track> wtr)
{
- boost::shared_ptr<Diskstream> ds (wds.lock());
+ boost::shared_ptr<Track> tr (wtr.lock());
- if (!ds) {
+ if (!tr) {
return;
}
- StreamView::playlist_layered (wds);
+ StreamView::playlist_layered (wtr);
/* make sure xfades are on top and all the regionviews are stacked correctly. */
@@ -260,19 +259,19 @@ AudioStreamView::playlist_layered (boost::weak_ptr<Diskstream> wds)
}
void
-AudioStreamView::playlist_switched (boost::weak_ptr<Diskstream> wds)
+AudioStreamView::playlist_switched (boost::weak_ptr<Track> wtr)
{
- boost::shared_ptr<Diskstream> ds (wds.lock());
+ boost::shared_ptr<Track> tr (wtr.lock());
- if (!ds) {
+ if (!tr) {
return;
}
playlist_connections.drop_connections ();
- StreamView::playlist_switched (ds);
+ StreamView::playlist_switched (tr);
- boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(ds->playlist());
+ boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist> (tr->playlist());
if (apl) {
apl->NewCrossfade.connect (playlist_connections, invalidator (*this), ui_bind (&AudioStreamView::add_crossfade, this, _1), gui_context());
@@ -350,7 +349,7 @@ AudioStreamView::remove_crossfade (boost::shared_ptr<Region> r)
}
void
-AudioStreamView::redisplay_diskstream ()
+AudioStreamView::redisplay_track ()
{
list<RegionView *>::iterator i;
CrossfadeViewList::iterator xi, tmpx;
@@ -372,12 +371,12 @@ AudioStreamView::redisplay_diskstream ()
// Add and display region and crossfade views, and flag them as valid
if (_trackview.is_audio_track()) {
- _trackview.get_diskstream()->playlist()->foreach_region(
+ _trackview.track()->playlist()->foreach_region(
sigc::hide_return (sigc::mem_fun (*this, &StreamView::add_region_view))
);
boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(
- _trackview.get_diskstream()->playlist()
+ _trackview.track()->playlist()
);
if (apl) {
@@ -445,7 +444,7 @@ AudioStreamView::setup_rec_box ()
if (!rec_active &&
_trackview.session()->record_status() == Session::Recording &&
- _trackview.get_diskstream()->record_enabled()) {
+ _trackview.track()->record_enabled()) {
if (_trackview.audio_track()->mode() == Normal && Config->get_show_waveforms_while_recording() && rec_regions.size() == rec_rects.size()) {
/* add a new region, but don't bother if they set show-waveforms-while-recording mid-record */
@@ -453,10 +452,10 @@ AudioStreamView::setup_rec_box ()
SourceList sources;
rec_data_ready_connections.drop_connections ();
- boost::shared_ptr<AudioDiskstream> ads = _trackview.audio_track()->audio_diskstream();
+ boost::shared_ptr<AudioTrack> tr = _trackview.audio_track();
- for (uint32_t n=0; n < ads->n_channels().n_audio(); ++n) {
- boost::shared_ptr<AudioFileSource> src = ads->write_source (n);
+ for (uint32_t n = 0; n < tr->n_channels().n_audio(); ++n) {
+ boost::shared_ptr<AudioFileSource> src = tr->write_source (n);
if (src) {
sources.push_back (src);
src->PeakRangeReady.connect (rec_data_ready_connections,
@@ -471,7 +470,7 @@ AudioStreamView::setup_rec_box ()
nframes_t start = 0;
if (rec_regions.size() > 0) {
start = rec_regions.back().first->start()
- + _trackview.get_diskstream()->get_captured_frames(rec_regions.size()-1);
+ + _trackview.track()->get_captured_frames(rec_regions.size()-1);
}
PropertyList plist;
@@ -495,8 +494,7 @@ AudioStreamView::setup_rec_box ()
boost::shared_ptr<AudioTrack> at;
at = _trackview.audio_track(); /* we know what it is already */
- boost::shared_ptr<AudioDiskstream> ds = at->audio_diskstream();
- nframes_t frame_pos = ds->current_capture_start ();
+ nframes_t frame_pos = at->current_capture_start ();
gdouble xstart = _trackview.editor().frame_to_pixel (frame_pos);
gdouble xend;
uint32_t fill_color;
@@ -543,7 +541,7 @@ AudioStreamView::setup_rec_box ()
} else if (rec_active &&
(_trackview.session()->record_status() != Session::Recording ||
- !_trackview.get_diskstream()->record_enabled())) {
+ !_trackview.track()->record_enabled())) {
screen_update_connection.disconnect();
rec_active = false;
rec_updating = false;
@@ -617,7 +615,7 @@ AudioStreamView::rec_peak_range_ready (nframes_t start, nframes_t cnt, boost::we
rec_data_ready_map[src] = true;
- if (rec_data_ready_map.size() == _trackview.get_diskstream()->n_channels().n_audio()) {
+ if (rec_data_ready_map.size() == _trackview.track()->n_channels().n_audio()) {
this->update_rec_regions ();
rec_data_ready_map.clear();
}
@@ -658,7 +656,7 @@ AudioStreamView::update_rec_regions ()
if (nlen != region->length()) {
region->suspend_property_changes ();
- region->set_position (_trackview.get_diskstream()->get_capture_start_frame(n), this);
+ region->set_position (_trackview.track()->get_capture_start_frame(n), this);
region->set_length (nlen, this);
region->resume_property_changes ();
@@ -676,14 +674,14 @@ AudioStreamView::update_rec_regions ()
} else {
- nframes_t nlen = _trackview.get_diskstream()->get_captured_frames(n);
+ nframes_t nlen = _trackview.track()->get_captured_frames(n);
if (nlen != region->length()) {
if (region->source_length(0) >= region->start() + nlen) {
region->suspend_property_changes ();
- region->set_position (_trackview.get_diskstream()->get_capture_start_frame(n), this);
+ region->set_position (_trackview.track()->get_capture_start_frame(n), this);
region->set_length (nlen, this);
region->resume_property_changes ();
diff --git a/gtk2_ardour/audio_streamview.h b/gtk2_ardour/audio_streamview.h
index 1443bd5b8f..93c74c5bb2 100644
--- a/gtk2_ardour/audio_streamview.h
+++ b/gtk2_ardour/audio_streamview.h
@@ -36,7 +36,6 @@ namespace Gdk {
namespace ARDOUR {
class Route;
- class Diskstream;
class Crossfade;
class PeakData;
class AudioRegion;
@@ -85,10 +84,10 @@ class AudioStreamView : public StreamView
void remove_region_view (boost::weak_ptr<ARDOUR::Region> );
void remove_audio_region_view (boost::shared_ptr<ARDOUR::AudioRegion> );
- void undisplay_diskstream ();
- void redisplay_diskstream ();
- void playlist_layered (boost::weak_ptr<ARDOUR::Diskstream>);
- void playlist_switched (boost::weak_ptr<ARDOUR::Diskstream>);
+ void undisplay_track ();
+ void redisplay_track ();
+ void playlist_layered (boost::weak_ptr<ARDOUR::Track>);
+ void playlist_switched (boost::weak_ptr<ARDOUR::Track>);
void add_crossfade (boost::weak_ptr<ARDOUR::Crossfade>);
void remove_crossfade (boost::shared_ptr<ARDOUR::Region>);
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index 192c9ffdcb..4a53b6fabd 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -38,7 +38,6 @@
#include <gtkmm2ext/utils.h>
#include "ardour/amp.h"
-#include "ardour/audio_diskstream.h"
#include "ardour/audioplaylist.h"
#include "ardour/event_type_map.h"
#include "ardour/location.h"
diff --git a/gtk2_ardour/audio_time_axis.h b/gtk2_ardour/audio_time_axis.h
index 80450e9f61..513627e095 100644
--- a/gtk2_ardour/audio_time_axis.h
+++ b/gtk2_ardour/audio_time_axis.h
@@ -42,7 +42,6 @@
namespace ARDOUR {
class Session;
- class AudioDiskstream;
class RouteGroup;
class IOProcessor;
class Processor;
diff --git a/gtk2_ardour/automation_streamview.cc b/gtk2_ardour/automation_streamview.cc
index 90cc96414f..e861522fd7 100644
--- a/gtk2_ardour/automation_streamview.cc
+++ b/gtk2_ardour/automation_streamview.cc
@@ -152,7 +152,7 @@ AutomationStreamView::set_automation_state (AutoState state)
}
void
-AutomationStreamView::redisplay_diskstream ()
+AutomationStreamView::redisplay_track ()
{
list<RegionView *>::iterator i, tmp;
@@ -164,7 +164,7 @@ AutomationStreamView::redisplay_diskstream ()
// Add and display region views, and flag them as valid
if (_trackview.is_track()) {
- _trackview.get_diskstream()->playlist()->foreach_region (
+ _trackview.track()->playlist()->foreach_region (
sigc::hide_return (sigc::mem_fun (*this, &StreamView::add_region_view))
);
}
diff --git a/gtk2_ardour/automation_streamview.h b/gtk2_ardour/automation_streamview.h
index de54ea58a9..37f13774a4 100644
--- a/gtk2_ardour/automation_streamview.h
+++ b/gtk2_ardour/automation_streamview.h
@@ -47,7 +47,7 @@ class AutomationStreamView : public StreamView
void set_automation_state (ARDOUR::AutoState state);
- void redisplay_diskstream ();
+ void redisplay_track ();
inline double contents_height() const {
return (_trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2);
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index bb8996ba93..630499a9c4 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -1358,7 +1358,7 @@ Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type,
break;
case StreamItem:
- if (clicked_routeview->get_diskstream()) {
+ if (clicked_routeview->track()) {
build_menu_function = &Editor::build_track_context_menu;
} else {
build_menu_function = &Editor::build_track_bus_context_menu;
@@ -1480,11 +1480,11 @@ Editor::build_track_region_context_menu (nframes64_t frame)
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (clicked_axisview);
if (rtv) {
- boost::shared_ptr<Diskstream> ds;
+ boost::shared_ptr<Track> tr;
boost::shared_ptr<Playlist> pl;
- if ((ds = rtv->get_diskstream()) && ((pl = ds->playlist()))) {
- Playlist::RegionList* regions = pl->regions_at ((nframes64_t) floor ( (double)frame * ds->speed()));
+ if ((tr = rtv->track()) && ((pl = tr->playlist()))) {
+ Playlist::RegionList* regions = pl->regions_at ((nframes64_t) floor ( (double)frame * tr->speed()));
if (selection->regions.size() > 1) {
// there's already a multiple selection: just add a
@@ -1517,11 +1517,11 @@ Editor::build_track_crossfade_context_menu (nframes64_t frame)
AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*> (clicked_axisview);
if (atv) {
- boost::shared_ptr<Diskstream> ds;
+ boost::shared_ptr<Track> tr;
boost::shared_ptr<Playlist> pl;
boost::shared_ptr<AudioPlaylist> apl;
- if ((ds = atv->get_diskstream()) && ((pl = ds->playlist()) != 0) && ((apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl)) != 0)) {
+ if ((tr = atv->track()) && ((pl = tr->playlist()) != 0) && ((apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl)) != 0)) {
Playlist::RegionList* regions = pl->regions_at (frame);
AudioPlaylist::Crossfades xfades;
@@ -4537,13 +4537,13 @@ Editor::get_regions_at (RegionSelection& rs, nframes64_t where, const TrackViewL
for (TrackViewList::const_iterator t = tracks->begin(); t != tracks->end(); ++t) {
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(*t);
if (rtv) {
- boost::shared_ptr<Diskstream> ds;
+ boost::shared_ptr<Track> tr;
boost::shared_ptr<Playlist> pl;
- if ((ds = rtv->get_diskstream()) && ((pl = ds->playlist()))) {
+ if ((tr = rtv->track()) && ((pl = tr->playlist()))) {
Playlist::RegionList* regions = pl->regions_at (
- (nframes64_t) floor ( (double)where * ds->speed()));
+ (nframes64_t) floor ( (double)where * tr->speed()));
for (Playlist::RegionList::iterator i = regions->begin(); i != regions->end(); ++i) {
RegionView* rv = rtv->view()->find_view (*i);
@@ -4572,13 +4572,13 @@ Editor::get_regions_after (RegionSelection& rs, nframes64_t where, const TrackVi
for (TrackViewList::const_iterator t = tracks->begin(); t != tracks->end(); ++t) {
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(*t);
if (rtv) {
- boost::shared_ptr<Diskstream> ds;
+ boost::shared_ptr<Track> tr;
boost::shared_ptr<Playlist> pl;
- if ((ds = rtv->get_diskstream()) && ((pl = ds->playlist()))) {
+ if ((tr = rtv->track()) && ((pl = tr->playlist()))) {
Playlist::RegionList* regions = pl->regions_touched (
- (nframes64_t) floor ( (double)where * ds->speed()), max_frames);
+ (nframes64_t) floor ( (double)where * tr->speed()), max_frames);
for (Playlist::RegionList::iterator i = regions->begin(); i != regions->end(); ++i) {
@@ -4650,14 +4650,14 @@ Editor::get_regions_corresponding_to (boost::shared_ptr<Region> region, vector<R
boost::shared_ptr<Playlist> pl;
vector<boost::shared_ptr<Region> > results;
RegionView* marv;
- boost::shared_ptr<Diskstream> ds;
+ boost::shared_ptr<Track> tr;
- if ((ds = tatv->get_diskstream()) == 0) {
+ if ((tr = tatv->track()) == 0) {
/* bus */
continue;
}
- if ((pl = (ds->playlist())) != 0) {
+ if ((pl = (tr->playlist())) != 0) {
pl->get_region_list_equivalent_regions (region, results);
}
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index ca12393b3e..ebd735e335 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -76,7 +76,6 @@ namespace Gtkmm2ext {
}
namespace ARDOUR {
- class AudioDiskstream;
class RouteGroup;
class Playlist;
class AudioPlaylist;
diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc
index e7572ce8c1..119ea3bc51 100644
--- a/gtk2_ardour/editor_audio_import.cc
+++ b/gtk2_ardour/editor_audio_import.cc
@@ -852,7 +852,7 @@ Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t
}
}
- boost::shared_ptr<Playlist> playlist = existing_track->diskstream()->playlist();
+ boost::shared_ptr<Playlist> playlist = existing_track->playlist();
boost::shared_ptr<Region> copy (RegionFactory::create (region, region->properties()));
begin_reversible_command (_("insert file"));
playlist->clear_history ();
@@ -887,7 +887,7 @@ Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t
}
boost::shared_ptr<Region> copy (RegionFactory::create (region));
- existing_track->diskstream()->playlist()->add_region (copy, pos);
+ existing_track->playlist()->add_region (copy, pos);
break;
}
@@ -901,7 +901,7 @@ Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t
if (!at.empty()) {
boost::shared_ptr<Region> copy (RegionFactory::create (region));
at.front()->set_name (basename_nosuffix (copy->name()));
- at.front()->diskstream()->playlist()->add_region (copy, pos);
+ at.front()->playlist()->add_region (copy, pos);
}
break;
}
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index 4ea6d27ea2..757445114f 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -480,7 +480,7 @@ Editor::drop_paths_part_two (const vector<ustring>& paths, nframes64_t frame, do
/* check that its an audio track, not a bus */
- if (tv->get_diskstream()) {
+ if (tv->track()) {
/* select the track, then embed/import */
selection->set (tv);
diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc
index 93402c7854..a670543512 100644
--- a/gtk2_ardour/editor_canvas_events.cc
+++ b/gtk2_ardour/editor_canvas_events.cc
@@ -24,7 +24,6 @@
#include "pbd/stacktrace.h"
-#include "ardour/audio_diskstream.h"
#include "ardour/audioplaylist.h"
#include "ardour/audioregion.h"
#include "ardour/region_factory.h"
@@ -587,7 +586,7 @@ Editor::canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item* item,
if (atv->is_audio_track()) {
boost::shared_ptr<AudioPlaylist> pl;
- if ((pl = boost::dynamic_pointer_cast<AudioPlaylist> (atv->get_diskstream()->playlist())) != 0) {
+ if ((pl = boost::dynamic_pointer_cast<AudioPlaylist> (atv->track()->playlist())) != 0) {
Playlist::RegionList* rl = pl->regions_at (event_frame (event));
if (!rl->empty()) {
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 8d6838eb76..d9da60e0c8 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -22,11 +22,9 @@
#include "pbd/memento_command.h"
#include "pbd/basename.h"
#include "pbd/stateful_diff_command.h"
-#include "ardour/diskstream.h"
#include "ardour/session.h"
#include "ardour/dB.h"
#include "ardour/region_factory.h"
-#include "ardour/midi_diskstream.h"
#include "editor.h"
#include "i18n.h"
#include "keyboard.h"
@@ -826,7 +824,7 @@ void
RegionMoveDrag::finished (GdkEvent* /*event*/, bool movement_occurred)
{
vector<RegionView*> copies;
- boost::shared_ptr<Diskstream> ds;
+ boost::shared_ptr<Track> tr;
boost::shared_ptr<Playlist> from_playlist;
boost::shared_ptr<Playlist> to_playlist;
RegionSelection new_views;
@@ -1016,11 +1014,11 @@ RegionMoveDrag::finished (GdkEvent* /*event*/, bool movement_occurred)
*/
source_tv = dynamic_cast<RouteTimeAxisView*> (&rv->get_time_axis_view());
- ds = source_tv->get_diskstream();
- from_playlist = ds->playlist();
+ tr = source_tv->track();
+ from_playlist = tr->playlist();
assert (source_tv);
- assert (ds);
+ assert (tr);
assert (from_playlist);
/* moved to a different audio track, without copying */
@@ -1370,7 +1368,7 @@ RegionMoveDrag::RegionMoveDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p,
double speed = 1;
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv);
if (rtv && rtv->is_track()) {
- speed = rtv->get_diskstream()->speed ();
+ speed = rtv->track()->speed ();
}
_last_frame_position = static_cast<nframes64_t> (_primary->region()->position() / speed);
@@ -1697,7 +1695,7 @@ TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor *)
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
if (tv && tv->is_track()) {
- speed = tv->get_diskstream()->speed();
+ speed = tv->track()->speed();
}
nframes64_t region_start = (nframes64_t) (_primary->region()->position() / speed);
@@ -1754,7 +1752,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
if (tv && tv->is_track()) {
- speed = tv->get_diskstream()->speed();
+ speed = tv->track()->speed();
}
nframes64_t const pf = adjusted_current_frame (event);
diff --git a/gtk2_ardour/editor_export_audio.cc b/gtk2_ardour/editor_export_audio.cc
index 7d0fcc1bf9..1af4fc4764 100644
--- a/gtk2_ardour/editor_export_audio.cc
+++ b/gtk2_ardour/editor_export_audio.cc
@@ -297,9 +297,9 @@ Editor::write_audio_selection (TimeSelection& ts)
if (atv->is_audio_track()) {
- boost::shared_ptr<AudioPlaylist> playlist = boost::dynamic_pointer_cast<AudioPlaylist>(atv->get_diskstream()->playlist());
+ boost::shared_ptr<AudioPlaylist> playlist = boost::dynamic_pointer_cast<AudioPlaylist>(atv->track()->playlist());
- if (playlist && write_audio_range (*playlist, atv->get_diskstream()->n_channels(), ts) == 0) {
+ if (playlist && write_audio_range (*playlist, atv->track()->n_channels(), ts) == 0) {
ret = -1;
break;
}
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index a67406f93c..479ffd9933 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -777,7 +777,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
if (rtv && _join_object_range_state == JOIN_OBJECT_RANGE_OBJECT) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> (rtv->route ());
if (t) {
- boost::shared_ptr<Playlist> pl = t->diskstream()->playlist ();
+ boost::shared_ptr<Playlist> pl = t->playlist ();
if (pl) {
boost::shared_ptr<Region> r = pl->top_region_at (event_frame (event));
@@ -1927,7 +1927,7 @@ Editor::region_view_item_click (AudioRegionView& rv, GdkEventButton* event)
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(tv);
double speed = 1.0;
if (rtv && rtv->is_track()) {
- speed = rtv->get_diskstream()->speed();
+ speed = rtv->track()->speed();
}
nframes64_t where = get_preferred_edit_position();
@@ -2131,7 +2131,7 @@ Editor::single_contents_trim (RegionView& rv, nframes64_t frame_delta, bool left
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
if (tv && tv->is_track()) {
- speed = tv->get_diskstream()->speed();
+ speed = tv->track()->speed();
}
if (left_direction) {
@@ -2171,7 +2171,7 @@ Editor::single_start_trim (RegionView& rv, nframes64_t frame_delta, bool left_di
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
if (tv && tv->is_track()) {
- speed = tv->get_diskstream()->speed();
+ speed = tv->track()->speed();
}
if (left_direction) {
@@ -2226,7 +2226,7 @@ Editor::single_end_trim (RegionView& rv, nframes64_t frame_delta, bool left_dire
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
if (tv && tv->is_track()) {
- speed = tv->get_diskstream()->speed();
+ speed = tv->track()->speed();
}
if (left_direction) {
@@ -2442,7 +2442,7 @@ Editor::mouse_brush_insert_region (RegionView* rv, nframes64_t pos)
}
boost::shared_ptr<Playlist> playlist = rtv->playlist();
- double speed = rtv->get_diskstream()->speed();
+ double speed = rtv->track()->speed();
playlist->clear_history ();
boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region()));
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index a38998ba73..7f3aa7f7a8 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -637,8 +637,8 @@ Editor::build_region_boundary_cache ()
RouteTimeAxisView *rtav;
if (ontrack != 0 && (rtav = dynamic_cast<RouteTimeAxisView*>(ontrack)) != 0 ) {
- if (rtav->get_diskstream() != 0) {
- speed = rtav->get_diskstream()->speed();
+ if (rtav->track() != 0) {
+ speed = rtav->track()->speed();
}
}
@@ -692,8 +692,8 @@ Editor::find_next_region (nframes64_t frame, RegionPoint point, int32_t dir, Tra
track_speed = 1.0f;
if ( (rtav = dynamic_cast<RouteTimeAxisView*>(*i)) != 0 ) {
- if (rtav->get_diskstream()!=0)
- track_speed = rtav->get_diskstream()->speed();
+ if (rtav->track()!=0)
+ track_speed = rtav->track()->speed();
}
track_frame = session_frame_to_track_frame(frame, track_speed);
@@ -893,8 +893,8 @@ Editor::cursor_to_region_point (EditorCursor* cursor, RegionPoint point, int32_t
RouteTimeAxisView *rtav;
if ( ontrack != 0 && (rtav = dynamic_cast<RouteTimeAxisView*>(ontrack)) != 0 ) {
- if (rtav->get_diskstream() != 0) {
- speed = rtav->get_diskstream()->speed();
+ if (rtav->track() != 0) {
+ speed = rtav->track()->speed();
}
}
@@ -1090,8 +1090,8 @@ Editor::selected_marker_to_region_point (RegionPoint point, int32_t dir)
RouteTimeAxisView *rtav;
if (ontrack != 0 && (rtav = dynamic_cast<RouteTimeAxisView*>(ontrack)) != 0) {
- if (rtav->get_diskstream() != 0) {
- speed = rtav->get_diskstream()->speed();
+ if (rtav->track() != 0) {
+ speed = rtav->track()->speed();
}
}
@@ -2782,7 +2782,7 @@ Editor::separate_regions_between (const TimeSelection& ts)
/* no edits to destructive tracks */
- if (rtv->track()->diskstream()->destructive()) {
+ if (rtv->track()->destructive()) {
continue;
}
@@ -2792,7 +2792,7 @@ Editor::separate_regions_between (const TimeSelection& ts)
/* XXX need to consider musical time selections here at some point */
- double speed = rtv->get_diskstream()->speed();
+ double speed = rtv->track()->speed();
for (list<AudioRange>::const_iterator t = ts.begin(); t != ts.end(); ++t) {
@@ -2939,7 +2939,7 @@ Editor::crop_region_to (nframes64_t start, nframes64_t end)
boost::shared_ptr<Track> t = rtv->track();
- if (t != 0 && ! t->diskstream()->destructive()) {
+ if (t != 0 && ! t->destructive()) {
if ((playlist = rtv->playlist()) != 0) {
playlists.push_back (playlist);
@@ -3411,8 +3411,8 @@ Editor::trim_region_to_location (const Location& loc, const char* str)
nframes64_t start;
nframes64_t end;
- if (tav->get_diskstream() != 0) {
- speed = tav->get_diskstream()->speed();
+ if (tav->track() != 0) {
+ speed = tav->track()->speed();
}
start = session_frame_to_track_frame (loc.start(), speed);
@@ -3452,8 +3452,8 @@ Editor::trim_region_to_edit_point ()
float speed = 1.0;
- if (tav->get_diskstream() != 0) {
- speed = tav->get_diskstream()->speed();
+ if (tav->track() != 0) {
+ speed = tav->track()->speed();
}
rv->region()->clear_history ();
@@ -3490,8 +3490,8 @@ Editor::trim_region_from_edit_point ()
float speed = 1.0;
- if (tav->get_diskstream() != 0) {
- speed = tav->get_diskstream()->speed();
+ if (tav->track() != 0) {
+ speed = tav->track()->speed();
}
rv->region()->clear_history ();
@@ -3541,8 +3541,8 @@ Editor::trim_to_region(bool forward)
float speed = 1.0;
- if (atav->get_diskstream() != 0) {
- speed = atav->get_diskstream()->speed();
+ if (atav->track() != 0) {
+ speed = atav->track()->speed();
}
@@ -5937,9 +5937,9 @@ Editor::tab_to_transient (bool forward)
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*t);
if (rtv) {
- boost::shared_ptr<Diskstream> ds = rtv->get_diskstream();
- if (ds) {
- boost::shared_ptr<Playlist> pl = rtv->get_diskstream()->playlist ();
+ boost::shared_ptr<Track> tr = rtv->track();
+ if (tr) {
+ boost::shared_ptr<Playlist> pl = tr->playlist ();
if (pl) {
nframes64_t result = pl->find_next_transient (pos, forward ? 1 : -1);
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc
index b9ed2a935f..3d5cb3522c 100644
--- a/gtk2_ardour/editor_routes.cc
+++ b/gtk2_ardour/editor_routes.cc
@@ -24,7 +24,6 @@
#include <cmath>
#include <cassert>
-#include "ardour/diskstream.h"
#include "ardour/session.h"
#include "editor.h"
@@ -458,7 +457,7 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes)
if ((*x)->is_track()) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> ((*x)->route());
- t->diskstream()->RecordEnableChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_rec_display, this), gui_context());
+ t->RecordEnableChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_rec_display, this), gui_context());
}
(*x)->route()->mute_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_mute_display, this), gui_context());
diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc
index e8feb7c085..fda5155e03 100644
--- a/gtk2_ardour/editor_selection.cc
+++ b/gtk2_ardour/editor_selection.cc
@@ -23,7 +23,6 @@
#include "pbd/stacktrace.h"
#include "ardour/session.h"
-#include "ardour/diskstream.h"
#include "ardour/playlist.h"
#include "ardour/route_group.h"
#include "ardour/profile.h"
@@ -329,9 +328,9 @@ Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t, RegionVi
boost::shared_ptr<Playlist> pl;
vector<boost::shared_ptr<Region> > results;
RegionView* marv;
- boost::shared_ptr<Diskstream> ds;
+ boost::shared_ptr<Track> tr;
- if ((ds = tv.get_diskstream()) == 0) {
+ if ((tr = tv.track()) == 0) {
/* bus */
return;
}
@@ -341,7 +340,7 @@ Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t, RegionVi
return;
}
- if ((pl = ds->playlist()) != 0) {
+ if ((pl = tr->playlist()) != 0) {
pl->get_equivalent_regions (basis->region(), results);
}
@@ -401,14 +400,14 @@ Editor::get_regionview_count_from_region_list (boost::shared_ptr<Region> region)
boost::shared_ptr<Playlist> pl;
vector<boost::shared_ptr<Region> > results;
RegionView* marv;
- boost::shared_ptr<Diskstream> ds;
+ boost::shared_ptr<Track> tr;
- if ((ds = tatv->get_diskstream()) == 0) {
+ if ((tr = tatv->track()) == 0) {
/* bus */
continue;
}
- if ((pl = (ds->playlist())) != 0) {
+ if ((pl = (tr->playlist())) != 0) {
pl->get_region_list_equivalent_regions (region, results);
}
diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc
index fcd7e9baf4..6a1f0d021a 100644
--- a/gtk2_ardour/editor_timefx.cc
+++ b/gtk2_ardour/editor_timefx.cc
@@ -41,7 +41,6 @@
#include "ardour/audioplaylist.h"
#include "ardour/audio_track.h"
#include "ardour/audioregion.h"
-#include "ardour/audio_diskstream.h"
#include "ardour/stretch.h"
#include "ardour/midi_stretch.h"
#include "ardour/pitch.h"
@@ -74,7 +73,7 @@ Editor::time_stretch (RegionSelection& regions, float fraction)
return -1;
boost::shared_ptr<Playlist> playlist
- = rtv->track()->diskstream()->playlist();
+ = rtv->track()->playlist();
ARDOUR::TimeFXRequest request;
request.time_fraction = fraction;
@@ -277,7 +276,7 @@ Editor::do_timefx (TimeFXDialog& dialog)
continue;
}
- if ((playlist = t->diskstream()->playlist()) == 0) {
+ if ((playlist = t->playlist()) == 0) {
i = tmp;
continue;
}
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index 91538cebea..26490f76e7 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -35,7 +35,6 @@
#include "ardour/tempo.h"
#include "ardour/midi_region.h"
#include "ardour/midi_source.h"
-#include "ardour/midi_diskstream.h"
#include "ardour/midi_model.h"
#include "ardour/midi_patch_manager.h"
#include "ardour/session.h"
@@ -678,7 +677,7 @@ MidiRegionView::apply_delta()
_model->apply_command(*trackview.session(), _delta_command);
_delta_command = 0;
- midi_view()->midi_track()->diskstream()->playlist_modified();
+ midi_view()->midi_track()->playlist_modified();
_marked_for_selection.clear();
_marked_for_velocity.clear();
@@ -693,7 +692,7 @@ MidiRegionView::apply_diff ()
_model->apply_command(*trackview.session(), _diff_command);
_diff_command = 0;
- midi_view()->midi_track()->diskstream()->playlist_modified();
+ midi_view()->midi_track()->playlist_modified();
_marked_for_velocity.clear();
}
@@ -712,7 +711,7 @@ MidiRegionView::apply_delta_as_subcommand()
_model->apply_command_as_subcommand(*trackview.session(), _delta_command);
_delta_command = 0;
- midi_view()->midi_track()->diskstream()->playlist_modified();
+ midi_view()->midi_track()->playlist_modified();
_marked_for_selection.clear();
_marked_for_velocity.clear();
@@ -732,7 +731,7 @@ MidiRegionView::apply_diff_as_subcommand()
_model->apply_command_as_subcommand(*trackview.session(), _diff_command);
_diff_command = 0;
- midi_view()->midi_track()->diskstream()->playlist_modified();
+ midi_view()->midi_track()->playlist_modified();
_marked_for_selection.clear();
_marked_for_velocity.clear();
diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc
index 430a92503d..7992051ade 100644
--- a/gtk2_ardour/midi_streamview.cc
+++ b/gtk2_ardour/midi_streamview.cc
@@ -209,9 +209,9 @@ MidiStreamView::display_region(MidiRegionView* region_view, bool load_model)
}
void
-MidiStreamView::display_diskstream (boost::shared_ptr<Diskstream> ds)
+MidiStreamView::display_track (boost::shared_ptr<Track> tr)
{
- StreamView::display_diskstream(ds);
+ StreamView::display_track (tr);
draw_note_lines();
NoteRangeChanged();
}
@@ -244,7 +244,7 @@ MidiStreamView::update_data_note_range(uint8_t min, uint8_t max)
}
void
-MidiStreamView::redisplay_diskstream ()
+MidiStreamView::redisplay_track ()
{
if (!_trackview.is_midi_track()) {
return;
@@ -256,7 +256,7 @@ MidiStreamView::redisplay_diskstream ()
_range_dirty = false;
_data_note_min = 127;
_data_note_max = 0;
- _trackview.get_diskstream()->playlist()->foreach_region(
+ _trackview.track()->playlist()->foreach_region(
sigc::mem_fun (*this, &StreamView::update_contents_metrics)
);
@@ -279,7 +279,7 @@ MidiStreamView::redisplay_diskstream ()
}
// Add and display region views, and flag them as valid
- _trackview.get_diskstream()->playlist()->foreach_region(
+ _trackview.track()->playlist()->foreach_region(
sigc::hide_return (sigc::mem_fun (*this, &StreamView::add_region_view))
);
@@ -385,7 +385,7 @@ MidiStreamView::setup_rec_box ()
if (!rec_active &&
_trackview.session()->record_status() == Session::Recording &&
- _trackview.get_diskstream()->record_enabled()) {
+ _trackview.track()->record_enabled()) {
if (Config->get_show_waveforms_while_recording() && rec_regions.size() == rec_rects.size()) {
@@ -397,12 +397,12 @@ MidiStreamView::setup_rec_box ()
boost::shared_ptr<MidiDiskstream> mds = _trackview.midi_track()->midi_diskstream();
- sources.push_back(mds->write_source());
+ sources.push_back (_trackview.midi_track()->write_source());
mds->write_source()->ViewDataRangeReady.connect
(rec_data_ready_connections,
invalidator (*this),
- ui_bind (&MidiStreamView::rec_data_range_ready, this, _1, _2, boost::weak_ptr<Source>(mds->write_source())),
+ ui_bind (&MidiStreamView::rec_data_range_ready, this, _1, _2, boost::weak_ptr<Source>(_trackview.midi_track()->write_source())),
gui_context());
// handle multi
@@ -410,7 +410,7 @@ MidiStreamView::setup_rec_box ()
nframes_t start = 0;
if (rec_regions.size() > 0) {
start = rec_regions.back().first->start()
- + _trackview.get_diskstream()->get_captured_frames(rec_regions.size()-1);
+ + _trackview.track()->get_captured_frames(rec_regions.size()-1);
}
PropertyList plist;
@@ -436,8 +436,7 @@ MidiStreamView::setup_rec_box ()
/* start a new rec box */
boost::shared_ptr<MidiTrack> mt = _trackview.midi_track(); /* we know what it is already */
- boost::shared_ptr<MidiDiskstream> ds = mt->midi_diskstream();
- nframes_t frame_pos = ds->current_capture_start ();
+ nframes_t frame_pos = mt->current_capture_start ();
gdouble xstart = _trackview.editor().frame_to_pixel (frame_pos);
gdouble xend;
uint32_t fill_color;
@@ -471,7 +470,7 @@ MidiStreamView::setup_rec_box ()
} else if (rec_active &&
(_trackview.session()->record_status() != Session::Recording ||
- !_trackview.get_diskstream()->record_enabled())) {
+ !_trackview.track()->record_enabled())) {
screen_update_connection.disconnect();
rec_active = false;
rec_updating = false;
@@ -558,7 +557,7 @@ MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, nframes_t
if (nlen != region->length()) {
region->suspend_property_changes ();
- region->set_position (_trackview.get_diskstream()->get_capture_start_frame(n), this);
+ region->set_position (_trackview.track()->get_capture_start_frame(n), this);
region->set_length (start + dur - region->position(), this);
region->resume_property_changes ();
@@ -615,14 +614,14 @@ MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, nframes_t
} else {
- nframes_t nlen = _trackview.get_diskstream()->get_captured_frames(n);
+ nframes_t nlen = _trackview.track()->get_captured_frames(n);
if (nlen != region->length()) {
if (region->source_length(0) >= region->position() + nlen) {
region->suspend_property_changes ();
- region->set_position (_trackview.get_diskstream()->get_capture_start_frame(n), this);
+ region->set_position (_trackview.track()->get_capture_start_frame(n), this);
region->set_length (nlen, this);
region->resume_property_changes ();
diff --git a/gtk2_ardour/midi_streamview.h b/gtk2_ardour/midi_streamview.h
index ae2b907d1e..1ab832986a 100644
--- a/gtk2_ardour/midi_streamview.h
+++ b/gtk2_ardour/midi_streamview.h
@@ -35,7 +35,6 @@ namespace Gdk {
namespace ARDOUR {
class Route;
- class Diskstream;
class Crossfade;
class PeakData;
class MidiRegion;
@@ -76,7 +75,7 @@ class MidiStreamView : public StreamView
void update_note_range(uint8_t note_num);
- void redisplay_diskstream ();
+ void redisplay_track ();
inline double contents_height() const
{ return (_trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2); }
@@ -119,7 +118,7 @@ class MidiStreamView : public StreamView
bool recording = false);
void display_region(MidiRegionView* region_view, bool load_model);
- void display_diskstream (boost::shared_ptr<ARDOUR::Diskstream> ds);
+ void display_track (boost::shared_ptr<ARDOUR::Track> tr);
void update_contents_height ();
void draw_note_lines();
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index 318ec62769..83567c42d9 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -738,7 +738,7 @@ MidiTimeAxisView::set_note_mode(NoteMode mode)
_note_mode = mode;
midi_track()->set_note_mode(mode);
xml_node->add_property ("note-mode", enum_2_string(_note_mode));
- _view->redisplay_diskstream();
+ _view->redisplay_track();
}
}
@@ -754,7 +754,7 @@ MidiTimeAxisView::set_color_mode(ColorMode mode)
_color_mode = mode;
xml_node->add_property ("color-mode", enum_2_string(_color_mode));
- _view->redisplay_diskstream();
+ _view->redisplay_track();
}
}
@@ -975,10 +975,7 @@ MidiTimeAxisView::add_region (nframes64_t pos)
const Tempo& t = _session->tempo_map().tempo_at(start);
double length = floor (m.frames_per_bar(t, _session->frame_rate()));
- const boost::shared_ptr<MidiDiskstream> diskstream =
- boost::dynamic_pointer_cast<MidiDiskstream>(view()->trackview().track()->diskstream());
-
- boost::shared_ptr<Source> src = _session->create_midi_source_for_session (*diskstream.get());
+ boost::shared_ptr<Source> src = _session->create_midi_source_for_session (view()->trackview().track()->name());
PropertyList plist;
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 5e7064ee8d..cb030287ca 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -41,13 +41,13 @@
#include "ardour/route.h"
#include "ardour/route_group.h"
#include "ardour/audio_track.h"
-#include "ardour/audio_diskstream.h"
#include "ardour/panner.h"
#include "ardour/send.h"
#include "ardour/processor.h"
#include "ardour/profile.h"
#include "ardour/ladspa_plugin.h"
#include "ardour/user_bundle.h"
+#include "ardour/port.h"
#include "ardour_ui.h"
#include "ardour_dialog.h"
diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc
index c1dc4aff9f..2bb2548164 100644
--- a/gtk2_ardour/mixer_ui.cc
+++ b/gtk2_ardour/mixer_ui.cc
@@ -33,7 +33,6 @@
#include <gtkmm2ext/tearoff.h>
#include <gtkmm2ext/window_title.h>
-#include "ardour/audio_diskstream.h"
#include "ardour/audio_track.h"
#include "ardour/plugin_manager.h"
#include "ardour/route_group.h"
diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h
index ba72ba2cba..935e85559e 100644
--- a/gtk2_ardour/mixer_ui.h
+++ b/gtk2_ardour/mixer_ui.h
@@ -44,7 +44,6 @@
namespace ARDOUR {
class Route;
class RouteGroup;
- class AudioDiskstream;
};
class MixerStrip;
diff --git a/gtk2_ardour/playlist_selector.cc b/gtk2_ardour/playlist_selector.cc
index aa678e80a3..c8a9255c62 100644
--- a/gtk2_ardour/playlist_selector.cc
+++ b/gtk2_ardour/playlist_selector.cc
@@ -79,10 +79,10 @@ PlaylistSelector::~PlaylistSelector ()
void
PlaylistSelector::clear_map ()
{
- for (DSPL_Map::iterator x = dspl_map.begin(); x != dspl_map.end(); ++x) {
+ for (TrackPlaylistMap::iterator x = trpl_map.begin(); x != trpl_map.end(); ++x) {
delete x->second;
}
- dspl_map.clear ();
+ trpl_map.clear ();
}
bool
@@ -99,7 +99,6 @@ void
PlaylistSelector::show_for (RouteUI* ruix)
{
vector<const char*> item;
- boost::shared_ptr<Diskstream> this_ds;
string str;
rui = ruix;
@@ -113,7 +112,7 @@ PlaylistSelector::show_for (RouteUI* ruix)
_session->playlists->foreach (this, &PlaylistSelector::add_playlist_to_map);
- this_ds = rui->get_diskstream();
+ boost::shared_ptr<Track> this_track = rui->track();
TreeModel::Row others = *(model->append ());
@@ -121,29 +120,29 @@ PlaylistSelector::show_for (RouteUI* ruix)
boost::shared_ptr<Playlist> proxy = others[columns.playlist];
proxy.reset ();
- for (DSPL_Map::iterator x = dspl_map.begin(); x != dspl_map.end(); ++x) {
+ for (TrackPlaylistMap::iterator x = trpl_map.begin(); x != trpl_map.end(); ++x) {
- boost::shared_ptr<Diskstream> ds = _session->diskstream_by_id (x->first);
+ boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (_session->route_by_id (x->first));
- if (ds == 0) {
+ if (tr == 0) {
continue;
}
- /* add a node for the diskstream */
+ /* add a node for the track */
string nodename;
- if (ds->name().empty()) {
+ if (tr->name().empty()) {
nodename = _("unassigned");
} else {
- nodename = ds->name().c_str();
+ nodename = tr->name().c_str();
}
TreeModel::Row row;
TreeModel::Row* selected_row = 0;
TreePath this_path;
- if (ds == this_ds) {
+ if (tr == this_track) {
row = *(model->prepend());
row[columns.text] = nodename;
boost::shared_ptr<Playlist> proxy = row[columns.playlist];
@@ -157,7 +156,7 @@ PlaylistSelector::show_for (RouteUI* ruix)
/* Now insert all the playlists for this diskstream/track in a subtree */
- list<boost::shared_ptr<Playlist> > *pls = x->second;
+ list<boost::shared_ptr<Playlist> >* pls = x->second;
for (list<boost::shared_ptr<Playlist> >::iterator p = pls->begin(); p != pls->end(); ++p) {
@@ -167,7 +166,7 @@ PlaylistSelector::show_for (RouteUI* ruix)
child_row[columns.text] = (*p)->name();
child_row[columns.playlist] = *p;
- if (*p == this_ds->playlist()) {
+ if (*p == this_track->playlist()) {
selected_row = &child_row;
}
}
@@ -197,7 +196,7 @@ PlaylistSelector::show_for (RouteUI* ruix)
child_row[columns.text] = (*p)->name();
child_row[columns.playlist] = *p;
- if (*p == this_ds->playlist()) {
+ if (*p == this_track->playlist()) {
selected_row = &child_row;
}
@@ -223,13 +222,10 @@ PlaylistSelector::add_playlist_to_map (boost::shared_ptr<Playlist> pl)
return;
}
- DSPL_Map::iterator x;
+ TrackPlaylistMap::iterator x;
- if ((x = dspl_map.find (apl->get_orig_diskstream_id())) == dspl_map.end()) {
-
- pair<PBD::ID,list<boost::shared_ptr<Playlist> >*> newp (apl->get_orig_diskstream_id(), new list<boost::shared_ptr<Playlist> >);
-
- x = dspl_map.insert (dspl_map.end(), newp);
+ if ((x = trpl_map.find (apl->get_orig_diskstream_id())) == trpl_map.end()) {
+ x = trpl_map.insert (trpl_map.end(), make_pair (apl->get_orig_diskstream_id(), new list<boost::shared_ptr<Playlist> >));
}
x->second->push_back (pl);
@@ -269,7 +265,7 @@ PlaylistSelector::selection_changed ()
return;
}
- at->diskstream()->use_playlist (apl);
+ at->use_playlist (apl);
hide ();
}
diff --git a/gtk2_ardour/playlist_selector.h b/gtk2_ardour/playlist_selector.h
index d0b36fae48..c792179776 100644
--- a/gtk2_ardour/playlist_selector.h
+++ b/gtk2_ardour/playlist_selector.h
@@ -51,10 +51,10 @@ class PlaylistSelector : public ArdourDialog
bool on_unmap_event (GdkEventAny*);
private:
- typedef std::map<PBD::ID,std::list<boost::shared_ptr<ARDOUR::Playlist> >*> DSPL_Map;
+ typedef std::map<PBD::ID,std::list<boost::shared_ptr<ARDOUR::Playlist> >*> TrackPlaylistMap;
Gtk::ScrolledWindow scroller;
- DSPL_Map dspl_map;
+ TrackPlaylistMap trpl_map;
RouteUI* rui;
sigc::connection select_connection;
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index 42711b4936..4b34bd0f68 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -42,7 +42,6 @@
#include "ardour/amp.h"
#include "ardour/ardour.h"
-#include "ardour/audio_diskstream.h"
#include "ardour/audio_track.h"
#include "ardour/audioengine.h"
#include "ardour/internal_send.h"
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index cee28fc5c1..91748707f4 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -242,8 +242,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, boost::sh
track()->TrackModeChanged.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::track_mode_changed, this), gui_context());
track()->FreezeChange.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::map_frozen, this), gui_context());
- track()->DiskstreamChanged.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::diskstream_changed, this), gui_context());
- get_diskstream()->SpeedChanged.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::speed_changed, this), gui_context());
+ track()->SpeedChanged.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::speed_changed, this), gui_context());
/* pick up the correct freeze state */
map_frozen ();
@@ -509,19 +508,21 @@ RouteTimeAxisView::build_display_menu ()
alignment_items.push_back (RadioMenuElem (align_group, _("Align With Existing Material"),
sigc::bind (sigc::mem_fun(*this, &RouteTimeAxisView::set_align_style), ExistingMaterial)));
align_existing_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
- if (get_diskstream()->alignment_style() == ExistingMaterial)
+ if (track()->alignment_style() == ExistingMaterial) {
align_existing_item->set_active();
+ }
alignment_items.push_back (RadioMenuElem (align_group, _("Align With Capture Time"),
sigc::bind (sigc::mem_fun(*this, &RouteTimeAxisView::set_align_style), CaptureTime)));
align_capture_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
- if (get_diskstream()->alignment_style() == CaptureTime)
+ if (track()->alignment_style() == CaptureTime) {
align_capture_item->set_active();
+ }
if (!Profile->get_sae()) {
items.push_back (MenuElem (_("Alignment"), *alignment_menu));
- get_diskstream()->AlignmentStyleChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteTimeAxisView::align_style_changed, this), gui_context());
+ track()->AlignmentStyleChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteTimeAxisView::align_style_changed, this), gui_context());
RadioMenuItem::Group mode_group;
items.push_back (RadioMenuElem (mode_group, _("Normal Mode"), sigc::bind (
@@ -556,7 +557,7 @@ RouteTimeAxisView::build_display_menu ()
_ignore_track_mode_change = false;
}
- get_diskstream()->AlignmentStyleChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteTimeAxisView::align_style_changed, this), gui_context());
+ track()->AlignmentStyleChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteTimeAxisView::align_style_changed, this), gui_context());
color_mode_menu = build_color_mode_menu();
if (color_mode_menu) {
@@ -900,8 +901,8 @@ RouteTimeAxisView::set_samples_per_unit (double spu)
{
double speed = 1.0;
- if (get_diskstream() != 0) {
- speed = get_diskstream()->speed();
+ if (track()) {
+ speed = track()->speed();
}
if (_view) {
@@ -914,7 +915,7 @@ RouteTimeAxisView::set_samples_per_unit (double spu)
void
RouteTimeAxisView::align_style_changed ()
{
- switch (get_diskstream()->alignment_style()) {
+ switch (track()->alignment_style()) {
case ExistingMaterial:
if (!align_existing_item->get_active()) {
align_existing_item->set_active();
@@ -947,7 +948,7 @@ RouteTimeAxisView::set_align_style (AlignStyle style)
}
if (item->get_active()) {
- get_diskstream()->set_align_style (style);
+ track()->set_align_style (style);
}
}
@@ -957,13 +958,15 @@ RouteTimeAxisView::rename_current_playlist ()
ArdourPrompter prompter (true);
string name;
- boost::shared_ptr<Diskstream> ds = get_diskstream();
- if (!ds || ds->destructive())
+ boost::shared_ptr<Track> tr = track();
+ if (!tr || tr->destructive()) {
return;
+ }
- boost::shared_ptr<Playlist> pl = ds->playlist();
- if (!pl)
+ boost::shared_ptr<Playlist> pl = tr->playlist();
+ if (!pl) {
return;
+ }
prompter.set_prompt (_("Name for playlist"));
prompter.set_initial_text (pl->name());
@@ -1023,13 +1026,15 @@ RouteTimeAxisView::use_copy_playlist (bool prompt, vector<boost::shared_ptr<Play
{
string name;
- boost::shared_ptr<Diskstream> ds = get_diskstream();
- if (!ds || ds->destructive())
+ boost::shared_ptr<Track> tr = track ();
+ if (!tr || tr->destructive()) {
return;
+ }
- boost::shared_ptr<const Playlist> pl = ds->playlist();
- if (!pl)
+ boost::shared_ptr<const Playlist> pl = tr->playlist();
+ if (!pl) {
return;
+ }
name = pl->name();
@@ -1065,8 +1070,8 @@ RouteTimeAxisView::use_copy_playlist (bool prompt, vector<boost::shared_ptr<Play
}
if (name.length()) {
- ds->use_copy_playlist ();
- ds->playlist()->set_name (name);
+ tr->use_copy_playlist ();
+ tr->playlist()->set_name (name);
}
}
@@ -1075,13 +1080,15 @@ RouteTimeAxisView::use_new_playlist (bool prompt, vector<boost::shared_ptr<Playl
{
string name;
- boost::shared_ptr<Diskstream> ds = get_diskstream();
- if (!ds || ds->destructive())
+ boost::shared_ptr<Track> tr = track ();
+ if (!tr || tr->destructive()) {
return;
+ }
- boost::shared_ptr<const Playlist> pl = ds->playlist();
- if (!pl)
+ boost::shared_ptr<const Playlist> pl = tr->playlist();
+ if (!pl) {
return;
+ }
name = pl->name();
@@ -1114,21 +1121,23 @@ RouteTimeAxisView::use_new_playlist (bool prompt, vector<boost::shared_ptr<Playl
}
if (name.length()) {
- ds->use_new_playlist ();
- ds->playlist()->set_name (name);
+ tr->use_new_playlist ();
+ tr->playlist()->set_name (name);
}
}
void
RouteTimeAxisView::clear_playlist ()
{
- boost::shared_ptr<Diskstream> ds = get_diskstream();
- if (!ds || ds->destructive())
+ boost::shared_ptr<Track> tr = track ();
+ if (!tr || tr->destructive()) {
return;
+ }
- boost::shared_ptr<Playlist> pl = ds->playlist();
- if (!pl)
+ boost::shared_ptr<Playlist> pl = tr->playlist();
+ if (!pl) {
return;
+ }
_editor.clear_playlist (pl);
}
@@ -1140,16 +1149,11 @@ RouteTimeAxisView::speed_changed ()
}
void
-RouteTimeAxisView::diskstream_changed ()
-{
- Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&RouteTimeAxisView::update_diskstream_display, this));
-}
-
-void
RouteTimeAxisView::update_diskstream_display ()
{
- if (!get_diskstream()) // bus
+ if (!track()) {
return;
+ }
map_frozen ();
}
@@ -1212,8 +1216,8 @@ RouteTimeAxisView::get_selectables (nframes_t start, nframes_t end, double top,
{
double speed = 1.0;
- if (get_diskstream() != 0) {
- speed = get_diskstream()->speed();
+ if (track() != 0) {
+ speed = track()->speed();
}
nframes_t start_adjusted = session_frame_to_track_frame(start, speed);
@@ -1291,10 +1295,10 @@ RouteTimeAxisView::name() const
boost::shared_ptr<Playlist>
RouteTimeAxisView::playlist () const
{
- boost::shared_ptr<Diskstream> ds;
+ boost::shared_ptr<Track> tr;
- if ((ds = get_diskstream()) != 0) {
- return ds->playlist();
+ if ((tr = track()) != 0) {
+ return tr->playlist();
} else {
return boost::shared_ptr<Playlist> ();
}
@@ -1349,11 +1353,10 @@ RouteTimeAxisView::hide_click ()
boost::shared_ptr<Region>
RouteTimeAxisView::find_next_region (nframes_t pos, RegionPoint point, int32_t dir)
{
- boost::shared_ptr<Diskstream> stream;
- boost::shared_ptr<Playlist> playlist;
+ boost::shared_ptr<Playlist> pl = playlist ();
- if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
- return playlist->find_next_region (pos, point, dir);
+ if (pl) {
+ return pl->find_next_region (pos, point, dir);
}
return boost::shared_ptr<Region> ();
@@ -1362,11 +1365,10 @@ RouteTimeAxisView::find_next_region (nframes_t pos, RegionPoint point, int32_t d
nframes64_t
RouteTimeAxisView::find_next_region_boundary (nframes64_t pos, int32_t dir)
{
- boost::shared_ptr<Diskstream> stream;
- boost::shared_ptr<Playlist> playlist;
+ boost::shared_ptr<Playlist> pl = playlist ();
- if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
- return playlist->find_next_region_boundary (pos, dir);
+ if (pl) {
+ return pl->find_next_region_boundary (pos, dir);
}
return -1;
@@ -1376,19 +1378,19 @@ bool
RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
{
boost::shared_ptr<Playlist> what_we_got;
- boost::shared_ptr<Diskstream> ds = get_diskstream();
+ boost::shared_ptr<Track> tr = track ();
boost::shared_ptr<Playlist> playlist;
bool ret = false;
- if (ds == 0) {
+ if (tr == 0) {
/* route is a bus, not a track */
return false;
}
- playlist = ds->playlist();
+ playlist = tr->playlist();
TimeSelection time (selection.time);
- float speed = ds->speed();
+ float const speed = tr->speed();
if (speed != 1.0f) {
for (TimeSelection::iterator i = time.begin(); i != time.end(); ++i) {
(*i).start = session_frame_to_track_frame((*i).start, speed);
@@ -1447,7 +1449,7 @@ RouteTimeAxisView::paste (nframes_t pos, float times, Selection& selection, size
return false;
}
- boost::shared_ptr<Playlist> playlist = get_diskstream()->playlist();
+ boost::shared_ptr<Playlist> pl = playlist ();
PlaylistSelection::iterator p;
for (p = selection.playlists.begin(); p != selection.playlists.end() && nth; ++p, --nth) {}
@@ -1456,13 +1458,13 @@ RouteTimeAxisView::paste (nframes_t pos, float times, Selection& selection, size
return false;
}
- if (get_diskstream()->speed() != 1.0f) {
- pos = session_frame_to_track_frame(pos, get_diskstream()->speed() );
+ if (track()->speed() != 1.0f) {
+ pos = session_frame_to_track_frame (pos, track()->speed());
}
- playlist->clear_history ();
- playlist->paste (*p, pos, times);
- _session->add_command (new StatefulDiffCommand (playlist));
+ pl->clear_history ();
+ pl->paste (*p, pos, times);
+ _session->add_command (new StatefulDiffCommand (pl));
return true;
}
@@ -1504,30 +1506,30 @@ RouteTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
delete playlist_menu;
- vector<boost::shared_ptr<Playlist> > playlists, playlists_ds;
- boost::shared_ptr<Diskstream> ds = get_diskstream();
+ vector<boost::shared_ptr<Playlist> > playlists, playlists_tr;
+ boost::shared_ptr<Track> tr = track();
RadioMenuItem::Group playlist_group;
_session->playlists->get (playlists);
/* find the playlists for this diskstream */
for (vector<boost::shared_ptr<Playlist> >::iterator i = playlists.begin(); i != playlists.end(); ++i) {
- if (((*i)->get_orig_diskstream_id() == ds->id()) || (ds->playlist()->id() == (*i)->id())) {
- playlists_ds.push_back(*i);
+ if (((*i)->get_orig_diskstream_id() == tr->diskstream_id()) || (tr->playlist()->id() == (*i)->id())) {
+ playlists_tr.push_back(*i);
}
}
/* sort the playlists */
PlaylistSorter cmp;
- sort(playlists_ds.begin(), playlists_ds.end(), cmp);
+ sort (playlists_tr.begin(), playlists_tr.end(), cmp);
/* add the playlists to the menu */
- for (vector<boost::shared_ptr<Playlist> >::iterator i = playlists_ds.begin(); i != playlists_ds.end(); ++i) {
+ for (vector<boost::shared_ptr<Playlist> >::iterator i = playlists_tr.begin(); i != playlists_tr.end(); ++i) {
playlist_items.push_back (RadioMenuElem (playlist_group, (*i)->name()));
RadioMenuItem *item = static_cast<RadioMenuItem*>(&playlist_items.back());
item->signal_toggled().connect(sigc::bind (sigc::mem_fun (*this, &RouteTimeAxisView::use_playlist), item, boost::weak_ptr<Playlist> (*i)));
- if (ds->playlist()->id() == (*i)->id()) {
+ if (tr->playlist()->id() == (*i)->id()) {
item->set_active();
}
@@ -1574,13 +1576,12 @@ RouteTimeAxisView::use_playlist (RadioMenuItem *item, boost::weak_ptr<Playlist>
boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl);
if (apl) {
- if (get_diskstream()->playlist() == apl) {
+ if (track()->playlist() == apl) {
// exit when use_playlist is called by the creation of the playlist menu
// or the playlist choice is unchanged
return;
}
- get_diskstream()->use_playlist (apl);
-
+ track()->use_playlist (apl);
if (route_group() && route_group()->is_active()) {
std::string group_string = "."+route_group()->name()+".";
@@ -1611,10 +1612,10 @@ RouteTimeAxisView::use_playlist (RadioMenuItem *item, boost::weak_ptr<Playlist>
boost::shared_ptr<Playlist> ipl = session()->playlists->by_name(playlist_name);
if (!ipl) {
// No playlist for this track for this take yet, make it
- track->diskstream()->use_new_playlist();
- track->diskstream()->playlist()->set_name(playlist_name);
+ track->use_new_playlist();
+ track->playlist()->set_name(playlist_name);
} else {
- track->diskstream()->use_playlist(ipl);
+ track->use_playlist(ipl);
}
}
}
diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h
index 7f35e54485..e24de4126f 100644
--- a/gtk2_ardour/route_time_axis.h
+++ b/gtk2_ardour/route_time_axis.h
@@ -48,7 +48,6 @@
namespace ARDOUR {
class Session;
class Region;
- class Diskstream;
class RouteGroup;
class IOProcessor;
class Processor;
@@ -183,7 +182,6 @@ protected:
};
- void diskstream_changed ();
void update_diskstream_display ();
gint edit_click (GdkEventButton *);
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index 526d99cd94..ee66bf4c90 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -50,9 +50,7 @@
#include "ardour/session.h"
#include "ardour/audioengine.h"
#include "ardour/audio_track.h"
-#include "ardour/audio_diskstream.h"
#include "ardour/midi_track.h"
-#include "ardour/midi_diskstream.h"
#include "ardour/template_utils.h"
#include "ardour/filename_extensions.h"
#include "ardour/directory_names.h"
@@ -221,7 +219,7 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
if (_session->writable() && is_track()) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(_route);
- t->diskstream()->RecordEnableChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::route_rec_enable_changed, this), gui_context());
+ t->RecordEnableChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::route_rec_enable_changed, this), gui_context());
rec_enable_button->show();
rec_enable_button->set_controllable (t->rec_enable_control());
@@ -1328,18 +1326,6 @@ RouteUI::midi_track() const
return boost::dynamic_pointer_cast<MidiTrack>(_route);
}
-boost::shared_ptr<Diskstream>
-RouteUI::get_diskstream () const
-{
- boost::shared_ptr<Track> t;
-
- if ((t = boost::dynamic_pointer_cast<Track>(_route)) != 0) {
- return t->diskstream();
- } else {
- return boost::shared_ptr<Diskstream> ((Diskstream*) 0);
- }
-}
-
string
RouteUI::name() const
{
diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h
index a01db6dd8e..bbe18bfc4f 100644
--- a/gtk2_ardour/route_ui.h
+++ b/gtk2_ardour/route_ui.h
@@ -69,8 +69,6 @@ class RouteUI : public virtual AxisView
boost::shared_ptr<ARDOUR::AudioTrack> audio_track() const;
boost::shared_ptr<ARDOUR::MidiTrack> midi_track() const;
- boost::shared_ptr<ARDOUR::Diskstream> get_diskstream() const;
-
std::string name() const;
// protected: XXX sigh this should be here
diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc
index 83dd9fc4b8..8fa9ed8d28 100644
--- a/gtk2_ardour/streamview.cc
+++ b/gtk2_ardour/streamview.cc
@@ -25,7 +25,6 @@
#include "ardour/playlist.h"
#include "ardour/region.h"
#include "ardour/source.h"
-#include "ardour/diskstream.h"
#include "ardour/track.h"
#include "ardour/session.h"
@@ -79,7 +78,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
if (_trackview.is_track()) {
_trackview.track()->DiskstreamChanged.connect (*this, invalidator (*this), boost::bind (&StreamView::diskstream_changed, this), gui_context());
- _trackview.get_diskstream()->RecordEnableChanged.connect (*this, invalidator (*this), boost::bind (&StreamView::rec_enable_changed, this), gui_context());
+ _trackview.track()->RecordEnableChanged.connect (*this, invalidator (*this), boost::bind (&StreamView::rec_enable_changed, this), gui_context());
_trackview.session()->TransportStateChange.connect (*this, invalidator (*this), boost::bind (&StreamView::transport_changed, this), gui_context());
_trackview.session()->TransportLooped.connect (*this, invalidator (*this), boost::bind (&StreamView::transport_looped, this), gui_context());
@@ -91,7 +90,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
StreamView::~StreamView ()
{
- undisplay_diskstream ();
+ undisplay_track ();
delete canvas_rect;
@@ -104,7 +103,7 @@ void
StreamView::attach ()
{
if (_trackview.is_track()) {
- display_diskstream (_trackview.get_diskstream());
+ display_track (_trackview.track ());
}
}
@@ -204,7 +203,7 @@ StreamView::remove_region_view (boost::weak_ptr<Region> weak_r)
}
void
-StreamView::undisplay_diskstream ()
+StreamView::undisplay_track ()
{
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end() ; ) {
RegionViewList::iterator next = i;
@@ -217,11 +216,11 @@ StreamView::undisplay_diskstream ()
}
void
-StreamView::display_diskstream (boost::shared_ptr<Diskstream> ds)
+StreamView::display_track (boost::shared_ptr<Track> tr)
{
playlist_switched_connection.disconnect();
- playlist_switched (ds);
- ds->PlaylistChanged.connect (playlist_switched_connection, invalidator (*this), boost::bind (&StreamView::playlist_switched, this, boost::weak_ptr<Diskstream> (ds)), gui_context());
+ playlist_switched (tr);
+ tr->PlaylistChanged.connect (playlist_switched_connection, invalidator (*this), boost::bind (&StreamView::playlist_switched, this, boost::weak_ptr<Track> (tr)), gui_context());
}
void
@@ -282,17 +281,17 @@ StreamView::layer_regions()
}
void
-StreamView::playlist_layered (boost::weak_ptr<Diskstream> wds)
+StreamView::playlist_layered (boost::weak_ptr<Track> wtr)
{
- boost::shared_ptr<Diskstream> ds (wds.lock());
+ boost::shared_ptr<Track> tr (wtr.lock());
- if (!ds) {
+ if (!tr) {
return;
}
/* update layers count and the y positions and heights of our regions */
- if (ds->playlist()) {
- _layers = ds->playlist()->top_layer() + 1;
+ if (tr->playlist()) {
+ _layers = tr->playlist()->top_layer() + 1;
}
if (_layer_display == Stacked) {
@@ -305,35 +304,35 @@ StreamView::playlist_layered (boost::weak_ptr<Diskstream> wds)
}
void
-StreamView::playlist_switched (boost::weak_ptr<Diskstream> wds)
+StreamView::playlist_switched (boost::weak_ptr<Track> wtr)
{
- boost::shared_ptr<Diskstream> ds (wds.lock());
+ boost::shared_ptr<Track> tr (wtr.lock());
- if (!ds) {
+ if (!tr) {
return;
}
/* disconnect from old playlist */
playlist_connections.drop_connections ();
- undisplay_diskstream ();
+ undisplay_track ();
/* update layers count and the y positions and heights of our regions */
- _layers = ds->playlist()->top_layer() + 1;
+ _layers = tr->playlist()->top_layer() + 1;
update_contents_height ();
update_coverage_frames ();
- ds->playlist()->set_explicit_relayering (_layer_display == Stacked);
+ tr->playlist()->set_explicit_relayering (_layer_display == Stacked);
/* draw it */
- redisplay_diskstream ();
+ redisplay_track ();
/* catch changes */
- ds->playlist()->LayeringChanged.connect (playlist_connections, invalidator (*this), boost::bind (&StreamView::playlist_layered, this, boost::weak_ptr<Diskstream>(ds)), gui_context());
- ds->playlist()->RegionAdded.connect (playlist_connections, invalidator (*this), ui_bind (&StreamView::add_region_view, this, _1), gui_context());
- ds->playlist()->RegionRemoved.connect (playlist_connections, invalidator (*this), ui_bind (&StreamView::remove_region_view, this, _1), gui_context());
+ tr->playlist()->LayeringChanged.connect (playlist_connections, invalidator (*this), boost::bind (&StreamView::playlist_layered, this, boost::weak_ptr<Track> (tr)), gui_context());
+ tr->playlist()->RegionAdded.connect (playlist_connections, invalidator (*this), ui_bind (&StreamView::add_region_view, this, _1), gui_context());
+ tr->playlist()->RegionRemoved.connect (playlist_connections, invalidator (*this), ui_bind (&StreamView::remove_region_view, this, _1), gui_context());
// ds->playlist()->ContentsChanged.connect (playlist_connections, invalidator (*this), boost::bind (&StreamView::redisplay_diskstream, this), gui_context());
}
@@ -343,15 +342,14 @@ StreamView::diskstream_changed ()
boost::shared_ptr<Track> t;
if ((t = _trackview.track()) != 0) {
- Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&StreamView::display_diskstream, this, t->diskstream()));
+ Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&StreamView::display_track, this, t));
} else {
- Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&StreamView::undisplay_diskstream, this));
+ Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&StreamView::undisplay_track, this));
}
}
void
StreamView::apply_color (Gdk::Color& color, ColorTarget target)
-
{
list<RegionView *>::iterator i;
@@ -412,7 +410,7 @@ StreamView::update_rec_box ()
if (rec_active && rec_rects.size() > 0) {
/* only update the last box */
RecBoxInfo & rect = rec_rects.back();
- nframes_t at = _trackview.get_diskstream()->current_capture_end();
+ nframes_t at = _trackview.track()->current_capture_end();
double xstart;
double xend;
@@ -427,7 +425,7 @@ StreamView::update_rec_box ()
case Destructive:
rect.length = 2;
- xstart = _trackview.editor().frame_to_pixel (_trackview.get_diskstream()->current_capture_start());
+ xstart = _trackview.editor().frame_to_pixel (_trackview.track()->current_capture_start());
xend = _trackview.editor().frame_to_pixel (at);
break;
}
@@ -577,7 +575,7 @@ StreamView::set_layer_display (LayerDisplay d)
_layer_display = d;
update_contents_height ();
update_coverage_frames ();
- _trackview.get_diskstream()->playlist()->set_explicit_relayering (_layer_display == Stacked);
+ _trackview.track()->playlist()->set_explicit_relayering (_layer_display == Stacked);
}
void
diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h
index 17a1c4182b..14b30a42fc 100644
--- a/gtk2_ardour/streamview.h
+++ b/gtk2_ardour/streamview.h
@@ -35,11 +35,11 @@ namespace Gdk {
namespace ARDOUR {
class Route;
- class Diskstream;
class Crossfade;
class PeakData;
class Region;
class Source;
+ class Track;
}
struct RecBoxInfo {
@@ -104,7 +104,7 @@ public:
void region_layered (RegionView*);
virtual void update_contents_height ();
- virtual void redisplay_diskstream () = 0;
+ virtual void redisplay_track () = 0;
double child_height () const;
ARDOUR::layer_t layers () const { return _layers; }
@@ -129,13 +129,13 @@ protected:
bool wait_for_waves, bool recording = false) = 0;
virtual void remove_region_view (boost::weak_ptr<ARDOUR::Region> );
- void display_diskstream (boost::shared_ptr<ARDOUR::Diskstream>);
- virtual void undisplay_diskstream ();
+ void display_track (boost::shared_ptr<ARDOUR::Track>);
+ virtual void undisplay_track ();
void diskstream_changed ();
void layer_regions ();
- virtual void playlist_switched (boost::weak_ptr<ARDOUR::Diskstream>);
- virtual void playlist_layered (boost::weak_ptr<ARDOUR::Diskstream>);
+ virtual void playlist_switched (boost::weak_ptr<ARDOUR::Track>);
+ virtual void playlist_layered (boost::weak_ptr<ARDOUR::Track>);
virtual void color_handler () = 0;
diff --git a/gtk2_ardour/tape_region_view.cc b/gtk2_ardour/tape_region_view.cc
index e4db441e74..5fef5e46ee 100644
--- a/gtk2_ardour/tape_region_view.cc
+++ b/gtk2_ardour/tape_region_view.cc
@@ -27,7 +27,6 @@
#include "ardour/playlist.h"
#include "ardour/audioregion.h"
#include "ardour/audiosource.h"
-#include "ardour/audio_diskstream.h"
#include "tape_region_view.h"
#include "audio_time_axis.h"
diff --git a/gtk2_ardour/time_fx_dialog.cc b/gtk2_ardour/time_fx_dialog.cc
index 04280e0011..d1650430b2 100644
--- a/gtk2_ardour/time_fx_dialog.cc
+++ b/gtk2_ardour/time_fx_dialog.cc
@@ -41,7 +41,6 @@
#include "ardour/audioplaylist.h"
#include "ardour/audio_track.h"
#include "ardour/audioregion.h"
-#include "ardour/audio_diskstream.h"
#include "ardour/stretch.h"
#include "ardour/midi_stretch.h"
#include "ardour/pitch.h"