LMMS
Loading...
Searching...
No Matches
a2m.h
Go to the documentation of this file.
1/*
2 * Adplug - Replayer for many OPL2/OPL3 audio file formats.
3 * Copyright (C) 1999 - 2007 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
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 * a2m.h - A2M Loader by Simon Peter <dn.tlp@gmx.net>
20 */
21
22#ifndef H_ADPLUG_A2MLOADER
23#define H_ADPLUG_A2MLOADER
24
25#include "protrack.h"
26
28{
29public:
30 static CPlayer *factory(Copl *newopl);
31
32 Ca2mLoader(Copl *newopl): CmodPlayer(newopl)
33 { }
34
35 bool load(const std::string &filename, const CFileProvider &fp);
36 float getrefresh();
37
38 std::string gettype()
39 { return std::string("AdLib Tracker 2"); }
40 std::string gettitle()
41 { if(*songname) return std::string(songname,1,*songname); else return std::string(); }
42 std::string getauthor()
43 { if(*author) return std::string(author,1,*author); else return std::string(); }
44 unsigned int getinstruments()
45 { return 250; }
46 std::string getinstrument(unsigned int n)
47 { return std::string(instname[n],1,*instname[n]); }
49private:
50
51#define ADPLUG_A2M_COPYRANGES 6
52#define ADPLUG_A2M_FIRSTCODE 257
53#define ADPLUG_A2M_MINCOPY 3
54#define ADPLUG_A2M_MAXCOPY 255
55#define ADPLUG_A2M_CODESPERRANGE (ADPLUG_A2M_MAXCOPY - ADPLUG_A2M_MINCOPY + 1)
56#define ADPLUG_A2M_MAXCHAR (ADPLUG_A2M_FIRSTCODE + ADPLUG_A2M_COPYRANGES * ADPLUG_A2M_CODESPERRANGE - 1)
57#define ADPLUG_A2M_TWICEMAX (2 * ADPLUG_A2M_MAXCHAR + 1)
58
59 static const unsigned int MAXFREQ, MINCOPY, MAXCOPY, COPYRANGES,
62
63 static const unsigned short bitvalue[14];
64 static const signed short copybits[ADPLUG_A2M_COPYRANGES],
66
67 void inittree();
68 void updatefreq(unsigned short a,unsigned short b);
69 void updatemodel(unsigned short code);
70 unsigned short inputcode(unsigned short bits);
71 unsigned short uncompress();
72 void decode();
73 unsigned short sixdepak(unsigned short *source,unsigned char *dest,unsigned short size);
74
75 char songname[43], author[43], instname[250][33];
76
80 unsigned char *obuf, *buf;
81};
82
83#endif
uint8_t a
Definition Spc_Cpu.h:141
#define ADPLUG_A2M_COPYRANGES
Definition a2m.h:51
#define ADPLUG_A2M_TWICEMAX
Definition a2m.h:57
#define ADPLUG_A2M_MAXCHAR
Definition a2m.h:56
Definition fprovide.h:29
CPlayer(Copl *newopl)
Definition player.cpp:34
static const unsigned int TWICEMAX
Definition a2m.h:60
static const unsigned int FIRSTCODE
Definition a2m.h:60
unsigned short freq[ADPLUG_A2M_TWICEMAX+1]
Definition a2m.h:79
unsigned short inputcode(unsigned short bits)
Definition a2m.cpp:366
unsigned short ibitcount
Definition a2m.h:77
unsigned char * obuf
Definition a2m.h:80
static const unsigned int MINCOPY
Definition a2m.h:59
std::string gettitle()
Definition a2m.h:40
void inittree()
Definition a2m.cpp:289
void updatefreq(unsigned short a, unsigned short b)
Definition a2m.cpp:304
unsigned short ibufcount
Definition a2m.h:77
void updatemodel(unsigned short code)
Definition a2m.cpp:321
unsigned int getinstruments()
Definition a2m.h:44
void decode()
Definition a2m.cpp:414
unsigned short rghtc[ADPLUG_A2M_MAXCHAR+1]
Definition a2m.h:78
unsigned short sixdepak(unsigned short *source, unsigned char *dest, unsigned short size)
Definition a2m.cpp:468
static const unsigned int ROOT
Definition a2m.h:60
char instname[250][33]
Definition a2m.h:75
unsigned short * wdbuf
Definition a2m.h:79
static const signed short copymin[ADPLUG_A2M_COPYRANGES]
Definition a2m.h:54
static const unsigned int MAXFREQ
Definition a2m.h:59
std::string getauthor()
Definition a2m.h:42
unsigned short dad[ADPLUG_A2M_TWICEMAX+1]
Definition a2m.h:79
std::string gettype()
Definition a2m.h:38
static CPlayer * factory(Copl *newopl)
Definition a2m.cpp:57
static const unsigned short bitvalue[14]
Definition a2m.h:48
unsigned short leftc[ADPLUG_A2M_MAXCHAR+1]
Definition a2m.h:78
static const unsigned int TERMINATE
Definition a2m.h:60
unsigned short uncompress()
Definition a2m.cpp:388
static const unsigned int SUCCMAX
Definition a2m.h:60
unsigned short input_size
Definition a2m.h:77
char songname[43]
Definition a2m.h:75
unsigned short output_size
Definition a2m.h:78
static const signed short copybits[ADPLUG_A2M_COPYRANGES]
Definition a2m.h:51
float getrefresh()
Definition a2m.cpp:279
static const unsigned int MAXSIZE
Definition a2m.h:61
static const unsigned int MAXBUF
Definition a2m.h:61
static const unsigned int COPYRANGES
Definition a2m.h:59
static const unsigned int MAXCOPY
Definition a2m.h:59
unsigned char * buf
Definition a2m.h:80
char author[43]
Definition a2m.h:75
unsigned short ibitbuffer
Definition a2m.h:77
bool load(const std::string &filename, const CFileProvider &fp)
Definition a2m.cpp:62
unsigned short obufcount
Definition a2m.h:77
std::string getinstrument(unsigned int n)
Definition a2m.h:46
Ca2mLoader(Copl *newopl)
Definition a2m.h:32
static const unsigned int CODESPERRANGE
Definition a2m.h:60
static const unsigned int MAXCHAR
Definition a2m.h:60
static const unsigned int MAXDISTANCE
Definition a2m.h:61
CmodPlayer(Copl *newopl)
Definition protrack.cpp:45
Definition opl.h:26
static char filename[]
Definition features.c:5
Definition inftrees.h:27
int n
Definition crypt.c:458
b
Definition crypt.c:628
ulg size
Definition extract.c:2350