bin/pc: Mark non-returning function as void
[haiku.git] / headers / os / midi / Midi.h
blobfcada5b26a18b18cf26e2c1628454e21ecea88e1
2 #ifndef _MIDI_H
3 #define _MIDI_H
5 #include <BeBuild.h>
6 #include <MidiDefs.h>
7 #include <OS.h>
9 class BList;
10 class BMidiLocalProducer;
11 class BMidiLocalConsumer;
13 class BMidi {
14 public:
16 BMidi();
17 virtual ~BMidi();
19 virtual void NoteOff(
20 uchar channel, uchar note, uchar velocity, uint32 time = B_NOW);
22 virtual void NoteOn(
23 uchar channel, uchar note, uchar velocity, uint32 time = B_NOW);
25 virtual void KeyPressure(
26 uchar channel, uchar note, uchar pressure, uint32 time = B_NOW);
28 virtual void ControlChange(
29 uchar channel, uchar controlNumber, uchar controlValue,
30 uint32 time = B_NOW);
32 virtual void ProgramChange(
33 uchar channel, uchar programNumber, uint32 time = B_NOW);
35 virtual void ChannelPressure(
36 uchar channel, uchar pressure, uint32 time = B_NOW);
38 virtual void PitchBend(
39 uchar channel, uchar lsb, uchar msb, uint32 time = B_NOW);
41 virtual void SystemExclusive(
42 void* data, size_t length, uint32 time = B_NOW);
44 virtual void SystemCommon(
45 uchar status, uchar data1, uchar data2, uint32 time = B_NOW);
47 virtual void SystemRealTime(uchar status, uint32 time = B_NOW);
49 virtual void TempoChange(int32 beatsPerMinute, uint32 time = B_NOW);
51 virtual void AllNotesOff(bool justChannel = true, uint32 time = B_NOW);
53 virtual status_t Start();
54 virtual void Stop();
56 bool IsRunning() const;
58 void Connect(BMidi* toObject);
59 void Disconnect(BMidi* fromObject);
60 bool IsConnected(BMidi* toObject) const;
61 BList* Connections() const;
63 void SnoozeUntil(uint32 time) const;
65 protected:
67 void SprayNoteOff(
68 uchar channel, uchar note, uchar velocity, uint32 time) const;
70 void SprayNoteOn(
71 uchar channel, uchar note, uchar velocity, uint32 time) const;
73 void SprayKeyPressure(
74 uchar channel, uchar note, uchar pressure, uint32 time) const;
76 void SprayControlChange(
77 uchar channel, uchar controlNumber, uchar controlValue,
78 uint32 time) const;
80 void SprayProgramChange(
81 uchar channel, uchar programNumber, uint32 time) const;
83 void SprayChannelPressure(
84 uchar channel, uchar pressure, uint32 time) const;
86 void SprayPitchBend(
87 uchar channel, uchar lsb, uchar msb, uint32 time) const;
89 void SpraySystemExclusive(
90 void* data, size_t length, uint32 time = B_NOW) const;
92 void SpraySystemCommon(
93 uchar status, uchar data1, uchar data2, uint32 time) const;
95 void SpraySystemRealTime(uchar status, uint32 time) const;
97 void SprayTempoChange(int32 beatsPerMinute, uint32 time) const;
99 bool KeepRunning();
101 private:
103 friend status_t _run_thread(void* data);
105 virtual void _ReservedMidi1();
106 virtual void _ReservedMidi2();
107 virtual void _ReservedMidi3();
109 virtual void Run();
111 BMidiLocalProducer* fProducer;
112 BMidiLocalConsumer* fConsumer;
114 BList* fConnections;
115 volatile thread_id fThreadId;
116 volatile bool fIsRunning;
118 uint32 _reserved2[5];
121 #endif // _MIDI_H