ScummVM API documentation
imuse.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef SCUMM_IMUSE_H
23#define SCUMM_IMUSE_H
24
25#include "audio/mididrv.h"
26#include "common/scummsys.h"
27#include "common/serializer.h"
28#include "common/mutex.h"
29#include "scumm/music.h"
30
31class MidiDriver;
32class OSystem;
33
34namespace Scumm {
35
36class IMuseInternal;
37class Player;
38class ScummEngine;
39
40typedef void (*sysexfunc)(Player *, const byte *, uint16);
41
50class IMuse : public MusicEngine {
51public:
52 enum {
53 PROP_TEMPO_BASE,
54 PROP_LIMIT_PLAYERS,
55 PROP_RECYCLE_PLAYERS,
56 PROP_QUALITY,
57 PROP_MUSICVOLUME,
58 PROP_SFXVOLUME
59 };
60
61public:
62 virtual void on_timer(MidiDriver *midi) = 0;
63 virtual void pause(bool paused) = 0;
64 virtual void saveLoadIMuse(Common::Serializer &ser, ScummEngine *scumm, bool fixAfterLoad = true) = 0;
65 virtual bool get_sound_active(int sound) const = 0;
66 virtual int32 doCommand(int numargs, int args[]) = 0;
67 virtual int clear_queue() = 0;
68 virtual uint32 property(int prop, uint32 value) = 0;
69 virtual void addSysexHandler(byte mfgID, sysexfunc handler) = 0;
70
71public:
72 virtual void startSoundWithNoteOffset(int sound, int offset) = 0;
73
74 // MusicEngine base class methods. Only this one is implemented:
75 void setQuality(int qual) override { property(PROP_QUALITY, qual); }
76
77public:
78 // Factory methods
79 static IMuse *create(ScummEngine *vm, MidiDriver *nativeMidiDriver, MidiDriver *adlibMidiDriver, MidiDriverFlags sndType, bool nativeMT32);
80};
81
82} // End of namespace Scumm
83
84#endif
Definition: serializer.h:80
Definition: mididrv.h:313
Definition: system.h:166
Definition: imuse.h:50
void setQuality(int qual) override
Definition: imuse.h:75
Definition: music.h:40
Definition: scumm.h:536
MidiDriverFlags
Definition: mididrv.h:83
Definition: actor.h:30