2007-05-30 21:56:52 +00:00
|
|
|
/* 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.
|
2007-01-14 21:29:12 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "common/file.h"
|
|
|
|
|
2007-02-21 21:42:37 +00:00
|
|
|
#include "common/stream.h"
|
2007-01-14 21:29:12 +00:00
|
|
|
|
2007-04-27 20:06:42 +00:00
|
|
|
#include "sound/mixer.h"
|
2007-02-21 21:42:37 +00:00
|
|
|
#include "sound/midiparser.h"
|
2007-04-27 20:06:42 +00:00
|
|
|
#include "sound/mods/protracker.h"
|
2007-01-14 21:29:12 +00:00
|
|
|
|
2007-05-01 16:21:16 +00:00
|
|
|
#include "parallaction/sound.h"
|
2007-04-27 20:06:42 +00:00
|
|
|
#include "parallaction/parallaction.h"
|
2007-01-14 21:29:12 +00:00
|
|
|
|
|
|
|
|
2007-02-21 21:42:37 +00:00
|
|
|
namespace Parallaction {
|
2007-01-14 21:29:12 +00:00
|
|
|
|
2007-04-27 20:06:42 +00:00
|
|
|
class MidiPlayer : public MidiDriver {
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum {
|
|
|
|
NUM_CHANNELS = 16
|
|
|
|
};
|
|
|
|
|
|
|
|
MidiPlayer(MidiDriver *driver);
|
|
|
|
~MidiPlayer();
|
|
|
|
|
2008-10-29 08:16:13 +00:00
|
|
|
void play(Common::SeekableReadStream *stream);
|
2007-04-27 20:06:42 +00:00
|
|
|
void stop();
|
|
|
|
void updateTimer();
|
|
|
|
void adjustVolume(int diff);
|
|
|
|
void setVolume(int volume);
|
|
|
|
int getVolume() const { return _masterVolume; }
|
|
|
|
void setLooping(bool loop) { _isLooping = loop; }
|
|
|
|
|
|
|
|
// MidiDriver interface
|
|
|
|
int open();
|
|
|
|
void close();
|
|
|
|
void send(uint32 b);
|
|
|
|
void metaEvent(byte type, byte *data, uint16 length);
|
|
|
|
void setTimerCallback(void *timerParam, void (*timerProc)(void *)) { }
|
|
|
|
uint32 getBaseTempo() { return _driver ? _driver->getBaseTempo() : 0; }
|
|
|
|
MidiChannel *allocateChannel() { return 0; }
|
|
|
|
MidiChannel *getPercussionChannel() { return 0; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
static void timerCallback(void *p);
|
|
|
|
|
|
|
|
MidiDriver *_driver;
|
|
|
|
MidiParser *_parser;
|
|
|
|
uint8 *_midiData;
|
|
|
|
bool _isLooping;
|
|
|
|
bool _isPlaying;
|
|
|
|
int _masterVolume;
|
|
|
|
MidiChannel *_channelsTable[NUM_CHANNELS];
|
|
|
|
uint8 _channelsVolume[NUM_CHANNELS];
|
|
|
|
Common::Mutex _mutex;
|
|
|
|
};
|
|
|
|
|
2007-02-21 21:42:37 +00:00
|
|
|
MidiPlayer::MidiPlayer(MidiDriver *driver)
|
|
|
|
: _driver(driver), _parser(0), _midiData(0), _isLooping(false), _isPlaying(false), _masterVolume(0) {
|
|
|
|
assert(_driver);
|
|
|
|
memset(_channelsTable, 0, sizeof(_channelsTable));
|
|
|
|
memset(_channelsVolume, 0, sizeof(_channelsVolume));
|
2007-01-14 21:29:12 +00:00
|
|
|
|
2007-02-21 21:42:37 +00:00
|
|
|
open();
|
2007-01-14 21:29:12 +00:00
|
|
|
}
|
|
|
|
|
2007-02-21 21:42:37 +00:00
|
|
|
MidiPlayer::~MidiPlayer() {
|
|
|
|
close();
|
2007-01-14 21:29:12 +00:00
|
|
|
}
|
|
|
|
|
2008-10-29 08:16:13 +00:00
|
|
|
void MidiPlayer::play(Common::SeekableReadStream *stream) {
|
|
|
|
if (!stream) {
|
|
|
|
stop();
|
2007-01-14 21:29:12 +00:00
|
|
|
return;
|
2008-10-29 08:16:13 +00:00
|
|
|
}
|
2007-01-14 21:29:12 +00:00
|
|
|
|
2008-10-29 08:16:13 +00:00
|
|
|
int size = stream->size();
|
2007-02-21 21:42:37 +00:00
|
|
|
|
|
|
|
_midiData = (uint8 *)malloc(size);
|
|
|
|
if (_midiData) {
|
2008-10-29 08:16:13 +00:00
|
|
|
stream->read(_midiData, size);
|
2008-11-04 13:57:29 +00:00
|
|
|
delete stream;
|
2007-02-21 21:42:37 +00:00
|
|
|
_mutex.lock();
|
|
|
|
_parser->loadMusic(_midiData, size);
|
|
|
|
_parser->setTrack(0);
|
|
|
|
_isLooping = true;
|
|
|
|
_isPlaying = true;
|
|
|
|
_mutex.unlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MidiPlayer::stop() {
|
|
|
|
_mutex.lock();
|
|
|
|
if (_isPlaying) {
|
|
|
|
_isPlaying = false;
|
|
|
|
_parser->unloadMusic();
|
|
|
|
free(_midiData);
|
|
|
|
_midiData = 0;
|
|
|
|
}
|
|
|
|
_mutex.unlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MidiPlayer::updateTimer() {
|
|
|
|
_mutex.lock();
|
|
|
|
if (_isPlaying) {
|
|
|
|
_parser->onTimer();
|
|
|
|
}
|
|
|
|
_mutex.unlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MidiPlayer::adjustVolume(int diff) {
|
|
|
|
setVolume(_masterVolume + diff);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MidiPlayer::setVolume(int volume) {
|
|
|
|
_masterVolume = CLIP(volume, 0, 255);
|
|
|
|
_mutex.lock();
|
|
|
|
for (int i = 0; i < NUM_CHANNELS; ++i) {
|
|
|
|
if (_channelsTable[i]) {
|
|
|
|
_channelsTable[i]->volume(_channelsVolume[i] * _masterVolume / 255);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_mutex.unlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
int MidiPlayer::open() {
|
|
|
|
int ret = _driver->open();
|
|
|
|
if (ret == 0) {
|
|
|
|
_parser = MidiParser::createParser_SMF();
|
|
|
|
_parser->setMidiDriver(this);
|
|
|
|
_parser->setTimerRate(_driver->getBaseTempo());
|
|
|
|
_driver->setTimerCallback(this, &timerCallback);
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MidiPlayer::close() {
|
|
|
|
stop();
|
|
|
|
_mutex.lock();
|
|
|
|
_driver->setTimerCallback(NULL, NULL);
|
|
|
|
_driver->close();
|
2008-07-11 12:55:08 +00:00
|
|
|
delete _driver;
|
2007-02-21 21:42:37 +00:00
|
|
|
_driver = 0;
|
|
|
|
_parser->setMidiDriver(NULL);
|
|
|
|
delete _parser;
|
|
|
|
_mutex.unlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MidiPlayer::send(uint32 b) {
|
|
|
|
byte volume, ch = (byte)(b & 0xF);
|
|
|
|
switch (b & 0xFFF0) {
|
|
|
|
case 0x07B0: // volume change
|
|
|
|
volume = (byte)((b >> 16) & 0x7F);
|
|
|
|
_channelsVolume[ch] = volume;
|
|
|
|
volume = volume * _masterVolume / 255;
|
|
|
|
b = (b & 0xFF00FFFF) | (volume << 16);
|
|
|
|
break;
|
|
|
|
case 0x7BB0: // all notes off
|
|
|
|
if (!_channelsTable[ch]) {
|
|
|
|
// channel not yet allocated, no need to send the event
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!_channelsTable[ch]) {
|
|
|
|
_channelsTable[ch] = (ch == 9) ? _driver->getPercussionChannel() : _driver->allocateChannel();
|
|
|
|
}
|
|
|
|
if (_channelsTable[ch]) {
|
|
|
|
_channelsTable[ch]->send(b);
|
|
|
|
}
|
|
|
|
}
|
2007-01-14 21:29:12 +00:00
|
|
|
|
2007-02-21 21:42:37 +00:00
|
|
|
void MidiPlayer::metaEvent(byte type, byte *data, uint16 length) {
|
|
|
|
switch (type) {
|
|
|
|
case 0x2F: // end of Track
|
|
|
|
if (_isLooping) {
|
|
|
|
_parser->jumpToTick(0);
|
|
|
|
} else {
|
|
|
|
stop();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
// warning("Unhandled meta event: %02x", type);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2007-01-14 21:29:12 +00:00
|
|
|
|
2007-02-21 21:42:37 +00:00
|
|
|
void MidiPlayer::timerCallback(void *p) {
|
|
|
|
MidiPlayer *player = (MidiPlayer *)p;
|
2007-01-14 21:29:12 +00:00
|
|
|
|
2007-02-21 21:42:37 +00:00
|
|
|
player->updateTimer();
|
2007-01-14 21:29:12 +00:00
|
|
|
}
|
|
|
|
|
2007-04-27 20:06:42 +00:00
|
|
|
|
|
|
|
DosSoundMan::DosSoundMan(Parallaction *vm, MidiDriver *midiDriver) : SoundMan(vm), _musicData1(0) {
|
|
|
|
_midiPlayer = new MidiPlayer(midiDriver);
|
|
|
|
}
|
|
|
|
|
|
|
|
DosSoundMan::~DosSoundMan() {
|
2007-05-12 12:56:35 +00:00
|
|
|
debugC(1, kDebugAudio, "DosSoundMan::playMusic()");
|
|
|
|
|
2007-04-27 20:06:42 +00:00
|
|
|
delete _midiPlayer;
|
|
|
|
}
|
|
|
|
|
2008-10-29 08:16:13 +00:00
|
|
|
bool DosSoundMan::isLocationSilent(const char *locationName) {
|
|
|
|
|
|
|
|
// these are the prefixes for location names with no background midi music
|
|
|
|
const char *noMusicPrefix[] = { "museo", "intgrottadopo", "caveau", "estgrotta", "plaza1", "endtgz", "common", 0 };
|
|
|
|
Common::String s(locationName);
|
|
|
|
|
|
|
|
for (int i = 0; noMusicPrefix[i]; i++) {
|
|
|
|
if (s.hasPrefix(noMusicPrefix[i])) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2007-04-27 20:06:42 +00:00
|
|
|
void DosSoundMan::playMusic() {
|
2007-05-12 12:56:35 +00:00
|
|
|
debugC(1, kDebugAudio, "DosSoundMan::playMusic()");
|
|
|
|
|
2008-10-29 08:16:13 +00:00
|
|
|
if (isLocationSilent(_vm->_location._name)) {
|
|
|
|
// just stop the music if this location is silent
|
|
|
|
_midiPlayer->stop();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Common::SeekableReadStream *stream = _vm->_disk->loadMusic(_musicFile);
|
|
|
|
_midiPlayer->play(stream);
|
2007-04-27 20:06:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DosSoundMan::stopMusic() {
|
|
|
|
_midiPlayer->stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DosSoundMan::playCharacterMusic(const char *character) {
|
2008-07-09 02:49:20 +00:00
|
|
|
if (character == NULL) {
|
|
|
|
return;
|
|
|
|
}
|
2007-04-27 20:06:42 +00:00
|
|
|
|
|
|
|
if (!scumm_stricmp(_vm->_location._name, "night") ||
|
|
|
|
!scumm_stricmp(_vm->_location._name, "intsushi")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
char *name = const_cast<char*>(character);
|
|
|
|
|
|
|
|
if (!scumm_stricmp(name, _dinoName)) {
|
|
|
|
setMusicFile("dino");
|
|
|
|
} else
|
|
|
|
if (!scumm_stricmp(name, _donnaName)) {
|
2007-08-19 19:05:41 +00:00
|
|
|
setMusicFile("donna");
|
2007-04-27 20:06:42 +00:00
|
|
|
} else
|
|
|
|
if (!scumm_stricmp(name, _doughName)) {
|
|
|
|
setMusicFile("nuts");
|
|
|
|
} else {
|
|
|
|
warning("unknown character '%s' in DosSoundMan::playCharacterMusic", character);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
playMusic();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DosSoundMan::playLocationMusic(const char *location) {
|
|
|
|
if (_musicData1 != 0) {
|
2007-09-22 18:45:43 +00:00
|
|
|
playCharacterMusic(_vm->_char.getBaseName());
|
2007-04-27 20:06:42 +00:00
|
|
|
_musicData1 = 0;
|
2007-09-16 08:43:34 +00:00
|
|
|
debugC(2, kDebugExec, "changeLocation: started character specific music");
|
2007-04-27 20:06:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!scumm_stricmp(location, "night") || !scumm_stricmp(location, "intsushi")) {
|
|
|
|
setMusicFile("nuts");
|
|
|
|
playMusic();
|
|
|
|
|
2007-09-16 08:43:34 +00:00
|
|
|
debugC(2, kDebugExec, "changeLocation: started music 'soft'");
|
2007-04-27 20:06:42 +00:00
|
|
|
}
|
|
|
|
|
2008-10-29 08:16:13 +00:00
|
|
|
if (isLocationSilent(location)) {
|
2007-04-27 20:06:42 +00:00
|
|
|
stopMusic();
|
|
|
|
_musicData1 = 1;
|
|
|
|
|
2007-09-16 08:43:34 +00:00
|
|
|
debugC(2, kDebugExec, "changeLocation: music stopped");
|
2007-04-27 20:06:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AmigaSoundMan::AmigaSoundMan(Parallaction *vm) : SoundMan(vm) {
|
|
|
|
_musicStream = 0;
|
2007-05-20 19:59:15 +00:00
|
|
|
_channels[0].data = 0;
|
2008-11-01 12:39:01 +00:00
|
|
|
_channels[0].dispose = false;
|
2008-01-06 20:42:28 +00:00
|
|
|
_channels[1].data = 0;
|
2008-11-01 12:39:01 +00:00
|
|
|
_channels[1].dispose = false;
|
2008-01-06 20:42:28 +00:00
|
|
|
_channels[2].data = 0;
|
2008-11-01 12:39:01 +00:00
|
|
|
_channels[2].dispose = false;
|
2008-01-06 20:42:28 +00:00
|
|
|
_channels[3].data = 0;
|
2008-11-01 12:39:01 +00:00
|
|
|
_channels[3].dispose = false;
|
2007-04-27 20:06:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AmigaSoundMan::~AmigaSoundMan() {
|
|
|
|
stopMusic();
|
2007-05-20 19:59:15 +00:00
|
|
|
stopSfx(0);
|
|
|
|
stopSfx(1);
|
|
|
|
stopSfx(2);
|
|
|
|
stopSfx(3);
|
2007-04-27 20:06:42 +00:00
|
|
|
}
|
|
|
|
|
2007-10-15 20:20:50 +00:00
|
|
|
#define AMIGABEEP_SIZE 16
|
|
|
|
#define NUM_REPEATS 60
|
|
|
|
|
|
|
|
static int8 res_amigaBeep[AMIGABEEP_SIZE] = {
|
|
|
|
0, 20, 40, 60, 80, 60, 40, 20, 0, -20, -40, -60, -80, -60, -40, -20
|
2007-10-07 19:18:41 +00:00
|
|
|
};
|
|
|
|
|
2007-10-15 20:20:50 +00:00
|
|
|
|
2007-10-07 19:18:41 +00:00
|
|
|
void AmigaSoundMan::loadChannelData(const char *filename, Channel *ch) {
|
|
|
|
if (!scumm_stricmp("beep", filename)) {
|
|
|
|
ch->header.oneShotHiSamples = 0;
|
|
|
|
ch->header.repeatHiSamples = 0;
|
|
|
|
ch->header.samplesPerHiCycle = 0;
|
2007-10-15 20:20:50 +00:00
|
|
|
ch->header.samplesPerSec = 11934;
|
|
|
|
ch->header.volume = 160;
|
2008-11-01 12:39:01 +00:00
|
|
|
ch->data = (int8*)malloc(AMIGABEEP_SIZE * NUM_REPEATS);
|
2007-10-15 20:20:50 +00:00
|
|
|
int8* odata = ch->data;
|
|
|
|
for (uint i = 0; i < NUM_REPEATS; i++) {
|
|
|
|
memcpy(odata, res_amigaBeep, AMIGABEEP_SIZE);
|
|
|
|
odata += AMIGABEEP_SIZE;
|
|
|
|
}
|
|
|
|
ch->dataSize = AMIGABEEP_SIZE * NUM_REPEATS;
|
|
|
|
ch->dispose = true;
|
2007-10-07 19:18:41 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Common::ReadStream *stream = _vm->_disk->loadSound(filename);
|
|
|
|
Audio::A8SVXDecoder decoder(*stream, ch->header, ch->data, ch->dataSize);
|
|
|
|
decoder.decode();
|
2007-10-15 09:21:13 +00:00
|
|
|
ch->dispose = true;
|
2007-10-07 19:18:41 +00:00
|
|
|
delete stream;
|
|
|
|
}
|
|
|
|
|
2007-05-01 15:39:40 +00:00
|
|
|
void AmigaSoundMan::playSfx(const char *filename, uint channel, bool looping, int volume, int rate) {
|
2007-05-01 17:17:00 +00:00
|
|
|
if (channel >= NUM_AMIGA_CHANNELS) {
|
2007-05-01 15:39:40 +00:00
|
|
|
warning("unknown sfx channel");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-11-01 12:39:01 +00:00
|
|
|
stopSfx(channel);
|
|
|
|
|
2007-05-12 12:56:35 +00:00
|
|
|
debugC(1, kDebugAudio, "AmigaSoundMan::playSfx(%s, %i)", filename, channel);
|
|
|
|
|
2007-05-01 15:39:40 +00:00
|
|
|
Channel *ch = &_channels[channel];
|
2007-10-07 19:18:41 +00:00
|
|
|
loadChannelData(filename, ch);
|
2007-05-01 15:39:40 +00:00
|
|
|
|
|
|
|
uint32 loopStart, loopEnd, flags;
|
|
|
|
if (looping) {
|
|
|
|
// the standard way to loop 8SVX audio implies use of the oneShotHiSamples and
|
|
|
|
// repeatHiSamples fields, but Nippon Safes handles loops according to flags
|
|
|
|
// set in its location scripts and always operates on the whole data.
|
|
|
|
loopStart = 0;
|
|
|
|
loopEnd = ch->header.oneShotHiSamples + ch->header.repeatHiSamples;
|
|
|
|
flags = Audio::Mixer::FLAG_LOOP;
|
|
|
|
} else {
|
|
|
|
loopStart = loopEnd = 0;
|
|
|
|
flags = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (volume == -1) {
|
|
|
|
volume = ch->header.volume;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rate == -1) {
|
|
|
|
rate = ch->header.samplesPerSec;
|
|
|
|
}
|
|
|
|
|
|
|
|
_mixer->playRaw(Audio::Mixer::kSFXSoundType, &ch->handle, ch->data, ch->dataSize, rate, flags, -1, volume, 0, loopStart, loopEnd);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AmigaSoundMan::stopSfx(uint channel) {
|
2007-05-01 17:17:00 +00:00
|
|
|
if (channel >= NUM_AMIGA_CHANNELS) {
|
2007-05-01 15:39:40 +00:00
|
|
|
warning("unknown sfx channel");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-01-06 20:42:28 +00:00
|
|
|
if (_channels[channel].dispose) {
|
|
|
|
debugC(1, kDebugAudio, "AmigaSoundMan::stopSfx(%i)", channel);
|
|
|
|
_mixer->stopHandle(_channels[channel].handle);
|
|
|
|
free(_channels[channel].data);
|
|
|
|
_channels[channel].data = 0;
|
|
|
|
}
|
2007-05-01 15:39:40 +00:00
|
|
|
}
|
|
|
|
|
2007-04-27 20:06:42 +00:00
|
|
|
void AmigaSoundMan::playMusic() {
|
|
|
|
stopMusic();
|
|
|
|
|
2007-05-12 12:56:35 +00:00
|
|
|
debugC(1, kDebugAudio, "AmigaSoundMan::playMusic()");
|
|
|
|
|
2007-07-28 07:52:24 +00:00
|
|
|
Common::SeekableReadStream *stream = _vm->_disk->loadMusic(_musicFile);
|
2007-04-27 20:06:42 +00:00
|
|
|
_musicStream = Audio::makeProtrackerStream(stream);
|
|
|
|
delete stream;
|
|
|
|
|
2007-05-12 12:56:35 +00:00
|
|
|
debugC(3, kDebugAudio, "AmigaSoundMan::playMusic(): created new music stream");
|
|
|
|
|
2007-05-01 15:39:40 +00:00
|
|
|
_mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, _musicStream, -1, 255, 0, false, false);
|
2007-04-27 20:06:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void AmigaSoundMan::stopMusic() {
|
2007-05-12 12:56:35 +00:00
|
|
|
debugC(1, kDebugAudio, "AmigaSoundMan::stopMusic()");
|
|
|
|
|
|
|
|
if (_mixer->isSoundHandleActive(_musicHandle)) {
|
|
|
|
_mixer->stopHandle(_musicHandle);
|
|
|
|
delete _musicStream;
|
|
|
|
_musicStream = 0;
|
|
|
|
}
|
2007-04-27 20:06:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void AmigaSoundMan::playCharacterMusic(const char *character) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void AmigaSoundMan::playLocationMusic(const char *location) {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SoundMan::SoundMan(Parallaction *vm) : _vm(vm) {
|
|
|
|
_mixer = _vm->_mixer;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SoundMan::setMusicVolume(int value) {
|
|
|
|
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SoundMan::setMusicFile(const char *filename) {
|
|
|
|
strcpy(_musicFile, filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-14 21:29:12 +00:00
|
|
|
} // namespace Parallaction
|