4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #ifndef PLAYTRANSPORT_H
23 #define PLAYTRANSPORT_H
27 #include "mwindow.inc"
28 #include "playbackengine.inc"
29 #include "playtransport.inc"
37 PlayTransport(MWindow *mwindow, BC_WindowBase *subwindow, int x, int y);
38 virtual ~PlayTransport();
40 void create_objects();
41 void reposition_buttons(int x, int y);
43 virtual void goto_start();
44 virtual void goto_end();
46 // Set the playback engine to control
47 void set_engine(PlaybackEngine *engine);
48 static int get_transport_width(MWindow *mwindow);
49 int flip_vertical(int vertical, int &x, int &y);
51 int do_keypress(int key);
52 // Abstract transport 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
57 // update_refresh - causes a frame advance to be issued after STOP to update
59 // toggle_audio - reverses audio playback enable in RenderEngine::get_duty
60 // loop_play - sets play_loop and plays btwn start/end position (in a loop)
61 // speed - play speed for SLOW/FAST playback, zero defaults to slow=.5,fast=2.
62 void handle_transport(int command, int wait_tracking=0,
63 int use_inout=0, int toggle_audio=0, int loop_play=0, float speed=0);
64 int set_transport(int mode);
67 // Get the EDL to play back with default to mwindow->edl
68 virtual EDL* get_edl();
69 void change_position(double position);
70 virtual bool use_mixers() { return false; }
72 // playback parameters
76 PTransportButton *active_button;
77 PlayButton *forward_play;
78 FramePlayButton *frame_forward_play;
79 ReverseButton *reverse_play;
80 FrameReverseButton *frame_reverse_play;
81 FastReverseButton *fast_reverse;
82 FastPlayButton *fast_play;
83 RewindButton *rewind_button;
84 StopButton *stop_button;
85 EndButton *end_button;
87 BC_WindowBase *subwindow;
89 PlaybackEngine *engine;
90 int using_inout, status;
96 class PTransportButton : public BC_Button
99 PTransportButton(MWindow *mwindow, PlayTransport *transport, int x, int y, VFrame **data);
100 virtual ~PTransportButton();
101 void set_mode(int mode);
102 void loop_mode(int dir);
103 int play_command(const char *lock_msg, int command);
107 PlayTransport *transport;
110 class RewindButton : public PTransportButton
113 RewindButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
117 class FastReverseButton : public PTransportButton
120 FastReverseButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
124 class ReverseButton : public PTransportButton
127 ReverseButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
131 class FrameReverseButton : public PTransportButton
134 FrameReverseButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
138 class PlayButton : public PTransportButton
141 PlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
145 class FramePlayButton : public PTransportButton
148 FramePlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
152 class FastPlayButton : public PTransportButton
155 FastPlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
161 class EndButton : public PTransportButton
164 EndButton(MWindow *mwindow, PlayTransport *transport, int x, int y);
168 class StopButton : public PTransportButton
171 StopButton(MWindow *mwindow, PlayTransport *transport, int x, int y);