rework keyframe hide popup, keyframe auto render, textbox set_selection wide text
[goodguy/history.git] / cinelerra-5.1 / cinelerra / playtransport.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * 
6  * This program 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  * This program 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 this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  */
21
22 #ifndef PLAYTRANSPORT_H
23 #define PLAYTRANSPORT_H
24
25 #include "edl.inc"
26 #include "guicast.h"
27 #include "mwindow.inc"
28 #include "playbackengine.inc"
29 #include "playtransport.inc"
30
31 #define PLAY_MODE 0
32 #define PAUSE_MODE 1
33 #define PAUSEDOWN_MODE 2
34
35 class PlayTransport
36 {
37 public:
38         PlayTransport(MWindow *mwindow, BC_WindowBase *subwindow, int x, int y);
39         virtual ~PlayTransport();
40
41         void create_objects();
42         void reposition_buttons(int x, int y);
43
44         virtual void goto_start();
45         virtual void goto_end();
46
47 // Set the playback engine to control
48         void set_engine(PlaybackEngine *engine);
49         static int get_transport_width(MWindow *mwindow);
50         int flip_vertical(int vertical, int &x, int &y);
51         int keypress_event();
52 // Abstract TransportQue::send_command.
53 // wait_tracking - causes stop to wail until the final tracking position 
54 // is updated before returning
55 // use_inout - causes the in/out points to determine the beginning and end 
56 // of playback
57 // update_refresh - causes a frame advance to be issued after STOP to update
58 // the refresh frame.
59         void handle_transport(int command, 
60                 int wait_tracking = 0, 
61                 int use_inout = 0,
62                 int update_refresh = 1);
63
64         int pause_transport();
65         int reset_transport();
66         int get_w();
67 // Get the EDL to play back with default to mwindow->edl
68         virtual EDL* get_edl();
69         void change_position(double position);
70
71 // playback parameters
72         int reverse;
73         float speed;
74
75         PTransportButton *active_button;
76         PlayButton *forward_play;
77         FramePlayButton *frame_forward_play;
78         ReverseButton *reverse_play;
79         FrameReverseButton *frame_reverse_play;
80         FastReverseButton *fast_reverse;
81         FastPlayButton *fast_play;
82         RewindButton *rewind_button;
83         StopButton *stop_button;
84         EndButton *end_button;
85         MWindow *mwindow;
86         BC_WindowBase *subwindow;
87
88         PlaybackEngine *engine;
89         int using_inout, status;
90         int x, y;
91 };
92
93 // Should be toggle
94
95 class PTransportButton : public BC_Button
96 {
97 public:
98         PTransportButton(MWindow *mwindow, PlayTransport *transport, int x, int y, VFrame **data);
99         virtual ~PTransportButton();
100         virtual int set_mode(int mode);
101
102         int mode;
103         MWindow *mwindow;
104         PlayTransport *transport;
105 };
106
107 class RewindButton : public PTransportButton
108 {
109 public:
110         RewindButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
111         int handle_event();
112 };
113
114 class FastReverseButton : public PTransportButton
115 {
116 public:
117         FastReverseButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
118         int handle_event();
119 };
120
121 class ReverseButton : public PTransportButton
122 {
123 public:
124         ReverseButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
125         int handle_event();
126 };
127
128 class FrameReverseButton : public PTransportButton
129 {
130 public:
131         FrameReverseButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
132         int handle_event();
133 };
134
135 class PlayButton : public PTransportButton
136 {
137 public:
138         PlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
139         int handle_event();
140 };
141
142 class FramePlayButton : public PTransportButton
143 {
144 public:
145         FramePlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
146         int handle_event();
147 };
148
149 class FastPlayButton : public PTransportButton
150 {
151 public:
152         FastPlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
153         int handle_event();
154 };
155
156
157
158 class EndButton : public PTransportButton
159 {
160 public:
161         EndButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
162         int handle_event();
163 };
164
165 class StopButton : public PTransportButton
166 {
167 public:
168         StopButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
169         int handle_event();
170 };
171
172 #endif