libsidplayfp  1.8.7
SidInfoImpl.h
1 /*
2  * This file is part of libsidplayfp, a SID player engine.
3  *
4  * Copyright 2011-2012 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 #ifdef HAVE_CONFIG_H
35 # include "config.h"
36 #endif
37 
38 #ifndef PACKAGE_NAME
39 # define PACKAGE_NAME PACKAGE
40 #endif
41 
42 #ifndef PACKAGE_VERSION
43 # define PACKAGE_VERSION VERSION
44 #endif
45 
49 class SidInfoImpl : public SidInfo
50 {
51 public:
52  const std::string m_name;
53  const std::string m_version;
54  std::vector<std::string> m_credits;
55 
56  std::string m_speedString;
57 
58  std::string m_kernalDesc;
59  std::string m_basicDesc;
60  std::string m_chargenDesc;
61 
62  const unsigned int m_maxsids;
63 
64  unsigned int m_channels;
65 
66  uint_least16_t m_driverAddr;
67  uint_least16_t m_driverLength;
68 
69  uint_least16_t m_powerOnDelay;
70 
71 private:
72  // prevent copying
73  SidInfoImpl(const SidInfoImpl&);
74  SidInfoImpl& operator=(SidInfoImpl&);
75 
76 public:
77  SidInfoImpl() :
78  m_name(PACKAGE_NAME),
79  m_version(PACKAGE_VERSION),
80  m_maxsids(Mixer::MAX_SIDS),
81  m_channels(1),
82  m_driverAddr(0),
83  m_driverLength(0),
84  m_powerOnDelay(0)
85  {
86  m_credits.push_back(PACKAGE_NAME " V" PACKAGE_VERSION " Engine:\n"
87  "\tCopyright (C) 2000 Simon White\n"
88  "\tCopyright (C) 2007-2010 Antti Lankila\n"
89  "\tCopyright (C) 2010-2014 Leandro Nini\n"
90  "\t" PACKAGE_URL "\n");
91  }
92 
93  const char *name() const { return m_name.c_str(); }
94  const char *version() const { return m_version.c_str(); }
95 
96  unsigned int numberOfCredits() const { return m_credits.size(); }
97  const char *credits(unsigned int i) const { return i<m_credits.size()?m_credits[i].c_str():""; }
98 
99  unsigned int maxsids() const { return m_maxsids; }
100 
101  unsigned int channels() const { return m_channels; }
102 
103  uint_least16_t driverAddr() const { return m_driverAddr; }
104  uint_least16_t driverLength() const { return m_driverLength; }
105 
106  uint_least16_t powerOnDelay() const { return m_powerOnDelay; }
107 
108  const char *speedString() const { return m_speedString.c_str(); }
109 
110  const char *kernalDesc() const { return m_kernalDesc.c_str(); }
111  const char *basicDesc() const { return m_basicDesc.c_str(); }
112  const char *chargenDesc() const { return m_chargenDesc.c_str(); }
113 };
114 
115 #endif /* SIDTUNEINFOIMPL_H */
static const unsigned int MAX_SIDS
Maximum number of supported SIDs.
Definition: mixer.h:41
const char * basicDesc() const
Description of the laoded ROM images.
Definition: SidInfoImpl.h:111
uint_least16_t driverAddr() const
Address of the driver.
Definition: SidInfoImpl.h:103
const char * chargenDesc() const
Description of the laoded ROM images.
Definition: SidInfoImpl.h:112
Definition: SidInfo.h:31
Definition: SidInfoImpl.h:49
unsigned int numberOfCredits() const
Library credits.
Definition: SidInfoImpl.h:96
uint_least16_t powerOnDelay() const
Power on delay.
Definition: SidInfoImpl.h:106
const char * kernalDesc() const
Description of the laoded ROM images.
Definition: SidInfoImpl.h:110
const char * name() const
Library name.
Definition: SidInfoImpl.h:93
const char * speedString() const
Describes the speed current song is running at.
Definition: SidInfoImpl.h:108
const char * version() const
Library version.
Definition: SidInfoImpl.h:94
unsigned int maxsids() const
Number of SIDs supported by this library.
Definition: SidInfoImpl.h:99
const char * credits(unsigned int i) const
Library credits.
Definition: SidInfoImpl.h:97
unsigned int channels() const
Number of output channels (1-mono, 2-stereo)
Definition: SidInfoImpl.h:101
uint_least16_t driverLength() const
Size of the driver in bytes.
Definition: SidInfoImpl.h:104