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,5 +1,6 @@
|
||||
#ifndef _MIDI_SINK_H
|
||||
#define _MIDI_SINK_H
|
||||
|
||||
#ifndef _MIDI_CONSUMER_H
|
||||
#define _MIDI_CONSUMER_H
|
||||
|
||||
#include <MidiEndpoint.h>
|
||||
|
||||
@@ -8,14 +9,17 @@ class BMidiDispatcher;
|
||||
class BMidiConsumer : public BMidiEndpoint
|
||||
{
|
||||
public:
|
||||
|
||||
bigtime_t Latency() const;
|
||||
|
||||
private:
|
||||
|
||||
friend class BMidiLocalConsumer;
|
||||
friend class BMidiLocalProducer;
|
||||
friend class BMidiRoster;
|
||||
friend class BMidiRosterLooper;
|
||||
|
||||
BMidiConsumer(const char *name = NULL);
|
||||
BMidiConsumer(const char* name = NULL);
|
||||
virtual ~BMidiConsumer();
|
||||
|
||||
virtual void _Reserved1();
|
||||
@@ -27,8 +31,8 @@ private:
|
||||
virtual void _Reserved7();
|
||||
virtual void _Reserved8();
|
||||
|
||||
port_id fEventPort;
|
||||
bigtime_t fLatency;
|
||||
port_id port;
|
||||
bigtime_t latency;
|
||||
|
||||
uint32 _reserved[2];
|
||||
};
|
||||
@@ -36,51 +40,60 @@ private:
|
||||
class BMidiLocalConsumer : public BMidiConsumer
|
||||
{
|
||||
public:
|
||||
BMidiLocalConsumer(const char *name = NULL);
|
||||
|
||||
BMidiLocalConsumer(const char* name = NULL);
|
||||
|
||||
void SetLatency(bigtime_t latency);
|
||||
int32 GetProducerID(void);
|
||||
|
||||
void SetTimeout(bigtime_t when, void *data);
|
||||
virtual void Timeout(void *data);
|
||||
void SetTimeout(bigtime_t when, void* data);
|
||||
virtual void Timeout(void* data);
|
||||
|
||||
virtual void Data(uchar *data, size_t length, bool atomic,
|
||||
bigtime_t time);
|
||||
// Raw Midi data has been received.
|
||||
// The default implementation calls one of the virtuals below:
|
||||
virtual void Data(
|
||||
uchar* data, size_t length, bool atomic, bigtime_t time);
|
||||
|
||||
virtual void NoteOff(uchar channel, uchar note, uchar velocity,
|
||||
bigtime_t time);
|
||||
virtual void NoteOn(uchar channel, uchar note, uchar velocity,
|
||||
bigtime_t time);
|
||||
virtual void KeyPressure(uchar channel, uchar note, uchar pressure,
|
||||
bigtime_t time);
|
||||
virtual void ControlChange(uchar channel, uchar controlNumber,
|
||||
uchar controlValue,
|
||||
bigtime_t time);
|
||||
virtual void ProgramChange(uchar channel, uchar programNumber,
|
||||
bigtime_t time);
|
||||
virtual void ChannelPressure(uchar channel, uchar pressure,
|
||||
bigtime_t time);
|
||||
virtual void PitchBend(uchar channel, uchar lsb, uchar msb,
|
||||
bigtime_t time);
|
||||
virtual void SystemExclusive(void* data, size_t dataLength,
|
||||
bigtime_t time);
|
||||
virtual void SystemCommon(uchar statusByte, uchar data1, uchar data2,
|
||||
bigtime_t time);
|
||||
virtual void SystemRealTime(uchar statusByte,
|
||||
bigtime_t time);
|
||||
virtual void TempoChange(int32 bpm,
|
||||
bigtime_t time);
|
||||
virtual void AllNotesOff(bool justChannel,
|
||||
bigtime_t time);
|
||||
virtual void NoteOff(
|
||||
uchar channel, uchar note, uchar velocity, bigtime_t time);
|
||||
|
||||
virtual void NoteOn(
|
||||
uchar channel, uchar note, uchar velocity, bigtime_t time);
|
||||
|
||||
virtual void KeyPressure(
|
||||
uchar channel, uchar note, uchar pressure, bigtime_t time);
|
||||
|
||||
virtual void ControlChange(
|
||||
uchar channel, uchar controlNumber, uchar controlValue,
|
||||
bigtime_t time);
|
||||
|
||||
virtual void ProgramChange(
|
||||
uchar channel, uchar programNumber, bigtime_t time);
|
||||
|
||||
virtual void ChannelPressure(
|
||||
uchar channel, uchar pressure, bigtime_t time);
|
||||
|
||||
virtual void PitchBend(
|
||||
uchar channel, uchar lsb, uchar msb, bigtime_t time);
|
||||
|
||||
virtual void SystemExclusive(
|
||||
void* data, size_t dataLength, bigtime_t time);
|
||||
|
||||
virtual void SystemCommon(
|
||||
uchar status, uchar data1, uchar data2, bigtime_t time);
|
||||
|
||||
virtual void SystemRealTime(uchar status, bigtime_t time);
|
||||
|
||||
virtual void TempoChange(int32 beatsPerMinute, bigtime_t time);
|
||||
|
||||
virtual void AllNotesOff(bool justChannel, bigtime_t time);
|
||||
|
||||
protected:
|
||||
|
||||
~BMidiLocalConsumer();
|
||||
|
||||
private:
|
||||
|
||||
friend class BMidiRoster;
|
||||
friend class BMidiDispatcher;
|
||||
friend class BMidiRoster;
|
||||
|
||||
virtual void _Reserved1();
|
||||
virtual void _Reserved2();
|
||||
@@ -91,12 +104,12 @@ private:
|
||||
virtual void _Reserved7();
|
||||
virtual void _Reserved8();
|
||||
|
||||
BMidiDispatcher *fDispatcher;
|
||||
BMidiDispatcher* fDispatcher;
|
||||
bigtime_t fTimeout;
|
||||
void *fTimeoutData;
|
||||
void* fTimeoutData;
|
||||
|
||||
int32 fCurrentProducer;
|
||||
uint32 _reserved[1];
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // _MIDI_CONSUMER_H
|
||||
|
||||
Reference in New Issue
Block a user