#pragma once
//-----------------------------------------------------
// Name, first name: Hoet, Guntran
// Group: 1DAE3
//-----------------------------------------------------

//-----------------------------------------------------
// Include Files
//-----------------------------------------------------
#include "GameEngine.h"
//-----------------------------------------------------
// Sound Class									
//-----------------------------------------------------
class Sound
{
private:
	Sound();				// Constructor
	static Sound* m_SoundPtr;

public:
	virtual ~Sound();		// Destructor
	static Sound* GetSingleton();

	//-------------------------------------------------
	// Methods - Member functions							
	//-------------------------------------------------

	void Tick(double deltaTime);
	//bool Play(String soundName);

	// 1.0 = overworld
	// 1.1 = overworld hurry mode
	// 1.2 = underground
	// 1.3 = underground hurry mode
	// 1.4 = castle complete
	// 1.5 = starman
	//
	// 2.0 = stop
	// 2.1 = play
	// 2.2 = pause
	//
	// 3   = set volume (standard = -1 -> dont change volume)
	void Theme(int track, int command = 1, int volume = -1);

	// 0 = TEST
	// 1 = jump
	// 2 = block bump
	// 3 = pipe / get hit
	// 4 = coin pickup
	// 5 = power up
	// 6 = starman
	// 7 = kill enemy
	// 8 = mario dead
	// 9 = game over
	// 10 = block break
	// 11 = fireball throw
	// 12 = flag
	void SFX(int track, int command = 1, int volume = 100);

	static const int COIN_TRACKS = 10;
	static const int JUMP_TRACKS = 7;
	static const int KILL_TRACKS = 5;
	static const int FIREBALL_THROW_TRACKS = 4;	//   spare ones to be sure
	static const int BLOCK_BREAK_TRACKS = 3;
	static const int BLOCK_BUMP_TRACKS = 5;

private: 
	//-------------------------------------------------
	// Datamembers								
	//-------------------------------------------------

	int m_CoinTrackCounter, m_JumpTrackCounter, m_KillTrackCounter,
		m_FireballThrowCounter, m_BlockBumpTrackCounter,m_BlockBreakTrackCounter;

	Audio	*m_OverworldPtr,
			*m_OverworldHurryPtr,
			*m_UndergroundPtr,
			*m_UndergroundHurryPtr,
			*m_TestPtr,
			*m_JumpPtrArr[JUMP_TRACKS],
			*m_BlockBumpPtrArr[BLOCK_BUMP_TRACKS],
			*m_PipePtr,
			*m_CoinPtrArr[COIN_TRACKS],
			*m_PowerUpPtr,
			*m_StarmanPtr,
			*m_KillEnemyPtrArr[KILL_TRACKS],
			*m_DeadPtr,
			*m_GameOverPtr,
			*m_BlockBreakPtrArr[BLOCK_BREAK_TRACKS],
			*m_FireballThrowPtrArr[FIREBALL_THROW_TRACKS],
			*m_FlagPtr,
			*m_CastleCompletePtr;


	// -------------------------
	// Disabling default copy constructor and default 
	// assignment operator.
	// -------------------------
	Sound(const Sound& yRef);									
	Sound& operator=(const Sound& yRef);	
};


