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 
31 class MidiDriver;
32 class OSystem;
33 
34 namespace Scumm {
35 
36 class IMuseInternal;
37 class Player;
38 class ScummEngine;
39 
40 typedef void (*sysexfunc)(Player *, const byte *, uint16);
41 
50 class IMuse : public MusicEngine {
51 public:
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 
61 public:
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 
71 public:
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 
77 public:
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: music.h:40
MidiDriverFlags
Definition: mididrv.h:81
Definition: serializer.h:79
Definition: mididrv.h:309
Definition: scumm.h:518
Definition: imuse.h:50
Definition: system.h:161
void setQuality(int qual) override
Definition: imuse.h:75
Definition: actor.h:30