6 #include "audiodevice.inc"
8 #include "channeldb.inc"
10 #include "bitspopup.h"
11 #include "browsebutton.h"
12 #include "channel.inc"
13 #include "defaults.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"
26 #include "recordengine.inc"
27 #include "recordgui.inc"
28 #include "recordmonitor.inc"
29 #include "recordthread.inc"
30 #include "recordwindow.inc"
31 #include "videodevice.inc"
35 class RecordMenuItem
: public BC_MenuItem
38 RecordMenuItem(MWindow
*mwindow
);
45 // State of recording dialog
49 class Record
: public Thread
52 Record(MWindow
*mwindow
, RecordMenuItem
*menu_item
);
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
,
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 */);
76 // no_monitor causes the monitor not to be resumed after the operation
77 int stop_operation(int resume_monitor
);
79 void stop_file_threads();
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
);
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
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
115 int video_window_open
;
116 // Prompt before cancel
118 // Compression is fixed by the driver
119 int fixed_compression
;
120 // Current batch being recorded to
122 // Current batch being edited. Don't want to interrupt recording to edit a different 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
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
;
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
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
178 // State of the capturing operation
180 // Translation of screencapture input
184 int reverse_interlace
; // Reverse the interlace in the video window display only
185 // Color model for uncompressed device interface
187 // Picture quality and parameters the device supports
189 // Fill dropped frames with duplicates
191 // Parameters for video monitor
211 // Number of channeldb entry
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();
222 int get_samplerate();
223 float get_framerate();
224 int get_everyframe();
225 int get_time_format();
227 float get_frame_rate();
229 char* get_video_inpath();
230 int get_video_driver();
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();
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
];
262 int video_window_w
; // Width of record video window