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 PACKAGEDISPATCHER_H
23 #define PACKAGEDISPATCHER_H
26 #include "arraylist.h"
30 #include "mwindow.inc"
31 #include "packagerenderer.inc"
32 #include "preferences.inc"
36 // Allocates fragments given a total start and total end.
37 // Checks the existence of every file.
38 // Adjusts package size for load.
39 class PackageDispatcher
45 int create_packages(MWindow *mwindow,
47 Preferences *preferences,
53 // Supply a frame rate of the calling node. If the client number is -1
54 // the frame rate isn't added to the preferences table.
55 RenderPackage* get_package(double frames_per_second,
58 // Return a new asset list of what was rendered. You must delete the return
59 // value with Garbage::remove_user for each member of the list & delete for
61 ArrayList<Indexable*>* get_asset_list();
62 RenderPackage* get_package(int number);
63 int get_total_packages();
66 int64_t audio_position;
67 int64_t video_position;
75 Preferences *preferences;
76 int current_number; // The number being injected into the filename.
77 int number_start; // Character in the filename path at which the number begins
78 int total_digits; // Total number of digits including padding the user specified.
79 double package_len; // Target length of a single package
80 double min_package_len; // Minimum package length after load balancing
81 int64_t total_packages; // Total packages to base calculations on
82 int64_t total_allocated; // Total packages to test the existence of
85 RenderPackage **packages;