2 * Adplug - Replayer for many OPL2/OPL3 audio file formats.
3 * Copyright (C) 1999 - 2006 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 * s3m.h - AdLib S3M Player by Simon Peter <dn.tlp@gmx.net>
27 class Cs3mPlayer: public CPlayer
30 static CPlayer *factory(Copl *newopl);
32 Cs3mPlayer(Copl *newopl);
34 bool load(const std::string &filename, const CFileProvider &fp);
36 void rewind(int subsong);
39 std::string gettype();
40 std::string gettitle()
41 { return std::string(header.name); };
43 unsigned int getpatterns()
44 { return header.patnum; };
45 unsigned int getpattern()
46 { return orders[ord]; };
47 unsigned int getorders()
48 { return (header.ordnum-1); };
49 unsigned int getorder()
53 unsigned int getspeed()
55 unsigned int getinstruments()
56 { return header.insnum; };
57 std::string getinstrument(unsigned int n)
58 { return std::string(inst[n].name); };
62 char name[28]; // song name
63 unsigned char kennung,typ,dummy[2];
64 unsigned short ordnum,insnum,patnum,flags,cwtv,ffi;
66 unsigned char gv,is,it,mv,uc,dp,dummy2[8];
67 unsigned short special;
68 unsigned char chanset[32];
74 unsigned char d00,d01,d02,d03,d04,d05,d06,d07,d08,d09,d0a,d0b,volume,dsk,dummy[2];
76 char dummy2[12], name[28],scri[4];
80 unsigned char note,oct,instrument,volume,command,info;
81 } pattern[99][64][32];
84 unsigned short freq,nextfreq;
85 unsigned char oct,vol,inst,fx,info,dualinfo,key,nextoct,trigger,note;
89 unsigned char orders[256];
90 unsigned char crow,ord,speed,tempo,del,songend,loopstart,loopcnt;
93 static const char chnresolv[];
94 static const unsigned short notetable[12];
95 static const unsigned char vibratotab[32];
97 void load_header(binistream *f, s3mheader *h);
98 void setvolume(unsigned char chan);
99 void setfreq(unsigned char chan);
100 void playnote(unsigned char chan);
101 void slide_down(unsigned char chan, unsigned char amount);
102 void slide_up(unsigned char chan, unsigned char amount);
103 void vibrato(unsigned char chan, unsigned char info);
104 void tone_portamento(unsigned char chan, unsigned char info);