libsidplayfp 2.15.0
SidInfoImpl.h
1/*
2 * This file is part of libsidplayfp, a SID player engine.
3 *
4 * Copyright 2011-2024 Leandro Nini
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 SIDINFOIMPL_H
24#define SIDINFOIMPL_H
25
26#include <stdint.h>
27#include <vector>
28#include <string>
29
30#include "sidplayfp/SidInfo.h"
31
32#include "mixer.h"
33
34#include "sidcxx11.h"
35
36
37#ifdef HAVE_CONFIG_H
38# include "config.h"
39#endif
40
41#ifndef PACKAGE_NAME
42# define PACKAGE_NAME PACKAGE
43#endif
44
45#ifndef PACKAGE_VERSION
46# define PACKAGE_VERSION VERSION
47#endif
48
52class SidInfoImpl final : public SidInfo
53{
54public:
55 const std::string m_name { PACKAGE_NAME };
56 const std::string m_version { PACKAGE_VERSION };
57 std::vector<std::string> m_credits
58 {
59 PACKAGE_NAME " V" PACKAGE_VERSION " Engine:\n"
60 "\tCopyright (C) 2000 Simon White\n"
61 "\tCopyright (C) 2007-2010 Antti Lankila\n"
62 "\tCopyright (C) 2010-2024 Leandro Nini\n"
63 "\t" PACKAGE_URL "\n"
64 };
65
66 std::string m_speedString;
67
68 std::string m_kernalDesc;
69 std::string m_basicDesc;
70 std::string m_chargenDesc;
71
72 const unsigned int m_maxsids = libsidplayfp::Mixer::MAX_SIDS;
73
74 unsigned int m_channels = 1;
75
76 uint_least16_t m_driverAddr = 0;
77 uint_least16_t m_driverLength = 0;
78
79 uint_least16_t m_powerOnDelay = 0;
80
81private:
82 // prevent copying
83 SidInfoImpl(const SidInfoImpl&) = delete;
84 SidInfoImpl& operator=(SidInfoImpl&) = delete;
85
86public:
87 SidInfoImpl() {}
88
89 const char *getName() const override { return m_name.c_str(); }
90 const char *getVersion() const override { return m_version.c_str(); }
91
92 unsigned int getNumberOfCredits() const override { return m_credits.size(); }
93 const char *getCredits(unsigned int i) const override { return i<m_credits.size()?m_credits[i].c_str():""; }
94
95 unsigned int getMaxsids() const override { return m_maxsids; }
96
97 unsigned int getChannels() const override { return m_channels; }
98
99 uint_least16_t getDriverAddr() const override { return m_driverAddr; }
100 uint_least16_t getDriverLength() const override { return m_driverLength; }
101
102 uint_least16_t getPowerOnDelay() const override { return m_powerOnDelay; }
103
104 const char *getSpeedString() const override { return m_speedString.c_str(); }
105
106 const char *getKernalDesc() const override { return m_kernalDesc.c_str(); }
107 const char *getBasicDesc() const override { return m_basicDesc.c_str(); }
108 const char *getChargenDesc() const override { return m_chargenDesc.c_str(); }
109};
110
111#endif /* SIDTUNEINFOIMPL_H */
Definition SidInfoImpl.h:53
Definition SidInfo.h:34
static constexpr unsigned int MAX_SIDS
Maximum number of supported SIDs.
Definition mixer.h:70