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.
|
2003-12-14 00:33:21 +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
|
2008-01-05 12:45:14 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2003-12-14 00:33:21 +00:00
|
|
|
* 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
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-12-14 00:33:21 +00:00
|
|
|
*
|
2006-02-11 10:07:12 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2003-12-14 00:33:21 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2007-11-15 20:21:33 +00:00
|
|
|
#include "common/config-manager.h"
|
2007-09-19 13:55:05 +00:00
|
|
|
#include "common/events.h"
|
2009-07-25 12:59:46 +00:00
|
|
|
#include "common/EventRecorder.h"
|
2007-09-19 08:40:12 +00:00
|
|
|
|
2003-12-14 00:33:21 +00:00
|
|
|
#include "queen/music.h"
|
|
|
|
#include "queen/queen.h"
|
|
|
|
#include "queen/resource.h"
|
2004-01-22 23:10:05 +00:00
|
|
|
#include "queen/sound.h"
|
2003-12-14 00:33:21 +00:00
|
|
|
|
|
|
|
#include "sound/midiparser.h"
|
|
|
|
|
|
|
|
namespace Queen {
|
|
|
|
|
2007-11-15 20:21:33 +00:00
|
|
|
extern MidiDriver *C_Player_CreateAdlibMidiDriver(Audio::Mixer *);
|
|
|
|
|
|
|
|
MidiMusic::MidiMusic(QueenEngine *vm)
|
|
|
|
: _isPlaying(false), _looping(false), _randomLoop(false), _masterVolume(192), _buf(0) {
|
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
memset(_channel, 0, sizeof(_channel));
|
2007-11-15 20:21:33 +00:00
|
|
|
_queuePos = _lastSong = _currentSong = 0;
|
2004-12-31 00:25:18 +00:00
|
|
|
queueClear();
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2009-12-09 18:12:51 +00:00
|
|
|
MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI);
|
2007-11-15 20:21:33 +00:00
|
|
|
_adlib = (midiDriver == MD_ADLIB);
|
|
|
|
_nativeMT32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32"));
|
|
|
|
|
|
|
|
const char *musicDataFile;
|
|
|
|
if (vm->resource()->isDemo()) {
|
|
|
|
_tune = Sound::_tuneDemo;
|
|
|
|
musicDataFile = "AQ8.RL";
|
|
|
|
} else {
|
|
|
|
_tune = Sound::_tune;
|
|
|
|
musicDataFile = "AQ.RL";
|
|
|
|
}
|
|
|
|
if (_adlib) {
|
|
|
|
musicDataFile = "AQBANK.MUS";
|
|
|
|
}
|
|
|
|
_musicData = vm->resource()->loadFile(musicDataFile, 0, &_musicDataSize);
|
2004-12-31 00:25:18 +00:00
|
|
|
_numSongs = READ_LE_UINT16(_musicData);
|
2007-03-16 22:34:59 +00:00
|
|
|
|
|
|
|
_tune = vm->resource()->isDemo() ? Sound::_tuneDemo : Sound::_tune;
|
2007-11-15 20:21:33 +00:00
|
|
|
|
|
|
|
if (_adlib) {
|
|
|
|
// int infoOffset = _numSongs * 4 + 2;
|
|
|
|
// if (READ_LE_UINT16(_musicData + 2) != infoOffset) {
|
|
|
|
// defaultAdlibVolume = _musicData[infoOffset];
|
|
|
|
// }
|
|
|
|
_driver = C_Player_CreateAdlibMidiDriver(vm->_mixer);
|
|
|
|
} else {
|
|
|
|
_driver = MidiDriver::createMidi(midiDriver);
|
|
|
|
if (_nativeMT32) {
|
|
|
|
_driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_driver->open();
|
2007-11-21 21:46:30 +00:00
|
|
|
_driver->setTimerCallback(this, &timerCallback);
|
2007-11-15 20:21:33 +00:00
|
|
|
|
|
|
|
_parser = MidiParser::createParser_SMF();
|
|
|
|
_parser->setMidiDriver(this);
|
|
|
|
_parser->setTimerRate(_driver->getBaseTempo());
|
|
|
|
|
2009-07-25 12:59:46 +00:00
|
|
|
g_eventRec.registerRandomSource(_rnd, "queenMusic");
|
2004-12-31 00:25:18 +00:00
|
|
|
}
|
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
MidiMusic::~MidiMusic() {
|
2007-11-15 20:21:33 +00:00
|
|
|
_driver->setTimerCallback(0, 0);
|
2007-12-26 00:22:32 +00:00
|
|
|
_parser->unloadMusic();
|
2007-11-15 20:21:33 +00:00
|
|
|
_driver->close();
|
2004-12-31 00:25:18 +00:00
|
|
|
delete _parser;
|
2008-01-18 17:23:10 +00:00
|
|
|
delete _driver;
|
2004-12-31 00:25:18 +00:00
|
|
|
delete[] _buf;
|
2007-03-08 22:15:20 +00:00
|
|
|
delete[] _musicData;
|
2004-12-31 00:25:18 +00:00
|
|
|
}
|
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
void MidiMusic::setVolume(int volume) {
|
2004-12-31 00:25:18 +00:00
|
|
|
if (volume < 0)
|
|
|
|
volume = 0;
|
|
|
|
else if (volume > 255)
|
|
|
|
volume = 255;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
if (_masterVolume == volume)
|
2007-02-21 20:27:48 +00:00
|
|
|
return;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
_masterVolume = volume;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
for (int i = 0; i < 16; ++i) {
|
|
|
|
if (_channel[i])
|
|
|
|
_channel[i]->volume(_channelVolume[i] * _masterVolume / 255);
|
2004-01-19 21:23:42 +00:00
|
|
|
}
|
2004-12-31 00:25:18 +00:00
|
|
|
}
|
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
void MidiMusic::playSong(uint16 songNum) {
|
|
|
|
queueClear();
|
|
|
|
queueSong(songNum);
|
|
|
|
playMusic();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MidiMusic::queueSong(uint16 songNum) {
|
2004-12-31 00:25:18 +00:00
|
|
|
if (songNum >= _numSongs && songNum < 1000) {
|
|
|
|
// this happens at the end of the car chase, where we try to play song 176,
|
|
|
|
// see Sound::_tune[], entry 39
|
2005-01-06 11:46:32 +00:00
|
|
|
debug(3, "Trying to queue an invalid song number %d, max %d", songNum, _numSongs);
|
2004-12-31 00:25:18 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
uint8 emptySlots = 0;
|
|
|
|
for (int i = 0; i < MUSIC_QUEUE_SIZE; i++)
|
|
|
|
if (!_songQueue[i])
|
|
|
|
emptySlots++;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
if (!emptySlots)
|
|
|
|
return false;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
// Work around bug in Roland music, note that these numbers are 'one-off'
|
|
|
|
// from the original code
|
2007-11-15 20:21:33 +00:00
|
|
|
if (!_adlib && (songNum == 88 || songNum == 89))
|
2004-12-31 00:25:18 +00:00
|
|
|
songNum = 62;
|
|
|
|
|
|
|
|
_songQueue[MUSIC_QUEUE_SIZE - emptySlots] = songNum;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
void MidiMusic::queueClear() {
|
2004-12-31 00:25:18 +00:00
|
|
|
_lastSong = _songQueue[0];
|
|
|
|
_queuePos = 0;
|
|
|
|
_looping = _randomLoop = false;
|
|
|
|
memset(_songQueue, 0, sizeof(_songQueue));
|
|
|
|
}
|
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
void MidiMusic::send(uint32 b) {
|
2007-11-15 20:21:33 +00:00
|
|
|
if (_adlib) {
|
2004-12-31 00:25:18 +00:00
|
|
|
_driver->send(b);
|
|
|
|
return;
|
2004-01-19 21:23:42 +00:00
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
byte channel = (byte)(b & 0x0F);
|
|
|
|
if ((b & 0xFFF0) == 0x07B0) {
|
|
|
|
// Adjust volume changes by master volume
|
|
|
|
byte volume = (byte)((b >> 16) & 0x7F);
|
|
|
|
_channelVolume[channel] = volume;
|
|
|
|
volume = volume * _masterVolume / 255;
|
|
|
|
b = (b & 0xFF00FFFF) | (volume << 16);
|
2007-11-21 21:46:30 +00:00
|
|
|
} else if ((b & 0xF0) == 0xC0 && !_nativeMT32) {
|
2005-04-03 22:01:38 +00:00
|
|
|
b = (b & 0xFFFF00FF) | MidiDriver::_mt32ToGm[(b >> 8) & 0xFF] << 8;
|
2007-11-15 20:21:33 +00:00
|
|
|
} else if ((b & 0xFFF0) == 0x007BB0) {
|
2004-12-31 00:25:18 +00:00
|
|
|
//Only respond to All Notes Off if this channel
|
|
|
|
//has currently been allocated
|
2007-11-15 20:21:33 +00:00
|
|
|
if (_channel[channel])
|
2004-10-22 23:44:08 +00:00
|
|
|
return;
|
2004-01-19 21:23:42 +00:00
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
//Work around annoying loud notes in certain Roland Floda tunes
|
|
|
|
if (channel == 3 && _currentSong == 90)
|
|
|
|
return;
|
|
|
|
if (channel == 4 && _currentSong == 27)
|
|
|
|
return;
|
|
|
|
if (channel == 5 && _currentSong == 38)
|
|
|
|
return;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
if (!_channel[channel])
|
|
|
|
_channel[channel] = (channel == 9) ? _driver->getPercussionChannel() : _driver->allocateChannel();
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
if (_channel[channel])
|
|
|
|
_channel[channel]->send(b);
|
|
|
|
}
|
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
void MidiMusic::metaEvent(byte type, byte *data, uint16 length) {
|
2007-11-15 20:21:33 +00:00
|
|
|
switch (type) {
|
|
|
|
case 0x2F: // End of Track
|
|
|
|
if (_looping || _songQueue[1]) {
|
|
|
|
playMusic();
|
|
|
|
} else {
|
|
|
|
stopMusic();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 0x7F: // Specific
|
|
|
|
if (_adlib) {
|
|
|
|
_driver->metaEvent(type, data, length);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
// warning("Unhandled meta event: %02x", type);
|
|
|
|
break;
|
|
|
|
}
|
2004-12-31 00:25:18 +00:00
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2007-11-21 21:46:30 +00:00
|
|
|
void MidiMusic::onTimer() {
|
|
|
|
_mutex.lock();
|
|
|
|
if (_isPlaying)
|
|
|
|
_parser->onTimer();
|
|
|
|
_mutex.unlock();
|
2004-12-31 00:25:18 +00:00
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
void MidiMusic::queueTuneList(int16 tuneList) {
|
2004-12-31 00:25:18 +00:00
|
|
|
queueClear();
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
//Jungle is the only part of the game that uses multiple tunelists.
|
|
|
|
//For the sake of code simplification we just hardcode the extended list ourselves
|
|
|
|
if ((tuneList + 1) == 3) {
|
|
|
|
_randomLoop = true;
|
|
|
|
int i = 0;
|
|
|
|
while (Sound::_jungleList[i])
|
|
|
|
queueSong(Sound::_jungleList[i++] - 1);
|
|
|
|
return;
|
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2007-03-16 22:34:59 +00:00
|
|
|
int mode = _tune[tuneList].mode;
|
2004-12-31 00:25:18 +00:00
|
|
|
switch (mode) {
|
|
|
|
case 0: // random loop
|
|
|
|
_randomLoop = true;
|
|
|
|
setLoop(false);
|
|
|
|
break;
|
|
|
|
case 1: // sequential loop
|
|
|
|
setLoop(_songQueue[1] == 0);
|
2005-07-30 21:11:48 +00:00
|
|
|
break;
|
2004-12-31 00:25:18 +00:00
|
|
|
case 2: // play once
|
|
|
|
default:
|
|
|
|
setLoop(false);
|
|
|
|
break;
|
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
int i = 0;
|
2007-03-16 22:34:59 +00:00
|
|
|
while (_tune[tuneList].tuneNum[i])
|
|
|
|
queueSong(_tune[tuneList].tuneNum[i++] - 1);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
if (_randomLoop)
|
|
|
|
_queuePos = randomQueuePos();
|
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
void MidiMusic::playMusic() {
|
2004-12-31 00:25:18 +00:00
|
|
|
if (!_songQueue[0]) {
|
2007-03-08 22:15:20 +00:00
|
|
|
debug(5, "MidiMusic::playMusic - Music queue is empty");
|
2004-12-31 00:25:18 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint16 songNum = _songQueue[_queuePos];
|
2004-01-19 23:54:50 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
//Special type
|
|
|
|
// > 1000 && < 2000 -> queue different tunelist
|
|
|
|
// 2000 -> repeat music from previous queue
|
|
|
|
if (songNum > 999) {
|
|
|
|
if ((songNum + 1) == 2000) {
|
|
|
|
songNum = _lastSong;
|
|
|
|
queueClear();
|
|
|
|
queueSong(songNum);
|
|
|
|
} else {
|
|
|
|
queueTuneList(songNum - 1000);
|
|
|
|
_queuePos = _randomLoop ? randomQueuePos() : 0;
|
|
|
|
songNum = _songQueue[_queuePos];
|
2004-01-19 23:54:50 +00:00
|
|
|
}
|
2004-12-31 00:25:18 +00:00
|
|
|
}
|
2004-01-25 12:50:29 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
byte *prevSong = _musicData + songOffset(_currentSong);
|
2007-11-15 20:21:33 +00:00
|
|
|
if (*prevSong == 'C' || *prevSong == 'c') {
|
2004-12-31 00:25:18 +00:00
|
|
|
if (_buf) {
|
|
|
|
delete[] _buf;
|
|
|
|
_buf = 0;
|
2004-02-27 02:08:44 +00:00
|
|
|
}
|
2004-12-31 00:25:18 +00:00
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
_currentSong = songNum;
|
|
|
|
if (!songNum) {
|
|
|
|
stopMusic();
|
|
|
|
return;
|
|
|
|
}
|
2004-02-27 02:08:44 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
byte *musicPtr = _musicData + songOffset(songNum);
|
|
|
|
uint32 size = songLength(songNum);
|
2007-11-15 20:21:33 +00:00
|
|
|
if (*musicPtr == 'C' || *musicPtr == 'c') {
|
2004-12-31 00:25:18 +00:00
|
|
|
uint32 packedSize = songLength(songNum) - 0x200;
|
|
|
|
_buf = new uint16[packedSize];
|
2004-02-27 02:08:44 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
uint16 *data = (uint16 *)(musicPtr + 1);
|
|
|
|
byte *idx = ((byte *)data) + 0x200;
|
2004-02-27 02:08:44 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
for (uint i = 0; i < packedSize; i++)
|
2004-03-28 21:44:41 +00:00
|
|
|
#if defined(SCUMM_NEED_ALIGNMENT)
|
2005-01-10 20:49:35 +00:00
|
|
|
memcpy(&_buf[i], (byte*)((byte*)data + *(idx + i) * sizeof(uint16)), sizeof(uint16));
|
2004-03-28 21:44:41 +00:00
|
|
|
#else
|
2004-12-31 00:25:18 +00:00
|
|
|
_buf[i] = data[*(idx + i)];
|
2004-03-28 21:44:41 +00:00
|
|
|
#endif
|
2004-02-27 02:08:44 +00:00
|
|
|
|
2007-11-15 20:21:33 +00:00
|
|
|
musicPtr = ((byte *)_buf) + ((*musicPtr == 'c') ? 1 : 0);
|
2004-12-31 00:25:18 +00:00
|
|
|
size = packedSize * 2;
|
2003-12-14 00:33:21 +00:00
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2007-11-21 21:46:30 +00:00
|
|
|
_mutex.lock();
|
2004-12-31 00:25:18 +00:00
|
|
|
_parser->loadMusic(musicPtr, size);
|
2005-07-30 21:11:48 +00:00
|
|
|
_parser->setTrack(0);
|
2004-12-31 00:25:18 +00:00
|
|
|
_isPlaying = true;
|
2007-11-21 21:46:30 +00:00
|
|
|
_mutex.unlock();
|
|
|
|
|
|
|
|
debug(8, "Playing song %d [queue position: %d]", songNum, _queuePos);
|
2004-12-31 00:25:18 +00:00
|
|
|
queueUpdatePos();
|
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
void MidiMusic::queueUpdatePos() {
|
2004-12-31 00:25:18 +00:00
|
|
|
if (_randomLoop) {
|
|
|
|
_queuePos = randomQueuePos();
|
|
|
|
} else {
|
|
|
|
if (_queuePos < (MUSIC_QUEUE_SIZE - 1) && _songQueue[_queuePos + 1])
|
|
|
|
_queuePos++;
|
|
|
|
else if (_looping)
|
|
|
|
_queuePos = 0;
|
2004-01-22 23:10:05 +00:00
|
|
|
}
|
2004-12-31 00:25:18 +00:00
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
uint8 MidiMusic::randomQueuePos() {
|
2004-12-31 00:25:18 +00:00
|
|
|
int queueSize = 0;
|
|
|
|
for (int i = 0; i < MUSIC_QUEUE_SIZE; i++)
|
|
|
|
if (_songQueue[i])
|
|
|
|
queueSize++;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
if (!queueSize)
|
|
|
|
return 0;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
return (uint8) _rnd.getRandomNumber(queueSize - 1) & 0xFF;
|
|
|
|
}
|
2003-12-28 03:31:05 +00:00
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
void MidiMusic::stopMusic() {
|
2007-11-21 21:46:30 +00:00
|
|
|
_mutex.lock();
|
2004-12-31 00:25:18 +00:00
|
|
|
_isPlaying = false;
|
|
|
|
_parser->unloadMusic();
|
2007-11-21 21:46:30 +00:00
|
|
|
_mutex.unlock();
|
2004-12-31 00:25:18 +00:00
|
|
|
}
|
2003-12-14 00:33:21 +00:00
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
uint32 MidiMusic::songOffset(uint16 songNum) const {
|
2004-12-31 00:25:18 +00:00
|
|
|
uint16 offsLo = READ_LE_UINT16(_musicData + (songNum * 4) + 2);
|
|
|
|
uint16 offsHi = READ_LE_UINT16(_musicData + (songNum * 4) + 4);
|
|
|
|
return (offsHi << 4) | offsLo;
|
|
|
|
}
|
2004-01-19 21:23:42 +00:00
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
uint32 MidiMusic::songLength(uint16 songNum) const {
|
2004-12-31 00:25:18 +00:00
|
|
|
if (songNum < _numSongs)
|
|
|
|
return (songOffset(songNum + 1) - songOffset(songNum));
|
|
|
|
return (_musicDataSize - songOffset(songNum));
|
|
|
|
}
|
2004-01-19 21:23:42 +00:00
|
|
|
|
2007-03-08 22:15:20 +00:00
|
|
|
void MidiMusic::toggleVChange() {
|
|
|
|
setVolume(_vToggle ? (getVolume() * 2) : (getVolume() / 2));
|
|
|
|
_vToggle = !_vToggle;
|
2004-12-31 00:25:18 +00:00
|
|
|
}
|
2004-03-09 01:48:12 +00:00
|
|
|
|
2003-12-14 00:33:21 +00:00
|
|
|
} // End of namespace Queen
|