bf0acbb905b0037c70d025168ef648e73dd131a9
[goodguy/history.git] / cinelerra-5.1 / cinelerra / edlsession.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008-2015 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 EDLSESSION_H
23 #define EDLSESSION_H
24
25 #include "autoconf.inc"
26 #include "bcwindowbase.inc"
27 #include "bchash.inc"
28 #include "edl.inc"
29 #include "filexml.inc"
30 #include "maxchannels.h"
31 #include "playbackconfig.inc"
32 #include "recordconfig.inc"
33
34
35 // Session shared between all clips
36
37
38 class EDLSession
39 {
40 public:
41         EDLSession(EDL *edl);
42         ~EDLSession();
43
44         int load_xml(FileXML *xml, int append_mode, uint32_t load_flags);
45         int save_xml(FileXML *xml);
46         int copy(EDLSession *session);
47         int load_audio_config(FileXML *file, int append_mode, uint32_t load_flags);
48         int save_audio_config(FileXML *xml);
49         int load_video_config(FileXML *file, int append_mode, uint32_t load_flags);
50         int save_video_config(FileXML *xml);
51         int load_defaults(BC_Hash *defaults);
52         int save_defaults(BC_Hash *defaults);
53         void boundaries();
54
55 //      PlaybackConfig* get_playback_config(int strategy, int head);
56 //      ArrayList<PlaybackConfig*>* get_playback_config(int strategy);
57 //      int get_playback_heads(int strategy);
58
59 // Called by PreferencesThread to determine if preference changes need to be
60 // rendered.
61         int need_rerender(EDLSession *ptr);
62 // Called by BRender to determine if any background rendered frames are valid.
63         void equivalent_output(EDLSession *session, double *result);
64         void dump();
65
66 // calculates the frame offset for programme timecode
67         int64_t get_frame_offset();
68
69 // Audio
70         int achannel_positions[MAXCHANNELS];
71 // AWindow format
72         int assetlist_format;
73 // AWindow column widths
74         int asset_columns[ASSET_COLUMNS];
75         AutoConf *auto_conf;
76 // Aspect ratio for video
77         float aspect_w;
78         float aspect_h;
79         int audio_channels;
80         int audio_tracks;
81 // automation follows edits during editing
82         int autos_follow_edits;
83 // Generate keyframes for every tweek
84         int auto_keyframes;
85 // Where to start background rendering
86         double brender_start;
87 // Length of clipboard if pasting
88         double clipboard_length;
89 // Colormodel for intermediate frames
90         int color_model;
91 // Interlace Mode for entire project
92         int interlace_mode;
93 // Coords for cropping operation
94         int crop_x1, crop_x2, crop_y1, crop_y2;
95 // radius of eyedropper
96         int eyedrop_radius;
97         float ruler_x1, ruler_y1;
98         float ruler_x2, ruler_y2;
99 // Ruler points relative to the output frame.
100 // Current folder in resource window
101         char current_folder[BCTEXTLEN];
102 // align cursor on frame boundaries
103         int cursor_on_frames;
104 // paste keyframes to any track type
105         int typeless_keyframes;
106 // Destination item for CWindow
107         int cwindow_dest;
108 // Current submask being edited in CWindow
109         int cwindow_mask;
110 // Use the cwindow or not
111         int cwindow_meter;
112 // CWindow tool currently selected
113         int cwindow_operation;
114 // Use scrollbars in the CWindow
115         int cwindow_scrollbars;
116 // Scrollbar positions
117         int cwindow_xscroll;
118         int cwindow_yscroll;
119         float cwindow_zoom;
120 // Transition
121         char default_atransition[BCTEXTLEN];
122         char default_vtransition[BCTEXTLEN];
123 // Length in seconds
124         double default_transition_length;
125 // Edit mode to use for each mouse button
126         int edit_handle_mode[3];
127 // Editing mode
128         int editing_mode;
129         EDL *edl;
130         int enable_duplex;
131 // AWindow format
132         int folderlist_format;
133         double frame_rate;
134         float frames_per_foot;
135 // Number of highlighted track
136         int highlighted_track;
137 // Enumeration for how to scale from edl.inc.
138         int interpolation_type;
139 // Whether to interpolate CR2 images
140         int interpolate_raw;
141 // Whether to white balance CR2 images
142         int white_balance_raw;
143 // labels follow edits during editing
144         int labels_follow_edits;
145         int mpeg4_deblock;
146         int plugins_follow_edits;
147 // For main menu plugin attaching, 
148 // // attach 1 standalone on the first track and share it with other tracks
149         int single_standalone;
150         int meter_format;
151         int min_meter_db;
152         int max_meter_db;
153         int output_w;
154         int output_h;
155         int64_t playback_buffer;
156         int playback_cursor_visible;
157         int64_t playback_preload;
158         int decode_subtitles;
159         int subtitle_number;
160         int label_cells;
161         int program_no;
162         int playback_software_position;
163 //      int playback_strategy;
164 // Play audio in realtime priority
165         int real_time_playback;
166         int real_time_record;
167 // Use record positioning selection
168         int record_positioning;
169 // Record undecoded stream data
170         int record_raw_stream;
171 // Sync the drives during recording
172         int record_sync_drives;
173 // Speed of meters when recording
174         int record_speed;
175 // Samples to read from device at a time
176         int record_fragment_size;
177 // Samples to write to disk at a time
178         int64_t record_write_length;
179 // Realtime TOC generation for DVB mpeg recording
180         int record_realtime_toc;
181 // Show title and action safe regions in CWindow
182         int safe_regions;
183         int64_t sample_rate;
184         float scrub_speed;
185 // Load files as a duration
186         int si_useduration;
187         float si_duration;
188 // Show assets in track canvas
189         int show_assets;
190 // Show titles in resources
191         int show_titles;
192 // Test for data before rendering a track
193         int test_playback_edits;
194 // Format to display times in
195         int time_format;
196 // Offset for timecode
197         int timecode_offset[4];
198 // Format to display nudge in, either seconds or track units.
199         int nudge_format;
200 // Show tool window in CWindow
201         int tool_window;
202 // Location of video outs
203         int vchannel_x[MAXCHANNELS];
204         int vchannel_y[MAXCHANNELS];
205 // Recording
206         int video_channels;
207         VideoInConfig *vconfig_in;
208         AudioInConfig *aconfig_in;
209         Asset *recording_format;
210 // play every frame
211         int video_every_frame;
212 // decode video asynchronously
213         int video_asynchronous;
214         int video_tracks;
215 // number of frames to write to disk at a time during video recording.
216         int video_write_length;
217         int view_follows_playback;
218 // Use the vwindow meter or not
219         int vwindow_meter;
220         float vwindow_zoom;
221
222 // Global ID counter
223         static int current_id;
224         PlaybackConfig* playback_config;
225
226 private:
227 // Global playback.  This is loaded from defaults but not from XML probably
228 // because it was discovered to be the most convenient.
229 // It is part of the EDL probably because the playback setting was
230 // going to be bound to the EDL.
231 //      ArrayList<PlaybackConfig*> playback_config[PLAYBACK_STRATEGIES];
232 };
233
234
235 #endif