//
// Asura_Chunk_StreamingBackgroundSound.h
//
// Created by Richard Rice - 13/01/04
// 
// Copyright (C) 2004 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef __ASURA_CHUNK_STREAMINGBACKGROUNDSOUND_H__
#define __ASURA_CHUNK_STREAMINGBACKGROUNDSOUND_H__

#include "ChunkSystem/Asura_Chunk_Loaders.h"

class Asura_Chunk_Stream;
class Asura_SaveBlock_Base;


class Asura_Chunk_StreamingBackgroundSound : public Asura_Chunk_Header
{
public :
	bool Process(Asura_Handle iFileHandle) const;
	bool Process(Asura_Chunk_Stream& xStream) const;
	#ifdef ASURA_TOOLS
	//Loads a single streaming sound with the given saved ID, and returns the index of the created sound
	//(or -1 if it fails)
	int ImportFromChunkBuffer(const char* pcChunkBuffer, u_int uSavedID, u_int uNewID) const;

	static void Create(Asura_SaveBlock* pxSaveBlock);
	static void Create(Asura_Chunk_Stream& xSaveBlock);
	#endif



	int m_iNumberOfSounds;
	int m_uSBSFlags;
};


//Stores the ingame state of the soundss.
//Currently just the flags for the active/inactive status
class Asura_Chunk_StreamingBackgroundSound_InGame : public Asura_Chunk_Header
{
	public :
		bool Process(class Asura_Chunk_Stream& xStream) const;
		bool Process(const char* pcChunkBuffer) const;

		static void Create(Asura_Chunk_Stream& xStream);
		static void Create(Asura_SaveBlock_Base* pxSaveBlock);

	enum
	{
		CHUNK_VERSION = 0,
	};
};



#endif //__ASURA_CHUNK_STREAMINGBACKGROUNDSOUND_H__
