mask tweaks, focus follows centroid, gradient/colorpicker rework, no hard edges in...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / packagingengine.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef PACKAGINGENGINE_H
23 #define PACKAGINGENGINE_H
24
25 #include "edl.h"
26 #include "packagingengine.inc"
27 #include "packagerenderer.h"
28
29 // Classes used for different packaging strategies, which allow for customary splitting of packages
30 // Used for renderfarm jobs
31 class PackagingEngine
32 {
33 public:
34         PackagingEngine() {}
35         virtual ~PackagingEngine() {}
36         virtual int create_packages_single_farm(
37                 EDL *edl,
38                 Preferences *preferences,
39                 Asset *default_asset,
40                 double total_start,
41                 double total_end) = 0;
42         virtual RenderPackage* get_package_single_farm(double frames_per_second,
43                 int client_number,
44                 int use_local_rate) = 0;
45         virtual int64_t get_progress_max() = 0;
46         virtual void get_package_paths(ArrayList<char*> *path_list) = 0;
47         virtual int get_asset_list(ArrayList<Indexable *> &idxbls) = 0;
48         virtual int packages_are_done() = 0;
49 };
50
51 // Classes used for different packaging strategies, which allow for customary splitting of packages
52 // Used for renderfarm jobs
53
54 class PackagingEngineDefault : public PackagingEngine
55 {
56 public:
57         PackagingEngineDefault();
58         ~PackagingEngineDefault();
59         int create_packages_single_farm(
60                 EDL *edl,
61                 Preferences *preferences,
62                 Asset *default_asset,
63                 double total_start,
64                 double total_end);
65         RenderPackage* get_package_single_farm(double frames_per_second,
66                 int client_number,
67                 int use_local_rate);
68         int64_t get_progress_max();
69         void get_package_paths(ArrayList<char*> *path_list);
70         int get_asset_list(ArrayList<Indexable *> &idxbls);
71         int packages_are_done();
72 private:
73         RenderPackage **packages;
74         int64_t total_allocated;  // Total packages to test the existence of
75         int current_number;    // The number being injected into the filename.
76         int number_start;      // Character in the filename path at which the number begins
77         int total_digits;      // Total number of digits including padding the user specified.
78         double package_len;    // Target length of a single package
79         double min_package_len; // Minimum package length after load balancing
80         int64_t total_packages;   // Total packages to base calculations on
81         int64_t audio_position;
82         int64_t video_position;
83         int64_t audio_end;
84         int64_t video_end;
85         double current_position;
86         int current_package;
87         Asset *default_asset;
88         Preferences *preferences;
89         double total_start;
90         double total_end;
91 };
92
93
94
95 #endif