repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix OS-X build
[deb_libcec.git]
/
src
/
lib
/
devices
/
CECPlaybackDevice.cpp
diff --git
a/src/lib/devices/CECPlaybackDevice.cpp
b/src/lib/devices/CECPlaybackDevice.cpp
index 86c1679cabe9e5bbb26b725ade214047c3224122..1beed4f37221cdfdce1e74127b07c377afcf7198 100644
(file)
--- a/
src/lib/devices/CECPlaybackDevice.cpp
+++ b/
src/lib/devices/CECPlaybackDevice.cpp
@@
-1,7
+1,7
@@
/*
* This file is part of the libCEC(R) library.
*
/*
* This file is part of the libCEC(R) library.
*
- * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited. All rights reserved.
+ * libCEC(R) is Copyright (C) 2011
-2012
Pulse-Eight Limited. All rights reserved.
* libCEC(R) is an original work, containing original code.
*
* libCEC(R) is a trademark of Pulse-Eight Limited.
* libCEC(R) is an original work, containing original code.
*
* libCEC(R) is a trademark of Pulse-Eight Limited.
@@
-34,13
+34,14
@@
#include "../implementations/CECCommandHandler.h"
#include "../CECProcessor.h"
#include "../LibCEC.h"
#include "../implementations/CECCommandHandler.h"
#include "../CECProcessor.h"
#include "../LibCEC.h"
+#include "../CECTypeUtils.h"
using namespace CEC;
using namespace PLATFORM;
using namespace CEC;
using namespace PLATFORM;
-#define ToString(p)
m_processor->
ToString(p)
+#define ToString(p)
CCECTypeUtils::
ToString(p)
-CCECPlaybackDevice::CCECPlaybackDevice(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress /* =
0
*/) :
+CCECPlaybackDevice::CCECPlaybackDevice(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress /* =
CEC_INVALID_PHYSICAL_ADDRESS
*/) :
CCECBusDevice(processor, address, iPhysicalAddress),
m_deckStatus(CEC_DECK_INFO_STOP),
m_deckControlMode(CEC_DECK_CONTROL_MODE_STOP)
CCECBusDevice(processor, address, iPhysicalAddress),
m_deckStatus(CEC_DECK_INFO_STOP),
m_deckControlMode(CEC_DECK_CONTROL_MODE_STOP)
@@
-48,7
+49,7
@@
CCECPlaybackDevice::CCECPlaybackDevice(CCECProcessor *processor, cec_logical_add
m_type = CEC_DEVICE_TYPE_PLAYBACK_DEVICE;
}
m_type = CEC_DEVICE_TYPE_PLAYBACK_DEVICE;
}
-cec_deck_info CCECPlaybackDevice::GetDeckStatus(
void
)
+cec_deck_info CCECPlaybackDevice::GetDeckStatus(
const cec_logical_address UNUSED(initiator)
)
{
CLockObject lock(m_mutex);
return m_deckStatus;
{
CLockObject lock(m_mutex);
return m_deckStatus;
@@
-57,14
+58,14
@@
cec_deck_info CCECPlaybackDevice::GetDeckStatus(void)
void CCECPlaybackDevice::SetDeckStatus(cec_deck_info deckStatus)
{
CLockObject lock(m_mutex);
void CCECPlaybackDevice::SetDeckStatus(cec_deck_info deckStatus)
{
CLockObject lock(m_mutex);
- if (m_deckStatus != deckStatus
&& m_deckStatus != CEC_DECK_INFO_OTHER_STATUS_LG
)
+ if (m_deckStatus != deckStatus)
{
{
-
CLibCEC::
AddLog(CEC_LOG_DEBUG, ">> %s (%X): deck status changed from '%s' to '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(m_deckStatus), ToString(deckStatus));
+
m_processor->GetLib()->
AddLog(CEC_LOG_DEBUG, ">> %s (%X): deck status changed from '%s' to '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(m_deckStatus), ToString(deckStatus));
m_deckStatus = deckStatus;
}
}
m_deckStatus = deckStatus;
}
}
-cec_deck_control_mode CCECPlaybackDevice::GetDeckControlMode(
void
)
+cec_deck_control_mode CCECPlaybackDevice::GetDeckControlMode(
const cec_logical_address UNUSED(initiator)
)
{
CLockObject lock(m_mutex);
return m_deckControlMode;
{
CLockObject lock(m_mutex);
return m_deckControlMode;
@@
-75,7
+76,7
@@
void CCECPlaybackDevice::SetDeckControlMode(cec_deck_control_mode mode)
CLockObject lock(m_mutex);
if (m_deckControlMode != mode)
{
CLockObject lock(m_mutex);
if (m_deckControlMode != mode)
{
-
CLibCEC::
AddLog(CEC_LOG_DEBUG, ">> %s (%X): deck control mode changed from '%s' to '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(m_deckControlMode), ToString(mode));
+
m_processor->GetLib()->
AddLog(CEC_LOG_DEBUG, ">> %s (%X): deck control mode changed from '%s' to '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(m_deckControlMode), ToString(mode));
m_deckControlMode = mode;
}
}
m_deckControlMode = mode;
}
}
@@
-85,9
+86,17
@@
bool CCECPlaybackDevice::TransmitDeckStatus(cec_logical_address dest)
cec_deck_info state;
{
CLockObject lock(m_mutex);
cec_deck_info state;
{
CLockObject lock(m_mutex);
-
CLibCEC::
AddLog(CEC_LOG_NOTICE, "<< %s (%X) -> %s (%X): deck status '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(dest), dest, ToString(m_deckStatus));
+
m_processor->GetLib()->
AddLog(CEC_LOG_NOTICE, "<< %s (%X) -> %s (%X): deck status '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(dest), dest, ToString(m_deckStatus));
state = m_deckStatus;
}
return m_handler->TransmitDeckStatus(m_iLogicalAddress, dest, state);
}
state = m_deckStatus;
}
return m_handler->TransmitDeckStatus(m_iLogicalAddress, dest, state);
}
+
+void CCECPlaybackDevice::ResetDeviceStatus(void)
+{
+ CLockObject lock(m_mutex);
+ m_deckStatus = CEC_DECK_INFO_STOP;
+ m_deckControlMode = CEC_DECK_CONTROL_MODE_STOP;
+ CCECBusDevice::ResetDeviceStatus();
+}