///////////////////////////////////////////////////////////////////////////////
/// @file resfuncs.cpp
///
/// @brief Destiny Sound System Resource Manager hooks
///
/// @author paradoxnj
///
/// This file is the intellectual property of Novus Delta, LLC.. Usage of the
/// contents of this file is subject to the Destiny3D Member License which
/// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
///
/// This file is distributed "AS IS" without warranty of any kind.  Novus
/// Delta, LLC. does not guarantee the fitness of the contents of this file
/// for any particular purpose.
///
/// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
///
/// <hr>
///                                 Change History
/// <hr>
///
/// @date Jan 2002
/// @author paradoxnj
/// @remarks Creation
///
///////////////////////////////////////////////////////////////////////////////

//Resource Manager Functions
#include <windows.h>

#include "deSound.hpp"
#include "Channels.hpp"

#include "deOGG.hpp"
#include "deWAV.hpp"

#include "deFile.hpp"
#include "deResource.hpp"

IdeResourceBase *deSound_LoadOGG(const char *filename, IdeFile *file, deBoolean /*isThreaded*/)
{
	deOGG				*ogg;
#pragma todo(handle loading from file)

	ogg = new deOGG();
	if (!ogg)
		return NULL;

	if (!ogg->Initialize(filename))
	{
		DE3D_SAFE_DELETE(ogg);
		return NULL;
	}

	return (IdeResourceBase*)ogg;
}

IdeResourceBase *deSound_LoadWAV(const char *filename, IdeFile *file, deBoolean /*isThreaded*/)
{
	deWAV				*wav;
#pragma todo(handle loading from file)

	try
	{
		wav = new deWAV(filename);
	}
	catch(...)
	{
		return NULL;
	}
	if (!wav)
		return NULL;
/*
	if (!wav->Initialize(filename))
	{
		DE3D_SAFE_DELETE(wav);
		return NULL;
	}
*/
	return (IdeResourceBase*)wav;
}

