libsidplayfp  2.1.0
SidTune.h
1 /*
2  * This file is part of libsidplayfp, a SID player engine.
3  *
4  * Copyright 2011-2020 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 
28 #include "sidplayfp/siddefs.h"
29 
30 class SidTuneInfo;
31 
32 namespace libsidplayfp
33 {
34 class SidTuneBase;
35 class sidmemory;
36 }
37 
41 class SID_EXTERN SidTune
42 {
43 public:
44  static const int MD5_LENGTH = 32;
45 
46 private:
48  static const char** fileNameExtensions;
49 
50 private: // -------------------------------------------------------------
52 
53  const char* m_statusString;
54 
55  bool m_status;
56 
57 public: // ----------------------------------------------------------------
58 
75  SidTune(const char* fileName, const char **fileNameExt = 0,
76  bool separatorIsSlash = false);
77 
85  SidTune(const uint_least8_t* oneFileFormatSidtune, uint_least32_t sidtuneLength);
86 
87  ~SidTune();
88 
97  void setFileNameExtensions(const char **fileNameExt);
98 
105  void load(const char* fileName, bool separatorIsSlash = false);
106 
113  void read(const uint_least8_t* sourceBuffer, uint_least32_t bufferLen);
114 
121  unsigned int selectSong(unsigned int songNum);
122 
128  const SidTuneInfo* getInfo() const;
129 
136  const SidTuneInfo* getInfo(unsigned int songNum);
137 
145  bool getStatus() const;
146 
150  const char* statusString() const;
151 
155  bool placeSidTuneInC64mem(libsidplayfp::sidmemory& mem);
156 
164  const char *createMD5(char *md5 = 0);
165 
173  const char *createMD5New(char *md5 = 0);
174 
175  const uint_least8_t* c64Data() const;
176 
177 private: // prevent copying
178  SidTune(const SidTune&);
179  SidTune& operator=(SidTune&);
180 };
181 
182 #endif /* SIDTUNE_H */
Definition: SidTuneInfo.h:39
Definition: SidTune.h:42
Definition: SidTuneBase.h:61
Definition: sidmemory.h:34