diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index ff8b1932a2..a8051f0eb4 100644 --- a/gtk2_ardour/automation_controller.cc +++ b/gtk2_ardour/automation_controller.cc @@ -40,6 +40,27 @@ using namespace ARDOUR; using namespace Gtk; +AutomationBarController::AutomationBarController ( + boost::shared_ptr printer, + boost::shared_ptr ac, + Adjustment* adj) + : Gtkmm2ext::BarController(*adj, ac) + , _printer(printer) + , _controllable(ac) +{ +} + +std::string +AutomationBarController::get_label (double& xpos) +{ + xpos = 0.5; + return _printer->value_as_string (_controllable); +} + +AutomationBarController::~AutomationBarController() +{ +} + AutomationController::AutomationController(boost::shared_ptr printer, boost::shared_ptr ac, Adjustment* adj) @@ -67,7 +88,7 @@ AutomationController::AutomationController(boost::shared_ptr _widget = but; } else { - Gtkmm2ext::BarController* bar = manage(new Gtkmm2ext::BarController(*adj, ac)); + AutomationBarController* bar = manage(new AutomationBarController(_printer, ac, adj)); bar->set_name(X_("ProcessorControlSlider")); bar->StartGesture.connect( @@ -124,13 +145,6 @@ AutomationController::create(boost::shared_ptr printer, return boost::shared_ptr(new AutomationController(printer, ac, adjustment)); } -std::string -AutomationController::get_label (double& xpos) -{ - xpos = 0.5; - return _printer->value_as_string (_controllable); -} - void AutomationController::display_effective_value() { @@ -314,7 +328,7 @@ AutomationController::stop_updating () void AutomationController::disable_vertical_scroll () { - Gtkmm2ext::BarController* bar = dynamic_cast(_widget); + AutomationBarController* bar = dynamic_cast(_widget); if (bar) { bar->set_tweaks ( Gtkmm2ext::PixFader::Tweaks(bar->tweaks() | diff --git a/gtk2_ardour/automation_controller.h b/gtk2_ardour/automation_controller.h index db79ac249e..c5d64c16c7 100644 --- a/gtk2_ardour/automation_controller.h +++ b/gtk2_ardour/automation_controller.h @@ -42,6 +42,18 @@ namespace ARDOUR { class Automatable; } +class AutomationBarController : public Gtkmm2ext::BarController { +public: + AutomationBarController(boost::shared_ptr printer, + boost::shared_ptr ac, + Gtk::Adjustment* adj); + ~AutomationBarController(); +private: + std::string get_label (double&); + boost::shared_ptr _printer; + boost::shared_ptr _controllable; +}; + /** A BarController which displays the value and allows control of an AutomationControl */ class AutomationController : public Gtk::Alignment { public: @@ -72,7 +84,6 @@ private: AutomationController (boost::shared_ptr printer, boost::shared_ptr ac, Gtk::Adjustment* adj); - std::string get_label (double&); void start_touch(); void end_touch();