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

arender.h

Go to the documentation of this file.
00001 #ifndef ARENDER_H
00002 #define ARENDER_H
00003 
00004 #include "atrack.inc"
00005 #include "commonrender.h"
00006 #include "maxchannels.h"
00007 
00008 class ARender : public CommonRender
00009 {
00010 public:
00011         ARender(RenderEngine *renderengine);
00012         ~ARender();
00013 
00014         void arm_command();
00015         void init_output_buffers();
00016         VirtualConsole* new_vconsole_object();
00017         int get_total_tracks();
00018         Module* new_module(Track *track);
00019 
00020 // set up and start thread
00021         int arm_playback(int64_t current_position,
00022                                 int64_t input_length, 
00023                                 int64_t module_render_fragment, 
00024                                 int64_t playback_buffer, 
00025                                 int64_t output_length);
00026         int wait_for_startup();
00027         int64_t tounits(double position, int round);
00028         double fromunits(int64_t position);
00029 
00030         void run();
00031 // Calculate number of samples in each meter fragment and how many
00032 // meter fragments to buffer.
00033         int calculate_history_size();
00034 // Get subscript of history entry corresponding to sample
00035         int get_history_number(int64_t *table, int64_t position);
00036 
00037 // output buffers for audio device
00038         double *audio_out[MAXCHANNELS];
00039 // information for meters
00040         int get_next_peak(int current_peak);
00041 // samples to use for one meter update.  Must be multiple of fragment_len
00042         int64_t meter_render_fragment;
00043 // Level history of output buffers
00044         double *level_history[MAXCHANNELS];
00045 // sample position of each level
00046         int64_t *level_samples;
00047 // total entries in level_history
00048         int total_peaks;
00049 // Next level to store value in
00050         int current_level[MAXCHANNELS];
00051 // Make VirtualAConsole block before the first buffer until video is ready
00052         int first_buffer;
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 // get the data type for certain commonrender routines
00061         int get_datatype();
00062 
00063 // handle playback autos and transitions
00064 //      int restart_playback();
00065 //      int send_reconfigure_buffer();
00066 
00067 // process a buffer
00068 // renders into buffer_out argument when no audio device
00069 // handles playback autos
00070         int process_buffer(double **buffer_out, int64_t input_len, int64_t input_position, int last_buffer);
00071 // renders to a device when there's a device
00072         int process_buffer(int64_t input_len, int64_t input_position);
00073 
00074         void send_last_buffer();
00075         int wait_device_completion();
00076 
00077 // reverse the data in a buffer 
00078         int reverse_buffer(double *buffer, int64_t len);
00079 // advance the buffer count
00080         int swap_current_buffer();
00081         int64_t get_render_length(int64_t current_render_length);
00082 
00083 //      int64_t playback_buffer;            // maximum length to send to audio device
00084 //      int64_t output_length;              // maximum length to send to audio device after speed
00085 
00086 
00087         int64_t source_length;  // Total number of frames to render for transitions
00088 
00089 
00090 private:
00091 // initialize buffer_out
00092         int init_meters();
00093 // Samples since start of playback
00094         int64_t session_position;
00095 };
00096 
00097 
00098 
00099 #endif

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