xref: /haiku/headers/os/midi2/MidiRoster.h (revision 51978af14a173e7fae0563b562be5603bc652aeb)
1 
2 #ifndef _MIDI_ROSTER_H
3 #define _MIDI_ROSTER_H
4 
5 #include <Application.h>
6 #include <MidiEndpoint.h>
7 
8 enum BMidiOp
9 {
10 	B_MIDI_NO_OP,
11 	B_MIDI_REGISTERED,
12 	B_MIDI_UNREGISTERED,
13 	B_MIDI_CONNECTED,
14 	B_MIDI_DISCONNECTED,
15 	B_MIDI_CHANGED_NAME,
16 	B_MIDI_CHANGED_LATENCY,
17 	B_MIDI_CHANGED_PROPERTIES
18 };
19 
20 #define B_MIDI_EVENT 'MIDI'
21 
22 class BMidiProducer;
23 class BMidiConsumer;
24 
25 class BMidiRoster
26 {
27 public:
28 
29 	static BMidiEndpoint* NextEndpoint(int32* id);
30 	static BMidiProducer* NextProducer(int32* id);
31 	static BMidiConsumer* NextConsumer(int32* id);
32 
33 	static BMidiEndpoint* FindEndpoint(int32 id, bool localOnly = false);
34 	static BMidiProducer* FindProducer(int32 id, bool localOnly = false);
35 	static BMidiConsumer* FindConsumer(int32 id, bool localOnly = false);
36 
37 	static void StartWatching(const BMessenger* msngr);
38 	static void StopWatching();
39 
40 	static status_t Register(BMidiEndpoint* endp);
41 	static status_t Unregister(BMidiEndpoint* endp);
42 
43 	static BMidiRoster* MidiRoster();
44 
45 private:
46 
47 	friend class BMidiConsumer;
48 	friend class BMidiEndpoint;
49 	friend class BMidiLocalProducer;
50 	friend class BMidiLocalConsumer;
51 	friend class BMidiProducer;
52 	friend class BMidiRosterKiller;
53 	friend class BMidiRosterLooper;
54 
55 	BMidiRoster();
56 	virtual ~BMidiRoster();
57 
58 	virtual void _Reserved1();
59 	virtual void _Reserved2();
60 	virtual void _Reserved3();
61 	virtual void _Reserved4();
62 	virtual void _Reserved5();
63 	virtual void _Reserved6();
64 	virtual void _Reserved7();
65 	virtual void _Reserved8();
66 
67 	void CreateLocal(BMidiEndpoint*);
68 	void DeleteLocal(BMidiEndpoint*);
69 
70 	status_t SendRequest(BMessage*, BMessage*);
71 
72 	BMidiRosterLooper* looper;
73 	BMessenger* server;
74 
75 	uint32 _reserved[16];
76 };
77 
78 #endif // _MIDI_ROSTER_H
79