2009-04-01 11:03:06 +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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CRUISE_SOUND_H
|
|
|
|
#define CRUISE_SOUND_H
|
|
|
|
|
2009-06-23 01:01:16 +00:00
|
|
|
#include "common/config-manager.h"
|
2009-04-01 11:03:06 +00:00
|
|
|
#include "common/serializer.h"
|
|
|
|
|
|
|
|
namespace Cruise {
|
|
|
|
|
2009-06-14 03:39:30 +00:00
|
|
|
class CruiseEngine;
|
|
|
|
class PCSoundDriver;
|
|
|
|
class PCSoundFxPlayer;
|
2009-04-01 11:03:06 +00:00
|
|
|
|
2009-06-14 03:39:30 +00:00
|
|
|
class PCSound {
|
|
|
|
private:
|
|
|
|
Audio::Mixer *_mixer;
|
|
|
|
CruiseEngine *_vm;
|
2009-06-22 06:17:50 +00:00
|
|
|
int _genVolume;
|
2009-06-14 03:39:30 +00:00
|
|
|
protected:
|
|
|
|
PCSoundDriver *_soundDriver;
|
|
|
|
PCSoundFxPlayer *_player;
|
2009-04-01 11:03:06 +00:00
|
|
|
public:
|
2009-06-14 03:39:30 +00:00
|
|
|
PCSound(Audio::Mixer *mixer, CruiseEngine *vm);
|
|
|
|
virtual ~PCSound();
|
|
|
|
|
|
|
|
virtual void loadMusic(const char *name);
|
|
|
|
virtual void playMusic();
|
|
|
|
virtual void stopMusic();
|
|
|
|
virtual void removeMusic();
|
|
|
|
virtual void fadeOutMusic();
|
|
|
|
|
2009-06-23 01:01:16 +00:00
|
|
|
virtual void playSound(const uint8 *data, int size, int volume);
|
2009-06-14 03:39:30 +00:00
|
|
|
virtual void stopSound(int channel);
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-04-01 11:03:06 +00:00
|
|
|
void doSync(Common::Serializer &s);
|
2009-06-20 08:15:01 +00:00
|
|
|
const char *musicName();
|
2009-06-14 03:39:30 +00:00
|
|
|
void stopChannel(int channel);
|
|
|
|
bool isPlaying() const;
|
|
|
|
bool songLoaded() const;
|
|
|
|
bool songPlayed() const;
|
2009-04-01 11:03:06 +00:00
|
|
|
void fadeSong();
|
2009-06-14 03:39:30 +00:00
|
|
|
uint8 numOrders() const;
|
|
|
|
void setNumOrders(uint8 v);
|
|
|
|
void setPattern(int offset, uint8 value);
|
|
|
|
bool musicLooping() const;
|
|
|
|
void musicLoop(bool v);
|
2009-06-21 11:53:11 +00:00
|
|
|
void startNote(int channel, int volume, int freq);
|
2009-06-30 10:36:50 +00:00
|
|
|
void syncSounds();
|
2009-06-22 06:17:50 +00:00
|
|
|
|
|
|
|
// Note: Volume variable accessed by these methods is never actually used in original game
|
|
|
|
void setVolume(int volume) { _genVolume = volume; }
|
|
|
|
uint8 getVolume() const { return _genVolume; }
|
2009-04-05 07:51:31 +00:00
|
|
|
};
|
|
|
|
|
2009-04-01 11:03:06 +00:00
|
|
|
} // End of namespace Cruise
|
|
|
|
|
|
|
|
#endif
|