00001 #ifndef PACKAGEDISPATCHER_H 00002 #define PACKAGEDISPATCHER_H 00003 00004 00005 #include "arraylist.h" 00006 #include "assets.inc" 00007 #include "edl.inc" 00008 #include "mutex.inc" 00009 #include "mwindow.inc" 00010 #include "packagerenderer.inc" 00011 #include "preferences.inc" 00012 #include "packagingengine.h" 00013 00014 00015 00016 // Allocates fragments given a total start and total end. 00017 // Checks the existence of every file. 00018 // Adjusts package size for load. 00019 class PackageDispatcher 00020 { 00021 public: 00022 PackageDispatcher(); 00023 ~PackageDispatcher(); 00024 00025 int create_packages(MWindow *mwindow, 00026 EDL *edl, 00027 Preferences *preferences, 00028 int strategy, 00029 Asset *default_asset, 00030 double total_start, 00031 double total_end, 00032 int test_overwrite); 00033 // Supply a frame rate of the calling node. If the client number is -1 00034 // the frame rate isn't added to the preferences table. 00035 RenderPackage* get_package(double frames_per_second, 00036 int client_number, 00037 int use_local_rate); 00038 ArrayList<Asset*>* get_asset_list(); 00039 void get_package_paths(ArrayList<char*> *path_list); 00040 00041 int get_total_packages(); 00042 int64_t get_progress_max(); 00043 int packages_are_done(); 00044 00045 private: 00046 EDL *edl; 00047 int64_t audio_position; 00048 int64_t video_position; 00049 int64_t audio_end; 00050 int64_t video_end; 00051 double total_start; 00052 double total_end; 00053 double total_len; 00054 int strategy; 00055 Asset *default_asset; 00056 Preferences *preferences; 00057 int current_number; // The number being injected into the filename. 00058 int number_start; // Character in the filename path at which the number begins 00059 int total_digits; // Total number of digits including padding the user specified. 00060 double package_len; // Target length of a single package 00061 double min_package_len; // Minimum package length after load balancing 00062 int64_t total_packages; // Total packages to base calculations on 00063 int64_t total_allocated; // Total packages to test the existence of 00064 int nodes; 00065 MWindow *mwindow; 00066 RenderPackage **packages; 00067 int current_package; 00068 Mutex *package_lock; 00069 00070 PackagingEngine *packaging_engine; 00071 }; 00072 00073 00074 #endif 00075 00076
1.5.5