ScummVM API documentation
player_he.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_PLAYERS_PLAYER_HE_H
23 #define SCUMM_PLAYERS_PLAYER_HE_H
24 
25 #include "scumm/music.h"
26 #include "audio/mixer.h"
27 #include "audio/mididrv.h"
28 #include "common/mutex.h"
29 
30 class MidiParser;
31 
32 namespace Scumm {
33 class ScummEngine;
34 
35 class Player_HE : public MusicEngine, public MidiDriver {
36 public:
37  Player_HE(ScummEngine *scumm);
38  ~Player_HE() override;
39  void setMusicVolume(int vol) override;
40  void startSound(int sound) override { startSoundWithTrackID(sound, 0); }
41  void startSoundWithTrackID(int sound, int track) override;
42  void stopSound(int sound) override;
43  void stopAllSounds() override;
44  int getSoundStatus(int sound) const override;
45  int getMusicTimer() override;
46 
47  int open() override;
48  bool isOpen() const override;
49  void close() override;
50  void setTimerCallback(void *timerParam, Common::TimerManager::TimerProc timerProc) override;
51  uint32 getBaseTempo() override;
52  MidiChannel *allocateChannel() override { return NULL; };
53  MidiChannel *getPercussionChannel() override { return NULL; };
54  void send(uint32 b) override;
55 
56 private:
57  ScummEngine *_vm;
58  MidiParser *_parser;
59  MidiDriver *_midi;
60  Common::Mutex _mutex;
61  byte *_bank;
62  int _bankSize;
63  int _currentMusic;
64  int _masterVolume;
65  byte _channelVolume[16];
66  static void onTimer(void *data);
67  void loadAdLibBank();
68 };
69 }
70 
71 #endif
bool isOpen() const override
void(* TimerProc)(void *refCon)
Definition: timer.h:42
void stopSound(int sound) override
Definition: music.h:40
uint32 getBaseTempo() override
Definition: mididrv.h:309
Definition: scumm.h:518
void startSoundWithTrackID(int sound, int track) override
int open() override
Definition: mutex.h:67
void setMusicVolume(int vol) override
Definition: player_he.h:35
Definition: mididrv.h:537
int getMusicTimer() override
void close() override
void startSound(int sound) override
Definition: player_he.h:40
int getSoundStatus(int sound) const override
void stopAllSounds() override
Definition: actor.h:30
void send(uint32 b) override
Definition: midiparser.h:289