#ifndef SOUND_SYSTEM_H
#define SOUND_SYSTEM_H
#pragma once

class ISound
{
public:
	virtual			~ISound		() { }

	virtual void	play		() = 0;
	virtual void	Stop		() = 0;
	virtual void	Pause		() = 0;

	virtual bool	isPlaying	() const		= 0;
	virtual bool	isPaused	() const		= 0;

	virtual bool	IsLooped	() const		= 0;
	virtual void	SetLooped	(bool bLooped)	= 0;

	virtual float	GetVolume		() const		= 0;
	virtual void	SetVolume	(float fVolume) = 0;

	virtual void	OnFrame		(float delta)	= 0;
};

typedef unsigned int SoundDeviceID;

class ISoundSystem
{
public:
	virtual					~ISoundSystem	() { }

	virtual void			selectDevice	(SoundDeviceID deviceId)	= 0;
	virtual SoundDeviceID	selectedDevice	() const					= 0;

	virtual ISound*			CreateSound		(const char* sSoundFile)	= 0;
	virtual void			DestroySound	(ISound*& pSound)			= 0;

	virtual void			Update			(float delta)				= 0;

	virtual void			StopAllSounds	()							= 0;
	virtual void			PauseAllSounds	()							= 0;
	virtual	void			ReleaseAllSounds()							= 0;

	virtual float			GetMasterVolume	() const					= 0;
	virtual void			SetMasterVolume	(float fVolume)				= 0;
};

ISoundSystem* CreateSoundSystem_DirectSound(void* wndHandle);

extern ISoundSystem* g_soundSystem;

#endif
