libsidplayfp  1.2.1
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 "c64/c64.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: // prevent copying
72  SidInfoImpl(const SidInfoImpl&);
73  SidInfoImpl& operator=(SidInfoImpl&);
74 
75 public:
76  SidInfoImpl() :
77  m_name(PACKAGE_NAME),
78  m_version(PACKAGE_VERSION),
79  m_maxsids(c64::MAX_SIDS),
80  m_channels(1),
81  m_driverAddr(0),
82  m_driverLength(0),
83  m_powerOnDelay(0)
84  {
85  m_credits.push_back(PACKAGE_NAME " V" PACKAGE_VERSION " Engine:\n"
86  "\tCopyright (C) 2000 Simon White\n"
87  "\tCopyright (C) 2007-2010 Antti Lankila\n"
88  "\tCopyright (C) 2010-2013 Leandro Nini\n"
89  "\t" PACKAGE_URL "\n");
90  }
91 
92  const char *name() const { return m_name.c_str(); }
93  const char *version() const { return m_version.c_str(); }
94 
95  unsigned int numberOfCredits() const { return m_credits.size(); }
96  const char *credits(unsigned int i) const { return i<m_credits.size()?m_credits[i].c_str():""; }
97 
98  unsigned int maxsids() const { return m_maxsids; }
99 
100  unsigned int channels() const { return m_channels; }
101 
102  uint_least16_t driverAddr() const { return m_driverAddr; }
103  uint_least16_t driverLength() const { return m_driverLength; }
104 
105  uint_least16_t powerOnDelay() const { return m_powerOnDelay; }
106 
107  const char *speedString() const { return m_speedString.c_str(); }
108 
109  const char *kernalDesc() const { return m_kernalDesc.c_str(); }
110  const char *basicDesc() const { return m_basicDesc.c_str(); }
111  const char *chargenDesc() const { return m_chargenDesc.c_str(); }
112 };
113 
114 #endif /* SIDTUNEINFOIMPL_H */
unsigned int channels() const
Number of output channels (1-mono, 2-stereo)
Definition: SidInfoImpl.h:100
const char * version() const
Library version.
Definition: SidInfoImpl.h:93
const char * credits(unsigned int i) const
Library credits.
Definition: SidInfoImpl.h:96
Definition: SidInfo.h:31
Definition: SidInfoImpl.h:49
const char * kernalDesc() const
Description of the laoded ROM images.
Definition: SidInfoImpl.h:109
static const unsigned int MAX_SIDS
Definition: c64.h:75
const char * basicDesc() const
Description of the laoded ROM images.
Definition: SidInfoImpl.h:110
unsigned int maxsids() const
Number of SIDs supported by this library.
Definition: SidInfoImpl.h:98
const char * speedString() const
Describes the speed current song is running at.
Definition: SidInfoImpl.h:107
const char * name() const
Library name.
Definition: SidInfoImpl.h:92
uint_least16_t driverAddr() const
Address of the driver.
Definition: SidInfoImpl.h:102
uint_least16_t driverLength() const
Size of the driver in bytes.
Definition: SidInfoImpl.h:103
const char * chargenDesc() const
Description of the laoded ROM images.
Definition: SidInfoImpl.h:111
unsigned int numberOfCredits() const
Library credits.
Definition: SidInfoImpl.h:95
uint_least16_t powerOnDelay() const
Power on delay.
Definition: SidInfoImpl.h:105