libsidplayfp 1.0.3
|
00001 /* 00002 * This file is part of libsidplayfp, a SID player engine. 00003 * 00004 * Copyright 2011-2012 Leandro Nini 00005 * Copyright 2007-2010 Antti Lankila 00006 * Copyright 2000 Simon White 00007 * 00008 * This program is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00021 */ 00022 00023 #ifndef SIDTUNEINFOIMPL_H 00024 #define SIDTUNEINFOIMPL_H 00025 00026 #include <stdint.h> 00027 #include <vector> 00028 #include <string> 00029 00030 #include "sidplayfp/SidTuneInfo.h" 00031 00035 class SidTuneInfoImpl : public SidTuneInfo 00036 { 00037 public: 00038 const char* m_formatString; 00039 00040 unsigned int m_songs; 00041 unsigned int m_startSong; 00042 unsigned int m_currentSong; 00043 00044 int m_songSpeed; 00045 00046 clock_t m_clockSpeed; 00047 00048 model_t m_sidModel1; 00049 model_t m_sidModel2; 00050 00051 compatibility_t m_compatibility; 00052 00053 uint_least32_t m_dataFileLen; 00054 00055 uint_least32_t m_c64dataLen; 00056 00057 uint_least16_t m_loadAddr; 00058 uint_least16_t m_initAddr; 00059 uint_least16_t m_playAddr; 00060 00061 uint_least16_t m_sidChipBase1; 00062 uint_least16_t m_sidChipBase2; 00063 00064 uint_least8_t m_relocStartPage; 00065 00066 uint_least8_t m_relocPages; 00067 00068 std::string m_path; 00069 00070 std::string m_dataFileName; 00071 00072 std::string m_infoFileName; 00073 00074 std::vector<std::string> m_infoString; 00075 00076 std::vector<std::string> m_commentString; 00077 00078 bool m_fixLoad; 00079 00080 private: // prevent copying 00081 SidTuneInfoImpl(const SidTuneInfoImpl&); 00082 SidTuneInfoImpl& operator=(SidTuneInfoImpl&); 00083 00084 public: 00085 SidTuneInfoImpl() : 00086 m_formatString("N/A"), 00087 m_songs(0), 00088 m_startSong(0), 00089 m_currentSong(0), 00090 m_songSpeed(SPEED_VBI), 00091 m_clockSpeed(CLOCK_UNKNOWN), 00092 m_sidModel1(SIDMODEL_UNKNOWN), 00093 m_sidModel2(SIDMODEL_UNKNOWN), 00094 m_compatibility(COMPATIBILITY_C64), 00095 m_dataFileLen(0), 00096 m_c64dataLen(0), 00097 m_loadAddr(0), 00098 m_initAddr(0), 00099 m_playAddr(0), 00100 m_sidChipBase1(0xd400), 00101 m_sidChipBase2(0), 00102 m_relocStartPage(0), 00103 m_relocPages(0), 00104 m_fixLoad(false) {} 00105 00106 uint_least16_t loadAddr() const { return m_loadAddr; } 00107 00108 uint_least16_t initAddr() const { return m_initAddr; } 00109 00110 uint_least16_t playAddr() const { return m_playAddr; } 00111 00112 unsigned int songs() const { return m_songs; } 00113 00114 unsigned int startSong() const { return m_startSong; } 00115 00116 unsigned int currentSong() const { return m_currentSong; } 00117 00118 uint_least16_t sidChipBase1() const { return m_sidChipBase1; } 00119 uint_least16_t sidChipBase2() const { return m_sidChipBase2; } 00120 00121 bool isStereo() const { return (m_sidChipBase1!=0 && m_sidChipBase2!=0); } 00122 00123 int songSpeed() const { return m_songSpeed; } 00124 00125 uint_least8_t relocStartPage() const { return m_relocStartPage; } 00126 00127 uint_least8_t relocPages() const { return m_relocPages; } 00128 00129 model_t sidModel1() const { return m_sidModel1; } 00130 model_t sidModel2() const { return m_sidModel2; } 00131 00132 compatibility_t compatibility() const { return m_compatibility; } 00133 00134 unsigned int numberOfInfoStrings() const { return m_infoString.size(); } 00135 const char* infoString(unsigned int i) const { return i<numberOfInfoStrings()?m_infoString[i].c_str():""; } 00136 00137 unsigned int numberOfCommentStrings() const { return m_commentString.size(); } 00138 const char* commentString(unsigned int i) const { return i<numberOfCommentStrings()?m_commentString[i].c_str():""; } 00139 00140 uint_least32_t dataFileLen() const { return m_dataFileLen; } 00141 00142 uint_least32_t c64dataLen() const { return m_c64dataLen; } 00143 00144 clock_t clockSpeed() const { return m_clockSpeed; } 00145 00146 const char* formatString() const { return m_formatString; } 00147 00148 bool fixLoad() const { return m_fixLoad; } 00149 00150 const char* path() const { return m_path.c_str(); } 00151 00152 const char* dataFileName() const { return m_dataFileName.c_str(); } 00153 00154 const char* infoFileName() const { return !m_infoFileName.empty()?m_infoFileName.c_str():0; } 00155 }; 00156 00157 #endif /* SIDTUNEINFOIMPL_H */