r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / render.h
blob8c466cc4a67ac5abfb04ed9132abc5baaaf100c9
1 #ifndef RENDER_H
2 #define RENDER_H
5 #include "assets.inc"
6 #include "bitspopup.h"
7 #include "browsebutton.h"
8 #include "cache.inc"
9 #include "compresspopup.h"
10 #include "defaults.inc"
11 #include "edit.inc"
12 #include "errorbox.inc"
13 #include "file.inc"
14 #include "formatpopup.inc"
15 #include "formattools.inc"
16 #include "guicast.h"
17 #include "loadmode.inc"
18 #include "mainprogress.inc"
19 #include "maxchannels.h"
20 #include "mutex.inc"
21 #include "mwindow.inc"
22 #include "packagedispatcher.inc"
23 #include "packagerenderer.h"
24 #include "playabletracks.inc"
25 #include "preferences.inc"
26 #include "bcprogressbox.inc"
27 #include "render.inc"
28 #include "track.inc"
29 #include "transportque.inc"
30 #include "vframe.inc"
32 class RenderItem : public BC_MenuItem
34 public:
35 RenderItem(MWindow *mwindow);
36 int handle_event();
37 MWindow *mwindow;
40 class RenderProgress : public Thread
42 public:
43 RenderProgress(MWindow *mwindow, Render *render);
44 ~RenderProgress();
46 void run();
49 MWindow *mwindow;
50 Render *render;
52 int64_t last_value;
57 class MainPackageRenderer : public PackageRenderer
59 public:
60 MainPackageRenderer(Render *render);
61 ~MainPackageRenderer();
64 int get_result();
65 void set_result(int value);
66 void set_progress(int64_t value);
67 int progress_cancelled();
69 Render *render;
75 class Render : public Thread
77 public:
78 Render(MWindow *mwindow);
79 ~Render();
81 void run();
82 int load_defaults(Asset *asset);
83 int save_defaults(Asset *asset);
84 // force asset parameters regardless of window
85 // This should be integrated into the Asset Class.
86 static int check_asset(EDL *edl, Asset &asset);
87 // Force filename to have a 0 padded number if rendering to a list.
88 int check_numbering(Asset &asset);
89 static void create_filename(char *path,
90 char *default_path,
91 int current_number,
92 int total_digits,
93 int number_start);
94 static void get_starting_number(char *path,
95 int &current_number,
96 int &number_start,
97 int &total_digits,
98 int min_digits = 3);
99 static int test_existence(MWindow *mwindow, Asset *asset);
100 int direct_frame_copy(EDL *edl, int64_t &render_video_position, File *file);
101 int direct_copy_possible(EDL *edl,
102 int64_t current_position,
103 Track* playable_track, // The one track which is playable
104 Edit* &playable_edit, // The edit which is playing
105 File *file); // Output file
107 void start_progress();
108 void stop_progress();
110 int load_mode;
111 int in_progress;
112 // Background compression must be disabled when direct frame copying and reenabled afterwards
113 int direct_frame_copying;
115 CICache *audio_cache, *video_cache;
116 VFrame *compressed_output;
117 MainProgressBar *progress;
118 RenderProgress *render_progress;
119 MWindow *mwindow;
120 PlayableTracks *playable_tracks;
121 PackageDispatcher *packages;
122 Mutex *package_lock, *counter_lock;
123 Preferences *preferences;
124 int strategy;
125 // Total selection to render in seconds
126 double total_start, total_end;
127 // External Render farm checks this every frame.
128 int result;
129 Asset *default_asset;
130 TransportCommand *command;
132 // Total samples updated by the render farm and the local renderer.
133 // This avoids rounding errors and complies with the use of samples for
134 // timing.
135 int64_t total_rendered;
136 // Speed for the master node
137 double frames_per_second;
140 class RenderToTracks;
142 class RenderWindow : public BC_Window
144 public:
145 RenderWindow(MWindow *mwindow, Render *render, Asset *asset);
146 ~RenderWindow();
148 int create_objects();
151 LoadMode *loadmode;
152 FormatTools *format_tools;
154 MWindow *mwindow;
155 Render *render;
156 Asset *asset;
171 #endif