r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / arender.h
blob02e0d936c48d089b8611c234c278564c87eb0d0b
1 #ifndef ARENDER_H
2 #define ARENDER_H
4 #include "atrack.inc"
5 #include "commonrender.h"
6 #include "maxchannels.h"
7 #include "mutex.h"
9 class ARender : public CommonRender
11 public:
12 ARender(RenderEngine *renderengine);
13 ~ARender();
15 void arm_command();
16 void init_output_buffers();
17 VirtualConsole* new_vconsole_object();
18 int get_total_tracks();
19 Module* new_module(Track *track);
21 // set up and start thread
22 int arm_playback(int64_t current_position,
23 int64_t input_length,
24 int64_t module_render_fragment,
25 int64_t playback_buffer,
26 int64_t output_length);
27 int wait_for_startup();
28 int64_t tounits(double position, int round);
29 double fromunits(int64_t position);
31 void run();
32 // Calculate number of samples
33 int history_size();
34 // Get subscript of history entry corresponding to sample
35 int get_history_number(int64_t *table, int64_t position);
37 // output buffers for audio device
38 double *audio_out[MAXCHANNELS];
39 // information for meters
40 int get_next_peak(int current_peak);
41 // samples to use for one meter update
42 int64_t meter_render_fragment;
43 // Level history of output buffers
44 double *level_history[MAXCHANNELS];
45 // sample position of each level
46 int64_t *level_samples;
47 // total entries in level_history
48 int total_peaks;
49 // Next level to store value in
50 int current_level[MAXCHANNELS];
60 // get the data type for certain commonrender routines
61 int get_datatype();
63 // handle playback autos and transitions
64 int restart_playback();
65 int send_reconfigure_buffer();
67 // process a buffer
68 // renders into buffer_out argument when no audio device
69 // handles playback autos
70 int process_buffer(double **buffer_out, int64_t input_len, int64_t input_position, int last_buffer);
71 // renders to a device when there's a device
72 int process_buffer(int64_t input_len, int64_t input_position);
74 int wait_device_completion();
76 // reverse the data in a buffer
77 int reverse_buffer(double *buffer, int64_t len);
78 // advance the buffer count
79 int swap_current_buffer();
80 int64_t get_render_length(int64_t current_render_length);
82 // int64_t playback_buffer; // maximum length to send to audio device
83 // int64_t output_length; // maximum length to send to audio device after speed
86 int64_t source_length; // Total number of frames to render for transitions
88 private:
89 // initialize buffer_out
90 int init_meters();
91 // Samples since start of playback
92 int64_t session_position;
93 Mutex startup_lock;
98 #endif