libsidplayfp 2.15.0
MUS.h
1/*
2 * This file is part of libsidplayfp, a SID player engine.
3 *
4 * Copyright 2012-2015 Leandro Nini <drfiemost@users.sourceforge.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef MUS_H
22#define MUS_H
23
24#include <stdint.h>
25
26#include "SidTuneBase.h"
27
28#include "sidcxx11.h"
29
30namespace libsidplayfp
31{
32
33class MUS final : public SidTuneBase
34{
35private:
37 uint_least16_t musDataLen;
38
39private:
40 bool mergeParts(buffer_t& musBuf, buffer_t& strBuf);
41
42 void tryLoad(buffer_t& musBuf,
43 buffer_t& strBuf,
44 uint_least32_t fileOffset,
45 uint_least32_t voice3Index,
46 bool init);
47
48protected:
49 MUS() {}
50
51 void installPlayer(sidmemory& mem);
52
53 void setPlayerAddress();
54
55 void acceptSidTune(const char* dataFileName, const char* infoFileName,
56 buffer_t& buf, bool isSlashedFileName) override;
57
58public:
59 ~MUS() override = default;
60
61 static SidTuneBase* load(buffer_t& dataBuf, bool init = false);
62 static SidTuneBase* load(buffer_t& musBuf,
63 buffer_t& strBuf,
64 uint_least32_t fileOffset,
65 bool init = false);
66
67 void placeSidTuneInC64mem(sidmemory& mem) override;
68
69private:
70 // prevent copying
71 MUS(const MUS&) = delete;
72 MUS& operator=(MUS&) = delete;
73};
74
75}
76
77#endif // MUS_H
Definition MUS.h:34
void acceptSidTune(const char *dataFileName, const char *infoFileName, buffer_t &buf, bool isSlashedFileName) override
Definition MUS.cpp:105
void placeSidTuneInC64mem(sidmemory &mem) override
Definition MUS.cpp:112
Definition SidTuneBase.h:61
uint_least32_t fileOffset
For files with header: offset to real data.
Definition SidTuneBase.h:193
Definition sidmemory.h:34