2 Copyright 2004-2005 Chris Tallon
4 This file is part of VOMP.
6 VOMP 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 of the License, or
9 (at your option) any later version.
11 VOMP 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 VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #include "abstractoption.h"
32 typedef map<ULLONG,UCHAR> RemoteTranslationList;
34 class Remote: public AbstractOption
39 static Remote* getInstance();
41 bool addOptionPagesToWTB(WTabBar *wtb);
42 bool loadOptionsfromServer(VDR* vdr);
43 bool saveOptionstoServer();
45 void setRemoteType(UCHAR type);
46 void setHWCtoCommand(ULLONG hcw,UCHAR command);
47 void unsetHWC(ULLONG hcw);
48 void LoadKeysConfig(VDR *vdr,const char*keynum);
49 void SaveKeysConfig();
50 void EnterLearningMode(UCHAR command);
52 virtual int init(char *devName)=0;
53 virtual int shutdown()=0;
54 virtual UCHAR getButtonPress(int how)=0;
55 virtual void clearBuffer()=0;
57 virtual bool mayHaveFewButtons() {return false;};
59 virtual bool handlesVolume() {return false;};
60 virtual void volumeUp() {};
61 virtual void volumeDown() {};
62 virtual void volumeMute() {};
64 virtual void InitHWCListwithDefaults();
65 virtual char* HCWDesc(ULLONG hcw);
66 const char *CommandDesc(UCHAR number);
67 char *CommandTranslateStr(UCHAR command);
68 virtual const char*HardcodedTranslateStr(UCHAR command);
69 void EnterLearnMode(UCHAR command);
70 void ResetToDefault();
72 virtual void changePowerState(bool poweron) {}; //informs the remote control, that about vomp's power state, this is important e.g. for cec
74 const static ULONG NOLEARNMODE = 256;
76 const static UCHAR NA_LEARN = 101;
77 const static UCHAR NA_NONE = 98;
78 const static UCHAR NA_UNKNOWN = 99;
79 const static UCHAR NA_SIGNAL = 100;
80 const static UCHAR DF_UP = 94;
81 const static UCHAR DF_DOWN = 95;
82 const static UCHAR DF_LEFT = 96;
83 const static UCHAR DF_RIGHT = 97;
85 // Problem common buttons
86 const static UCHAR VOLUMEUP = 16;
87 const static UCHAR VOLUMEDOWN = 17;
88 const static UCHAR CHANNELUP = 32;
89 const static UCHAR CHANNELDOWN = 33;
92 const static UCHAR ZERO = 0;
93 const static UCHAR ONE = 1;
94 const static UCHAR TWO = 2;
95 const static UCHAR THREE = 3;
96 const static UCHAR FOUR = 4;
97 const static UCHAR FIVE = 5;
98 const static UCHAR SIX = 6;
99 const static UCHAR SEVEN = 7;
100 const static UCHAR EIGHT = 8;
101 const static UCHAR NINE = 9;
102 const static UCHAR POWER = 61;
103 const static UCHAR GO = 59;
104 const static UCHAR BACK = 31;
105 const static UCHAR MENU = 13;
106 const static UCHAR RED = 11;
107 const static UCHAR GREEN = 46;
108 const static UCHAR YELLOW = 56;
109 const static UCHAR BLUE = 41;
110 const static UCHAR MUTE = 15;
111 const static UCHAR RADIO = 12; // The unlabelled button on old
112 const static UCHAR REVERSE = 50;
113 const static UCHAR PLAY = 53;
114 const static UCHAR FORWARD = 52;
115 const static UCHAR RECORD = 55;
116 const static UCHAR STOP = 54;
117 const static UCHAR PAUSE = 48;
118 const static UCHAR SKIPBACK = 36;
119 const static UCHAR SKIPFORWARD = 30;
120 const static UCHAR OK = 37;
123 const static UCHAR FULL = 60;
126 const static UCHAR TV = 28;
127 const static UCHAR VIDEOS = 24;
128 const static UCHAR MUSIC = 25;
129 const static UCHAR PICTURES = 26;
130 const static UCHAR GUIDE = 27;
131 const static UCHAR UP = 20;
132 const static UCHAR DOWN = 21;
133 const static UCHAR LEFT = 22;
134 const static UCHAR RIGHT = 23;
135 const static UCHAR PREVCHANNEL = 18;
136 const static UCHAR STAR = 10;
137 const static UCHAR HASH = 14;
140 const static UCHAR PLAYPAUSE = 201;
144 const static UCHAR OLDREMOTE = 1;
145 const static UCHAR NEWREMOTE = 2;
148 virtual UCHAR TranslateHWCFixed(ULLONG code);
149 UCHAR TranslateHWCList(ULLONG code);
150 UCHAR TranslateHWC(ULLONG code);
154 static Remote* instance;
156 RemoteTranslationList translist;