comparison src/Input/adplug/core/bmf.h @ 0:13389e613d67 trunk

[svn] - initial import of audacious-plugins tree (lots to do)
author nenolod
date Mon, 18 Sep 2006 01:11:49 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:13389e613d67
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
24 class CxadbmfPlayer: public CxadPlayer
25 {
26 public:
27 static CPlayer *factory(Copl *newopl);
28
29 CxadbmfPlayer(Copl *newopl): CxadPlayer(newopl)
30 { };
31 ~CxadbmfPlayer()
32 { };
33
34 protected:
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];
59 } instruments[32];
60
61 bmf_event streams[9][1024];
62
63 int active_streams;
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();
77 float xadplayer_getrefresh();
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 //
84 private:
85 static const unsigned char bmf_adlib_registers[117];
86 static const unsigned short bmf_notes[12];
87 static const unsigned short bmf_notes_2[12];
88 static const unsigned char bmf_default_instrument[13];
89
90 int __bmf_convert_stream(unsigned char *stream, int channel);
91 };