00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef MIDIFILE_H_
00024 #define MIDIFILE_H_
00025
00026 #include <vector>
00027 #include <string>
00028 using namespace std;
00029
00030 #include "Chunk.h"
00031
00032 #include "Header.h"
00033 #include "Track.h"
00034
00035 namespace MIDI
00036 {
00038
00047 class File
00048 {
00049 public:
00051
00056 File(string path);
00057
00059
00065 void setPath(string path);
00066
00068
00073 bool open();
00074
00076
00081 bool write();
00082
00086 Header* header();
00087
00091 Track* track(unsigned int id);
00092
00097 void addTrack(Track* track);
00098
00102 unsigned int numTracks();
00103
00104 protected:
00109 Chunk* readChunk(ifstream& fh);
00110
00111 private:
00112 string _path;
00113
00114 Header *_header;
00115 vector<Track*> _tracks;
00116 };
00117 }
00118
00119 #endif // MIDIFILE_H_