2 #ifndef _MIDI_PRODUCER_H
3 #define _MIDI_PRODUCER_H
7 #include <MidiEndpoint.h>
9 namespace BPrivate
{ class BMidiRosterLooper
; }
11 class BMidiProducer
: public BMidiEndpoint
15 status_t
Connect(BMidiConsumer
*cons
);
16 status_t
Disconnect(BMidiConsumer
*cons
);
17 bool IsConnected(BMidiConsumer
*cons
) const;
18 BList
*Connections() const;
22 friend class BMidiLocalProducer
;
23 friend class BMidiRoster
;
24 friend class BPrivate::BMidiRosterLooper
;
26 BMidiProducer(const char *name
= NULL
);
27 virtual ~BMidiProducer();
29 virtual void _Reserved1();
30 virtual void _Reserved2();
31 virtual void _Reserved3();
32 virtual void _Reserved4();
33 virtual void _Reserved5();
34 virtual void _Reserved6();
35 virtual void _Reserved7();
36 virtual void _Reserved8();
38 status_t
SendConnectRequest(BMidiConsumer
*, bool);
39 void ConnectionMade(BMidiConsumer
*);
40 bool ConnectionBroken(BMidiConsumer
*);
42 int32
CountConsumers() const;
43 BMidiConsumer
*ConsumerAt(int32
) const;
45 bool LockProducer() const;
46 void UnlockProducer() const;
49 mutable BLocker fLocker
;
54 class BMidiLocalProducer
: public BMidiProducer
58 BMidiLocalProducer(const char *name
= NULL
);
60 virtual void Connected(BMidiConsumer
*cons
);
61 virtual void Disconnected(BMidiConsumer
*cons
);
64 void *data
, size_t length
, bool atomic
= false,
65 bigtime_t time
= 0) const;
68 uchar channel
, uchar note
, uchar velocity
,
69 bigtime_t time
= 0) const;
72 uchar channel
, uchar note
, uchar velocity
,
73 bigtime_t time
= 0) const;
75 void SprayKeyPressure(
76 uchar channel
, uchar note
, uchar pressure
,
77 bigtime_t time
= 0) const;
79 void SprayControlChange(
80 uchar channel
, uchar controlNumber
, uchar controlValue
,
81 bigtime_t time
= 0) const;
83 void SprayProgramChange(
84 uchar channel
, uchar programNumber
, bigtime_t time
= 0) const;
86 void SprayChannelPressure(
87 uchar channel
, uchar pressure
, bigtime_t time
= 0) const;
90 uchar channel
, uchar lsb
, uchar msb
, bigtime_t time
= 0) const;
92 void SpraySystemExclusive(
93 void *data
, size_t length
, bigtime_t time
= 0) const;
95 void SpraySystemCommon(
96 uchar status
, uchar data1
, uchar data2
, bigtime_t time
= 0) const;
98 void SpraySystemRealTime(
99 uchar status
, bigtime_t time
= 0) const;
101 void SprayTempoChange(
102 int32 beatsPerMinute
, bigtime_t time
= 0) const;
106 ~BMidiLocalProducer();
111 const void *data
, size_t length
, bool atomic
, bigtime_t time
,
112 bool sysex
= false) const;
114 virtual void _Reserved1();
115 virtual void _Reserved2();
116 virtual void _Reserved3();
117 virtual void _Reserved4();
118 virtual void _Reserved5();
119 virtual void _Reserved6();
120 virtual void _Reserved7();
121 virtual void _Reserved8();
126 #endif // _MIDI_PRODUCER_H