4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #ifndef PACKAGINGENGINE_H
23 #define PACKAGINGENGINE_H
26 #include "packagingengine.inc"
27 #include "packagerenderer.h"
29 // Classes used for different packaging strategies, which allow for customary splitting of packages
30 // Used for renderfarm jobs
34 virtual int create_packages_single_farm(
36 Preferences *preferences,
39 double total_end) = 0;
40 virtual RenderPackage* get_package_single_farm(double frames_per_second,
42 int use_local_rate) = 0;
43 virtual int64_t get_progress_max() = 0;
44 virtual void get_package_paths(ArrayList<char*> *path_list) = 0;
45 virtual int packages_are_done() = 0;
48 // Classes used for different packaging strategies, which allow for customary splitting of packages
49 // Used for renderfarm jobs
51 class PackagingEngineDefault : public PackagingEngine
54 PackagingEngineDefault();
55 ~PackagingEngineDefault();
56 int create_packages_single_farm(
58 Preferences *preferences,
62 RenderPackage* get_package_single_farm(double frames_per_second,
65 int64_t get_progress_max();
66 void get_package_paths(ArrayList<char*> *path_list);
67 int packages_are_done();
69 RenderPackage **packages;
70 int64_t total_allocated; // Total packages to test the existence of
71 int current_number; // The number being injected into the filename.
72 int number_start; // Character in the filename path at which the number begins
73 int total_digits; // Total number of digits including padding the user specified.
74 double package_len; // Target length of a single package
75 double min_package_len; // Minimum package length after load balancing
76 int64_t total_packages; // Total packages to base calculations on
77 int64_t audio_position;
78 int64_t video_position;
83 Preferences *preferences;