//
// Asura_Chunk_Phonons.h
//
// Created by Kevin Lea - 12/06/2001 11:20:06
// 
// Copyright (C) 2001 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef __ASURA_CHUNK_PHONONS_H__
#define __ASURA_CHUNK_PHONONS_H__

#include "ChunkSystem/Asura_Chunk_Loaders.h"
#include "Sound/Asura_Sound.h"
#ifdef ASURA_TOOLS
#include "Network/Asura_Guid.h"
#endif

class Asura_NameTree;
class Asura_SaveBlock;

#ifndef ASURA_USE_AUDIO_SYSTEM

class Asura_Phonon;

class Asura_Chunk_Phonons : public Asura_Chunk_Header
{
	public:
		bool Process(Asura_Handle fileHandle) const;
#ifdef ASURA_TOOLS
		//extract a single phonon from the chunk , assigning it the new guid
		Asura_Phonon* ProcessSinglePhonon(const char* pcChunkBuffer,Asura_Guid uOldGuid,Asura_Guid uNewGuid,bool bMissionFile) const;

		static void Create(Asura_SaveBlock& saveBlock);
#endif

		int NumberOfPhonons;


		enum ChunkFlags
		{
			ChunkFlag_HasNames  = 0x00000001,
		};

};

#ifdef ASURA_TOOLS
class Asura_Chunk_Phonon_TemplateGuids : public Asura_Chunk_Header
{
	public:
		bool Process(Asura_Handle iFileHandle) const;
		static void Create(Asura_SaveBlock& xSaveBlock);

		int m_iNumberOfPhonons;
};
#endif	// ASURA_TOOLS

#ifdef ASURA_TOOLS
// (MH - 29.05.2002) this chunk is a series of int, string pairs where the int is
// a sound ID and the string is the filename.
class Asura_Chunk_SoundNames : public Asura_Chunk_Header
{
public:
	bool Process(Asura_Handle fileHandle) const;
	static void Create(const Asura_NameTree* nameTree,Asura_Sound_ID eMinID, Asura_Sound_ID eMaxID, Asura_SaveBlock* saveBlock);

	//Gets the filename of a sound in the chunk from the ID
	const char* GetFilename(const char* pcChunkBuffer,int iSoundID) const;

	int NumberOfSounds;
};
#endif // #ifdef ASURA_TOOLS

#endif // ifndef ASURA_USE_AUDIO_SYSTEM

#endif//__ASURA_CHUNK_PHONONS_H__

//eof
