add Autosave continuous backups by Andras Reuss and Andrew-R
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / remotecontrol.h
1 #ifndef _REMOTECONTROL_H_
2 #define _REMOTECONTROL_H_
3
4 #include "bcpopup.h"
5 #include "bcwindow.h"
6 #include "mutex.h"
7 #include "mwindowgui.inc"
8 #include "thread.h"
9
10 class RemoteControl;
11 class RemoteGUI;
12 class RemoteHandler;
13 class RemoteWindow;
14
15 class RemoteGUI : public BC_Popup
16 {
17 public:
18         RemoteControl *remote_control;
19
20         void set_active(RemoteHandler *handler);
21         void set_inactive();
22         void fill_color(int color);
23         void tile_windows(int config);
24         int button_press_event();
25         int keypress_event();
26         int process_key(int key);
27
28         RemoteGUI(BC_WindowBase *wdw, RemoteControl *remote_control);
29         ~RemoteGUI();
30 };
31
32 class RemoteWindow : public BC_Window
33 {
34 public:
35         RemoteControl *remote_control;
36
37          RemoteWindow(RemoteControl *remote_control);
38          ~RemoteWindow();
39 };
40
41 class RemoteHandler
42 {
43 public:
44         RemoteGUI *gui;
45         int color;
46
47         void activate() { gui->set_active(this); }
48         virtual int remote_key(int key);
49         virtual int process_key(int key);
50
51         virtual int is_keytv() { return 0; }
52         virtual int is_wintv() { return 0; }
53         virtual int is_x10tv() { return 0; }
54
55         RemoteHandler(RemoteGUI *gui, int color);
56         virtual ~RemoteHandler();
57 };
58
59 class RemoteControl : Thread {
60 public:
61         MWindowGUI *mwindow_gui;
62         RemoteWindow *remote_window;
63         RemoteGUI *gui;
64         RemoteHandler *handler;
65         Mutex *active_lock;
66
67         void run();
68         void set_color(int color);
69         void fill_color(int color);
70         int remote_key(int key);
71
72         int activate(RemoteHandler *handler=0);
73         int deactivate();
74         bool is_active() { return handler != 0; }
75
76         RemoteControl(MWindowGUI *gui);
77         ~RemoteControl();
78 };
79
80 #endif