Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

render.h

Go to the documentation of this file.
00001 #ifndef RENDER_H
00002 #define RENDER_H
00003 
00004 
00005 #include "asset.inc"
00006 #include "batchrender.inc"
00007 #include "bitspopup.h"
00008 #include "browsebutton.h"
00009 #include "cache.inc"
00010 #include "compresspopup.h"
00011 #include "condition.inc"
00012 #include "defaults.inc"
00013 #include "edit.inc"
00014 #include "errorbox.inc"
00015 #include "file.inc"
00016 #include "formatpopup.inc"
00017 #include "formattools.inc"
00018 #include "guicast.h"
00019 #include "loadmode.inc"
00020 #include "mainprogress.inc"
00021 #include "maxchannels.h"
00022 #include "mutex.inc"
00023 #include "mwindow.inc"
00024 #include "packagedispatcher.inc"
00025 #include "packagerenderer.h"
00026 #include "playabletracks.inc"
00027 #include "preferences.inc"
00028 #include "bcprogressbox.inc"
00029 #include "render.inc"
00030 #include "track.inc"
00031 #include "transportque.inc"
00032 #include "vframe.inc"
00033 
00034 class RenderItem : public BC_MenuItem
00035 {
00036 public:
00037         RenderItem(MWindow *mwindow);
00038         int handle_event();
00039         MWindow *mwindow;
00040 };
00041 
00042 class RenderProgress : public Thread
00043 {
00044 public:
00045         RenderProgress(MWindow *mwindow, Render *render);
00046         ~RenderProgress();
00047         
00048         void run();
00049         
00050         
00051         MWindow *mwindow;
00052         Render *render;
00053         
00054         int64_t last_value;
00055 };
00056 
00057 
00058 
00059 class MainPackageRenderer : public PackageRenderer
00060 {
00061 public:
00062         MainPackageRenderer(Render *render);
00063         ~MainPackageRenderer();
00064         
00065         
00066         int get_master();
00067         int get_result();
00068         void set_result(int value);
00069         void set_progress(int64_t value);
00070         int progress_cancelled();
00071 
00072         Render *render;
00073 };
00074 
00075 class RenderWindow;
00076 
00077 
00078 class Render : public Thread
00079 {
00080 public:
00081         Render(MWindow *mwindow);
00082         ~Render();
00083 
00084 // Start dialogue box and render interactively.
00085         void start_interactive();
00086 // Start batch rendering jobs.
00087 // A new thread is created and the rendering is interactive.
00088         void start_batches(ArrayList<BatchRenderJob*> *jobs);
00089 // The batches are processed in the foreground in non interactive mode.
00090         void start_batches(ArrayList<BatchRenderJob*> *jobs,
00091                 Defaults *boot_defaults,
00092                 Preferences *preferences,
00093                 ArrayList<PluginServer*> *plugindb);
00094 // Called by BatchRender to stop the operation.
00095         void stop_operation();
00096         void run();
00097 
00098 
00099 // Render single job.  Used by run.
00100         int render(int test_overwrite, 
00101                 Asset *asset,
00102                 EDL *edl,
00103                 int strategy);
00104 
00105         int load_defaults(Asset *asset);
00106         int save_defaults(Asset *asset);
00107 // force asset parameters regardless of window
00108 // This should be integrated into the Asset Class.
00109         static int check_asset(EDL *edl, Asset &asset); 
00110 // Fix strategy to conform with using renderfarm.
00111         static int fix_strategy(int strategy, int use_renderfarm);
00112 // Force filename to have a 0 padded number if rendering to a list.
00113         int check_numbering(Asset &asset);
00114         static void create_filename(char *path, 
00115                 char *default_path, 
00116                 int current_number,
00117                 int total_digits,
00118                 int number_start);
00119         static void get_starting_number(char *path, 
00120                 int &current_number,
00121                 int &number_start, 
00122                 int &total_digits,
00123                 int min_digits = 3);
00124         int direct_frame_copy(EDL *edl, int64_t &render_video_position, File *file);
00125         int direct_copy_possible(EDL *edl, 
00126                         int64_t current_position, 
00127                         Track* playable_track,  // The one track which is playable
00128                         Edit* &playable_edit, // The edit which is playing
00129                         File *file);   // Output file
00130 
00131         void start_progress();
00132         void stop_progress();
00133 
00134 // Procedure the run function should use.
00135         int mode;
00136         enum
00137         {
00138                 INTERACTIVE,
00139                 BATCH
00140         };
00141 // When batch rendering is cancelled from the batch dialog
00142         int batch_cancelled;
00143 
00144 
00145         int load_mode;
00146         int in_progress;
00147 // Background compression must be disabled when direct frame copying and reenabled afterwards
00148         int direct_frame_copying;
00149 
00150         CICache *audio_cache, *video_cache;
00151         VFrame *compressed_output;
00152         MainProgressBar *progress;
00153         RenderProgress *render_progress;
00154         MWindow *mwindow;
00155         PlayableTracks *playable_tracks;
00156         PackageDispatcher *packages;
00157         Mutex *package_lock, *counter_lock;
00158 // Copy of mwindow preferences
00159         Preferences *preferences;
00160 // For use in non interactive mode
00161         ArrayList<PluginServer*> *plugindb;
00162         int strategy;
00163 // Total selection to render in seconds
00164         double total_start, total_end;
00165 // External Render farm checks this every frame.
00166         int result;
00167         Asset *default_asset;
00168         TransportCommand *command;
00169 // Jobs pointer passed to start_batches
00170         ArrayList<BatchRenderJob*> *jobs;
00171 // Used by batch rendering to wait until rendering is finished
00172         Condition *completion;
00173 
00174 
00175 // Total samples updated by the render farm and the local renderer.
00176 // This avoids rounding errors and complies with the use of samples for
00177 // timing.
00178         int64_t total_rendered;
00179 // Speed for the master node
00180         double frames_per_second;
00181 // Time used in last render
00182         double elapsed_time;
00183 
00184 // Current open RenderWindow
00185         RenderWindow *render_window;
00186 
00187 // For non interactive mode, maintain progress here.
00188         int64_t progress_max;
00189         Timer *progress_timer;
00190         int64_t last_eta;
00191 };
00192 
00193 class RenderToTracks;
00194 
00195 class RenderWindow : public BC_Window
00196 {
00197 public:
00198         RenderWindow(MWindow *mwindow, Render *render, Asset *asset);
00199         ~RenderWindow();
00200 
00201         int create_objects();
00202 
00203 
00204         LoadMode *loadmode;
00205         FormatTools *format_tools;
00206 
00207         MWindow *mwindow;
00208         Render *render;
00209         Asset *asset;
00210 };
00211 
00212 
00213 
00214 
00215 
00216 
00217 
00218 
00219 
00220 
00221 
00222 
00223 
00224 #endif

Generated on Sun Jan 8 13:39:00 2006 for Cinelerra-svn by  doxygen 1.4.4