//********************************************************************
// This source file is part of Ninfa3D Engine
// 
// Copyright (C) 2008-2009 Viz_fuerte.
// All rights reserved.
// 
// LIMITED WARRANTY
// This software is provided "as-is", without any express or implied warranty.
// In no event shall the author be held liable for any damages arising from the use of this software.
// This is a contract. By accepting the Ninfa3D Engine (the SOFTWARE), 
// you (either an individual or a single entity, the LICENSEE) accept the terms and conditions of this licensing agreement.
// 
// If the LICENSEE does not accept the terms and conditions, then LICENSEE must not accept the SOFTWARE.
// If at a later time the LICENSEE decides not to continue licensing the SOFTWARE under these terms and 
// conditions, then the LICENSEE must delete permanently all files constituting the SOFTWARE.
//
//
// LICENSE AGREEMENT
// Ninfa3D Engine Limited grants to the LICENSEE and the LICENSEE hereby accepts a perpetual 
// nontransferable and nonexclusive license to use and distribute the SOFTWARE, for any purpose. 
// In addition, the following conditions apply:
//
// 1) The LICENSEE may not use the SOFTWARE to reverse engineer the computer algorithm used by the SOFTWARE.
// 2) The origin of the SOFTWARE must not be misrepresented; If the LICENSEE uses the SOFTWARE to distribute 
//    a product, the LICENSEE must not claim that He or She wrote the original SOFTWARE.
// 3) The LICENSEE agrees to credit the use of the Ninfa3D Engine in any program information, 
//    including credit screens, "About" dialogs, program notes or instructions and shrink-wrapped packaging.
// 4) The LICENSEE may not redistribute the SOFTWARE, except as part of a compiled software program that is 
//    not itself a physics library.
// 5) The LICENSEE agrees to notify www.mysticrealitystudio.comuv.com of any products, commercial, shareware or free 
//    that incorporate the Ninfa3D Engine technology.
//
// File: Sound.cpp
//********************************************************************

/*--------------------------------------------------------------------
Includos*/

	#include "..\..\Header Files\Ninfa3D.h"
	#include "..\..\Codes\CSoundSceneNode.h"

/*--------------------------------------------------------------------
Variables externas*/

	extern ISceneManager* SceneManager;

/*--------------------------------------------------------------------
Declaracion global de funciones*/

extern "C"
{

	/*================================================================
	Carga el archivo de sonido*/

	DLL_EXPORT void* DLL_APIENTRY LoadSound(char* fileName)
	{
		CSoundSceneNode* sound = new CSoundSceneNode(0,SceneManager,-1);
		sound->addSound(fileName);
		return (void*)sound;
	};

	/*================================================================
	Carga el archivo de sonido*/

	DLL_EXPORT void DLL_APIENTRY SoundType(CSoundSceneNode* sound,int mode)
	{
		sound->setType(mode);
	}

	/*================================================================
	Volume el sonido --- added by nespa */

	DLL_EXPORT void DLL_APIENTRY VolumeSound(CSoundSceneNode* sound,float value)
	{
		sound->setVolume(value);
	};

	/*================================================================
	Pitch el sonido --- added by nespa */

	DLL_EXPORT void DLL_APIENTRY PitchSound(CSoundSceneNode* sound,float value)
	{
		sound->setPitch(value);
	};

	

	/*================================================================
	Reproduce el sonido*/

	DLL_EXPORT void DLL_APIENTRY PlaySound(CSoundSceneNode* sound)
	{
		sound->setPlay();
	};

	/*================================================================
	Para el sonido*/

	DLL_EXPORT void DLL_APIENTRY StopSound(CSoundSceneNode* sound)
	{
		sound->setStop();
	};

	/*================================================================
	Carga la fuente de letras*/

	DLL_EXPORT void DLL_APIENTRY LoopSound(CSoundSceneNode* sound)
	{
		sound->setLoop();
	};

	/*================================================================
	Carga el archivo de sonido*/

	DLL_EXPORT void DLL_APIENTRY PauseSound(CSoundSceneNode* sound)
	{
		sound->setPause();
	};

	/*================================================================
	Carga el archivo de sonido*/

	DLL_EXPORT void DLL_APIENTRY SoundReferenceDistance(CSoundSceneNode* sound,float Value)
	{
		sound->setReferenceDistance(Value);
	};

	/*================================================================
	Carga el archivo de sonido*/

	DLL_EXPORT void DLL_APIENTRY SoundRollOff(CSoundSceneNode* sound,float Value)
	{
		sound->setRollOff(Value);
	};

};