3 * Copyright (C) 2005-2011 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 * http://www.gnu.org/copyleft/gpl.html
23 #include "PeripheralHID.h"
24 #include "interfaces/AnnouncementManager.h"
25 #include "threads/Thread.h"
26 #include "threads/CriticalSection.h"
39 unsigned int iButtonPressed;
40 unsigned int iButtonReleased;
44 class CPeripheralCecAdapter : public CPeripheralHID, public ANNOUNCEMENT::IAnnouncer, private CThread
47 CPeripheralCecAdapter(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId);
48 virtual ~CPeripheralCecAdapter(void);
50 virtual void Announce(ANNOUNCEMENT::EAnnouncementFlag flag, const char *sender, const char *message, const CVariant &data);
51 virtual bool PowerOnCecDevices(void);
52 virtual bool StandbyCecDevices(void);
54 virtual bool SendPing(void);
55 virtual bool StartBootloader(void);
57 virtual void OnSettingChanged(const CStdString &strChangedSetting);
59 virtual WORD GetButton(void);
60 virtual unsigned int GetHoldTime(void);
61 virtual void ResetButton(void);
64 virtual void FlushLog(void);
65 virtual bool GetNextKey(void);
66 virtual bool InitialiseFeature(const PeripheralFeature feature);
67 virtual void Process(void);
68 virtual void ProcessNextCommand(void);
69 static bool FindConfigLocation(CStdString &strString);
70 static bool TranslateComPort(CStdString &strPort);
72 CEC::ICECAdapter* m_cecAdapter;
76 CecButtonPress m_button;
77 CCriticalSection m_critSection;