![]() |
Mixxx
|
#include <controlobjectthread.h>
Public Slots | |
void | slotSet (double v) |
void | slotParentDead () |
Signals | |
void | valueChanged (double) |
Public Member Functions | |
ControlObjectThread (ControlObject *pControlObject, QObject *pParent=NULL) | |
virtual | ~ControlObjectThread () |
double | get () |
virtual bool | setExtern (double v) |
void | add (double v) |
void | sub (double v) |
void | emitValueChanged () |
ControlObject * | getControlObject () |
Static Public Member Functions | |
static bool | update () |
Protected Attributes | |
double | m_dValue |
QMutex | m_dataMutex |
ControlObject * | m_pControlObject |
Static Protected Attributes | |
static QMutex | m_sqMutex |
This class is used to store a control value as used by an EngineObject. ControlEngine is thread safe, and sends a user event to a ControlObject whenever it's value is changed. setExtern is used for external threads to set it's value.
Definition at line 39 of file controlobjectthread.h.
ControlObjectThread::ControlObjectThread | ( | ControlObject * | pControlObject, |
QObject * | pParent = NULL |
||
) |
ControlObjectThread::~ControlObjectThread | ( | ) | [virtual] |
void ControlObjectThread::add | ( | double | v | ) |
Adds a value to the value property of the ControlEngine. Notification in a similar way to set. Thread safe, blocking.
Definition at line 125 of file controlobjectthread.cpp.
void ControlObjectThread::emitValueChanged | ( | ) |
Called from update();
Definition at line 120 of file controlobjectthread.cpp.
double ControlObjectThread::get | ( | ) |
Returns the value of the object
Definition at line 52 of file controlobjectthread.cpp.
ControlObject * ControlObjectThread::getControlObject | ( | ) |
bool ControlObjectThread::setExtern | ( | double | v | ) | [virtual] |
Setting the value from an external controller. This happen when a ControlObject has changed and its value is syncronized with this object. Thread safe, non blocking. Returns true if successful, otherwise false. Thread safe, non blocking.
Reimplemented in ControlObjectThreadMain, and ControlObjectThreadWidget.
Definition at line 70 of file controlobjectthread.cpp.
void ControlObjectThread::slotParentDead | ( | ) | [slot] |
void ControlObjectThread::slotSet | ( | double | v | ) | [slot] |
The value is changed by the engine, and the corresponding ControlObject is updated. Thread safe, blocking.
Definition at line 61 of file controlobjectthread.cpp.
void ControlObjectThread::sub | ( | double | v | ) |
Subtracts a value to the value property. Notification in a similar way to set. Thread safe, blocking.
Definition at line 134 of file controlobjectthread.cpp.
bool ControlObjectThread::update | ( | ) | [static] |
Updates the object with changes from the corresponding ControlObject, and emits valueChagned signal. Returns true if this it was updated
Definition at line 101 of file controlobjectthread.cpp.
void ControlObjectThread::valueChanged | ( | double | ) | [signal] |
QMutex ControlObjectThread::m_dataMutex [protected] |
Mutex controlling access to non-static members
Definition at line 85 of file controlobjectthread.h.
double ControlObjectThread::m_dValue [protected] |
The actual value of the object
Definition at line 81 of file controlobjectthread.h.
ControlObject* ControlObjectThread::m_pControlObject [protected] |
Pointer to corresponding ControlObject
Definition at line 87 of file controlobjectthread.h.
QMutex ControlObjectThread::m_sqMutex [static, protected] |
Mutex controlling access to static members
Definition at line 83 of file controlobjectthread.h.