4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef RECORDENGINE_H
23 #define RECORDENGINE_H
28 #include "audiodevice.inc"
29 #include "channel.inc"
31 #include "filexml.inc"
32 #include "mwindow.inc"
33 #include "playbackengine.inc"
35 #include "recordaudio.inc"
36 #include "recordvideo.inc"
37 #include "recordgui.inc"
38 #include "recordlabel.inc"
39 #include "recordthread.inc"
41 #include "videodevice.inc"
46 RecordEngine(MWindow *mwindow, Record *record);
57 RecordEngine(MWindow *mwindow,
61 RecordLabels *labels);
65 int set_gui(RecordGUI *gui);
66 long get_dc_offset(int offset);
67 int set_dc_offset(long new_offset, int number);
68 long get_dc_offset(long *dc_offset, RecordGUIDCOffsetText **dc_offset_text);
69 int run_script(FileXML *script);
71 // =================================== record operations
79 int start_saving(int duplex = 0);
80 int stop_saving(int no_monitor = 0);
88 int stop_preview(int no_monitor = 0);
90 int stop_operation(int no_monitor = 0);
95 int set_video_picture(); // Send the picture quality to the device
97 // Open device for recording
98 int open_input_devices(int duplex);
99 int close_input_devices();
100 // Open device for previewing
101 int open_output_devices();
102 int close_output_devices();
104 // ======================================= transport
106 int delete_all_labels();
107 int calibrate_dc_offset();
108 int calibrate_dc_offset(long new_value, int channel);
110 int update_position(long new_position);
111 int update_total_length(long new_length);
112 int update_prev_label(long new_label);
113 int update_next_label(long new_label);
115 int goto_prev_label();
116 int goto_next_label();
120 int set_done(int value);
122 RecordThread *monitor_thread;
123 RecordThread *record_thread;
124 PlaybackEngine *duplex_thread;
127 AudioDevice *adevice;
128 VideoDevice *vdevice;
131 RecordLabels *labels;
133 // For video synchronization when no audio thread
134 Timer monitor_timer, preview_timer, record_timer;
141 long current_position;
145 // =========================================== info
147 int mode_to_text(char *string, int mode);
148 int text_to_mode(char *string);
150 // Current sample depending on the operation
151 long absolute_monitor_position();
152 long absolute_preview_position();
153 long absolute_record_position();
155 ArrayList<char*>* get_video_inputs();
156 int change_channel(Channel *channel);
161 long get_loop_duration();
162 int set_loop_duration();
163 int get_duplex_status();
164 int set_duplex_status(int duplex_status);
165 int set_record_mode(char *text);
166 int set_monitor_video(int value);
167 int set_monitor_audio(int value);
168 int get_record_mode(char *text);
169 int get_record_mode();
171 int get_duplex_enable();
172 int get_input_channels();
173 int get_format(char *string);
174 int get_samplerate();
175 int get_time_format();
176 float get_frames_per_foot();
178 float get_frame_rate();
179 long get_current_position();
181 long get_current_delay();
182 long get_current_jumps();
183 int reset_current_delay();
184 int get_in_length(); // Length to read during record
185 int get_meter_over_hold(int divisions);
186 int get_meter_peak_hold(int divisions);
187 int get_meter_speed();
190 long jump_delay[JUMP_DELAYS], current_jump_jumps[JUMP_DELAYS];
191 int current_jump_delay, current_jump_jump;