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