summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-07-19 05:44:23 +0000
committerDavid Robillard <d@drobilla.net>2006-07-19 05:44:23 +0000
commit0cdb918d4dd409075c0e2fdc50633e7b6adb22f2 (patch)
tree0c2901a6c81dffa69a87533b70c6f8e5bffa2ed4 /gtk2_ardour
parent50a3102b9b533d7f8786d220f8df67421b9227c8 (diff)
Work towards removal of Session's Diskstream list.
Havn't managed to completely remove it because of Session loading from XML - the Diskstreams are separate from the Tracks (I assume as a throwback to when they were distinct) so the Diskstreams need to be stored somewhere until the Tracks are loaded. Ideally tracks should completely own their Diskstreams - not sure how to accomplish this without breaking Session loading though... git-svn-id: svn://localhost/ardour2/branches/midi@687 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui.cc17
-rw-r--r--gtk2_ardour/ardour_ui.h2
-rw-r--r--gtk2_ardour/audio_time_axis.cc4
-rw-r--r--gtk2_ardour/editor_audio_import.cc4
-rw-r--r--gtk2_ardour/editor_timefx.cc2
-rw-r--r--gtk2_ardour/mixer_strip.cc46
-rw-r--r--gtk2_ardour/mixer_strip.h2
-rw-r--r--gtk2_ardour/playlist_selector.cc2
-rw-r--r--gtk2_ardour/route_ui.cc11
-rw-r--r--gtk2_ardour/streamview.cc8
10 files changed, 26 insertions, 72 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 8a7e24aeee..fafaf8e6e0 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -53,7 +53,7 @@
#include <ardour/audio_diskstream.h>
#include <ardour/audiofilesource.h>
#include <ardour/recent_sessions.h>
-#include <ardour/session_diskstream.h>
+#include <ardour/session_route.h>
#include <ardour/port.h>
#include <ardour/audio_track.h>
#include <ardour/midi_track.h>
@@ -544,9 +544,10 @@ ARDOUR_UI::update_buffer_load ()
}
void
-ARDOUR_UI::count_recenabled_diskstreams (Diskstream& ds)
+ARDOUR_UI::count_recenabled_diskstreams (Route* route)
{
- if (ds.record_enabled()) {
+ Track* track = dynamic_cast<Track*>(route);
+ if (track && track->diskstream().record_enabled()) {
rec_enabled_diskstreams++;
}
}
@@ -572,7 +573,7 @@ ARDOUR_UI::update_disk_space()
if (session->actively_recording()){
rec_enabled_diskstreams = 0;
- session->foreach_diskstream (this, &ARDOUR_UI::count_recenabled_diskstreams);
+ session->foreach_route (this, &ARDOUR_UI::count_recenabled_diskstreams);
if (rec_enabled_diskstreams) {
frames /= rec_enabled_diskstreams;
@@ -592,7 +593,7 @@ ARDOUR_UI::update_disk_space()
frames -= mins * fr * 60;
secs = frames / fr;
- snprintf (buf, sizeof(buf), _("Space: %02dh:%02dm:%02ds"), hrs, mins, secs);
+ snprintf (buf, sizeof(buf), _("Disk: %02dh:%02dm:%02ds"), hrs, mins, secs);
}
disk_space_label.set_text (buf);
@@ -1210,10 +1211,10 @@ ARDOUR_UI::toggle_record_enable (uint32_t dstream)
if ((r = session->route_by_remote_id (dstream)) != 0) {
- AudioTrack* at;
+ Track* t;
- if ((at = dynamic_cast<AudioTrack*>(r)) != 0) {
- at->disk_stream().set_record_enabled (!at->disk_stream().record_enabled(), this);
+ if ((t = dynamic_cast<Track*>(r)) != 0) {
+ t->diskstream().set_record_enabled (!t->diskstream().record_enabled(), this);
}
}
if (session == 0) {
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index dd4674b164..b84015623d 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -628,7 +628,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void toggle_record_enable (uint32_t);
uint32_t rec_enabled_diskstreams;
- void count_recenabled_diskstreams (ARDOUR::Diskstream&);
+ void count_recenabled_diskstreams (ARDOUR::Route*);
About* about;
bool shown_flag;
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index c48bda3a72..ebaf3fdc2c 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -230,8 +230,8 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt
audio_track()->FreezeChange.connect (mem_fun(*this, &AudioTimeAxisView::map_frozen));
- audio_track()->diskstream_changed.connect (mem_fun(*this, &AudioTimeAxisView::diskstream_changed));
- get_diskstream()->speed_changed.connect (mem_fun(*this, &AudioTimeAxisView::speed_changed));
+ audio_track()->DiskstreamChanged.connect (mem_fun(*this, &AudioTimeAxisView::diskstream_changed));
+ get_diskstream()->SpeedChanged.connect (mem_fun(*this, &AudioTimeAxisView::speed_changed));
controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
controls_base_selected_name = "AudioTrackControlsBaseSelected";
diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc
index f3e2ee1cb2..1dc3b8b5ef 100644
--- a/gtk2_ardour/editor_audio_import.cc
+++ b/gtk2_ardour/editor_audio_import.cc
@@ -314,7 +314,7 @@ int
case ImportToTrack:
if (track) {
- Playlist* playlist = track->disk_stream().playlist();
+ Playlist* playlist = track->diskstream().playlist();
AudioRegion* copy = new AudioRegion (region);
begin_reversible_command (_("insert sndfile"));
@@ -330,7 +330,7 @@ int
case ImportAsTrack:
AudioTrack* at = session->new_audio_track (in_chans, out_chans);
AudioRegion* copy = new AudioRegion (region);
- at->disk_stream().playlist()->add_region (*copy, pos);
+ at->diskstream().playlist()->add_region (*copy, pos);
break;
}
diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc
index 6ff467454d..8315834b93 100644
--- a/gtk2_ardour/editor_timefx.cc
+++ b/gtk2_ardour/editor_timefx.cc
@@ -184,7 +184,7 @@ Editor::do_timestretch (TimeStretchDialog& dialog)
continue;
}
- if ((playlist = at->disk_stream().playlist()) == 0) {
+ if ((playlist = at->diskstream().playlist()) == 0) {
i = tmp;
continue;
}
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 64e8acc392..2f55d3b79b 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -290,8 +290,8 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer)
_route.panner().Changed.connect (mem_fun(*this, &MixerStrip::connect_to_pan));
if (is_audio_track()) {
- audio_track()->diskstream_changed.connect (mem_fun(*this, &MixerStrip::diskstream_changed));
- get_diskstream()->speed_changed.connect (mem_fun(*this, &MixerStrip::speed_changed));
+ audio_track()->DiskstreamChanged.connect (mem_fun(*this, &MixerStrip::diskstream_changed));
+ get_diskstream()->SpeedChanged.connect (mem_fun(*this, &MixerStrip::speed_changed));
}
_route.name_changed.connect (mem_fun(*this, &RouteUI::name_changed));
@@ -558,11 +558,6 @@ MixerStrip::input_press (GdkEventButton *ev)
case 1:
-#if ADVANCED_ROUTE_DISKSTREAM_CONNECTIVITY
- if (is_audio_track()) {
- citems.push_back (MenuElem (_("Track"), mem_fun(*this, &MixerStrip::select_stream_input)));
- }
-#endif
citems.push_back (MenuElem (_("Edit"), mem_fun(*this, &MixerStrip::edit_input_configuration)));
citems.push_back (SeparatorElem());
citems.push_back (MenuElem (_("Disconnect"), mem_fun (*(static_cast<RouteUI*>(this)), &RouteUI::disconnect_input)));
@@ -660,43 +655,6 @@ MixerStrip::add_connection_to_output_menu (ARDOUR::Connection* c)
}
void
-MixerStrip::select_stream_input ()
-{
- using namespace Menu_Helpers;
-
- Menu *stream_menu = manage (new Menu);
- MenuList& items = stream_menu->items();
- stream_menu->set_name ("ArdourContextMenu");
-
- Session::DiskstreamList streams = _session.disk_streams();
-
- for (Session::DiskstreamList::iterator i = streams.begin(); i != streams.end(); ++i) {
- AudioDiskstream* ads = dynamic_cast<AudioDiskstream*>(*i);
-
- if (ads && !(*i)->hidden()) {
-
- items.push_back (CheckMenuElem (ads->name(), bind (mem_fun(*this, &MixerStrip::stream_input_chosen), ads)));
-
- if (get_diskstream() == ads) {
- ignore_toggle = true;
- static_cast<CheckMenuItem *> (&items.back())->set_active (true);
- ignore_toggle = false;
- }
- }
- }
-
- stream_menu->popup (1, 0);
-}
-
-void
-MixerStrip::stream_input_chosen (AudioDiskstream *stream)
-{
- if (is_audio_track()) {
- audio_track()->set_diskstream (*stream, this);
- }
-}
-
-void
MixerStrip::update_diskstream_display ()
{
if (is_audio_track()) {
diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h
index c914d12404..1f9095525a 100644
--- a/gtk2_ardour/mixer_strip.h
+++ b/gtk2_ardour/mixer_strip.h
@@ -171,8 +171,6 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
Gtk::Menu output_menu;
void add_connection_to_output_menu (ARDOUR::Connection *);
- void stream_input_chosen (ARDOUR::AudioDiskstream*);
- void select_stream_input ();
void connection_input_chosen (ARDOUR::Connection *);
void connection_output_chosen (ARDOUR::Connection *);
diff --git a/gtk2_ardour/playlist_selector.cc b/gtk2_ardour/playlist_selector.cc
index 9d000b7f27..ca3f4e97ba 100644
--- a/gtk2_ardour/playlist_selector.cc
+++ b/gtk2_ardour/playlist_selector.cc
@@ -243,7 +243,7 @@ PlaylistSelector::selection_changed ()
return;
}
- at->disk_stream().use_playlist (apl);
+ at->diskstream().use_playlist (apl);
hide ();
}
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index 34d7e995d6..b18bff46e9 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -75,7 +75,7 @@ RouteUI::RouteUI (ARDOUR::Route& rt, ARDOUR::Session& sess, const char* m_name,
if (is_audio_track()) {
AudioTrack* at = dynamic_cast<AudioTrack*>(&_route);
- get_diskstream()->record_enable_changed.connect (mem_fun (*this, &RouteUI::route_rec_enable_changed));
+ get_diskstream()->RecordEnableChanged.connect (mem_fun (*this, &RouteUI::route_rec_enable_changed));
_session.RecordStateChanged.connect (mem_fun (*this, &RouteUI::session_rec_enable_changed));
@@ -886,13 +886,10 @@ RouteUI::is_midi_track () const
Diskstream*
RouteUI::get_diskstream () const
{
- AudioTrack *at;
- MidiTrack *mt;
+ Track *t;
- if ((at = dynamic_cast<AudioTrack*>(&_route)) != 0) {
- return &at->disk_stream();
- } else if ((mt = dynamic_cast<MidiTrack*>(&_route)) != 0) {
- return &mt->disk_stream();
+ if ((t = dynamic_cast<Track*>(&_route)) != 0) {
+ return &t->diskstream();
} else {
return 0;
}
diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc
index 6e8f3d1ff3..dd37ba16ea 100644
--- a/gtk2_ardour/streamview.cc
+++ b/gtk2_ardour/streamview.cc
@@ -71,9 +71,9 @@ StreamView::StreamView (AudioTimeAxisView& tv)
_amplitude_above_axis = 1.0;
if (_trackview.is_audio_track()) {
- _trackview.audio_track()->diskstream_changed.connect (mem_fun (*this, &StreamView::diskstream_changed));
+ _trackview.audio_track()->DiskstreamChanged.connect (mem_fun (*this, &StreamView::diskstream_changed));
_trackview.session().TransportStateChange.connect (mem_fun (*this, &StreamView::transport_changed));
- _trackview.get_diskstream()->record_enable_changed.connect (mem_fun (*this, &StreamView::rec_enable_changed));
+ _trackview.get_diskstream()->RecordEnableChanged.connect (mem_fun (*this, &StreamView::rec_enable_changed));
_trackview.session().RecordStateChanged.connect (mem_fun (*this, &StreamView::sess_rec_enable_changed));
}
@@ -501,7 +501,7 @@ StreamView::diskstream_changed (void *src_ignored)
AudioTrack *at;
if ((at = _trackview.audio_track()) != 0) {
- AudioDiskstream& ds = at->disk_stream();
+ AudioDiskstream& ds = at->audio_diskstream();
/* XXX grrr: when will SigC++ allow me to bind references? */
Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun (*this, &StreamView::display_diskstream), &ds));
} else {
@@ -672,7 +672,7 @@ StreamView::setup_rec_box ()
AudioTrack* at;
at = _trackview.audio_track(); /* we know what it is already */
- AudioDiskstream& ds = at->disk_stream();
+ AudioDiskstream& ds = at->audio_diskstream();
jack_nframes_t frame_pos = ds.current_capture_start ();
gdouble xstart = _trackview.editor.frame_to_pixel (frame_pos);
gdouble xend;