MCPcopy Create free account
hub / github.com/Pulse-Eight/libcec / CCecPythonCallbacks

Method CCecPythonCallbacks

src/libcec/SwigHelper.h:72–93  ·  view source on GitHub ↗

* Create a new python callbacks instance, and set callbacks in the configuration * @param config the configuration to set the callbacks in */

Source from the content-addressed store, hash-verified

70 * @param config the configuration to set the callbacks in
71 */
72 CCecPythonCallbacks(libcec_configuration* config) :
73 m_configuration(config)
74 {
75 assert(!!config);
76 assert(!!m_configuration);
77
78 config->callbacks = new ICECCallbacks;
79 if (!config->callbacks)
80 throw std::bad_alloc();
81
82 for (size_t ptr = 0; ptr < NB_PYTHON_CB; ++ptr)
83 m_callbacks[ptr] = NULL;
84
85 m_configuration->callbacks->logMessage = CBCecLogMessage;
86 m_configuration->callbacks->keyPress = CBCecKeyPress;
87 m_configuration->callbacks->commandReceived = CBCecCommand;
88 m_configuration->callbacks->configurationChanged = CBCecConfigurationChanged;
89 m_configuration->callbacks->alert = CBCecAlert;
90 m_configuration->callbacks->menuStateChanged = CBCecMenuStateChanged;
91 m_configuration->callbacks->sourceActivated = CBCecSourceActivated;
92 m_configuration->callbacks->commandHandler = CBCecCommandHandler;
93 }
94
95 /**
96 * Unreferences all python callbacks, and deletes the callbacks

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected