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"
34 class RenderItem
: public BC_MenuItem
37 RenderItem(MWindow
*mwindow
);
42 class RenderProgress
: public Thread
45 RenderProgress(MWindow
*mwindow
, Render
*render
);
59 class MainPackageRenderer
: public PackageRenderer
62 MainPackageRenderer(Render
*render
);
63 ~MainPackageRenderer();
68 void set_result(int value
);
69 void set_progress(int64_t value
);
70 int progress_cancelled();
78 class Render
: public Thread
81 Render(MWindow
*mwindow
);
84 // Start dialogue box and render interactively.
85 void start_interactive();
86 // Start batch rendering jobs.
87 // A new thread is created and the rendering is interactive.
88 void start_batches(ArrayList
<BatchRenderJob
*> *jobs
);
89 // The batches are processed in the foreground in non interactive mode.
90 void start_batches(ArrayList
<BatchRenderJob
*> *jobs
,
91 BC_Hash
*boot_defaults
,
92 Preferences
*preferences
,
93 ArrayList
<PluginServer
*> *plugindb
);
94 // Called by BatchRender to stop the operation.
95 void stop_operation();
99 // Render single job. Used by run.
100 int render(int test_overwrite
,
105 int load_defaults(Asset
*asset
);
106 int save_defaults(Asset
*asset
);
107 // force asset parameters regardless of window
108 // This should be integrated into the Asset Class.
109 static int check_asset(EDL
*edl
, Asset
&asset
);
110 // Fix strategy to conform with using renderfarm.
111 static int fix_strategy(int strategy
, int use_renderfarm
);
112 // Force filename to have a 0 padded number if rendering to a list.
113 int check_numbering(Asset
&asset
);
114 static void create_filename(char *path
,
119 static void get_starting_number(char *path
,
124 int direct_frame_copy(EDL
*edl
, int64_t &render_video_position
, File
*file
);
125 int direct_copy_possible(EDL
*edl
,
126 int64_t current_position
,
127 Track
* playable_track
, // The one track which is playable
128 Edit
* &playable_edit
, // The edit which is playing
129 File
*file
); // Output file
131 void start_progress();
132 void stop_progress();
134 // Procedure the run function should use.
141 // When batch rendering is cancelled from the batch dialog
147 // Background compression must be disabled when direct frame copying and reenabled afterwards
148 int direct_frame_copying
;
150 CICache
*audio_cache
, *video_cache
;
151 VFrame
*compressed_output
;
152 MainProgressBar
*progress
;
153 RenderProgress
*render_progress
;
155 PlayableTracks
*playable_tracks
;
156 PackageDispatcher
*packages
;
157 Mutex
*package_lock
, *counter_lock
;
158 // Copy of mwindow preferences
159 Preferences
*preferences
;
160 // For use in non interactive mode
161 ArrayList
<PluginServer
*> *plugindb
;
163 // Total selection to render in seconds
164 double total_start
, total_end
;
165 // External Render farm checks this every frame.
167 Asset
*default_asset
;
168 TransportCommand
*command
;
169 // Jobs pointer passed to start_batches
170 ArrayList
<BatchRenderJob
*> *jobs
;
171 // Used by batch rendering to wait until rendering is finished
172 Condition
*completion
;
175 // Total samples updated by the render farm and the local renderer.
176 // This avoids rounding errors and complies with the use of samples for
178 int64_t total_rendered
;
179 // Speed for the master node
180 double frames_per_second
;
181 // Time used in last render
184 // Current open RenderWindow
185 RenderWindow
*render_window
;
187 // For non interactive mode, maintain progress here.
188 int64_t progress_max
;
189 Timer
*progress_timer
;
193 class RenderToTracks
;
195 class RenderWindow
: public BC_Window
198 RenderWindow(MWindow
*mwindow
, Render
*render
, Asset
*asset
);
201 int create_objects();
205 FormatTools
*format_tools
;