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