My Project
Loading...
Searching...
No Matches
chai3d::cXTouchController Class Reference

This class implements support for the X-Touch midi controller. More...

#include <CXTouchController.h>

Inheritance diagram for chai3d::cXTouchController:

Public Member Functions

 cXTouchController (unsigned int a_deviceNumber=0)
 Constructor of cXTouchController.
 
virtual ~cXTouchController ()
 Destructor of cXTouchController.
 
virtual bool open ()
 This method opens a connection to this device.
 
virtual bool close ()
 This method closes the connection to this device.
 
cXTouchModel getModel ()
 This method returns the model of X-Touch interface.
 
void setLayerA ()
 This method enables layer A.
 
void setLayerB ()
 This method enables layer B.
 
void setLayer (int a_layer)
 This method selects the desired layer (A or B)
 
void initialize ()
 This method iniaitalizes the table to its default state.
 
int getNumSliders ()
 This method returns the number of active sliders.
 
double getSliderValue (int a_index)
 This method returns the value of a slider.
 
void setSliderValue (int a_index, double a_value)
 This method sets the value of a slider.
 
void setAllSlidersValue (double a_value)
 This method sets the value of a all sliders.
 
int getNumDials ()
 This method returns the number of dials.
 
double getDialValue (int a_index)
 This method returns the value of a dial.
 
double getDialRangeMin (int a_index)
 This method returns the minium range value of a dial.
 
double getDialRangeMax (int a_index)
 This method returns the maximum range value of a dial.
 
void setDialRange (int a_index, double a_min, double a_max)
 This method assigns a range of values to the dial.
 
void setDialValue (int a_index, double a_value)
 This method sets a value to a dial.
 
void setDialMode (int a_index, int a_mode)
 This method sets the mode of a dial.
 
void setDialModeSingle (int a_index)
 This method sets the display mode of the dial to single.
 
void setDialModePan (int a_index)
 This method sets the display mode of the dial to pan.
 
void setDialModeFan (int a_index)
 This method sets the display mode of the dial to fan.
 
void setDialModeSpread (int a_index)
 This method sets the display mode of the dial to spread.
 
void setDialModeTrim (int a_index)
 This method sets the display mode of the dial to trim.
 
void setDialLightOn (int a_index)
 This method turns the lights of the dial ON.
 
void setDialLightOff (int a_index)
 This method turns the lights of the dial OFF.
 
void setDialLightBlinking (int a_index)
 This method turns the lights of the dial to blinking.
 
void setAllDialsValue (double a_value)
 This method sets a value to all dials.
 
void setAllDialsRange (double a_min, double a_max)
 This method assigns a range of values to the dial.
 
void setAllDialsMode (int a_mode)
 This method sets the mode of all dials.
 
void setAllDialsModeSingle ()
 This method sets the display mode of all dials to single.
 
void setAllDialsModePan ()
 This method sets the display mode of all dials to pan.
 
void setAllDialsModeFan ()
 This method sets the display mode of all dials to fan.
 
void setAllDialsModeSpread ()
 This method sets the display mode of all dials to spread.
 
void setAllDialsModeTrim ()
 This method sets the display mode of all dials to trim.
 
void setAllDialsLightOn ()
 This method turns the lights of all dials ON.
 
void setAllDialsLightOff ()
 This method turns the lights of all dials OFF.
 
void setAllDialsLightBlinking ()
 This method turns the lights of all dials to blinking.
 
int getNumButtons ()
 This method returns the number of buttons.
 
int getButtonMode (int a_index)
 This method return the current mode of a button.
 
bool getButtonState (int a_index)
 This method returns the state of a button.
 
int getButtonLightBehavior (int a_index)
 This method returns the light behavior of a button.
 
void setButtonState (int a_index, bool a_state)
 This method sets the state of a button.
 
void setButtonToggleMode (int a_index)
 This method sets a button to toggle mode.
 
void setButtonMomentaryMode (int a_index)
 This method sets a button to momentary mode.
 
void setButtonMode (int a_index, int a_mode)
 This method set a button to a given mode.
 
void setButtonToggleOn (int a_index)
 This method toggles the buttons ON.
 
void setButtonToggleOff (int a_index)
 This method toggles the button OFF.
 
void setButtonLightBehavior (int a_index, int a_mode)
 This method sets the light mode of a button.
 
void setButtonLightOn (int a_index)
 This method sets the light of a button ON.
 
void setButtonLightOff (int a_index)
 This method sets the light of a button OFF.
 
void setButtonLightBlinking (int a_index)
 This method sets the light of a button to blinking.
 
void setAllButtonsState (bool a_state)
 This method sets the state of all buttons.
 
void setAllButtonsToggleMode ()
 This method sets all buttons to toggle mode.
 
void setAllButtonsMomentaryMode ()
 This method sets all buttons to momentary mode.
 
void setAllButtonsMode (int a_mode)
 This method sets all buttons to a given mode.
 
void setAllButtonsToggleOn ()
 This method toggles all buttons ON.
 
void setAllButtonsToggleOff ()
 This method toggles all buttons OFF.
 
void setAllButtonsLightBehavior (int a_mode)
 This method sets the light behavior of all buttons.
 
void setAllButtonsLightOn ()
 This method sets the light of all buttons ON.
 
void setAllButtonsLightOff ()
 This method sets the light of all buttons OFF.
 
void setAllButtonsLightBlinking ()
 This method sets the light of all buttona to blinking.
 
void callbackMidiIn (double a_deltatime, std::vector< unsigned char > *a_message)
 This method is a callback for all midi data coming from the interface.
 
void sendMidi3 (unsigned char a_data0, unsigned char a_data1, unsigned char a_data2)
 This method sends a message through the midi port composed of three bytes.
 
void sendMidi2 (unsigned char a_data0, unsigned char a_data1)
 This method sends a message through the midi port composed of two bytes.
 
double convertFrom (unsigned char a_value, double a_rangeMin, double a_rangeMax)
 This method converts a midi value (0-127) into a ranged value.
 
unsigned char convertTo (double a_value, double a_rangeMin, double a_rangeMax)
 This method converts a ranged value into a midi value (0-127).
 
- Public Member Functions inherited from chai3d::cGenericDevice
 cGenericDevice (unsigned int a_deviceNumber=0)
 Constructor of cGenericDevice.
 
virtual ~cGenericDevice ()
 Destructor of cGenericDevice.
 
bool isDeviceAvailable ()
 This method returns true if the device is available for communication, false otherwise.
 
bool isDeviceReady ()
 This method returns true if the connection to the device has been established by calling method open(), false otherwise.
 

Static Public Member Functions

static unsigned int getNumDevices ()
 This method returns the number of haptic devices available for this class of devices.
 
- Static Public Member Functions inherited from chai3d::cGenericDevice
static unsigned int getNumDevices ()
 This method returns the number of haptic devices available for this class of devices.
 

Protected Attributes

cXTouchModel m_model
 Device model.
 
void * midiin
 Midi interface input data.
 
void * midiout
 Midi interface output data.
 
unsigned int m_portNumberIn
 Port number MIDI in.
 
unsigned int m_portNumberOut
 Port number MIDI out.
 
int m_layer
 Current layer.
 
double m_sliderValue [C_XTOUCH_MAX_SLIDERS]
 Slider values.
 
double m_sliderRange [C_XTOUCH_MAX_DIALS][2]
 Slider Ranges.
 
double m_dialValue [C_XTOUCH_MAX_DIALS]
 Dial values.
 
double m_dialRange [C_XTOUCH_MAX_DIALS][2]
 Dial Ranges.
 
bool m_buttonState [C_XTOUCH_MAX_BUTTONS]
 Button states.
 
int m_buttonMode [C_XTOUCH_MAX_BUTTONS]
 Button modes.
 
int m_buttonBehavior [C_XTOUCH_MAX_BUTTONS]
 Button light behavior.
 
- Protected Attributes inherited from chai3d::cGenericDevice
bool m_deviceAvailable
 Flag that indicates if the device is available to the computer.
 
bool m_deviceReady
 Flag that indicates if connection to device was opened successfully by calling method open().
 
int m_deviceNumber
 Device number ID for this category of devices. Value must be equal or bigger than 0. A value of -1 means that the ID has not yet been defined.
 

Additional Inherited Members

- Static Protected Member Functions inherited from chai3d::cGenericDevice
static bool openLibraries ()
 This method opens libraries for this class of devices.
 
static bool closeLibraries ()
 This method closes libraries for this class of devices.
 

Detailed Description

This class implements support for the X-Touch midi controller.

Constructor & Destructor Documentation

◆ cXTouchController()

chai3d::cXTouchController::cXTouchController ( unsigned int  a_deviceNumber = 0)

Constructor of cXTouchController.

◆ ~cXTouchController()

chai3d::cXTouchController::~cXTouchController ( )
virtual

Destructor of cXTouchController.

Member Function Documentation

◆ getNumDevices()

unsigned int chai3d::cXTouchController::getNumDevices ( )
static

This method opens a connection to this device.

Returns
Number of x-touch devices availble

◆ open()

bool chai3d::cXTouchController::open ( )
virtual

This method opens a connection to this device.

Returns
true if operation succeeds, false otherwise.

Reimplemented from chai3d::cGenericDevice.

◆ close()

bool chai3d::cXTouchController::close ( )
virtual

This method closes a connection to this device.

Returns
true if operation succeeds, false otherwise.

Reimplemented from chai3d::cGenericDevice.

◆ getModel()

cXTouchModel chai3d::cXTouchController::getModel ( )
inline

◆ setLayerA()

void chai3d::cXTouchController::setLayerA ( )
inline

◆ setLayerB()

void chai3d::cXTouchController::setLayerB ( )
inline

◆ setLayer()

void chai3d::cXTouchController::setLayer ( int  a_layer)

This method selects the desired layer (A or B)

Parameters
a_layerLayer number: 0 or 1.

◆ initialize()

void chai3d::cXTouchController::initialize ( )

This method iniaitalizes the table to its default state.

◆ getNumSliders()

int chai3d::cXTouchController::getNumSliders ( )

This method returns the number of sliders.

Returns
Number of sliders available.

◆ getSliderValue()

double chai3d::cXTouchController::getSliderValue ( int  a_index)

This method returns the value of a slider.

Parameters
a_indexIndex number of slider.
Returns
Value of slider position.

◆ setSliderValue()

void chai3d::cXTouchController::setSliderValue ( int  a_index,
double  a_value 
)

This method sets the value of a slider.

Parameters
a_indexIndex number of slider.
a_valueDesired value

◆ setAllSlidersValue()

void chai3d::cXTouchController::setAllSlidersValue ( double  a_value)

This method sets all sliders to a given value.

Parameters
a_valueDesired value

◆ getNumDials()

int chai3d::cXTouchController::getNumDials ( )

This method returns the number of dials.

Returns
Number of dials available.

◆ getDialValue()

double chai3d::cXTouchController::getDialValue ( int  a_index)

This method returns the value of a dial.

Parameters
a_indexIndex value.
Returns
Current value of the dial.

◆ getDialRangeMin()

double chai3d::cXTouchController::getDialRangeMin ( int  a_index)

This method returns the minium range value of a dial.

Returns
Minimum range value.

◆ getDialRangeMax()

double chai3d::cXTouchController::getDialRangeMax ( int  a_index)

This method returns the maximum range value of a dial.

Returns
Maximum range value.

◆ setDialRange()

void chai3d::cXTouchController::setDialRange ( int  a_index,
double  a_min,
double  a_max 
)

This method assigns a range of values to the dial.

Parameters
a_indexIndex number of dial.
a_minMinimum range value.
a_maxMaximum range value.

◆ setDialValue()

void chai3d::cXTouchController::setDialValue ( int  a_index,
double  a_value 
)

This method sets a value to a dial.

Parameters
a_indexIndex number of dial.
a_valueDesired value.

◆ setDialMode()

void chai3d::cXTouchController::setDialMode ( int  a_index,
int  a_mode 
)

This method sets the desired display mode of a dial. (0, 1, 2, or 3)

Parameters
a_indexIndex number of dial.
a_modeDesired mode.

◆ setDialModeSingle()

void chai3d::cXTouchController::setDialModeSingle ( int  a_index)

This method sets the display mode of the dial to single.

Parameters
a_indexIndex number of dial.

◆ setDialModePan()

void chai3d::cXTouchController::setDialModePan ( int  a_index)

This method sets the display mode of the dial to pan.

Parameters
a_indexIndex number of dial.

◆ setDialModeFan()

void chai3d::cXTouchController::setDialModeFan ( int  a_index)

This method sets the display mode of the dial to fan.

Parameters
a_indexIndex number of dial.

◆ setDialModeSpread()

void chai3d::cXTouchController::setDialModeSpread ( int  a_index)

This method sets the display mode of the dial to spread.

Parameters
a_indexIndex number of dial.

◆ setDialModeTrim()

void chai3d::cXTouchController::setDialModeTrim ( int  a_index)

This method sets the display mode of the dial to trim.

Parameters
a_indexIndex number of dial.

◆ setDialLightOn()

void chai3d::cXTouchController::setDialLightOn ( int  a_index)

This method turns the lights of the dial ON.

Parameters
a_indexIndex number of dial.

◆ setDialLightOff()

void chai3d::cXTouchController::setDialLightOff ( int  a_index)

This method turns the lights of the dial OFF.

Parameters
a_indexIndex number of dial.

◆ setDialLightBlinking()

void chai3d::cXTouchController::setDialLightBlinking ( int  a_index)

This method turns the lights of the dial to blinking.

Parameters
a_indexIndex number of dial.

◆ setAllDialsValue()

void chai3d::cXTouchController::setAllDialsValue ( double  a_value)

This method sets a value to all dials.

Parameters
a_valueDesired value

◆ setAllDialsRange()

void chai3d::cXTouchController::setAllDialsRange ( double  a_min,
double  a_max 
)

This method assigns a range of values to the dial.

Parameters
a_minMinimum value of range.
a_maxMaximum value of range.

◆ setAllDialsMode()

void chai3d::cXTouchController::setAllDialsMode ( int  a_mode)

This method sets the mode of all dials.

Parameters
a_modeMode.

◆ setAllDialsModeSingle()

void chai3d::cXTouchController::setAllDialsModeSingle ( )

This method sets the display mode of all dials to single.

◆ setAllDialsModePan()

void chai3d::cXTouchController::setAllDialsModePan ( )

This method sets the display mode of all dials to pan.

◆ setAllDialsModeFan()

void chai3d::cXTouchController::setAllDialsModeFan ( )

This method sets the display mode of all dials to fan.

◆ setAllDialsModeSpread()

void chai3d::cXTouchController::setAllDialsModeSpread ( )

This method sets the display mode of all dials to spread.

◆ setAllDialsModeTrim()

void chai3d::cXTouchController::setAllDialsModeTrim ( )

This method sets the display mode of all dials to trim.

◆ setAllDialsLightOn()

void chai3d::cXTouchController::setAllDialsLightOn ( )

This method turns the lights of all dials ON.

◆ setAllDialsLightOff()

void chai3d::cXTouchController::setAllDialsLightOff ( )

This method turns the lights of all dials OFF.

◆ setAllDialsLightBlinking()

void chai3d::cXTouchController::setAllDialsLightBlinking ( )

This method turns the lights of all dials to blinking.

◆ getNumButtons()

int chai3d::cXTouchController::getNumButtons ( )

This method returns the number of buttons.

Returns
Number of available buttons

◆ getButtonMode()

int chai3d::cXTouchController::getButtonMode ( int  a_index)

This method return the current mode of a button.

Parameters
a_indexIndex value.
Returns
Button mode.

◆ getButtonState()

bool chai3d::cXTouchController::getButtonState ( int  a_index)

This method returns the state of a button.

Parameters
a_indexIndex value.
Returns
Button state.

◆ getButtonLightBehavior()

int chai3d::cXTouchController::getButtonLightBehavior ( int  a_index)

This method returns the light behavior of a button.

Parameters
a_indexIndex value.
Returns
Light behavior mode.

◆ setButtonState()

void chai3d::cXTouchController::setButtonState ( int  a_index,
bool  a_state 
)

This method sets the state of a button.

Parameters
a_indexIndex value.
a_stateButton state value.

◆ setButtonToggleMode()

void chai3d::cXTouchController::setButtonToggleMode ( int  a_index)

This method sets a button to toggle mode.

Parameters
a_indexIndex value.

◆ setButtonMomentaryMode()

void chai3d::cXTouchController::setButtonMomentaryMode ( int  a_index)

This method sets a button to momentary mode.

Parameters
a_indexIndex value.

◆ setButtonMode()

void chai3d::cXTouchController::setButtonMode ( int  a_index,
int  a_mode 
)

This method sets a button to a given mode.

Parameters
a_indexIndex value.
a_modeMode

◆ setButtonToggleOn()

void chai3d::cXTouchController::setButtonToggleOn ( int  a_index)

This method toggles the buttons ON.

Parameters
a_indexIndex value.

◆ setButtonToggleOff()

void chai3d::cXTouchController::setButtonToggleOff ( int  a_index)

This method toggles the button OFF.

Parameters
a_indexIndex value.

◆ setButtonLightBehavior()

void chai3d::cXTouchController::setButtonLightBehavior ( int  a_index,
int  a_mode 
)

This method sets the light mode of a button.

Parameters
a_indexIndex value.
a_modeMode

◆ setButtonLightOn()

void chai3d::cXTouchController::setButtonLightOn ( int  a_index)

This method sets the light of a button ON.

Parameters
a_indexIndex value.

◆ setButtonLightOff()

void chai3d::cXTouchController::setButtonLightOff ( int  a_index)

This method sets the light of a button OFF.

Parameters
a_indexIndex value.

◆ setButtonLightBlinking()

void chai3d::cXTouchController::setButtonLightBlinking ( int  a_index)

This method sets the light of a button to blinking.

Parameters
a_indexIndex value.

◆ setAllButtonsState()

void chai3d::cXTouchController::setAllButtonsState ( bool  a_state)

This method sets the state of all buttons

Parameters
a_stateButton state value.

◆ setAllButtonsToggleMode()

void chai3d::cXTouchController::setAllButtonsToggleMode ( )

This method sets all buttons to toggle mode.

◆ setAllButtonsMomentaryMode()

void chai3d::cXTouchController::setAllButtonsMomentaryMode ( )

This method sets all buttons to momentary mode.

◆ setAllButtonsMode()

void chai3d::cXTouchController::setAllButtonsMode ( int  a_mode)

This method sets all buttons to a given mode.

Parameters
a_modeButton mode.

◆ setAllButtonsToggleOn()

void chai3d::cXTouchController::setAllButtonsToggleOn ( )

This method toggles all buttons ON.

◆ setAllButtonsToggleOff()

void chai3d::cXTouchController::setAllButtonsToggleOff ( )

This method toggles all buttons OFF.

◆ setAllButtonsLightBehavior()

void chai3d::cXTouchController::setAllButtonsLightBehavior ( int  a_mode)

This method sets the light behavior of all buttons.

Parameters
a_modeLight behavior mode.

◆ setAllButtonsLightOn()

void chai3d::cXTouchController::setAllButtonsLightOn ( )

This method sets the light of all buttons ON.

◆ setAllButtonsLightOff()

void chai3d::cXTouchController::setAllButtonsLightOff ( )

This method sets the light of all buttons OFF.

◆ setAllButtonsLightBlinking()

void chai3d::cXTouchController::setAllButtonsLightBlinking ( )

This method sets the light of all buttona to blinking.

◆ callbackMidiIn()

void chai3d::cXTouchController::callbackMidiIn ( double  a_deltatime,
std::vector< unsigned char > *  a_message 
)

This method implements a call back for incoming data from XTouchInterface.

Parameters
a_deltatimeTimestamp.
a_messageIncoming midi message.

◆ sendMidi3()

void chai3d::cXTouchController::sendMidi3 ( unsigned char  a_data0,
unsigned char  a_data1,
unsigned char  a_data2 
)

This method sends a three-byte command through the midi port

Parameters
a_data0Data value 0
a_data1Data value 1
a_data2Data value 2

◆ sendMidi2()

void chai3d::cXTouchController::sendMidi2 ( unsigned char  a_data0,
unsigned char  a_data1 
)

This method sends a two-byte command through the midi port

Parameters
a_data0Data value 0
a_data1Data value 1

◆ convertFrom()

double chai3d::cXTouchController::convertFrom ( unsigned char  a_value,
double  a_rangeMin,
double  a_rangeMax 
)

This method converts a midi value (0-127) into a ranged value.

Parameters
a_valueInput value from midi interface.
a_rangeMinMinimum range value after conversion.
a_rangeMaxMaximum range value after conversion.
Returns
Converted value.

◆ convertTo()

unsigned char chai3d::cXTouchController::convertTo ( double  a_value,
double  a_rangeMin,
double  a_rangeMax 
)

This method converts a ranged value into a midi value (0-127).

Parameters
a_valueInput value.
a_rangeMinMinimum range value before conversion.
a_rangeMaxMaximum range value before conversion.
Returns
Converted value.

Member Data Documentation

◆ m_model

cXTouchModel chai3d::cXTouchController::m_model
protected

◆ midiin

void* chai3d::cXTouchController::midiin
protected

◆ midiout

void* chai3d::cXTouchController::midiout
protected

◆ m_portNumberIn

unsigned int chai3d::cXTouchController::m_portNumberIn
protected

◆ m_portNumberOut

unsigned int chai3d::cXTouchController::m_portNumberOut
protected

◆ m_layer

int chai3d::cXTouchController::m_layer
protected

◆ m_sliderValue

double chai3d::cXTouchController::m_sliderValue[C_XTOUCH_MAX_SLIDERS]
protected

◆ m_sliderRange

double chai3d::cXTouchController::m_sliderRange[C_XTOUCH_MAX_DIALS][2]
protected

◆ m_dialValue

double chai3d::cXTouchController::m_dialValue[C_XTOUCH_MAX_DIALS]
protected

◆ m_dialRange

double chai3d::cXTouchController::m_dialRange[C_XTOUCH_MAX_DIALS][2]
protected

◆ m_buttonState

bool chai3d::cXTouchController::m_buttonState[C_XTOUCH_MAX_BUTTONS]
protected

◆ m_buttonMode

int chai3d::cXTouchController::m_buttonMode[C_XTOUCH_MAX_BUTTONS]
protected

◆ m_buttonBehavior

int chai3d::cXTouchController::m_buttonBehavior[C_XTOUCH_MAX_BUTTONS]
protected

The documentation for this class was generated from the following files: