LMMS
Loading...
Searching...
No Matches
bmf.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] BMF player, by Riven the Mage <riven@ok.ru>
20 */
21
22#include "xad.h"
23
25{
26public:
27 static CPlayer *factory(Copl *newopl);
28
29 CxadbmfPlayer(Copl *newopl): CxadPlayer(newopl)
30 { };
32 { };
33
34protected:
35 enum { BMF0_9B, BMF1_1, BMF1_2 };
36 //
37 struct bmf_event
38 {
39 unsigned char note;
40 unsigned char delay;
41 unsigned char volume;
42 unsigned char instrument;
43 unsigned char cmd;
44 unsigned char cmd_data;
45 };
46
47 struct
48 {
49 unsigned char version;
50 char title[36];
51 char author[36];
52 float timer;
53 unsigned char speed;
54
55 struct
56 {
57 char name[11];
58 unsigned char data[13];
64
65 struct
66 {
67 unsigned short stream_position;
68 unsigned char delay;
69 unsigned short loop_position;
70 unsigned char loop_counter;
71 } channel[9];
72 } bmf;
73 //
74 bool xadplayer_load();
75 void xadplayer_rewind(int subsong);
76 void xadplayer_update();
78 std::string xadplayer_gettype();
79 std::string xadplayer_gettitle();
80 std::string xadplayer_getauthor();
81 std::string xadplayer_getinstrument(unsigned int i);
82 unsigned int xadplayer_getinstruments();
83 unsigned int xadplayer_getspeed();
84 //
85private:
86 static const unsigned char bmf_adlib_registers[117];
87 static const unsigned short bmf_notes[12];
88 static const unsigned short bmf_notes_2[12];
89 static const unsigned char bmf_default_instrument[13];
90
91 int __bmf_convert_stream(unsigned char *stream, int channel);
92};
CPlayer(Copl *newopl)
Definition player.cpp:34
Definition opl.h:26
CxadPlayer(Copl *newopl)
Definition xad.cpp:36
float xadplayer_getrefresh()
Definition bmf.cpp:381
int __bmf_convert_stream(unsigned char *stream, int channel)
Definition bmf.cpp:418
void xadplayer_update()
Definition bmf.cpp:239
unsigned short loop_position
Definition bmf.h:69
std::string xadplayer_getinstrument(unsigned int i)
Definition bmf.cpp:406
char title[36]
Definition bmf.h:50
unsigned int xadplayer_getspeed()
Definition bmf.cpp:411
@ BMF1_1
Definition bmf.h:35
@ BMF1_2
Definition bmf.h:35
@ BMF0_9B
Definition bmf.h:35
float timer
Definition bmf.h:52
struct CxadbmfPlayer::@340310310351332207201377310131234356134205370324 bmf
char author[36]
Definition bmf.h:51
static CPlayer * factory(Copl *newopl)
Definition bmf.cpp:76
std::string xadplayer_getauthor()
Definition bmf.cpp:396
unsigned char loop_counter
Definition bmf.h:70
unsigned char speed
Definition bmf.h:53
~CxadbmfPlayer()
Definition bmf.h:31
struct CxadbmfPlayer::@340310310351332207201377310131234356134205370324::@377100342130111362047202340270073072166356000000 instruments[32]
unsigned char data[13]
Definition bmf.h:58
unsigned char delay
Definition bmf.h:68
static const unsigned short bmf_notes_2[12]
Definition bmf.h:66
unsigned short stream_position
Definition bmf.h:67
void xadplayer_rewind(int subsong)
Definition bmf.cpp:198
unsigned char version
Definition bmf.h:49
static const unsigned char bmf_default_instrument[13]
Definition bmf.h:71
struct CxadbmfPlayer::@340310310351332207201377310131234356134205370324::@366124227127244276111271213122142220324121071220 channel[9]
unsigned int xadplayer_getinstruments()
Definition bmf.cpp:401
static const unsigned short bmf_notes[12]
Definition bmf.h:60
static const unsigned char bmf_adlib_registers[117]
Definition bmf.h:47
CxadbmfPlayer(Copl *newopl)
Definition bmf.h:29
bool xadplayer_load()
Definition bmf.cpp:81
std::string xadplayer_gettype()
Definition bmf.cpp:386
char name[11]
Definition bmf.h:57
std::string xadplayer_gettitle()
Definition bmf.cpp:391
bmf_event streams[9][1024]
Definition bmf.h:61
int active_streams
Definition bmf.h:63
register unsigned i
Definition inflate.c:1575
Definition bmf.h:38
unsigned char delay
Definition bmf.h:40
unsigned char cmd
Definition bmf.h:43
unsigned char instrument
Definition bmf.h:42
unsigned char note
Definition bmf.h:39
unsigned char cmd_data
Definition bmf.h:44
unsigned char volume
Definition bmf.h:41