aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/sound/sound_manager.cpp
blob: 0d133c37e6d10ccdb5eee27c221c3703b072742e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

#include "titanic/sound/sound_manager.h"

namespace Titanic {

const uint SAMPLING_RATE = 22050;
const uint LATENCY = 100;
const uint CHANNELS_COUNT = 16;

CSoundManager::CSoundManager() : _musicPercent(75.0), _speechPercent(75.0),
	_masterPercent(75.0), _parrotPercent(75.0), _field14(1) {
}

/*------------------------------------------------------------------------*/

QSoundManager::QSoundManager(Audio::Mixer *mixer) : CSoundManager(), QMixer(mixer),
		_field18(0), _field1C(0) {
	Common::fill(&_field4A0[0], &_field4A0[16], 0);

	qsWaveMixInitEx(QMIXCONFIG(SAMPLING_RATE, CHANNELS_COUNT, LATENCY));
	qsWaveMixActivate(true);
	qsWaveMixOpenChannel(0, QMIX_OPENALL);
}

QSoundManager::~QSoundManager() {
	// Close down the mixer
	qsWaveMixCloseSession();
}

CWaveFile *QSoundManager::loadSound(const CString &name) {
	CWaveFile *waveFile = new CWaveFile();

	// Try to load the specified sound
	if (!waveFile->loadSound(name)) {
		delete waveFile;
		return nullptr;
	}

	return waveFile;
}

CWaveFile *QSoundManager::loadSpeech(CDialogueFile *dialogueFile, int speechId) {
	warning("TODO");
	return nullptr;
}

int QSoundManager::proc5() const {
	warning("TODO");
	return 0;
}

int QSoundManager::playSound(CWaveFile &soundRes, CProximity &prox) {
	warning("TODO");
	return 0;
}

void QSoundManager::proc7() {
	warning("TODO");
}

void QSoundManager::proc8(int v) {
	warning("TODO");
}

void QSoundManager::proc9() {
	warning("TODO");
}

void QSoundManager::proc10() {
	warning("TODO");
}

void QSoundManager::proc11() {
	warning("TODO");
}

void QSoundManager::proc12() {
	warning("TODO");
}

void QSoundManager::proc13() {
	warning("TODO");
}

bool QSoundManager::proc14() {
	warning("TODO");
	return false;
}

bool QSoundManager::isActive(const CWaveFile *waveFile) const {
	warning("TODO");
	return false;
}

int QSoundManager::proc16() const {
	warning("TODO");
	return 0;
}

uint QSoundManager::getLatency() const {
	return LATENCY;
}

void QSoundManager::proc19(int v) {
	warning("TODO");
}

void QSoundManager::proc20(int v) {
	warning("TODO");
}

void QSoundManager::proc21(int v) {
	warning("TODO");
}

void QSoundManager::proc29() {
	warning("TODO");
}

void QSoundManager::proc30() {
	warning("TODO");
}

void QSoundManager::soundFreed(Audio::SoundHandle &handle) {
	qsWaveMixFreeWave(handle);
}

} // End of namespace Titanic z