Mercurial > audlegacy
annotate Plugins/Input/adplug/core/protrack.h @ 1458:f12d7e208b43 trunk
[svn] Update FSF address in copyright notices. Update autotools templates.
author | chainsaw |
---|---|
date | Wed, 02 Aug 2006 15:44:07 -0700 |
parents | 8df427a314a8 |
children | 705d4c089fce |
rev | line source |
---|---|
359 | 1 /* |
2 * Adplug - Replayer for many OPL2/OPL3 audio file formats. | |
3 * Copyright (C) 1999 - 2002 Simon Peter, <dn.tlp@gmx.net>, et al. | |
4 * | |
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. | |
9 * | |
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. | |
14 * | |
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 | |
1458
f12d7e208b43
[svn] Update FSF address in copyright notices. Update autotools templates.
chainsaw
parents:
359
diff
changeset
|
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA |
359 | 18 * |
19 * protrack.h - Generic Protracker Player by Simon Peter <dn.tlp@gmx.net> | |
20 */ | |
21 | |
22 #ifndef H_PROTRACK | |
23 #define H_PROTRACK | |
24 | |
25 #include "player.h" | |
26 | |
27 class CmodPlayer: public CPlayer | |
28 { | |
29 public: | |
30 CmodPlayer(Copl *newopl); | |
31 virtual ~CmodPlayer(); | |
32 | |
33 bool update(); | |
34 void rewind(int subsong); | |
35 float getrefresh(); | |
36 | |
37 unsigned int getpatterns() | |
38 { return nop; }; | |
39 unsigned int getpattern() | |
40 { return order[ord]; }; | |
41 unsigned int getorders() | |
42 { return length; }; | |
43 unsigned int getorder() | |
44 { return ord; }; | |
45 unsigned int getrow() | |
46 { return rw; }; | |
47 unsigned int getspeed() | |
48 { return speed; }; | |
49 | |
50 protected: | |
51 enum Flags {Standard = 0, Decimal = 1, Faust = 2, NoKeyOn = 4}; | |
52 | |
53 struct Instrument { | |
54 unsigned char data[11],arpstart,arpspeed,arppos,arpspdcnt,misc; | |
55 signed char slide; | |
56 } *inst; | |
57 | |
58 struct Tracks { | |
59 unsigned char note,command,inst,param2,param1; | |
60 } **tracks; | |
61 | |
62 unsigned char *order, *arplist, *arpcmd, initspeed; | |
63 unsigned short tempo, activechan, **trackord, bpm, flags, nop; | |
64 unsigned long length, restartpos; | |
65 | |
66 struct Channel { | |
67 unsigned short freq,nextfreq; | |
68 unsigned char oct,vol1,vol2,inst,fx,info1,info2,key,nextoct, | |
69 note,portainfo,vibinfo1,vibinfo2,arppos,arpspdcnt; | |
70 signed char trigger; | |
71 } *channel; | |
72 | |
73 void init_trackord(); | |
74 bool init_specialarp(); | |
75 void init_notetable(const unsigned short *newnotetable); | |
76 bool realloc_order(unsigned long len); | |
77 bool realloc_patterns(unsigned long pats, unsigned long rows, unsigned long chans); | |
78 bool realloc_instruments(unsigned long len); | |
79 | |
80 void dealloc(); | |
81 | |
82 private: | |
83 static const unsigned short sa2_notetable[12]; | |
84 static const unsigned char vibratotab[32]; | |
85 | |
86 unsigned char speed, del, songend, regbd; | |
87 unsigned short rows, notetable[12]; | |
88 unsigned long rw, ord, nrows, npats, nchans; | |
89 | |
90 void setvolume(unsigned char chan); | |
91 void setvolume_alt(unsigned char chan); | |
92 void setfreq(unsigned char chan); | |
93 void playnote(unsigned char chan); | |
94 void setnote(unsigned char chan, int note); | |
95 void slide_down(unsigned char chan, int amount); | |
96 void slide_up(unsigned char chan, int amount); | |
97 void tone_portamento(unsigned char chan, unsigned char info); | |
98 void vibrato(unsigned char chan, unsigned char speed, unsigned char depth); | |
99 void vol_up(unsigned char chan, int amount); | |
100 void vol_down(unsigned char chan, int amount); | |
101 void vol_up_alt(unsigned char chan, int amount); | |
102 void vol_down_alt(unsigned char chan, int amount); | |
103 | |
104 void dealloc_patterns(); | |
105 }; | |
106 | |
107 #endif |