summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-06-20 03:05:16 +0000
committerDavid Robillard <d@drobilla.net>2007-06-20 03:05:16 +0000
commit8ae580427987b4eefc102f3e801c1b76fdc74d48 (patch)
tree52d9ffe3e964bc96d60dae929c5c3c834bccf107 /gtk2_ardour
parent996d59663f83200c0716f1ba7bccc486d52bee7e (diff)
Made plugin input/output counts multi-typed (towards MIDI plugins, instruments, etc).
Cleaning up/genericification of Insert interface. Fixed meter count for pre-fader metering (was # inputs, not # channels at end of pre-fader redirect list). Work on redirect list stream handling, better error reporting (towards automatically adding 'adaptors' in the future?). git-svn-id: svn://localhost/ardour2/trunk@2025 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/gain_meter.cc4
-rw-r--r--gtk2_ardour/plugin_selector.cc4
-rw-r--r--gtk2_ardour/redirect_box.cc26
-rw-r--r--gtk2_ardour/redirect_box.h2
4 files changed, 19 insertions, 17 deletions
diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc
index c9e26d1b5f..bb925d8f8e 100644
--- a/gtk2_ardour/gain_meter.cc
+++ b/gtk2_ardour/gain_meter.cc
@@ -425,10 +425,12 @@ GainMeter::setup_meters ()
if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
switch (r->meter_point()) {
- case MeterPreFader:
case MeterInput:
nmeters = r->n_inputs().n_total();
break;
+ case MeterPreFader:
+ nmeters = r->pre_fader_streams().n_total();
+ break;
case MeterPostFader:
nmeters = r->n_outputs().n_total();
break;
diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc
index 1283837e0c..7333e45242 100644
--- a/gtk2_ardour/plugin_selector.cc
+++ b/gtk2_ardour/plugin_selector.cc
@@ -270,8 +270,8 @@ PluginSelector::input_refiller ()
// Insert into GTK list
for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) {
- snprintf (ibuf, sizeof(ibuf)-1, "%d", (*i)->n_inputs);
- snprintf (obuf, sizeof(obuf)-1, "%d", (*i)->n_outputs);
+ snprintf (ibuf, sizeof(ibuf)-1, "%zu", (*i)->n_inputs.n_total());
+ snprintf (obuf, sizeof(obuf)-1, "%zu", (*i)->n_outputs.n_total());
Gtk::TreeModel::Row newrow = *(lmodel->append());
newrow[lcols.name] = (*i)->name.c_str();
diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc
index 9533cbf782..30bec50a19 100644
--- a/gtk2_ardour/redirect_box.cc
+++ b/gtk2_ardour/redirect_box.cc
@@ -396,24 +396,24 @@ RedirectBox::insert_plugin_chosen (boost::shared_ptr<Plugin> plugin)
redirect->active_changed.connect (bind (mem_fun (*this, &RedirectBox::show_redirect_active_r), boost::weak_ptr<Redirect>(redirect)));
- uint32_t err_streams;
+ Route::InsertStreams err;
- if (_route->add_redirect (redirect, this, &err_streams)) {
- weird_plugin_dialog (*plugin, err_streams, _route);
+ if (_route->add_redirect (redirect, this, &err)) {
+ weird_plugin_dialog (*plugin, err, _route);
// XXX SHAREDPTR delete plugin here .. do we even need to care?
}
}
}
void
-RedirectBox::weird_plugin_dialog (Plugin& p, uint32_t streams, boost::shared_ptr<IO> io)
+RedirectBox::weird_plugin_dialog (Plugin& p, Route::InsertStreams streams, boost::shared_ptr<IO> io)
{
ArdourDialog dialog (_("ardour: weird plugin dialog"));
Label label;
/* i hate this kind of code */
- if (streams > p.get_info()->n_inputs) {
+ if (streams.count > p.get_info()->n_inputs) {
label.set_text (string_compose (_(
"You attempted to add a plugin (%1).\n"
"The plugin has %2 inputs\n"
@@ -423,9 +423,9 @@ RedirectBox::weird_plugin_dialog (Plugin& p, uint32_t streams, boost::shared_ptr
"This makes no sense - you are throwing away\n"
"part of the signal."),
p.name(),
- p.get_info()->n_inputs,
- streams));
- } else if (streams < p.get_info()->n_inputs) {
+ p.get_info()->n_inputs.n_total(),
+ streams.count.n_total()));
+ } else if (streams.count < p.get_info()->n_inputs) {
label.set_text (string_compose (_(
"You attempted to add a plugin (%1).\n"
"The plugin has %2 inputs\n"
@@ -436,8 +436,8 @@ RedirectBox::weird_plugin_dialog (Plugin& p, uint32_t streams, boost::shared_ptr
"side-chain inputs. A future version of Ardour will\n"
"support this type of configuration."),
p.name(),
- p.get_info()->n_inputs,
- streams));
+ p.get_info()->n_inputs.n_total(),
+ streams.count.n_total()));
} else {
label.set_text (string_compose (_(
"You attempted to add a plugin (%1).\n"
@@ -450,11 +450,11 @@ RedirectBox::weird_plugin_dialog (Plugin& p, uint32_t streams, boost::shared_ptr
"\n"
"Ardour does not understand what to do in such situations.\n"),
p.name(),
- p.get_info()->n_inputs,
- p.get_info()->n_outputs,
+ p.get_info()->n_inputs.n_total(),
+ p.get_info()->n_outputs.n_total(),
io->n_inputs().n_total(),
io->n_outputs().n_total(),
- streams));
+ streams.count.n_total()));
}
dialog.get_vbox()->pack_start (label);
diff --git a/gtk2_ardour/redirect_box.h b/gtk2_ardour/redirect_box.h
index 089542b041..baf0746723 100644
--- a/gtk2_ardour/redirect_box.h
+++ b/gtk2_ardour/redirect_box.h
@@ -198,7 +198,7 @@ class RedirectBox : public Gtk::HBox
gint idle_delete_redirect (boost::weak_ptr<ARDOUR::Redirect>);
- void weird_plugin_dialog (ARDOUR::Plugin& p, uint32_t streams, boost::shared_ptr<ARDOUR::IO> io);
+ void weird_plugin_dialog (ARDOUR::Plugin& p, ARDOUR::Route::InsertStreams streams, boost::shared_ptr<ARDOUR::IO> io);
static RedirectBox* _current_redirect_box;
static bool enter_box (GdkEventCrossing*, RedirectBox*);