Checkin of the source code for midi2 kit milestone 1.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2335 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,24 +1,28 @@
|
||||
#ifndef _MIDI_SOURCE_H
|
||||
#define _MIDI_SOURCE_H
|
||||
|
||||
#ifndef _MIDI_PRODUCER_H
|
||||
#define _MIDI_PRODUCER_H
|
||||
|
||||
#include <Locker.h>
|
||||
#include <MidiEndpoint.h>
|
||||
|
||||
class BMidiEvent;
|
||||
class BList;
|
||||
|
||||
class BMidiProducer : public BMidiEndpoint
|
||||
{
|
||||
public:
|
||||
status_t Connect(BMidiConsumer *toObject);
|
||||
status_t Disconnect(BMidiConsumer *toObject);
|
||||
bool IsConnected(BMidiConsumer *toObject) const;
|
||||
|
||||
status_t Connect(BMidiConsumer* cons);
|
||||
status_t Disconnect(BMidiConsumer* cons);
|
||||
bool IsConnected(BMidiConsumer* cons) const;
|
||||
BList* Connections() const;
|
||||
|
||||
private:
|
||||
|
||||
friend class BMidiLocalProducer;
|
||||
friend class BMidiRoster;
|
||||
friend class BMidiRosterLooper;
|
||||
|
||||
BMidiProducer(const char *name = NULL);
|
||||
BMidiProducer(const char* name = NULL);
|
||||
virtual ~BMidiProducer();
|
||||
|
||||
virtual void _Reserved1();
|
||||
@@ -29,54 +33,80 @@ private:
|
||||
virtual void _Reserved6();
|
||||
virtual void _Reserved7();
|
||||
virtual void _Reserved8();
|
||||
|
||||
BMidiList *fConnections;
|
||||
mutable BLocker fLock;
|
||||
|
||||
int fConnectionCount;
|
||||
uint32 _reserved[1];
|
||||
|
||||
status_t SendConnectRequest(BMidiConsumer*, bool);
|
||||
void ConnectionMade(BMidiConsumer*);
|
||||
bool ConnectionBroken(BMidiConsumer*);
|
||||
|
||||
int32 CountConsumers() const;
|
||||
BMidiConsumer* ConsumerAt(int32) const;
|
||||
|
||||
bool LockProducer() const;
|
||||
void UnlockProducer() const;
|
||||
|
||||
BList* connections;
|
||||
BLocker* locker;
|
||||
|
||||
uint32 _reserved[10];
|
||||
};
|
||||
|
||||
class BMidiLocalProducer : public BMidiProducer
|
||||
{
|
||||
public:
|
||||
BMidiLocalProducer(const char *name = NULL);
|
||||
|
||||
BMidiLocalProducer(const char* name = NULL);
|
||||
|
||||
virtual void Connected(BMidiConsumer *dest);
|
||||
virtual void Disconnected(BMidiConsumer *dest);
|
||||
virtual void Connected(BMidiConsumer* cons);
|
||||
virtual void Disconnected(BMidiConsumer* cons);
|
||||
|
||||
// Spray some MIDI data downstream to the targets of this object
|
||||
void SprayData(void *data, size_t length,
|
||||
bool atomic = false, bigtime_t time = 0) const;
|
||||
void SprayData(
|
||||
void* data, size_t length, bool atomic = false,
|
||||
bigtime_t time = 0) const;
|
||||
|
||||
void SprayNoteOff(uchar channel, uchar note, uchar velocity,
|
||||
bigtime_t time = 0) const;
|
||||
void SprayNoteOn(uchar channel, uchar note, uchar velocity,
|
||||
bigtime_t time = 0) const;
|
||||
void SprayKeyPressure(uchar channel, uchar note, uchar pressure,
|
||||
bigtime_t time = 0) const;
|
||||
void SprayControlChange(uchar channel, uchar controlNumber,
|
||||
uchar controlValue, bigtime_t time = 0) const;
|
||||
void SprayProgramChange(uchar channel, uchar programNumber,
|
||||
bigtime_t time = 0) const;
|
||||
void SprayChannelPressure(uchar channel, uchar pressure,
|
||||
bigtime_t time = 0) const;
|
||||
void SprayPitchBend(uchar channel, uchar lsb, uchar msb,
|
||||
bigtime_t time = 0) const;
|
||||
void SpraySystemExclusive(void* data, size_t dataLength,
|
||||
bigtime_t time = 0) const;
|
||||
void SpraySystemCommon(uchar statusByte, uchar data1, uchar data2,
|
||||
bigtime_t time = 0) const;
|
||||
void SpraySystemRealTime(uchar statusByte,
|
||||
bigtime_t time = 0) const;
|
||||
void SprayTempoChange(int32 bpm,
|
||||
bigtime_t time = 0) const;
|
||||
void SprayNoteOff(
|
||||
uchar channel, uchar note, uchar velocity,
|
||||
bigtime_t time = 0) const;
|
||||
|
||||
void SprayNoteOn(
|
||||
uchar channel, uchar note, uchar velocity,
|
||||
bigtime_t time = 0) const;
|
||||
|
||||
void SprayKeyPressure(
|
||||
uchar channel, uchar note, uchar pressure,
|
||||
bigtime_t time = 0) const;
|
||||
|
||||
void SprayControlChange(
|
||||
uchar channel, uchar controlNumber, uchar controlValue,
|
||||
bigtime_t time = 0) const;
|
||||
|
||||
void SprayProgramChange(
|
||||
uchar channel, uchar programNumber, bigtime_t time = 0) const;
|
||||
|
||||
void SprayChannelPressure(
|
||||
uchar channel, uchar pressure, bigtime_t time = 0) const;
|
||||
|
||||
void SprayPitchBend(
|
||||
uchar channel, uchar lsb, uchar msb, bigtime_t time = 0) const;
|
||||
|
||||
void SpraySystemExclusive(
|
||||
void* data, size_t dataLength, bigtime_t time = 0) const;
|
||||
|
||||
void SpraySystemCommon(
|
||||
uchar status, uchar data1, uchar data2, bigtime_t time = 0) const;
|
||||
|
||||
void SpraySystemRealTime(
|
||||
uchar status, bigtime_t time = 0) const;
|
||||
|
||||
void SprayTempoChange(
|
||||
int32 beatsPerMinute, bigtime_t time = 0) const;
|
||||
|
||||
protected:
|
||||
|
||||
~BMidiLocalProducer();
|
||||
|
||||
private:
|
||||
void SprayEvent(BMidiEvent *event, size_t length) const;
|
||||
|
||||
//void SprayEvent(BMidiEvent* event, size_t length) const;
|
||||
|
||||
virtual void _Reserved1();
|
||||
virtual void _Reserved2();
|
||||
@@ -90,4 +120,4 @@ private:
|
||||
uint32 _reserved[2];
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // _MIDI_PRODUCER_H
|
||||
|
||||
Reference in New Issue
Block a user