summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui.cc2
-rw-r--r--gtk2_ardour/gain_meter.cc67
-rw-r--r--gtk2_ardour/gain_meter.h9
-rw-r--r--gtk2_ardour/mixer_strip.cc8
-rw-r--r--gtk2_ardour/processor_box.cc2
-rw-r--r--gtk2_ardour/return_ui.cc2
-rw-r--r--gtk2_ardour/route_time_axis.cc2
-rw-r--r--gtk2_ardour/send_ui.cc2
-rw-r--r--gtk2_ardour/sfdb_ui.cc2
9 files changed, 53 insertions, 43 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 1335dce36f..2a2b3cc10b 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -733,7 +733,7 @@ ARDOUR_UI::finish()
if (session->transport_rolling()) {
session->request_stop ();
- usleep (2500000);
+ usleep (250000);
}
if (session->dirty()) {
diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc
index 6ed8893752..e6f0c74042 100644
--- a/gtk2_ardour/gain_meter.cc
+++ b/gtk2_ardour/gain_meter.cc
@@ -19,6 +19,7 @@
#include <limits.h>
+#include "ardour/amp.h"
#include "ardour/io.h"
#include "ardour/route.h"
#include "ardour/route_group.h"
@@ -162,27 +163,26 @@ GainMeterBase::~GainMeterBase ()
void
GainMeterBase::set_controls (boost::shared_ptr<Route> r,
boost::shared_ptr<PeakMeter> pm,
- boost::shared_ptr<AutomationControl> gc,
- boost::shared_ptr<Automatable> gc_owner)
+ boost::shared_ptr<Amp> amp)
{
connections.clear ();
- if (!pm && !gc) {
+ if (!pm && !amp) {
level_meter->set_meter (0);
gain_slider->set_controllable (boost::shared_ptr<PBD::Controllable>());
_meter.reset ();
- _gain_control.reset ();
+ _amp.reset ();
_route.reset ();
return;
}
_meter = pm;
- _gain_control = gc;
+ _amp = amp;
_route = r;
level_meter->set_meter (pm.get());
- gain_slider->set_controllable (gc);
-
+ gain_slider->set_controllable (amp->gain_control());
+
if (!_route || !_route->is_hidden()) {
using namespace Menu_Helpers;
@@ -190,28 +190,30 @@ GainMeterBase::set_controls (boost::shared_ptr<Route> r,
gain_astate_menu.items().clear ();
gain_astate_menu.items().push_back (MenuElem (_("Manual"),
- bind (mem_fun (*(gc_owner.get()), &Automatable::set_parameter_automation_state),
+ bind (mem_fun (*(amp.get()), &Automatable::set_parameter_automation_state),
Evoral::Parameter(GainAutomation), (AutoState) Off)));
gain_astate_menu.items().push_back (MenuElem (_("Play"),
- bind (mem_fun (*(gc_owner.get()), &Automatable::set_parameter_automation_state),
+ bind (mem_fun (*(amp.get()), &Automatable::set_parameter_automation_state),
Evoral::Parameter(GainAutomation), (AutoState) Play)));
gain_astate_menu.items().push_back (MenuElem (_("Write"),
- bind (mem_fun (*(gc_owner.get()), &Automatable::set_parameter_automation_state),
+ bind (mem_fun (*(amp.get()), &Automatable::set_parameter_automation_state),
Evoral::Parameter(GainAutomation), (AutoState) Write)));
gain_astate_menu.items().push_back (MenuElem (_("Touch"),
- bind (mem_fun (*(gc_owner.get()), &Automatable::set_parameter_automation_state),
+ bind (mem_fun (*(amp.get()), &Automatable::set_parameter_automation_state),
Evoral::Parameter(GainAutomation), (AutoState) Touch)));
connections.push_back (gain_automation_style_button.signal_button_press_event().connect (mem_fun(*this, &GainMeterBase::gain_automation_style_button_event), false));
connections.push_back (gain_automation_state_button.signal_button_press_event().connect (mem_fun(*this, &GainMeterBase::gain_automation_state_button_event), false));
-
+
+ boost::shared_ptr<AutomationControl> gc = amp->gain_control();
+
connections.push_back (gc->alist()->automation_state_changed.connect (mem_fun(*this, &GainMeter::gain_automation_state_changed)));
connections.push_back (gc->alist()->automation_style_changed.connect (mem_fun(*this, &GainMeter::gain_automation_style_changed)));
gain_automation_state_changed ();
}
- connections.push_back (gc->Changed.connect (mem_fun (*this, &GainMeterBase::gain_changed)));
+ connections.push_back (amp->gain_control()->Changed.connect (mem_fun (*this, &GainMeterBase::gain_changed)));
gain_changed ();
show_gain ();
@@ -344,7 +346,7 @@ GainMeterBase::gain_activated ()
f = min (f, 6.0f);
- _gain_control->set_value (dB_to_coefficient(f));
+ _amp->set_gain (dB_to_coefficient(f), this);
if (gain_display.has_focus()) {
PublicEditor::instance().reset_focus();
@@ -372,7 +374,13 @@ void
GainMeterBase::gain_adjusted ()
{
if (!ignore_toggle) {
- _gain_control->set_value (slider_position_to_gain (gain_adjustment.get_value()));
+ if (_route) {
+ if (_route->amp() == _amp) {
+ _route->set_gain (slider_position_to_gain (gain_adjustment.get_value()), this);
+ } else {
+ _amp->set_gain (slider_position_to_gain (gain_adjustment.get_value()), this);
+ }
+ }
}
show_gain ();
@@ -381,7 +389,7 @@ GainMeterBase::gain_adjusted ()
void
GainMeterBase::effective_gain_display ()
{
- gfloat value = gain_to_slider_position (_gain_control->get_value());
+ gfloat value = gain_to_slider_position (_amp->gain());
//cerr << this << " for " << _io->name() << " EGAIN = " << value
// << " AGAIN = " << gain_adjustment.get_value () << endl;
@@ -415,7 +423,7 @@ GainMeterBase::set_fader_name (const char * name)
void
GainMeterBase::update_gain_sensitive ()
{
- bool x = !(_gain_control->alist()->automation_state() & Play);
+ bool x = !(_amp->gain_control()->alist()->automation_state() & Play);
static_cast<Gtkmm2ext::SliderController*>(gain_slider)->set_sensitive (x);
}
@@ -557,14 +565,14 @@ GainMeterBase::meter_point_clicked ()
gint
GainMeterBase::start_gain_touch (GdkEventButton* ev)
{
- _gain_control->start_touch ();
+ _amp->gain_control()->start_touch ();
return FALSE;
}
gint
GainMeterBase::end_gain_touch (GdkEventButton* ev)
{
- _gain_control->stop_touch ();
+ _amp->gain_control()->stop_touch ();
return FALSE;
}
@@ -667,10 +675,10 @@ GainMeterBase::gain_automation_style_changed ()
{
switch (_width) {
case Wide:
- gain_automation_style_button.set_label (astyle_string(_gain_control->alist()->automation_style()));
+ gain_automation_style_button.set_label (astyle_string(_amp->gain_control()->alist()->automation_style()));
break;
case Narrow:
- gain_automation_style_button.set_label (short_astyle_string(_gain_control->alist()->automation_style()));
+ gain_automation_style_button.set_label (short_astyle_string(_amp->gain_control()->alist()->automation_style()));
break;
}
}
@@ -684,14 +692,14 @@ GainMeterBase::gain_automation_state_changed ()
switch (_width) {
case Wide:
- gain_automation_state_button.set_label (astate_string(_gain_control->alist()->automation_state()));
+ gain_automation_state_button.set_label (astate_string(_amp->gain_control()->alist()->automation_state()));
break;
case Narrow:
- gain_automation_state_button.set_label (short_astate_string(_gain_control->alist()->automation_state()));
+ gain_automation_state_button.set_label (short_astate_string(_amp->gain_control()->alist()->automation_state()));
break;
}
- x = (_gain_control->alist()->automation_state() != Off);
+ x = (_amp->gain_control()->alist()->automation_state() != Off);
if (gain_automation_state_button.get_active() != x) {
ignore_toggle = true;
@@ -795,8 +803,7 @@ GainMeter::GainMeter (Session& s)
void
GainMeter::set_controls (boost::shared_ptr<Route> r,
boost::shared_ptr<PeakMeter> meter,
- boost::shared_ptr<AutomationControl> gain_control,
- boost::shared_ptr<Automatable> gc_owner)
+ boost::shared_ptr<Amp> amp)
{
if (level_meter->get_parent()) {
hbox.remove (*level_meter);
@@ -810,7 +817,7 @@ GainMeter::set_controls (boost::shared_ptr<Route> r,
fader_vbox->remove (gain_automation_state_button);
}
- GainMeterBase::set_controls (r, meter, gain_control, gc_owner);
+ GainMeterBase::set_controls (r, meter, amp);
/*
if we have a non-hidden route (ie. we're not the click or the auditioner),
@@ -915,7 +922,11 @@ GainMeter::meter_metrics_expose (GdkEventExpose *ev)
boost::shared_ptr<PBD::Controllable>
GainMeterBase::get_controllable()
{
- return _gain_control;
+ if (_amp) {
+ return _amp->gain_control();
+ } else {
+ return boost::shared_ptr<PBD::Controllable>();
+ }
}
diff --git a/gtk2_ardour/gain_meter.h b/gtk2_ardour/gain_meter.h
index 7feaf5c0e4..4ce13af0d6 100644
--- a/gtk2_ardour/gain_meter.h
+++ b/gtk2_ardour/gain_meter.h
@@ -47,6 +47,7 @@ namespace ARDOUR {
class Route;
class RouteGroup;
class PeakMeter;
+ class Amp;
class Automatable;
}
namespace Gtkmm2ext {
@@ -66,8 +67,7 @@ class GainMeterBase : virtual public sigc::trackable
virtual void set_controls (boost::shared_ptr<ARDOUR::Route> route,
boost::shared_ptr<ARDOUR::PeakMeter> meter,
- boost::shared_ptr<ARDOUR::AutomationControl> gain_control,
- boost::shared_ptr<ARDOUR::Automatable> gc_owner);
+ boost::shared_ptr<ARDOUR::Amp> amp);
void update_gain_sensitive ();
void update_meters ();
@@ -89,7 +89,7 @@ class GainMeterBase : virtual public sigc::trackable
friend class MixerStrip;
boost::shared_ptr<ARDOUR::Route> _route;
boost::shared_ptr<ARDOUR::PeakMeter> _meter;
- boost::shared_ptr<ARDOUR::AutomationControl> _gain_control;
+ boost::shared_ptr<ARDOUR::Amp> _amp;
ARDOUR::Session& _session;
std::vector<sigc::connection> connections;
@@ -184,8 +184,7 @@ class GainMeter : public GainMeterBase, public Gtk::VBox
virtual void set_controls (boost::shared_ptr<ARDOUR::Route> route,
boost::shared_ptr<ARDOUR::PeakMeter> meter,
- boost::shared_ptr<ARDOUR::AutomationControl> gain_control,
- boost::shared_ptr<ARDOUR::Automatable> gc_owner);
+ boost::shared_ptr<ARDOUR::Amp> amp);
int get_gm_width ();
void setup_meters (int len=0);
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index b18e1699b2..7d6257bbd0 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -343,7 +343,7 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
_current_delivery = _route->main_outs ();
panners.set_panner (rt->main_outs()->panner());
- gpm.set_controls (rt, rt->shared_peak_meter(), rt->gain_control(), rt->amp());
+ gpm.set_controls (rt, rt->shared_peak_meter(), rt->amp());
processor_box.set_route (rt);
if (set_color_from_route()) {
@@ -1419,12 +1419,12 @@ MixerStrip::switch_io (boost::shared_ptr<Route> target)
send = boost::dynamic_pointer_cast<Send>(_current_delivery);
send->set_metering (true);
_current_delivery->GoingAway.connect (mem_fun (*this, &MixerStrip::revert_to_default_display));
- gain_meter().set_controls (_route, send->meter(), send->amp()->gain_control(), send->amp());
+ gain_meter().set_controls (_route, send->meter(), send->amp());
panner_ui().set_panner (_current_delivery->panner());
} else {
_current_delivery = _route->main_outs ();
- gain_meter().set_controls (_route, _route->shared_peak_meter(), _route->gain_control(), _route->amp());
+ gain_meter().set_controls (_route, _route->shared_peak_meter(), _route->amp());
panner_ui().set_panner (_route->main_outs()->panner());
}
@@ -1446,7 +1446,7 @@ MixerStrip::revert_to_default_display ()
_current_delivery = _route->main_outs();
- gain_meter().set_controls (_route, _route->shared_peak_meter(), _route->gain_control(), _route->amp());
+ gain_meter().set_controls (_route, _route->shared_peak_meter(), _route->amp());
gain_meter().setup_meters ();
panner_ui().set_panner (_route->main_outs()->panner());
panner_ui().setup_pan ();
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index 7b7d18f7e7..5f4762c18c 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -1383,7 +1383,7 @@ ProcessorBox::edit_processor (boost::shared_ptr<Processor> processor)
gidget = send_ui;
#else
if (_parent_strip) {
- _parent_strip->gain_meter().set_controls (_route, send->meter(), send->amp()->gain_control(), send->amp());
+ _parent_strip->gain_meter().set_controls (_route, send->meter(), send->amp());
_parent_strip->panner_ui().set_panner (send->panner());
}
#endif
diff --git a/gtk2_ardour/return_ui.cc b/gtk2_ardour/return_ui.cc
index 155a1095c1..5d2e2d9826 100644
--- a/gtk2_ardour/return_ui.cc
+++ b/gtk2_ardour/return_ui.cc
@@ -38,7 +38,7 @@ ReturnUI::ReturnUI (boost::shared_ptr<Return> r, Session& se)
, _session (se)
, _gpm (se)
{
- _gpm.set_controls (boost::shared_ptr<Route>(), r->meter(), r->amp()->gain_control(), r->amp());
+ _gpm.set_controls (boost::shared_ptr<Route>(), r->meter(), r->amp());
_hbox.pack_start (_gpm, true, true);
set_name ("ReturnUIFrame");
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 87ba46ffb6..11be3086e5 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -114,7 +114,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
{
set_button_names ();
- gm.set_controls (_route, _route->shared_peak_meter(), _route->gain_control(), _route->amp());
+ gm.set_controls (_route, _route->shared_peak_meter(), _route->amp());
gm.get_level_meter().set_no_show_all();
gm.get_level_meter().setup_meters(50);
diff --git a/gtk2_ardour/send_ui.cc b/gtk2_ardour/send_ui.cc
index 19baaa7f93..9192765999 100644
--- a/gtk2_ardour/send_ui.cc
+++ b/gtk2_ardour/send_ui.cc
@@ -40,7 +40,7 @@ SendUI::SendUI (boost::shared_ptr<Send> s, Session& se)
, _panners (se)
{
_panners.set_panner (s->panner());
- _gpm.set_controls (boost::shared_ptr<Route>(), s->meter(), s->amp()->gain_control(), s->amp());
+ _gpm.set_controls (boost::shared_ptr<Route>(), s->meter(), s->amp());
_hbox.pack_start (_gpm, true, true);
set_name ("SendUIFrame");
diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc
index 817c710fd8..e0caced97a 100644
--- a/gtk2_ardour/sfdb_ui.cc
+++ b/gtk2_ardour/sfdb_ui.cc
@@ -598,7 +598,7 @@ SoundFileBrowser::add_gain_meter ()
boost::shared_ptr<Route> r = session->the_auditioner ();
- gm->set_controls (r, r->shared_peak_meter(), r->gain_control(), r->amp());
+ gm->set_controls (r, r->shared_peak_meter(), r->amp());
meter_packer.set_border_width (12);
meter_packer.pack_start (*gm, false, true);