5 #include "audiodevice.inc"
9 #include "browsebutton.h"
10 #include "channel.inc"
11 #include "defaults.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"
22 #include "playbackengine.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"
33 class RecordMenuItem
: public BC_MenuItem
36 RecordMenuItem(MWindow
*mwindow
);
43 // State of recording dialog
47 class Record
: public Thread
50 Record(MWindow
*mwindow
, RecordMenuItem
*menu_item
);
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 */);
73 // no_monitor causes the monitor not to be resumed after the operation
74 int stop_operation(int resume_monitor
);
76 void stop_file_threads();
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
);
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
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
110 int video_window_open
;
111 // Prompt before cancel
113 // Compression is fixed by the driver
114 int fixed_compression
;
115 // Current batch being recorded to
117 // Current batch being edited. Don't want to interrupt recording to edit a different 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
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
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
167 // State of the capturing operation
169 // Translation of screencapture input
173 int reverse_interlace
; // Reverse the interlace in the video window display only
174 // Color model for uncompressed device interface
177 int video_brightness
;
182 // Fill dropped frames with duplicates
184 // Parameters for video monitor
204 // Number of channeldb entry
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();
215 int get_samplerate();
216 float get_framerate();
217 int get_everyframe();
218 int get_time_format();
220 float get_frame_rate();
222 char* get_video_inpath();
223 int get_video_driver();
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();
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
];
255 int video_window_w
; // Width of record video window