cec: give every device type it's own class
authorLars Op den Kamp <lars@opdenkamp.eu>
Sun, 6 Nov 2011 11:30:31 +0000 (12:30 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sun, 6 Nov 2011 11:30:31 +0000 (12:30 +0100)
14 files changed:
src/lib/CECProcessor.cpp
src/lib/CECProcessor.h
src/lib/Makefile.am
src/lib/devices/CECAudioSystem.cpp [new file with mode: 0644]
src/lib/devices/CECAudioSystem.h [new file with mode: 0644]
src/lib/devices/CECBusDevice.cpp
src/lib/devices/CECPlaybackDevice.cpp [new file with mode: 0644]
src/lib/devices/CECPlaybackDevice.h [new file with mode: 0644]
src/lib/devices/CECRecordingDevice.cpp [new file with mode: 0644]
src/lib/devices/CECRecordingDevice.h [new file with mode: 0644]
src/lib/devices/CECTV.cpp [new file with mode: 0644]
src/lib/devices/CECTV.h [new file with mode: 0644]
src/lib/devices/CECTuner.cpp [new file with mode: 0644]
src/lib/devices/CECTuner.h [new file with mode: 0644]

index b9f2c5188c6f72a89db86286ad42b4c1119012bc..5eed4a888f650802c3238d47c5a391275617e242 100644 (file)
 
 #include "AdapterCommunication.h"
 #include "devices/CECBusDevice.h"
+#include "devices/CECAudioSystem.h"
+#include "devices/CECPlaybackDevice.h"
+#include "devices/CECRecordingDevice.h"
+#include "devices/CECTuner.h"
+#include "devices/CECTV.h"
 #include "LibCEC.h"
 #include "util/StdString.h"
 #include "platform/timeutils.h"
@@ -65,7 +70,36 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, CAdapterCommunication *serComm
 {
   m_logicalAddresses.clear();
   for (int iPtr = 0; iPtr < 16; iPtr++)
-    m_busDevices[iPtr] = new CCECBusDevice(this, (cec_logical_address) iPtr, 0);
+  {
+    switch(iPtr)
+    {
+    case CECDEVICE_AUDIOSYSTEM:
+      m_busDevices[iPtr] = new CCECAudioSystem(this, (cec_logical_address) iPtr, 0);
+      break;
+    case CECDEVICE_PLAYBACKDEVICE1:
+    case CECDEVICE_PLAYBACKDEVICE2:
+    case CECDEVICE_PLAYBACKDEVICE3:
+      m_busDevices[iPtr] = new CCECPlaybackDevice(this, (cec_logical_address) iPtr, 0);
+      break;
+    case CECDEVICE_RECORDINGDEVICE1:
+    case CECDEVICE_RECORDINGDEVICE2:
+    case CECDEVICE_RECORDINGDEVICE3:
+      m_busDevices[iPtr] = new CCECRecordingDevice(this, (cec_logical_address) iPtr, 0);
+      break;
+    case CECDEVICE_TUNER1:
+    case CECDEVICE_TUNER2:
+    case CECDEVICE_TUNER3:
+    case CECDEVICE_TUNER4:
+      m_busDevices[iPtr] = new CCECTuner(this, (cec_logical_address) iPtr, 0);
+      break;
+    case CECDEVICE_TV:
+      m_busDevices[iPtr] = new CCECTV(this, (cec_logical_address) iPtr, 0);
+      break;
+    default:
+      m_busDevices[iPtr] = new CCECBusDevice(this, (cec_logical_address) iPtr, 0);
+      break;
+    }
+  }
 }
 
 CCECProcessor::~CCECProcessor(void)
@@ -102,7 +136,7 @@ bool CCECProcessor::Start(void)
   return false;
 }
 
-bool CCECProcessor::TryLogicalAddress(cec_logical_address address, const char *strLabel)
+bool CCECProcessor::TryLogicalAddress(cec_logical_address address, const char *strLabel, unsigned int iIndex)
 {
   CStdString strLog;
   strLog.Format("trying logical address '%s'", strLabel);
@@ -120,7 +154,7 @@ bool CCECProcessor::TryLogicalAddress(cec_logical_address address, const char *s
     m_logicalAddresses.set(address);
 
     // TODO
-    m_busDevices[address]->SetPhysicalAddress(CEC_DEFAULT_PHYSICAL_ADDRESS);
+    m_busDevices[address]->SetPhysicalAddress(CEC_DEFAULT_PHYSICAL_ADDRESS + iIndex);
 
     return true;
   }
@@ -130,35 +164,35 @@ bool CCECProcessor::TryLogicalAddress(cec_logical_address address, const char *s
   return false;
 }
 
-bool CCECProcessor::FindLogicalAddressRecordingDevice(void)
+bool CCECProcessor::FindLogicalAddressRecordingDevice(unsigned int iIndex)
 {
   AddLog(CEC_LOG_DEBUG, "detecting logical address for type 'recording device'");
-  return TryLogicalAddress(CECDEVICE_RECORDINGDEVICE1, "recording 1") ||
-      TryLogicalAddress(CECDEVICE_RECORDINGDEVICE2, "recording 2") ||
-      TryLogicalAddress(CECDEVICE_RECORDINGDEVICE3, "recording 3");
+  return TryLogicalAddress(CECDEVICE_RECORDINGDEVICE1, "recording 1", iIndex) ||
+      TryLogicalAddress(CECDEVICE_RECORDINGDEVICE2, "recording 2", iIndex) ||
+      TryLogicalAddress(CECDEVICE_RECORDINGDEVICE3, "recording 3", iIndex);
 }
 
-bool CCECProcessor::FindLogicalAddressTuner(void)
+bool CCECProcessor::FindLogicalAddressTuner(unsigned int iIndex)
 {
   AddLog(CEC_LOG_DEBUG, "detecting logical address for type 'tuner'");
-  return TryLogicalAddress(CECDEVICE_TUNER1, "tuner 1") ||
-      TryLogicalAddress(CECDEVICE_TUNER2, "tuner 2") ||
-      TryLogicalAddress(CECDEVICE_TUNER3, "tuner 3") ||
-      TryLogicalAddress(CECDEVICE_TUNER4, "tuner 4");
+  return TryLogicalAddress(CECDEVICE_TUNER1, "tuner 1", iIndex) ||
+      TryLogicalAddress(CECDEVICE_TUNER2, "tuner 2", iIndex) ||
+      TryLogicalAddress(CECDEVICE_TUNER3, "tuner 3", iIndex) ||
+      TryLogicalAddress(CECDEVICE_TUNER4, "tuner 4", iIndex);
 }
 
-bool CCECProcessor::FindLogicalAddressPlaybackDevice(void)
+bool CCECProcessor::FindLogicalAddressPlaybackDevice(unsigned int iIndex)
 {
   AddLog(CEC_LOG_DEBUG, "detecting logical address for type 'playback device'");
-  return TryLogicalAddress(CECDEVICE_PLAYBACKDEVICE1, "playback 1") ||
-      TryLogicalAddress(CECDEVICE_PLAYBACKDEVICE2, "playback 2") ||
-      TryLogicalAddress(CECDEVICE_PLAYBACKDEVICE3, "playback 3");
+  return TryLogicalAddress(CECDEVICE_PLAYBACKDEVICE1, "playback 1", iIndex) ||
+      TryLogicalAddress(CECDEVICE_PLAYBACKDEVICE2, "playback 2", iIndex) ||
+      TryLogicalAddress(CECDEVICE_PLAYBACKDEVICE3, "playback 3", iIndex);
 }
 
-bool CCECProcessor::FindLogicalAddressAudioSystem(void)
+bool CCECProcessor::FindLogicalAddressAudioSystem(unsigned int iIndex)
 {
   AddLog(CEC_LOG_DEBUG, "detecting logical address for type 'audio'");
-  return TryLogicalAddress(CECDEVICE_AUDIOSYSTEM, "audio");
+  return TryLogicalAddress(CECDEVICE_AUDIOSYSTEM, "audio", iIndex);
 }
 
 bool CCECProcessor::FindLogicalAddresses(void)
@@ -176,13 +210,13 @@ bool CCECProcessor::FindLogicalAddresses(void)
     AddLog(CEC_LOG_DEBUG, strLog);
 
     if (m_types.types[iPtr] == CEC_DEVICE_TYPE_RECORDING_DEVICE)
-      bReturn &= FindLogicalAddressRecordingDevice();
+      bReturn &= FindLogicalAddressRecordingDevice(iPtr);
     if (m_types.types[iPtr] == CEC_DEVICE_TYPE_TUNER)
-      bReturn &= FindLogicalAddressTuner();
+      bReturn &= FindLogicalAddressTuner(iPtr);
     if (m_types.types[iPtr] == CEC_DEVICE_TYPE_PLAYBACK_DEVICE)
-      bReturn &= FindLogicalAddressPlaybackDevice();
+      bReturn &= FindLogicalAddressPlaybackDevice(iPtr);
     if (m_types.types[iPtr] == CEC_DEVICE_TYPE_AUDIO_SYSTEM)
-      bReturn &= FindLogicalAddressAudioSystem();
+      bReturn &= FindLogicalAddressAudioSystem(iPtr);
   }
 
   return bReturn;
index a9c1065b918dd8a9d357998d5ccdec23fa9f3bed..ad444480ff1e3f5f6259b48e212ea84ab4a0e9d7 100644 (file)
@@ -87,11 +87,11 @@ namespace CEC
       CCECBusDevice *m_busDevices[16];
 
   private:
-      bool TryLogicalAddress(cec_logical_address address, const char *strLabel);
-      bool FindLogicalAddressRecordingDevice(void);
-      bool FindLogicalAddressTuner(void);
-      bool FindLogicalAddressPlaybackDevice(void);
-      bool FindLogicalAddressAudioSystem(void);
+      bool TryLogicalAddress(cec_logical_address address, const char *strLabel, unsigned int iIndex);
+      bool FindLogicalAddressRecordingDevice(unsigned int iIndex);
+      bool FindLogicalAddressTuner(unsigned int iIndex);
+      bool FindLogicalAddressPlaybackDevice(unsigned int iIndex);
+      bool FindLogicalAddressAudioSystem(unsigned int iIndex);
 
       bool SetAckMask(uint16_t iMask);
       void LogOutput(const cec_command &data);
index f5b5b0e26cd608db6684d39f1e8af2b6f96d30c5..64ed009176c0298f6128da9ad26716c1e4f873e7 100644 (file)
@@ -18,8 +18,18 @@ libcec_la_SOURCES = AdapterCommunication.cpp \
                     LibCEC.h \
                     LibCECC.cpp \
                     util/StdString.h \
+                    devices/CECAudioSystem.h \
+                                       devices/CECAudioSystem.cpp \
                     devices/CECBusDevice.cpp \
                     devices/CECBusDevice.h \
+                    devices/CECPlaybackDevice.h \
+                    devices/CECPlaybackDevice.cpp \
+                    devices/CECRecordingDevice.h \
+                                       devices/CECRecordingDevice.cpp \
+                    devices/CECTuner.h \
+                    devices/CECTuner.cpp \
+                    devices/CECTV.h \
+                    devices/CECTV.cpp \
                     implementations/ANCommandHandler.cpp \
                     implementations/ANCommandHandler.h \
                     implementations/CECCommandHandler.cpp \
diff --git a/src/lib/devices/CECAudioSystem.cpp b/src/lib/devices/CECAudioSystem.cpp
new file mode 100644 (file)
index 0000000..d0ab39e
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing       <license@pulse-eight.com>
+ *     http://www.pulse-eight.com/
+ *     http://www.pulse-eight.net/
+ */
+
+#include "CECAudioSystem.h"
+
+using namespace CEC;
+
+CCECAudioSystem::CCECAudioSystem(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress /* = 0 */) :
+    CCECBusDevice(processor, address, iPhysicalAddress)
+{
+  m_type          = CEC_DEVICE_TYPE_AUDIO_SYSTEM;
+  m_strDeviceName = "Audio";
+}
diff --git a/src/lib/devices/CECAudioSystem.h b/src/lib/devices/CECAudioSystem.h
new file mode 100644 (file)
index 0000000..51c1676
--- /dev/null
@@ -0,0 +1,44 @@
+#pragma once
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing       <license@pulse-eight.com>
+ *     http://www.pulse-eight.com/
+ *     http://www.pulse-eight.net/
+ */
+
+#include "CECBusDevice.h"
+
+namespace CEC
+{
+  class CCECAudioSystem : public CCECBusDevice
+  {
+  public:
+    CCECAudioSystem(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress = 0);
+    virtual ~CCECAudioSystem(void) {};
+  };
+}
index 4e15fb795bd4ff5dd75f61564dd17bdc9a978003..07675cdf69354c021cbb53114034f1c080239d51 100644 (file)
@@ -49,46 +49,15 @@ CCECBusDevice::CCECBusDevice(CCECProcessor *processor, cec_logical_address iLogi
   m_cecVersion(CEC_VERSION_UNKNOWN)
 {
   m_handler = new CCECCommandHandler(this);
+
   for (unsigned int iPtr = 0; iPtr < 4; iPtr++)
     m_menuLanguage.language[iPtr] = '?';
   m_menuLanguage.language[3] = 0;
   m_menuLanguage.device = iLogicalAddress;
-  m_vendor.vendor = CEC_VENDOR_UNKNOWN;
 
-  switch(iLogicalAddress)
-  {
-  case CECDEVICE_AUDIOSYSTEM:
-    m_type          = CEC_DEVICE_TYPE_AUDIO_SYSTEM;
-    m_strDeviceName = "Audio";
-    break;
-  case CECDEVICE_PLAYBACKDEVICE1:
-  case CECDEVICE_PLAYBACKDEVICE2:
-  case CECDEVICE_PLAYBACKDEVICE3:
-    m_type          = CEC_DEVICE_TYPE_PLAYBACK_DEVICE;
-    m_strDeviceName = "Player";
-    break;
-  case CECDEVICE_RECORDINGDEVICE1:
-  case CECDEVICE_RECORDINGDEVICE2:
-  case CECDEVICE_RECORDINGDEVICE3:
-    m_type          = CEC_DEVICE_TYPE_RECORDING_DEVICE;
-    m_strDeviceName = "Recorder";
-    break;
-  case CECDEVICE_TUNER1:
-  case CECDEVICE_TUNER2:
-  case CECDEVICE_TUNER3:
-  case CECDEVICE_TUNER4:
-    m_type          = CEC_DEVICE_TYPE_TUNER;
-    m_strDeviceName = "Tuner";
-    break;
-  case CECDEVICE_TV:
-    m_type          = CEC_DEVICE_TYPE_TV;
-    m_strDeviceName = "TV";
-    break;
-  default:
-    m_type          = CEC_DEVICE_TYPE_RESERVED;
-    m_strDeviceName = "Unknown";
-    break;
-  }
+  m_vendor.vendor = CEC_VENDOR_UNKNOWN;
+  m_type          = CEC_DEVICE_TYPE_RESERVED;
+  m_strDeviceName = "Unknown";
 }
 
 CCECBusDevice::~CCECBusDevice(void)
diff --git a/src/lib/devices/CECPlaybackDevice.cpp b/src/lib/devices/CECPlaybackDevice.cpp
new file mode 100644 (file)
index 0000000..8951fe0
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing       <license@pulse-eight.com>
+ *     http://www.pulse-eight.com/
+ *     http://www.pulse-eight.net/
+ */
+
+#include "CECPlaybackDevice.h"
+
+using namespace CEC;
+
+CCECPlaybackDevice::CCECPlaybackDevice(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress /* = 0 */) :
+    CCECBusDevice(processor, address, iPhysicalAddress)
+{
+  m_type          = CEC_DEVICE_TYPE_PLAYBACK_DEVICE;
+  m_strDeviceName = "Player";
+}
diff --git a/src/lib/devices/CECPlaybackDevice.h b/src/lib/devices/CECPlaybackDevice.h
new file mode 100644 (file)
index 0000000..2b13508
--- /dev/null
@@ -0,0 +1,44 @@
+#pragma once
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing       <license@pulse-eight.com>
+ *     http://www.pulse-eight.com/
+ *     http://www.pulse-eight.net/
+ */
+
+#include "CECBusDevice.h"
+
+namespace CEC
+{
+  class CCECPlaybackDevice : public CCECBusDevice
+  {
+  public:
+    CCECPlaybackDevice(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress = 0);
+    virtual ~CCECPlaybackDevice(void) {};
+  };
+}
diff --git a/src/lib/devices/CECRecordingDevice.cpp b/src/lib/devices/CECRecordingDevice.cpp
new file mode 100644 (file)
index 0000000..e5ae9d8
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing       <license@pulse-eight.com>
+ *     http://www.pulse-eight.com/
+ *     http://www.pulse-eight.net/
+ */
+
+#include "CECRecordingDevice.h"
+
+using namespace CEC;
+
+CCECRecordingDevice::CCECRecordingDevice(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress /* = 0 */) :
+    CCECBusDevice(processor, address, iPhysicalAddress)
+{
+  m_type          = CEC_DEVICE_TYPE_RECORDING_DEVICE;
+  m_strDeviceName = "Recorder";
+}
diff --git a/src/lib/devices/CECRecordingDevice.h b/src/lib/devices/CECRecordingDevice.h
new file mode 100644 (file)
index 0000000..45c0407
--- /dev/null
@@ -0,0 +1,44 @@
+#pragma once
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing       <license@pulse-eight.com>
+ *     http://www.pulse-eight.com/
+ *     http://www.pulse-eight.net/
+ */
+
+#include "CECBusDevice.h"
+
+namespace CEC
+{
+  class CCECRecordingDevice : public CCECBusDevice
+  {
+  public:
+    CCECRecordingDevice(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress = 0);
+    virtual ~CCECRecordingDevice(void) {};
+  };
+}
diff --git a/src/lib/devices/CECTV.cpp b/src/lib/devices/CECTV.cpp
new file mode 100644 (file)
index 0000000..862cf84
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing       <license@pulse-eight.com>
+ *     http://www.pulse-eight.com/
+ *     http://www.pulse-eight.net/
+ */
+
+#include "CECTV.h"
+
+using namespace CEC;
+
+CCECTV::CCECTV(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress /* = 0 */) :
+    CCECBusDevice(processor, address, iPhysicalAddress)
+{
+  m_type          = CEC_DEVICE_TYPE_TV;
+  m_strDeviceName = "TV";
+}
diff --git a/src/lib/devices/CECTV.h b/src/lib/devices/CECTV.h
new file mode 100644 (file)
index 0000000..c14075c
--- /dev/null
@@ -0,0 +1,44 @@
+#pragma once
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing       <license@pulse-eight.com>
+ *     http://www.pulse-eight.com/
+ *     http://www.pulse-eight.net/
+ */
+
+#include "CECBusDevice.h"
+
+namespace CEC
+{
+  class CCECTV : public CCECBusDevice
+  {
+  public:
+    CCECTV(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress = 0);
+    virtual ~CCECTV(void) {};
+  };
+}
diff --git a/src/lib/devices/CECTuner.cpp b/src/lib/devices/CECTuner.cpp
new file mode 100644 (file)
index 0000000..55d7bb5
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing       <license@pulse-eight.com>
+ *     http://www.pulse-eight.com/
+ *     http://www.pulse-eight.net/
+ */
+
+#include "CECTuner.h"
+
+using namespace CEC;
+
+CCECTuner::CCECTuner(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress /* = 0 */) :
+    CCECBusDevice(processor, address, iPhysicalAddress)
+{
+  m_type          = CEC_DEVICE_TYPE_TUNER;
+  m_strDeviceName = "Tuner";
+}
diff --git a/src/lib/devices/CECTuner.h b/src/lib/devices/CECTuner.h
new file mode 100644 (file)
index 0000000..e74b3e5
--- /dev/null
@@ -0,0 +1,44 @@
+#pragma once
+/*
+ * This file is part of the libCEC(R) library.
+ *
+ * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is an original work, containing original code.
+ *
+ * libCEC(R) is a trademark of Pulse-Eight Limited.
+ *
+ * This program is dual-licensed; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Alternatively, you can license this library under a commercial license,
+ * please contact Pulse-Eight Licensing for more information.
+ *
+ * For more information contact:
+ * Pulse-Eight Licensing       <license@pulse-eight.com>
+ *     http://www.pulse-eight.com/
+ *     http://www.pulse-eight.net/
+ */
+
+#include "CECBusDevice.h"
+
+namespace CEC
+{
+  class CCECTuner : public CCECBusDevice
+  {
+  public:
+    CCECTuner(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress = 0);
+    virtual ~CCECTuner(void) {};
+  };
+}