Revision 1 (by moose, 2006/03/06 10:00:33) Initial Import
#ifndef __FILEINFO_H__
#define __FILEINFO_H__

class FileHashHandler { // MD5HashHandler, etc
	public:
		virtual const char *getHash(const char *) = 0;

};

class FileDemuxHandler {
	public:
		virtual FileDemux *getDemux(const char *);
};

class FileDemux { // MP3Demux, OggDemux, etc
	public:
		FileDemux(const char *) { } // after this is called, the header/info/tag stuff should be accessable
		virtual FileDemux() { }
		
		// bit stream access
		virtual unsigned int read(unsigned char *buf, unsigned int want) = 0;
		virtual bool seekable() = 0;
		virtual int rawseek(unsigned int off, int whence) = 0;
		virtual int seekto(double off) = 0;

		// info/tag access

		virtual unsigned int streamLength() = 0; // in seconds

};

// should not write to file on every modification, have a commit() in the FileInfo class to save all the dirty tags.
class FileTag {
	public:
		virtual const char *name() = 0;
		virtual const char *data() = 0;
		virtual int asInt() = 0;
		virtual bool asBool() = 0;
		virtual double asDouble() = 0;

		virtual void setInt(int) = 0;
		virtual void setBool(int) = 0;
		virtual void setDouble(int) = 0;
		virtual void setText(int) = 0;
};

// reads the info (length, bitrate, etc) and tags (artist, track, whatever)
// gives back FileTag classes
class FileInfo { // Mp3Info, OggInfo, MpegInfo, AviInfo, etc
	public:
		virtual FileTag *tag(const char *) = 0;
		virtual FileTag *firstTag() = 0;
		virtual FileTag *nextTag() = 0;

		virtual const char *fileName() = 0;
		virtual size_t fileSize() = 0;
};


class FileInfoHandler { // Mp3InfoHandler, OggInfoHandler, MpegInfoHandler, AviInfoHandler etc.
	public:

		virtual FileInfo *getInfo(const char *) = 0;
	private:
};

#endif /* __FILEINFO_H__ */