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