6 #include "audiodevice.inc"
8 #include "channeldb.inc"
10 #include "bitspopup.h"
11 #include "browsebutton.h"
12 #include "channel.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 // is_monitor - set by caller to make sure the caller is the same one
69 // that opened the device.
70 int close_input_devices(int is_monitor
);
71 void start_file_threads();
72 int start_recording(int duplex
,
73 int context
/* = CONTEXT_INTERACTIVE */);
78 // no_monitor causes the monitor not to be resumed after the operation
79 int stop_operation(int resume_monitor
);
81 void stop_file_threads();
84 int set_video_picture();
85 // Set screencapture translation
86 void set_translation(int x
, int y
);
88 // Set the channel in the current batch and the picture controls
89 int set_channel(int channel
);
90 void set_channel(Channel
*channel
);
94 // Set values in batch structures
95 void configure_batches();
96 void source_to_text(char *string
, Batch
*batch
);
97 // Create first file in batch
98 int open_output_file();
99 // Delete the output file for overwrite if it exists.
100 int delete_output_file();
101 // Create next file in batch
102 int init_next_file();
104 // Get the inputs supported by the device
105 ArrayList
<Channel
*>* get_video_inputs();
107 // Copied to each batch for the files
108 Asset_GC default_asset
;
109 ArrayList
<Batch
*> batches
;
110 // How to combine the batches with the project
116 int video_window_open
;
117 // Prompt before cancel
119 // Compression is fixed by the driver
120 int fixed_compression
;
121 // Current batch being recorded to
123 // Current batch being edited. Don't want to interrupt recording to edit a different 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_GC
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
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
;
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
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
179 // State of the capturing operation
181 // Translation of screencapture input
185 // Reverse the interlace in the video window display only
186 int reverse_interlace
;
187 // Color model for uncompressed device interface
189 // Picture quality and parameters the device supports
190 PictureConfig
*picture
;
191 // Fill dropped frames with duplicates
193 // Parameters for video monitor
213 // Number of channeldb entry
217 RecordMenuItem
*menu_item
;
219 int set_script(FileXML
*script
);
220 int run_script(Asset_GC asset
, int &do_audio
, int &do_video
);
221 int save_engine_defaults();
224 int get_samplerate();
225 float get_framerate();
226 int get_everyframe();
227 int get_time_format();
229 float get_frame_rate();
231 char* get_video_inpath();
232 int get_video_driver();
235 int set_rec_mode(int value
);
236 int set_loop_duration(int64_t value
);
237 int use_floatingpoint();
239 int get_out_length(); // Length to write during playback
240 int64_t get_out_buffersize(); // Same as get_out_length
241 int get_software_positioning();
242 int64_t get_in_buffersize(); // Length to write to disk at a time
243 int get_video_buffersize(); // Number of frames to write to disk at a time
244 int get_video_capturesize(); // Number of frames to read from device at a time
245 int get_meter_over_hold(int divisions
);
246 int get_meter_peak_hold(int divisions
);
247 int get_meter_speed();
249 int64_t get_playback_buffer();
254 int64_t loop_duration
;
255 int64_t startsource_sample
; // start in source file of this recording
256 int64_t endsource_sample
;
257 int64_t startsource_frame
;
258 int64_t endsource_frame
;
259 int64_t dc_offset
[MAXCHANNELS
];
264 int video_window_w
; // Width of record video window
273 // c-file-style: "linux"