r668: Configure.in and autogen.sh cleanup based on ideas by giskard.
[cinelerra_cv.git] / cinelerra / record.h
blob00f4221f72a434e2c1d09b4b009f69b4ab5291d7
1 #ifndef RECORD_H
2 #define RECORD_H
4 #include "asset.inc"
5 #include "assets.inc"
6 #include "audiodevice.inc"
7 #include "batch.inc"
8 #include "channeldb.inc"
9 #include "guicast.h"
10 #include "bitspopup.h"
11 #include "browsebutton.h"
12 #include "channel.inc"
13 #include "defaults.inc"
14 #include "edl.inc"
15 #include "file.inc"
16 #include "filexml.inc"
17 #include "filethread.inc"
18 #include "formatpopup.h"
19 #include "formattools.inc"
20 #include "loadmode.inc"
21 #include "mwindow.inc"
22 #include "maxchannels.h"
23 #include "picture.inc"
24 #include "playbackengine.inc"
25 #include "record.inc"
26 #include "recordengine.inc"
27 #include "recordgui.inc"
28 #include "recordmonitor.inc"
29 #include "recordthread.inc"
30 #include "recordwindow.inc"
31 #include "videodevice.inc"
33 class Record;
35 class RecordMenuItem : public BC_MenuItem
37 public:
38 RecordMenuItem(MWindow *mwindow);
39 ~RecordMenuItem();
41 int handle_event();
43 Record *thread;
44 MWindow *mwindow;
45 // State of recording dialog
46 int current_state;
49 class Record : public Thread
51 public:
52 Record(MWindow *mwindow, RecordMenuItem *menu_item);
53 ~Record();
55 void run();
56 int load_defaults();
57 int save_defaults();
58 Batch* new_batch();
59 void delete_batch();
60 void activate_batch(int number, int stop_operation);
61 void change_editing_batch(int number);
62 void close_output_file();
63 void delete_batch(int number);
64 void swap_batches(int number1, int number2);
65 void get_audio_write_length(int &buffer_size,
66 int &fragment_size);
67 int open_input_devices(int duplex, int context);
68 int close_input_devices();
69 void start_file_threads();
70 int start_recording(int duplex,
71 int context /* = CONTEXT_INTERACTIVE */);
72 int record_frame();
73 int start_monitor();
74 int pause_monitor();
75 int resume_monitor();
76 // no_monitor causes the monitor not to be resumed after the operation
77 int stop_operation(int resume_monitor);
78 int stop_duplex();
79 void stop_file_threads();
80 int stop_monitor();
81 int get_in_length();
82 int set_video_picture();
83 // Set screencapture translation
84 void set_translation(int x, int y);
86 // Set the channel in the current batch and the picture controls
87 int set_channel(int channel);
88 void set_channel(Channel *channel);
89 int has_signal();
91 void toggle_label();
92 // Set values in batch structures
93 void configure_batches();
94 void source_to_text(char *string, Batch *batch);
95 // Create first file in batch
96 int open_output_file();
97 // Delete the output file for overwrite if it exists.
98 int delete_output_file();
99 // Create next file in batch
100 int init_next_file();
101 void rewind_file();
102 // Get the inputs supported by the device
103 ArrayList<Channel*>* get_video_inputs();
104 // Don't write to the returned string.
105 char* get_channeldb_prefix();
107 // Copied to each batch for the files
108 Asset *default_asset;
109 ArrayList<Batch*> batches;
110 // How to combine the batches with the project
111 int load_mode;
112 int do_audio;
113 int do_video;
114 int monitor_audio;
115 int monitor_video;
116 int video_window_open;
117 // Prompt before cancel
118 int prompt_cancel;
119 // Compression is fixed by the driver
120 int fixed_compression;
121 // Current batch being recorded to
122 int current_batch;
123 // Current batch being edited. Don't want to interrupt recording to edit a different batch.
124 int editing_batch;
125 // Get next batch using activation or -1
126 int get_next_batch();
127 // Information about the current batch.
128 Batch* get_current_batch();
129 // Information about the batch being edited
130 Batch* get_editing_batch();
131 char* current_mode();
132 char* current_source();
133 int get_current_channel();
134 int get_editing_channel();
135 void get_current_time(double &seconds, int &day);
136 Channel* get_current_channel_struct();
137 char* current_news();
138 double* current_start();
139 double* current_duration();
140 Asset* current_asset();
141 int* current_offset_type();
142 // Total number of samples since record sequence started
143 int64_t sync_position();
144 // Current position for GUI relative to batch
145 double current_display_position();
146 int64_t current_audio_position();
147 int64_t current_duration_samples();
148 int64_t current_video_position();
149 int64_t current_duration_frames();
150 // Number of frames between the current file and the start of the batch
151 int64_t batch_video_offset();
152 // Rewind the current file in the current batch
153 void start_over();
156 // User defined TV stations and inputs to record from.
157 ChannelDB *channeldb;
158 // Structure which stores what parameters the device supports
159 Channel *master_channel;
162 LoadMode *loadmode;
163 MWindow *mwindow;
164 RecordGUI *record_gui;
165 RecordMonitor *record_monitor;
166 RecordThread *monitor_engine;
167 RecordThread *record_engine;
168 AudioDevice *adevice;
169 VideoDevice *vdevice;
170 // File handle of last asset.in current batch
171 File *file;
173 PlaybackEngine *duplex_engine;
174 RecordWindow *record_window;
175 // Table for LML conversion
176 // unsigned char _601_to_rgb_table[256];
177 // For video synchronization when no audio thread
178 Timer monitor_timer;
179 // State of the capturing operation
180 int capture_state;
181 // Translation of screencapture input
182 int video_x;
183 int video_y;
184 float video_zoom;
185 int reverse_interlace; // Reverse the interlace in the video window display only
186 // Color model for uncompressed device interface
187 int color_model;
188 // Picture quality and parameters the device supports
189 PictureConfig *picture;
190 // Fill dropped frames with duplicates
191 int fill_frames;
192 // Parameters for video monitor
193 EDL *edl;
194 Mutex *window_lock;
212 // Number of channeldb entry
213 int current_channel;
215 FileXML *script;
216 RecordMenuItem *menu_item;
218 int set_script(FileXML *script);
219 int run_script(Asset *asset, int &do_audio, int &do_video);
220 int save_engine_defaults();
222 float get_min_db();
223 int get_samplerate();
224 float get_framerate();
225 int get_everyframe();
226 int get_time_format();
227 int get_realtime();
228 float get_frame_rate();
229 char* get_in_path();
230 char* get_video_inpath();
231 int get_video_driver();
232 int get_vu_format();
233 int get_rec_mode();
234 int set_rec_mode(int value);
235 int set_loop_duration(int64_t value);
236 int use_floatingpoint();
238 int get_out_length(); // Length to write during playback
239 int64_t get_out_buffersize(); // Same as get_out_length
240 int get_software_positioning();
241 int64_t get_in_buffersize(); // Length to write to disk at a time
242 int get_video_buffersize(); // Number of frames to write to disk at a time
243 int get_video_capturesize(); // Number of frames to read from device at a time
244 int get_meter_over_hold(int divisions);
245 int get_meter_peak_hold(int divisions);
246 int get_meter_speed();
248 int64_t get_playback_buffer();
249 int enable_duplex();
251 int realtime;
252 int to_tracks;
253 int64_t loop_duration;
254 int64_t startsource_sample; // start in source file of this recording
255 int64_t endsource_sample;
256 int64_t startsource_frame;
257 int64_t endsource_frame;
258 int64_t dc_offset[MAXCHANNELS];
259 int append_to_file;
260 int record_mode;
261 int frame_w;
262 int frame_h;
263 int video_window_w; // Width of record video window
264 int cpus;
268 #endif