summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-07 17:31:18 +0000
committerDavid Robillard <d@drobilla.net>2009-05-07 17:31:18 +0000
commit2c231282baa596219506c1ee4632708977cc0714 (patch)
treeb5dd7dedd8b5c9b7740b444711d26cdeb114687a /gtk2_ardour
parent80c8866303c405fb6230eb96f2a8cd7f181b57da (diff)
Returns (i.e. sidechains).
And lo, upon the revision of our hoarde 5061, was the last Big Feature committed to Three Poino, who, now more than ever, lurks imposingly on the sidelines, heir to the throne, and eventual ruler of the realm. His eventual succession all but guaranteed, only time and the number of heads that must roll remain mysteries. git-svn-id: svn://localhost/ardour2/branches/3.0@5061 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/SAE-us-keypad.bindings.in1
-rw-r--r--gtk2_ardour/ardour-sae.menus1
-rw-r--r--gtk2_ardour/ardour.menus.in2
-rw-r--r--gtk2_ardour/ergonomic-us.bindings.in1
-rw-r--r--gtk2_ardour/mnemonic-us.bindings.in1
-rw-r--r--gtk2_ardour/processor_box.cc151
-rw-r--r--gtk2_ardour/processor_box.h6
-rw-r--r--gtk2_ardour/return_ui.cc133
-rw-r--r--gtk2_ardour/return_ui.h77
-rw-r--r--gtk2_ardour/route_params_ui.cc83
-rw-r--r--gtk2_ardour/send_ui.cc49
-rw-r--r--gtk2_ardour/send_ui.h12
-rw-r--r--gtk2_ardour/wscript1
13 files changed, 435 insertions, 83 deletions
diff --git a/gtk2_ardour/SAE-us-keypad.bindings.in b/gtk2_ardour/SAE-us-keypad.bindings.in
index 88085b0968..a3b40c284a 100644
--- a/gtk2_ardour/SAE-us-keypad.bindings.in
+++ b/gtk2_ardour/SAE-us-keypad.bindings.in
@@ -424,6 +424,7 @@
; (gtk_accel_path "<Actions>/redirectmenu/newinsert" "")
; (gtk_accel_path "<Actions>/redirectmenu/newplugin" "")
; (gtk_accel_path "<Actions>/redirectmenu/newsend" "")
+; (gtk_accel_path "<Actions>/redirectmenu/newreturn" "")
; (gtk_accel_path "<Actions>/redirectmenu/paste" "")
; (gtk_accel_path "<Actions>/redirectmenu/rename" "")
; (gtk_accel_path "<Actions>/redirectmenu/selectall" "")
diff --git a/gtk2_ardour/ardour-sae.menus b/gtk2_ardour/ardour-sae.menus
index 2a73c4c16a..9d61bf7ebb 100644
--- a/gtk2_ardour/ardour-sae.menus
+++ b/gtk2_ardour/ardour-sae.menus
@@ -354,6 +354,7 @@
<menuitem action='newplugin'/>
<menuitem action='newinsert'/>
<menuitem action='newsend'/>
+ <menuitem action='newreturn'/>
<separator/>
<menuitem action='clear'/>
<separator/>
diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in
index c754590102..f17f8e2bd0 100644
--- a/gtk2_ardour/ardour.menus.in
+++ b/gtk2_ardour/ardour.menus.in
@@ -607,6 +607,7 @@
<menuitem action='newplugin'/>
<menuitem action='newinsert'/>
<menuitem action='newsend'/>
+ <menuitem action='newreturn'/>
<separator/>
<menuitem action='clear'/>
<separator/>
@@ -663,6 +664,7 @@
<menuitem action='newplugin'/>
<menuitem action='newinsert'/>
<menuitem action='newsend'/>
+ <menuitem action='newreturn'/>
<separator/>
<menuitem action='clear'/>
<separator/>
diff --git a/gtk2_ardour/ergonomic-us.bindings.in b/gtk2_ardour/ergonomic-us.bindings.in
index 523878bd3f..e657dcc1b8 100644
--- a/gtk2_ardour/ergonomic-us.bindings.in
+++ b/gtk2_ardour/ergonomic-us.bindings.in
@@ -129,6 +129,7 @@
; (gtk_accel_path "<Actions>/Editor/EditSelectRegionOptions" "")
(gtk_accel_path "<Actions>/Editor/crop" "c")
; (gtk_accel_path "<Actions>/redirectmenu/newsend" "")
+; (gtk_accel_path "<Actions>/redirectmenu/newreturn" "")
; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurfaceSubMenu" "")
; (gtk_accel_path "<Actions>/Editor/MeterFalloff" "")
; (gtk_accel_path "<Actions>/RegionList/rlRemove" "")
diff --git a/gtk2_ardour/mnemonic-us.bindings.in b/gtk2_ardour/mnemonic-us.bindings.in
index d6df9078cc..ed26ec2212 100644
--- a/gtk2_ardour/mnemonic-us.bindings.in
+++ b/gtk2_ardour/mnemonic-us.bindings.in
@@ -439,6 +439,7 @@
; (gtk_accel_path "<Actions>/Editor/playhead-to-range-end" "")
; (gtk_accel_path "<Actions>/Editor/EditSelectRegionOptions" "")
; (gtk_accel_path "<Actions>/redirectmenu/newsend" "")
+; (gtk_accel_path "<Actions>/redirectmenu/newreturn" "")
; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurfaceSubMenu" "")
; (gtk_accel_path "<Actions>/Editor/MeterFalloff" "")
; (gtk_accel_path "<Actions>/RegionList/rlRemove" "")
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index 2bf988aad9..3c2de7edd7 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -47,23 +47,26 @@
#include "ardour/plugin_insert.h"
#include "ardour/port_insert.h"
#include "ardour/profile.h"
+#include "ardour/return.h"
#include "ardour/route.h"
#include "ardour/send.h"
#include "ardour/session.h"
-#include "ardour_ui.h"
+#include "actions.h"
#include "ardour_dialog.h"
-#include "public_editor.h"
-#include "processor_box.h"
+#include "ardour_ui.h"
+#include "gui_thread.h"
+#include "io_selector.h"
#include "keyboard.h"
-#include "plugin_selector.h"
-#include "route_processor_selection.h"
#include "mixer_ui.h"
-#include "actions.h"
+#include "plugin_selector.h"
#include "plugin_ui.h"
-#include "io_selector.h"
+#include "processor_box.h"
+#include "public_editor.h"
+#include "return_ui.h"
+#include "route_processor_selection.h"
+#include "send_ui.h"
#include "utils.h"
-#include "gui_thread.h"
#include "i18n.h"
@@ -216,6 +219,7 @@ void
ProcessorBox::remove_processor_gui (boost::shared_ptr<Processor> processor)
{
boost::shared_ptr<Send> send;
+ boost::shared_ptr<Return> retrn;
boost::shared_ptr<PortInsert> port_insert;
if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (processor)) != 0) {
@@ -226,6 +230,10 @@ ProcessorBox::remove_processor_gui (boost::shared_ptr<Processor> processor)
SendUIWindow *sui = reinterpret_cast<SendUIWindow*> (send->get_gui());
send->set_gui (0);
delete sui;
+ } else if ((retrn = boost::dynamic_pointer_cast<Return> (processor)) != 0) {
+ ReturnUIWindow *rui = reinterpret_cast<ReturnUIWindow*> (retrn->get_gui());
+ retrn->set_gui (0);
+ delete rui;
}
}
@@ -495,20 +503,13 @@ void
ProcessorBox::choose_send ()
{
boost::shared_ptr<Send> send (new Send (_session));
- //send->set_default_type(_route->default_type());
-
- ChanCount outs;
/* make an educated guess at the initial number of outputs for the send */
-
- if (_session.master_out()) {
- outs = _session.master_out()->n_outputs();
- } else {
- outs = _route->n_outputs();
- }
+ ChanCount outs = (_session.master_out())
+ ? _session.master_out()->n_outputs()
+ : _route->n_outputs();
/* XXX need processor lock on route */
-
try {
send->io()->ensure_io (ChanCount::ZERO, outs, false, this);
} catch (AudioEngine::PortRegistrationFailure& err) {
@@ -516,23 +517,17 @@ ProcessorBox::choose_send ()
return;
}
- /* let the user adjust the output setup (number and connections) before passing
- it along to the Route
- */
-
+ /* let the user adjust the IO setup before creation */
IOSelectorWindow *ios = new IOSelectorWindow (_session, send->io(), false, true);
-
ios->show_all ();
- /* bit of a hack; keep a shared_ptr to send around so that it doesn't get deleted while
+ /* keep a reference to the send so it doesn't get deleted while
the IOSelectorWindow is doing its stuff */
- _send_being_created = send;
-
- boost::shared_ptr<Processor> r = boost::static_pointer_cast<Processor>(send);
+ _processor_being_created = send;
ios->selector().Finished.connect (bind (
mem_fun(*this, &ProcessorBox::send_io_finished),
- boost::weak_ptr<Processor>(r), ios));
+ boost::weak_ptr<Processor>(send), ios));
}
void
@@ -540,8 +535,65 @@ ProcessorBox::send_io_finished (IOSelector::Result r, boost::weak_ptr<Processor>
{
boost::shared_ptr<Processor> processor (weak_processor.lock());
- /* now we can lose the dummy shared_ptr */
- _send_being_created.reset ();
+ /* drop our temporary reference to the new send */
+ _processor_being_created.reset ();
+
+ if (!processor) {
+ return;
+ }
+
+ switch (r) {
+ case IOSelector::Cancelled:
+ // processor will go away when all shared_ptrs to it vanish
+ break;
+
+ case IOSelector::Accepted:
+ _route->add_processor (processor, 0, 0, _placement);
+ if (Profile->get_sae()) {
+ processor->activate ();
+ }
+ break;
+ }
+
+ delete_when_idle (ios);
+}
+
+void
+ProcessorBox::choose_return ()
+{
+ boost::shared_ptr<Return> retrn (new Return (_session));
+
+ /* assume user just wants a single audio input (sidechain) by default */
+ ChanCount ins(DataType::AUDIO, 1);
+
+ /* XXX need processor lock on route */
+ try {
+ retrn->io()->ensure_io (ins, ChanCount::ZERO, false, this);
+ } catch (AudioEngine::PortRegistrationFailure& err) {
+ error << string_compose (_("Cannot set up new return: %1"), err.what()) << endmsg;
+ return;
+ }
+
+ /* let the user adjust the IO setup before creation */
+ IOSelectorWindow *ios = new IOSelectorWindow (_session, retrn->io(), true, true);
+ ios->show_all ();
+
+ /* keep a reference to the send so it doesn't get deleted while
+ the IOSelectorWindow is doing its stuff */
+ _processor_being_created = retrn;
+
+ ios->selector().Finished.connect (bind (
+ mem_fun(*this, &ProcessorBox::return_io_finished),
+ boost::weak_ptr<Processor>(retrn), ios));
+}
+
+void
+ProcessorBox::return_io_finished (IOSelector::Result r, boost::weak_ptr<Processor> weak_processor, IOSelectorWindow* ios)
+{
+ boost::shared_ptr<Processor> processor (weak_processor.lock());
+
+ /* drop our temporary reference to the new return */
+ _processor_being_created.reset ();
if (!processor) {
return;
@@ -1067,6 +1119,7 @@ void
ProcessorBox::edit_processor (boost::shared_ptr<Processor> processor)
{
boost::shared_ptr<Send> send;
+ boost::shared_ptr<Return> retrn;
boost::shared_ptr<PluginInsert> plugin_insert;
boost::shared_ptr<PortInsert> port_insert;
Window* gidget = 0;
@@ -1103,6 +1156,32 @@ ProcessorBox::edit_processor (boost::shared_ptr<Processor> processor)
}
gidget = send_ui;
+
+ } else if ((retrn = boost::dynamic_pointer_cast<Return> (processor)) != 0) {
+
+ if (!_session.engine().connected()) {
+ return;
+ }
+
+ boost::shared_ptr<Return> retrn = boost::dynamic_pointer_cast<Return> (processor);
+
+ ReturnUIWindow *return_ui;
+
+ if (retrn->get_gui() == 0) {
+
+ return_ui = new ReturnUIWindow (retrn, _session);
+
+ WindowTitle title(Glib::get_application_name());
+ title += retrn->name();
+ return_ui->set_title (title.get_string());
+
+ send->set_gui (return_ui);
+
+ } else {
+ return_ui = reinterpret_cast<ReturnUIWindow *> (retrn->get_gui());
+ }
+
+ gidget = return_ui;
} else if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (processor)) != 0) {
@@ -1194,6 +1273,9 @@ ProcessorBox::register_actions ()
act = ActionManager::register_action (popup_act_grp, X_("newsend"), _("New Send ..."),
sigc::ptr_fun (ProcessorBox::rb_choose_send));
ActionManager::jack_sensitive_actions.push_back (act);
+ act = ActionManager::register_action (popup_act_grp, X_("newreturn"), _("New Return ..."),
+ sigc::ptr_fun (ProcessorBox::rb_choose_return));
+ ActionManager::jack_sensitive_actions.push_back (act);
ActionManager::register_action (popup_act_grp, X_("clear"), _("Clear"),
sigc::ptr_fun (ProcessorBox::rb_clear));
@@ -1268,6 +1350,15 @@ ProcessorBox::rb_choose_send ()
}
void
+ProcessorBox::rb_choose_return ()
+{
+ if (_current_processor_box == 0) {
+ return;
+ }
+ _current_processor_box->choose_return ();
+}
+
+void
ProcessorBox::rb_clear ()
{
if (_current_processor_box == 0) {
diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h
index ea908133e3..37c442d283 100644
--- a/gtk2_ardour/processor_box.h
+++ b/gtk2_ardour/processor_box.h
@@ -94,8 +94,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject
bool ab_direction;
std::vector<sigc::connection> connections;
- /// a send that is in the process of creation
- boost::shared_ptr<ARDOUR::Send> _send_being_created;
+ boost::shared_ptr<ARDOUR::Processor> _processor_being_created;
ARDOUR::Placement _placement;
@@ -147,6 +146,8 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject
void choose_send ();
void send_io_finished (IOSelector::Result, boost::weak_ptr<ARDOUR::Processor>, IOSelectorWindow*);
+ void choose_return ();
+ void return_io_finished (IOSelector::Result, boost::weak_ptr<ARDOUR::Processor>, IOSelectorWindow*);
void choose_insert ();
void choose_plugin ();
void use_plugins (const SelectedPlugins&);
@@ -209,6 +210,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject
static void rb_choose_plugin ();
static void rb_choose_insert ();
static void rb_choose_send ();
+ static void rb_choose_return ();
static void rb_clear ();
static void rb_cut ();
static void rb_copy ();
diff --git a/gtk2_ardour/return_ui.cc b/gtk2_ardour/return_ui.cc
new file mode 100644
index 0000000000..5423415bd2
--- /dev/null
+++ b/gtk2_ardour/return_ui.cc
@@ -0,0 +1,133 @@
+/*
+ Copyright (C) 2002 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <gtkmm2ext/doi.h>
+
+#include "ardour/io.h"
+#include "ardour/return.h"
+
+#include "utils.h"
+#include "return_ui.h"
+#include "io_selector.h"
+#include "ardour_ui.h"
+#include "gui_thread.h"
+
+using namespace ARDOUR;
+using namespace PBD;
+
+ReturnUI::ReturnUI (boost::shared_ptr<Return> r, Session& se)
+ : _return (r)
+ , _session (se)
+ , _gpm (se)
+{
+ _gpm.set_io (r->io());
+
+ _hbox.pack_start (_gpm, true, true);
+ set_name ("ReturnUIFrame");
+
+ _vbox.set_spacing (5);
+ _vbox.set_border_width (5);
+
+ _vbox.pack_start (_hbox, false, false, false);
+
+ io = manage (new IOSelector (se, r->io(), true));
+
+ pack_start (_vbox, false, false);
+
+ pack_start (*io, true, true);
+
+ show_all ();
+
+ //_return->set_metering (true);
+
+ _return->io()->input_changed.connect (mem_fun (*this, &ReturnUI::ins_changed));
+ //_return->io()->output_changed.connect (mem_fun (*this, &ReturnUI::outs_changed));
+
+ _gpm.setup_meters ();
+ _gpm.set_fader_name ("ReturnUIFrame");
+
+ // screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect (mem_fun (*this, &ReturnUI::update));
+ fast_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (mem_fun (*this, &ReturnUI::fast_update));
+}
+
+ReturnUI::~ReturnUI ()
+{
+ //_return->set_metering (false);
+
+ /* XXX not clear that we need to do this */
+
+ screen_update_connection.disconnect();
+ fast_screen_update_connection.disconnect();
+}
+
+void
+ReturnUI::ins_changed (IOChange change, void* ignored)
+{
+ ENSURE_GUI_THREAD(bind (mem_fun (*this, &ReturnUI::ins_changed), change, ignored));
+ if (change & ConfigurationChanged) {
+ _gpm.setup_meters ();
+ }
+}
+
+void
+ReturnUI::update ()
+{
+}
+
+void
+ReturnUI::fast_update ()
+{
+ if (Config->get_meter_falloff() > 0.0f) {
+ _gpm.update_meters ();
+ }
+}
+
+ReturnUIWindow::ReturnUIWindow (boost::shared_ptr<Return> s, Session& ss)
+ : ArdourDialog (string("Ardour: return ") + s->name())
+{
+ ui = new ReturnUI (s, ss);
+
+ hpacker.pack_start (*ui, true, true);
+
+ get_vbox()->set_border_width (5);
+ get_vbox()->pack_start (hpacker);
+
+ set_name ("ReturnUIWindow");
+
+ going_away_connection = s->GoingAway.connect (
+ mem_fun (*this, &ReturnUIWindow::return_going_away));
+
+ signal_delete_event().connect (bind (
+ ptr_fun (just_hide_it),
+ reinterpret_cast<Window *> (this)));
+}
+
+ReturnUIWindow::~ReturnUIWindow ()
+{
+ delete ui;
+}
+
+void
+ReturnUIWindow::return_going_away ()
+{
+ ENSURE_GUI_THREAD (mem_fun (*this, &ReturnUIWindow::return_going_away));
+ delete_when_idle (this);
+ going_away_connection.disconnect ();
+}
+
diff --git a/gtk2_ardour/return_ui.h b/gtk2_ardour/return_ui.h
new file mode 100644
index 0000000000..08c6bba5ba
--- /dev/null
+++ b/gtk2_ardour/return_ui.h
@@ -0,0 +1,77 @@
+/*
+ Copyright (C) 2002 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __ardour_gtk_return_ui_h__
+#define __ardour_gtk_return_ui_h__
+
+#include "gain_meter.h"
+#include "panner_ui.h"
+#include "ardour_dialog.h"
+
+namespace ARDOUR {
+ class Return;
+ class Session;
+ class IOProcessor;
+}
+
+class IOSelector;
+
+class ReturnUI : public Gtk::HBox
+{
+ public:
+ ReturnUI (boost::shared_ptr<ARDOUR::Return>, ARDOUR::Session&);
+ ~ReturnUI();
+
+ void update ();
+ void fast_update ();
+
+ IOSelector* io;
+
+ boost::shared_ptr<ARDOUR::Return>& retrn() { return _return; }
+
+ private:
+ boost::shared_ptr<ARDOUR::Return> _return;
+ ARDOUR::Session& _session;
+ GainMeter _gpm;
+ Gtk::VBox _vbox;
+ Gtk::VBox _hbox;
+
+ sigc::connection screen_update_connection;
+ sigc::connection fast_screen_update_connection;
+
+ void ins_changed (ARDOUR::IOChange, void*);
+};
+
+class ReturnUIWindow : public ArdourDialog
+{
+ public:
+ ReturnUIWindow(boost::shared_ptr<ARDOUR::Return>, ARDOUR::Session&);
+ ~ReturnUIWindow();
+
+ ReturnUI* ui;
+
+ private:
+ Gtk::HBox hpacker;
+
+ void return_going_away ();
+ sigc::connection going_away_connection;
+};
+
+#endif /* __ardour_gtk_return_ui_h__ */
+
diff --git a/gtk2_ardour/route_params_ui.cc b/gtk2_ardour/route_params_ui.cc
index 37639a9985..33a99f6955 100644
--- a/gtk2_ardour/route_params_ui.cc
+++ b/gtk2_ardour/route_params_ui.cc
@@ -26,29 +26,31 @@
#include <gtkmm2ext/stop_signal.h>
#include <gtkmm2ext/window_title.h>
-#include "ardour/session.h"
-#include "ardour/session_route.h"
+#include "ardour/ardour.h"
#include "ardour/audio_diskstream.h"
+#include "ardour/audio_track.h"
#include "ardour/plugin.h"
+#include "ardour/plugin_insert.h"
#include "ardour/plugin_manager.h"
-#include "ardour/ardour.h"
-#include "ardour/session.h"
+#include "ardour/port_insert.h"
+#include "ardour/return.h"
#include "ardour/route.h"
-#include "ardour/audio_track.h"
#include "ardour/send.h"
-#include "ardour/plugin_insert.h"
-#include "ardour/port_insert.h"
+#include "ardour/session.h"
+#include "ardour/session.h"
+#include "ardour/session_route.h"
-#include "route_params_ui.h"
+#include "ardour_ui.h"
+#include "gui_thread.h"
+#include "io_selector.h"
#include "keyboard.h"
#include "mixer_strip.h"
#include "plugin_selector.h"
-#include "ardour_ui.h"
#include "plugin_ui.h"
-#include "io_selector.h"
+#include "return_ui.h"
+#include "route_params_ui.h"
#include "send_ui.h"
#include "utils.h"
-#include "gui_thread.h"
#include "i18n.h"
@@ -559,6 +561,7 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> insert,
}
boost::shared_ptr<Send> send;
+ boost::shared_ptr<Return> retrn;
boost::shared_ptr<PluginInsert> plugin_insert;
boost::shared_ptr<PortInsert> port_insert;
@@ -568,35 +571,66 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> insert,
if (place == PreFader) {
cleanup_pre_view();
- _pre_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
+ _pre_plugin_conn = send->GoingAway.connect (bind (
+ mem_fun(*this, &RouteParams_UI::redirect_going_away),
+ insert));
_active_pre_view = send_ui;
pre_redir_hpane.add2 (*_active_pre_view);
pre_redir_hpane.show_all();
- }
- else {
+ } else {
cleanup_post_view();
- _post_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
+ _post_plugin_conn = send->GoingAway.connect (bind (
+ mem_fun(*this, &RouteParams_UI::redirect_going_away),
+ insert));
_active_post_view = send_ui;
post_redir_hpane.add2 (*_active_post_view);
post_redir_hpane.show_all();
}
+
+ } else if ((retrn = boost::dynamic_pointer_cast<Return> (insert)) != 0) {
+
+ ReturnUI *return_ui = new ReturnUI (retrn, *session);
+
+ if (place == PreFader) {
+ cleanup_pre_view();
+ _pre_plugin_conn = retrn->GoingAway.connect (bind (
+ mem_fun(*this, &RouteParams_UI::redirect_going_away),
+ insert));
+ _active_pre_view = return_ui;
+
+ pre_redir_hpane.add2 (*_active_pre_view);
+ pre_redir_hpane.show_all();
+ } else {
+ cleanup_post_view();
+ _post_plugin_conn = retrn->GoingAway.connect (bind (
+ mem_fun(*this, &RouteParams_UI::redirect_going_away),
+ insert));
+ _active_post_view = return_ui;
+
+ post_redir_hpane.add2 (*_active_post_view);
+ post_redir_hpane.show_all();
+ }
+
} else if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) {
GenericPluginUI *plugin_ui = new GenericPluginUI (plugin_insert, true);
if (place == PreFader) {
cleanup_pre_view();
- _pre_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PreFader));
+ _pre_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (
+ mem_fun(*this, &RouteParams_UI::plugin_going_away),
+ PreFader));
plugin_ui->start_updating (0);
_active_pre_view = plugin_ui;
pre_redir_hpane.pack2 (*_active_pre_view);
pre_redir_hpane.show_all();
- }
- else {
+ } else {
cleanup_post_view();
- _post_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PostFader));
+ _post_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (
+ mem_fun(*this, &RouteParams_UI::plugin_going_away),
+ PostFader));
plugin_ui->start_updating (0);
_active_post_view = plugin_ui;
post_redir_hpane.pack2 (*_active_post_view);
@@ -609,15 +643,18 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> insert,
if (place == PreFader) {
cleanup_pre_view();
- _pre_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
+ _pre_plugin_conn = port_insert->GoingAway.connect (bind (
+ mem_fun(*this, &RouteParams_UI::redirect_going_away),
+ insert));
_active_pre_view = portinsert_ui;
pre_redir_hpane.pack2 (*_active_pre_view);
portinsert_ui->redisplay();
pre_redir_hpane.show_all();
- }
- else {
+ } else {
cleanup_post_view();
- _post_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
+ _post_plugin_conn = port_insert->GoingAway.connect (bind (
+ mem_fun(*this, &RouteParams_UI::redirect_going_away),
+ insert));
_active_post_view = portinsert_ui;
post_redir_hpane.pack2 (*_active_post_view);
portinsert_ui->redisplay();
diff --git a/gtk2_ardour/send_ui.cc b/gtk2_ardour/send_ui.cc
index 1014f5a07a..664092d39f 100644
--- a/gtk2_ardour/send_ui.cc
+++ b/gtk2_ardour/send_ui.cc
@@ -34,24 +34,24 @@ using namespace PBD;
SendUI::SendUI (boost::shared_ptr<Send> s, Session& se)
: _send (s)
, _session (se)
- , gpm (se)
- , panners (se)
+ , _gpm (se)
+ , _panners (se)
{
- panners.set_io (s->io());
- gpm.set_io (s->io());
+ _panners.set_io (s->io());
+ _gpm.set_io (s->io());
- hbox.pack_start (gpm, true, true);
+ _hbox.pack_start (_gpm, true, true);
set_name ("SendUIFrame");
- vbox.set_spacing (5);
- vbox.set_border_width (5);
+ _vbox.set_spacing (5);
+ _vbox.set_border_width (5);
- vbox.pack_start (hbox, false, false, false);
- vbox.pack_start (panners, false,false);
+ _vbox.pack_start (_hbox, false, false, false);
+ _vbox.pack_start (_panners, false,false);
io = manage (new IOSelector (se, s->io(), true));
- pack_start (vbox, false, false);
+ pack_start (_vbox, false, false);
pack_start (*io, true, true);
@@ -62,14 +62,16 @@ SendUI::SendUI (boost::shared_ptr<Send> s, Session& se)
_send->io()->input_changed.connect (mem_fun (*this, &SendUI::ins_changed));
_send->io()->output_changed.connect (mem_fun (*this, &SendUI::outs_changed));
- panners.set_width (Wide);
- panners.setup_pan ();
+ _panners.set_width (Wide);
+ _panners.setup_pan ();
- gpm.setup_meters ();
- gpm.set_fader_name ("SendUIFrame");
+ _gpm.setup_meters ();
+ _gpm.set_fader_name ("SendUIFrame");
- // screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect (mem_fun (*this, &SendUI::update));
- fast_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (mem_fun (*this, &SendUI::fast_update));
+ // screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect (
+ // mem_fun (*this, &SendUI::update));
+ fast_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (
+ mem_fun (*this, &SendUI::fast_update));
}
SendUI::~SendUI ()
@@ -87,7 +89,7 @@ SendUI::ins_changed (IOChange change, void* ignored)
{
ENSURE_GUI_THREAD(bind (mem_fun (*this, &SendUI::ins_changed), change, ignored));
if (change & ConfigurationChanged) {
- panners.setup_pan ();
+ _panners.setup_pan ();
}
}
@@ -96,8 +98,8 @@ SendUI::outs_changed (IOChange change, void* ignored)
{
ENSURE_GUI_THREAD(bind (mem_fun (*this, &SendUI::outs_changed), change, ignored));
if (change & ConfigurationChanged) {
- panners.setup_pan ();
- gpm.setup_meters ();
+ _panners.setup_pan ();
+ _gpm.setup_meters ();
}
}
@@ -110,7 +112,7 @@ void
SendUI::fast_update ()
{
if (Config->get_meter_falloff() > 0.0f) {
- gpm.update_meters ();
+ _gpm.update_meters ();
}
}
@@ -126,9 +128,12 @@ SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session& ss)
set_name ("SendUIWindow");
- going_away_connection = s->GoingAway.connect (mem_fun (*this, &SendUIWindow::send_going_away));
+ going_away_connection = s->GoingAway.connect (
+ mem_fun (*this, &SendUIWindow::send_going_away));
- signal_delete_event().connect (bind (ptr_fun (just_hide_it), reinterpret_cast<Window *> (this)));
+ signal_delete_event().connect (bind (
+ ptr_fun (just_hide_it),
+ reinterpret_cast<Window *> (this)));
}
SendUIWindow::~SendUIWindow ()
diff --git a/gtk2_ardour/send_ui.h b/gtk2_ardour/send_ui.h
index 0d6356970e..284f078234 100644
--- a/gtk2_ardour/send_ui.h
+++ b/gtk2_ardour/send_ui.h
@@ -47,11 +47,11 @@ class SendUI : public Gtk::HBox
private:
boost::shared_ptr<ARDOUR::Send> _send;
- ARDOUR::Session& _session;
- GainMeter gpm;
- PannerUI panners;
- Gtk::VBox vbox;
- Gtk::VBox hbox;
+ ARDOUR::Session& _session;
+ GainMeter _gpm;
+ PannerUI _panners;
+ Gtk::VBox _vbox;
+ Gtk::VBox _hbox;
sigc::connection screen_update_connection;
sigc::connection fast_screen_update_connection;
@@ -66,7 +66,7 @@ class SendUIWindow : public ArdourDialog
SendUIWindow(boost::shared_ptr<ARDOUR::Send>, ARDOUR::Session&);
~SendUIWindow();
- SendUI* ui;
+ SendUI* ui;
private:
Gtk::HBox hpacker;
diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript
index 8bb973c4e6..56df15b846 100644
--- a/gtk2_ardour/wscript
+++ b/gtk2_ardour/wscript
@@ -182,6 +182,7 @@ def build(bld):
region_gain_line.cc
region_selection.cc
region_view.cc
+ return_ui.cc
rhythm_ferret.cc
route_params_ui.cc
route_processor_selection.cc