2 * Adplug - Replayer for many OPL2/OPL3 audio file formats.
3 * Copyright (C) 1999 - 2008 Simon Peter, <dn.tlp@gmx.net>, et al.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * mid.h - LAA, SCI, MID & CMF Player by Philip Hassey <philhassey@hotmail.com>
24 class CmidPlayer: public CPlayer
27 static CPlayer *factory(Copl *newopl);
29 CmidPlayer(Copl *newopl);
31 { if(data) delete [] data; }
33 bool load(const std::string &filename, const CFileProvider &fp);
35 void rewind(int subsong);
38 std::string gettype();
39 std::string gettitle()
40 { return std::string(title); }
41 std::string getauthor()
42 { return std::string(author); }
44 { return std::string(remarks); }
45 unsigned int getinstruments()
47 unsigned int getsubsongs()
51 static const unsigned char adlib_opadd[];
52 static const int ops[], map_chan[], fnums[], percussion_map[];
56 unsigned char ins[11];
71 char *author,*title,*remarks,emptystr;
74 unsigned long sierra_pos; //sierras gotta be special.. :>
78 unsigned char adlib_data[256];
81 unsigned char myinsbank[128][16], smyinsbank[128][16];
89 unsigned int curtrack;
98 bool load_sierra_ins(const std::string &fname, const CFileProvider &fp);
99 void midiprintf(const char *format, ...);
100 unsigned char datalook(long pos);
101 unsigned long getnexti(unsigned long num);
102 unsigned long getnext(unsigned long num);
103 unsigned long getval();
104 void sierra_next_section();
105 void midi_write_adlib(unsigned int r, unsigned char v);
106 void midi_fm_instrument(int voice, unsigned char *inst);
107 void midi_fm_percussion(int ch, unsigned char *inst);
108 void midi_fm_volume(int voice, int volume);
109 void midi_fm_playnote(int voice, int note, int volume);
110 void midi_fm_endnote(int voice);
111 void midi_fm_reset();