read_write_example/main.cxx
Go to the documentation of this file.00001 #include "../MIDISong.hxx"
00002 #include "../MIDIReader.hxx"
00003 #include "../MIDIWriter.hxx"
00004
00005 using namespace MIDI;
00006
00007 int main(int argc, char** argv)
00008 {
00009 char* filein;
00010 char* fileout;
00011
00012 switch(argc)
00013 {
00014 case 1:
00015 filein="../test.mid";
00016 fileout="midi_out.mid";
00017 break;
00018 case 2:
00019 filein=argv[1];
00020 fileout="midi_out.mid";
00021 break;
00022 case 3:
00023 filein=argv[1];
00024 fileout=argv[2];
00025 break;
00026 }
00027
00028 Song s;
00029 Reader r(filein);
00030 Writer w(fileout);
00031 r.Read(s);
00032 w.Write(s);
00033 return 0;
00034 }
00035
00036
00037