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

record.h

Go to the documentation of this file.
00001 #ifndef RECORD_H
00002 #define RECORD_H
00003 
00004 #include "asset.inc"
00005 #include "assets.inc"
00006 #include "audiodevice.inc"
00007 #include "batch.inc"
00008 #include "channeldb.inc"
00009 #include "guicast.h"
00010 #include "bitspopup.h"
00011 #include "browsebutton.h"
00012 #include "channel.inc"
00013 #include "defaults.inc"
00014 #include "edl.inc"
00015 #include "file.inc"
00016 #include "filexml.inc"
00017 #include "filethread.inc"
00018 #include "formatpopup.h"
00019 #include "formattools.inc"
00020 #include "loadmode.inc"
00021 #include "mwindow.inc"
00022 #include "maxchannels.h"
00023 #include "picture.inc"
00024 #include "playbackengine.inc"
00025 #include "record.inc"
00026 #include "recordengine.inc"
00027 #include "recordgui.inc"
00028 #include "recordmonitor.inc"
00029 #include "recordthread.inc"
00030 #include "recordwindow.inc"
00031 #include "videodevice.inc"
00032 
00033 class Record;
00034 
00035 class RecordMenuItem : public BC_MenuItem
00036 {
00037 public:
00038         RecordMenuItem(MWindow *mwindow);
00039         ~RecordMenuItem();
00040 
00041         int handle_event();
00042 
00043         Record *thread;
00044         MWindow *mwindow;
00045 // State of recording dialog
00046         int current_state;
00047 };
00048 
00049 class Record : public Thread
00050 {
00051 public:
00052         Record(MWindow *mwindow, RecordMenuItem *menu_item);
00053         ~Record();
00054 
00055         void run();
00056         int load_defaults();
00057         int save_defaults();
00058         Batch* new_batch();
00059         void delete_batch();
00060         void activate_batch(int number, int stop_operation);
00061         void change_editing_batch(int number);
00062         void close_output_file();
00063         void delete_batch(int number);
00064         void swap_batches(int number1, int number2);
00065         void get_audio_write_length(int &buffer_size, 
00066                 int &fragment_size);
00067         int open_input_devices(int duplex, int context);
00068         int close_input_devices();
00069         void start_file_threads();
00070         int start_recording(int duplex, 
00071                 int context /* = CONTEXT_INTERACTIVE */);
00072         int record_frame();
00073         int start_monitor();
00074         int pause_monitor();
00075         int resume_monitor();
00076 // no_monitor causes the monitor not to be resumed after the operation
00077         int stop_operation(int resume_monitor);
00078         int stop_duplex();
00079         void stop_file_threads();
00080         int stop_monitor();
00081         int get_in_length();
00082         int set_video_picture();
00083 // Set screencapture translation
00084         void set_translation(int x, int y);
00085 
00086 // Set the channel in the current batch and the picture controls
00087         int set_channel(int channel);
00088         void set_channel(Channel *channel);
00089         int has_signal();
00090 
00091         void toggle_label();
00092 // Set values in batch structures
00093         void configure_batches();
00094         void source_to_text(char *string, Batch *batch);
00095 // Create first file in batch
00096         int open_output_file();
00097 // Delete the output file for overwrite if it exists.
00098         int delete_output_file();
00099 // Create next file in batch
00100         int init_next_file();
00101         void rewind_file();
00102 // Get the inputs supported by the device
00103         ArrayList<Channel*>* get_video_inputs();
00104 // Don't write to the returned string.
00105         char* get_channeldb_prefix();
00106 
00107 // Copied to each batch for the files
00108         Asset *default_asset;
00109         ArrayList<Batch*> batches;
00110 // How to combine the batches with the project
00111         int load_mode;
00112         int do_audio;
00113         int do_video;
00114         int monitor_audio;
00115         int monitor_video;
00116         int video_window_open;
00117 // Prompt before cancel
00118         int prompt_cancel;
00119 // Compression is fixed by the driver
00120         int fixed_compression;
00121 // Current batch being recorded to
00122         int current_batch;
00123 // Current batch being edited.  Don't want to interrupt recording to edit a different batch.
00124         int editing_batch;
00125 // Get next batch using activation or -1
00126         int get_next_batch();
00127 // Information about the current batch.
00128         Batch* get_current_batch();
00129 // Information about the batch being edited
00130         Batch* get_editing_batch();
00131         char* current_mode();
00132         char* current_source();
00133         int get_current_channel();
00134         int get_editing_channel();
00135         void get_current_time(double &seconds, int &day);
00136         Channel* get_current_channel_struct();
00137         char* current_news();
00138         double* current_start();
00139         double* current_duration();
00140         Asset* current_asset();
00141         int* current_offset_type();
00142 // Total number of samples since record sequence started
00143         int64_t sync_position();
00144 // Current position for GUI relative to batch
00145         double current_display_position();
00146         int64_t current_audio_position();
00147         int64_t current_duration_samples();
00148         int64_t current_video_position();
00149         int64_t current_duration_frames();
00150 // Number of frames between the current file and the start of the batch
00151         int64_t batch_video_offset();
00152 // Rewind the current file in the current batch
00153         void start_over();
00154 
00155 
00156 // User defined TV stations and inputs to record from.
00157         ChannelDB *channeldb;
00158 // Structure which stores what parameters the device supports
00159         Channel *master_channel;
00160 
00161 
00162         LoadMode *loadmode;
00163         MWindow *mwindow;
00164         RecordGUI *record_gui;
00165         RecordMonitor *record_monitor;
00166         RecordThread *monitor_engine;
00167         RecordThread *record_engine;
00168         AudioDevice *adevice;
00169         VideoDevice *vdevice;
00170 // File handle of last asset.in current batch
00171         File *file;
00172 
00173         PlaybackEngine *duplex_engine;
00174         RecordWindow *record_window;
00175 // Table for LML conversion
00176 //      unsigned char _601_to_rgb_table[256];
00177 // For video synchronization when no audio thread
00178         Timer monitor_timer;
00179 // State of the capturing operation
00180         int capture_state;
00181 // Translation of screencapture input
00182         int video_x;
00183         int video_y;
00184         float video_zoom;
00185         int reverse_interlace;     // Reverse the interlace in the video window display only
00186 // Color model for uncompressed device interface
00187         int color_model;
00188 // Picture quality and parameters the device supports
00189         PictureConfig *picture;
00190 // Fill dropped frames with duplicates
00191         int fill_frames;
00192 // Parameters for video monitor
00193         EDL *edl;
00194         Mutex *window_lock;
00195 
00196 
00197 
00198 
00199 
00200 
00201 
00202 
00203 
00204 
00205 
00206 
00207 
00208 
00209 
00210 
00211 
00212 // Number of channeldb entry
00213         int current_channel;
00214 
00215         FileXML *script;
00216         RecordMenuItem *menu_item;
00217 
00218         int set_script(FileXML *script);
00219         int run_script(Asset *asset, int &do_audio, int &do_video);
00220         int save_engine_defaults();
00221 
00222         float get_min_db();
00223         int get_samplerate();
00224         float get_framerate();
00225         int get_everyframe();
00226         int get_time_format();
00227         int get_realtime();
00228         float get_frame_rate();
00229         char* get_in_path();
00230         char* get_video_inpath();
00231         int get_video_driver();
00232         int get_vu_format();
00233         int get_rec_mode();
00234         int set_rec_mode(int value);
00235         int set_loop_duration(int64_t value);
00236         int use_floatingpoint();
00237 
00238         int get_out_length();   // Length to write during playback
00239         int64_t get_out_buffersize();  // Same as get_out_length
00240         int get_software_positioning();
00241         int64_t get_in_buffersize();      // Length to write to disk at a time
00242         int get_video_buffersize();    // Number of frames to write to disk at a time
00243         int get_video_capturesize();    // Number of frames to read from device at a time
00244         int get_meter_over_hold(int divisions);
00245         int get_meter_peak_hold(int divisions);
00246         int get_meter_speed();
00247 
00248         int64_t get_playback_buffer();
00249         int enable_duplex();
00250 
00251         int realtime;
00252         int to_tracks;
00253         int64_t loop_duration;
00254         int64_t startsource_sample;           // start in source file of this recording
00255         int64_t endsource_sample;
00256         int64_t startsource_frame;
00257         int64_t endsource_frame;
00258         int64_t dc_offset[MAXCHANNELS];
00259         int append_to_file;
00260         int record_mode;
00261         int frame_w;
00262         int frame_h;
00263         int video_window_w;       // Width of record video window
00264         int cpus;
00265 };
00266 
00267 
00268 #endif

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