LMMS
Loading...
Searching...
No Matches
jbm.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 * jbm.h - JBM Player by Dennis Lindroos <lindroos@nls.fi>
20 */
21
22#ifndef H_ADPLUG_JBMPLAYER
23#define H_ADPLUG_JBMPLAYER
24
25#include "player.h"
26
27class CjbmPlayer: public CPlayer
28{
29 public:
30 static CPlayer *factory(Copl *newopl);
31
32 CjbmPlayer(Copl *newopl) : CPlayer(newopl), m(0)
33 { }
35 { if(m != NULL) delete [] m; }
36
37 bool load(const std::string &filename, const CFileProvider &fp);
38 bool update();
39 void rewind(int subsong);
40
41 float getrefresh()
42 { return timer; }
43
44 std::string gettype()
45 {
46 return std::string(flags&1 ? "JBM Adlib Music [rhythm mode]" :
47 "JBM Adlib Music");
48 }
49 std::string getauthor()
50 { return std::string("Johannes Bjerregaard"); }
51
52 protected:
53
54 unsigned char *m;
55 float timer;
56 unsigned short flags, voicemask;
57 unsigned short seqtable, seqcount;
58 unsigned short instable, inscount;
59 unsigned short *sequences;
60 unsigned char bdreg;
61
62 typedef struct {
63 unsigned short trkpos, trkstart, seqpos;
64 unsigned char seqno, note;
65 short vol;
66 short delay;
67 short instr;
68 unsigned char frq[2];
69 unsigned char ivol, dummy;
70 } JBMVoice;
71
73
74 private:
75 //void calc_opl_frequency(JBMVoice *);
76 void set_opl_instrument(int, JBMVoice *);
77 void opl_noteonoff(int, JBMVoice *, bool);
78};
79
80#endif
#define NULL
Definition CarlaBridgeFormat.cpp:30
Definition fprovide.h:29
CPlayer(Copl *newopl)
Definition player.cpp:34
float timer
Definition jbm.h:55
std::string gettype()
Definition jbm.h:44
unsigned short voicemask
Definition jbm.h:56
CjbmPlayer(Copl *newopl)
Definition jbm.h:32
bool load(const std::string &filename, const CFileProvider &fp)
Definition jbm.cpp:66
std::string getauthor()
Definition jbm.h:49
unsigned short inscount
Definition jbm.h:58
unsigned short seqcount
Definition jbm.h:57
unsigned char * m
Definition jbm.h:54
JBMVoice voice[11]
Definition jbm.h:72
static CPlayer * factory(Copl *newopl)
Definition jbm.cpp:61
unsigned short flags
Definition jbm.h:56
unsigned short seqtable
Definition jbm.h:57
void opl_noteonoff(int, JBMVoice *, bool)
Definition jbm.cpp:233
void set_opl_instrument(int, JBMVoice *)
Definition jbm.cpp:253
void rewind(int subsong)
Definition jbm.cpp:190
unsigned char bdreg
Definition jbm.h:60
bool update()
Definition jbm.cpp:123
float getrefresh()
Definition jbm.h:41
unsigned short instable
Definition jbm.h:58
unsigned short * sequences
Definition jbm.h:59
~CjbmPlayer()
Definition jbm.h:34
Definition opl.h:26
static char filename[]
Definition features.c:5
Definition jbm.h:62
unsigned short trkstart
Definition jbm.h:63
unsigned short trkpos
Definition jbm.h:63
short vol
Definition jbm.h:65
unsigned short seqpos
Definition jbm.h:63
unsigned char ivol
Definition jbm.h:69
unsigned char dummy
Definition jbm.h:69
short instr
Definition jbm.h:67
short delay
Definition jbm.h:66
unsigned char frq[2]
Definition jbm.h:68
unsigned char note
Definition jbm.h:64
unsigned char seqno
Definition jbm.h:64