2 * Copyright 2006, Haiku.
4 * Copyright (c) 2003 Matthijs Hollemans
5 * Copyright (c) 2002 Jerome Leveque
6 * Distributed under the terms of the MIT License.
17 #include <MidiConsumer.h>
19 #define MAKE_TIME(t) (t / (bigtime_t)1000)
20 #define MAKE_BIGTIME(t) (t * (bigtime_t)1000)
24 class BMidiGlue
: public BMidiLocalConsumer
{
27 BMidiGlue(BMidi
* midiObject
, const char* name
= NULL
);
30 uchar channel
, uchar note
, uchar velocity
, bigtime_t time
);
33 uchar channel
, uchar note
, uchar velocity
, bigtime_t time
);
35 virtual void KeyPressure(
36 uchar channel
, uchar note
, uchar pressure
, bigtime_t time
);
38 virtual void ControlChange(
39 uchar channel
, uchar controlNumber
, uchar controlValue
,
42 virtual void ProgramChange(
43 uchar channel
, uchar programNumber
, bigtime_t time
);
45 virtual void ChannelPressure(
46 uchar channel
, uchar pressure
, bigtime_t time
);
48 virtual void PitchBend(
49 uchar channel
, uchar lsb
, uchar msb
, bigtime_t time
);
51 virtual void SystemExclusive(
52 void* data
, size_t length
, bigtime_t time
);
54 virtual void SystemCommon(
55 uchar status
, uchar data1
, uchar data2
, bigtime_t time
);
57 virtual void SystemRealTime(uchar status
, bigtime_t time
);
59 virtual void TempoChange(int32 beatsPerMinute
, bigtime_t time
);
66 class BMidiPortGlue
: public BMidiLocalConsumer
{
69 BMidiPortGlue(BMidiPort
* midiObject
, const char* name
= NULL
);
72 uchar channel
, uchar note
, uchar velocity
, bigtime_t time
);
75 uchar channel
, uchar note
, uchar velocity
, bigtime_t time
);
77 virtual void KeyPressure(
78 uchar channel
, uchar note
, uchar pressure
, bigtime_t time
);
80 virtual void ControlChange(
81 uchar channel
, uchar controlNumber
, uchar controlValue
,
84 virtual void ProgramChange(
85 uchar channel
, uchar programNumber
, bigtime_t time
);
87 virtual void ChannelPressure(
88 uchar channel
, uchar pressure
, bigtime_t time
);
90 virtual void PitchBend(
91 uchar channel
, uchar lsb
, uchar msb
, bigtime_t time
);
93 virtual void SystemExclusive(
94 void* data
, size_t length
, bigtime_t time
);
96 virtual void SystemCommon(
97 uchar status
, uchar data1
, uchar data2
, bigtime_t time
);
99 virtual void SystemRealTime(uchar status
, bigtime_t time
);
101 virtual void TempoChange(int32 beatsPerMinute
, bigtime_t time
);
104 BMidiPort
* fMidiObject
;
107 } // namespace BPrivate
109 #endif // _MIDI_GLUE_H