CLAM-Development  1.4.0
MIDITypes.cxx
Go to the documentation of this file.
1 #include "MIDITypes.hxx"
2 
3 namespace CLAM
4 {
6 
7  void MIDIEvent::DefaultInit()
8  {
9  AddAll();
10  UpdateData();
11  SetTime(0.0);
12  SetLast(false);
13  }
14 
15  unsigned MIDIEvent::Ticks() const
16  {
17  return (unsigned)((GetTime() * 1000.0 * 96.0) / 480.0);
18  }
19 
20  int MIDIEvent::Length() const
21  {
22  return GetMessage().Size();
23  }
24 
25 
27 
28  void MIDITrack::DefaultInit()
29  {
30  AddAll();
31  UpdateData();
32  GetTrackMelody().AddNumberOfNotes();
33  GetTrackMelody().UpdateData();
34  GetTrackMelody().SetNumberOfNotes(0);
35  }
36 
37 
39 
40  void MIDISong::DefaultInit()
41  {
42  AddAll();
43  UpdateData();
44  SetNumberOfTracks(0);
45  }
46 }
47 
48 // END
49