annotate src/midifile.h @ 34:a14cc6c5d7ef

Possibly fix 64-bit issues. Probably not.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 05 Aug 2013 20:51:20 +0300
parents 785057719d9b
children 1db62040204e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #ifndef _MIDIFILE_H
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 #define _MIDIFILE_H
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
34
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
4 #include "midiinfo.h" /* enumerations and constants for GM */
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
5 #include "mtypes.h"
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
6
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 /*
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 * midiFile.c - Header file for Steevs MIDI Library
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 * Version 1.4
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 * AUTHOR: Steven Goodwin (StevenGoodwin@gmail.com)
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 * Copyright 1998-2010, Steven Goodwin.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 * This program is free software; you can redistribute it and/or
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 * modify it under the terms of the GNU General Public License as
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 * published by the Free Software Foundation; either version 2 of
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 * the License,or (at your option) any later version.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 * This program is distributed in the hope that it will be useful,
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 * GNU General Public License for more details.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 * You should have received a copy of the GNU General Public License
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 * along with this program; if not, write to the Free Software
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29
34
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
30 /*
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 ** All functions start with one of the following prefixes:
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 ** midiFile* For non-GM features that relate to the file, and have
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 ** no use once the file has been created, i.e. CreateFile
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 ** or SetTrack (those data is embedded into the file, but
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 ** not explicitly stored)
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 ** midiSong* For operations that work across the song, i.e. SetTempo
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 ** midiTrack* For operations on a specific track, i.e. AddNoteOn
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 /*
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 ** MIDI Constants
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 #define MIDI_PPQN_DEFAULT 384
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 #define MIDI_VERSION_DEFAULT 1
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 /*
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 ** MIDI Limits
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 #define MAX_MIDI_TRACKS 256
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 #define MAX_TRACK_POLYPHONY 64
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 /*
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 ** MIDI structures, accessibly externably
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 */
34
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
55 typedef void MIDI_FILE;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
56 typedef struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
57 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
58 tMIDI_MSG iType;
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59
34
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
60 Uint32 dt; /* delta time */
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
61 Uint32 dwAbsPos;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
62 Uint32 iMsgSize;
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63
34
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
64 BOOL bImpliedMsg;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
65 tMIDI_MSG iImpliedMsg;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
66
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
67 /* Raw data chunk */
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
68 Uint8 *data; /* dynamic data block */
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
69 Uint32 data_sz;
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
34
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
71 union
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
72 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
73 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
74 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
75 int iNote;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
76 int iChannel;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
77 int iVolume;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
78 } NoteOn;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
79 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
80 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
81 int iNote;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
82 int iChannel;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
83 } NoteOff;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
84 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
85 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
86 int iNote;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
87 int iChannel;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
88 int iPressure;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
89 } NoteKeyPressure;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
90 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
91 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
92 int iChannel;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
93 tMIDI_CC iControl;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
94 int iParam;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
95 } NoteParameter;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
96 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
97 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
98 int iChannel;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
99 int iProgram;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
100 } ChangeProgram;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
101 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
102 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
103 int iChannel;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
104 int iPressure;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
105 } ChangePressure;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
106 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
107 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
108 int iChannel;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
109 int iPitch;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
110 } PitchWheel;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
111 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
112 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
113 tMIDI_META iType;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
114 union
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
115 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
116 int iMIDIPort;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
117 int iSequenceNumber;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
118 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
119 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
120 Uint8 *pData;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
121 } Text;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
122 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
123 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
124 int iBPM;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
125 } Tempo;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
126 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
127 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
128 int iHours, iMins;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
129 int iSecs, iFrames, iFF;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
130 } SMPTE;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
131 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
132 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
133 tMIDI_KEYSIG iKey;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
134 } KeySig;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
135 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
136 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
137 int iNom, iDenom;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
138 } TimeSig;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
139 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
140 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
141 Uint8 *pData;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
142 int iSize;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
143 } Sequencer;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
144 } Data;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
145 } MetaEvent;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
146 struct
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
147 {
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
148 Uint8 *pData;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
149 int iSize;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
150 } SysEx;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
151 } MsgData;
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152
34
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
153 /* State information - Please treat these as private */
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
154 tMIDI_MSG iLastMsgType;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
155 Uint8 iLastMsgChnl;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
156
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
157 } MIDI_MSG;
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
158
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160 /*
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161 ** midiFile* Prototypes
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162 */
34
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
163 MIDI_FILE *midiFileCreate(const char *pFilename, BOOL bOverwriteIfExists);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
164 int midiFileSetTracksDefaultChannel(MIDI_FILE *pMF, int iTrack,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
165 int iChannel);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
166 int midiFileGetTracksDefaultChannel(const MIDI_FILE *pMF, int iTrack);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
167 BOOL midiFileFlushTrack(MIDI_FILE *pMF, int iTrack, BOOL bFlushToEnd,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
168 Uint32 dwEndTimePos);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
169 BOOL midiFileSyncTracks(MIDI_FILE *pMF, int iTrack1, int iTrack2);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
170 int midiFileSetPPQN(MIDI_FILE *pMF, int PPQN);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
171 int midiFileGetPPQN(const MIDI_FILE *pMF);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
172 int midiFileSetVersion(MIDI_FILE *pMF, int iVersion);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
173 int midiFileGetVersion(const MIDI_FILE *pMF);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
174 MIDI_FILE *midiFileOpen(const char *pFilename);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
175 BOOL midiFileClose(MIDI_FILE *pMF);
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
176
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177 /*
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178 ** midiSong* Prototypes
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
179 */
34
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
180 BOOL midiSongAddSMPTEOffset(MIDI_FILE *pMF, int iTrack, int iHours,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
181 int iMins, int iSecs, int iFrames, int iFFrames);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
182 BOOL midiSongAddSimpleTimeSig(MIDI_FILE *pMF, int iTrack, int iNom,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
183 int iDenom);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
184 BOOL midiSongAddTimeSig(MIDI_FILE *pMF, int iTrack, int iNom, int iDenom,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
185 int iClockInMetroTick, int iNotated32nds);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
186 BOOL midiSongAddKeySig(MIDI_FILE *pMF, int iTrack, tMIDI_KEYSIG iKey);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
187 BOOL midiSongAddTempo(MIDI_FILE *pMF, int iTrack, int iTempo);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
188 BOOL midiSongAddMIDIPort(MIDI_FILE *pMF, int iTrack, int iPort);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
189 BOOL midiSongAddEndSequence(MIDI_FILE *pMF, int iTrack);
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
191 /*
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
192 ** midiTrack* Prototypes
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
193 */
34
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
194 BOOL midiTrackAddRaw(MIDI_FILE *pMF, int iTrack, int iDataSize,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
195 const Uint8 * pData, BOOL bMovePtr, int iDeltaTime);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
196 BOOL midiTrackIncTime(MIDI_FILE *pMF, int iTrack, int iDeltaTime,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
197 BOOL bOverridePPQN);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
198 BOOL midiTrackAddText(MIDI_FILE *pMF, int iTrack, tMIDI_TEXT iType,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
199 const char *pTxt);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
200 BOOL midiTrackAddMsg(MIDI_FILE *pMF, int iTrack, tMIDI_MSG iMsg, int iParam1,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
201 int iParam2);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
202 BOOL midiTrackSetKeyPressure(MIDI_FILE *pMF, int iTrack, int iNote,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
203 int iAftertouch);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
204 BOOL midiTrackAddControlChange(MIDI_FILE *pMF, int iTrack, tMIDI_CC iCCType,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
205 int iParam);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
206 BOOL midiTrackAddProgramChange(MIDI_FILE *pMF, int iTrack, int iInstrPatch);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
207 BOOL midiTrackChangeKeyPressure(MIDI_FILE *pMF, int iTrack,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
208 int iDeltaPressure);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
209 BOOL midiTrackSetPitchWheel(MIDI_FILE *pMF, int iTrack, int iWheelPos);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
210 BOOL midiTrackAddNote(MIDI_FILE *pMF, int iTrack, int iNote, int iLength,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
211 int iVol, BOOL bAutoInc, BOOL bOverrideLength);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
212 BOOL midiTrackAddRest(MIDI_FILE *pMF, int iTrack, int iLength,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
213 BOOL bOverridePPQN);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
214 BOOL midiTrackGetEndPos(MIDI_FILE *pMF, int iTrack);
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
215
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
216 /*
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
217 ** midiRead* Prototypes
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
218 */
34
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
219 int midiReadGetNumTracks(const MIDI_FILE *pMF);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
220 BOOL midiReadGetNextMessage(const MIDI_FILE *pMF, int iTrack,
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
221 MIDI_MSG * pMsg);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
222 void midiReadInitMessage(MIDI_MSG * pMsg);
a14cc6c5d7ef Possibly fix 64-bit issues. Probably not.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
223 void midiReadFreeMessage(MIDI_MSG * pMsg);
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
224
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
225
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
226 #endif /* _MIDIFILE_H */