2 * Adplug - Replayer for many OPL2/OPL3 audio file formats.
3 * Copyright (C) 1999 - 2007 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 * protrack.h - Generic Protracker Player by Simon Peter <dn.tlp@gmx.net>
27 class CmodPlayer: public CPlayer
30 CmodPlayer(Copl *newopl);
31 virtual ~CmodPlayer();
34 void rewind(int subsong);
37 unsigned int getpatterns()
39 unsigned int getpattern()
40 { return order[ord]; }
41 unsigned int getorders()
43 unsigned int getorder()
47 unsigned int getspeed()
63 unsigned char data[11],arpstart,arpspeed,arppos,arpspdcnt,misc;
68 unsigned char note,command,inst,param2,param1;
71 unsigned char *order, *arplist, *arpcmd, initspeed;
72 unsigned short tempo, **trackord, bpm, nop;
73 unsigned long length, restartpos, activechan;
77 unsigned short freq,nextfreq;
78 unsigned char oct,vol1,vol2,inst,fx,info1,info2,key,nextoct,
79 note,portainfo,vibinfo1,vibinfo2,arppos,arpspdcnt;
84 bool init_specialarp();
85 void init_notetable(const unsigned short *newnotetable);
86 bool realloc_order(unsigned long len);
87 bool realloc_patterns(unsigned long pats, unsigned long rows, unsigned long chans);
88 bool realloc_instruments(unsigned long len);
93 static const unsigned short sa2_notetable[12];
94 static const unsigned char vibratotab[32];
96 unsigned char speed, del, songend, regbd;
97 unsigned short rows, notetable[12];
98 unsigned long rw, ord, nrows, npats, nchans;
100 void setvolume(unsigned char chan);
101 void setvolume_alt(unsigned char chan);
102 void setfreq(unsigned char chan);
103 void playnote(unsigned char chan);
104 void setnote(unsigned char chan, int note);
105 void slide_down(unsigned char chan, int amount);
106 void slide_up(unsigned char chan, int amount);
107 void tone_portamento(unsigned char chan, unsigned char info);
108 void vibrato(unsigned char chan, unsigned char speed, unsigned char depth);
109 void vol_up(unsigned char chan, int amount);
110 void vol_down(unsigned char chan, int amount);
111 void vol_up_alt(unsigned char chan, int amount);
112 void vol_down_alt(unsigned char chan, int amount);
114 void dealloc_patterns();
115 bool resolve_order();
116 unsigned char set_opl_chip(unsigned char chan);