CLAM-Development  1.4.0
read_write_example/main.cxx
Go to the documentation of this file.
1 #include "../MIDISong.hxx"
2 #include "../MIDIReader.hxx"
3 #include "../MIDIWriter.hxx"
4 
5 using namespace MIDI;
6 
7 int main(int argc, char** argv)
8 {
9  char* filein;
10  char* fileout;
11 
12  switch(argc)
13  {
14  case 1:
15  filein="../test.mid";
16  fileout="midi_out.mid";
17  break;
18  case 2:
19  filein=argv[1];
20  fileout="midi_out.mid";
21  break;
22  case 3:
23  filein=argv[1];
24  fileout=argv[2];
25  break;
26  }
27 
28  Song s;
29  Reader r(filein);
30  Writer w(fileout);
31  r.Read(s);
32  w.Write(s);
33  return 0;
34 }
35 
36 // END
37