![]() |
Mixxx
|
#include <controlobject.h>
Public Slots | |
void | set (double dValue) |
Signals | |
void | valueChanged (double) |
void | valueChangedFromEngine (double) |
Public Member Functions | |
ControlObject () | |
ControlObject (ConfigKey key, bool bIgnoreNops=true) | |
virtual | ~ControlObject () |
void | addProxy (ControlObjectThread *pControlObjectThread) |
void | removeProxy (ControlObjectThread *pControlObjectThread) |
bool | updateProxies (ControlObjectThread *pProxyNoUpdate=0) |
ConfigKey | getKey () |
double | get () |
void | add (double dValue) |
void | sub (double dValue) |
void | queueFromThread (double dValue, ControlObjectThread *pControlObjectThread=0) |
void | queueFromMidi (MidiCategory c, double v) |
virtual double | getValueFromWidget (double dValue) |
virtual double | getValueToWidget (double dValue) |
virtual double | GetMidiValue () |
Static Public Member Functions | |
static bool | connectControls (ConfigKey src, ConfigKey dest) |
static bool | disconnectControl (ConfigKey key) |
static ControlObject * | getControl (ConfigKey key) |
static void | getControls (QList< ControlObject * > *pControlsList) |
static void | sync () |
Protected Member Functions | |
virtual void | setValueFromEngine (double dValue) |
virtual void | setValueFromMidi (MidiCategory, double v) |
virtual void | setValueFromThread (double dValue) |
Protected Attributes | |
double | m_dValue |
ConfigKey | m_Key |
ControlObjects is used as a way to share controller values between controllers, GUI and the sound engine. Whenever the value is changed by either a connected widget or a ControlEventMidi the emitValueChanged method is called which syncronizes the new value with the player thread using the semaphore protected queue.
The player thread has a corresponding ControlEngine object for each ControlObject. The ControlEngine object updates the ControlObject by queueing the values, and sending them as an event to the ControlObject.
Definition at line 58 of file controlobject.h.
ControlObject::ControlObject | ( | ) |
Definition at line 35 of file controlobject.cpp.
ControlObject::ControlObject | ( | ConfigKey | key, |
bool | bIgnoreNops = true |
||
) |
Definition at line 40 of file controlobject.cpp.
ControlObject::~ControlObject | ( | ) | [virtual] |
void ControlObject::add | ( | double | dValue | ) |
Add to value. Not thread safe.
Definition at line 244 of file controlobject.cpp.
void ControlObject::addProxy | ( | ControlObjectThread * | pControlObjectThread | ) |
Used to add a pointer to the corresponding ControlObjectThread of this ControlObject
Definition at line 126 of file controlobject.cpp.
Connect two control objects dest and src, so each time src is updated, so is dest.
Definition at line 96 of file controlobject.cpp.
bool ControlObject::disconnectControl | ( | ConfigKey | key | ) | [static] |
Disonnect a control object.
Definition at line 112 of file controlobject.cpp.
double ControlObject::get | ( | ) | [inline] |
Return the value of the ControlObject
Definition at line 85 of file controlobject.h.
ControlObject * ControlObject::getControl | ( | ConfigKey | key | ) | [static] |
Returns a pointer to the ControlObject matching the given ConfigKey
Definition at line 168 of file controlobject.cpp.
void ControlObject::getControls | ( | QList< ControlObject * > * | pControlsList | ) | [static] |
ConfigKey ControlObject::getKey | ( | ) | [inline] |
Return the key of the object
Definition at line 83 of file controlobject.h.
double ControlObject::GetMidiValue | ( | ) | [virtual] |
get value (range 0..127)
Reimplemented in ControlLogpotmeter, and ControlPotmeter.
Definition at line 219 of file controlobject.cpp.
double ControlObject::getValueFromWidget | ( | double | dValue | ) | [virtual] |
Return a ControlObject value, corresponding to the widget input value. Thread safe.
Reimplemented in ControlLogpotmeter, ControlPotmeter, and ControlTTRotary.
Definition at line 266 of file controlobject.cpp.
double ControlObject::getValueToWidget | ( | double | dValue | ) | [virtual] |
Return a widget value corresponding to the ControlObject input value. Thread safe.
Reimplemented in ControlLogpotmeter, ControlPotmeter, and ControlTTRotary.
Definition at line 271 of file controlobject.cpp.
void ControlObject::queueFromMidi | ( | MidiCategory | c, |
double | v | ||
) |
Queue a control change from MIDI. Thread safe. Blocking.
Definition at line 195 of file controlobject.cpp.
void ControlObject::queueFromThread | ( | double | dValue, |
ControlObjectThread * | pControlObjectThread = 0 |
||
) |
Queue a control change from a widget. Thread safe. Blocking.
Definition at line 183 of file controlobject.cpp.
void ControlObject::removeProxy | ( | ControlObjectThread * | pControlObjectThread | ) |
void ControlObject::set | ( | double | dValue | ) | [slot] |
Sets the value of the object and updates associated proxy objects. Not thread safe.
Definition at line 233 of file controlobject.cpp.
void ControlObject::setValueFromEngine | ( | double | dValue | ) | [protected, virtual] |
Sets the value of the object. Not thread safe.
Reimplemented in ControlPotmeter.
Definition at line 207 of file controlobject.cpp.
void ControlObject::setValueFromMidi | ( | MidiCategory | , |
double | v | ||
) | [protected, virtual] |
Called when a widget has changed value. Not thread safe.
Reimplemented in ControlBeat, ControlLogpotmeter, ControlPotmeter, ControlPushButton, and ControlTTRotary.
Definition at line 213 of file controlobject.cpp.
void ControlObject::setValueFromThread | ( | double | dValue | ) | [protected, virtual] |
Called when another thread has changed value. Not thread safe.
Reimplemented in ControlBeat, and ControlPotmeter.
Definition at line 224 of file controlobject.cpp.
void ControlObject::sub | ( | double | dValue | ) |
Subtract from value. Not thread safe.
Definition at line 255 of file controlobject.cpp.
void ControlObject::sync | ( | ) | [static] |
Syncronizes all ControlObjects with their corresponding proxies.
Definition at line 276 of file controlobject.cpp.
bool ControlObject::updateProxies | ( | ControlObjectThread * | pProxyNoUpdate = 0 | ) |
Update proxies, execep the one given a pointer to. Returns true if all updates happend, otherwise false.
Definition at line 139 of file controlobject.cpp.
void ControlObject::valueChanged | ( | double | ) | [signal] |
void ControlObject::valueChangedFromEngine | ( | double | ) | [signal] |
double ControlObject::m_dValue [protected] |
The actual value of the controller
Definition at line 121 of file controlobject.h.
ConfigKey ControlObject::m_Key [protected] |
Key of the object
Definition at line 123 of file controlobject.h.