cec: added GetLogicalAddresses() and SetStreamPath() to LibCecSharp
authorLars Op den Kamp <lars@opdenkamp.eu>
Fri, 10 Feb 2012 11:53:11 +0000 (12:53 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Fri, 10 Feb 2012 11:53:11 +0000 (12:53 +0100)
src/LibCecSharp/CecSharpTypes.h
src/LibCecSharp/LibCecSharp.cpp

index 2c158a5d64dbdb7b78c919c58c55a28cf37e4419..64172bb4c5cb83ae2f845108bf0c9bcaa5964130 100644 (file)
@@ -369,6 +369,7 @@ namespace CecSharp
                        return Addresses[(unsigned int)iAddress] != CecLogicalAddress::Unregistered;
                }
 
+               property CecLogicalAddress          Primary;
                property array<CecLogicalAddress> ^ Addresses;
        };
 
index 6cdc6ab0a72b14e2cafb86215bef5094ec222f23..698c81753e2c3a4354bb4feab3a7f60cdfed0e54 100644 (file)
@@ -388,6 +388,26 @@ namespace CecSharp
                        return m_libCec->GetDevicePhysicalAddress((cec_logical_address)iAddress);
                }
 
+               bool SetStreamPath(CecLogicalAddress iAddress)
+               {
+                       return m_libCec->SetStreamPath((cec_logical_address)iAddress);
+               }
+
+               bool SetStreamPath(uint16_t iPhysicalAddress)
+               {
+                       return m_libCec->SetStreamPath(iPhysicalAddress);
+               }
+
+               CecLogicalAddresses ^GetLogicalAddresses(void)
+               {
+                       CecLogicalAddresses ^addr = gcnew CecLogicalAddresses();
+                       cec_logical_addresses libAddr = m_libCec->GetLogicalAddresses();
+                       for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
+                               addr->Addresses[iPtr] = (CecLogicalAddress)libAddr.addresses[iPtr];
+                       addr->Primary = (CecLogicalAddress)libAddr.primary;
+                       return addr;
+               }
+
                bool GetCurrentConfiguration(LibCECConfiguration ^configuration)
                {
                        libcec_configuration config;