initial commit
[goodguy/history.git] / cinelerra-5.0 / 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 // Get the direction based on the command
39         int get_direction();
40         float get_speed();
41         void copy_from(TransportCommand *command);
42         TransportCommand& operator=(TransportCommand &command);
43 // Get the range to play back from the EDL
44         void set_playback_range(EDL *edl = 0, int use_inout = 0);
45
46 // Adjust playback range with in/out points for rendering
47         void adjust_playback_range();
48
49         int single_frame();
50         EDL* get_edl();
51         void delete_edl();
52         void new_edl();
53
54         int command;
55         int change_type;
56 // lowest numbered second in playback range
57         double start_position;
58 // highest numbered second in playback range
59         double end_position;
60         int infinite;
61 // Position used when starting playback
62         double playbackstart;
63 // Send output to device
64         int realtime;
65 // Use persistant starting point
66         int resume;
67
68 private:
69 // Copied to render engines
70         EDL *edl;
71 };
72
73 class TransportQue
74 {
75 public:
76         TransportQue();
77         ~TransportQue();
78
79         int send_command(int command, 
80 // The change type is ORed to accumulate changes.
81                 int change_type, 
82                 EDL *new_edl,
83                 int realtime,
84 // Persistent starting point
85                 int resume = 0,
86                 int use_inout = 0);
87         void update_change_type(int change_type);
88
89         TransportCommand command;
90         Condition *input_lock, *output_lock;
91 };
92
93 #endif