ScummVM API documentation
sega_audio.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 SEGA_AUDIO_H
23#define SEGA_AUDIO_H
24
25#include "common/scummsys.h"
26
27namespace Audio {
28class Mixer;
29}
30
31class SegaAudioInterfaceInternal;
33public:
34 virtual ~SegaAudioPluginDriver() {}
35 virtual void timerCallback60Hz() {}
36 virtual void timerCallbackA() {}
37 virtual void timerCallbackB() {}
38};
39
41public:
44
45 bool init();
46 void reset();
47
48 void loadPCMData(uint16 address, const uint8 *data, uint16 dataSize);
49 void playPCMChannel(uint8 channel, uint8 dataStart, uint16 loopStart, uint16 rate, uint8 pan, uint8 env);
50 void stopPCMChannel(uint8 channel);
51
52 void writeReg(uint8 part, uint8 regAddress, uint8 value);
53 uint8 readReg(uint8 part, uint8 regAddress);
54
55 void psgWrite(uint8 data);
56
57 void setMusicVolume(int volume);
58 void setSoundEffectVolume(int volume);
59
60 // Defines the channels used as sound effect channels for the purpose of ScummVM GUI volume control.
61 // The first 6 bits are 6 fm channels. The next 3 bits are psg channels. The bits that follow represent pcm channels.
62 void setSoundEffectChanMask(int mask);
63
64 class MutexLock {
65 friend class SegaAudioInterface;
66 public:
67 ~MutexLock();
68 private:
69 MutexLock(SegaAudioInterfaceInternal *saii, int reverse = 0);
70 SegaAudioInterfaceInternal *_saii;
71 int _count;
72 };
73
74 MutexLock stackLockMutex();
75 MutexLock stackUnlockMutex();
76
77private:
78 SegaAudioInterfaceInternal *_internal;
79};
80
81#endif
Definition: mixer.h:70
Definition: sega_audio.h:64
Definition: sega_audio.h:40
Definition: sega_audio.h:32
Definition: system.h:39