/*!
* @brief Sends a volume up keypress to an audiosystem if it's present.
- * @param bWait Wait for the response of the audiosystem when true.
+ * @param bSendRelease Send a key release after the keypress.
* @return The new audio status.
*/
- virtual uint8_t VolumeUp(bool bWait = true) = 0;
+ virtual uint8_t VolumeUp(bool bSendRelease = true) = 0;
/*!
* @brief Sends a volume down keypress to an audiosystem if it's present.
- * @param bWait Wait for the response of the audiosystem when true.
+ * @param bSendRelease Send a key release after the keypress.
* @return The new audio status.
*/
- virtual uint8_t VolumeDown(bool bWait = true) = 0;
+ virtual uint8_t VolumeDown(bool bSendRelease = true) = 0;
/*!
* @brief Sends a mute keypress to an audiosystem if it's present.
- * @param bWait Wait for the response of the audiosystem when true.
+ * @param bSendRelease Send a key release after the keypress.
* @return The new audio status.
*/
- virtual uint8_t MuteAudio(bool bWait = true) = 0;
+ virtual uint8_t MuteAudio(bool bSendRelease = true) = 0;
/*!
* @brief Send a keypress to a device on the CEC bus.
extern DECLSPEC int cec_set_hdmi_port(cec_logical_address iBaseDevice, uint8_t iPort);
#endif
-extern DECLSPEC int cec_volume_up(int bWait);
+extern DECLSPEC int cec_volume_up(int bSendRelease);
-extern DECLSPEC int cec_volume_down(int bWait);
+extern DECLSPEC int cec_volume_down(int bSendRelease);
-extern DECLSPEC int cec_mute_audio(int bWait);
+extern DECLSPEC int cec_mute_audio(int bSendRelease);
#ifdef __cplusplus
extern DECLSPEC int cec_send_keypress(CEC::cec_logical_address iDestination, CEC::cec_user_control_code key, int bWait);
return false;
}
-uint8_t CCECProcessor::VolumeUp(void)
+uint8_t CCECProcessor::VolumeUp(bool bSendRelease /* = true */)
{
uint8_t status = 0;
if (IsPresentDevice(CECDEVICE_AUDIOSYSTEM))
- status = ((CCECAudioSystem *)m_busDevices[CECDEVICE_AUDIOSYSTEM])->VolumeUp();
+ status = ((CCECAudioSystem *)m_busDevices[CECDEVICE_AUDIOSYSTEM])->VolumeUp(bSendRelease);
return status;
}
-uint8_t CCECProcessor::VolumeDown(void)
+uint8_t CCECProcessor::VolumeDown(bool bSendRelease /* = true */)
{
uint8_t status = 0;
if (IsPresentDevice(CECDEVICE_AUDIOSYSTEM))
- status = ((CCECAudioSystem *)m_busDevices[CECDEVICE_AUDIOSYSTEM])->VolumeDown();
+ status = ((CCECAudioSystem *)m_busDevices[CECDEVICE_AUDIOSYSTEM])->VolumeDown(bSendRelease);
return status;
}
-uint8_t CCECProcessor::MuteAudio(void)
+uint8_t CCECProcessor::MuteAudio(bool bSendRelease /* = true */)
{
uint8_t status = 0;
if (IsPresentDevice(CECDEVICE_AUDIOSYSTEM))
- status = ((CCECAudioSystem *)m_busDevices[CECDEVICE_AUDIOSYSTEM])->MuteAudio();
+ status = ((CCECAudioSystem *)m_busDevices[CECDEVICE_AUDIOSYSTEM])->MuteAudio(bSendRelease);
return status;
}
virtual bool SetActiveSource(uint16_t iStreamPath);
virtual bool SwitchMonitoring(bool bEnable);
virtual bool PollDevice(cec_logical_address iAddress);
- virtual uint8_t VolumeUp(void);
- virtual uint8_t VolumeDown(void);
- virtual uint8_t MuteAudio(void);
+ virtual uint8_t VolumeUp(bool bSendRelease = true);
+ virtual uint8_t VolumeDown(bool bSendRelease = true);
+ virtual uint8_t MuteAudio(bool bSendRelease = true);
virtual bool TransmitKeypress(cec_logical_address iDestination, cec_user_control_code key);
virtual bool TransmitKeyRelease(cec_logical_address iDestination);
virtual bool EnablePhysicalAddressDetection(void) { return false; };
return false;
}
-uint8_t CLibCEC::VolumeUp(bool bWait /* = true */)
+uint8_t CLibCEC::VolumeUp(bool bSendRelease /* = true */)
{
if (m_cec)
- return m_cec->VolumeUp();
+ return m_cec->VolumeUp(bSendRelease);
return 0;
}
-uint8_t CLibCEC::VolumeDown(bool bWait /* = true */)
+uint8_t CLibCEC::VolumeDown(bool bSendRelease /* = true */)
{
if (m_cec)
- return m_cec->VolumeDown();
+ return m_cec->VolumeDown(bSendRelease);
return 0;
}
-uint8_t CLibCEC::MuteAudio(bool bWait /* = true */)
+uint8_t CLibCEC::MuteAudio(bool bSendRelease /* = true */)
{
if (m_cec)
- return m_cec->MuteAudio();
+ return m_cec->MuteAudio(bSendRelease);
return 0;
}
virtual bool IsActiveDevice(cec_logical_address iAddress);
virtual bool IsActiveDeviceType(cec_device_type type);
virtual bool SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort = CEC_DEFAULT_HDMI_PORT);
- virtual uint8_t VolumeUp(bool bWait = true);
- virtual uint8_t VolumeDown(bool bWait = true);
- virtual uint8_t MuteAudio(bool bWait = true);
+ virtual uint8_t VolumeUp(bool bSendRelease = true);
+ virtual uint8_t VolumeDown(bool bSendRelease = true);
+ virtual uint8_t MuteAudio(bool bSendRelease = true);
virtual bool SendKeypress(cec_logical_address iDestination, cec_user_control_code key, bool bWait = false);
virtual bool SendKeyRelease(cec_logical_address iDestination, bool bWait = false);
virtual cec_osd_name GetDeviceOSDName(cec_logical_address iAddress);
return -1;
}
-int cec_volume_up(int bWait)
+int cec_volume_up(int bSendRelease)
{
if (cec_parser)
- return cec_parser->VolumeUp(bWait == 1);
+ return cec_parser->VolumeUp(bSendRelease == 1);
return -1;
}
-int cec_volume_down(int bWait)
+int cec_volume_down(int bSendRelease)
{
if (cec_parser)
- return cec_parser->VolumeDown(bWait == 1);
+ return cec_parser->VolumeDown(bSendRelease == 1);
return -1;
}
-int cec_mute_audio(int bWait)
+int cec_mute_audio(int bSendRelease)
{
if (cec_parser)
- return cec_parser->MuteAudio(bWait == 1);
+ return cec_parser->MuteAudio(bSendRelease == 1);
return -1;
}
return m_handler->TransmitSystemAudioModeStatus(m_iLogicalAddress, dest, state);
}
-uint8_t CCECAudioSystem::VolumeUp(void)
+uint8_t CCECAudioSystem::VolumeUp(bool bSendRelease /* = true */)
{
- if (TransmitKeypress(CEC_USER_CONTROL_CODE_VOLUME_UP))
+ if (TransmitKeypress(CEC_USER_CONTROL_CODE_VOLUME_UP) && bSendRelease)
TransmitKeyRelease();
CLockObject lock(&m_mutex);
return m_audioStatus;
}
-uint8_t CCECAudioSystem::VolumeDown(void)
+uint8_t CCECAudioSystem::VolumeDown(bool bSendRelease /* = true */)
{
- if (TransmitKeypress(CEC_USER_CONTROL_CODE_VOLUME_DOWN))
+ if (TransmitKeypress(CEC_USER_CONTROL_CODE_VOLUME_DOWN) && bSendRelease)
TransmitKeyRelease();
CLockObject lock(&m_mutex);
return m_audioStatus;
}
-uint8_t CCECAudioSystem::MuteAudio(void)
+uint8_t CCECAudioSystem::MuteAudio(bool bSendRelease /* = true */)
{
- if (TransmitKeypress(CEC_USER_CONTROL_CODE_MUTE))
+ if (TransmitKeypress(CEC_USER_CONTROL_CODE_MUTE) && bSendRelease)
TransmitKeyRelease();
CLockObject lock(&m_mutex);
virtual bool TransmitSetSystemAudioMode(cec_logical_address dest);
virtual bool TransmitSystemAudioModeStatus(cec_logical_address dest);
- virtual uint8_t VolumeUp(void);
- virtual uint8_t VolumeDown(void);
- virtual uint8_t MuteAudio(void);
+ virtual uint8_t VolumeUp(bool bSendRelease = true);
+ virtual uint8_t VolumeDown(bool bSendRelease = true);
+ virtual uint8_t MuteAudio(bool bSendRelease = true);
virtual bool TransmitActiveSource(void) { return false; }