no longer need ffmpeg patch0 which was for Termux
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / wintv.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 __WINTV_H__
22 #define __WINTV_H__
23 // as of 2020/01/06 using kernel version 5.3.16
24 //  a patch is needed for: drivers/media/usb/em28xx/em28xx-rc.ko
25 //  prototype in thirdparty/src/em28xx-input.patch1
26 //#define HAVE_WINTV
27 #ifdef HAVE_WINTV
28
29 #include "remotecontrol.h"
30 #include "thread.h"
31
32 #define WTV_OK          0x0160
33 #define WTV_LT          0x0069
34 #define WTV_UP          0x0067
35 #define WTV_RT          0x006a
36 #define WTV_DN          0x006c
37 #define WTV_HOME        0x0162
38 #define WTV_BACK        0x00ae
39 #define WTV_MENU        0x008b
40 #define WTV_TV          0x0179
41 #define WTV_POWER       0x0074
42 #define WTV_VOLUP       0x0073
43 #define WTV_VOLDN       0x0072
44 #define WTV_CH_UP       0x0192
45 #define WTV_CH_DN       0x0193
46 #define WTV_1           0x0201
47 #define WTV_2           0x0202
48 #define WTV_3           0x0203
49 #define WTV_4           0x0204
50 #define WTV_5           0x0205
51 #define WTV_6           0x0206
52 #define WTV_7           0x0207
53 #define WTV_8           0x0208
54 #define WTV_9           0x0209
55 #define WTV_TEXT        0x0184
56 #define WTV_0           0x0200
57 #define WTV_CC          0x0172
58 #define WTV_BOX         0x0080
59 #define WTV_START       0x0195
60 #define WTV_REV         0x00a8
61 #define WTV_STOP        0x0077
62 #define WTV_PLAY        0x00cf
63 #define WTV_FWD         0x00d0
64 #define WTV_END         0x0197
65 #define WTV_MUTE        0x0071
66 #define WTV_PREV        0x019c
67 #define WTV_RED         0x00a7
68
69 struct input_event;
70
71 class WinTV : public Thread
72 {
73 public:
74         WinTV(MWindow *mwindow, int ifd);
75         ~WinTV();
76
77         void stop();
78         void start();
79         static int open_usb_input(int vendor, int product, int &version);
80         static WinTV *probe(MWindow *mwindow);
81         void run();
82         void handle_event();
83         int check_menu_keys(int code);
84         virtual int process_code() { return 1; }
85
86         MWindow *mwindow;
87         input_event *ev;
88         int done, ifd;
89         int last_code, code;
90 };
91
92 class WinTVCWindowHandler : public RemoteHandler
93 {
94 public:
95         WinTVCWindowHandler(WinTV *wintv, RemoteControl *remote_control);
96         int wintv_process_code(int code);
97         int process_key(int key);
98         int is_wintv() { return 1; }
99
100         WinTV *wintv;
101 };
102
103 class WinTVRecordHandler : public RemoteHandler
104 {
105 public:
106         WinTVRecordHandler(WinTV *wintv, RemoteControl *remote_control);
107         int wintv_process_code(int code);
108         int process_key(int key);
109         int is_wintv() { return 1; }
110
111         WinTV *wintv;
112 };
113
114 #endif
115 #endif