Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

recordengine.h

Go to the documentation of this file.
00001 #ifndef RECORDENGINE_H
00002 #define RECORDENGINE_H
00003 
00004 #define JUMP_DELAYS 5
00005 
00006 #include "assets.inc"
00007 #include "audiodevice.inc"
00008 #include "channel.inc"
00009 #include "file.inc"
00010 #include "filexml.inc"
00011 #include "mwindow.inc"
00012 #include "playbackengine.inc"
00013 #include "record.inc"
00014 #include "recordaudio.inc"
00015 #include "recordvideo.inc"
00016 #include "recordgui.inc"
00017 #include "recordlabel.inc"
00018 #include "recordthread.inc"
00019 #include "bctimer.h"
00020 #include "videodevice.inc"
00021 
00022 class RecordEngine
00023 {
00024 public:
00025         RecordEngine(MWindow *mwindow, Record *record);
00026 
00027         Record *record;
00028         MWindow *mwindow;
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036         RecordEngine(MWindow *mwindow,
00037                         Record *record, 
00038                         File *file, 
00039                         Asset *asset, 
00040                         RecordLabels *labels);
00041         ~RecordEngine();
00042 
00043         int initialize();
00044         int set_gui(RecordGUI *gui);
00045         long get_dc_offset(int offset);
00046         int set_dc_offset(long new_offset, int number);
00047         long get_dc_offset(long *dc_offset, RecordGUIDCOffsetText **dc_offset_text);
00048         int run_script(FileXML *script);
00049 
00050 // =================================== record operations
00051 
00052         int start_monitor();
00053         int stop_monitor();
00054         int pause_monitor();
00055 
00056         int resume_monitor();
00057 
00058         int start_saving(int duplex = 0);
00059         int stop_saving(int no_monitor = 0);
00060         int save_frame();
00061 
00062         int arm_duplex();
00063         int start_duplex();
00064         int stop_duplex();
00065 
00066         int start_preview();
00067         int stop_preview(int no_monitor = 0);
00068 
00069         int stop_operation(int no_monitor = 0);
00070         int start_over();
00071 
00072         int lock_window();
00073         int unlock_window();
00074         int set_video_picture();   // Send the picture quality to the device
00075 
00076 // Open device for recording
00077         int open_input_devices(int duplex);
00078         int close_input_devices();
00079 // Open device for previewing
00080         int open_output_devices();
00081         int close_output_devices();
00082 
00083 // ======================================= transport
00084 
00085         int delete_all_labels();
00086         int calibrate_dc_offset();
00087         int calibrate_dc_offset(long new_value, int channel);
00088 
00089         int update_position(long new_position);
00090         int update_total_length(long new_length);
00091         int update_prev_label(long new_label);
00092         int update_next_label(long new_label);
00093 
00094         int goto_prev_label();
00095         int goto_next_label();
00096         int toggle_label();
00097 
00098         int reset_over();
00099         int set_done(int value);
00100 
00101         RecordThread *monitor_thread;
00102         RecordThread *record_thread;
00103         PlaybackEngine *duplex_thread;
00104 
00105         RecordGUI *gui;
00106         AudioDevice *adevice;
00107         VideoDevice *vdevice;
00108         File *file;
00109         Asset *asset;
00110         RecordLabels *labels;
00111 
00112 // For video synchronization when no audio thread
00113         Timer monitor_timer, preview_timer, record_timer;
00114         int record_mode;
00115         int is_saving;
00116         int is_previewing;
00117         int is_duplexing;
00118         int is_monitoring;
00119         long total_length;
00120         long current_position;
00121         long prev_label;
00122         long next_label;
00123 
00124 // =========================================== info
00125 
00126         int mode_to_text(char *string, int mode);
00127         int text_to_mode(char *string);
00128 
00129 // Current sample depending on the operation
00130         long absolute_monitor_position();
00131         long absolute_preview_position();
00132         long absolute_record_position();
00133 
00134         ArrayList<char*>* get_video_inputs();
00135         int change_channel(Channel *channel);
00136         int get_vu_format();
00137         int get_loop_hr();
00138         int get_loop_min();
00139         int get_loop_sec();
00140         long get_loop_duration();
00141         int set_loop_duration();
00142         int get_duplex_status();
00143         int set_duplex_status(int duplex_status);
00144         int set_record_mode(char *text);
00145         int set_monitor_video(int value);
00146         int set_monitor_audio(int value);
00147         int get_record_mode(char *text);
00148         int get_record_mode();
00149         int get_dither();
00150         int get_duplex_enable();
00151         int get_input_channels();
00152         int get_format(char *string);
00153         int get_samplerate();
00154         int get_time_format();
00155         float get_frames_per_foot();
00156         float get_min_db();
00157         float get_frame_rate();
00158         long get_current_position();
00159         int get_bits();
00160         long get_current_delay();
00161         long get_current_jumps();
00162         int reset_current_delay();
00163         int get_in_length();    // Length to read during record
00164         int get_meter_over_hold(int divisions);
00165         int get_meter_peak_hold(int divisions);
00166         int get_meter_speed();
00167 
00168 private:
00169         long jump_delay[JUMP_DELAYS], current_jump_jumps[JUMP_DELAYS];
00170         int current_jump_delay, current_jump_jump;
00171 };
00172 
00173 #endif

Generated on Sun Jan 8 13:38:59 2006 for Cinelerra-svn by  doxygen 1.4.4