00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __CL_ClipIO_h__
00023 #define __CL_ClipIO_h__
00024
00025 #include "CL_API.h"
00026 #include <UT/UT_SortedSymbolTable.h>
00027 class CL_Clip;
00028 class CL_ClipReader;
00029 class CL_ClipWriter;
00030
00031 class CL_API CL_ClipIO
00032 {
00033 public:
00034
00035 static CL_ClipIO &inst()
00036 {
00037 static bool created = false;
00038 static CL_ClipIO clip_io;
00039 if (!created)
00040 {
00041 created = true;
00042
00043
00044
00045 clip_io.registerClipHandlers();
00046 }
00047 return clip_io;
00048 }
00049
00050
00051
00052 bool readClip(const char *file_name, CL_Clip &clip);
00053 bool writeClip(const char *file_name, const CL_Clip &clip);
00054
00055
00056 bool canReadFileType(const char *extension);
00057 bool canWriteFileType(const char *extension);
00058
00059
00060
00061 int getNumReadableExtensions() const
00062 { return myClipReaders.entries(); }
00063 const char *getReadableExtension(int index) const
00064 { return myClipReaders.getSymbol(index); }
00065 int getNumWritableExtensions() const
00066 { return myClipWriters.entries(); }
00067 const char *getWritableExtension(int index) const
00068 { return myClipWriters.getSymbol(index); }
00069
00070
00071
00072
00073 void registerClipReader(const char *extension,
00074 CL_ClipReader &clip_reader);
00075 void registerClipWriter(const char *extension,
00076 CL_ClipWriter &clip_writer);
00077
00078 protected:
00079
00080 bool findReader(const char* symbol, UT_Thing* datap) const;
00081
00082 private:
00083 CL_ClipIO();
00084 void registerClipHandlers();
00085
00086 UT_SortedSymbolTable myClipReaders;
00087 UT_SortedSymbolTable myClipWriters;
00088 };
00089
00090
00091
00092 extern "C" {
00093 DLLEXPORT extern void CLregisterClipReader(void *);
00094 DLLEXPORT extern void CLregisterClipWriter(void *);
00095 }
00096
00097 #endif