LMMS
Loading...
Searching...
No Matches
GbApuWrapper.h
Go to the documentation of this file.
1/*
2 * GbApuWrapper.h - Gb_Apu subclass which allows direct buffer access
3 * Copyright (c) 2017 Tres Finocchiaro <tres.finocchiaro/at/gmail.com>
4 *
5 * This file is part of LMMS - https://lmms.io
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public
18 * License along with this program (see COPYING); if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301 USA.
21 *
22 */
23
24#ifndef LMMS_GB_APU_WRAPPER_H
25#define LMMS_GB_APU_WRAPPER_H
26
27#include <Gb_Apu.h>
28#include <Multi_Buffer.h>
29
30namespace lmms
31{
32
33
34class GbApuWrapper : private Gb_Apu
35{
36public:
37 GbApuWrapper() = default;
38 ~GbApuWrapper() = default;
39
40 blargg_err_t setSampleRate(long sampleRate, long clockRate);
41 void writeRegister(unsigned addr, int data) { Gb_Apu::write_register(fakeClock(), addr, data); }
42 long samplesAvail() const;
45 void bassFreq(int freq);
46 void endFrame(blip_time_t endTime);
47
48private:
50
51 // Fake CPU timing
52 blip_time_t fakeClock() { return m_time += 4; }
54};
55
56
57} // namespace lmms
58
59#endif // LMMS_GB_APU_WRAPPER_H
blip_long blip_time_t
Definition Blip_Buffer.h:17
short blip_sample_t
Definition Blip_Buffer.h:20
void treble_eq(const blip_eq_t &)
Definition Gb_Apu.cpp:51
Gb_Apu()
Definition Gb_Apu.cpp:23
void write_register(blip_time_t, unsigned addr, int data)
Definition Gb_Apu.cpp:200
Definition Multi_Buffer.h:91
Definition Blip_Buffer.h:239
void writeRegister(unsigned addr, int data)
Definition GbApuWrapper.h:41
void trebleEq(const blip_eq_t &eq)
Definition GbApuWrapper.h:44
long samplesAvail() const
Definition GbApuWrapper.cpp:39
blip_time_t m_time
Definition GbApuWrapper.h:53
blargg_err_t setSampleRate(long sampleRate, long clockRate)
Definition GbApuWrapper.cpp:31
Stereo_Buffer m_buf
Definition GbApuWrapper.h:49
void endFrame(blip_time_t endTime)
Definition GbApuWrapper.cpp:56
~GbApuWrapper()=default
GbApuWrapper()=default
void bassFreq(int freq)
Definition GbApuWrapper.cpp:51
long readSamples(blip_sample_t *out, long count)
Definition GbApuWrapper.cpp:45
blip_time_t fakeClock()
Definition GbApuWrapper.h:52
JHUFF_TBL long freq[]
Definition jchuff.h:50
JSAMPIMAGE data
Definition jpeglib.h:945
float out
Definition lilv_test.c:1461
Definition AudioAlsa.cpp:35
Definition tap_eq.c:71
_WDL_CSTRING_PREFIX void INT_PTR count
Definition wdlcstring.h:263