2 #ifndef _MIDI_CONSUMER_H
3 #define _MIDI_CONSUMER_H
5 #include <MidiEndpoint.h>
7 namespace BPrivate
{ class BMidiRosterLooper
; }
9 class BMidiConsumer
: public BMidiEndpoint
13 bigtime_t
Latency() const;
17 friend class BMidiLocalConsumer
;
18 friend class BMidiLocalProducer
;
19 friend class BMidiRoster
;
20 friend class BPrivate::BMidiRosterLooper
;
22 BMidiConsumer(const char *name
= NULL
);
23 virtual ~BMidiConsumer();
25 virtual void _Reserved1();
26 virtual void _Reserved2();
27 virtual void _Reserved3();
28 virtual void _Reserved4();
29 virtual void _Reserved5();
30 virtual void _Reserved6();
31 virtual void _Reserved7();
32 virtual void _Reserved8();
40 class BMidiLocalConsumer
: public BMidiConsumer
44 BMidiLocalConsumer(const char *name
= NULL
);
46 void SetLatency(bigtime_t latency
);
47 int32
GetProducerID();
49 void SetTimeout(bigtime_t when
, void *data
);
50 virtual void Timeout(void *data
);
53 uchar
*data
, size_t length
, bool atomic
, bigtime_t time
);
56 uchar channel
, uchar note
, uchar velocity
, bigtime_t time
);
59 uchar channel
, uchar note
, uchar velocity
, bigtime_t time
);
61 virtual void KeyPressure(
62 uchar channel
, uchar note
, uchar pressure
, bigtime_t time
);
64 virtual void ControlChange(
65 uchar channel
, uchar controlNumber
, uchar controlValue
,
68 virtual void ProgramChange(
69 uchar channel
, uchar programNumber
, bigtime_t time
);
71 virtual void ChannelPressure(
72 uchar channel
, uchar pressure
, bigtime_t time
);
74 virtual void PitchBend(
75 uchar channel
, uchar lsb
, uchar msb
, bigtime_t time
);
77 virtual void SystemExclusive(
78 void* data
, size_t length
, bigtime_t time
);
80 virtual void SystemCommon(
81 uchar status
, uchar data1
, uchar data2
, bigtime_t time
);
83 virtual void SystemRealTime(uchar status
, bigtime_t time
);
85 virtual void TempoChange(int32 beatsPerMinute
, bigtime_t time
);
87 virtual void AllNotesOff(bool justChannel
, bigtime_t time
);
91 ~BMidiLocalConsumer();
95 friend class BMidiRoster
;
96 friend int32
_midi_event_thread(void *);
98 virtual void _Reserved1();
99 virtual void _Reserved2();
100 virtual void _Reserved3();
101 virtual void _Reserved4();
102 virtual void _Reserved5();
103 virtual void _Reserved6();
104 virtual void _Reserved7();
105 virtual void _Reserved8();
111 int32 fCurrentProducer
;
117 #endif // _MIDI_CONSUMER_H