libmanta
A cross-platform API for the Snyderphonics Manta
|
Superclass that provides an interface to the Manta. More...
#include <Manta.h>
Public Member Functions | |
Manta (void) | |
Manta constructor. | |
virtual void | SetPadLED (LEDState state, int ledID) |
Sets a single LED. | |
virtual void | SetPadLEDRow (LEDState state, int row, uint8_t mask) |
Sets a row of LEDs. | |
virtual void | SetPadLEDColumn (LEDState state, int column, uint8_t mask) |
Sets a column of LEDs. | |
virtual void | SetPadLEDFrame (LEDState state, uint8_t mask[]) |
Sets all the pad LEDs at the same time. | |
virtual void | SetSliderLED (LEDState state, int id, uint8_t mask) |
Sets the slider LEDs. | |
virtual void | SetButtonLED (LEDState state, int id) |
Sets a button LED. | |
virtual void | ResendLEDState (void) |
Resends the currently-stored LED State. | |
virtual void | ClearPadAndButtonLEDs (void) |
Sets all the Pad and Button LEDs to Off. | |
virtual void | ClearButtonLEDs (void) |
Sets all the Button LEDs to Off. | |
virtual void | Recalibrate (void) |
Toggles the Recalibrate bit on the Manta. | |
virtual void | SetLEDControl (LEDControlType control, bool state) |
Sets the current LED Control mode. | |
virtual void | SetTurboMode (bool Enabled) |
Enables or Disables Turbo Mode. | |
virtual void | SetRawMode (bool Enabled) |
Enables or Disables Raw Mode. | |
virtual void | SetMaxSensorValues (int *values) |
Sets the maximum sensor values used for scaling. |
Superclass that provides an interface to the Manta.
The Manta class is intended to use as a base class within your application. In order to use libmanta, subclass this and define implementations for any callback functions that you would like your application to be notified of. The event functions are declared in the MantaClient interface.
Creating an instance of the Manta class (or a subclass) will not initiate a connection to any plugged-in mantas. Before you can start communicating with the Manta you must call its Connect() method to connect to a physical Manta over USB.
Once connected, your application should periodically call the static method HandleEvents(). This will take care of servicing the low-level USB communication for all connected Mantas.
Manta::Manta | ( | void | ) |
void Manta::SetButtonLED | ( | LEDState | state, |
int | id | ||
) | [virtual] |
Sets a button LED.
state | Off, Amber, or Red. |
id | ID of the button LED you'd like to set |
Implements MantaServer.
void Manta::SetLEDControl | ( | LEDControlType | control, |
bool | state | ||
) | [virtual] |
Sets the current LED Control mode.
control | Which control set will be toggled |
state | false for disabled, true for enabled |
LEDs on the Manta can either be controlled automatically by the Manta itself in response to touch, or driven my messages by the host. This method determines how the LEDs are controlled in the Manta. Setting a zone of LEDs to Enabled causes them to be controlled by the host, and Disabled will hand control to the Manta.
Implements MantaServer.
void Manta::SetMaxSensorValues | ( | int * | values | ) | [virtual] |
Sets the maximum sensor values used for scaling.
values | array of 52 ints to set new scaling values |
libmanta scales the incoming values from the Manta to equalize the sensitivity of the pads. Without this scaling, some pads tend to be more or less sensitive depending on their location, and manufacturing variations.
libmanta comes with built-in scaling factors that should be suitable for most Mantas, but this method allows your application to tune those scaling factors to an individual user's Manta. After scaling, the pads each should output a number from 0 - 210.
To calibrate a Manta
Implements MantaServer.
void Manta::SetPadLED | ( | LEDState | state, |
int | ledID | ||
) | [virtual] |
Sets a single LED.
state | Off, Amber, or Red |
ledID | The ID of the LED to be set (0 - 47) |
Implements MantaServer.
void Manta::SetPadLEDColumn | ( | LEDState | state, |
int | column, | ||
uint8_t | mask | ||
) | [virtual] |
Sets a column of LEDs.
state | Off, Amber, or Red. All LEDs with their bit set to one in the mask will be set to this state |
column | The column index, starting with 0 on the left |
mask | A mask representing the column. The lsb is the bottom LED |
Implements MantaServer.
void Manta::SetPadLEDFrame | ( | LEDState | state, |
uint8_t | mask[] | ||
) | [virtual] |
Sets all the pad LEDs at the same time.
state | Off, Amber, or Red. All LEDs with their bit set to one in the mask will be set to this state |
mask | A 6-byte mask representing all the pads. The first byte is the bottom row, and the lsb is the leftmost LED |
Implements MantaServer.
void Manta::SetPadLEDRow | ( | LEDState | state, |
int | row, | ||
uint8_t | mask | ||
) | [virtual] |
Sets a row of LEDs.
state | Off, Amber, or Red. All LEDs with their bit set to one in the mask will be set to this state |
row | The row index, starting with 0 at the bottom |
mask | A mask representing the row. The lsb is the rightmost LED |
Implements MantaServer.
void Manta::SetRawMode | ( | bool | Enabled | ) | [virtual] |
Enables or Disables Raw Mode.
Enabled | false for disabled, true for enabled |
Normally the Manta does some pre-processing of its output to remove low-level noise from the sensors. By enabling Raw mode you can bypass the filtering to get the raw values delivered by the sensor. This causes lots of noise on individual pads, but is sometimes useful in conjunction with centroid detection.
Implements MantaServer.
void Manta::SetSliderLED | ( | LEDState | state, |
int | id, | ||
uint8_t | mask | ||
) | [virtual] |
Sets the slider LEDs.
state | Off, Amber, or Red. All LEDs with their bit set to one in the mask will be set to this state |
id | 0 for the bottom slider, 1 for the top slider |
mask | A mask representing the slider. The lsb is the rightmost LED |
Implements MantaServer.
void Manta::SetTurboMode | ( | bool | Enabled | ) | [virtual] |
Enables or Disables Turbo Mode.
Enabled | false for disabled, true for enabled |
TBD - need to ask Jeff exactly how Turbo Mode works
Implements MantaServer.