LMMS
Loading...
Searching...
No Matches
xad.h
Go to the documentation of this file.
1/*
2 AdPlug - Replayer for many OPL2/OPL3 audio file formats.
3 Copyright (C) 1999 - 2003 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 xad.h - XAD shell player by Riven the Mage <riven@ok.ru>
20*/
21
22/*
23 * Copyright (c) 2015 - 2017 Wraithverge <liam82067@yahoo.com>
24 * - Realigned to Tabs.
25 * - Added support for Speed indicator in 'File Info' dialogues.
26 */
27
28#ifndef H_ADPLUG_XAD
29#define H_ADPLUG_XAD
30
31#include "player.h"
32
33class CxadPlayer: public CPlayer
34{
35public:
36 static CPlayer *factory(Copl *newopl);
37
38 CxadPlayer(Copl * newopl);
40
41 bool load(const std::string &filename, const CFileProvider &fp);
42 bool update();
43 void rewind(int subsong);
44 float getrefresh();
45
46 std::string gettype();
47 std::string gettitle();
48 std::string getauthor();
49 std::string getinstrument(unsigned int i);
50 unsigned int getinstruments();
51
52 // Wraithverge: added this.
53 unsigned int getspeed();
54
55protected:
56 virtual void xadplayer_rewind(int subsong) = 0;
57 virtual bool xadplayer_load() = 0;
58 virtual void xadplayer_update() = 0;
59 virtual float xadplayer_getrefresh() = 0;
60 virtual std::string xadplayer_gettype() = 0;
61 virtual std::string xadplayer_gettitle()
62 {
63 return std::string(xad.title);
64 }
65 virtual std::string xadplayer_getauthor()
66 {
67 return std::string(xad.author);
68 }
69 virtual std::string xadplayer_getinstrument(unsigned int i)
70 {
71 return std::string("");
72 }
73 virtual unsigned int xadplayer_getinstruments()
74 {
75 return 0;
76 }
77
78 // Wraithverge: added this.
79 virtual unsigned int xadplayer_getspeed()
80 {
81 return 0;
82 }
83
84 enum { HYP=1, PSI, FLASH, BMF, RAT, HYBRID };
85
87 {
88 unsigned long id;
89 char title[36];
90 char author[36];
91 unsigned short fmt;
92 unsigned char speed;
93 unsigned char reserved_a;
94 } xad;
95
96 unsigned char * tune;
97 unsigned long tune_size;
98
99 struct
100 {
103 unsigned char speed;
104 unsigned char speed_counter;
106
107 unsigned char adlib[256];
108
109 void opl_write(int reg, int val);
110};
111#endif
Definition fprovide.h:29
CPlayer(Copl *newopl)
Definition player.cpp:34
Definition opl.h:26
@ FLASH
Definition xad.h:84
@ BMF
Definition xad.h:84
@ HYP
Definition xad.h:84
@ PSI
Definition xad.h:84
@ HYBRID
Definition xad.h:84
@ RAT
Definition xad.h:84
bool load(const std::string &filename, const CFileProvider &fp)
Definition xad.cpp:46
unsigned int getspeed()
Definition xad.cpp:161
std::string getinstrument(unsigned int i)
Definition xad.cpp:150
CxadPlayer(Copl *newopl)
Definition xad.cpp:36
virtual void xadplayer_update()=0
std::string gettype()
Definition xad.cpp:135
int playing
Definition xad.h:101
unsigned char speed
Definition xad.h:103
virtual std::string xadplayer_gettitle()
Definition xad.h:61
void opl_write(int reg, int val)
Definition xad.cpp:168
virtual float xadplayer_getrefresh()=0
int looping
Definition xad.h:102
void rewind(int subsong)
Definition xad.cpp:100
unsigned char speed_counter
Definition xad.h:104
struct CxadPlayer::xad_header xad
~CxadPlayer()
Definition xad.cpp:41
unsigned int getinstruments()
Definition xad.cpp:155
std::string getauthor()
Definition xad.cpp:145
std::string gettitle()
Definition xad.cpp:140
unsigned char * tune
Definition xad.h:96
float getrefresh()
Definition xad.cpp:130
virtual std::string xadplayer_gettype()=0
bool update()
Definition xad.cpp:117
virtual unsigned int xadplayer_getspeed()
Definition xad.h:79
virtual bool xadplayer_load()=0
static CPlayer * factory(Copl *newopl)
virtual unsigned int xadplayer_getinstruments()
Definition xad.h:73
unsigned long tune_size
Definition xad.h:97
virtual std::string xadplayer_getauthor()
Definition xad.h:65
virtual void xadplayer_rewind(int subsong)=0
unsigned char adlib[256]
Definition xad.h:107
struct CxadPlayer::@176053223310103327234035266032031255242231023037 plr
virtual std::string xadplayer_getinstrument(unsigned int i)
Definition xad.h:69
register unsigned i
Definition inflate.c:1575
static char filename[]
Definition features.c:5
int val
Definition jpeglib.h:956
Definition xad.h:87
unsigned long id
Definition xad.h:88
char title[36]
Definition xad.h:89
unsigned char reserved_a
Definition xad.h:93
unsigned char speed
Definition xad.h:92
unsigned short fmt
Definition xad.h:91
char author[36]
Definition xad.h:90