Skip to content
Permalink
Browse files

changed: moved transmitting volume change commands to CCECBusDevice

  • Loading branch information...
opdenkamp committed Oct 26, 2016
1 parent f49b884 commit 59c35e3d5ba324d9c6e36a42db76f4eded5eb630
Showing with 28 additions and 11 deletions.
  1. +3 −11 src/libcec/devices/CECAudioSystem.cpp
  2. +22 −0 src/libcec/devices/CECBusDevice.cpp
  3. +3 −0 src/libcec/devices/CECBusDevice.h
@@ -117,29 +117,21 @@ bool CCECAudioSystem::TransmitSystemAudioModeStatus(cec_logical_address dest, bo

uint8_t CCECAudioSystem::VolumeUp(const cec_logical_address source, bool bSendRelease /* = true */)
{
TransmitKeypress(source, CEC_USER_CONTROL_CODE_VOLUME_UP);
if (bSendRelease)
TransmitKeyRelease(source);

TransmitVolumeUp(source, bSendRelease);
CLockObject lock(m_mutex);
return m_audioStatus;
}

uint8_t CCECAudioSystem::VolumeDown(const cec_logical_address source, bool bSendRelease /* = true */)
{
TransmitKeypress(source, CEC_USER_CONTROL_CODE_VOLUME_DOWN);
if (bSendRelease)
TransmitKeyRelease(source);

TransmitVolumeDown(source, bSendRelease);
CLockObject lock(m_mutex);
return m_audioStatus;
}

uint8_t CCECAudioSystem::MuteAudio(const cec_logical_address source)
{
TransmitKeypress(source, CEC_USER_CONTROL_CODE_MUTE);
TransmitKeyRelease(source);

TransmitMuteAudio(source);
return GetAudioStatus(source, true);
}

@@ -1476,3 +1476,25 @@ bool CCECBusDevice::SystemAudioModeRequest(void)
m_handler->TransmitSystemAudioModeRequest(m_iLogicalAddress, iPhysicalAddress) :
false;
}

bool CCECBusDevice::TransmitVolumeUp(const cec_logical_address source, bool bSendRelease /* = true */)
{
bool retval = TransmitKeypress(source, CEC_USER_CONTROL_CODE_VOLUME_UP);
if (bSendRelease && retval)
retval &= TransmitKeyRelease(source);
return retval;
}

bool CCECBusDevice::TransmitVolumeDown(const cec_logical_address source, bool bSendRelease /* = true */)
{
bool retval = TransmitKeypress(source, CEC_USER_CONTROL_CODE_VOLUME_UP);
if (bSendRelease && retval)
retval &= TransmitKeyRelease(source);
return retval;
}

bool CCECBusDevice::TransmitMuteAudio(const cec_logical_address source)
{
return TransmitKeypress(source, CEC_USER_CONTROL_CODE_MUTE) &&
TransmitKeyRelease(source);
}
@@ -189,6 +189,9 @@ namespace CEC
virtual bool Standby(const cec_logical_address initiator);

virtual bool SystemAudioModeRequest(void);
virtual bool TransmitVolumeUp(const cec_logical_address source, bool bSendRelease = true);
virtual bool TransmitVolumeDown(const cec_logical_address source, bool bSendRelease = true);
virtual bool TransmitMuteAudio(const cec_logical_address source);

virtual bool TryLogicalAddress(cec_version libCECSpecVersion = CEC_VERSION_1_4);

0 comments on commit 59c35e3

Please sign in to comment.
You can’t perform that action at this time.