Ardour
9.0-pre0-582-g084a23a80d
|
#include <controllable.h>
Public Types | |
enum | Flag { Toggle = 0x01 , GainLike = 0x02 , RealTime = 0x04 , NotAutomatable = 0x08 , InlineControl = 0x10 , HiddenControl = 0x20 , MonitorControl = 0x40 } |
enum | GroupControlDisposition { InverseGroup , NoGroup , UseGroup , ForGroup } |
Public Member Functions | |
Controllable (const std::string &name, Flag f=Flag(0)) | |
virtual void | set_value (double value, GroupControlDisposition group_override)=0 |
virtual double | get_value (void) const =0 |
virtual double | get_save_value () const |
virtual double | internal_to_interface (double i, bool rotary=false) const |
virtual double | interface_to_internal (double i, bool rotary=false) const |
virtual float | get_interface (bool rotary=false) const |
virtual void | set_interface (float fraction, bool rotary=false, GroupControlDisposition gcd=NoGroup) |
virtual std::string | get_user_string () const |
int | set_state (const XMLNode &, int version) |
virtual XMLNode & | get_state () const |
std::string | name () const |
bool | touching () const |
bool | is_toggle () const |
bool | is_gain_like () const |
virtual double | lower () const |
virtual double | upper () const |
virtual double | normal () const |
Flag | flags () const |
void | set_flags (Flag f) |
void | set_flag (Flag f) |
_flags |= f; More... | |
void | clear_flag (Flag f) |
_flags &= ~f; More... | |
Public Member Functions inherited from PBD::Stateful | |
Stateful () | |
virtual | ~Stateful () |
virtual bool | apply_change (PropertyBase const &) |
PropertyChange | apply_changes (PropertyList const &) |
const OwnedPropertyList & | properties () const |
void | add_property (PropertyBase &s) |
void | add_extra_xml (XMLNode &) |
XMLNode * | extra_xml (const std::string &str, bool add_if_missing=false) |
void | save_extra_xml (const XMLNode &) |
const PBD::ID & | id () const |
bool | set_id (const XMLNode &) |
void | set_id (const std::string &) |
void | reset_id () |
void | clear_changes () |
virtual void | clear_owned_changes () |
PropertyList * | get_changes_as_properties (PBD::Command *) const |
virtual void | rdiff (std::vector< PBD::Command * > &) const |
bool | changed () const |
virtual PropertyList * | property_factory (const XMLNode &) const |
virtual void | suspend_property_changes () |
virtual void | resume_property_changes () |
bool | property_changes_suspended () const |
Public Member Functions inherited from PBD::Destructible | |
virtual | ~Destructible () |
virtual void | drop_references () |
Static Public Member Functions | |
static std::shared_ptr< Controllable > | by_id (const PBD::ID &) |
static void | dump_registry () |
static ControllableSet | registered_controllables () |
Public Attributes | |
PBD::Signal< void()> | LearningFinished |
PBD::Signal< void(bool, PBD::Controllable::GroupControlDisposition)> | Changed |
PBD::Signal< void()> | TouchChanged |
Public Attributes inherited from PBD::Stateful | |
PBD::Signal< void(const PropertyChange &)> | PropertyChanged |
Public Attributes inherited from PBD::Destructible | |
PBD::Signal< void()> | Destroyed |
PBD::Signal< void()> | DropReferences |
Static Public Attributes | |
static PBD::Signal< bool(std::weak_ptr< PBD::Controllable >)> | StartLearning |
static PBD::Signal< void(std::weak_ptr< PBD::Controllable >)> | StopLearning |
static PBD::Signal< void(std::weak_ptr< PBD::Controllable >)> | GUIFocusChanged |
static PBD::Signal< void(std::weak_ptr< PBD::Controllable >)> | ControlTouched |
static const std::string | xml_node_name |
Static Public Attributes inherited from PBD::Stateful | |
static int | current_state_version |
static int | loading_state_version |
Protected Member Functions | |
void | set_touching (bool yn) |
Protected Member Functions inherited from PBD::Stateful | |
void | add_instant_xml (XMLNode &, const std::string &directory_path) |
XMLNode * | instant_xml (const std::string &str, const std::string &directory_path) |
void | add_properties (XMLNode &) const |
PropertyChange | set_values (XMLNode const &) |
virtual void | post_set (const PropertyChange &) |
virtual void | send_change (const PropertyChange &) |
virtual void | mid_thaw (const PropertyChange &) |
bool | regenerate_xml_or_string_ids () const |
Private Types | |
typedef std::set< PBD::Controllable * > | Controllables |
Static Private Member Functions | |
static void | add (Controllable &) |
static void | remove (Controllable *) |
Private Attributes | |
std::string | _name |
std::string | _units |
Flag | _flags |
bool | _touching |
Static Private Attributes | |
static ScopedConnectionList | registry_connections |
static Glib::Threads::RWLock | registry_lock |
static Controllables | registry |
Additional Inherited Members | |
Protected Attributes inherited from PBD::Stateful | |
XMLNode * | _extra_xml |
XMLNode * | _instant_xml |
PBD::PropertyChange | _pending_changed |
Glib::Threads::Mutex | _lock |
std::string | _xml_node_name |
name of node to use for this object in XML More... | |
OwnedPropertyList * | _properties |
This is a pure virtual class to represent a scalar control.
Note that it contains no storage/state for the controllable thing that it represents. Derived classes must provide set_value()/get_value() methods, which will involve (somehow) an actual location to store the value.
In essence, this is an interface, not a class.
Without overriding upper() and lower(), a derived class will function as a control whose value can range between 0 and 1.0.
We express Controllable values in one of three ways:
Note that in some cases user and internal may be the same (and interface different) e.g. frequency, which is presented to the user and passed to the processor in linear terms, but which needs log scaling in the interface.
In other cases, user and interface may be the same (and internal different) e.g. gain, which is presented to the user in log terms (dB) but passed to the processor as a linear quantity.
Definition at line 71 of file controllable.h.
|
private |
Definition at line 191 of file controllable.h.
Enumerator | |
---|---|
Toggle | |
GainLike | |
RealTime | |
NotAutomatable | |
InlineControl | |
HiddenControl | |
MonitorControl |
Definition at line 74 of file controllable.h.
Within an application, various Controllables might be considered to be "grouped" in a way that implies that setting 1 of them also modifies others in the group.
Definition at line 90 of file controllable.h.
|
staticprivate |
|
static |
void PBD::Controllable::clear_flag | ( | Flag | f | ) |
_flags &= ~f;
|
static |
|
inline |
Definition at line 166 of file controllable.h.
|
inlinevirtual |
Get and Set ‘interface’ value (typically, fraction of knob travel)
Definition at line 135 of file controllable.h.
|
inlinevirtual |
This is used when saving state. By default it just calls get_value(), but a class with more complex semantics might override this to save some value that differs from what get_value() would return.
Reimplemented in ARDOUR::SoloControl, ARDOUR::MuteControl, and ARDOUR::AutomationControl.
Definition at line 121 of file controllable.h.
|
virtual |
|
inlinevirtual |
Reimplemented in ARDOUR::SurroundReturn::BinauralRenderControl, ARDOUR::SurroundReturn::OutputFormatControl, ARDOUR::SurroundControllable, ARDOUR::ProxyControllable, ARDOUR::PlugInsertBase::PluginControl, ARDOUR::PanControllable, ARDOUR::MPControl< T >, ARDOUR::MPControl< gain_t >, ARDOUR::MPControl< bool >, ARDOUR::MPControl< volatile gain_t >, ARDOUR::AutomationControl, and VKBDControl.
Definition at line 139 of file controllable.h.
|
pure virtual |
Get ‘internal’ value
Implemented in ARDOUR::PlugInsertBase::PluginPropertyControl, ARDOUR::PlugInsertBase::PluginControl, TransportControlProvider::TransportControllable, ShuttleControl::ShuttleControllable, ARDOUR::SoloSafeControl, ARDOUR::SoloIsolateControl, ARDOUR::SoloControl, ARDOUR::SlavableAutomationControl, ARDOUR::ProxyControllable, ARDOUR::MuteControl, ARDOUR::MPControl< T >, ARDOUR::MPControl< gain_t >, ARDOUR::MPControl< bool >, ARDOUR::MPControl< volatile gain_t >, ARDOUR::AutomationControl, VKBDControl, and TimeCtlGUIControllable.
|
inlinevirtual |
Reimplemented in ARDOUR::AutomationControl, and TimeCtlGUIControllable.
Definition at line 130 of file controllable.h.
|
inlinevirtual |
Conversions between ‘internal’, 'interface', and 'user' values
Reimplemented in ARDOUR::AutomationControl, and TimeCtlGUIControllable.
Definition at line 124 of file controllable.h.
|
inline |
Definition at line 160 of file controllable.h.
|
inline |
Definition at line 159 of file controllable.h.
|
inlinevirtual |
Reimplemented in ARDOUR::MPControl< T >, ARDOUR::MPControl< gain_t >, ARDOUR::MPControl< bool >, ARDOUR::MPControl< volatile gain_t >, ARDOUR::AutomationControl, VKBDControl, TimeCtlGUIControllable, and ShuttleControl::ShuttleControllable.
Definition at line 162 of file controllable.h.
|
inline |
Definition at line 154 of file controllable.h.
|
inlinevirtual |
Reimplemented in ARDOUR::MPControl< T >, ARDOUR::MPControl< gain_t >, ARDOUR::MPControl< bool >, ARDOUR::MPControl< volatile gain_t >, ARDOUR::AutomationControl, and VKBDControl.
Definition at line 164 of file controllable.h.
|
static |
|
staticprivate |
void PBD::Controllable::set_flag | ( | Flag | f | ) |
_flags |= f;
void PBD::Controllable::set_flags | ( | Flag | f | ) |
|
virtual |
|
virtual |
Implements PBD::Stateful.
|
inlineprotected |
Definition at line 179 of file controllable.h.
|
pure virtual |
Set ‘internal’ value
All derived classes must implement this.
Basic derived classes will ignore group_override
but more sophisticated children, notably those that proxy the value setting logic via an object that is aware of group relationships between this control and others, will find it useful.
value | raw numeric value to set |
group_override | if and how to propagate value to grouped controls |
Implemented in ARDOUR::RecordEnableControl, TransportControlProvider::TransportControllable, ShuttleControl::ShuttleControllable, ARDOUR::AutomationControl, TimeCtlGUIControllable, ARDOUR::ProxyControllable, ARDOUR::MPControl< T >, ARDOUR::MPControl< gain_t >, ARDOUR::MPControl< bool >, ARDOUR::MPControl< volatile gain_t >, ARDOUR::MPControl< T >, ARDOUR::MPControl< gain_t >, ARDOUR::MPControl< bool >, ARDOUR::MPControl< volatile gain_t >, and VKBDControl.
|
inline |
Definition at line 156 of file controllable.h.
|
inlinevirtual |
Reimplemented in ARDOUR::MPControl< T >, ARDOUR::MPControl< gain_t >, ARDOUR::MPControl< bool >, ARDOUR::MPControl< volatile gain_t >, ARDOUR::AutomationControl, VKBDControl, TimeCtlGUIControllable, and ShuttleControl::ShuttleControllable.
Definition at line 163 of file controllable.h.
|
private |
Definition at line 188 of file controllable.h.
|
private |
Definition at line 186 of file controllable.h.
|
private |
Definition at line 189 of file controllable.h.
|
private |
Definition at line 187 of file controllable.h.
PBD::Signal<void(bool,PBD::Controllable::GroupControlDisposition)> PBD::Controllable::Changed |
Definition at line 149 of file controllable.h.
|
static |
Definition at line 147 of file controllable.h.
|
static |
Definition at line 146 of file controllable.h.
PBD::Signal<void()> PBD::Controllable::LearningFinished |
Definition at line 141 of file controllable.h.
|
staticprivate |
Definition at line 195 of file controllable.h.
|
staticprivate |
Definition at line 193 of file controllable.h.
|
staticprivate |
Definition at line 194 of file controllable.h.
|
static |
Definition at line 143 of file controllable.h.
|
static |
Definition at line 144 of file controllable.h.
PBD::Signal<void()> PBD::Controllable::TouchChanged |
Definition at line 157 of file controllable.h.
|
static |
Definition at line 176 of file controllable.h.