libsidplayfp 1.0.3
SidInfoImpl.h
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 SIDINFOIMPL_H
00024 #define SIDINFOIMPL_H
00025 
00026 #include <stdint.h>
00027 #include <vector>
00028 #include <string>
00029 
00030 #include "sidplayfp/SidInfo.h"
00031 
00032 #include "c64/c64.h"
00033 
00034 #ifdef HAVE_CONFIG_H
00035 #  include "config.h"
00036 #endif
00037 
00038 #ifndef PACKAGE_NAME
00039 #   define PACKAGE_NAME PACKAGE
00040 #endif
00041 
00042 #ifndef PACKAGE_VERSION
00043 #   define PACKAGE_VERSION VERSION
00044 #endif
00045 
00049 class SidInfoImpl : public SidInfo
00050 {
00051 public:
00052     const std::string m_name;
00053     const std::string m_version;
00054     std::vector<std::string> m_credits;
00055 
00056     std::string m_speedString;
00057 
00058     std::string m_kernalDesc;
00059     std::string m_basicDesc;
00060     std::string m_chargenDesc;
00061 
00062     const unsigned int m_maxsids;
00063 
00064     unsigned int m_channels;
00065 
00066     uint_least16_t m_driverAddr;
00067     uint_least16_t m_driverLength;
00068 
00069     uint_least16_t m_powerOnDelay;
00070 
00071 private:    // prevent copying
00072     SidInfoImpl(const SidInfoImpl&);
00073     SidInfoImpl& operator=(SidInfoImpl&);
00074 
00075 public:
00076     SidInfoImpl() :
00077         m_name(PACKAGE_NAME),
00078         m_version(PACKAGE_VERSION),
00079         m_maxsids(c64::MAX_SIDS),
00080         m_channels(1),
00081         m_driverAddr(0),
00082         m_driverLength(0),
00083         m_powerOnDelay(0)
00084     {
00085         m_credits.push_back(PACKAGE_NAME " V" PACKAGE_VERSION " Engine:\n"
00086             "\tCopyright (C) 2000 Simon White\n"
00087             "\tCopyright (C) 2007-2010 Antti Lankila\n"
00088             "\tCopyright (C) 2010-2012 Leandro Nini\n"
00089             "\thttp://sourceforge.net/projects/sidplay-residfp/\n");
00090     }
00091 
00092     const char *name() const { return m_name.c_str(); }
00093     const char *version() const { return m_version.c_str(); }
00094 
00095     unsigned int numberOfCredits() const { return m_credits.size(); }
00096     const char *credits(unsigned int i) const { return i<m_credits.size()?m_credits[i].c_str():""; }
00097 
00098     unsigned int maxsids() const { return m_maxsids; }
00099 
00100     unsigned int channels() const { return m_channels; }
00101 
00102     uint_least16_t driverAddr() const { return m_driverAddr; }
00103     uint_least16_t driverLength() const { return m_driverLength; }
00104 
00105     uint_least16_t powerOnDelay() const { return m_powerOnDelay; }
00106 
00107     const char *speedString() const { return m_speedString.c_str(); }
00108 
00109     const char *kernalDesc() const { return m_kernalDesc.c_str(); }
00110     const char *basicDesc() const { return m_basicDesc.c_str(); }
00111     const char *chargenDesc() const { return m_chargenDesc.c_str(); }
00112 };
00113 
00114 #endif  /* SIDTUNEINFOIMPL_H */