summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2007-10-08 23:47:35 +0000
committerCarl Hetherington <carl@carlh.net>2007-10-08 23:47:35 +0000
commit4d66204f4eb96ca802e9b301293ff4bd922717d0 (patch)
treee9ec9784f4cd1fd7673c783703221a6a53242e76 /gtk2_ardour
parent3f38e6b7f56ad85891d3669e0f1c58e6124b07f6 (diff)
Various work on Bundles, especially dynamic ones so that you can, for example, pass tracks to busses by selecting the buss name from the track's output menu.
git-svn-id: svn://localhost/ardour2/trunk@2530 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/mixer_strip.cc50
-rw-r--r--gtk2_ardour/mixer_strip.h8
2 files changed, 31 insertions, 27 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 3fd53c8633..dfe5a268fa 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -43,7 +43,6 @@
#include <ardour/processor.h>
#include <ardour/ladspa_plugin.h>
#include <ardour/bundle.h>
-#include <ardour/session_bundle.h>
#include "ardour_ui.h"
#include "ardour_dialog.h"
@@ -549,7 +548,9 @@ MixerStrip::output_press (GdkEventButton *ev)
citems.push_back (MenuElem (_("Disconnect"), mem_fun (*(static_cast<RouteUI*>(this)), &RouteUI::disconnect_output)));
citems.push_back (SeparatorElem());
- _session.foreach_bundle (this, &MixerStrip::add_bundle_to_output_menu);
+ _session.foreach_bundle (
+ bind (mem_fun (*this, &MixerStrip::add_bundle_to_output_menu), _route->output_bundle ())
+ );
output_menu.popup (1, ev->time);
break;
@@ -611,7 +612,9 @@ MixerStrip::input_press (GdkEventButton *ev)
citems.push_back (MenuElem (_("Disconnect"), mem_fun (*(static_cast<RouteUI*>(this)), &RouteUI::disconnect_input)));
citems.push_back (SeparatorElem());
- _session.foreach_bundle (this, &MixerStrip::add_bundle_to_input_menu);
+ _session.foreach_bundle (
+ bind (mem_fun (*this, &MixerStrip::add_bundle_to_input_menu), _route->input_bundle ())
+ );
input_menu.popup (1, ev->time);
break;
@@ -623,12 +626,12 @@ MixerStrip::input_press (GdkEventButton *ev)
}
void
-MixerStrip::bundle_input_chosen (ARDOUR::Bundle *c)
+MixerStrip::bundle_input_chosen (boost::shared_ptr<ARDOUR::Bundle> c)
{
if (!ignore_toggle) {
try {
- _route->use_input_bundle (*c, this);
+ _route->connect_input_ports_to_bundle (c, this);
}
catch (AudioEngine::PortRegistrationFailure& err) {
@@ -639,12 +642,12 @@ MixerStrip::bundle_input_chosen (ARDOUR::Bundle *c)
}
void
-MixerStrip::bundle_output_chosen (ARDOUR::Bundle *c)
+MixerStrip::bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle> c)
{
if (!ignore_toggle) {
try {
- _route->use_output_bundle (*c, this);
+ _route->connect_output_ports_to_bundle (c, this);
}
catch (AudioEngine::PortRegistrationFailure& err) {
@@ -655,23 +658,23 @@ MixerStrip::bundle_output_chosen (ARDOUR::Bundle *c)
}
void
-MixerStrip::add_bundle_to_input_menu (ARDOUR::Bundle* c)
+MixerStrip::add_bundle_to_input_menu (boost::shared_ptr<Bundle> b, boost::shared_ptr<Bundle> current)
{
using namespace Menu_Helpers;
- if (dynamic_cast<InputBundle *> (c) == 0) {
+ /* the input menu needs to contain only output bundles (that we
+ can connect inputs to */
+ if (boost::dynamic_pointer_cast<OutputBundle, Bundle> (b) == 0) {
return;
}
MenuList& citems = input_menu.items();
- if (c->nchannels() == _route->n_inputs().n_total()) {
+ if (b->nchannels() == _route->n_inputs().n_total()) {
- citems.push_back (CheckMenuElem (c->name(), bind (mem_fun(*this, &MixerStrip::bundle_input_chosen), c)));
+ citems.push_back (CheckMenuElem (b->name(), bind (mem_fun(*this, &MixerStrip::bundle_input_chosen), b)));
- ARDOUR::Bundle *current = _route->input_bundle();
-
- if (current == c) {
+ if (current == b) {
ignore_toggle = true;
dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true);
ignore_toggle = false;
@@ -680,22 +683,23 @@ MixerStrip::add_bundle_to_input_menu (ARDOUR::Bundle* c)
}
void
-MixerStrip::add_bundle_to_output_menu (ARDOUR::Bundle* c)
+MixerStrip::add_bundle_to_output_menu (boost::shared_ptr<Bundle> b, boost::shared_ptr<Bundle> current)
{
using namespace Menu_Helpers;
- if (dynamic_cast<OutputBundle *> (c) == 0) {
+ /* the output menu needs to contain only input bundles (that we
+ can connect outputs to */
+ if (boost::dynamic_pointer_cast<InputBundle, Bundle> (b) == 0) {
return;
}
- if (c->nchannels() == _route->n_outputs().n_total()) {
+
+ if (b->nchannels() == _route->n_outputs().n_total()) {
MenuList& citems = output_menu.items();
- citems.push_back (CheckMenuElem (c->name(), bind (mem_fun(*this, &MixerStrip::bundle_output_chosen), c)));
-
- ARDOUR::Bundle *current = _route->output_bundle();
+ citems.push_back (CheckMenuElem (b->name(), bind (mem_fun(*this, &MixerStrip::bundle_output_chosen), b)));
- if (current == c) {
+ if (current == b) {
ignore_toggle = true;
dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true);
ignore_toggle = false;
@@ -748,7 +752,7 @@ MixerStrip::connect_to_pan ()
void
MixerStrip::update_input_display ()
{
- ARDOUR::Bundle *c;
+ boost::shared_ptr<ARDOUR::Bundle> c;
if ((c = _route->input_bundle()) != 0) {
input_label.set_text (c->name());
@@ -768,7 +772,7 @@ MixerStrip::update_input_display ()
void
MixerStrip::update_output_display ()
{
- ARDOUR::Bundle *c;
+ boost::shared_ptr<ARDOUR::Bundle> c;
if ((c = _route->output_bundle()) != 0) {
output_label.set_text (c->name());
diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h
index b7bd20cfbd..9702ea09d8 100644
--- a/gtk2_ardour/mixer_strip.h
+++ b/gtk2_ardour/mixer_strip.h
@@ -168,13 +168,13 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
gint output_press (GdkEventButton *);
Gtk::Menu input_menu;
- void add_bundle_to_input_menu (ARDOUR::Bundle *);
+ void add_bundle_to_input_menu (boost::shared_ptr<ARDOUR::Bundle>, boost::shared_ptr<ARDOUR::Bundle>);
Gtk::Menu output_menu;
- void add_bundle_to_output_menu (ARDOUR::Bundle *);
+ void add_bundle_to_output_menu (boost::shared_ptr<ARDOUR::Bundle>, boost::shared_ptr<ARDOUR::Bundle>);
- void bundle_input_chosen (ARDOUR::Bundle *);
- void bundle_output_chosen (ARDOUR::Bundle *);
+ void bundle_input_chosen (boost::shared_ptr<ARDOUR::Bundle>);
+ void bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle>);
void edit_input_configuration ();
void edit_output_configuration ();