libsidplayfp 3.0.0
sidplayfp.h
1/*
2 * This file is part of libsidplayfp, a SID player engine.
3 *
4 * Copyright 2011-2025 Leandro Nini <drfiemost@users.sourceforge.net>
5 * Copyright 2007-2010 Antti Lankila
6 * Copyright 2000 Simon White
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 */
22
23#ifndef SIDPLAYFP_H
24#define SIDPLAYFP_H
25
26#include <cstdint>
27#include <cstdio>
28
29#include "sidplayfp/siddefs.h"
30#include "sidplayfp/sidversion.h"
31
32class SidConfig;
33class SidTune;
34class SidInfo;
35class EventContext;
36
37// Private Sidplayer
38namespace libsidplayfp
39{
40 class Player;
41}
42
46class SID_EXTERN sidplayfp
47{
48private:
49 libsidplayfp::Player &sidplayer;
50
51public:
52 sidplayfp();
53 ~sidplayfp();
54
60 const SidConfig &config() const;
61
67 const SidInfo &info() const;
68
76 bool config(const SidConfig &cfg);
77
83 const char *error() const;
84
92 bool load(SidTune *tune);
93
100 void buffers(short** buffers) const;
101
113 int play(unsigned int cycles);
114
122 bool reset();
123
130 unsigned int installedSIDs() const;
131
138 void initMixer(bool stereo);
139
148 unsigned int mix(short *buffer, unsigned int samples);
149
157 void debug(bool enable, FILE *out);
158
166 void mute(unsigned int sidNum, unsigned int voice, bool enable);
167
176 void filter(unsigned int sidNum, bool enable);
177
183 uint_least32_t time() const;
184
191 uint_least32_t timeMs() const;
192
200 void setRoms(const uint8_t* kernal, const uint8_t* basic=0, const uint8_t* character=0);
201
209 void setKernal(const uint8_t* rom);
210 void setBasic(const uint8_t* rom);
211 void setChargen(const uint8_t* rom);
213
217 uint_least16_t getCia1TimerA() const;
218
227 bool getSidStatus(unsigned int sidNum, uint8_t regs[32]);
228
238 int getBufSize(unsigned int cycles);
239};
240
241#endif // SIDPLAYFP_H
Definition SidConfig.h:40
Definition SidInfo.h:35
Definition SidTune.h:43
Definition player.h:58
const SidInfo & info() const
Definition sidplayfp.cpp:74
bool getSidStatus(unsigned int sidNum, uint8_t regs[32])
Definition sidplayfp.cpp:125
void filter(unsigned int sidNum, bool enable)
Definition sidplayfp.cpp:99
const SidConfig & config() const
Definition sidplayfp.cpp:49
uint_least16_t getCia1TimerA() const
Definition sidplayfp.cpp:120
void initMixer(bool stereo)
Definition sidplayfp.cpp:135
int play(unsigned int cycles)
Definition sidplayfp.cpp:59
bool load(SidTune *tune)
Definition sidplayfp.cpp:69
void debug(bool enable, FILE *out)
Definition sidplayfp.cpp:104
const char * error() const
Definition sidplayfp.cpp:89
int getBufSize(unsigned int cycles)
Definition sidplayfp.cpp:145
uint_least32_t timeMs() const
Definition sidplayfp.cpp:84
unsigned int mix(short *buffer, unsigned int samples)
Definition sidplayfp.cpp:140
void mute(unsigned int sidNum, unsigned int voice, bool enable)
Definition sidplayfp.cpp:94
void setRoms(const uint8_t *kernal, const uint8_t *basic=0, const uint8_t *character=0)
Definition sidplayfp.cpp:113
bool reset()
Definition sidplayfp.cpp:64
uint_least32_t time() const
Definition sidplayfp.cpp:79
void buffers(short **buffers) const
Definition sidplayfp.cpp:54
void setKernal(const uint8_t *rom)
Definition sidplayfp.cpp:109
unsigned int installedSIDs() const
Definition sidplayfp.cpp:130