_val = val;
if (!_tooltip_prefix.empty()) {
boost::shared_ptr<ARDOUR::AutomationControl> ac = boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (c);
- if (_printer && ac) {
-
- _tooltip.set_tip (_tooltip_prefix + _printer->value_as_string (ac));
- } else {
- _tooltip.set_tip (_tooltip_prefix + c->get_user_string());
- }
+ _tooltip.set_tip (_tooltip_prefix + c->get_user_string());
}
set_dirty();
}
bool on_scroll_event (GdkEventScroll* ev);
bool on_motion_notify_event (GdkEventMotion *ev) ;
- void set_printer (boost::shared_ptr<ARDOUR::Automatable> p) { _printer = p; controllable_changed (true); }
-
void color_handler ();
protected:
private:
Element _elements;
BindingProxy binding_proxy;
- boost::shared_ptr<ARDOUR::Automatable> _printer;
bool _hovering;
float _grabbed_x;
ArdourSpinner::ArdourSpinner (
boost::shared_ptr<ARDOUR::AutomationControl> c,
- Gtk::Adjustment* adj,
- boost::shared_ptr<ARDOUR::Automatable> p)
+ Gtk::Adjustment* adj)
: _btn (ArdourButton::Text)
, _ctrl_adj (adj)
, _spin_adj (0, c->lower (), c->upper (), .1, .01)
, _ctrl_ignore (false)
, _spin_ignore (false)
, _controllable (c)
- , _printer (p)
{
add_events (Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK);
set (.5, .5, 1.0, 1.0);
void
ArdourSpinner::controllable_changed ()
{
- if (_printer) {
- _btn.set_text (_printer->value_as_string (_controllable));
- } else {
- _btn.set_text (_controllable->get_user_string());
- }
+ _btn.set_text (_controllable->get_user_string());
_btn.set_dirty();
}
public:
ArdourSpinner (
boost::shared_ptr<ARDOUR::AutomationControl>,
- Gtk::Adjustment* adj,
- boost::shared_ptr<ARDOUR::Automatable>);
+ Gtk::Adjustment* adj);
virtual ~ArdourSpinner ();
bool _spin_ignore;
boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
- boost::shared_ptr<ARDOUR::Automatable> _printer;
};
using PBD::Controllable;
AutomationBarController::AutomationBarController (
- boost::shared_ptr<Automatable> printer,
boost::shared_ptr<AutomationControl> 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);
+ xpos = 0.5;
+ return _controllable->get_user_string();
}
AutomationBarController::~AutomationBarController()
{
}
-AutomationController::AutomationController(boost::shared_ptr<Automatable> printer,
- boost::shared_ptr<AutomationControl> ac,
+AutomationController::AutomationController(boost::shared_ptr<AutomationControl> ac,
Adjustment* adj,
bool use_knob)
: _widget(NULL)
- , _printer (printer)
, _controllable(ac)
, _adjustment(adj)
, _ignore_change(false)
{
- assert (_printer);
-
if (ac->toggled()) {
ArdourButton* but = manage(new ArdourButton());
knob->set_name("processor control knob");
_widget = knob;
} else {
- AutomationBarController* bar = manage(new AutomationBarController(_printer, ac, adj));
+ AutomationBarController* bar = manage(new AutomationBarController(ac, adj));
bar->set_name(X_("ProcessorControlSlider"));
bar->StartGesture.connect(
}
boost::shared_ptr<AutomationController>
-AutomationController::create(boost::shared_ptr<Automatable> printer,
- const Evoral::Parameter& param,
+AutomationController::create(const Evoral::Parameter& param,
const ParameterDescriptor& desc,
boost::shared_ptr<AutomationControl> ac,
bool use_knob)
assert (ac);
assert(ac->parameter() == param);
- return boost::shared_ptr<AutomationController>(new AutomationController(printer, ac, adjustment, use_knob));
+ return boost::shared_ptr<AutomationController>(new AutomationController(ac, adjustment, use_knob));
}
void
class Session;
class AutomationList;
class AutomationControl;
- class Automatable;
}
class AutomationBarController : public Gtkmm2ext::BarController {
public:
- AutomationBarController(boost::shared_ptr<ARDOUR::Automatable> printer,
- boost::shared_ptr<ARDOUR::AutomationControl> ac,
+ AutomationBarController(boost::shared_ptr<ARDOUR::AutomationControl> ac,
Gtk::Adjustment* adj);
~AutomationBarController();
private:
std::string get_label (double&);
- boost::shared_ptr<ARDOUR::Automatable> _printer;
boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
};
/** A BarController which displays the value and allows control of an AutomationControl */
class AutomationController : public Gtk::Alignment {
public:
- static boost::shared_ptr<AutomationController> create(
- boost::shared_ptr<ARDOUR::Automatable> parent,
+ static boost::shared_ptr<AutomationController> create (
const Evoral::Parameter& param,
const ARDOUR::ParameterDescriptor& desc,
boost::shared_ptr<ARDOUR::AutomationControl> ac,
void stop_updating ();
private:
- AutomationController (boost::shared_ptr<ARDOUR::Automatable> printer,
- boost::shared_ptr<ARDOUR::AutomationControl> ac,
+ AutomationController (boost::shared_ptr<ARDOUR::AutomationControl> ac,
Gtk::Adjustment* adj,
bool use_knob);
bool on_button_release(GdkEventButton* ev);
Gtk::Widget* _widget;
- boost::shared_ptr<ARDOUR::Automatable> _printer;
boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
Gtk::Adjustment* _adjustment;
sigc::connection _screen_update_connection;
have_name_font = true;
}
- if (_automatable && _control) {
- _controller = AutomationController::create (_automatable, _control->parameter(), _control->desc(), _control);
+ if (_control) {
+ _controller = AutomationController::create (_control->parameter(), _control->desc(), _control);
}
const std::string fill_color_name = (dynamic_cast<MidiTimeAxisView*>(&parent)
* destructor, and manage() reports object hierarchy
* ambiguity.
*/
- control_ui->controller = AutomationController::create(insert, mcontrol->parameter(), desc, mcontrol, use_knob);
+ control_ui->controller = AutomationController::create(mcontrol->parameter(), desc, mcontrol, use_knob);
/* Control UI's don't need the rapid timer workaround */
control_ui->controller->stop_updating ();
}
if (!desc.integer_step && !desc.toggled && use_knob) {
- control_ui->spin_box = manage (new ArdourSpinner (mcontrol, adj, insert));
+ control_ui->spin_box = manage (new ArdourSpinner (mcontrol, adj));
}
adj->set_value (mcontrol->internal_to_interface(value));
} else if (control_ui->spin_box) {
ArdourKnob* knob = dynamic_cast<ArdourKnob*>(control_ui->controller->widget ());
knob->set_tooltip_prefix (desc.label + ": ");
- knob->set_printer (insert);
Alignment *align = manage (new Alignment (.5, .5, 0, 0));
align->add (*control_ui->controller);
control_ui->knobtable->attach (*align, 0, 1, 0, 1, EXPAND, SHRINK, 1, 2);