Mercurial > audlegacy-plugins
annotate src/adplug/core/protrack.h @ 2138:76f9a4168708
Fix linking with libaudid3tag
Linking with libaudid3tag from /usr/lib/audacious, add rpath (affected to tta,
shnplug and madplug plugins)
| author | Vitaly Lipatov <lav@etersoft.ru> |
|---|---|
| date | Sat, 27 Oct 2007 19:34:46 -0500 |
| parents | 87666f9bf6d0 |
| children |
| rev | line source |
|---|---|
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1 /* |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
2 * Adplug - Replayer for many OPL2/OPL3 audio file formats. |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
3 * Copyright (C) 1999 - 2007 Simon Peter, <dn.tlp@gmx.net>, et al. |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
4 * |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
5 * This library is free software; you can redistribute it and/or |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
6 * modify it under the terms of the GNU Lesser General Public |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
7 * License as published by the Free Software Foundation; either |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
8 * version 2.1 of the License, or (at your option) any later version. |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
9 * |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
10 * This library is distributed in the hope that it will be useful, |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
13 * Lesser General Public License for more details. |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
14 * |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
15 * You should have received a copy of the GNU Lesser General Public |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
16 * License along with this library; if not, write to the Free Software |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
18 * |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
19 * protrack.h - Generic Protracker Player by Simon Peter <dn.tlp@gmx.net> |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
20 */ |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
21 |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
22 #ifndef H_PROTRACK |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
23 #define H_PROTRACK |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
24 |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
25 #include "player.h" |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
26 |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
27 class CmodPlayer: public CPlayer |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
28 { |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
29 public: |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
30 CmodPlayer(Copl *newopl); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
31 virtual ~CmodPlayer(); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
32 |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
33 bool update(); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
34 void rewind(int subsong); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
35 float getrefresh(); |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
36 |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
37 unsigned int getpatterns() |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
38 { return nop; } |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
39 unsigned int getpattern() |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
40 { return order[ord]; } |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
41 unsigned int getorders() |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
42 { return length; } |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
43 unsigned int getorder() |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
44 { return ord; } |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
45 unsigned int getrow() |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
46 { return rw; } |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
47 unsigned int getspeed() |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
48 { return speed; } |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
49 |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
50 protected: |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
51 enum Flags { |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
52 Standard = 0, |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
53 Decimal = 1 << 0, |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
54 Faust = 1 << 1, |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
55 NoKeyOn = 1 << 2, |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
56 Opl3 = 1 << 3, |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
57 Tremolo = 1 << 4, |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
58 Vibrato = 1 << 5, |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
59 Percussion = 1 << 6 |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
60 }; |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
61 |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
62 struct Instrument { |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
63 unsigned char data[11],arpstart,arpspeed,arppos,arpspdcnt,misc; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
64 signed char slide; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
65 } *inst; |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
66 |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
67 struct Tracks { |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
68 unsigned char note,command,inst,param2,param1; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
69 } **tracks; |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
70 |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
71 unsigned char *order, *arplist, *arpcmd, initspeed; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
72 unsigned short tempo, **trackord, bpm, nop; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
73 unsigned long length, restartpos, activechan; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
74 int flags, curchip; |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
75 |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
76 struct Channel { |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
77 unsigned short freq,nextfreq; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
78 unsigned char oct,vol1,vol2,inst,fx,info1,info2,key,nextoct, |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
79 note,portainfo,vibinfo1,vibinfo2,arppos,arpspdcnt; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
80 signed char trigger; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
81 } *channel; |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
82 |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
83 void init_trackord(); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
84 bool init_specialarp(); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
85 void init_notetable(const unsigned short *newnotetable); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
86 bool realloc_order(unsigned long len); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
87 bool realloc_patterns(unsigned long pats, unsigned long rows, unsigned long chans); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
88 bool realloc_instruments(unsigned long len); |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
89 |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
90 void dealloc(); |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
91 |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
92 private: |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
93 static const unsigned short sa2_notetable[12]; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
94 static const unsigned char vibratotab[32]; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
95 |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
96 unsigned char speed, del, songend, regbd; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
97 unsigned short rows, notetable[12]; |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
98 unsigned long rw, ord, nrows, npats, nchans; |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
99 |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
100 void setvolume(unsigned char chan); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
101 void setvolume_alt(unsigned char chan); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
102 void setfreq(unsigned char chan); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
103 void playnote(unsigned char chan); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
104 void setnote(unsigned char chan, int note); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
105 void slide_down(unsigned char chan, int amount); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
106 void slide_up(unsigned char chan, int amount); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
107 void tone_portamento(unsigned char chan, unsigned char info); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
108 void vibrato(unsigned char chan, unsigned char speed, unsigned char depth); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
109 void vol_up(unsigned char chan, int amount); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
110 void vol_down(unsigned char chan, int amount); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
111 void vol_up_alt(unsigned char chan, int amount); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
112 void vol_down_alt(unsigned char chan, int amount); |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
113 |
|
952
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
114 void dealloc_patterns(); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
115 bool resolve_order(); |
|
87666f9bf6d0
[svn] Upstream commit "Vastly enhanced generic Protracker player and modified loaders accordingly.
chainsaw
parents:
12
diff
changeset
|
116 unsigned char set_opl_chip(unsigned char chan); |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
117 }; |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
118 |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
119 #endif |
