From: Lars Op den Kamp Date: Sun, 6 Nov 2011 11:30:31 +0000 (+0100) Subject: cec: give every device type it's own class X-Git-Tag: upstream/2.2.0~1^2~108 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=51b2a0943d227f8090948c3d603c643e410cd17d;p=deb_libcec.git cec: give every device type it's own class --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index b9f2c51..5eed4a8 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -34,6 +34,11 @@ #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; diff --git a/src/lib/CECProcessor.h b/src/lib/CECProcessor.h index a9c1065..ad44448 100644 --- a/src/lib/CECProcessor.h +++ b/src/lib/CECProcessor.h @@ -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); diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index f5b5b0e..64ed009 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -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 index 0000000..d0ab39e --- /dev/null +++ b/src/lib/devices/CECAudioSystem.cpp @@ -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 + * 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 index 0000000..51c1676 --- /dev/null +++ b/src/lib/devices/CECAudioSystem.h @@ -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 + * 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) {}; + }; +} diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 4e15fb7..07675cd 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -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 index 0000000..8951fe0 --- /dev/null +++ b/src/lib/devices/CECPlaybackDevice.cpp @@ -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 + * 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 index 0000000..2b13508 --- /dev/null +++ b/src/lib/devices/CECPlaybackDevice.h @@ -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 + * 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 index 0000000..e5ae9d8 --- /dev/null +++ b/src/lib/devices/CECRecordingDevice.cpp @@ -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 + * 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 index 0000000..45c0407 --- /dev/null +++ b/src/lib/devices/CECRecordingDevice.h @@ -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 + * 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 index 0000000..862cf84 --- /dev/null +++ b/src/lib/devices/CECTV.cpp @@ -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 + * 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 index 0000000..c14075c --- /dev/null +++ b/src/lib/devices/CECTV.h @@ -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 + * 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 index 0000000..55d7bb5 --- /dev/null +++ b/src/lib/devices/CECTuner.cpp @@ -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 + * 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 index 0000000..e74b3e5 --- /dev/null +++ b/src/lib/devices/CECTuner.h @@ -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 + * 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) {}; + }; +}