4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #ifndef COMMONRENDER_H
23 #define COMMONRENDER_H
26 #include "condition.inc"
27 #include "virtualconsole.inc"
29 #include "mwindow.inc"
30 #include "renderengine.inc"
36 class CommonRender : public Thread
39 CommonRender(RenderEngine *renderengine);
40 virtual ~CommonRender();
42 virtual void arm_command();
43 virtual int get_total_tracks() { return 0; };
44 virtual Module* new_module(Track *track) { return 0; };
45 void delete_vconsole();
46 void create_modules();
47 void reset_parameters();
48 // Build the virtual console at the current position
49 virtual void build_virtual_console();
50 virtual VirtualConsole* new_vconsole_object() { return 0; };
51 virtual void init_output_buffers() {};
54 virtual void interrupt_playback();
55 int test_reconfigure(int64_t position, int64_t &length);
57 void evaluate_current_position();
59 virtual int restart_playback();
62 // convert to and from the native units of the render engine
63 virtual int64_t tounits(double position, int round);
64 virtual double fromunits(int64_t position);
65 // test region against loop boundaries
66 int get_boundaries(int64_t ¤t_render_length);
67 // advance the buffer position depending on the loop status
68 int advance_position(int64_t current_render_length);
70 RenderEngine *renderengine;
72 VirtualConsole *vconsole;
73 // Native units position in project used for all functions
74 int64_t current_position;
75 Condition *start_lock;
76 // flag for normally completed playback
78 // Flag for interrupted playback
80 // if this media type is being rendered asynchronously by threads
82 // Module for every track to dispatch plugins in whether the track is
84 // Maintain module structures here instead of reusing the EDL so
85 // plugins persist if the EDL is replaced.
86 // Modules can persist after vconsole is restarted.
90 // If a VirtualConsole was created need to start plugins