00001 /* ScummVM - Graphic Adventure Engine00002 *00003 * ScummVM is the legal property of its developers, whose names00004 * are too numerous to list here. Please refer to the COPYRIGHT00005 * file distributed with this source distribution.00006 *00007 * This program is free software; you can redistribute it and/or00008 * modify it under the terms of the GNU General Public License00009 * as published by the Free Software Foundation; either version 200010 * of the License, or (at your option) any later version.00011 *00012 * This program is distributed in the hope that it will be useful,00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the00015 * GNU General Public License for more details.00016 *00017 * You should have received a copy of the GNU General Public License00018 * along with this program; if not, write to the Free Software00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.00020 *00021 */00022
00023 #ifndef AUDIO_MPU401_H00024 #define AUDIO_MPU401_H00025
00026 #include "audio/mididrv.h"00027
00029 //00030 // Common MPU401 implementation methods00031 //00033
00034class MidiChannel_MPU401 : publicMidiChannel {
00035
00036 private:
00037MidiDriver *_owner;
00038bool_allocated;
00039byte_channel;
00040
00041 public:
00042 MidiDriver *device();
00043bytegetNumber() { return_channel; }
00044virtualvoidrelease() { _allocated = false; }
00045
00046 virtualvoidsend(uint32 b);
00047
00048 // Regular messages00049 virtualvoidnoteOff(byte note);
00050 virtualvoidnoteOn(byte note, byte velocity);
00051 virtualvoidprogramChange(byte program);
00052 virtualvoidpitchBend(int16 bend);
00053
00054 // Control Change messages00055 virtualvoidcontrolChange(byte control, byte value);
00056 virtualvoidpitchBendFactor(byte value);
00057
00058 // SysEx messages00059 virtualvoidsysEx_customInstrument(uint32type, constbyte *instr);
00060
00061 // Only to be called by the owner00062 voidinit(MidiDriver *owner, byte channel);
00063 boolallocate();
00064 };
00065
00066
00067
00068class MidiDriver_MPU401 : publicMidiDriver {
00069 private:
00070MidiChannel_MPU401_midi_channels[16];
00071Common::TimerManager::TimerProc_timer_proc;
00072uint16_channel_mask;
00073
00074 public:
00075 MidiDriver_MPU401();
00076 virtual~MidiDriver_MPU401();
00077
00078 virtualvoidclose();
00079 virtualvoidsetTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc);
00080virtualuint32getBaseTempo(void) { return 10000; }
00081 virtualuint32property(int prop, uint32 param);
00082
00083 virtualMidiChannel *allocateChannel();
00084virtualMidiChannel *getPercussionChannel() { return &_midi_channels[9]; }
00085 };
00086
00087
00088 #endif
Generated on Sat Feb 16 2019 05:00:59 for ResidualVM by 1.7.1