summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r--gtk2_ardour/ardour_ui.cc83
1 files changed, 8 insertions, 75 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index c91ab34ff6..8a7e24aeee 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -1200,35 +1200,25 @@ ARDOUR_UI::transport_forward (int option)
}
void
-ARDOUR_UI::toggle_monitor_enable (guint32 dstream)
+ARDOUR_UI::toggle_record_enable (uint32_t dstream)
{
if (session == 0) {
return;
}
- Diskstream *ds;
+ Route* r;
+
+ if ((r = session->route_by_remote_id (dstream)) != 0) {
+
+ AudioTrack* at;
- if ((ds = session->diskstream_by_id (dstream)) != 0) {
- AudioDiskstream *ads = dynamic_cast<AudioDiskstream*>(ds);
- if (ads) {
- Port *port = ds->io()->input (0);
- port->request_monitor_input (!port->monitoring_input());
+ if ((at = dynamic_cast<AudioTrack*>(r)) != 0) {
+ at->disk_stream().set_record_enabled (!at->disk_stream().record_enabled(), this);
}
}
-}
-
-void
-ARDOUR_UI::toggle_record_enable (guint32 dstream)
-{
if (session == 0) {
return;
}
-
- Diskstream *ds;
-
- if ((ds = session->diskstream_by_id (dstream)) != 0) {
- ds->set_record_enabled (!ds->record_enabled(), this);
- }
}
void
@@ -1429,63 +1419,6 @@ ARDOUR_UI::stop_blinking ()
}
}
-
-void
-ARDOUR_UI::add_diskstream_to_menu (Diskstream& dstream)
-{
- using namespace Gtk;
- using namespace Menu_Helpers;
-
- if (dstream.hidden()) {
- return;
- }
-
- MenuList& items = diskstream_menu->items();
- items.push_back (MenuElem (dstream.name(), bind (mem_fun(*this, &ARDOUR_UI::diskstream_selected), (gint32) dstream.id())));
-}
-
-void
-ARDOUR_UI::diskstream_selected (gint32 id)
-{
- selected_dstream = id;
- Main::quit ();
-}
-
-gint32
-ARDOUR_UI::select_diskstream (GdkEventButton *ev)
-{
- using namespace Gtk;
- using namespace Menu_Helpers;
-
- if (session == 0) {
- return -1;
- }
-
- diskstream_menu = new Menu();
- diskstream_menu->set_name ("ArdourContextMenu");
- using namespace Gtk;
- using namespace Menu_Helpers;
-
- MenuList& items = diskstream_menu->items();
- items.push_back (MenuElem (_("No Stream"), (bind (mem_fun(*this, &ARDOUR_UI::diskstream_selected), -1))));
-
- session->foreach_diskstream (this, &ARDOUR_UI::add_diskstream_to_menu);
-
- if (ev) {
- diskstream_menu->popup (ev->button, ev->time);
- } else {
- diskstream_menu->popup (0, 0);
- }
-
- selected_dstream = -1;
-
- Main::run ();
-
- delete diskstream_menu;
-
- return selected_dstream;
-}
-
void
ARDOUR_UI::name_io_setup (AudioEngine& engine,
string& buf,