rework histogram_bezier, init wm icon set_icon(gg), update de.po+msg/txt
[goodguy/history.git] / cinelerra-5.1 / cinelerra / arender.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2009 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #ifndef ARENDER_H
23 #define ARENDER_H
24
25 #include "atrack.inc"
26 #include "commonrender.h"
27 #include "maxchannels.h"
28 #include "meterhistory.h"
29 #include "samples.inc"
30
31 class ARender : public CommonRender
32 {
33 public:
34         ARender(RenderEngine *renderengine);
35         ~ARender();
36
37         void arm_command();
38         void allocate_buffers(int samples);
39 // Used by realtime rendering
40         void init_output_buffers();
41         void interrupt_playback();
42         VirtualConsole* new_vconsole_object();
43         int get_total_tracks();
44         Module* new_module(Track *track);
45
46 // set up and start thread
47         int arm_playback(int64_t current_position,
48                                 int64_t input_length,
49                                 int64_t module_render_fragment,
50                                 int64_t playback_buffer,
51                                 int64_t output_length);
52         int wait_for_startup();
53
54 // process a buffer
55 // renders into buffer_out argument when no audio device
56 // handles playback autos
57         int process_buffer(Samples **buffer_out,
58                 int64_t input_len,
59                 int64_t input_position);
60 // renders to a device when there's a device
61         int process_buffer(int64_t input_len, int64_t input_position);
62
63         void run();
64
65         void send_last_buffer();
66         int stop_audio(int wait);
67
68 // Calculate number of samples in each meter fragment and how many
69 // meter fragments to buffer.
70         int init_meters();
71         int calculate_history_size();
72         int total_peaks;
73         MeterHistory *meter_history;
74 // samples to use for one meter update.  Must be multiple of fragment_len
75         int64_t meter_render_fragment;
76
77         int64_t tounits(double position, int round);
78         double fromunits(int64_t position);
79
80 // pointers to output buffers for VirtualConsole
81         Samples *audio_out[MAXCHANNELS];
82 // allocated memory for output
83         Samples *buffer[MAXCHANNELS];
84 // allocated buffer sizes for nested EDL rendering
85         int buffer_allocated[MAXCHANNELS];
86 // Make VirtualAConsole block before the first buffer until video is ready
87         int first_buffer;
88 };
89
90
91
92 #endif