Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / cinelerra / playtransport.h
bloba7000087674347566187fd093e2ee2c156ec8f23
1 #ifndef PLAYTRANSPORT_H
2 #define PLAYTRANSPORT_H
4 #include "edl.inc"
5 #include "guicast.h"
6 #include "mwindow.inc"
7 #include "playbackengine.inc"
8 #include "playtransport.inc"
10 #define PLAY_MODE 0
11 #define PAUSE_MODE 1
12 #define PAUSEDOWN_MODE 2
14 class PlayTransport
16 public:
17 PlayTransport(MWindow *mwindow, BC_WindowBase *subwindow, int x, int y);
18 ~PlayTransport();
20 int create_objects();
21 void reposition_buttons(int x, int y);
23 virtual void goto_start();
24 virtual void goto_end();
25 // Set a slider to control if there is one
26 void set_slider(BC_Slider *slider);
27 // Set the playback engine to control
28 void set_engine(PlaybackEngine *engine);
29 static int get_transport_width(MWindow *mwindow);
30 int flip_vertical(int vertical, int &x, int &y);
31 int keypress_event();
32 // Abstract TransportQue::send_command.
33 // wait_tracking - causes stop to wail until the final tracking position
34 // is updated before returning
35 // use_inout - causes the in/out points to determine the beginning and end
36 // of playback
37 // update_refresh - causes a frame advance to be issued after STOP to update
38 // the refresh frame.
39 void handle_transport(int command,
40 int wait_tracking = 0,
41 int use_inout = 0,
42 int update_refresh = 1);
44 int pause_transport();
45 int reset_transport();
46 int get_w();
47 // Get the EDL to play back with default to mwindow->edl
48 virtual EDL* get_edl();
50 // playback parameters
51 int reverse;
52 float speed;
54 PTransportButton *active_button;
55 PlayButton *forward_play;
56 FramePlayButton *frame_forward_play;
57 ReverseButton *reverse_play;
58 FrameReverseButton *frame_reverse_play;
59 FastReverseButton *fast_reverse;
60 FastPlayButton *fast_play;
61 RewindButton *rewind_button;
62 StopButton *stop_button;
63 EndButton *end_button;
64 MWindow *mwindow;
65 BC_WindowBase *subwindow;
66 BC_Slider *slider;
67 PlaybackEngine *engine;
68 int status;
69 int x, y;
72 // Should be toggle
74 class PTransportButton : public BC_Button
76 public:
77 PTransportButton(MWindow *mwindow, PlayTransport *transport, int x, int y, VFrame **data);
78 virtual ~PTransportButton();
79 virtual int set_mode(int mode);
81 int mode;
82 MWindow *mwindow;
83 PlayTransport *transport;
86 class RewindButton : public PTransportButton
88 public:
89 RewindButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
90 int handle_event();
93 class FastReverseButton : public PTransportButton
95 public:
96 FastReverseButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
97 int handle_event();
100 class ReverseButton : public PTransportButton
102 public:
103 ReverseButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
104 int handle_event();
107 class FrameReverseButton : public PTransportButton
109 public:
110 FrameReverseButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
111 int handle_event();
114 class PlayButton : public PTransportButton
116 public:
117 PlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
118 int handle_event();
121 class FramePlayButton : public PTransportButton
123 public:
124 FramePlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
125 int handle_event();
128 class FastPlayButton : public PTransportButton
130 public:
131 FastPlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
132 int handle_event();
137 class EndButton : public PTransportButton
139 public:
140 EndButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
141 int handle_event();
144 class StopButton : public PTransportButton
146 public:
147 StopButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
148 int handle_event();
151 #endif
153 // Local Variables:
154 // mode: C++
155 // c-file-style: "linux"
156 // End: