SinricPro Library
|
Device to control a smart speaker. More...
Public Types | |
typedef std::function< bool(const String &, int &)> | SetVolumeCallback |
Callback definition for onSetVolume function. More... | |
typedef std::function< bool(const String &, int &)> | AdjustVolumeCallback |
Callback definition for onAdjustVolume function. More... | |
typedef std::function< bool(const String &, bool &)> | MuteCallback |
Callback definition for onMute function. More... | |
typedef std::function< bool(const String &, String &)> | MediaControlCallback |
Callback definition for onMediaControl function. More... | |
typedef std::function< bool(const String &, String &)> | SelectInputCallback |
Callback definition for onSelectInput function. More... | |
typedef std::function< bool(const String &, const String &, int &)> | SetBandsCallback |
Callback definition for onSetBands function. More... | |
typedef std::function< bool(const String &, const String &, int &)> | AdjustBandsCallback |
Callback definition for onAdjustBands function. More... | |
typedef std::function< bool(const String &, const String &, int &)> | ResetBandsCallback |
Callback definition for onResetBands function. More... | |
typedef std::function< bool(const String &, String &)> | ModeCallback |
Callback definition for onSetMode function. More... | |
typedef std::function< bool(const String &, bool &)> | PowerStateCallback |
Callback definition for onPowerState function. More... | |
Public Member Functions | |
void | onSetVolume (SetVolumeCallback cb) |
Set callback function for setVolume request. More... | |
void | onAdjustVolume (AdjustVolumeCallback cb) |
Set callback function for adjustVolume request. More... | |
void | onMute (MuteCallback cb) |
Set callback function for setMute request. More... | |
void | onMediaControl (MediaControlCallback cb) |
Set callback function for mediaControl request. More... | |
void | onSetBands (SetBandsCallback cb) |
Set callback function for setBands request. More... | |
void | onAdjustBands (AdjustBandsCallback cb) |
Set callback function for adjustBands request. More... | |
void | onResetBands (ResetBandsCallback cb) |
Set callback function for resetBands request. More... | |
void | onSetMode (ModeCallback cb) |
Set callback function for setMode request. More... | |
bool | sendVolumeEvent (int volume, String cause="PHYSICAL_INTERACTION") |
Send setVolume event to SinricPro Server indicating actual volume has changed. More... | |
bool | sendMuteEvent (bool mute, String cause="PHYSICAL_INTERACTION") |
Send setMute event to SinricPro Server indicating actual mute state. More... | |
bool | sendMediaControlEvent (String mediaControl, String cause="PHYSICAL_INTERACTION") |
Send mediaControl event to SinricPro Server indicating devices media control state. More... | |
bool | sendSelectInputEvent (String intput, String cause="PHYSICAL_INTERACTION") |
Send selectInput event to SinricPro Server to report selected input. More... | |
bool | sendBandsEvent (String bands, int level, String cause="PHYSICAL_INTERACTION") |
Send setBands event to SinricPro Server indicating bands level has changed. More... | |
bool | sendModeEvent (String mode, String cause="PHYSICAL_INTERACTION") |
Send setMode event to SinricPro Server indicating the mode has changed. More... | |
virtual void | onPowerState (PowerStateCallback cb) |
Set callback function for powerState request. More... | |
bool | sendPowerStateEvent (bool state, String cause="PHYSICAL_INTERACTION") |
Send setPowerState event to SinricPro Server indicating actual power state. More... | |
Device to control a smart speaker.
Supporting:
typedef std::function<bool(const String&, const String&, int&)> AdjustBandsCallback |
Callback definition for onAdjustBands function.
Gets called when device receive a adjustBands
request
[in] | deviceId | String which contains the ID of device |
[in] | bands | String with requested bands to change BASS , MIDRANGE , TREBBLE |
[in] | levelDelta | Integer with relative level value device should change bands about |
[out] | bands | String with changed bands BASS , MIDRANGE , TREBBLE |
[out] | levelDelta | Integer value with level bands changed to |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, int&)> AdjustVolumeCallback |
Callback definition for onAdjustVolume function.
Gets called when device receive a adjustVolume
request
[in] | deviceId | String which contains the ID of device |
[in] | volumeDelta | Integer with relative volume the device should change about (-100..100) |
[out] | volumeDelta | Integer with absolute volume device has been set to |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, String&)> MediaControlCallback |
Callback definition for onMediaControl function.
Gets called when device receive a mediaControl
request
[in] | deviceId | String which contains the ID of device |
[in] | control | String with requested control FastForward , Next , Pause , Play , Previous , Rewind , StartOver , Stop |
[out] | control | String with control FastForward , Next , Pause , Play , Previous , Rewind , StartOver , Stop |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, String&)> ModeCallback |
Callback definition for onSetMode function.
Gets called when device receive a setBands
request
[in] | deviceId | String which contains the ID of device |
[in] | mode | String device mode should set to MOVIE , MUSIC , NIGHT , SPORT , TV |
[out] | mode | String devices mode is set to MOVIE , MUSIC , NIGHT , SPORT , TV |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, bool&)> MuteCallback |
Callback definition for onMute function.
Gets called when device receive a setMute
request
[in] | deviceId | String which contains the ID of device |
[in] | mute | true mute device false unmute device |
[out] | mute | true device is muted false device is unmuted |
true | request handled properly |
false | request was not handled properly because of some error |
|
inherited |
Callback definition for onPowerState function.
Gets called when device receive a setPowerState
reuqest
[in] | deviceId | String which contains the ID of device |
[in] | state | true = device is requested to turn on false = device is requested to turn off |
[out] | state | true = device has been turned on false = device has been turned off |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, const String&, int&)> ResetBandsCallback |
Callback definition for onResetBands function.
Gets called when device receive a onResetBands
request
[in] | deviceId | String which contains the ID of device |
[in] | bands | String with requested bands to reset BASS , MIDRANGE , TREBBLE |
[out] | bands | String with changed bands BASS , MIDRANGE , TREBBLE |
[out] | level | Integer value with level bands changed to |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, String&)> SelectInputCallback |
Callback definition for onSelectInput function.
Gets called when device receive a selectInput
request
[in] | deviceId | String which contains the ID of device |
[in] | input | String with input name device is requested to switch to AUX 1 ..AUX 7 , BLURAY , CABLE , CD , COAX 1 ,COAX 2 , COMPOSITE 1 , DVD , GAME , HD RADIO , HDMI 1 .. HDMI 10 , HDMI ARC , INPUT 1 ..INPUT 10 , IPOD , LINE 1 ..LINE 7 , MEDIA PLAYER , OPTICAL 1 , OPTICAL 2 , PHONO , PLAYSTATION , PLAYSTATION 3 , PLAYSTATION 4 , SATELLITE , SMARTCAST , TUNER , TV , USB DAC , VIDEO 1 ..VIDEO 3 , XBOX |
[out] | input | String with input name device has switchted to AUX 1 ..AUX 7 , BLURAY , CABLE , CD , COAX 1 ,COAX 2 , COMPOSITE 1 , DVD , GAME , HD RADIO , HDMI 1 .. HDMI 10 , HDMI ARC , INPUT 1 ..INPUT 10 , IPOD , LINE 1 ..LINE 7 , MEDIA PLAYER , OPTICAL 1 , OPTICAL 2 , PHONO , PLAYSTATION , PLAYSTATION 3 , PLAYSTATION 4 , SATELLITE , SMARTCAST , TUNER , TV , USB DAC , VIDEO 1 ..VIDEO 3 , XBOX |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, const String&, int&)> SetBandsCallback |
Callback definition for onSetBands function.
Gets called when device receive a setBands
request
[in] | deviceId | String which contains the ID of device |
[in] | bands | String with requested bands to change BASS , MIDRANGE , TREBBLE |
[in] | level | Integer value with level bands should set to |
[out] | bands | String with changed bands BASS , MIDRANGE , TREBBLE |
[out] | level | Integer value with level bands changed to |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, int&)> SetVolumeCallback |
Callback definition for onSetVolume function.
Gets called when device receive a setVolume
request
[in] | deviceId | String which contains the ID of device |
[in] | volume | Integer with volume device should set to |
[out] | volume | Integer with volume device has been set to |
true | request handled properly |
false | request was not handled properly because of some error |
void onAdjustBands | ( | AdjustBandsCallback | cb | ) |
Set callback function for adjustBands
request.
cb | Function pointer to a AdjustBandsCallback function |
void onAdjustVolume | ( | AdjustVolumeCallback | cb | ) |
Set callback function for adjustVolume
request.
cb | Function pointer to a AdjustVolumeCallback function |
void onMediaControl | ( | MediaControlCallback | cb | ) |
Set callback function for mediaControl
request.
cb | Function pointer to a MediaControlCallback function |
void onMute | ( | MuteCallback | cb | ) |
Set callback function for setMute
request.
cb | Function pointer to a MuteCallback function |
|
virtualinherited |
Set callback function for powerState
request.
cb | Function pointer to a PowerStateCallback function |
void onResetBands | ( | ResetBandsCallback | cb | ) |
Set callback function for resetBands
request.
cb | Function pointer to a ResetBandsCallback function |
void onSetBands | ( | SetBandsCallback | cb | ) |
Set callback function for setBands
request.
cb | Function pointer to a SetBandsCallback function |
void onSetMode | ( | ModeCallback | cb | ) |
Set callback function for setMode
request.
cb | Function pointer to a ModeCallback function |
void onSetVolume | ( | SetVolumeCallback | cb | ) |
Set callback function for setVolume
request.
cb | Function pointer to a SetVolumeCallback function |
bool sendBandsEvent | ( | String | bands, |
int | level, | ||
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send setBands
event to SinricPro Server indicating bands level has changed.
bands | String which bands has changed BASS , MIDRANGE , TREBBLE |
level | Integer with changed bands level |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
bool sendMediaControlEvent | ( | String | mediaControl, |
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send mediaControl
event to SinricPro Server indicating devices media control state.
mediaControl | String with actual media control FastForward , Next , Pause , Play , Previous , Rewind , StartOver , Stop |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
bool sendModeEvent | ( | String | mode, |
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send setMode
event to SinricPro Server indicating the mode has changed.
mode | String with actual mode device is set to MOVIE , MUSIC , NIGHT , SPORT , TV |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
bool sendMuteEvent | ( | bool | mute, |
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send setMute
event to SinricPro Server indicating actual mute state.
mute | true = device is muted on false = device is unmuted |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
|
inherited |
Send setPowerState
event to SinricPro Server indicating actual power state.
state | true = device turned on false = device turned off |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
bool sendSelectInputEvent | ( | String | input, |
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send selectInput
event to SinricPro Server to report selected input.
input | String with actual media control AUX 1 ..AUX 7 , BLURAY , CABLE , CD , COAX 1 ,COAX 2 , COMPOSITE 1 , DVD , GAME , HD RADIO , HDMI 1 .. HDMI 10 , HDMI ARC , INPUT 1 ..INPUT 10 , IPOD , LINE 1 ..LINE 7 , MEDIA PLAYER , OPTICAL 1 , OPTICAL 2 , PHONO , PLAYSTATION , PLAYSTATION 3 , PLAYSTATION 4 , SATELLITE , SMARTCAST , TUNER , TV , USB DAC , VIDEO 1 ..VIDEO 3 , XBOX |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
bool sendVolumeEvent | ( | int | volume, |
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send setVolume
event to SinricPro Server indicating actual volume has changed.
volume | Integer reporting the volume that the device have been set to |
cause | (optional) Reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |