vfs: check userland buffers before reading them.
[haiku.git] / src / kits / midi / MidiGlue.h
blob97e6cc18b506e94e64bbd75746f4a81ab6a2f872
1 /*
2 * Copyright 2006, Haiku.
3 *
4 * Copyright (c) 2003 Matthijs Hollemans
5 * Copyright (c) 2002 Jerome Leveque
6 * Distributed under the terms of the MIT License.
8 * Authors:
9 * Matthijs Hollemans
10 * Jérôme Leveque
13 #ifndef _MIDI_GLUE_H
14 #define _MIDI_GLUE_H
16 #include <MidiPort.h>
17 #include <MidiConsumer.h>
19 #define MAKE_TIME(t) (t / (bigtime_t)1000)
20 #define MAKE_BIGTIME(t) (t * (bigtime_t)1000)
22 namespace BPrivate {
24 class BMidiGlue: public BMidiLocalConsumer {
25 public:
27 BMidiGlue(BMidi* midiObject, const char* name = NULL);
29 virtual void NoteOff(
30 uchar channel, uchar note, uchar velocity, bigtime_t time);
32 virtual void NoteOn(
33 uchar channel, uchar note, uchar velocity, bigtime_t time);
35 virtual void KeyPressure(
36 uchar channel, uchar note, uchar pressure, bigtime_t time);
38 virtual void ControlChange(
39 uchar channel, uchar controlNumber, uchar controlValue,
40 bigtime_t time);
42 virtual void ProgramChange(
43 uchar channel, uchar programNumber, bigtime_t time);
45 virtual void ChannelPressure(
46 uchar channel, uchar pressure, bigtime_t time);
48 virtual void PitchBend(
49 uchar channel, uchar lsb, uchar msb, bigtime_t time);
51 virtual void SystemExclusive(
52 void* data, size_t length, bigtime_t time);
54 virtual void SystemCommon(
55 uchar status, uchar data1, uchar data2, bigtime_t time);
57 virtual void SystemRealTime(uchar status, bigtime_t time);
59 virtual void TempoChange(int32 beatsPerMinute, bigtime_t time);
61 private:
62 BMidi* fMidiObject;
66 class BMidiPortGlue: public BMidiLocalConsumer {
67 public:
69 BMidiPortGlue(BMidiPort* midiObject, const char* name = NULL);
71 virtual void NoteOff(
72 uchar channel, uchar note, uchar velocity, bigtime_t time);
74 virtual void NoteOn(
75 uchar channel, uchar note, uchar velocity, bigtime_t time);
77 virtual void KeyPressure(
78 uchar channel, uchar note, uchar pressure, bigtime_t time);
80 virtual void ControlChange(
81 uchar channel, uchar controlNumber, uchar controlValue,
82 bigtime_t time);
84 virtual void ProgramChange(
85 uchar channel, uchar programNumber, bigtime_t time);
87 virtual void ChannelPressure(
88 uchar channel, uchar pressure, bigtime_t time);
90 virtual void PitchBend(
91 uchar channel, uchar lsb, uchar msb, bigtime_t time);
93 virtual void SystemExclusive(
94 void* data, size_t length, bigtime_t time);
96 virtual void SystemCommon(
97 uchar status, uchar data1, uchar data2, bigtime_t time);
99 virtual void SystemRealTime(uchar status, bigtime_t time);
101 virtual void TempoChange(int32 beatsPerMinute, bigtime_t time);
103 private:
104 BMidiPort* fMidiObject;
107 } // namespace BPrivate
109 #endif // _MIDI_GLUE_H