xref: /haiku/headers/os/midi2/MidiEndpoint.h (revision 3e216965baa8d58a67bf7372e2bfa13d999f5a9d)
1 
2 #ifndef _MIDI_ENDPOINT_H
3 #define _MIDI_ENDPOINT_H
4 
5 #include <BeBuild.h>
6 #include <Message.h>
7 #include <Midi2Defs.h>
8 #include <OS.h>
9 #include <String.h>
10 
11 class BMidiProducer;
12 class BMidiConsumer;
13 
14 namespace BPrivate { class BMidiRosterLooper; }
15 
16 class BMidiEndpoint
17 {
18 public:
19 
20 	const char *Name() const;
21 	void SetName(const char *name);
22 
23 	int32 ID() const;
24 
25 	bool IsProducer() const;
26 	bool IsConsumer() const;
27 	bool IsRemote() const;
28 	bool IsLocal() const;
29 	bool IsPersistent() const;
30 	bool IsValid() const;
31 
32 	status_t Release();
33 	status_t Acquire();
34 
35 	status_t SetProperties(const BMessage *properties);
36 	status_t GetProperties(BMessage *properties) const;
37 
38 	status_t Register();
39 	status_t Unregister();
40 
41 private:
42 
43 	friend class BMidiConsumer;
44 	friend class BMidiLocalConsumer;
45 	friend class BMidiLocalProducer;
46 	friend class BMidiProducer;
47 	friend class BMidiRoster;
48 	friend class BPrivate::BMidiRosterLooper;
49 
50 	BMidiEndpoint(const char *name);
51 	virtual	~BMidiEndpoint();
52 
53 	virtual void _Reserved1();
54 	virtual void _Reserved2();
55 	virtual void _Reserved3();
56 	virtual void _Reserved4();
57 	virtual void _Reserved5();
58 	virtual void _Reserved6();
59 	virtual void _Reserved7();
60 	virtual void _Reserved8();
61 
62 	status_t SendRegisterRequest(bool);
63 	status_t SendChangeRequest(BMessage *);
64 
65 	bool IsRegistered() const;
66 	bool LockLooper() const;
67 	void UnlockLooper() const;
68 
69 	int32 fId;
70 	BString fName;
71 	int32 fRefCount;
72 	BMessage *fProperties;
73 	bool fIsLocal;
74 	bool fIsConsumer;
75 	bool fIsRegistered;
76 	bool fIsAlive;
77 
78 	uint32 _reserved[4];
79 };
80 
81 #endif // _MIDI_ENDPOINT_H
82