2 * Copyright 2006, Haiku.
4 * Copyright (c) 2002-2003 Matthijs Hollemans
5 * Copyright (c) 2002 Jerome Leveque
6 * Copyright (c) 2002 Paul Stadler
7 * Distributed under the terms of the MIT License.
21 BMidiText::BMidiText()
27 BMidiText::~BMidiText()
35 uchar channel
, uchar note
, uchar velocity
, uint32 time
)
39 "B_NOTE OFF; channel = %d, note = %d, velocity = %d\n",
40 channel
, note
, velocity
);
46 uchar channel
, uchar note
, uchar velocity
, uint32 time
)
50 "B_NOTE ON; channel = %d, note = %d, velocity = %d\n",
51 channel
, note
, velocity
);
56 BMidiText::KeyPressure(
57 uchar channel
, uchar note
, uchar pressure
, uint32 time
)
61 "KEY PRESSURE; channel = %d, note = %d, pressure = %d\n",
62 channel
, note
, pressure
);
67 BMidiText::ControlChange(
68 uchar channel
, uchar controlNumber
, uchar controlValue
, uint32 time
)
72 "CONTROL CHANGE; channel = %d, control = %d, value = %d\n",
73 channel
, controlNumber
, controlValue
);
78 BMidiText::ProgramChange(
79 uchar channel
, uchar programNumber
, uint32 time
)
83 "PROGRAM CHANGE; channel = %d, program = %d\n",
84 channel
, programNumber
);
89 BMidiText::ChannelPressure(uchar channel
, uchar pressure
, uint32 time
)
93 "CHANNEL PRESSURE; channel = %d, pressure = %d\n",
99 BMidiText::PitchBend(uchar channel
, uchar lsb
, uchar msb
, uint32 time
)
103 "PITCH BEND; channel = %d, lsb = %d, msb = %d\n",
109 BMidiText::SystemExclusive(void* data
, size_t length
, uint32 time
)
113 printf("SYSTEM EXCLUSIVE;\n");
114 for (size_t t
= 0; t
< length
; ++t
)
115 printf("%02X ", ((uint8
*) data
)[t
]);
121 BMidiText::SystemCommon(
122 uchar status
, uchar data1
, uchar data2
, uint32 time
)
126 "SYSTEM COMMON; status = %d, data1 = %d, data2 = %d\n",
127 status
, data1
, data2
);
132 BMidiText::SystemRealTime(uchar status
, uint32 time
)
135 printf("SYSTEM REAL TIME; status = %d\n", status
);
140 BMidiText::ResetTimer(bool start
)
142 fStartTime
= start
? B_NOW
: 0;
146 void BMidiText::_ReservedMidiText1() { }
147 void BMidiText::_ReservedMidiText2() { }
148 void BMidiText::_ReservedMidiText3() { }
154 while (KeepRunning())
160 BMidiText::_WaitAndPrint(uint32 time
)
167 printf("%" B_PRIu32
": ", time
- fStartTime
);