/* Resource manager is going to hold a list of soundeffects for each item and the state that item is in. 
 * ie. A shotgun is reloading, so the shotgun is the item, and the state (reloading) has a list of different reloading sounds
 * this is so we don't have annoying repeats. 
 *
 * The sound engine is going to handle global events that are passed from these objects which will contain their entity ID
 * and event specific information, such as event location and in special cases the type of item that is triggering the event
 * such as my shotgun has fired so I will have my audio engine look through a list of shotgun firing sound effects to play,
 * Once the engine knows what sound to play, it will look for the next available source, load the buffer onto that source and play.
 * Every frame the engine is responsible for checking every source and pull off buffers that are no longer in use
 */

#ifndef _H_SOUNDEFFECT_H
#define _H_SOUNDEFFECT_H

#define STB_VORBIS_HEADER_ONLY
#include "thirdparty/stb_vorbis.c"

#include "utility/logger.h"
#include "util.h"

#include <AL/al.h>
#include <string>

class SoundEffect
{
public:
	SoundEffect(const std::string& filename);

	ALuint getBuffer() const { return buffer; }
	bool isValid() const { return valid; }

	~SoundEffect();
private:
	bool loadFile(const std::string &filename);

	ALuint buffer;
	bool valid;
};

#endif // _H_SOUNDEFFECT_H
