libsidplayfp  1.6.0
SidTuneInfoImpl.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 SIDTUNEINFOIMPL_H
24 #define SIDTUNEINFOIMPL_H
25 
26 #include <stdint.h>
27 #include <vector>
28 #include <string>
29 
30 #include "sidplayfp/SidTuneInfo.h"
31 
36 {
37 public:
38  const char* m_formatString;
39 
40  unsigned int m_songs;
41  unsigned int m_startSong;
42  unsigned int m_currentSong;
43 
44  int m_songSpeed;
45 
46  clock_t m_clockSpeed;
47 
48  model_t m_sidModel1;
49  model_t m_sidModel2;
50 
51  compatibility_t m_compatibility;
52 
53  uint_least32_t m_dataFileLen;
54 
55  uint_least32_t m_c64dataLen;
56 
57  uint_least16_t m_loadAddr;
58  uint_least16_t m_initAddr;
59  uint_least16_t m_playAddr;
60 
61  uint_least16_t m_sidChipBase1;
62  uint_least16_t m_sidChipBase2;
63 
64  uint_least8_t m_relocStartPage;
65 
66  uint_least8_t m_relocPages;
67 
68  std::string m_path;
69 
70  std::string m_dataFileName;
71 
72  std::string m_infoFileName;
73 
74  std::vector<std::string> m_infoString;
75 
76  std::vector<std::string> m_commentString;
77 
78  bool m_fixLoad;
79 
80 private: // prevent copying
82  SidTuneInfoImpl& operator=(SidTuneInfoImpl&);
83 
84 public:
85  SidTuneInfoImpl() :
86  m_formatString("N/A"),
87  m_songs(0),
88  m_startSong(0),
89  m_currentSong(0),
90  m_songSpeed(SPEED_VBI),
91  m_clockSpeed(CLOCK_UNKNOWN),
92  m_sidModel1(SIDMODEL_UNKNOWN),
93  m_sidModel2(SIDMODEL_UNKNOWN),
94  m_compatibility(COMPATIBILITY_C64),
95  m_dataFileLen(0),
96  m_c64dataLen(0),
97  m_loadAddr(0),
98  m_initAddr(0),
99  m_playAddr(0),
100  m_sidChipBase1(0xd400),
101  m_sidChipBase2(0),
102  m_relocStartPage(0),
103  m_relocPages(0),
104  m_fixLoad(false) {}
105 
106  uint_least16_t loadAddr() const { return m_loadAddr; }
107 
108  uint_least16_t initAddr() const { return m_initAddr; }
109 
110  uint_least16_t playAddr() const { return m_playAddr; }
111 
112  unsigned int songs() const { return m_songs; }
113 
114  unsigned int startSong() const { return m_startSong; }
115 
116  unsigned int currentSong() const { return m_currentSong; }
117 
118  uint_least16_t sidChipBase1() const { return m_sidChipBase1; }
119  uint_least16_t sidChipBase2() const { return m_sidChipBase2; }
120 
121  bool isStereo() const { return (m_sidChipBase1!=0 && m_sidChipBase2!=0); }
122 
123  int songSpeed() const { return m_songSpeed; }
124 
125  uint_least8_t relocStartPage() const { return m_relocStartPage; }
126 
127  uint_least8_t relocPages() const { return m_relocPages; }
128 
129  model_t sidModel1() const { return m_sidModel1; }
130  model_t sidModel2() const { return m_sidModel2; }
131 
132  compatibility_t compatibility() const { return m_compatibility; }
133 
134  unsigned int numberOfInfoStrings() const { return m_infoString.size(); }
135  const char* infoString(unsigned int i) const { return i<numberOfInfoStrings()?m_infoString[i].c_str():""; }
136 
137  unsigned int numberOfCommentStrings() const { return m_commentString.size(); }
138  const char* commentString(unsigned int i) const { return i<numberOfCommentStrings()?m_commentString[i].c_str():""; }
139 
140  uint_least32_t dataFileLen() const { return m_dataFileLen; }
141 
142  uint_least32_t c64dataLen() const { return m_c64dataLen; }
143 
144  clock_t clockSpeed() const { return m_clockSpeed; }
145 
146  const char* formatString() const { return m_formatString; }
147 
148  bool fixLoad() const { return m_fixLoad; }
149 
150  const char* path() const { return m_path.c_str(); }
151 
152  const char* dataFileName() const { return m_dataFileName.c_str(); }
153 
154  const char* infoFileName() const { return !m_infoFileName.empty()?m_infoFileName.c_str():0; }
155 };
156 
157 #endif /* SIDTUNEINFOIMPL_H */
const char * infoString(unsigned int i) const
text info from the format headers etc.
Definition: SidTuneInfoImpl.h:135
unsigned int songs() const
Definition: SidTuneInfoImpl.h:112
static const int SPEED_VBI
Vertical-Blanking-Interrupt.
Definition: SidTuneInfo.h:62
bool isStereo() const
Definition: SidTuneInfoImpl.h:121
uint_least16_t loadAddr() const
Definition: SidTuneInfoImpl.h:106
uint_least32_t c64dataLen() const
Definition: SidTuneInfoImpl.h:142
uint_least16_t sidChipBase1() const
0xD400 (normal, 1st SID)
Definition: SidTuneInfoImpl.h:118
uint_least16_t playAddr() const
Definition: SidTuneInfoImpl.h:110
model_t sidModel2() const
second SID
Definition: SidTuneInfoImpl.h:130
Definition: SidTuneInfo.h:36
uint_least8_t relocStartPage() const
Definition: SidTuneInfoImpl.h:125
uint_least32_t dataFileLen() const
Definition: SidTuneInfoImpl.h:140
const char * formatString() const
Definition: SidTuneInfoImpl.h:146
File is C64 compatible.
Definition: SidTuneInfo.h:54
unsigned int numberOfCommentStrings() const
Number of comments.
Definition: SidTuneInfoImpl.h:137
int songSpeed() const
Definition: SidTuneInfoImpl.h:123
Definition: SidTuneInfoImpl.h:35
uint_least16_t initAddr() const
Definition: SidTuneInfoImpl.h:108
bool fixLoad() const
Definition: SidTuneInfoImpl.h:148
clock_t clockSpeed() const
Definition: SidTuneInfoImpl.h:144
const char * dataFileName() const
Definition: SidTuneInfoImpl.h:152
model_t sidModel1() const
first SID
Definition: SidTuneInfoImpl.h:129
unsigned int startSong() const
Definition: SidTuneInfoImpl.h:114
const char * commentString(unsigned int i) const
Used to stash the MUS comment somewhere.
Definition: SidTuneInfoImpl.h:138
unsigned int currentSong() const
Definition: SidTuneInfoImpl.h:116
compatibility_t
Definition: SidTuneInfo.h:53
const char * path() const
Definition: SidTuneInfoImpl.h:150
unsigned int numberOfInfoStrings() const
the number of available text info lines
Definition: SidTuneInfoImpl.h:134
uint_least8_t relocPages() const
Definition: SidTuneInfoImpl.h:127
uint_least16_t sidChipBase2() const
0xD?00 (2nd SID) or 0 (no 2nd SID)
Definition: SidTuneInfoImpl.h:119
const char * infoFileName() const
Definition: SidTuneInfoImpl.h:154
compatibility_t compatibility() const
Definition: SidTuneInfoImpl.h:132