1/*
2
3MidiDelay.h
4
5Copyright (c) 2002 OpenBeOS.
6
7A filter for Midi Kit 1 that sprays midi events
8when the performance time is reached.
9
10Author:
11	Michael Pfeiffer
12
13Permission is hereby granted, free of charge, to any person obtaining a copy of
14this software and associated documentation files (the "Software"), to deal in
15the Software without restriction, including without limitation the rights to
16use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17of the Software, and to permit persons to whom the Software is furnished to do
18so, subject to the following conditions:
19
20The above copyright notice and this permission notice shall be included in all
21copies or substantial portions of the Software.
22
23THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29THE SOFTWARE.
30
31*/
32
33#ifndef _MIDI_DELAY_H
34#define _MIDI_DELAY_H
35
36#include <Midi.h>
37
38class MidiDelay : public BMidi {
39
40	static inline bigtime_t ToBigtime(uint32 time) { return time * (bigtime_t)1000; }
41
42public:
43
44virtual	void	NoteOff(uchar channel,
45						uchar note,
46						uchar velocity,
47						uint32 time = B_NOW);
48
49virtual	void	NoteOn(uchar channel,
50					   uchar note,
51					   uchar velocity,
52			    	   uint32 time = B_NOW);
53
54virtual	void	KeyPressure(uchar channel,
55							uchar note,
56							uchar pressure,
57							uint32 time = B_NOW);
58
59virtual	void	ControlChange(uchar channel,
60							  uchar controlNumber,
61							  uchar controlValue,
62							  uint32 time = B_NOW);
63
64virtual	void	ProgramChange(uchar channel,
65								uchar programNumber,
66							  	uint32 time = B_NOW);
67
68virtual	void	ChannelPressure(uchar channel,
69								uchar pressure,
70								uint32 time = B_NOW);
71
72virtual	void	PitchBend(uchar channel,
73						  uchar lsb,
74						  uchar msb,
75			    		  uint32 time = B_NOW);
76
77virtual	void	SystemExclusive(void* data,
78								size_t dataLength,
79								uint32 time = B_NOW);
80
81virtual	void	SystemCommon(uchar statusByte,
82							 uchar data1,
83							 uchar data2,
84							 uint32 time = B_NOW);
85
86virtual	void	SystemRealTime(uchar statusByte, uint32 time = B_NOW);
87
88virtual	void	TempoChange(int32 bpm, uint32 time = B_NOW);
89
90virtual void	AllNotesOff(bool justChannel = true, uint32 time = B_NOW);
91};
92
93#endif
94