Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / x10tv.h
1 /*
2  * CINELERRA
3  * Copyright (C) 2016-2020 William Morrow
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published
7  * by the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18  * USA
19  */
20
21 #ifndef __X10TV_H__
22 #define __X10TV_H__
23 #ifdef HAVE_X10TV
24
25 #include "remotecontrol.h"
26 #include "thread.h"
27
28 #define X10_A           0x001e
29 #define X10_B           0x0030
30 #define X10_POWER       0x0074
31 #define X10_TV          0x0179
32 #define X10_DVD         0x0185
33 #define X10_WWW         0x0096
34 #define X10_BOOK        0x009c
35 #define X10_EDIT        0x00b0
36 #define X10_VOLDN       0x0072
37 #define X10_VOLUP       0x0073
38 #define X10_MUTE        0x0071
39 #define X10_CH_DN       0x0193
40 #define X10_CH_UP       0x0192
41 #define X10_1           0x0201
42 #define X10_2           0x0202
43 #define X10_3           0x0203
44 #define X10_4           0x0204
45 #define X10_5           0x0205
46 #define X10_6           0x0206
47 #define X10_7           0x0207
48 #define X10_8           0x0208
49 #define X10_9           0x0209
50 #define X10_MENU        0x008b
51 #define X10_0           0x0200
52 #define X10_SETUP       0x008d
53 #define X10_C           0x002e
54 #define X10_UP          0x0067
55 #define X10_D           0x0020
56 #define X10_PROPS       0x0082
57 #define X10_LT          0x0069
58 #define X10_OK          0x0160
59 #define X10_RT          0x006a
60 #define X10_SCRN        0x0177
61 #define X10_E           0x0012
62 #define X10_DN          0x006c
63 #define X10_F           0x0021
64 #define X10_REW         0x00a8
65 #define X10_PLAY        0x00cf
66 #define X10_FWD         0x00d0
67 #define X10_REC         0x00a7
68 #define X10_STOP        0x00a6
69 #define X10_PAUSE       0x0077
70
71 // unknown keysyms
72 //#define X10_NEXT      0x0000
73 //#define X10_PREV      0x0000
74 //#define X10_INFO      0x0000
75 //#define X10_HOME      0x0000
76 //#define X10_END       0x0000
77 //#define X10_SELECT    0x0000
78
79 struct input_event;
80
81 class X10TV : public Thread
82 {
83 public:
84         X10TV(MWindow *mwindow, int *ifd, int nfds);
85         ~X10TV();
86
87         void stop();
88         void start();
89         static int open_usb_inputs(int vendor, int product, int &version,
90                         int *ifds, int nfds);
91         static X10TV *probe(MWindow *mwindow);
92         void run();
93         void handle_event(int fd);
94         int check_menu_keys(int code);
95         virtual int process_code() { return 1; }
96
97         MWindow *mwindow;
98         input_event *ev;
99         int done;
100         int *ifds, nfds;
101         int last_code, code;
102         fd_set rfds;
103         int mfd;
104 };
105
106 class X10TVCWindowHandler : public RemoteHandler
107 {
108 public:
109         X10TVCWindowHandler(X10TV *wintv, RemoteControl *remote_control);
110         int x10tv_process_code(int code);
111         int process_key(int key);
112         int is_x10tv() { return 1; }
113
114         X10TV *x10tv;
115 };
116
117 class X10TVRecordHandler : public RemoteHandler
118 {
119 public:
120         X10TVRecordHandler(X10TV *wintv, RemoteControl *remote_control);
121         int wintv_process_code(int code);
122         int process_key(int key);
123         int is_x10tv() { return 1; }
124
125         X10TV *x10tv;
126 };
127
128 #endif
129 #endif