SinricPro Library
|
Device to control a TV. 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 &, String &)> | ChangeChannelCallback |
Callback definition for onChangeChannel function. More... | |
typedef std::function< bool(const String &, int, String &)> | ChangeChannelNumberCallback |
Callback definition for onChangeChannelNumber function. More... | |
typedef std::function< bool(const String &, int, String &)> | SkipChannelsCallback |
Callback definition for onSkipChannels 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 | onSelectInput (SelectInputCallback cb) |
Set callback function for selectInput request. More... | |
void | onChangeChannel (ChangeChannelCallback cb) |
Set callback function for changeChannel request. More... | |
void | onChangeChannelNumber (ChangeChannelNumberCallback cb) |
Set callback function for changeChannel request. More... | |
void | onSkipChannels (SkipChannelsCallback cb) |
Set callback function for skipChannels 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 | sendChangeChannelEvent (String channelName, String cause="PHYSICAL_INTERACTION") |
Send changeChannel event to SinricPro Server to report selected channel. 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 TV.
Supporting:
FastForward
, Next
, Pause
, Play
, Previous
, Rewind
, StartOver
, Stop
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
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&)> ChangeChannelCallback |
Callback definition for onChangeChannel function.
Gets called when device receive a changeChannel
request by using channel name
[in] | deviceId | String which contains the ID of device |
[in] | channel | String with channel name device is requested to switch to |
[out] | channel | String with channel name device has switchted to |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, int, String&)> ChangeChannelNumberCallback |
Callback definition for onChangeChannelNumber function.
Gets called when device receive a changeChannel
request by using channel number
[in] | deviceId | String which contains the ID of device |
[in] | channelNumber | Integer with channel number device is requested to switch to |
[out] | channelName | String with channel name device has switchted 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&, 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&, 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&, 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 |
typedef std::function<bool(const String&, int, String&)> SkipChannelsCallback |
Callback definition for onSkipChannels function.
Gets called when device receive a changeChannel
request by using channel number
[in] | deviceId | String which contains the ID of device |
[in] | channelCount | Integer with channels device is requested to skip -n ..+n |
[out] | channelName | String with channel name device has switchted to |
true | request handled properly |
false | request was not handled properly because of some error |
void onAdjustVolume | ( | AdjustVolumeCallback | cb | ) |
Set callback function for adjustVolume
request.
cb | Function pointer to a AdjustVolumeCallback function |
void onChangeChannel | ( | ChangeChannelCallback | cb | ) |
Set callback function for changeChannel
request.
cb | Function pointer to a ChangeChannelCallback function |
void onChangeChannelNumber | ( | ChangeChannelNumberCallback | cb | ) |
Set callback function for changeChannel
request.
cb | Function pointer to a ChangeChannelNumberCallback 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 onSelectInput | ( | SelectInputCallback | cb | ) |
Set callback function for selectInput
request.
cb | Function pointer to a SelectInputCallback function |
void onSetVolume | ( | SetVolumeCallback | cb | ) |
Set callback function for setVolume
request.
cb | Function pointer to a SetVolumeCallback function |
void onSkipChannels | ( | SkipChannelsCallback | cb | ) |
Set callback function for skipChannels
request.
cb | Function pointer to a SkipChannelsCallback function |
bool sendChangeChannelEvent | ( | String | channelName, |
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send changeChannel
event to SinricPro Server to report selected channel.
channelName | String with actual channel |
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 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 |