fix delete_edit optimize segv, add dump submenu/dump_undo, add dbl edge drag/drop...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / transportque.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 TRANSPORTQUE_H
23 #define TRANSPORTQUE_H
24
25 #include "canvas.inc"
26 #include "condition.inc"
27 #include "edl.inc"
28 #include "preferences.inc"
29 #include "transportque.inc"
30
31 class TransportCommand
32 {
33 public:
34         TransportCommand();
35         ~TransportCommand();
36
37         void reset();
38         static int single_frame(int command);
39         int single_frame();
40 // Get the direction based on the command
41         static int get_direction(int command);
42         int get_direction();
43         static float get_speed(int command);
44         float get_speed();
45         void copy_from(TransportCommand *command);
46         TransportCommand& operator=(TransportCommand &command);
47 // Get the range to play back from the EDL
48         void set_playback_range(EDL *edl=0, int use_inout=0,
49                 int toggle_audio=0, int loop_play=0, int use_displacement=0);
50
51 // Adjust playback range with in/out points for rendering
52         void playback_range_adjust_inout();
53 // Set playback range to in/out points for rendering
54         void playback_range_inout();
55 // Set playback range to whole project for rendering
56         void playback_range_project();
57         void playback_range_1frame();
58
59         EDL* get_edl();
60         void delete_edl();
61         void new_edl();
62
63         int command;
64         int change_type;
65 // lowest numbered second in playback range
66         double start_position;
67 // highest numbered second in playback range
68         double end_position;
69         int infinite;
70 // Position used when starting playback
71         double playbackstart;
72 // start position at this=0/next=1 frame
73         int displacement;
74 // Send output to device
75         int realtime;
76 // Use persistant starting point
77         int resume;
78 // reverse audio duty
79         int audio_toggle;
80 // playback loop
81         int play_loop;
82 private:
83 // Copied to render engines
84         EDL *edl;
85 };
86
87 class TransportQue
88 {
89 public:
90         TransportQue();
91         ~TransportQue();
92
93         int send_command(int command,
94 // The change type is ORed to accumulate changes.
95                 int change_type, EDL *new_edl, int realtime,
96 // Persistent starting point
97                 int resume = 0, int use_inout = 0, int toggle_audio = 0,
98                 int loop_play = 0, int use_displacement = 0);
99         void update_change_type(int change_type);
100
101         TransportCommand command;
102         Condition *input_lock, *output_lock;
103 };
104
105 #endif