xref: /haiku/headers/os/midi2/MidiEndpoint.h (revision 80f3aa2d2b709f2e78fac1cc9431d32384748435)
11df1f394Smahlzeit 
24614b80eSbeveloper #ifndef _MIDI_ENDPOINT_H
34614b80eSbeveloper #define _MIDI_ENDPOINT_H
44614b80eSbeveloper 
54614b80eSbeveloper #include <BeBuild.h>
698c9e9e8SJérôme Duval #include <Message.h>
74614b80eSbeveloper #include <Midi2Defs.h>
84614b80eSbeveloper #include <OS.h>
94614b80eSbeveloper #include <String.h>
104614b80eSbeveloper 
114614b80eSbeveloper class BMidiProducer;
124614b80eSbeveloper class BMidiConsumer;
134614b80eSbeveloper 
14ff7afbb3Smahlzeit namespace BPrivate { class BMidiRosterLooper; }
15ff7afbb3Smahlzeit 
164614b80eSbeveloper class BMidiEndpoint
174614b80eSbeveloper {
184614b80eSbeveloper public:
191df1f394Smahlzeit 
204614b80eSbeveloper 	const char *Name() const;
214614b80eSbeveloper 	void SetName(const char *name);
224614b80eSbeveloper 
234614b80eSbeveloper 	int32 ID() const;
244614b80eSbeveloper 
254614b80eSbeveloper 	bool IsProducer() const;
264614b80eSbeveloper 	bool IsConsumer() const;
274614b80eSbeveloper 	bool IsRemote() const;
284614b80eSbeveloper 	bool IsLocal() const;
294614b80eSbeveloper 	bool IsPersistent() const;
304614b80eSbeveloper 	bool IsValid() const;
314614b80eSbeveloper 
324614b80eSbeveloper 	status_t Release();
334614b80eSbeveloper 	status_t Acquire();
344614b80eSbeveloper 
351df1f394Smahlzeit 	status_t SetProperties(const BMessage *properties);
361df1f394Smahlzeit 	status_t GetProperties(BMessage *properties) const;
374614b80eSbeveloper 
38*769952f1SJérôme Duval 	status_t Register();
39*769952f1SJérôme Duval 	status_t Unregister();
404614b80eSbeveloper 
414614b80eSbeveloper private:
421df1f394Smahlzeit 
434614b80eSbeveloper 	friend class BMidiConsumer;
444614b80eSbeveloper 	friend class BMidiLocalConsumer;
451df1f394Smahlzeit 	friend class BMidiLocalProducer;
461df1f394Smahlzeit 	friend class BMidiProducer;
471df1f394Smahlzeit 	friend class BMidiRoster;
48ff7afbb3Smahlzeit 	friend class BPrivate::BMidiRosterLooper;
494614b80eSbeveloper 
504614b80eSbeveloper 	BMidiEndpoint(const char *name);
514614b80eSbeveloper 	virtual	~BMidiEndpoint();
524614b80eSbeveloper 
534614b80eSbeveloper 	virtual void _Reserved1();
544614b80eSbeveloper 	virtual void _Reserved2();
554614b80eSbeveloper 	virtual void _Reserved3();
564614b80eSbeveloper 	virtual void _Reserved4();
574614b80eSbeveloper 	virtual void _Reserved5();
584614b80eSbeveloper 	virtual void _Reserved6();
594614b80eSbeveloper 	virtual void _Reserved7();
604614b80eSbeveloper 	virtual void _Reserved8();
614614b80eSbeveloper 
621df1f394Smahlzeit 	status_t SendRegisterRequest(bool);
631df1f394Smahlzeit 	status_t SendChangeRequest(BMessage *);
644614b80eSbeveloper 
651df1f394Smahlzeit 	bool IsRegistered() const;
661df1f394Smahlzeit 	bool LockLooper() const;
671df1f394Smahlzeit 	void UnlockLooper() const;
681df1f394Smahlzeit 
6960d15308SJérôme Duval 	int32 fId;
7060d15308SJérôme Duval 	BString fName;
7160d15308SJérôme Duval 	int32 fRefCount;
7260d15308SJérôme Duval 	BMessage *fProperties;
7360d15308SJérôme Duval 	bool fIsLocal;
7460d15308SJérôme Duval 	bool fIsConsumer;
7560d15308SJérôme Duval 	bool fIsRegistered;
7660d15308SJérôme Duval 	bool fIsAlive;
774614b80eSbeveloper 
784614b80eSbeveloper 	uint32 _reserved[4];
794614b80eSbeveloper };
804614b80eSbeveloper 
811df1f394Smahlzeit #endif // _MIDI_ENDPOINT_H
82