r956: README.BUILD - add more library recommendations
[cinelerra_cv/ct.git] / cinelerra / recordengine.h
blob12bb87afd787e46c20e6eccbd1131d051ee859d5
1 #ifndef RECORDENGINE_H
2 #define RECORDENGINE_H
4 #define JUMP_DELAYS 5
6 #include "assets.inc"
7 #include "audiodevice.inc"
8 #include "channel.inc"
9 #include "file.inc"
10 #include "filexml.inc"
11 #include "mwindow.inc"
12 #include "playbackengine.inc"
13 #include "record.inc"
14 #include "recordaudio.inc"
15 #include "recordvideo.inc"
16 #include "recordgui.inc"
17 #include "recordlabel.inc"
18 #include "recordthread.inc"
19 #include "bctimer.h"
20 #include "videodevice.inc"
22 class RecordEngine
24 public:
25 RecordEngine(MWindow *mwindow, Record *record);
27 Record *record;
28 MWindow *mwindow;
36 RecordEngine(MWindow *mwindow,
37 Record *record,
38 File *file,
39 Asset *asset,
40 RecordLabels *labels);
41 ~RecordEngine();
43 int initialize();
44 int set_gui(RecordGUI *gui);
45 long get_dc_offset(int offset);
46 int set_dc_offset(long new_offset, int number);
47 long get_dc_offset(long *dc_offset, RecordGUIDCOffsetText **dc_offset_text);
48 int run_script(FileXML *script);
50 // =================================== record operations
52 int start_monitor();
53 int stop_monitor();
54 int pause_monitor();
56 int resume_monitor();
58 int start_saving(int duplex = 0);
59 int stop_saving(int no_monitor = 0);
60 int save_frame();
62 int arm_duplex();
63 int start_duplex();
64 int stop_duplex();
66 int start_preview();
67 int stop_preview(int no_monitor = 0);
69 int stop_operation(int no_monitor = 0);
70 int start_over();
72 int lock_window();
73 int unlock_window();
74 int set_video_picture(); // Send the picture quality to the device
76 // Open device for recording
77 int open_input_devices(int duplex);
78 int close_input_devices();
79 // Open device for previewing
80 int open_output_devices();
81 int close_output_devices();
83 // ======================================= transport
85 int delete_all_labels();
86 int calibrate_dc_offset();
87 int calibrate_dc_offset(long new_value, int channel);
89 int update_position(long new_position);
90 int update_total_length(long new_length);
91 int update_prev_label(long new_label);
92 int update_next_label(long new_label);
94 int goto_prev_label();
95 int goto_next_label();
96 int toggle_label();
98 int reset_over();
99 int set_done(int value);
101 RecordThread *monitor_thread;
102 RecordThread *record_thread;
103 PlaybackEngine *duplex_thread;
105 RecordGUI *gui;
106 AudioDevice *adevice;
107 VideoDevice *vdevice;
108 File *file;
109 Asset *asset;
110 RecordLabels *labels;
112 // For video synchronization when no audio thread
113 Timer monitor_timer, preview_timer, record_timer;
114 int record_mode;
115 int is_saving;
116 int is_previewing;
117 int is_duplexing;
118 int is_monitoring;
119 long total_length;
120 long current_position;
121 long prev_label;
122 long next_label;
124 // =========================================== info
126 int mode_to_text(char *string, int mode);
127 int text_to_mode(char *string);
129 // Current sample depending on the operation
130 long absolute_monitor_position();
131 long absolute_preview_position();
132 long absolute_record_position();
134 ArrayList<char*>* get_video_inputs();
135 int change_channel(Channel *channel);
136 int get_vu_format();
137 int get_loop_hr();
138 int get_loop_min();
139 int get_loop_sec();
140 long get_loop_duration();
141 int set_loop_duration();
142 int get_duplex_status();
143 int set_duplex_status(int duplex_status);
144 int set_record_mode(char *text);
145 int set_monitor_video(int value);
146 int set_monitor_audio(int value);
147 int get_record_mode(char *text);
148 int get_record_mode();
149 int get_dither();
150 int get_duplex_enable();
151 int get_input_channels();
152 int get_format(char *string);
153 int get_samplerate();
154 int get_time_format();
155 float get_frames_per_foot();
156 float get_min_db();
157 float get_frame_rate();
158 long get_current_position();
159 int get_bits();
160 long get_current_delay();
161 long get_current_jumps();
162 int reset_current_delay();
163 int get_in_length(); // Length to read during record
164 int get_meter_over_hold(int divisions);
165 int get_meter_peak_hold(int divisions);
166 int get_meter_speed();
168 private:
169 long jump_delay[JUMP_DELAYS], current_jump_jumps[JUMP_DELAYS];
170 int current_jump_delay, current_jump_jump;
173 #endif