Prepare to eventually drop Automatable::value_as_string()
Probably due to historical reasons, there are two APIs to format a control's value. In all both variants end up calling either ARDOUR::value_as_string() or the Controllable's formatting function (except for panners).
This commit is contained in:
@@ -116,6 +116,8 @@ class LIBARDOUR_API AutomationControl
|
||||
double internal_to_interface (double i) const;
|
||||
double interface_to_internal (double i) const;
|
||||
|
||||
virtual std::string get_user_string() const;
|
||||
|
||||
const ParameterDescriptor& desc() const { return _desc; }
|
||||
|
||||
const ARDOUR::Session& session() const { return _session; }
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "ardour/event_type_map.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/selection.h"
|
||||
#include "ardour/value_as_string.h"
|
||||
|
||||
#include "pbd/i18n.h"
|
||||
|
||||
@@ -338,6 +339,12 @@ AutomationControl::interface_to_internal (double val) const
|
||||
return val;
|
||||
}
|
||||
|
||||
std::string
|
||||
AutomationControl::get_user_string () const
|
||||
{
|
||||
return ARDOUR::value_as_string (_desc, get_value());
|
||||
}
|
||||
|
||||
void
|
||||
AutomationControl::set_group (boost::shared_ptr<ControlGroup> cg)
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "ardour/panner.h"
|
||||
#include "ardour/pan_controllable.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/value_as_string.h"
|
||||
|
||||
#include "pbd/i18n.h"
|
||||
|
||||
@@ -282,5 +283,5 @@ Pannable::value_as_string (boost::shared_ptr<const AutomationControl> ac) const
|
||||
return p->value_as_string (ac);
|
||||
}
|
||||
|
||||
return Automatable::value_as_string (ac);
|
||||
return ARDOUR::value_as_string(ac->desc(), ac->get_value());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user