xref: /haiku/src/apps/midiplayer/SynthBridge.h (revision 42bcaa84c0eb475d3f6c49a7a7f4cc8d72083f5b)
1 /*
2  * Copyright (c) 2004 Matthijs Hollemans
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 #ifndef _SYNTH_BRIDGE_H
23 #define _SYNTH_BRIDGE_H
24 
25 
26 #include <MidiConsumer.h>
27 #include <MidiSynth.h>
28 
29 
30 class SynthBridge : public BMidiLocalConsumer {
31 public:
32 	SynthBridge();
33 
34 	bool Init(synth_mode mode);
35 
36 	BMidiSynth* MidiSynth();
37 
38 	virtual void NoteOff(uchar channel, uchar note, uchar velocity,
39 		bigtime_t time);
40 
41 	virtual void NoteOn(uchar channel, uchar note, uchar velocity,
42 		bigtime_t time);
43 
44 	virtual void KeyPressure(uchar channel, uchar note, uchar pressure,
45 		bigtime_t time);
46 
47 	virtual void ControlChange(uchar channel, uchar controlNumber,
48 		uchar controlValue, bigtime_t time);
49 
50 	virtual void ProgramChange(uchar channel, uchar programNumber,
51 		bigtime_t time);
52 
53 	virtual void ChannelPressure( uchar channel, uchar pressure,
54 		bigtime_t time);
55 
56 	virtual void PitchBend(uchar channel, uchar lsb, uchar msb,
57 		bigtime_t time);
58 
59 	virtual void AllNotesOff(bool justChannel, bigtime_t time);
60 
61 protected:
62 	virtual ~SynthBridge() {}
63 
64 private:
65 	BMidiSynth fMidiSynth;
66 };
67 
68 
69 #endif // _SYNTH_BRIDGE_H
70