libsidplayfp 1.8.8
SidTune.h
1/*
2 * This file is part of libsidplayfp, a SID player engine.
3 *
4 * Copyright 2011-2013 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
31class SidTuneInfo;
32class SidTuneBase;
33class sidmemory;
34
38class SID_EXTERN SidTune
39{
40public:
41 static const int MD5_LENGTH = 32;
42
43private:
45 static const char** fileNameExtensions;
46
47private: // -------------------------------------------------------------
48 std::auto_ptr<SidTuneBase> tune;
49
50 const char* m_statusString;
51
52 bool m_status;
53
54public: // ----------------------------------------------------------------
55
72 SidTune(const char* fileName, const char **fileNameExt = 0,
73 bool separatorIsSlash = false);
74
82 SidTune(const uint_least8_t* oneFileFormatSidtune, uint_least32_t sidtuneLength);
83
84 virtual ~SidTune();
85
94 void setFileNameExtensions(const char **fileNameExt);
95
102 void load(const char* fileName, bool separatorIsSlash = false);
103
110 void read(const uint_least8_t* sourceBuffer, uint_least32_t bufferLen);
111
118 unsigned int selectSong(unsigned int songNum);
119
125 const SidTuneInfo* getInfo() const;
126
133 const SidTuneInfo* getInfo(unsigned int songNum);
134
142 bool getStatus() const;
143
147 const char* statusString() const;
148
152 bool placeSidTuneInC64mem(sidmemory* mem);
153
161 const char *createMD5(char *md5 = 0);
162
163 const uint_least8_t* c64Data() const;
164
165private: // prevent copying
166 SidTune(const SidTune&);
167 SidTune& operator=(SidTune&);
168};
169
170#endif /* SIDTUNE_H */
Definition: SidTuneBase.h:56
Definition: SidTuneInfo.h:39
Definition: SidTune.h:39
Definition: sidmemory.h:31