libsidplayfp 2.6.0
SidInfoImpl.h
1/*
2 * This file is part of libsidplayfp, a SID player engine.
3 *
4 * Copyright 2011-2015 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;
56 const std::string m_version;
57 std::vector<std::string> m_credits;
58
59 std::string m_speedString;
60
61 std::string m_kernalDesc;
62 std::string m_basicDesc;
63 std::string m_chargenDesc;
64
65 const unsigned int m_maxsids;
66
67 unsigned int m_channels;
68
69 uint_least16_t m_driverAddr;
70 uint_least16_t m_driverLength;
71
72 uint_least16_t m_powerOnDelay;
73
74private:
75 // prevent copying
77 SidInfoImpl& operator=(SidInfoImpl&);
78
79public:
80 SidInfoImpl() :
81 m_name(PACKAGE_NAME),
82 m_version(PACKAGE_VERSION),
84 m_channels(1),
85 m_driverAddr(0),
86 m_driverLength(0),
87 m_powerOnDelay(0)
88 {
89 m_credits.push_back(PACKAGE_NAME " V" PACKAGE_VERSION " Engine:\n"
90 "\tCopyright (C) 2000 Simon White\n"
91 "\tCopyright (C) 2007-2010 Antti Lankila\n"
92 "\tCopyright (C) 2010-2015 Leandro Nini\n"
93 "\t" PACKAGE_URL "\n");
94 }
95
96 const char *getName() const override { return m_name.c_str(); }
97 const char *getVersion() const override { return m_version.c_str(); }
98
99 unsigned int getNumberOfCredits() const override { return m_credits.size(); }
100 const char *getCredits(unsigned int i) const override { return i<m_credits.size()?m_credits[i].c_str():""; }
101
102 unsigned int getMaxsids() const override { return m_maxsids; }
103
104 unsigned int getChannels() const override { return m_channels; }
105
106 uint_least16_t getDriverAddr() const override { return m_driverAddr; }
107 uint_least16_t getDriverLength() const override { return m_driverLength; }
108
109 uint_least16_t getPowerOnDelay() const override { return m_powerOnDelay; }
110
111 const char *getSpeedString() const override { return m_speedString.c_str(); }
112
113 const char *getKernalDesc() const override { return m_kernalDesc.c_str(); }
114 const char *getBasicDesc() const override { return m_basicDesc.c_str(); }
115 const char *getChargenDesc() const override { return m_chargenDesc.c_str(); }
116};
117
118#endif /* SIDTUNEINFOIMPL_H */
Definition SidInfoImpl.h:53
Definition SidInfo.h:34
static const unsigned int MAX_SIDS
Maximum number of supported SIDs.
Definition mixer.h:71