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