X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FLibCecSharp%2FLibCecSharp.cpp;h=81c857fb2fed67c2475365eab980289d32aaf21b;hb=1664420dd2cd46c9daafeb541c45d055d176bcdc;hp=97329b3e9cd773e8dd531528c3c815dc24588261;hpb=d3b96c620e8bf4235d0ccee29d5b8e76dcdd86b6;p=deb_libcec.git diff --git a/src/LibCecSharp/LibCecSharp.cpp b/src/LibCecSharp/LibCecSharp.cpp index 97329b3..81c857f 100644 --- a/src/LibCecSharp/LibCecSharp.cpp +++ b/src/LibCecSharp/LibCecSharp.cpp @@ -82,6 +82,7 @@ namespace CecSharp ConvertConfiguration(context, config, libCecConfig); m_libCec = (ICECAdapter *) CECInitialise(&libCecConfig); + config->Update(libCecConfig); delete context; return m_libCec != NULL; @@ -135,11 +136,9 @@ namespace CecSharp } if (netConfig->ServerVersion >= CecServerVersion::Version1_6_3) - { - config.bMonitorOnly = netConfig->MonitorOnlyClient ? 1 : 0; - } + config.bMonitorOnly = netConfig->MonitorOnlyClient ? 1 : 0; - config.callbacks = &g_cecCallbacks; + config.callbacks = &g_cecCallbacks; } public: @@ -189,7 +188,7 @@ namespace CecSharp virtual bool EnableCallbacks(CecCallbackMethods ^ callbacks) override { if (m_libCec && CecCallbackMethods::EnableCallbacks(callbacks)) - return m_libCec->EnableCallbacks(NULL, &g_cecCallbacks); + return m_libCec->EnableCallbacks((void*)GetCallbackPtr(), &g_cecCallbacks); return false; } @@ -235,7 +234,7 @@ namespace CecSharp cec_keypress key; if (m_libCec->GetNextKeypress(&key)) { - return gcnew CecKeypress(key.keycode, key.duration); + return gcnew CecKeypress((CecUserControlCode)key.keycode, key.duration); } return gcnew CecKeypress(); @@ -599,6 +598,17 @@ namespace CecSharp return gcnew String(retVal); } + String ^ GetLibInfo() + { + const char *retVal = m_libCec->GetLibInfo(); + return gcnew String(retVal); + } + + void InitVideoStandalone() + { + m_libCec->InitVideoStandalone(); + } + private: ICECAdapter * m_libCec; CecCallbackMethods ^ m_callbacks;