mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Pan: remove value-as-string indirection
This commit is contained in:
parent
991f92c2c6
commit
efb63e1bf2
5 changed files with 6 additions and 22 deletions
|
|
@ -64,7 +64,6 @@ public:
|
|||
return ((_auto_state & Write) || ((_auto_state & (Touch | Latch)) && touching()));
|
||||
}
|
||||
|
||||
std::string value_as_string (boost::shared_ptr<const AutomationControl>) const;
|
||||
|
||||
void start_touch (double when);
|
||||
void stop_touch (double when);
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ class Pannable;
|
|||
class BufferSet;
|
||||
class AudioBuffer;
|
||||
class Speakers;
|
||||
class PanControllable;
|
||||
|
||||
class LIBARDOUR_API Panner : public PBD::Stateful, public PBD::ScopedConnectionList
|
||||
{
|
||||
|
|
@ -111,7 +112,6 @@ public:
|
|||
|
||||
virtual std::set<Evoral::Parameter> what_can_be_automated() const;
|
||||
virtual std::string describe_parameter (Evoral::Parameter);
|
||||
virtual std::string value_as_string (boost::shared_ptr<const AutomationControl>) const;
|
||||
|
||||
bool touching() const;
|
||||
|
||||
|
|
@ -145,8 +145,11 @@ public:
|
|||
virtual void thaw ();
|
||||
|
||||
protected:
|
||||
friend PanControllable;
|
||||
boost::shared_ptr<Pannable> _pannable;
|
||||
|
||||
virtual std::string value_as_string (boost::shared_ptr<const AutomationControl>) const = 0;
|
||||
|
||||
virtual void distribute_one (AudioBuffer&, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes, uint32_t which) = 0;
|
||||
virtual void distribute_one_automated (AudioBuffer&, BufferSet& obufs,
|
||||
samplepos_t start, samplepos_t end, pframes_t nframes,
|
||||
|
|
|
|||
|
|
@ -58,12 +58,12 @@ PanControllable::actually_set_value (double v, Controllable::GroupControlDisposi
|
|||
std::string
|
||||
PanControllable::get_user_string () const
|
||||
{
|
||||
if (!owner) {
|
||||
if (!owner || !owner->panner()) {
|
||||
/* assume PanAzimuthAutomation, 0..1 */
|
||||
float v = get_value ();
|
||||
char buf[32];
|
||||
snprintf(buf, sizeof(buf), "%.0f%%", 100.f * v);
|
||||
return buf;
|
||||
}
|
||||
return owner->value_as_string (boost::dynamic_pointer_cast<const AutomationControl>(shared_from_this()));
|
||||
return owner->panner()->value_as_string (boost::dynamic_pointer_cast<const AutomationControl>(shared_from_this()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -256,15 +256,3 @@ Pannable::set_state (const XMLNode& root, int version)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
string
|
||||
Pannable::value_as_string (boost::shared_ptr<const AutomationControl> ac) const
|
||||
{
|
||||
boost::shared_ptr<Panner> p = panner ();
|
||||
|
||||
if (p) {
|
||||
return p->value_as_string (ac);
|
||||
}
|
||||
|
||||
return ARDOUR::value_as_string(ac->desc(), ac->get_value());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,12 +98,6 @@ Panner::describe_parameter (Evoral::Parameter p)
|
|||
return _pannable->describe_parameter (p);
|
||||
}
|
||||
|
||||
string
|
||||
Panner::value_as_string (boost::shared_ptr<const AutomationControl> ac) const
|
||||
{
|
||||
return _pannable->value_as_string (ac);
|
||||
}
|
||||
|
||||
int
|
||||
Panner::set_state (XMLNode const &, int)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue