aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/MacOSX/Wrapper/MidiFile.pas
blob: 9ae684f44eff3355cb90292e63f13347f49fe25a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
unit MidiFile;

{$INCLUDE ../Platform.inc}

interface

type

  TMidiEvent = record
    event: byte;
    data1: byte;
    data2: byte;
    str: string;
    dticks: integer;
    time: integer;
    mtime: integer;
    len: integer;
  end;
  PMidiEvent = ^TMidiEvent;

  TOnMidiEvent = procedure(event: PMidiEvent) of object;


  TMidiTrack = class
  private
  public
    OnMidiEvent: TOnMidiEvent;
    function getEventCount: integer;
    function getEvent(index: integer): PMidiEvent;
  end;

  TMidiFile = class
  private
    FOnMidiEvent : TOnMidiEvent;
  public
    TicksPerQuarter,
    NumberOfTracks,
    BPM : Integer;
    Filename : String;
    Constructor Create(AParent : TObject);
    procedure StartPlaying;
    procedure StopPlaying;
    procedure ReadFile;
    function GetTrack(index: integer): TMidiTrack;
    function getCurrentTime: integer;
    function getTrackLength: integer;
    property OnMidiEvent: TOnMidiEvent read FOnMidiEvent write FOnMidiEvent;
  end;


implementation

{ TMidiFile }

constructor TMidiFile.Create(AParent: TObject);
begin

end;

function TMidiFile.getCurrentTime: integer;
begin

end;

function TMidiFile.GetTrack(index: integer): TMidiTrack;
begin
    Result := TMidiTrack.Create;
end;

function TMidiFile.getTrackLength: integer;
begin

end;

procedure TMidiFile.ReadFile;
begin

end;

procedure TMidiFile.StartPlaying;
begin

end;

procedure TMidiFile.StopPlaying;
begin

end;

{ TMidiTrack }

function TMidiTrack.getEvent(index: integer): PMidiEvent;
begin

end;

function TMidiTrack.getEventCount: integer;
begin

end;

end.