]> git.vomp.tv Git - vompclient.git/blob - remote.h
Initial import
[vompclient.git] / remote.h
1 /*
2     Copyright 2004-2005 Chris Tallon
3
4     This file is part of VOMP.
5
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.
10
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.
15
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21 #ifndef REMOTE_H
22 #define REMOTE_H
23
24 #include <stdio.h>
25 #include <unistd.h>
26 #include <fcntl.h>
27
28 #include "defines.h"
29 #include "log.h"
30
31 class Remote
32 {
33   public:
34     Remote();
35     ~Remote();
36     static Remote* getInstance();
37
38     int init(char *devName);
39     int shutdown();
40     int getDevice();
41     UCHAR getButtonPress(int how);
42
43     const static UCHAR ZERO        = 0;
44     const static UCHAR ONE         = 1;
45     const static UCHAR TWO         = 2;
46     const static UCHAR THREE       = 3;
47     const static UCHAR FOUR        = 4;
48     const static UCHAR FIVE        = 5;
49     const static UCHAR SIX         = 6;
50     const static UCHAR SEVEN       = 7;
51     const static UCHAR EIGHT       = 8;
52     const static UCHAR NINE        = 9;
53     const static UCHAR POWER       = 61;
54     const static UCHAR GO          = 59;
55     const static UCHAR BACK        = 31;
56     const static UCHAR MENU        = 13;
57     const static UCHAR RED         = 11;
58     const static UCHAR GREEN       = 46;
59     const static UCHAR YELLOW      = 56;
60     const static UCHAR BLUE        = 41;
61     const static UCHAR LEFT        = 17;
62     const static UCHAR RIGHT       = 16;
63     const static UCHAR UP          = 32;
64     const static UCHAR DOWN        = 33;
65     const static UCHAR MUTE        = 15;
66     const static UCHAR OSD         = 12;
67     const static UCHAR FULL        = 60;
68     const static UCHAR REVERSE     = 50;
69     const static UCHAR PLAY        = 53;
70     const static UCHAR FORWARD     = 52;
71     const static UCHAR RECORD      = 55;
72     const static UCHAR STOP        = 54;
73     const static UCHAR PAUSE       = 48;
74     const static UCHAR SKIPBACK    = 36;
75     const static UCHAR SKIPFORWARD = 30;
76     const static UCHAR OK          = 37;
77     const static UCHAR NONE        = 98;
78     const static UCHAR UNKNOWN     = 99;
79     const static UCHAR SIGNAL      = 100;
80
81   private:
82     static Remote* instance;
83     int initted;
84     int device;
85     struct timeval tv;
86 };
87
88 #endif