ScummVM API documentation
macintosh.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_DRV_MAC_H
23 #define SCUMM_IMUSE_DRV_MAC_H
24 
25 #include "audio/mididrv.h"
26 #include "scumm/players/mac_sound_lowlevel.h"
27 
28 namespace Audio {
29 class Mixer;
30 }
31 
32 namespace IMSMacintosh {
33 class IMuseChannel_Macintosh;
34 class IMSMacSoundSystem;
35 struct ChanControlNode;
36 } // End of namespace IMSMacintosh
37 
38 namespace Scumm {
39 
40 class IMuseDriver_Macintosh final : public MidiDriver {
41  friend class IMSMacintosh::IMuseChannel_Macintosh;
42 public:
43  IMuseDriver_Macintosh(ScummEngine *vm, Audio::Mixer *mixer, byte gameID);
44  virtual ~IMuseDriver_Macintosh() override;
45 
46  int open() override;
47  void close() override;
48 
49  bool isOpen() const override { return _isOpen; }
50  uint32 property(int prop, uint32 param) override;
51  void setTimerCallback(void *timerParam, Common::TimerManager::TimerProc timerProc) override;
52  uint32 getBaseTempo() override { return _baseTempo; }
53  void send(uint32 b) override { error("%s():: Not implemented", __FUNCTION__); }
54 
55  // Channel allocation functions
56  MidiChannel *allocateChannel() override;
57  MidiChannel *getPercussionChannel() override;
58 
59 private:
60  void createChannels();
61  void releaseChannels();
62 
63  bool _isOpen;
64  uint32 _quality;
65  uint32 _musicVolume;
66  uint32 _sfxVolume;
67 
68  IMSMacintosh::IMSMacSoundSystem *_device;
69  IMSMacintosh::IMuseChannel_Macintosh **_imsParts;
70  IMSMacintosh::ChanControlNode **_channels;
71 
72  byte _numChannels;
73  byte _numParts;
74  uint32 _baseTempo;
75  int8 _version;
76 };
77 
78 } // End of namespace Scumm
79 
80 #endif
Definition: macintosh.h:40
void(* TimerProc)(void *refCon)
Definition: timer.h:42
bool isOpen() const override
Definition: macintosh.h:49
Definition: mididrv.h:309
void send(uint32 b) override
Definition: macintosh.h:53
Definition: scumm.h:518
Definition: mixer.h:59
uint32 getBaseTempo() override
Definition: macintosh.h:52
Definition: mididrv.h:537
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: macintosh.h:32
Definition: actor.h:30
Definition: system.h:38