6 #include "batchrender.inc"
8 #include "browsebutton.h"
10 #include "compresspopup.h"
11 #include "condition.inc"
14 #include "errorbox.inc"
16 #include "formatpopup.inc"
17 #include "formattools.inc"
19 #include "loadmode.inc"
20 #include "mainprogress.inc"
21 #include "maxchannels.h"
23 #include "mwindow.inc"
24 #include "packagedispatcher.inc"
25 #include "packagerenderer.h"
26 #include "playabletracks.inc"
27 #include "preferences.inc"
28 #include "bcprogressbox.inc"
31 #include "transportque.inc"
33 #include "renderprofiles.inc"
36 class RenderItem
: public BC_MenuItem
39 RenderItem(MWindow
*mwindow
);
44 class RenderProgress
: public Thread
47 RenderProgress(MWindow
*mwindow
, Render
*render
);
61 class MainPackageRenderer
: public PackageRenderer
64 MainPackageRenderer(Render
*render
);
65 ~MainPackageRenderer();
70 void set_result(int value
);
71 void set_progress(int64_t value
);
72 int progress_cancelled();
80 class Render
: public Thread
83 Render(MWindow
*mwindow
);
86 // Start dialogue box and render interactively.
87 void start_interactive();
88 // Start batch rendering jobs.
89 // A new thread is created and the rendering is interactive.
90 void start_batches(ArrayList
<BatchRenderJob
*> *jobs
);
91 // The batches are processed in the foreground in non interactive mode.
92 void start_batches(ArrayList
<BatchRenderJob
*> *jobs
,
93 BC_Hash
*boot_defaults
,
94 Preferences
*preferences
,
95 ArrayList
<PluginServer
*> *plugindb
);
96 // Called by BatchRender to stop the operation.
97 void stop_operation();
101 // Render single job. Used by run.
102 int render(int test_overwrite
,
108 int load_defaults(Asset
*asset
);
109 int save_defaults(Asset
*asset
);
110 int load_profile(int profile_slot
, Asset
*asset
);
111 // force asset parameters regardless of window
112 // This should be integrated into the Asset Class.
113 static int check_asset(EDL
*edl
, Asset
&asset
);
114 // Fix strategy to conform with using renderfarm.
115 static int fix_strategy(int strategy
, int use_renderfarm
);
116 // Force filename to have a 0 padded number if rendering to a list.
117 int check_numbering(Asset
&asset
);
118 static void create_filename(char *path
,
123 static void get_starting_number(char *path
,
128 int direct_frame_copy(EDL
*edl
, int64_t &render_video_position
, File
*file
);
129 int direct_copy_possible(EDL
*edl
,
130 int64_t current_position
,
131 Track
* playable_track
, // The one track which is playable
132 Edit
* &playable_edit
, // The edit which is playing
133 File
*file
); // Output file
135 void start_progress();
136 void stop_progress();
138 // Procedure the run function should use.
145 // When batch rendering is cancelled from the batch dialog
151 // Background compression must be disabled when direct frame copying and reenabled afterwards
152 int direct_frame_copying
;
154 CICache
*audio_cache
, *video_cache
;
155 VFrame
*compressed_output
;
156 MainProgressBar
*progress
;
157 RenderProgress
*render_progress
;
159 PlayableTracks
*playable_tracks
;
160 PackageDispatcher
*packages
;
161 Mutex
*package_lock
, *counter_lock
;
162 // Copy of mwindow preferences
163 Preferences
*preferences
;
164 // For use in non interactive mode
165 ArrayList
<PluginServer
*> *plugindb
;
168 // Total selection to render in seconds
169 double total_start
, total_end
;
170 // External Render farm checks this every frame.
172 Asset
*default_asset
;
173 TransportCommand
*command
;
174 // Jobs pointer passed to start_batches
175 ArrayList
<BatchRenderJob
*> *jobs
;
176 // Used by batch rendering to wait until rendering is finished
177 Condition
*completion
;
180 // Total samples updated by the render farm and the local renderer.
181 // This avoids rounding errors and complies with the use of samples for
183 int64_t total_rendered
;
184 // Speed for the master node
185 double frames_per_second
;
186 // Time used in last render
189 // Current open RenderWindow
190 RenderWindow
*render_window
;
192 // For non interactive mode, maintain progress here.
193 int64_t progress_max
;
194 Timer
*progress_timer
;
198 class RenderToTracks
;
201 class RenderRangeProject
: public BC_Radial
204 RenderRangeProject(RenderWindow
*rwindow
, int value
, int x
, int y
);
206 RenderWindow
*rwindow
;
209 class RenderRangeSelection
: public BC_Radial
212 RenderRangeSelection(RenderWindow
*rwindow
, int value
, int x
, int y
);
214 RenderWindow
*rwindow
;
218 class RenderRangeInOut
: public BC_Radial
221 RenderRangeInOut(RenderWindow
*rwindow
, int value
, int x
, int y
);
223 RenderWindow
*rwindow
;
228 class RenderWindow
: public BC_Window
231 RenderWindow(MWindow
*mwindow
, Render
*render
, Asset
*asset
);
234 int create_objects();
235 void update_range_type(int range_type
);
236 int load_profile(int profile_slot
);
238 RenderRangeProject
*rangeproject
;
239 RenderRangeSelection
*rangeselection
;
240 RenderRangeInOut
*rangeinout
;
242 RenderProfile
*renderprofile
;
245 FormatTools
*format_tools
;