libsidplayfp  2.0.2
SidTune.h
1 /*
2  * This file is part of libsidplayfp, a SID player engine.
3  *
4  * Copyright 2011-2015 Leandro Nini <drfiemost@users.sourceforge.net>
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 SIDTUNE_H
24 #define SIDTUNE_H
25 
26 #include <stdint.h>
27 #include <memory>
28 
29 #include "sidplayfp/siddefs.h"
30 
31 class SidTuneInfo;
32 
33 namespace libsidplayfp
34 {
35 class SidTuneBase;
36 class sidmemory;
37 }
38 
42 class SID_EXTERN SidTune
43 {
44 public:
45  static const int MD5_LENGTH = 32;
46 
47 private:
49  static const char** fileNameExtensions;
50 
51 private: // -------------------------------------------------------------
52  std::auto_ptr<libsidplayfp::SidTuneBase> tune;
53 
54  const char* m_statusString;
55 
56  bool m_status;
57 
58 public: // ----------------------------------------------------------------
59 
76  SidTune(const char* fileName, const char **fileNameExt = 0,
77  bool separatorIsSlash = false);
78 
86  SidTune(const uint_least8_t* oneFileFormatSidtune, uint_least32_t sidtuneLength);
87 
88  ~SidTune();
89 
98  void setFileNameExtensions(const char **fileNameExt);
99 
106  void load(const char* fileName, bool separatorIsSlash = false);
107 
114  void read(const uint_least8_t* sourceBuffer, uint_least32_t bufferLen);
115 
122  unsigned int selectSong(unsigned int songNum);
123 
129  const SidTuneInfo* getInfo() const;
130 
137  const SidTuneInfo* getInfo(unsigned int songNum);
138 
146  bool getStatus() const;
147 
151  const char* statusString() const;
152 
156  bool placeSidTuneInC64mem(libsidplayfp::sidmemory& mem);
157 
165  const char *createMD5(char *md5 = 0);
166 
174  const char *createMD5New(char *md5 = 0);
175 
176  const uint_least8_t* c64Data() const;
177 
178 private: // prevent copying
179  SidTune(const SidTune&);
180  SidTune& operator=(SidTune&);
181 };
182 
183 #endif /* SIDTUNE_H */
SidTuneInfo
Definition: SidTuneInfo.h:39
libsidplayfp::sidmemory
Definition: sidmemory.h:34
SidTune
Definition: SidTune.h:43