Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

filelist.h

Go to the documentation of this file.
00001 #ifndef FILELIST_H
00002 #define FILELIST_H
00003 
00004 #include "file.inc"
00005 #include "filebase.h"
00006 #include "filelist.inc"
00007 #include "loadbalance.h"
00008 #include "mutex.inc"
00009 #include "vframe.inc"
00010 
00011 // Any file which is a list of frames.
00012 // FileList handles both frame files and indexes of frame files.
00013 
00014 
00015 
00016 
00017 
00018 
00019 class FileList : public FileBase
00020 {
00021 public:
00022         FileList(Asset *asset, 
00023                 File *file, 
00024                 char *list_prefix,
00025                 char *file_extension, 
00026                 int frame_type,
00027                 int list_type);
00028         virtual ~FileList();
00029 
00030 // basic commands for every file interpreter
00031         int open_file(int rd, int wr);
00032         int close_file();
00033 
00034         char* calculate_path(int number, char *string);
00035         char* create_path(int number_override);
00036         void add_return_value(int amount);
00037 
00038         int read_list_header();
00039         virtual int read_frame_header(char *path) { return 1; };
00040         int read_frame(VFrame *frame);
00041 
00042 // subclass returns whether the asset format is a list or single file
00043         virtual int read_frame(VFrame *frame, VFrame *data) { return 0; };
00044         virtual int write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit) { return 0; };
00045 
00046 
00047         int write_list_header();
00048         int write_frames(VFrame ***frames, int len);
00049         VFrame* read_frame(int use_alpha, int use_float);
00050         virtual int get_memory_usage();
00051 // Get the total writer units for calculating memory usage
00052         int get_units();
00053 // Get a writer unit for retrieving temporary usage.
00054         FrameWriterUnit* get_unit(int number);
00055 
00056         virtual FrameWriterUnit* new_writer_unit(FrameWriter *writer);
00057 
00058 // Temp storage for compressed data
00059         VFrame *data;
00060 // Storage for single frame
00061         VFrame *temp;
00062 
00063 private:
00064         int read_raw(VFrame *frame, 
00065                 float in_x1, float in_y1, float in_x2, float in_y2,
00066                 float out_x1, float out_y1, float out_x2, float out_y2, 
00067                 int alpha, int use_alpha, int use_float, int interpolate);
00068         int reset_parameters_derived();
00069         ArrayList<char*> path_list;     // List of files
00070         char *list_prefix;
00071         char *file_extension;
00072         int frame_type;
00073         int list_type;
00074         Mutex *table_lock;
00075         FrameWriter *writer;
00076         int return_value;
00077         int first_number;
00078         int number_start;
00079         int number_digits;
00080 };
00081 
00082 
00083 
00084 
00085 class FrameWriterPackage : public LoadPackage
00086 {
00087 public:
00088         FrameWriterPackage();
00089         ~FrameWriterPackage();
00090         
00091         
00092         VFrame *input;
00093         
00094         char *path;
00095 };
00096 
00097 
00098 
00099 
00100 class FrameWriterUnit : public LoadClient
00101 {
00102 public:
00103         FrameWriterUnit(FrameWriter *server);
00104         virtual ~FrameWriterUnit();
00105         
00106         void process_package(LoadPackage *package);
00107 
00108         FrameWriter *server;
00109         VFrame *output;
00110 };
00111 
00112 
00113 
00114 
00115 
00116 class FrameWriter : public LoadServer
00117 {
00118 public:
00119         FrameWriter(FileList *file, int cpus);
00120         ~FrameWriter();
00121         
00122         void write_frames(VFrame ***frames, int len);
00123         void init_packages();
00124         LoadClient* new_client();
00125         LoadPackage* new_package();
00126         
00127         FileList *file;
00128         VFrame ***frames;
00129         int len;
00130 };
00131 
00132 
00133 
00134 
00135 
00136 
00137 
00138 
00139 #endif

Generated on Sun Jan 8 13:38:54 2006 for Cinelerra-svn by  doxygen 1.4.4