Fix FreeBSD build.
[haiku.git] / headers / os / midi2 / MidiProducer.h
blobf138a56735500e144f14529e9c42662a1f0e5a41
2 #ifndef _MIDI_PRODUCER_H
3 #define _MIDI_PRODUCER_H
5 #include <List.h>
6 #include <Locker.h>
7 #include <MidiEndpoint.h>
9 namespace BPrivate { class BMidiRosterLooper; }
11 class BMidiProducer : public BMidiEndpoint
13 public:
15 status_t Connect(BMidiConsumer *cons);
16 status_t Disconnect(BMidiConsumer *cons);
17 bool IsConnected(BMidiConsumer *cons) const;
18 BList *Connections() const;
20 private:
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;
48 BList *fConnections;
49 mutable BLocker fLocker;
51 uint32 _reserved[2];
54 class BMidiLocalProducer : public BMidiProducer
56 public:
58 BMidiLocalProducer(const char *name = NULL);
60 virtual void Connected(BMidiConsumer *cons);
61 virtual void Disconnected(BMidiConsumer *cons);
63 void SprayData(
64 void *data, size_t length, bool atomic = false,
65 bigtime_t time = 0) const;
67 void SprayNoteOff(
68 uchar channel, uchar note, uchar velocity,
69 bigtime_t time = 0) const;
71 void SprayNoteOn(
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;
89 void SprayPitchBend(
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;
104 protected:
106 ~BMidiLocalProducer();
108 private:
110 void SprayEvent(
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();
123 uint32 _reserved[2];
126 #endif // _MIDI_PRODUCER_H