mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 16:46:35 +01:00
Update GUI, drop Automatable::value_as_string() API
This commit is contained in:
parent
17fb5bfb49
commit
99b064274f
8 changed files with 17 additions and 47 deletions
|
|
@ -485,13 +485,8 @@ ArdourKnob::controllable_changed (bool force_update)
|
||||||
_val = val;
|
_val = val;
|
||||||
if (!_tooltip_prefix.empty()) {
|
if (!_tooltip_prefix.empty()) {
|
||||||
boost::shared_ptr<ARDOUR::AutomationControl> ac = boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (c);
|
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();
|
set_dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,6 @@ public:
|
||||||
bool on_scroll_event (GdkEventScroll* ev);
|
bool on_scroll_event (GdkEventScroll* ev);
|
||||||
bool on_motion_notify_event (GdkEventMotion *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 ();
|
void color_handler ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -108,7 +106,6 @@ public:
|
||||||
private:
|
private:
|
||||||
Element _elements;
|
Element _elements;
|
||||||
BindingProxy binding_proxy;
|
BindingProxy binding_proxy;
|
||||||
boost::shared_ptr<ARDOUR::Automatable> _printer;
|
|
||||||
|
|
||||||
bool _hovering;
|
bool _hovering;
|
||||||
float _grabbed_x;
|
float _grabbed_x;
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,7 @@ using namespace ARDOUR;
|
||||||
|
|
||||||
ArdourSpinner::ArdourSpinner (
|
ArdourSpinner::ArdourSpinner (
|
||||||
boost::shared_ptr<ARDOUR::AutomationControl> c,
|
boost::shared_ptr<ARDOUR::AutomationControl> c,
|
||||||
Gtk::Adjustment* adj,
|
Gtk::Adjustment* adj)
|
||||||
boost::shared_ptr<ARDOUR::Automatable> p)
|
|
||||||
: _btn (ArdourButton::Text)
|
: _btn (ArdourButton::Text)
|
||||||
, _ctrl_adj (adj)
|
, _ctrl_adj (adj)
|
||||||
, _spin_adj (0, c->lower (), c->upper (), .1, .01)
|
, _spin_adj (0, c->lower (), c->upper (), .1, .01)
|
||||||
|
|
@ -40,7 +39,6 @@ ArdourSpinner::ArdourSpinner (
|
||||||
, _ctrl_ignore (false)
|
, _ctrl_ignore (false)
|
||||||
, _spin_ignore (false)
|
, _spin_ignore (false)
|
||||||
, _controllable (c)
|
, _controllable (c)
|
||||||
, _printer (p)
|
|
||||||
{
|
{
|
||||||
add_events (Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK);
|
add_events (Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK);
|
||||||
set (.5, .5, 1.0, 1.0);
|
set (.5, .5, 1.0, 1.0);
|
||||||
|
|
@ -204,10 +202,6 @@ ArdourSpinner::spin_adjusted ()
|
||||||
void
|
void
|
||||||
ArdourSpinner::controllable_changed ()
|
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();
|
_btn.set_dirty();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,7 @@ class ArdourSpinner : public Gtk::Alignment
|
||||||
public:
|
public:
|
||||||
ArdourSpinner (
|
ArdourSpinner (
|
||||||
boost::shared_ptr<ARDOUR::AutomationControl>,
|
boost::shared_ptr<ARDOUR::AutomationControl>,
|
||||||
Gtk::Adjustment* adj,
|
Gtk::Adjustment* adj);
|
||||||
boost::shared_ptr<ARDOUR::Automatable>);
|
|
||||||
|
|
||||||
virtual ~ArdourSpinner ();
|
virtual ~ArdourSpinner ();
|
||||||
|
|
||||||
|
|
@ -65,7 +64,6 @@ class ArdourSpinner : public Gtk::Alignment
|
||||||
bool _spin_ignore;
|
bool _spin_ignore;
|
||||||
|
|
||||||
boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
|
boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
|
||||||
boost::shared_ptr<ARDOUR::Automatable> _printer;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,11 +44,9 @@ using namespace Gtk;
|
||||||
using PBD::Controllable;
|
using PBD::Controllable;
|
||||||
|
|
||||||
AutomationBarController::AutomationBarController (
|
AutomationBarController::AutomationBarController (
|
||||||
boost::shared_ptr<Automatable> printer,
|
|
||||||
boost::shared_ptr<AutomationControl> ac,
|
boost::shared_ptr<AutomationControl> ac,
|
||||||
Adjustment* adj)
|
Adjustment* adj)
|
||||||
: Gtkmm2ext::BarController(*adj, ac)
|
: Gtkmm2ext::BarController(*adj, ac)
|
||||||
, _printer(printer)
|
|
||||||
, _controllable(ac)
|
, _controllable(ac)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -57,25 +55,21 @@ std::string
|
||||||
AutomationBarController::get_label (double& xpos)
|
AutomationBarController::get_label (double& xpos)
|
||||||
{
|
{
|
||||||
xpos = 0.5;
|
xpos = 0.5;
|
||||||
return _printer->value_as_string (_controllable);
|
return _controllable->get_user_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
AutomationBarController::~AutomationBarController()
|
AutomationBarController::~AutomationBarController()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
AutomationController::AutomationController(boost::shared_ptr<Automatable> printer,
|
AutomationController::AutomationController(boost::shared_ptr<AutomationControl> ac,
|
||||||
boost::shared_ptr<AutomationControl> ac,
|
|
||||||
Adjustment* adj,
|
Adjustment* adj,
|
||||||
bool use_knob)
|
bool use_knob)
|
||||||
: _widget(NULL)
|
: _widget(NULL)
|
||||||
, _printer (printer)
|
|
||||||
, _controllable(ac)
|
, _controllable(ac)
|
||||||
, _adjustment(adj)
|
, _adjustment(adj)
|
||||||
, _ignore_change(false)
|
, _ignore_change(false)
|
||||||
{
|
{
|
||||||
assert (_printer);
|
|
||||||
|
|
||||||
if (ac->toggled()) {
|
if (ac->toggled()) {
|
||||||
ArdourButton* but = manage(new ArdourButton());
|
ArdourButton* but = manage(new ArdourButton());
|
||||||
|
|
||||||
|
|
@ -104,7 +98,7 @@ AutomationController::AutomationController(boost::shared_ptr<Automatable>
|
||||||
knob->set_name("processor control knob");
|
knob->set_name("processor control knob");
|
||||||
_widget = knob;
|
_widget = knob;
|
||||||
} else {
|
} else {
|
||||||
AutomationBarController* bar = manage(new AutomationBarController(_printer, ac, adj));
|
AutomationBarController* bar = manage(new AutomationBarController(ac, adj));
|
||||||
|
|
||||||
bar->set_name(X_("ProcessorControlSlider"));
|
bar->set_name(X_("ProcessorControlSlider"));
|
||||||
bar->StartGesture.connect(
|
bar->StartGesture.connect(
|
||||||
|
|
@ -134,8 +128,7 @@ AutomationController::~AutomationController()
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<AutomationController>
|
boost::shared_ptr<AutomationController>
|
||||||
AutomationController::create(boost::shared_ptr<Automatable> printer,
|
AutomationController::create(const Evoral::Parameter& param,
|
||||||
const Evoral::Parameter& param,
|
|
||||||
const ParameterDescriptor& desc,
|
const ParameterDescriptor& desc,
|
||||||
boost::shared_ptr<AutomationControl> ac,
|
boost::shared_ptr<AutomationControl> ac,
|
||||||
bool use_knob)
|
bool use_knob)
|
||||||
|
|
@ -151,7 +144,7 @@ AutomationController::create(boost::shared_ptr<Automatable> printer,
|
||||||
|
|
||||||
assert (ac);
|
assert (ac);
|
||||||
assert(ac->parameter() == param);
|
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
|
void
|
||||||
|
|
|
||||||
|
|
@ -39,26 +39,22 @@ namespace ARDOUR {
|
||||||
class Session;
|
class Session;
|
||||||
class AutomationList;
|
class AutomationList;
|
||||||
class AutomationControl;
|
class AutomationControl;
|
||||||
class Automatable;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class AutomationBarController : public Gtkmm2ext::BarController {
|
class AutomationBarController : public Gtkmm2ext::BarController {
|
||||||
public:
|
public:
|
||||||
AutomationBarController(boost::shared_ptr<ARDOUR::Automatable> printer,
|
AutomationBarController(boost::shared_ptr<ARDOUR::AutomationControl> ac,
|
||||||
boost::shared_ptr<ARDOUR::AutomationControl> ac,
|
|
||||||
Gtk::Adjustment* adj);
|
Gtk::Adjustment* adj);
|
||||||
~AutomationBarController();
|
~AutomationBarController();
|
||||||
private:
|
private:
|
||||||
std::string get_label (double&);
|
std::string get_label (double&);
|
||||||
boost::shared_ptr<ARDOUR::Automatable> _printer;
|
|
||||||
boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
|
boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** A BarController which displays the value and allows control of an AutomationControl */
|
/** A BarController which displays the value and allows control of an AutomationControl */
|
||||||
class AutomationController : public Gtk::Alignment {
|
class AutomationController : public Gtk::Alignment {
|
||||||
public:
|
public:
|
||||||
static boost::shared_ptr<AutomationController> create(
|
static boost::shared_ptr<AutomationController> create (
|
||||||
boost::shared_ptr<ARDOUR::Automatable> parent,
|
|
||||||
const Evoral::Parameter& param,
|
const Evoral::Parameter& param,
|
||||||
const ARDOUR::ParameterDescriptor& desc,
|
const ARDOUR::ParameterDescriptor& desc,
|
||||||
boost::shared_ptr<ARDOUR::AutomationControl> ac,
|
boost::shared_ptr<ARDOUR::AutomationControl> ac,
|
||||||
|
|
@ -79,8 +75,7 @@ public:
|
||||||
void stop_updating ();
|
void stop_updating ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AutomationController (boost::shared_ptr<ARDOUR::Automatable> printer,
|
AutomationController (boost::shared_ptr<ARDOUR::AutomationControl> ac,
|
||||||
boost::shared_ptr<ARDOUR::AutomationControl> ac,
|
|
||||||
Gtk::Adjustment* adj,
|
Gtk::Adjustment* adj,
|
||||||
bool use_knob);
|
bool use_knob);
|
||||||
|
|
||||||
|
|
@ -95,7 +90,6 @@ private:
|
||||||
bool on_button_release(GdkEventButton* ev);
|
bool on_button_release(GdkEventButton* ev);
|
||||||
|
|
||||||
Gtk::Widget* _widget;
|
Gtk::Widget* _widget;
|
||||||
boost::shared_ptr<ARDOUR::Automatable> _printer;
|
|
||||||
boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
|
boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
|
||||||
Gtk::Adjustment* _adjustment;
|
Gtk::Adjustment* _adjustment;
|
||||||
sigc::connection _screen_update_connection;
|
sigc::connection _screen_update_connection;
|
||||||
|
|
|
||||||
|
|
@ -122,8 +122,8 @@ AutomationTimeAxisView::AutomationTimeAxisView (
|
||||||
have_name_font = true;
|
have_name_font = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_automatable && _control) {
|
if (_control) {
|
||||||
_controller = AutomationController::create (_automatable, _control->parameter(), _control->desc(), _control);
|
_controller = AutomationController::create (_control->parameter(), _control->desc(), _control);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string fill_color_name = (dynamic_cast<MidiTimeAxisView*>(&parent)
|
const std::string fill_color_name = (dynamic_cast<MidiTimeAxisView*>(&parent)
|
||||||
|
|
|
||||||
|
|
@ -740,7 +740,7 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param,
|
||||||
* destructor, and manage() reports object hierarchy
|
* destructor, and manage() reports object hierarchy
|
||||||
* ambiguity.
|
* 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's don't need the rapid timer workaround */
|
||||||
control_ui->controller->stop_updating ();
|
control_ui->controller->stop_updating ();
|
||||||
|
|
@ -773,7 +773,7 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!desc.integer_step && !desc.toggled && use_knob) {
|
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));
|
adj->set_value (mcontrol->internal_to_interface(value));
|
||||||
|
|
@ -797,7 +797,6 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param,
|
||||||
} else if (control_ui->spin_box) {
|
} else if (control_ui->spin_box) {
|
||||||
ArdourKnob* knob = dynamic_cast<ArdourKnob*>(control_ui->controller->widget ());
|
ArdourKnob* knob = dynamic_cast<ArdourKnob*>(control_ui->controller->widget ());
|
||||||
knob->set_tooltip_prefix (desc.label + ": ");
|
knob->set_tooltip_prefix (desc.label + ": ");
|
||||||
knob->set_printer (insert);
|
|
||||||
Alignment *align = manage (new Alignment (.5, .5, 0, 0));
|
Alignment *align = manage (new Alignment (.5, .5, 0, 0));
|
||||||
align->add (*control_ui->controller);
|
align->add (*control_ui->controller);
|
||||||
control_ui->knobtable->attach (*align, 0, 1, 0, 1, EXPAND, SHRINK, 1, 2);
|
control_ui->knobtable->attach (*align, 0, 1, 0, 1, EXPAND, SHRINK, 1, 2);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue