3 * This file is part of the libCEC(R) library.
5 * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved.
6 * libCEC(R) is an original work, containing original code.
8 * libCEC(R) is a trademark of Pulse-Eight Limited.
10 * This program is dual-licensed; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 * Alternatively, you can license this library under a commercial license,
26 * please contact Pulse-Eight Licensing for more information.
28 * For more information contact:
29 * Pulse-Eight Licensing <license@pulse-eight.com>
30 * http://www.pulse-eight.com/
31 * http://www.pulse-eight.net/
34 #include "../lib/platform/threads/mutex.h"
36 #include <msclr/marshal.h>
37 #include "../../include/cec.h"
43 /// LibCecSharp namespace
45 /// <see cref="LibCecSharp" />
49 /// The device type. For client applications, libCEC only supports RecordingDevice, PlaybackDevice or Tuner.
50 /// libCEC uses RecordingDevice by default.
52 public enum class CecDeviceType
63 /// Reserved / do not use
75 /// Audio system / AVR
81 /// Log level that can be used by the logging callback method to filter messages from libCEC.
83 public enum class CecLogLevel
90 /// libCEC encountered a serious problem, and couldn't complete an action.
94 /// libCEC warns that it encountered a problem, but recovered.
98 /// libCEC informs the client about a CEC state change.
102 /// Raw CEC data traffic
106 /// Debugging messages
110 /// Display all messages
116 /// A logical address on the CEC bus
118 public enum class CecLogicalAddress
121 /// Not a valid logical address
129 /// Recording device 1
131 RecordingDevice1
= 1,
133 /// Recording device 2
135 RecordingDevice2
= 2,
141 /// Playback device 1
145 /// Audio system / AVR
157 /// Playback device 2
161 /// Recording device 3
163 RecordingDevice3
= 9,
169 /// Playback device 3
171 PlaybackDevice3
= 11,
173 /// Reserved address 1
177 /// Reserved address 2
185 /// Unregistered / new device
189 /// Broadcast address
195 /// The type of alert when libCEC calls the CecAlert callback
197 public enum class CecAlert
200 /// The device needs servicing. This is set when the firmware can be upgraded, or when a problem with the firmware is detected.
201 /// The latest firmware flash tool can be downloaded from http://packages.pulse-eight.net/
207 /// The type of parameter that is sent with the CecAlert callback
209 public enum class CecParameterType
212 /// The parameter is a string
214 ParameterTypeString
= 1
218 /// A parameter for the CecAlert callback
220 public ref
class CecParameter
224 /// Create a new parameter
226 /// <param name="type">The type of this parameter.</param>
227 /// <param name="data">The value of this parameter.</param>
228 CecParameter(CecParameterType type
, System::String
^ data
)
235 /// The type of this parameter
237 property CecParameterType Type
;
239 /// The value of this parameter
241 property
System::String
^ Data
;
245 /// The power status of a CEC device
247 public enum class CecPowerStatus
258 /// In transition from standby to on
260 InTransitionStandbyToOn
= 0x02,
262 /// In transition from on to standby
264 InTransitionOnToStandby
= 0x03,
272 /// The CEC version of a CEC device
274 public enum class CecVersion
303 /// Parameter for OSD string display, that controls how to display the string
305 public enum class CecDisplayControl
308 /// Display for the default time
310 DisplayForDefaultTime
= 0x00,
312 /// Display until it is cleared by ClearPreviousMessage
314 DisplayUntilCleared
= 0x40,
316 /// Clear message displayed by DisplayUntilCleared
318 ClearPreviousMessage
= 0x80,
320 /// Reserved / do not use
322 ReservedForFutureUse
= 0xC0
326 /// The menu state of a CEC device
328 public enum class CecMenuState
341 /// Deck control mode for playback and recording devices
343 public enum class CecDeckControlMode
346 /// Skip forward / wind
350 /// Skip reverse / rewind
352 SkipReverseRewind
= 2,
364 /// Deck status for playback and recording devices
366 public enum class CecDeckInfo
381 /// Showing still frame
389 /// Playing slow reverse
401 /// No media detected
405 /// Stop / not playing
409 /// Skip forward / wind
411 SkipForwardWind
= 0x1B,
413 /// Skip reverse / rewind
415 SkipReverseRewind
= 0x1C,
417 /// Index search forward
419 IndexSearchForward
= 0x1D,
421 /// Index search reverse
423 IndexSearchReverse
= 0x1E,
425 /// Other / unknown status
431 /// User control code, the key code when the user presses or releases a button on the remote.
432 /// Used by SendKeypress() and the CecKey callback.
434 public enum class CecUserControlCode
457 /// Direction right + up
461 /// Direction right + down
465 /// Direction left + up
469 /// Direction left + down
559 PreviousChannel
= 0x32,
561 /// Select sound track
569 /// Display information
571 DisplayInformation
= 0x35,
585 /// Toggle powered on / standby
649 /// Toggle sub picture
653 /// Toggle video on demand
655 VideoOnDemand
= 0x52,
657 /// Toggle electronic program guide (EPG)
659 ElectronicProgramGuide
= 0x53,
661 /// Toggle timer programming
663 TimerProgramming
= 0x54,
665 /// Set initial configuration
667 InitialConfiguration
= 0x55,
669 /// Start playback function
673 /// Pause playback function
675 PausePlayFunction
= 0x61,
677 /// Toggle recording function
679 RecordFunction
= 0x62,
681 /// Pause recording function
683 PauseRecordFunction
= 0x63,
685 /// Stop playback function
689 /// Mute audio function
693 /// Restore volume function
695 RestoreVolumeFunction
= 0x66,
701 /// Select media function
703 SelectMediaFunction
= 0x68,
705 /// Select AV input function
707 SelectAVInputFunction
= 0x69,
709 /// Select audio input function
711 SelectAudioInputFunction
= 0x6A,
713 /// Toggle powered on / standby function
715 PowerToggleFunction
= 0x6B,
717 /// Power off function
719 PowerOffFunction
= 0x6C,
721 /// Power on function
723 PowerOnFunction
= 0x6D,
733 /// F3 / green button
737 /// F4 / yellow button
749 /// Max. valid key code for standard buttons
753 /// Extra return button on Samsung remotes
755 SamsungReturn
= 0x91,
757 /// Unknown / invalid key code
763 /// Vendor IDs for CEC devices
765 public enum class CecVendorId
769 Panasonic
= 0x008045,
787 /// Audio status of audio system / AVR devices
789 public enum class CecAudioStatus
794 MuteStatusMask
= 0x80,
796 /// Not muted, volume status mask
798 VolumeStatusMask
= 0x7F,
810 VolumeStatusUnknown
= 0x7F
814 /// CEC opcodes, as described in the HDMI CEC specification
816 public enum class CecOpcode
823 /// Image view on: power on display for image display
827 /// Text view on: power on display for text display
831 /// Device no longer is the active source
833 InactiveSource
= 0x9D,
835 /// Request which device has the active source status
837 RequestActiveSource
= 0x85,
839 /// Routing change for HDMI switches
841 RoutingChange
= 0x80,
843 /// Routing information for HDMI switches
845 RoutingInformation
= 0x81,
847 /// Change the stream path to the given physical address
849 SetStreamPath
= 0x86,
851 /// Inform that a device went into standby mode
863 /// Recording status information
867 /// Record current display
869 RecordTvScreen
= 0x0F,
871 /// Clear analogue timer
873 ClearAnalogueTimer
= 0x33,
875 /// Clear digital timer
877 ClearDigitalTimer
= 0x99,
879 /// Clear external timer
881 ClearExternalTimer
= 0xA1,
883 /// Set analogue timer
885 SetAnalogueTimer
= 0x34,
887 /// Set digital timer
889 SetDigitalTimer
= 0x97,
891 /// Set external timer
893 SetExternalTimer
= 0xA2,
895 /// Set program title of a timer
897 SetTimerProgramTitle
= 0x67,
899 /// Timer status cleared
901 TimerClearedStatus
= 0x43,
903 /// Timer status information
907 /// CEC version used by a device
911 /// Request CEC version of a device
913 GetCecVersion
= 0x9F,
915 /// Request physical address of a device
917 GivePhysicalAddress
= 0x83,
919 /// Request language code of the menu language of a device
921 GetMenuLanguage
= 0x91,
923 /// Report the physical address
925 ReportPhysicalAddress
= 0x84,
927 /// Report the language code of the menu language
929 SetMenuLanguage
= 0x32,
931 /// Deck control for playback and recording devices
935 /// Deck status for playback and recording devices
939 /// Request deck status from playback and recording devices
941 GiveDeckStatus
= 0x1A,
943 /// Start playback on playback and recording devices
947 /// Request tuner status
949 GiveTunerDeviceStatus
= 0x08,
951 /// Select analogue service on a tuner
953 SelectAnalogueService
= 0x92,
955 /// Select digital service on a tuner
957 SelectDigtalService
= 0x93,
959 /// Report tuner device status
961 TunerDeviceStatus
= 0x07,
963 /// Tuner step decrement
965 TunerStepDecrement
= 0x06,
967 /// Tuner step increment
969 TunerStepIncrement
= 0x05,
971 /// Report device vendor ID
973 DeviceVendorId
= 0x87,
975 /// Request device vendor ID
977 GiveDeviceVendorId
= 0x8C,
979 /// Vendor specific command
981 VendorCommand
= 0x89,
983 /// Vendor specific command with vendor ID
985 VendorCommandWithId
= 0xA0,
987 /// Vendor specific remote button pressed
989 VendorRemoteButtonDown
= 0x8A,
991 /// Vendor specific remote button released
993 VendorRemoteButtonUp
= 0x8B,
995 /// Display / clear OSD string
999 /// Request device OSD name
1003 /// Report device OSD name
1007 /// Request device menu status
1011 /// Report device menu status
1015 /// Remote button pressed
1017 UserControlPressed
= 0x44,
1019 /// Remote button released
1021 UserControlRelease
= 0x45,
1023 /// Request device power status
1025 GiveDevicePowerStatus
= 0x8F,
1027 /// Report device power status
1029 ReportPowerStatus
= 0x90,
1031 /// Feature abort / unsupported command
1033 FeatureAbort
= 0x00,
1039 /// Give audio status
1041 GiveAudioStatus
= 0x71,
1043 /// Give audiosystem mode
1045 GiveSystemAudioMode
= 0x7D,
1047 /// Report device audio status
1049 ReportAudioStatus
= 0x7A,
1051 /// Set audiosystem mode
1053 SetSystemAudioMode
= 0x72,
1055 /// Request audiosystem mode
1057 SystemAudioModeRequest
= 0x70,
1059 /// Report audiosystem mode
1061 SystemAudioModeStatus
= 0x7E,
1063 /// Set audio bitrate
1065 SetAudioRate
= 0x9A,
1067 /// When this opcode is set, no opcode will be sent to the device / poll message
1068 /// This is one of the reserved numbers
1074 /// Audiosystem status
1076 public enum class CecSystemAudioStatus
1089 /// libCEC client application version
1091 public enum class CecClientVersion
1100 Version1_5_0
= 0x1500,
1104 Version1_5_1
= 0x1501,
1108 Version1_5_2
= 0x1502,
1112 Version1_5_3
= 0x1503,
1116 Version1_6_0
= 0x1600,
1120 Version1_6_1
= 0x1601,
1124 Version1_6_2
= 0x1602,
1128 Version1_6_3
= 0x1603,
1132 Version1_7_0
= 0x1700,
1136 Version1_7_1
= 0x1701,
1140 Version1_7_2
= 0x1702,
1144 Version1_8_0
= 0x1800,
1148 Version1_8_1
= 0x1801,
1152 Version1_8_2
= 0x1802,
1156 Version1_9_0
= 0x1900
1162 public enum class CecServerVersion
1171 Version1_5_0
= 0x1500,
1175 Version1_5_1
= 0x1501,
1179 Version1_5_2
= 0x1502,
1183 Version1_5_3
= 0x1503,
1187 Version1_6_0
= 0x1600,
1191 Version1_6_1
= 0x1601,
1195 Version1_6_2
= 0x1602,
1199 Version1_6_3
= 0x1603,
1203 Version1_7_0
= 0x1700,
1207 Version1_7_1
= 0x1701,
1211 Version1_7_2
= 0x1702,
1215 Version1_8_0
= 0x1800,
1219 Version1_8_1
= 0x1801,
1223 Version1_8_2
= 0x1802,
1227 Version1_9_0
= 0x1900
1231 /// Type of adapter to which libCEC is connected
1233 public enum class CecAdapterType
1236 /// Unknown adapter type
1240 /// Pulse-Eight USB-CEC adapter
1242 PulseEightExternal
= 0x1,
1244 /// Pulse-Eight CEC daughterboard
1246 PulseEightDaughterboard
= 0x2,
1254 /// Descriptor of a CEC adapter, returned when scanning for adapters that are connected to the system
1256 public ref
class CecAdapter
1260 /// Create a new CEC adapter descriptor
1262 /// <param name="path"> The path descriptor for this CEC adapter</param>
1263 /// <param name="comPort">The COM port of this CEC adapter</param>
1264 CecAdapter(System::String
^ path
, System::String
^ comPort
)
1271 /// The path descriptor for this CEC adapter
1273 property
System::String
^ Path
;
1276 /// The COM port of this CEC adapter
1278 property
System::String
^ ComPort
;
1282 /// A list of CEC device types
1284 public ref
class CecDeviceTypeList
1288 /// Create a new empty list of CEC device types
1290 CecDeviceTypeList(void)
1292 Types
= gcnew array
<CecDeviceType
>(5);
1293 for (unsigned int iPtr
= 0; iPtr
< 5; iPtr
++)
1294 Types
[iPtr
] = CecDeviceType::Reserved
;
1298 /// The array with CecDeviceType instances in this list.
1300 property array
<CecDeviceType
> ^ Types
;
1304 /// A list of logical addresses
1306 public ref
class CecLogicalAddresses
1310 /// Create a new empty list of logical addresses
1312 CecLogicalAddresses(void)
1314 Addresses
= gcnew array
<CecLogicalAddress
>(16);
1319 /// Clears this list
1323 Primary
= CecLogicalAddress::Unknown
;
1324 for (unsigned int iPtr
= 0; iPtr
< 16; iPtr
++)
1325 Addresses
[iPtr
] = CecLogicalAddress::Unknown
;
1329 /// Checks whether a logical address is set in this list.
1331 /// <param name="address">The address to check.</param>
1332 /// <returns>True when set, false otherwise</returns>
1333 bool IsSet(CecLogicalAddress address
)
1335 return Addresses
[(unsigned int)address
] != CecLogicalAddress::Unknown
;
1339 /// Add a logical address to this list (if it's not set already)
1341 /// <param name="address">The address to add.</param>
1342 void Set(CecLogicalAddress address
)
1344 Addresses
[(unsigned int)address
] = address
;
1345 if (Primary
== CecLogicalAddress::Unknown
)
1350 /// The primary (first) address in this list
1352 property CecLogicalAddress Primary
;
1355 /// The list of addresses
1357 property array
<CecLogicalAddress
> ^ Addresses
;
1362 /// Byte array used for CEC command parameters
1364 public ref
class CecDatapacket
1368 /// Create a new byte array with maximum size 100
1372 Data
= gcnew array
<uint8_t>(100);
1377 /// Adds a byte to this byte array
1379 /// <param name="data">The byte to add.</param>
1380 void PushBack(uint8_t data
)
1392 property array
<uint8_t> ^ Data
;
1395 /// Current data size
1397 property
uint8_t Size
;
1401 /// A CEC command that is received or transmitted over the CEC bus
1403 public ref
class CecCommand
1407 /// Create a new CEC command instance
1409 /// <param name="initiator">The initiator of the command</param>
1410 /// <param name="destination">The receiver of the command</param>
1411 /// <param name="ack">True when the ack bit is set, false otherwise</param>
1412 /// <param name="eom">True when the eom bit is set, false otherwise</param>
1413 /// <param name="opcode">The CEC opcode of this command</param>
1414 /// <param name="transmitTimeout">The timeout to use when transmitting a command</param>
1415 CecCommand(CecLogicalAddress initiator
, CecLogicalAddress destination
, bool ack
, bool eom
, CecOpcode opcode
, int32_t transmitTimeout
)
1417 Initiator
= initiator
;
1418 Destination
= destination
;
1423 TransmitTimeout
= transmitTimeout
;
1424 Parameters
= gcnew CecDatapacket
;
1429 /// Create a new empty CEC command instance
1433 Initiator
= CecLogicalAddress::Unknown
;
1434 Destination
= CecLogicalAddress::Unknown
;
1437 Opcode
= CecOpcode::None
;
1439 TransmitTimeout
= 0;
1440 Parameters
= gcnew CecDatapacket
;
1445 /// Pushes a byte of data to this CEC command
1447 /// <param name="data">The byte to add</param>
1448 void PushBack(uint8_t data
)
1450 if (Initiator
== CecLogicalAddress::Unknown
&& Destination
== CecLogicalAddress::Unknown
)
1452 Initiator
= (CecLogicalAddress
) (data
>> 4);
1453 Destination
= (CecLogicalAddress
) (data
& 0xF);
1455 else if (!OpcodeSet
)
1458 Opcode
= (CecOpcode
)data
;
1462 Parameters
->PushBack(data
);
1467 /// True when this command is empty, false otherwise.
1469 property
bool Empty
;
1471 /// The initiator of the command
1473 property CecLogicalAddress Initiator
;
1475 /// The destination of the command
1477 property CecLogicalAddress Destination
;
1479 /// True when the ack bit is set, false otherwise
1483 /// True when the eom bit is set, false otherwise
1487 /// The CEC opcode of the command
1489 property CecOpcode Opcode
;
1491 /// The parameters of this command
1493 property CecDatapacket
^ Parameters
;
1495 /// True when an opcode is set, false otherwise (poll message)
1497 property
bool OpcodeSet
;
1499 /// The timeout to use when transmitting a command
1501 property
int32_t TransmitTimeout
;
1505 /// A key press that was received
1507 public ref
class CecKeypress
1511 /// Create a new key press instance
1513 /// <param name="keycode">The key code of this key press</param>
1514 /// <param name="duration">The duration of this key press in milliseconds</param>
1515 CecKeypress(CecUserControlCode keycode
, unsigned int duration
)
1518 Duration
= duration
;
1523 /// Create a new empty key press instance
1527 Keycode
= CecUserControlCode::Unknown
;
1533 /// True when empty, false otherwise
1535 property
bool Empty
;
1537 /// The key code of this key press
1539 property CecUserControlCode Keycode
;
1541 /// The duration of this key press in milliseconds
1543 property
unsigned int Duration
;
1547 /// A log message that libCEC generated
1549 public ref
class CecLogMessage
1553 /// Create a new log message
1555 /// <param name="message">The actual message</param>
1556 /// <param name="level">The log level, so the application can choose what type information to display</param>
1557 /// <param name="time">The timestamp of this message, in milliseconds after connecting</param>
1558 CecLogMessage(System::String
^ message
, CecLogLevel level
, int64_t time
)
1567 /// Create a new empty log message
1572 Level
= CecLogLevel::None
;
1578 /// True when empty, false otherwise.
1580 property
bool Empty
;
1582 /// The actual message
1584 property
System::String
^Message
;
1586 /// The log level, so the application can choose what type information to display
1588 property CecLogLevel Level
;
1590 /// The timestamp of this message, in milliseconds after connecting
1592 property
int64_t Time
;
1595 ref
class CecCallbackMethods
; //forward declaration
1598 /// The configuration that libCEC uses.
1600 public ref
class LibCECConfiguration
1604 /// Create a new configuration instance with default settings.
1606 LibCECConfiguration(void)
1609 DeviceTypes
= gcnew
CecDeviceTypeList();
1610 AutodetectAddress
= true;
1611 PhysicalAddress
= CEC_DEFAULT_PHYSICAL_ADDRESS
;
1612 BaseDevice
= (CecLogicalAddress
)CEC_DEFAULT_BASE_DEVICE
;
1613 HDMIPort
= CEC_DEFAULT_HDMI_PORT
;
1614 ClientVersion
= CecClientVersion::VersionPre1_5
;
1615 ServerVersion
= CecServerVersion::VersionPre1_5
;
1616 TvVendor
= CecVendorId::Unknown
;
1618 GetSettingsFromROM
= false;
1619 UseTVMenuLanguage
= CEC_DEFAULT_SETTING_USE_TV_MENU_LANGUAGE
== 1;
1620 ActivateSource
= CEC_DEFAULT_SETTING_ACTIVATE_SOURCE
== 1;
1622 WakeDevices
= gcnew
CecLogicalAddresses();
1623 if (CEC_DEFAULT_SETTING_ACTIVATE_SOURCE
== 1)
1624 WakeDevices
->Set(CecLogicalAddress::Tv
);
1626 PowerOffDevices
= gcnew
CecLogicalAddresses();
1627 if (CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN
== 1)
1628 PowerOffDevices
->Set(CecLogicalAddress::Broadcast
);
1630 PowerOffScreensaver
= CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER
== 1;
1631 PowerOffOnStandby
= CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY
== 1;
1633 SendInactiveSource
= CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE
== 1;
1634 LogicalAddresses
= gcnew
CecLogicalAddresses();
1635 FirmwareVersion
= 1;
1636 PowerOffDevicesOnStandby
= CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY
== 1;
1637 ShutdownOnStandby
= CEC_DEFAULT_SETTING_SHUTDOWN_ON_STANDBY
== 1;
1638 DeviceLanguage
= "";
1639 FirmwareBuildDate
= gcnew
System::DateTime(1970,1,1,0,0,0,0);
1640 CECVersion
= (CecVersion
)CEC_DEFAULT_SETTING_CEC_VERSION
;
1641 AdapterType
= CecAdapterType::Unknown
;
1645 /// Change the callback method pointers in this configuration instance.
1647 /// <param name="callbacks">The new callbacks</param>
1648 void SetCallbacks(CecCallbackMethods
^callbacks
)
1650 Callbacks
= callbacks
;
1654 /// Update this configuration with data received from libCEC
1656 /// <param name="config">The configuration that was received from libCEC</param>
1657 void Update(const CEC::libcec_configuration
&config
)
1659 DeviceName
= gcnew
System::String(config
.strDeviceName
);
1661 for (unsigned int iPtr
= 0; iPtr
< 5; iPtr
++)
1662 DeviceTypes
->Types
[iPtr
] = (CecDeviceType
)config
.deviceTypes
.types
[iPtr
];
1664 AutodetectAddress
= config
.bAutodetectAddress
== 1;
1665 PhysicalAddress
= config
.iPhysicalAddress
;
1666 BaseDevice
= (CecLogicalAddress
)config
.baseDevice
;
1667 HDMIPort
= config
.iHDMIPort
;
1668 ClientVersion
= (CecClientVersion
)config
.clientVersion
;
1669 ServerVersion
= (CecServerVersion
)config
.serverVersion
;
1670 TvVendor
= (CecVendorId
)config
.tvVendor
;
1672 // player specific settings
1673 GetSettingsFromROM
= config
.bGetSettingsFromROM
== 1;
1674 UseTVMenuLanguage
= config
.bUseTVMenuLanguage
== 1;
1675 ActivateSource
= config
.bActivateSource
== 1;
1677 WakeDevices
->Clear();
1678 for (uint8_t iPtr
= 0; iPtr
<= 16; iPtr
++)
1679 if (config
.wakeDevices
[iPtr
])
1680 WakeDevices
->Set((CecLogicalAddress
)iPtr
);
1682 PowerOffDevices
->Clear();
1683 for (uint8_t iPtr
= 0; iPtr
<= 16; iPtr
++)
1684 if (config
.powerOffDevices
[iPtr
])
1685 PowerOffDevices
->Set((CecLogicalAddress
)iPtr
);
1687 PowerOffScreensaver
= config
.bPowerOffScreensaver
== 1;
1688 PowerOffOnStandby
= config
.bPowerOffOnStandby
== 1;
1690 if (ServerVersion
>= CecServerVersion::Version1_5_1
)
1691 SendInactiveSource
= config
.bSendInactiveSource
== 1;
1693 if (ServerVersion
>= CecServerVersion::Version1_5_3
)
1695 LogicalAddresses
->Clear();
1696 for (uint8_t iPtr
= 0; iPtr
<= 16; iPtr
++)
1697 if (config
.logicalAddresses
[iPtr
])
1698 LogicalAddresses
->Set((CecLogicalAddress
)iPtr
);
1701 if (ServerVersion
>= CecServerVersion::Version1_6_0
)
1703 FirmwareVersion
= config
.iFirmwareVersion
;
1704 PowerOffDevicesOnStandby
= config
.bPowerOffDevicesOnStandby
== 1;
1705 ShutdownOnStandby
= config
.bShutdownOnStandby
== 1;
1708 if (ServerVersion
>= CecServerVersion::Version1_6_2
)
1710 DeviceLanguage
= gcnew
System::String(config
.strDeviceLanguage
);
1711 FirmwareBuildDate
= gcnew
System::DateTime(1970,1,1,0,0,0,0);
1712 FirmwareBuildDate
= FirmwareBuildDate
->AddSeconds(config
.iFirmwareBuildDate
);
1715 if (ServerVersion
>= CecServerVersion::Version1_6_3
)
1716 MonitorOnlyClient
= config
.bMonitorOnly
== 1;
1718 if (ServerVersion
>= CecServerVersion::Version1_8_0
)
1719 CECVersion
= (CecVersion
)config
.cecVersion
;
1721 if (ServerVersion
>= CecServerVersion::Version1_8_2
)
1722 AdapterType
= (CecAdapterType
)config
.adapterType
;
1726 /// The device name to use on the CEC bus
1728 property
System::String
^ DeviceName
;
1731 /// The device type(s) to use on the CEC bus for libCEC
1733 property CecDeviceTypeList
^ DeviceTypes
;
1736 /// True to try to autodetect the physical address, false otherwise
1738 property
bool AutodetectAddress
;
1741 /// The physical address that libCEC uses on the CEC bus
1743 property
uint16_t PhysicalAddress
;
1746 /// The logical address of the device to which the CEC adapter is connected, only used when PhysicalAddress isn't set
1748 property CecLogicalAddress BaseDevice
;
1751 /// The hdmi port number on the device to which the CEC adapter is connected, only used when PhysicalAddress isn't set
1753 property
uint8_t HDMIPort
;
1756 /// The client API version to use
1758 property CecClientVersion ClientVersion
;
1761 /// The version of libCEC
1763 property CecServerVersion ServerVersion
;
1766 /// Override the vendor ID of the TV when set (for quirks mode)
1768 property CecVendorId TvVendor
;
1771 /// True to read the settings from the EEPROM, which possibly override the settings passed here
1773 property
bool GetSettingsFromROM
;
1776 /// Use the language setting of the TV in the client application. Must be implemented by the client application.
1778 property
bool UseTVMenuLanguage
;
1781 /// Make libCEC the active source when starting the client application
1783 property
bool ActivateSource
;
1786 /// List of devices to send a power on command to when starting the client application
1788 property CecLogicalAddresses
^WakeDevices
;
1791 /// List of devices to send a standby command to when exiting the client application
1793 property CecLogicalAddresses
^PowerOffDevices
;
1796 /// Send standby commands when the client application activates the screensaver. Must be implemented by the client application.
1798 property
bool PowerOffScreensaver
;
1801 /// Power off the PC when the TV powers off. Must be implemented by the client application.
1803 property
bool PowerOffOnStandby
;
1806 /// Send an inactive source message when exiting the client application.
1808 property
bool SendInactiveSource
;
1811 /// The list of logical addresses that libCEC is using
1813 property CecLogicalAddresses
^LogicalAddresses
;
1816 /// The firmware version of the adapter to which libCEC is connected
1818 property
uint16_t FirmwareVersion
;
1821 /// Send standby commands when the client application activates standby mode (S3). Must be implemented by the client application.
1823 property
bool PowerOffDevicesOnStandby
;
1824 property
bool ShutdownOnStandby
;
1827 /// True to start a monitor-only client, false to start a standard client.
1829 property
bool MonitorOnlyClient
;
1832 /// The language code of the menu language that libCEC reports to other devices.
1834 property
System::String
^ DeviceLanguage
;
1837 /// The callback methods to use.
1839 property CecCallbackMethods
^ Callbacks
;
1842 /// The build date of the firmware.
1844 property
System::DateTime
^ FirmwareBuildDate
;
1847 /// The CEC version that libCEC uses.
1849 property CecVersion CECVersion
;
1852 /// The type of adapter that libCEC is connected to.
1854 property CecAdapterType AdapterType
;
1857 // the callback methods are called by unmanaged code, so we need some delegates for this
1859 // unmanaged callback methods
1860 typedef int (__stdcall
*LOGCB
) (const CEC::cec_log_message
&message
);
1861 typedef int (__stdcall
*KEYCB
) (const CEC::cec_keypress
&key
);
1862 typedef int (__stdcall
*COMMANDCB
)(const CEC::cec_command
&command
);
1863 typedef int (__stdcall
*CONFIGCB
) (const CEC::libcec_configuration
&config
);
1864 typedef int (__stdcall
*ALERTCB
) (const CEC::libcec_alert
, const CEC::libcec_parameter
&data
);
1865 typedef int (__stdcall
*MENUCB
) (const CEC::cec_menu_state newVal
);
1866 typedef void (__stdcall
*ACTICB
) (const CEC::cec_logical_address logicalAddress
, const uint8_t bActivated
);
1869 /// libCEC callback methods. Unmanaged code.
1874 /// Log message callback
1878 /// Key press/release callback
1882 /// Raw CEC data callback
1884 COMMANDCB commandCB
;
1886 /// Updated configuration callback
1890 /// Alert message callback
1894 /// Menu status change callback
1898 /// Source (de)activated callback
1900 ACTICB sourceActivatedCB
;
1901 } UnmanagedCecCallbacks
;
1903 static PLATFORM::CMutex g_callbackMutex
;
1904 static std::vector
<UnmanagedCecCallbacks
> g_unmanagedCallbacks
;
1905 static CEC::ICECCallbacks g_cecCallbacks
;
1908 /// Called by libCEC to send back a log message to the application
1910 /// <param name="cbParam">Pointer to the callback struct</param>
1911 /// <param name="message">The log message</param>
1912 /// <return>1 when handled, 0 otherwise</return>
1913 int CecLogMessageCB(void *cbParam
, const CEC::cec_log_message
&message
)
1917 size_t iPtr
= (size_t)cbParam
;
1918 PLATFORM::CLockObject
lock(g_callbackMutex
);
1919 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
1920 return g_unmanagedCallbacks
[iPtr
].logCB(message
);
1926 /// Called by libCEC to send back a key press or release to the application
1928 /// <param name="cbParam">Pointer to the callback struct</param>
1929 /// <param name="key">The key press command that libCEC received</param>
1930 /// <return>1 when handled, 0 otherwise</return>
1931 int CecKeyPressCB(void *cbParam
, const CEC::cec_keypress
&key
)
1935 size_t iPtr
= (size_t)cbParam
;
1936 PLATFORM::CLockObject
lock(g_callbackMutex
);
1937 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
1938 return g_unmanagedCallbacks
[iPtr
].keyCB(key
);
1944 /// Called by libCEC to send back raw CEC data to the application
1946 /// <param name="cbParam">Pointer to the callback struct</param>
1947 /// <param name="command">The raw CEC data</param>
1948 /// <return>1 when handled, 0 otherwise</return>
1949 int CecCommandCB(void *cbParam
, const CEC::cec_command
&command
)
1953 size_t iPtr
= (size_t)cbParam
;
1954 PLATFORM::CLockObject
lock(g_callbackMutex
);
1955 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
1956 return g_unmanagedCallbacks
[iPtr
].commandCB(command
);
1962 /// Called by libCEC to send back an updated configuration to the application
1964 /// <param name="cbParam">Pointer to the callback struct</param>
1965 /// <param name="config">The new configuration</param>
1966 /// <return>1 when handled, 0 otherwise</return>
1967 int CecConfigCB(void *cbParam
, const CEC::libcec_configuration
&config
)
1971 size_t iPtr
= (size_t)cbParam
;
1972 PLATFORM::CLockObject
lock(g_callbackMutex
);
1973 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
1974 return g_unmanagedCallbacks
[iPtr
].configCB(config
);
1980 /// Called by libCEC to send back an alert message to the application
1982 /// <param name="cbParam">Pointer to the callback struct</param>
1983 /// <param name="data">The alert message</param>
1984 /// <return>1 when handled, 0 otherwise</return>
1985 int CecAlertCB(void *cbParam
, const CEC::libcec_alert alert
, const CEC::libcec_parameter
&data
)
1989 size_t iPtr
= (size_t)cbParam
;
1990 PLATFORM::CLockObject
lock(g_callbackMutex
);
1991 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
1992 return g_unmanagedCallbacks
[iPtr
].alertCB(alert
, data
);
1998 /// Called by libCEC to send back a menu state change to the application
2000 /// <param name="cbParam">Pointer to the callback struct</param>
2001 /// <param name="newVal">The new menu state</param>
2002 /// <return>1 when handled, 0 otherwise</return>
2003 int CecMenuCB(void *cbParam
, const CEC::cec_menu_state newVal
)
2007 size_t iPtr
= (size_t)cbParam
;
2008 PLATFORM::CLockObject
lock(g_callbackMutex
);
2009 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
2010 return g_unmanagedCallbacks
[iPtr
].menuCB(newVal
);
2016 /// Called by libCEC to notify the application that the source that is handled by libCEC was (de)activated
2018 /// <param name="cbParam">Pointer to the callback struct</param>
2019 /// <param name="logicalAddress">The logical address that was (de)activated</param>
2020 /// <param name="activated">True when activated, false when deactivated</param>
2021 void CecSourceActivatedCB(void *cbParam
, const CEC::cec_logical_address logicalAddress
, const uint8_t activated
)
2025 size_t iPtr
= (size_t)cbParam
;
2026 PLATFORM::CLockObject
lock(g_callbackMutex
);
2027 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
2028 g_unmanagedCallbacks
[iPtr
].sourceActivatedCB(logicalAddress
, activated
);
2034 /// Delegate method for the CecLogMessageCB callback in CecCallbackMethods
2036 public delegate
int CecLogMessageManagedDelegate(const CEC::cec_log_message
&);
2038 /// Delegate method for the CecKeyPressCB callback in CecCallbackMethods
2040 public delegate
int CecKeyPressManagedDelegate(const CEC::cec_keypress
&);
2042 /// Delegate method for the CecCommandCB callback in CecCallbackMethods
2044 public delegate
int CecCommandManagedDelegate(const CEC::cec_command
&);
2046 /// Delegate method for the CecConfigCB callback in CecCallbackMethods
2048 public delegate
int CecConfigManagedDelegate(const CEC::libcec_configuration
&);
2050 /// Delegate method for the CecAlertCB callback in CecCallbackMethods
2052 public delegate
int CecAlertManagedDelegate(const CEC::libcec_alert
, const CEC::libcec_parameter
&);
2054 /// Delegate method for the CecMenuCB callback in CecCallbackMethods
2056 public delegate
int CecMenuManagedDelegate(const CEC::cec_menu_state
);
2058 /// Delegate method for the CecSourceActivatedCB callback in CecCallbackMethods
2060 public delegate
void CecSourceActivatedManagedDelegate(const CEC::cec_logical_address
, const uint8_t);
2063 /// Assign the callback methods in the g_cecCallbacks struct
2065 void AssignCallbacks()
2067 g_cecCallbacks
.CBCecLogMessage
= CecLogMessageCB
;
2068 g_cecCallbacks
.CBCecKeyPress
= CecKeyPressCB
;
2069 g_cecCallbacks
.CBCecCommand
= CecCommandCB
;
2070 g_cecCallbacks
.CBCecConfigurationChanged
= CecConfigCB
;
2071 g_cecCallbacks
.CBCecAlert
= CecAlertCB
;
2072 g_cecCallbacks
.CBCecMenuStateChanged
= CecMenuCB
;
2073 g_cecCallbacks
.CBCecSourceActivated
= CecSourceActivatedCB
;
2077 /// The callback methods that libCEC uses
2079 public ref
class CecCallbackMethods
2082 CecCallbackMethods(void)
2084 m_iCallbackPtr
= -1;
2086 m_bHasCallbacks
= false;
2087 m_bDelegatesCreated
= false;
2090 ~CecCallbackMethods(void)
2096 /// Pointer to the callbacks struct entry
2098 size_t GetCallbackPtr(void)
2100 PLATFORM::CLockObject
lock(g_callbackMutex
);
2101 return m_iCallbackPtr
;
2105 !CecCallbackMethods(void)
2112 /// Disable callback methods
2114 virtual void DisableCallbacks(void)
2120 /// Enable callback methods
2122 /// <param name="callbacks">Callback methods to activate</param>
2123 /// <return>true when handled, false otherwise</return>
2124 virtual bool EnableCallbacks(CecCallbackMethods
^ callbacks
)
2127 if (!m_bHasCallbacks
)
2129 m_bHasCallbacks
= true;
2130 m_callbacks
= callbacks
;
2138 /// Called by libCEC to send back a log message to the application.
2139 /// Override in the application to handle this callback.
2141 /// <param name="message">The log message</param>
2142 /// <return>1 when handled, 0 otherwise</return>
2143 virtual int ReceiveLogMessage(CecLogMessage
^ message
)
2149 /// Called by libCEC to send back a key press or release to the application.
2150 /// Override in the application to handle this callback.
2152 /// <param name="key">The key press command that libCEC received</param>
2153 /// <return>1 when handled, 0 otherwise</return>
2154 virtual int ReceiveKeypress(CecKeypress
^ key
)
2160 /// Called by libCEC to send back raw CEC data to the application.
2161 /// Override in the application to handle this callback.
2163 /// <param name="command">The raw CEC data</param>
2164 /// <return>1 when handled, 0 otherwise</return>
2165 virtual int ReceiveCommand(CecCommand
^ command
)
2171 /// Called by libCEC to send back an updated configuration to the application.
2172 /// Override in the application to handle this callback.
2174 /// <param name="config">The new configuration</param>
2175 /// <return>1 when handled, 0 otherwise</return>
2176 virtual int ConfigurationChanged(LibCECConfiguration
^ config
)
2182 /// Called by libCEC to send back an alert message to the application.
2183 /// Override in the application to handle this callback.
2185 /// <param name="data">The alert message</param>
2186 /// <return>1 when handled, 0 otherwise</return>
2187 virtual int ReceiveAlert(CecAlert alert
, CecParameter
^ data
)
2193 /// Called by libCEC to send back a menu state change to the application.
2194 /// Override in the application to handle this callback.
2196 /// <param name="newVal">The new menu state</param>
2197 /// <return>1 when handled, 0 otherwise</return>
2198 virtual int ReceiveMenuStateChange(CecMenuState newVal
)
2204 /// Called by libCEC to notify the application that the source that is handled by libCEC was (de)activated.
2205 /// Override in the application to handle this callback.
2207 /// <param name="logicalAddress">The logical address that was (de)activated</param>
2208 /// <param name="activated">True when activated, false when deactivated</param>
2209 virtual void SourceActivated(CecLogicalAddress logicalAddress
, bool activated
)
2214 // managed callback methods
2215 int CecLogMessageManaged(const CEC::cec_log_message
&message
)
2218 if (m_bHasCallbacks
)
2219 iReturn
= m_callbacks
->ReceiveLogMessage(gcnew
CecLogMessage(gcnew
System::String(message
.message
), (CecLogLevel
)message
.level
, message
.time
));
2223 int CecKeyPressManaged(const CEC::cec_keypress
&key
)
2226 if (m_bHasCallbacks
)
2227 iReturn
= m_callbacks
->ReceiveKeypress(gcnew
CecKeypress((CecUserControlCode
)key
.keycode
, key
.duration
));
2231 int CecCommandManaged(const CEC::cec_command
&command
)
2234 if (m_bHasCallbacks
)
2236 CecCommand
^ newCommand
= gcnew
CecCommand((CecLogicalAddress
)command
.initiator
, (CecLogicalAddress
)command
.destination
, command
.ack
== 1 ? true : false, command
.eom
== 1 ? true : false, (CecOpcode
)command
.opcode
, command
.transmit_timeout
);
2237 for (uint8_t iPtr
= 0; iPtr
< command
.parameters
.size
; iPtr
++)
2238 newCommand
->Parameters
->PushBack(command
.parameters
[iPtr
]);
2239 iReturn
= m_callbacks
->ReceiveCommand(newCommand
);
2244 int CecConfigManaged(const CEC::libcec_configuration
&config
)
2247 if (m_bHasCallbacks
)
2249 LibCECConfiguration
^netConfig
= gcnew
LibCECConfiguration();
2250 netConfig
->Update(config
);
2251 iReturn
= m_callbacks
->ConfigurationChanged(netConfig
);
2256 int CecAlertManaged(const CEC::libcec_alert alert
, const CEC::libcec_parameter
&data
)
2259 if (m_bHasCallbacks
)
2261 CecParameterType newType
= (CecParameterType
)data
.paramType
;
2262 if (newType
== CecParameterType::ParameterTypeString
)
2264 System::String
^ newData
= gcnew
System::String((const char *)data
.paramData
, 0, 128);
2265 CecParameter
^ newParam
= gcnew
CecParameter(newType
, newData
);
2266 iReturn
= m_callbacks
->ReceiveAlert((CecAlert
)alert
, newParam
);
2272 int CecMenuManaged(const CEC::cec_menu_state newVal
)
2275 if (m_bHasCallbacks
)
2277 iReturn
= m_callbacks
->ReceiveMenuStateChange((CecMenuState
)newVal
);
2282 void CecSourceActivatedManaged(const CEC::cec_logical_address logicalAddress
, const uint8_t bActivated
)
2284 if (m_bHasCallbacks
)
2285 m_callbacks
->SourceActivated((CecLogicalAddress
)logicalAddress
, bActivated
== 1);
2288 void DestroyDelegates()
2290 m_bHasCallbacks
= false;
2291 if (m_bDelegatesCreated
)
2293 m_bDelegatesCreated
= false;
2294 m_logMessageGCHandle
.Free();
2295 m_keypressGCHandle
.Free();
2296 m_commandGCHandle
.Free();
2297 m_alertGCHandle
.Free();
2298 m_menuGCHandle
.Free();
2299 m_sourceActivatedGCHandle
.Free();
2303 void CreateDelegates()
2307 if (!m_bDelegatesCreated
)
2309 msclr::interop::marshal_context
^ context
= gcnew
msclr::interop::marshal_context();
2311 // create the delegate method for the log message callback
2312 m_logMessageDelegate
= gcnew
CecLogMessageManagedDelegate(this, &CecCallbackMethods::CecLogMessageManaged
);
2313 m_logMessageGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_logMessageDelegate
);
2314 m_logMessageCallback
= static_cast<LOGCB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_logMessageDelegate
).ToPointer());
2316 // create the delegate method for the keypress callback
2317 m_keypressDelegate
= gcnew
CecKeyPressManagedDelegate(this, &CecCallbackMethods::CecKeyPressManaged
);
2318 m_keypressGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_keypressDelegate
);
2319 m_keypressCallback
= static_cast<KEYCB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_keypressDelegate
).ToPointer());
2321 // create the delegate method for the command callback
2322 m_commandDelegate
= gcnew
CecCommandManagedDelegate(this, &CecCallbackMethods::CecCommandManaged
);
2323 m_commandGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_commandDelegate
);
2324 m_commandCallback
= static_cast<COMMANDCB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_commandDelegate
).ToPointer());
2326 // create the delegate method for the configuration change callback
2327 m_configDelegate
= gcnew
CecConfigManagedDelegate(this, &CecCallbackMethods::CecConfigManaged
);
2328 m_configGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_configDelegate
);
2329 m_configCallback
= static_cast<CONFIGCB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_configDelegate
).ToPointer());
2331 // create the delegate method for the alert callback
2332 m_alertDelegate
= gcnew
CecAlertManagedDelegate(this, &CecCallbackMethods::CecAlertManaged
);
2333 m_alertGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_alertDelegate
);
2334 m_alertCallback
= static_cast<ALERTCB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_alertDelegate
).ToPointer());
2336 // create the delegate method for the menu callback
2337 m_menuDelegate
= gcnew
CecMenuManagedDelegate(this, &CecCallbackMethods::CecMenuManaged
);
2338 m_menuGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_menuDelegate
);
2339 m_menuCallback
= static_cast<MENUCB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_menuDelegate
).ToPointer());
2341 // create the delegate method for the source activated callback
2342 m_sourceActivatedDelegate
= gcnew
CecSourceActivatedManagedDelegate(this, &CecCallbackMethods::CecSourceActivatedManaged
);
2343 m_sourceActivatedGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_sourceActivatedDelegate
);
2344 m_sourceActivatedCallback
= static_cast<ACTICB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_sourceActivatedDelegate
).ToPointer());
2348 UnmanagedCecCallbacks unmanagedCallbacks
;
2349 unmanagedCallbacks
.logCB
= m_logMessageCallback
;
2350 unmanagedCallbacks
.keyCB
= m_keypressCallback
;
2351 unmanagedCallbacks
.commandCB
= m_commandCallback
;
2352 unmanagedCallbacks
.configCB
= m_configCallback
;
2353 unmanagedCallbacks
.alertCB
= m_alertCallback
;
2354 unmanagedCallbacks
.menuCB
= m_menuCallback
;
2355 unmanagedCallbacks
.sourceActivatedCB
= m_sourceActivatedCallback
;
2357 PLATFORM::CLockObject
lock(g_callbackMutex
);
2358 g_unmanagedCallbacks
.push_back(unmanagedCallbacks
);
2359 m_iCallbackPtr
= g_unmanagedCallbacks
.size() - 1;
2360 m_bDelegatesCreated
= true;
2364 CecLogMessageManagedDelegate
^ m_logMessageDelegate
;
2365 static System::Runtime::InteropServices::GCHandle m_logMessageGCHandle
;
2366 LOGCB m_logMessageCallback
;
2368 CecKeyPressManagedDelegate
^ m_keypressDelegate
;
2369 static System::Runtime::InteropServices::GCHandle m_keypressGCHandle
;
2370 KEYCB m_keypressCallback
;
2372 CecCommandManagedDelegate
^ m_commandDelegate
;
2373 static System::Runtime::InteropServices::GCHandle m_commandGCHandle
;
2374 COMMANDCB m_commandCallback
;
2376 CecConfigManagedDelegate
^ m_configDelegate
;
2377 static System::Runtime::InteropServices::GCHandle m_configGCHandle
;
2378 CONFIGCB m_configCallback
;
2380 CecAlertManagedDelegate
^ m_alertDelegate
;
2381 static System::Runtime::InteropServices::GCHandle m_alertGCHandle
;
2382 ALERTCB m_alertCallback
;
2384 CecMenuManagedDelegate
^ m_menuDelegate
;
2385 static System::Runtime::InteropServices::GCHandle m_menuGCHandle
;
2386 MENUCB m_menuCallback
;
2388 CecSourceActivatedManagedDelegate
^ m_sourceActivatedDelegate
;
2389 static System::Runtime::InteropServices::GCHandle m_sourceActivatedGCHandle
;
2390 ACTICB m_sourceActivatedCallback
;
2392 CecCallbackMethods
^ m_callbacks
;
2393 bool m_bHasCallbacks
;
2394 bool m_bDelegatesCreated
;
2395 size_t m_iCallbackPtr
;