#endif
} cec_logical_addresses;
-struct ICECCallbacks
+typedef int (__cdecl *CBCecLogMessageType)(const CEC::cec_log_message &);
+typedef int (__cdecl* CBCecKeyPressType)(const cec_keypress &key);
+typedef int (__cdecl* CBCecCommandType)(const cec_command &command);
+
+typedef struct ICECCallbacks
{
/*!
* @brief Transfer a log message from libCEC to the client.
* @param message The message to transfer.
* @return 1 when ok, 0 otherwise.
*/
- int (*CecLogMessage)(const cec_log_message &message);
+ CBCecLogMessageType CBCecLogMessage;
/*!
* @brief Transfer a keypress from libCEC to the client.
* @param key The keypress to transfer.
* @return 1 when ok, 0 otherwise.
*/
- int (*CecKeyPress)(const cec_keypress &key);
+ CBCecKeyPressType CBCecKeyPress;
/*!
* @brief Transfer a CEC command from libCEC to the client.
* @param command The command to transfer.
* @return 1 when ok, 0 otherwise.
*/
- int (*CecCommand)(const cec_command &command);
-};
+ CBCecCommandType CBCecCommand;
+} ICECCallbacks;
#ifdef UNUSED
#elif defined(__GNUC__)
snprintf(message.message, sizeof(message.message), "%s", strMessage.c_str());
if (m_callbacks)
- m_callbacks->CecLogMessage(message);
+ m_callbacks->CBCecLogMessage(message);
else
m_logBuffer.Push(message);
}
{
CLockObject lock(&m_mutex);
if (m_callbacks)
- m_callbacks->CecKeyPress(key);
+ m_callbacks->CBCecKeyPress(key);
else
m_keyBuffer.Push(key);
m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN;
key.keycode = m_iCurrentButton;
if (m_callbacks)
- m_callbacks->CecKeyPress(key);
+ m_callbacks->CBCecKeyPress(key);
else
m_keyBuffer.Push(key);
m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN;
CLockObject lock(&m_mutex);
if (m_callbacks)
{
- m_callbacks->CecCommand(command);
+ m_callbacks->CBCecCommand(command);
}
else if (m_commandBuffer.Push(command))
{
void EnableCallbacks(ICECAdapter *adapter)
{
- g_callbacks.CecLogMessage = &CecLogMessage;
- g_callbacks.CecKeyPress = &CecKeyPress;
- g_callbacks.CecCommand = &CecCommand;
+ g_callbacks.CBCecLogMessage = &CecLogMessage;
+ g_callbacks.CBCecKeyPress = &CecKeyPress;
+ g_callbacks.CBCecCommand = &CecCommand;
adapter->EnableCallbacks(&g_callbacks);
}