libsidplayfp 2.15.0
SidTune.h
1/*
2 * This file is part of libsidplayfp, a SID player engine.
3 *
4 * Copyright 2011-2021 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 <vector>
28
29#include "sidplayfp/siddefs.h"
30
31class SidTuneInfo;
32
33namespace libsidplayfp
34{
35class SidTuneBase;
36class sidmemory;
37}
38
42class SID_EXTERN SidTune
43{
44public:
45 static const int MD5_LENGTH = 32;
46
47private:
49 static const char** fileNameExtensions;
50
51private: // -------------------------------------------------------------
53
54 const char* m_statusString;
55
56 bool m_status;
57
58public: // ----------------------------------------------------------------
59
60 typedef void (*LoaderFunc)(const char* fileName, std::vector<uint8_t>& bufferRef);
61
78 SidTune(const char* fileName, const char **fileNameExt = 0,
79 bool separatorIsSlash = false);
80
93 SidTune(LoaderFunc loader, const char* fileName, const char **fileNameExt = 0,
94 bool separatorIsSlash = false);
95
103 SidTune(const uint_least8_t* oneFileFormatSidtune, uint_least32_t sidtuneLength);
104
105 ~SidTune();
106
115 void setFileNameExtensions(const char **fileNameExt);
116
123 void load(const char* fileName, bool separatorIsSlash = false);
124
133 void load(LoaderFunc loader, const char* fileName, bool separatorIsSlash = false);
134
141 void read(const uint_least8_t* sourceBuffer, uint_least32_t bufferLen);
142
149 unsigned int selectSong(unsigned int songNum);
150
156 const SidTuneInfo* getInfo() const;
157
164 const SidTuneInfo* getInfo(unsigned int songNum);
165
173 bool getStatus() const;
174
178 const char* statusString() const;
179
183 bool placeSidTuneInC64mem(libsidplayfp::sidmemory& mem);
184
192 const char *createMD5(char *md5 = 0);
193
201 const char *createMD5New(char *md5 = 0);
202
203 const uint_least8_t* c64Data() const;
204
205private: // prevent copying
206 SidTune(const SidTune&);
207 SidTune& operator=(SidTune&);
208};
209
210#endif /* SIDTUNE_H */
Definition SidTuneInfo.h:39
Definition SidTune.h:43
Definition SidTuneBase.h:61
Definition sidmemory.h:34