00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _FM_LOADERS_H_
00015 #define _FM_LOADERS_H_
00016
00017
00018 #include "generic.h"
00019 #include <wx/wx.h>
00020 #include <wx/file.h>
00021 #include <wx/list.h>
00022
00023
00027 typedef struct {
00028 off_t pos;
00029 off_t len;
00030 off_t hinfo;
00031 } DataPos;
00032
00033 WX_DECLARE_LIST(DataPos, Datas);
00034
00035
00039 typedef union {
00040 wxUint32 id;
00041 char chars[4];
00042 } fourcc;
00043
00044
00053 inline bool cmp_fourcc(const fourcc cc, const char * str) {
00054 return (strncmp((const char * ) &cc.chars, str, 4) == 0);
00055 }
00056
00057
00064 class Loader {
00065 public:
00066 virtual const wxString & Name() const = 0;
00068 virtual enum status_t Attach(wxFile * file, const wxString & name) = 0;
00069 virtual enum status_t Create(wxFile * file, const wxString & name, const format_t & fmt) = 0;
00070 virtual enum status_t Create(wxFile * file, const wxString & name, const format_ex_t & fmt) = 0;
00071 virtual track_t NumIntTracks() const = 0;
00072 virtual const format_t * TrackFormat(const track_t itrack) const = 0;
00073 virtual const wxString * FileName() const = 0;
00074 virtual length_t GetRawLength() const = 0;
00076 virtual samples_t GetSamples(const track_t itrack, const samples_t pos, const samples_t len, void * data) = 0;
00077 virtual samples_t AppendSamples(const track_t itrack, const samples_t len, void * data, samples_t & npos) = 0;
00078 virtual samples_t AppendSamples(const samples_t len, void * data) = 0;
00079 };
00080
00081
00082 void LoadersRegister();
00085 #endif