1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00
vcmi/hch/CMusicHandler.h
Michał W. Urbańczyk df25dd7efb Sound patches from Ubuntux #7 - #10:
* Some sound code cleanups
* Renamed soundBase::soundNames into soundBase::soundID
* Add a music handler destructor
* Add Archdevil and vampire pre and post movement sounds

I've applied minor change to fix CMusicHandler - GeniusAI conflict: moved sounds bimap to the .cpp file.

(vcmi_sounds_cleanup.diff
vcmi_sounds_cleanup2.diff
vcmi_sounds_cleanup3.diff
vcmi_add_sounds.diff)
2009-04-30 10:53:06 +00:00

49 lines
1.1 KiB
C++

#ifndef __CMUSICHANDLER_H__
#define __CMUSICHANDLER_H__
#include "CSoundBase.h"
/*
* CMusicHandler.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
struct Mix_Chunk;
class CSndHandler;
class CMusicHandler
{
private:
CSndHandler *sndh;
soundBase::soundID getSoundID(std::string &fileName);
std::map<soundBase::soundID, Mix_Chunk *> soundChunks;
Mix_Chunk *GetSoundChunk(soundBase::soundID soundID);
bool audioInit;
public:
CMusicHandler(): sndh(NULL), audioInit(false) {};
~CMusicHandler();
void initMusics();
void initCreaturesSounds(std::vector<CCreature> &creatures);
// Sounds
int playSound(soundBase::soundID soundID, int repeats=0);
int playSoundFromSet(std::vector<soundBase::soundID> &sound_vec);
void stopSound(int handler);
// Sets
std::vector<soundBase::soundID> pickup_sounds;
std::vector<soundBase::soundID> horseSounds;
};
#endif // __CMUSICHANDLER_H__