Mixxx

ControlObject Class Reference

#include <controlobject.h>

Inheritance diagram for ControlObject:
Collaboration diagram for ControlObject:

List of all members.

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 ControlObjectgetControl (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

Detailed Description

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.

Author:
Tue and Ken Haste Andersen

Definition at line 58 of file controlobject.h.


Constructor & Destructor Documentation

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]

Definition at line 49 of file controlobject.cpp.

Here is the call graph for this function:


Member Function Documentation

void ControlObject::add ( double  dValue)

Add to value. Not thread safe.

Definition at line 244 of file controlobject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

bool ControlObject::connectControls ( ConfigKey  src,
ConfigKey  dest 
) [static]

Connect two control objects dest and src, so each time src is updated, so is dest.

Definition at line 96 of file controlobject.cpp.

Here is the call graph for this function:

bool ControlObject::disconnectControl ( ConfigKey  key) [static]

Disonnect a control object.

Definition at line 112 of file controlobject.cpp.

Here is the call graph for this function:

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]

Definition at line 159 of file controlobject.cpp.

Here is the caller graph for this function:

ConfigKey ControlObject::getKey ( ) [inline]

Return the key of the object

Definition at line 83 of file controlobject.h.

Here is the caller graph for this function:

double ControlObject::GetMidiValue ( ) [virtual]

get value (range 0..127)

Reimplemented in ControlLogpotmeter, and ControlPotmeter.

Definition at line 219 of file controlobject.cpp.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

void ControlObject::queueFromMidi ( MidiCategory  c,
double  v 
)

Queue a control change from MIDI. Thread safe. Blocking.

Definition at line 195 of file controlobject.cpp.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

void ControlObject::removeProxy ( ControlObjectThread pControlObjectThread)

Definition at line 133 of file controlobject.cpp.

Here is the caller graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

void ControlObject::sub ( double  dValue)

Subtract from value. Not thread safe.

Definition at line 255 of file controlobject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ControlObject::sync ( ) [static]

Syncronizes all ControlObjects with their corresponding proxies.

Definition at line 276 of file controlobject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

void ControlObject::valueChanged ( double  ) [signal]

Here is the caller graph for this function:

void ControlObject::valueChangedFromEngine ( double  ) [signal]

Here is the caller graph for this function:


Member Data Documentation

double ControlObject::m_dValue [protected]

The actual value of the controller

Definition at line 121 of file controlobject.h.

Key of the object

Definition at line 123 of file controlobject.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines