xref: /haiku/headers/os/midi2/MidiEndpoint.h (revision ff7afbb32237bb7c385768ba88b8f4ba4788a548)
11df1f394Smahlzeit 
24614b80eSbeveloper #ifndef _MIDI_ENDPOINT_H
34614b80eSbeveloper #define _MIDI_ENDPOINT_H
44614b80eSbeveloper 
54614b80eSbeveloper #include <BeBuild.h>
64614b80eSbeveloper #include <Midi2Defs.h>
74614b80eSbeveloper #include <OS.h>
84614b80eSbeveloper #include <String.h>
94614b80eSbeveloper 
104614b80eSbeveloper class BMidiProducer;
114614b80eSbeveloper class BMidiConsumer;
124614b80eSbeveloper 
13*ff7afbb3Smahlzeit namespace BPrivate { class BMidiRosterLooper; }
14*ff7afbb3Smahlzeit 
154614b80eSbeveloper class BMidiEndpoint
164614b80eSbeveloper {
174614b80eSbeveloper public:
181df1f394Smahlzeit 
194614b80eSbeveloper 	const char* Name() const;
204614b80eSbeveloper 	void SetName(const char* name);
214614b80eSbeveloper 
224614b80eSbeveloper 	int32 ID() const;
234614b80eSbeveloper 
244614b80eSbeveloper 	bool IsProducer() const;
254614b80eSbeveloper 	bool IsConsumer() const;
264614b80eSbeveloper 	bool IsRemote() const;
274614b80eSbeveloper 	bool IsLocal() const;
284614b80eSbeveloper 	bool IsPersistent() const;
294614b80eSbeveloper 	bool IsValid() const;
304614b80eSbeveloper 
314614b80eSbeveloper 	status_t Release();
324614b80eSbeveloper 	status_t Acquire();
334614b80eSbeveloper 
341df1f394Smahlzeit 	status_t SetProperties(const BMessage* properties);
351df1f394Smahlzeit 	status_t GetProperties(BMessage* properties) const;
364614b80eSbeveloper 
374614b80eSbeveloper 	status_t Register(void);
384614b80eSbeveloper 	status_t Unregister(void);
394614b80eSbeveloper 
404614b80eSbeveloper private:
411df1f394Smahlzeit 
424614b80eSbeveloper 	friend class BMidiConsumer;
434614b80eSbeveloper 	friend class BMidiLocalConsumer;
441df1f394Smahlzeit 	friend class BMidiLocalProducer;
451df1f394Smahlzeit 	friend class BMidiProducer;
461df1f394Smahlzeit 	friend class BMidiRoster;
47*ff7afbb3Smahlzeit 	friend class BPrivate::BMidiRosterLooper;
484614b80eSbeveloper 
494614b80eSbeveloper 	BMidiEndpoint(const char* name);
504614b80eSbeveloper 	virtual	~BMidiEndpoint();
514614b80eSbeveloper 
524614b80eSbeveloper 	virtual void _Reserved1();
534614b80eSbeveloper 	virtual void _Reserved2();
544614b80eSbeveloper 	virtual void _Reserved3();
554614b80eSbeveloper 	virtual void _Reserved4();
564614b80eSbeveloper 	virtual void _Reserved5();
574614b80eSbeveloper 	virtual void _Reserved6();
584614b80eSbeveloper 	virtual void _Reserved7();
594614b80eSbeveloper 	virtual void _Reserved8();
604614b80eSbeveloper 
611df1f394Smahlzeit 	status_t SendRegisterRequest(bool);
621df1f394Smahlzeit 	status_t SendChangeRequest(BMessage*);
634614b80eSbeveloper 
641df1f394Smahlzeit 	bool IsRegistered() const;
651df1f394Smahlzeit 	bool LockLooper() const;
661df1f394Smahlzeit 	void UnlockLooper() const;
671df1f394Smahlzeit 
681df1f394Smahlzeit 	int32 id;
691df1f394Smahlzeit 	BString name;
701df1f394Smahlzeit 	int32 refCount;
711df1f394Smahlzeit 	BMessage* properties;
721df1f394Smahlzeit 	bool isLocal;
731df1f394Smahlzeit 	bool isConsumer;
741df1f394Smahlzeit 	bool isRegistered;
751df1f394Smahlzeit 	bool isAlive;
764614b80eSbeveloper 
774614b80eSbeveloper 	uint32 _reserved[4];
784614b80eSbeveloper };
794614b80eSbeveloper 
801df1f394Smahlzeit #endif // _MIDI_ENDPOINT_H
81