LMMS
Loading...
Searching...
No Matches
wemuopl.h
Go to the documentation of this file.
1/*
2 * Adplug - Replayer for many OPL2/OPL3 audio file formats.
3 * Copyright (C) 1999 - 2008 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 * wemuopl.h - Emulated OPL using the DOSBox OPL3 emulator
20 */
21
22#ifndef H_ADPLUG_WEMUOPL
23#define H_ADPLUG_WEMUOPL
24
25#include "opl.h"
26extern "C" {
27#include "woodyopl.h"
28}
29
30class CWemuopl: public Copl
31{
32public:
33 CWemuopl(int rate, bool bit16, bool usestereo)
34 {
35 opl.adlib_init(rate, usestereo ? 2 : 1, bit16 ? 2 : 1);
37 };
38
39 void update(short *buf, int samples)
40 {
41 opl.adlib_getsample(buf, samples);
42 }
43
44 // template methods
45 void write(int reg, int val)
46 {
47 opl.adlib_write((currChip << 8) | reg, val);
48 };
49
50 void init() {};
51
52private:
54};
55
56#endif
void write(int reg, int val)
Definition wemuopl.h:45
void update(short *buf, int samples)
Definition wemuopl.h:39
void init()
Definition wemuopl.h:50
OPLChipClass opl
Definition wemuopl.h:53
CWemuopl(int rate, bool bit16, bool usestereo)
Definition wemuopl.h:33
@ TYPE_OPL2
Definition opl.h:29
int currChip
Definition opl.h:65
Copl()
Definition opl.h:32
ChipType currType
Definition opl.h:66
Definition woodyopl.h:160
int val
Definition jpeglib.h:956