JUCE
|
Receives events from an Apple IR remote control device (Only available in OSX!). More...
Public Types | |
enum | ButtonType { menuButton = 0, playButton, plusButton, minusButton, rightButton, leftButton, rightButton_Long, leftButton_Long, menuButton_Long, playButtonSleepMode, switched } |
The set of buttons that may be pressed. More... | |
Public Member Functions | |
AppleRemoteDevice () | |
virtual | ~AppleRemoteDevice () |
virtual void | buttonPressed (ButtonType buttonId, bool isDown)=0 |
Override this method to receive the callback about a button press. More... | |
bool | start (bool inExclusiveMode) |
Starts the device running and responding to events. More... | |
void | stop () |
Stops the device running. More... | |
bool | isActive () const |
Returns true if the device has been started successfully. More... | |
int | getRemoteId () const |
Returns the ID number of the remote, if it has sent one. More... | |
void | handleCallbackInternal () |
Receives events from an Apple IR remote control device (Only available in OSX!).
To use it, just create a subclass of this class, implementing the buttonPressed() callback, then call start() and stop() to start or stop receiving events.
The set of buttons that may be pressed.
AppleRemoteDevice::AppleRemoteDevice | ( | ) |
|
virtual |
|
pure virtual |
Override this method to receive the callback about a button press.
The callback will happen on the application's message thread.
Some buttons trigger matching up and down events, in which the isDown parameter will be true and then false. Others only send a single event when the button is pressed.
bool AppleRemoteDevice::start | ( | bool | inExclusiveMode | ) |
Starts the device running and responding to events.
Returns true if it managed to open the device.
inExclusiveMode | if true, the remote will be grabbed exclusively for this app, and will not be available to any other part of the system. If false, it will be shared with other apps. |
void AppleRemoteDevice::stop | ( | ) |
Stops the device running.
bool AppleRemoteDevice::isActive | ( | ) | const |
Returns true if the device has been started successfully.
int AppleRemoteDevice::getRemoteId | ( | ) | const |
Returns the ID number of the remote, if it has sent one.
References JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR.
void AppleRemoteDevice::handleCallbackInternal | ( | ) |