2002-10-23 16:50:56 +04:00
|
|
|
|
|
|
|
#ifndef _MIDI_ROSTER_H
|
|
|
|
#define _MIDI_ROSTER_H
|
|
|
|
|
|
|
|
#include <Application.h>
|
|
|
|
#include <MidiEndpoint.h>
|
|
|
|
|
|
|
|
enum BMidiOp
|
|
|
|
{
|
|
|
|
B_MIDI_NO_OP,
|
|
|
|
B_MIDI_REGISTERED,
|
|
|
|
B_MIDI_UNREGISTERED,
|
|
|
|
B_MIDI_CONNECTED,
|
|
|
|
B_MIDI_DISCONNECTED,
|
|
|
|
B_MIDI_CHANGED_NAME,
|
|
|
|
B_MIDI_CHANGED_LATENCY,
|
|
|
|
B_MIDI_CHANGED_PROPERTIES
|
|
|
|
};
|
|
|
|
|
|
|
|
#define B_MIDI_EVENT 'MIDI'
|
|
|
|
|
|
|
|
class BMidiProducer;
|
|
|
|
class BMidiConsumer;
|
|
|
|
|
2004-05-13 14:55:10 +04:00
|
|
|
namespace BPrivate
|
|
|
|
{
|
|
|
|
class BMidiRosterLooper;
|
|
|
|
struct BMidiRosterKiller;
|
|
|
|
}
|
|
|
|
|
2002-10-23 16:50:56 +04:00
|
|
|
class BMidiRoster
|
|
|
|
{
|
|
|
|
public:
|
2002-12-31 17:25:02 +03:00
|
|
|
|
2006-09-14 14:04:11 +04:00
|
|
|
static BMidiEndpoint *NextEndpoint(int32 *id);
|
|
|
|
static BMidiProducer *NextProducer(int32 *id);
|
|
|
|
static BMidiConsumer *NextConsumer(int32 *id);
|
2002-10-23 16:50:56 +04:00
|
|
|
|
2006-09-14 14:04:11 +04:00
|
|
|
static BMidiEndpoint *FindEndpoint(int32 id, bool localOnly = false);
|
|
|
|
static BMidiProducer *FindProducer(int32 id, bool localOnly = false);
|
|
|
|
static BMidiConsumer *FindConsumer(int32 id, bool localOnly = false);
|
2002-10-23 16:50:56 +04:00
|
|
|
|
2006-09-14 14:04:11 +04:00
|
|
|
static void StartWatching(const BMessenger *msngr);
|
2002-10-23 16:50:56 +04:00
|
|
|
static void StopWatching();
|
2002-12-31 17:25:02 +03:00
|
|
|
|
2006-09-14 14:04:11 +04:00
|
|
|
static status_t Register(BMidiEndpoint *endp);
|
|
|
|
static status_t Unregister(BMidiEndpoint *endp);
|
2002-12-31 17:25:02 +03:00
|
|
|
|
2006-09-14 14:04:11 +04:00
|
|
|
static BMidiRoster *MidiRoster();
|
2002-10-23 16:50:56 +04:00
|
|
|
|
|
|
|
private:
|
2002-12-31 17:25:02 +03:00
|
|
|
|
2002-10-23 16:50:56 +04:00
|
|
|
friend class BMidiConsumer;
|
2002-12-31 17:25:02 +03:00
|
|
|
friend class BMidiEndpoint;
|
2002-10-23 16:50:56 +04:00
|
|
|
friend class BMidiLocalProducer;
|
|
|
|
friend class BMidiLocalConsumer;
|
2002-12-31 17:25:02 +03:00
|
|
|
friend class BMidiProducer;
|
2004-05-13 14:55:10 +04:00
|
|
|
friend class BPrivate::BMidiRosterLooper;
|
|
|
|
friend struct BPrivate::BMidiRosterKiller;
|
2002-12-31 17:25:02 +03:00
|
|
|
|
|
|
|
BMidiRoster();
|
2002-10-23 16:50:56 +04:00
|
|
|
virtual ~BMidiRoster();
|
|
|
|
|
|
|
|
virtual void _Reserved1();
|
|
|
|
virtual void _Reserved2();
|
|
|
|
virtual void _Reserved3();
|
|
|
|
virtual void _Reserved4();
|
|
|
|
virtual void _Reserved5();
|
|
|
|
virtual void _Reserved6();
|
|
|
|
virtual void _Reserved7();
|
|
|
|
virtual void _Reserved8();
|
|
|
|
|
2002-12-31 17:25:02 +03:00
|
|
|
void CreateLocal(BMidiEndpoint*);
|
|
|
|
void DeleteLocal(BMidiEndpoint*);
|
|
|
|
|
|
|
|
status_t SendRequest(BMessage*, BMessage*);
|
|
|
|
|
2006-06-16 19:38:29 +04:00
|
|
|
BPrivate::BMidiRosterLooper* fLooper;
|
2006-06-17 18:04:46 +04:00
|
|
|
BMessenger *fServer;
|
2002-12-31 17:25:02 +03:00
|
|
|
|
2002-10-23 16:50:56 +04:00
|
|
|
uint32 _reserved[16];
|
|
|
|
};
|
|
|
|
|
2002-12-31 17:25:02 +03:00
|
|
|
#endif // _MIDI_ROSTER_H
|