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
920 /// 3 character ISO 639-2 country code. see http://http://www.loc.gov/standards/iso639-2/
922 GetMenuLanguage
= 0x91,
924 /// Report the physical address
926 ReportPhysicalAddress
= 0x84,
928 /// Report the language code of the menu language
929 /// 3 character ISO 639-2 country code. see http://http://www.loc.gov/standards/iso639-2/
931 SetMenuLanguage
= 0x32,
933 /// Deck control for playback and recording devices
937 /// Deck status for playback and recording devices
941 /// Request deck status from playback and recording devices
943 GiveDeckStatus
= 0x1A,
945 /// Start playback on playback and recording devices
949 /// Request tuner status
951 GiveTunerDeviceStatus
= 0x08,
953 /// Select analogue service on a tuner
955 SelectAnalogueService
= 0x92,
957 /// Select digital service on a tuner
959 SelectDigtalService
= 0x93,
961 /// Report tuner device status
963 TunerDeviceStatus
= 0x07,
965 /// Tuner step decrement
967 TunerStepDecrement
= 0x06,
969 /// Tuner step increment
971 TunerStepIncrement
= 0x05,
973 /// Report device vendor ID
975 DeviceVendorId
= 0x87,
977 /// Request device vendor ID
979 GiveDeviceVendorId
= 0x8C,
981 /// Vendor specific command
983 VendorCommand
= 0x89,
985 /// Vendor specific command with vendor ID
987 VendorCommandWithId
= 0xA0,
989 /// Vendor specific remote button pressed
991 VendorRemoteButtonDown
= 0x8A,
993 /// Vendor specific remote button released
995 VendorRemoteButtonUp
= 0x8B,
997 /// Display / clear OSD string
1001 /// Request device OSD name
1005 /// Report device OSD name
1009 /// Request device menu status
1013 /// Report device menu status
1017 /// Remote button pressed
1019 UserControlPressed
= 0x44,
1021 /// Remote button released
1023 UserControlRelease
= 0x45,
1025 /// Request device power status
1027 GiveDevicePowerStatus
= 0x8F,
1029 /// Report device power status
1031 ReportPowerStatus
= 0x90,
1033 /// Feature abort / unsupported command
1035 FeatureAbort
= 0x00,
1041 /// Give audio status
1043 GiveAudioStatus
= 0x71,
1045 /// Give audiosystem mode
1047 GiveSystemAudioMode
= 0x7D,
1049 /// Report device audio status
1051 ReportAudioStatus
= 0x7A,
1053 /// Set audiosystem mode
1055 SetSystemAudioMode
= 0x72,
1057 /// Request audiosystem mode
1059 SystemAudioModeRequest
= 0x70,
1061 /// Report audiosystem mode
1063 SystemAudioModeStatus
= 0x7E,
1065 /// Set audio bitrate
1067 SetAudioRate
= 0x9A,
1069 /// When this opcode is set, no opcode will be sent to the device / poll message
1070 /// This is one of the reserved numbers
1076 /// Audiosystem status
1078 public enum class CecSystemAudioStatus
1091 /// libCEC client application version
1093 public enum class CecClientVersion
1102 Version1_5_0
= 0x1500,
1106 Version1_5_1
= 0x1501,
1110 Version1_5_2
= 0x1502,
1114 Version1_5_3
= 0x1503,
1118 Version1_6_0
= 0x1600,
1122 Version1_6_1
= 0x1601,
1126 Version1_6_2
= 0x1602,
1130 Version1_6_3
= 0x1603,
1134 Version1_7_0
= 0x1700,
1138 Version1_7_1
= 0x1701,
1142 Version1_7_2
= 0x1702,
1146 Version1_8_0
= 0x1800,
1150 Version1_8_1
= 0x1801,
1154 Version1_8_2
= 0x1802,
1158 Version1_9_0
= 0x1900,
1162 Version1_99_0
= 0x1990,
1166 Version2_0_0
= 0x2000,
1170 Version2_0_1
= 0x2001,
1174 Version2_0_2
= 0x2002
1180 public enum class CecServerVersion
1189 Version1_5_0
= 0x1500,
1193 Version1_5_1
= 0x1501,
1197 Version1_5_2
= 0x1502,
1201 Version1_5_3
= 0x1503,
1205 Version1_6_0
= 0x1600,
1209 Version1_6_1
= 0x1601,
1213 Version1_6_2
= 0x1602,
1217 Version1_6_3
= 0x1603,
1221 Version1_7_0
= 0x1700,
1225 Version1_7_1
= 0x1701,
1229 Version1_7_2
= 0x1702,
1233 Version1_8_0
= 0x1800,
1237 Version1_8_1
= 0x1801,
1241 Version1_8_2
= 0x1802,
1245 Version1_9_0
= 0x1900,
1249 Version1_99_0
= 0x1990,
1253 Version2_0_0
= 0x2000,
1257 Version2_0_1
= 0x2001,
1261 Version2_0_2
= 0x2002
1265 /// Type of adapter to which libCEC is connected
1267 public enum class CecAdapterType
1270 /// Unknown adapter type
1274 /// Pulse-Eight USB-CEC adapter
1276 PulseEightExternal
= 0x1,
1278 /// Pulse-Eight CEC daughterboard
1280 PulseEightDaughterboard
= 0x2,
1288 /// Descriptor of a CEC adapter, returned when scanning for adapters that are connected to the system
1290 public ref
class CecAdapter
1294 /// Create a new CEC adapter descriptor
1296 /// <param name="path"> The path descriptor for this CEC adapter</param>
1297 /// <param name="comPort">The COM port of this CEC adapter</param>
1298 CecAdapter(System::String
^ path
, System::String
^ comPort
)
1305 /// The path descriptor for this CEC adapter
1307 property
System::String
^ Path
;
1310 /// The COM port of this CEC adapter
1312 property
System::String
^ ComPort
;
1316 /// A list of CEC device types
1318 public ref
class CecDeviceTypeList
1322 /// Create a new empty list of CEC device types
1324 CecDeviceTypeList(void)
1326 Types
= gcnew array
<CecDeviceType
>(5);
1327 for (unsigned int iPtr
= 0; iPtr
< 5; iPtr
++)
1328 Types
[iPtr
] = CecDeviceType::Reserved
;
1332 /// The array with CecDeviceType instances in this list.
1334 property array
<CecDeviceType
> ^ Types
;
1338 /// A list of logical addresses
1340 public ref
class CecLogicalAddresses
1344 /// Create a new empty list of logical addresses
1346 CecLogicalAddresses(void)
1348 Addresses
= gcnew array
<CecLogicalAddress
>(16);
1353 /// Clears this list
1357 Primary
= CecLogicalAddress::Unknown
;
1358 for (unsigned int iPtr
= 0; iPtr
< 16; iPtr
++)
1359 Addresses
[iPtr
] = CecLogicalAddress::Unknown
;
1363 /// Checks whether a logical address is set in this list.
1365 /// <param name="address">The address to check.</param>
1366 /// <returns>True when set, false otherwise</returns>
1367 bool IsSet(CecLogicalAddress address
)
1369 return Addresses
[(unsigned int)address
] != CecLogicalAddress::Unknown
;
1373 /// Add a logical address to this list (if it's not set already)
1375 /// <param name="address">The address to add.</param>
1376 void Set(CecLogicalAddress address
)
1378 Addresses
[(unsigned int)address
] = address
;
1379 if (Primary
== CecLogicalAddress::Unknown
)
1384 /// The primary (first) address in this list
1386 property CecLogicalAddress Primary
;
1389 /// The list of addresses
1391 property array
<CecLogicalAddress
> ^ Addresses
;
1396 /// Byte array used for CEC command parameters
1398 public ref
class CecDatapacket
1402 /// Create a new byte array with maximum size 100
1406 Data
= gcnew array
<uint8_t>(100);
1411 /// Adds a byte to this byte array
1413 /// <param name="data">The byte to add.</param>
1414 void PushBack(uint8_t data
)
1426 property array
<uint8_t> ^ Data
;
1429 /// Current data size
1431 property
uint8_t Size
;
1435 /// A CEC command that is received or transmitted over the CEC bus
1437 public ref
class CecCommand
1441 /// Create a new CEC command instance
1443 /// <param name="initiator">The initiator of the command</param>
1444 /// <param name="destination">The receiver of the command</param>
1445 /// <param name="ack">True when the ack bit is set, false otherwise</param>
1446 /// <param name="eom">True when the eom bit is set, false otherwise</param>
1447 /// <param name="opcode">The CEC opcode of this command</param>
1448 /// <param name="transmitTimeout">The timeout to use when transmitting a command</param>
1449 CecCommand(CecLogicalAddress initiator
, CecLogicalAddress destination
, bool ack
, bool eom
, CecOpcode opcode
, int32_t transmitTimeout
)
1451 Initiator
= initiator
;
1452 Destination
= destination
;
1457 TransmitTimeout
= transmitTimeout
;
1458 Parameters
= gcnew CecDatapacket
;
1463 /// Create a new empty CEC command instance
1467 Initiator
= CecLogicalAddress::Unknown
;
1468 Destination
= CecLogicalAddress::Unknown
;
1471 Opcode
= CecOpcode::None
;
1473 TransmitTimeout
= 0;
1474 Parameters
= gcnew CecDatapacket
;
1479 /// Pushes a byte of data to this CEC command
1481 /// <param name="data">The byte to add</param>
1482 void PushBack(uint8_t data
)
1484 if (Initiator
== CecLogicalAddress::Unknown
&& Destination
== CecLogicalAddress::Unknown
)
1486 Initiator
= (CecLogicalAddress
) (data
>> 4);
1487 Destination
= (CecLogicalAddress
) (data
& 0xF);
1489 else if (!OpcodeSet
)
1492 Opcode
= (CecOpcode
)data
;
1496 Parameters
->PushBack(data
);
1501 /// True when this command is empty, false otherwise.
1503 property
bool Empty
;
1505 /// The initiator of the command
1507 property CecLogicalAddress Initiator
;
1509 /// The destination of the command
1511 property CecLogicalAddress Destination
;
1513 /// True when the ack bit is set, false otherwise
1517 /// True when the eom bit is set, false otherwise
1521 /// The CEC opcode of the command
1523 property CecOpcode Opcode
;
1525 /// The parameters of this command
1527 property CecDatapacket
^ Parameters
;
1529 /// True when an opcode is set, false otherwise (poll message)
1531 property
bool OpcodeSet
;
1533 /// The timeout to use when transmitting a command
1535 property
int32_t TransmitTimeout
;
1539 /// A key press that was received
1541 public ref
class CecKeypress
1545 /// Create a new key press instance
1547 /// <param name="keycode">The key code of this key press</param>
1548 /// <param name="duration">The duration of this key press in milliseconds</param>
1549 CecKeypress(CecUserControlCode keycode
, unsigned int duration
)
1552 Duration
= duration
;
1557 /// Create a new empty key press instance
1561 Keycode
= CecUserControlCode::Unknown
;
1567 /// True when empty, false otherwise
1569 property
bool Empty
;
1571 /// The key code of this key press
1573 property CecUserControlCode Keycode
;
1575 /// The duration of this key press in milliseconds
1577 property
unsigned int Duration
;
1581 /// A log message that libCEC generated
1583 public ref
class CecLogMessage
1587 /// Create a new log message
1589 /// <param name="message">The actual message</param>
1590 /// <param name="level">The log level, so the application can choose what type information to display</param>
1591 /// <param name="time">The timestamp of this message, in milliseconds after connecting</param>
1592 CecLogMessage(System::String
^ message
, CecLogLevel level
, int64_t time
)
1601 /// Create a new empty log message
1606 Level
= CecLogLevel::None
;
1612 /// True when empty, false otherwise.
1614 property
bool Empty
;
1616 /// The actual message
1618 property
System::String
^Message
;
1620 /// The log level, so the application can choose what type information to display
1622 property CecLogLevel Level
;
1624 /// The timestamp of this message, in milliseconds after connecting
1626 property
int64_t Time
;
1629 ref
class CecCallbackMethods
; //forward declaration
1632 /// The configuration that libCEC uses.
1634 public ref
class LibCECConfiguration
1638 /// Create a new configuration instance with default settings.
1640 LibCECConfiguration(void)
1643 DeviceTypes
= gcnew
CecDeviceTypeList();
1644 AutodetectAddress
= true;
1645 PhysicalAddress
= CEC_DEFAULT_PHYSICAL_ADDRESS
;
1646 BaseDevice
= (CecLogicalAddress
)CEC_DEFAULT_BASE_DEVICE
;
1647 HDMIPort
= CEC_DEFAULT_HDMI_PORT
;
1648 ClientVersion
= CecClientVersion::VersionPre1_5
;
1649 ServerVersion
= CecServerVersion::VersionPre1_5
;
1650 TvVendor
= CecVendorId::Unknown
;
1652 GetSettingsFromROM
= false;
1653 UseTVMenuLanguage
= CEC_DEFAULT_SETTING_USE_TV_MENU_LANGUAGE
== 1;
1654 ActivateSource
= CEC_DEFAULT_SETTING_ACTIVATE_SOURCE
== 1;
1656 WakeDevices
= gcnew
CecLogicalAddresses();
1657 if (CEC_DEFAULT_SETTING_ACTIVATE_SOURCE
== 1)
1658 WakeDevices
->Set(CecLogicalAddress::Tv
);
1660 PowerOffDevices
= gcnew
CecLogicalAddresses();
1661 if (CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN
== 1)
1662 PowerOffDevices
->Set(CecLogicalAddress::Broadcast
);
1664 PowerOffScreensaver
= CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER
== 1;
1665 PowerOffOnStandby
= CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY
== 1;
1667 SendInactiveSource
= CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE
== 1;
1668 LogicalAddresses
= gcnew
CecLogicalAddresses();
1669 FirmwareVersion
= 1;
1670 PowerOffDevicesOnStandby
= CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY
== 1;
1671 ShutdownOnStandby
= CEC_DEFAULT_SETTING_SHUTDOWN_ON_STANDBY
== 1;
1672 DeviceLanguage
= "";
1673 FirmwareBuildDate
= gcnew
System::DateTime(1970,1,1,0,0,0,0);
1674 CECVersion
= (CecVersion
)CEC_DEFAULT_SETTING_CEC_VERSION
;
1675 AdapterType
= CecAdapterType::Unknown
;
1679 /// Change the callback method pointers in this configuration instance.
1681 /// <param name="callbacks">The new callbacks</param>
1682 void SetCallbacks(CecCallbackMethods
^callbacks
)
1684 Callbacks
= callbacks
;
1688 /// Update this configuration with data received from libCEC
1690 /// <param name="config">The configuration that was received from libCEC</param>
1691 void Update(const CEC::libcec_configuration
&config
)
1693 DeviceName
= gcnew
System::String(config
.strDeviceName
);
1695 for (unsigned int iPtr
= 0; iPtr
< 5; iPtr
++)
1696 DeviceTypes
->Types
[iPtr
] = (CecDeviceType
)config
.deviceTypes
.types
[iPtr
];
1698 AutodetectAddress
= config
.bAutodetectAddress
== 1;
1699 PhysicalAddress
= config
.iPhysicalAddress
;
1700 BaseDevice
= (CecLogicalAddress
)config
.baseDevice
;
1701 HDMIPort
= config
.iHDMIPort
;
1702 ClientVersion
= (CecClientVersion
)config
.clientVersion
;
1703 ServerVersion
= (CecServerVersion
)config
.serverVersion
;
1704 TvVendor
= (CecVendorId
)config
.tvVendor
;
1706 // player specific settings
1707 GetSettingsFromROM
= config
.bGetSettingsFromROM
== 1;
1708 UseTVMenuLanguage
= config
.bUseTVMenuLanguage
== 1;
1709 ActivateSource
= config
.bActivateSource
== 1;
1711 WakeDevices
->Clear();
1712 for (uint8_t iPtr
= 0; iPtr
<= 16; iPtr
++)
1713 if (config
.wakeDevices
[iPtr
])
1714 WakeDevices
->Set((CecLogicalAddress
)iPtr
);
1716 PowerOffDevices
->Clear();
1717 for (uint8_t iPtr
= 0; iPtr
<= 16; iPtr
++)
1718 if (config
.powerOffDevices
[iPtr
])
1719 PowerOffDevices
->Set((CecLogicalAddress
)iPtr
);
1721 PowerOffScreensaver
= config
.bPowerOffScreensaver
== 1;
1722 PowerOffOnStandby
= config
.bPowerOffOnStandby
== 1;
1724 if (ServerVersion
>= CecServerVersion::Version1_5_1
)
1725 SendInactiveSource
= config
.bSendInactiveSource
== 1;
1727 if (ServerVersion
>= CecServerVersion::Version1_5_3
)
1729 LogicalAddresses
->Clear();
1730 for (uint8_t iPtr
= 0; iPtr
<= 16; iPtr
++)
1731 if (config
.logicalAddresses
[iPtr
])
1732 LogicalAddresses
->Set((CecLogicalAddress
)iPtr
);
1735 if (ServerVersion
>= CecServerVersion::Version1_6_0
)
1737 FirmwareVersion
= config
.iFirmwareVersion
;
1738 PowerOffDevicesOnStandby
= config
.bPowerOffDevicesOnStandby
== 1;
1739 ShutdownOnStandby
= config
.bShutdownOnStandby
== 1;
1742 if (ServerVersion
>= CecServerVersion::Version1_6_2
)
1744 DeviceLanguage
= gcnew
System::String(config
.strDeviceLanguage
);
1745 FirmwareBuildDate
= gcnew
System::DateTime(1970,1,1,0,0,0,0);
1746 FirmwareBuildDate
= FirmwareBuildDate
->AddSeconds(config
.iFirmwareBuildDate
);
1749 if (ServerVersion
>= CecServerVersion::Version1_6_3
)
1750 MonitorOnlyClient
= config
.bMonitorOnly
== 1;
1752 if (ServerVersion
>= CecServerVersion::Version1_8_0
)
1753 CECVersion
= (CecVersion
)config
.cecVersion
;
1755 if (ServerVersion
>= CecServerVersion::Version1_8_2
)
1756 AdapterType
= (CecAdapterType
)config
.adapterType
;
1760 /// The device name to use on the CEC bus
1762 property
System::String
^ DeviceName
;
1765 /// The device type(s) to use on the CEC bus for libCEC
1767 property CecDeviceTypeList
^ DeviceTypes
;
1770 /// (read only) set to true by libCEC when the physical address was autodetected
1772 property
bool AutodetectAddress
;
1775 /// The physical address of the CEC adapter
1777 property
uint16_t PhysicalAddress
;
1780 /// The logical address of the device to which the adapter is connected. Only used when PhysicalAddress = 0 or when the adapter doesn't support autodetection
1782 property CecLogicalAddress BaseDevice
;
1785 /// The HDMI port to which the adapter is connected. Only used when iPhysicalAddress = 0 or when the adapter doesn't support autodetection
1787 property
uint8_t HDMIPort
;
1790 /// The client API version to use
1792 property CecClientVersion ClientVersion
;
1795 /// The version of libCEC
1797 property CecServerVersion ServerVersion
;
1800 /// Override the vendor ID of the TV. Leave this untouched to autodetect
1802 property CecVendorId TvVendor
;
1805 /// True to read the settings from the EEPROM, which possibly override the settings passed here
1807 property
bool GetSettingsFromROM
;
1810 /// Use the language setting of the TV in the client application. Must be implemented by the client application.
1811 /// 3 character ISO 639-2 country code. see http://http://www.loc.gov/standards/iso639-2/
1813 property
bool UseTVMenuLanguage
;
1816 /// Make libCEC the active source when starting the client application
1818 property
bool ActivateSource
;
1821 /// List of devices to wake when initialising libCEC or when calling PowerOnDevices() without any parameter.
1823 property CecLogicalAddresses
^WakeDevices
;
1826 /// List of devices to power off when calling StandbyDevices() without any parameter.
1828 property CecLogicalAddresses
^PowerOffDevices
;
1831 /// Send standby commands when the client application activates the screensaver. Must be implemented by the client application.
1833 property
bool PowerOffScreensaver
;
1836 /// Power off the PC when the TV powers off. Must be implemented by the client application.
1838 property
bool PowerOffOnStandby
;
1841 /// Send an inactive source message when exiting the client application.
1843 property
bool SendInactiveSource
;
1846 /// The list of logical addresses that libCEC is using
1848 property CecLogicalAddresses
^LogicalAddresses
;
1851 /// The firmware version of the adapter to which libCEC is connected
1853 property
uint16_t FirmwareVersion
;
1856 /// Send standby commands when the client application activates standby mode (S3). Must be implemented by the client application.
1858 property
bool PowerOffDevicesOnStandby
;
1861 /// Shutdown this PC when the TV is switched off. only used when PowerOffOnStandby = false
1863 property
bool ShutdownOnStandby
;
1866 /// True to start a monitor-only client, false to start a standard client.
1868 property
bool MonitorOnlyClient
;
1871 /// The language code of the menu language that libCEC reports to other devices.
1872 /// 3 character ISO 639-2 country code. see http://http://www.loc.gov/standards/iso639-2/
1874 property
System::String
^ DeviceLanguage
;
1877 /// The callback methods to use.
1879 property CecCallbackMethods
^ Callbacks
;
1882 /// The build date of the firmware.
1884 property
System::DateTime
^ FirmwareBuildDate
;
1887 /// The CEC version that libCEC uses.
1889 property CecVersion CECVersion
;
1892 /// The type of adapter that libCEC is connected to.
1894 property CecAdapterType AdapterType
;
1897 // the callback methods are called by unmanaged code, so we need some delegates for this
1899 // unmanaged callback methods
1900 typedef int (__stdcall
*LOGCB
) (const CEC::cec_log_message
&message
);
1901 typedef int (__stdcall
*KEYCB
) (const CEC::cec_keypress
&key
);
1902 typedef int (__stdcall
*COMMANDCB
)(const CEC::cec_command
&command
);
1903 typedef int (__stdcall
*CONFIGCB
) (const CEC::libcec_configuration
&config
);
1904 typedef int (__stdcall
*ALERTCB
) (const CEC::libcec_alert
, const CEC::libcec_parameter
&data
);
1905 typedef int (__stdcall
*MENUCB
) (const CEC::cec_menu_state newVal
);
1906 typedef void (__stdcall
*ACTICB
) (const CEC::cec_logical_address logicalAddress
, const uint8_t bActivated
);
1909 /// libCEC callback methods. Unmanaged code.
1914 /// Log message callback
1918 /// Key press/release callback
1922 /// Raw CEC data callback
1924 COMMANDCB commandCB
;
1926 /// Updated configuration callback
1930 /// Alert message callback
1934 /// Menu status change callback
1938 /// Source (de)activated callback
1940 ACTICB sourceActivatedCB
;
1941 } UnmanagedCecCallbacks
;
1943 static PLATFORM::CMutex g_callbackMutex
;
1944 static std::vector
<UnmanagedCecCallbacks
> g_unmanagedCallbacks
;
1945 static CEC::ICECCallbacks g_cecCallbacks
;
1948 /// Called by libCEC to send back a log message to the application
1950 /// <param name="cbParam">Pointer to the callback struct</param>
1951 /// <param name="message">The log message</param>
1952 /// <return>1 when handled, 0 otherwise</return>
1953 int CecLogMessageCB(void *cbParam
, const CEC::cec_log_message message
)
1957 size_t iPtr
= (size_t)cbParam
;
1958 PLATFORM::CLockObject
lock(g_callbackMutex
);
1959 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
1960 return g_unmanagedCallbacks
[iPtr
].logCB(message
);
1966 /// Called by libCEC to send back a key press or release to the application
1968 /// <param name="cbParam">Pointer to the callback struct</param>
1969 /// <param name="key">The key press command that libCEC received</param>
1970 /// <return>1 when handled, 0 otherwise</return>
1971 int CecKeyPressCB(void *cbParam
, const CEC::cec_keypress key
)
1975 size_t iPtr
= (size_t)cbParam
;
1976 PLATFORM::CLockObject
lock(g_callbackMutex
);
1977 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
1978 return g_unmanagedCallbacks
[iPtr
].keyCB(key
);
1984 /// Called by libCEC to send back raw CEC data to the application
1986 /// <param name="cbParam">Pointer to the callback struct</param>
1987 /// <param name="command">The raw CEC data</param>
1988 /// <return>1 when handled, 0 otherwise</return>
1989 int CecCommandCB(void *cbParam
, const CEC::cec_command command
)
1993 size_t iPtr
= (size_t)cbParam
;
1994 PLATFORM::CLockObject
lock(g_callbackMutex
);
1995 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
1996 return g_unmanagedCallbacks
[iPtr
].commandCB(command
);
2002 /// Called by libCEC to send back an updated configuration to the application
2004 /// <param name="cbParam">Pointer to the callback struct</param>
2005 /// <param name="config">The new configuration</param>
2006 /// <return>1 when handled, 0 otherwise</return>
2007 int CecConfigCB(void *cbParam
, const CEC::libcec_configuration config
)
2011 size_t iPtr
= (size_t)cbParam
;
2012 PLATFORM::CLockObject
lock(g_callbackMutex
);
2013 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
2014 return g_unmanagedCallbacks
[iPtr
].configCB(config
);
2020 /// Called by libCEC to send back an alert message to the application
2022 /// <param name="cbParam">Pointer to the callback struct</param>
2023 /// <param name="data">The alert message</param>
2024 /// <return>1 when handled, 0 otherwise</return>
2025 int CecAlertCB(void *cbParam
, const CEC::libcec_alert alert
, const CEC::libcec_parameter data
)
2029 size_t iPtr
= (size_t)cbParam
;
2030 PLATFORM::CLockObject
lock(g_callbackMutex
);
2031 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
2032 return g_unmanagedCallbacks
[iPtr
].alertCB(alert
, data
);
2038 /// Called by libCEC to send back a menu state change to the application
2040 /// <param name="cbParam">Pointer to the callback struct</param>
2041 /// <param name="newVal">The new menu state</param>
2042 /// <return>1 when handled, 0 otherwise</return>
2043 int CecMenuCB(void *cbParam
, const CEC::cec_menu_state newVal
)
2047 size_t iPtr
= (size_t)cbParam
;
2048 PLATFORM::CLockObject
lock(g_callbackMutex
);
2049 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
2050 return g_unmanagedCallbacks
[iPtr
].menuCB(newVal
);
2056 /// Called by libCEC to notify the application that the source that is handled by libCEC was (de)activated
2058 /// <param name="cbParam">Pointer to the callback struct</param>
2059 /// <param name="logicalAddress">The logical address that was (de)activated</param>
2060 /// <param name="activated">True when activated, false when deactivated</param>
2061 void CecSourceActivatedCB(void *cbParam
, const CEC::cec_logical_address logicalAddress
, const uint8_t activated
)
2065 size_t iPtr
= (size_t)cbParam
;
2066 PLATFORM::CLockObject
lock(g_callbackMutex
);
2067 if (iPtr
>= 0 && iPtr
< g_unmanagedCallbacks
.size())
2068 g_unmanagedCallbacks
[iPtr
].sourceActivatedCB(logicalAddress
, activated
);
2074 /// Delegate method for the CecLogMessageCB callback in CecCallbackMethods
2076 public delegate
int CecLogMessageManagedDelegate(const CEC::cec_log_message
&);
2078 /// Delegate method for the CecKeyPressCB callback in CecCallbackMethods
2080 public delegate
int CecKeyPressManagedDelegate(const CEC::cec_keypress
&);
2082 /// Delegate method for the CecCommandCB callback in CecCallbackMethods
2084 public delegate
int CecCommandManagedDelegate(const CEC::cec_command
&);
2086 /// Delegate method for the CecConfigCB callback in CecCallbackMethods
2088 public delegate
int CecConfigManagedDelegate(const CEC::libcec_configuration
&);
2090 /// Delegate method for the CecAlertCB callback in CecCallbackMethods
2092 public delegate
int CecAlertManagedDelegate(const CEC::libcec_alert
, const CEC::libcec_parameter
&);
2094 /// Delegate method for the CecMenuCB callback in CecCallbackMethods
2096 public delegate
int CecMenuManagedDelegate(const CEC::cec_menu_state
);
2098 /// Delegate method for the CecSourceActivatedCB callback in CecCallbackMethods
2100 public delegate
void CecSourceActivatedManagedDelegate(const CEC::cec_logical_address
, const uint8_t);
2103 /// Assign the callback methods in the g_cecCallbacks struct
2105 void AssignCallbacks()
2107 g_cecCallbacks
.CBCecLogMessage
= CecLogMessageCB
;
2108 g_cecCallbacks
.CBCecKeyPress
= CecKeyPressCB
;
2109 g_cecCallbacks
.CBCecCommand
= CecCommandCB
;
2110 g_cecCallbacks
.CBCecConfigurationChanged
= CecConfigCB
;
2111 g_cecCallbacks
.CBCecAlert
= CecAlertCB
;
2112 g_cecCallbacks
.CBCecMenuStateChanged
= CecMenuCB
;
2113 g_cecCallbacks
.CBCecSourceActivated
= CecSourceActivatedCB
;
2117 /// The callback methods that libCEC uses
2119 public ref
class CecCallbackMethods
2122 CecCallbackMethods(void)
2124 m_iCallbackPtr
= -1;
2126 m_bHasCallbacks
= false;
2127 m_bDelegatesCreated
= false;
2130 ~CecCallbackMethods(void)
2136 /// Pointer to the callbacks struct entry
2138 size_t GetCallbackPtr(void)
2140 PLATFORM::CLockObject
lock(g_callbackMutex
);
2141 return m_iCallbackPtr
;
2145 !CecCallbackMethods(void)
2152 /// Disable callback methods
2154 virtual void DisableCallbacks(void)
2160 /// Enable callback methods
2162 /// <param name="callbacks">Callback methods to activate</param>
2163 /// <return>true when handled, false otherwise</return>
2164 virtual bool EnableCallbacks(CecCallbackMethods
^ callbacks
)
2167 if (!m_bHasCallbacks
)
2169 m_bHasCallbacks
= true;
2170 m_callbacks
= callbacks
;
2178 /// Called by libCEC to send back a log message to the application.
2179 /// Override in the application to handle this callback.
2181 /// <param name="message">The log message</param>
2182 /// <return>1 when handled, 0 otherwise</return>
2183 virtual int ReceiveLogMessage(CecLogMessage
^ message
)
2189 /// Called by libCEC to send back a key press or release to the application.
2190 /// Override in the application to handle this callback.
2192 /// <param name="key">The key press command that libCEC received</param>
2193 /// <return>1 when handled, 0 otherwise</return>
2194 virtual int ReceiveKeypress(CecKeypress
^ key
)
2200 /// Called by libCEC to send back raw CEC data to the application.
2201 /// Override in the application to handle this callback.
2203 /// <param name="command">The raw CEC data</param>
2204 /// <return>1 when handled, 0 otherwise</return>
2205 virtual int ReceiveCommand(CecCommand
^ command
)
2211 /// Called by libCEC to send back an updated configuration to the application.
2212 /// Override in the application to handle this callback.
2214 /// <param name="config">The new configuration</param>
2215 /// <return>1 when handled, 0 otherwise</return>
2216 virtual int ConfigurationChanged(LibCECConfiguration
^ config
)
2222 /// Called by libCEC to send back an alert message to the application.
2223 /// Override in the application to handle this callback.
2225 /// <param name="data">The alert message</param>
2226 /// <return>1 when handled, 0 otherwise</return>
2227 virtual int ReceiveAlert(CecAlert alert
, CecParameter
^ data
)
2233 /// Called by libCEC to send back a menu state change to the application.
2234 /// Override in the application to handle this callback.
2236 /// <param name="newVal">The new menu state</param>
2237 /// <return>1 when handled, 0 otherwise</return>
2238 virtual int ReceiveMenuStateChange(CecMenuState newVal
)
2244 /// Called by libCEC to notify the application that the source that is handled by libCEC was (de)activated.
2245 /// Override in the application to handle this callback.
2247 /// <param name="logicalAddress">The logical address that was (de)activated</param>
2248 /// <param name="activated">True when activated, false when deactivated</param>
2249 virtual void SourceActivated(CecLogicalAddress logicalAddress
, bool activated
)
2254 // managed callback methods
2255 int CecLogMessageManaged(const CEC::cec_log_message
&message
)
2258 if (m_bHasCallbacks
)
2259 iReturn
= m_callbacks
->ReceiveLogMessage(gcnew
CecLogMessage(gcnew
System::String(message
.message
), (CecLogLevel
)message
.level
, message
.time
));
2263 int CecKeyPressManaged(const CEC::cec_keypress
&key
)
2266 if (m_bHasCallbacks
)
2267 iReturn
= m_callbacks
->ReceiveKeypress(gcnew
CecKeypress((CecUserControlCode
)key
.keycode
, key
.duration
));
2271 int CecCommandManaged(const CEC::cec_command
&command
)
2274 if (m_bHasCallbacks
)
2276 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
);
2277 for (uint8_t iPtr
= 0; iPtr
< command
.parameters
.size
; iPtr
++)
2278 newCommand
->Parameters
->PushBack(command
.parameters
[iPtr
]);
2279 iReturn
= m_callbacks
->ReceiveCommand(newCommand
);
2284 int CecConfigManaged(const CEC::libcec_configuration
&config
)
2287 if (m_bHasCallbacks
)
2289 LibCECConfiguration
^netConfig
= gcnew
LibCECConfiguration();
2290 netConfig
->Update(config
);
2291 iReturn
= m_callbacks
->ConfigurationChanged(netConfig
);
2296 int CecAlertManaged(const CEC::libcec_alert alert
, const CEC::libcec_parameter
&data
)
2299 if (m_bHasCallbacks
)
2301 CecParameterType newType
= (CecParameterType
)data
.paramType
;
2302 if (newType
== CecParameterType::ParameterTypeString
)
2304 System::String
^ newData
= gcnew
System::String((const char *)data
.paramData
, 0, 128);
2305 CecParameter
^ newParam
= gcnew
CecParameter(newType
, newData
);
2306 iReturn
= m_callbacks
->ReceiveAlert((CecAlert
)alert
, newParam
);
2312 int CecMenuManaged(const CEC::cec_menu_state newVal
)
2315 if (m_bHasCallbacks
)
2317 iReturn
= m_callbacks
->ReceiveMenuStateChange((CecMenuState
)newVal
);
2322 void CecSourceActivatedManaged(const CEC::cec_logical_address logicalAddress
, const uint8_t bActivated
)
2324 if (m_bHasCallbacks
)
2325 m_callbacks
->SourceActivated((CecLogicalAddress
)logicalAddress
, bActivated
== 1);
2328 void DestroyDelegates()
2330 m_bHasCallbacks
= false;
2331 if (m_bDelegatesCreated
)
2333 m_bDelegatesCreated
= false;
2334 m_logMessageGCHandle
.Free();
2335 m_keypressGCHandle
.Free();
2336 m_commandGCHandle
.Free();
2337 m_alertGCHandle
.Free();
2338 m_menuGCHandle
.Free();
2339 m_sourceActivatedGCHandle
.Free();
2343 void CreateDelegates()
2347 if (!m_bDelegatesCreated
)
2349 msclr::interop::marshal_context
^ context
= gcnew
msclr::interop::marshal_context();
2351 // create the delegate method for the log message callback
2352 m_logMessageDelegate
= gcnew
CecLogMessageManagedDelegate(this, &CecCallbackMethods::CecLogMessageManaged
);
2353 m_logMessageGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_logMessageDelegate
);
2354 m_logMessageCallback
= static_cast<LOGCB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_logMessageDelegate
).ToPointer());
2356 // create the delegate method for the keypress callback
2357 m_keypressDelegate
= gcnew
CecKeyPressManagedDelegate(this, &CecCallbackMethods::CecKeyPressManaged
);
2358 m_keypressGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_keypressDelegate
);
2359 m_keypressCallback
= static_cast<KEYCB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_keypressDelegate
).ToPointer());
2361 // create the delegate method for the command callback
2362 m_commandDelegate
= gcnew
CecCommandManagedDelegate(this, &CecCallbackMethods::CecCommandManaged
);
2363 m_commandGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_commandDelegate
);
2364 m_commandCallback
= static_cast<COMMANDCB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_commandDelegate
).ToPointer());
2366 // create the delegate method for the configuration change callback
2367 m_configDelegate
= gcnew
CecConfigManagedDelegate(this, &CecCallbackMethods::CecConfigManaged
);
2368 m_configGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_configDelegate
);
2369 m_configCallback
= static_cast<CONFIGCB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_configDelegate
).ToPointer());
2371 // create the delegate method for the alert callback
2372 m_alertDelegate
= gcnew
CecAlertManagedDelegate(this, &CecCallbackMethods::CecAlertManaged
);
2373 m_alertGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_alertDelegate
);
2374 m_alertCallback
= static_cast<ALERTCB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_alertDelegate
).ToPointer());
2376 // create the delegate method for the menu callback
2377 m_menuDelegate
= gcnew
CecMenuManagedDelegate(this, &CecCallbackMethods::CecMenuManaged
);
2378 m_menuGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_menuDelegate
);
2379 m_menuCallback
= static_cast<MENUCB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_menuDelegate
).ToPointer());
2381 // create the delegate method for the source activated callback
2382 m_sourceActivatedDelegate
= gcnew
CecSourceActivatedManagedDelegate(this, &CecCallbackMethods::CecSourceActivatedManaged
);
2383 m_sourceActivatedGCHandle
= System::Runtime::InteropServices::GCHandle::Alloc(m_sourceActivatedDelegate
);
2384 m_sourceActivatedCallback
= static_cast<ACTICB
>(System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(m_sourceActivatedDelegate
).ToPointer());
2388 UnmanagedCecCallbacks unmanagedCallbacks
;
2389 unmanagedCallbacks
.logCB
= m_logMessageCallback
;
2390 unmanagedCallbacks
.keyCB
= m_keypressCallback
;
2391 unmanagedCallbacks
.commandCB
= m_commandCallback
;
2392 unmanagedCallbacks
.configCB
= m_configCallback
;
2393 unmanagedCallbacks
.alertCB
= m_alertCallback
;
2394 unmanagedCallbacks
.menuCB
= m_menuCallback
;
2395 unmanagedCallbacks
.sourceActivatedCB
= m_sourceActivatedCallback
;
2397 PLATFORM::CLockObject
lock(g_callbackMutex
);
2398 g_unmanagedCallbacks
.push_back(unmanagedCallbacks
);
2399 m_iCallbackPtr
= g_unmanagedCallbacks
.size() - 1;
2400 m_bDelegatesCreated
= true;
2404 CecLogMessageManagedDelegate
^ m_logMessageDelegate
;
2405 static System::Runtime::InteropServices::GCHandle m_logMessageGCHandle
;
2406 LOGCB m_logMessageCallback
;
2408 CecKeyPressManagedDelegate
^ m_keypressDelegate
;
2409 static System::Runtime::InteropServices::GCHandle m_keypressGCHandle
;
2410 KEYCB m_keypressCallback
;
2412 CecCommandManagedDelegate
^ m_commandDelegate
;
2413 static System::Runtime::InteropServices::GCHandle m_commandGCHandle
;
2414 COMMANDCB m_commandCallback
;
2416 CecConfigManagedDelegate
^ m_configDelegate
;
2417 static System::Runtime::InteropServices::GCHandle m_configGCHandle
;
2418 CONFIGCB m_configCallback
;
2420 CecAlertManagedDelegate
^ m_alertDelegate
;
2421 static System::Runtime::InteropServices::GCHandle m_alertGCHandle
;
2422 ALERTCB m_alertCallback
;
2424 CecMenuManagedDelegate
^ m_menuDelegate
;
2425 static System::Runtime::InteropServices::GCHandle m_menuGCHandle
;
2426 MENUCB m_menuCallback
;
2428 CecSourceActivatedManagedDelegate
^ m_sourceActivatedDelegate
;
2429 static System::Runtime::InteropServices::GCHandle m_sourceActivatedGCHandle
;
2430 ACTICB m_sourceActivatedCallback
;
2432 CecCallbackMethods
^ m_callbacks
;
2433 bool m_bHasCallbacks
;
2434 bool m_bDelegatesCreated
;
2435 size_t m_iCallbackPtr
;