r370: Heroine Virutal's official release 1.2.1
[cinelerra_cv/mob.git] / hvirtual / cinelerra / record.h
blobbb9b7889d41fa7d2862e36466f2969dd732fb01e
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);
90 void toggle_label();
91 // Set values in batch structures
92 void configure_batches();
93 void source_to_text(char *string, Batch *batch);
94 // Create first file in batch
95 int open_output_file();
96 // Delete the output file for overwrite if it exists.
97 int delete_output_file();
98 // Create next file in batch
99 int init_next_file();
100 void rewind_file();
101 // Get the inputs supported by the device
102 ArrayList<Channel*>* get_video_inputs();
103 // Don't write to the returned string.
104 char* get_channeldb_prefix();
106 // Copied to each batch for the files
107 Asset *default_asset;
108 ArrayList<Batch*> batches;
109 // How to combine the batches with the project
110 int load_mode;
111 int do_audio;
112 int do_video;
113 int monitor_audio;
114 int monitor_video;
115 int video_window_open;
116 // Prompt before cancel
117 int prompt_cancel;
118 // Compression is fixed by the driver
119 int fixed_compression;
120 // Current batch being recorded to
121 int current_batch;
122 // Current batch being edited. Don't want to interrupt recording to edit a different batch.
123 int editing_batch;
124 // Get next batch using activation or -1
125 int get_next_batch();
126 // Information about the current batch.
127 Batch* get_current_batch();
128 // Information about the batch being edited
129 Batch* get_editing_batch();
130 char* current_mode();
131 char* current_source();
132 int get_current_channel();
133 int get_editing_channel();
134 void get_current_time(double &seconds, int &day);
135 Channel* get_current_channel_struct();
136 char* current_news();
137 double* current_start();
138 double* current_duration();
139 Asset* current_asset();
140 int* current_offset_type();
141 // Total number of samples since record sequence started
142 int64_t sync_position();
143 // Current position for GUI relative to batch
144 double current_display_position();
145 int64_t current_audio_position();
146 int64_t current_duration_samples();
147 int64_t current_video_position();
148 int64_t current_duration_frames();
149 // Number of frames between the current file and the start of the batch
150 int64_t batch_video_offset();
151 // Rewind the current file in the current batch
152 void start_over();
155 // User defined TV stations and inputs to record from.
156 ChannelDB *channeldb;
157 // Structure which stores what parameters the device supports
158 Channel *master_channel;
161 LoadMode *loadmode;
162 MWindow *mwindow;
163 RecordGUI *record_gui;
164 RecordMonitor *record_monitor;
165 RecordThread *monitor_engine;
166 RecordThread *record_engine;
167 AudioDevice *adevice;
168 VideoDevice *vdevice;
169 // File handle of last asset.in current batch
170 File *file;
172 PlaybackEngine *duplex_engine;
173 RecordWindow *record_window;
174 // Table for LML conversion
175 // unsigned char _601_to_rgb_table[256];
176 // For video synchronization when no audio thread
177 Timer monitor_timer;
178 // State of the capturing operation
179 int capture_state;
180 // Translation of screencapture input
181 int video_x;
182 int video_y;
183 float video_zoom;
184 int reverse_interlace; // Reverse the interlace in the video window display only
185 // Color model for uncompressed device interface
186 int color_model;
187 // Picture quality and parameters the device supports
188 Picture *picture;
189 // Fill dropped frames with duplicates
190 int fill_frames;
191 // Parameters for video monitor
192 EDL *edl;
193 Mutex *window_lock;
211 // Number of channeldb entry
212 int current_channel;
214 FileXML *script;
215 RecordMenuItem *menu_item;
217 int set_script(FileXML *script);
218 int run_script(Asset *asset, int &do_audio, int &do_video);
219 int save_engine_defaults();
221 float get_min_db();
222 int get_samplerate();
223 float get_framerate();
224 int get_everyframe();
225 int get_time_format();
226 int get_realtime();
227 float get_frame_rate();
228 char* get_in_path();
229 char* get_video_inpath();
230 int get_video_driver();
231 int get_vu_format();
232 int get_rec_mode();
233 int set_rec_mode(int value);
234 int set_loop_duration(int64_t value);
235 int use_floatingpoint();
237 int get_out_length(); // Length to write during playback
238 int64_t get_out_buffersize(); // Same as get_out_length
239 int get_software_positioning();
240 int64_t get_in_buffersize(); // Length to write to disk at a time
241 int get_video_buffersize(); // Number of frames to write to disk at a time
242 int get_video_capturesize(); // Number of frames to read from device at a time
243 int get_meter_over_hold(int divisions);
244 int get_meter_peak_hold(int divisions);
245 int get_meter_speed();
247 int64_t get_playback_buffer();
248 int enable_duplex();
250 int realtime;
251 int to_tracks;
252 int64_t loop_duration;
253 int64_t startsource_sample; // start in source file of this recording
254 int64_t endsource_sample;
255 int64_t startsource_frame;
256 int64_t endsource_frame;
257 int64_t dc_offset[MAXCHANNELS];
258 int append_to_file;
259 int record_mode;
260 int frame_w;
261 int frame_h;
262 int video_window_w; // Width of record video window
263 int cpus;
267 #endif