/*  $Id: soundprovider_mikmod.cpp,v 1.2 2003/07/20 22:22:17 grumbel Exp $
**
**  ClanLib Game SDK
**  Copyright (C) 2003  The ClanLib Team
**  For a total list of contributers see the file CREDITS.
**
**  This library is free software; you can redistribute it and/or
**  modify it under the terms of the GNU Lesser General Public
**  License as published by the Free Software Foundation; either
**  version 2.1 of the License, or (at your option) any later version.
**
**  This library is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
**  Lesser General Public License for more details.
**
**  You should have received a copy of the GNU Lesser General Public
**  License along with this library; if not, write to the Free Software
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
**
*/

#include "Sound/precomp.h"
#include "API/MikMod/soundprovider_mikmod.h"
#include "API/Core/IOData/inputsource_provider.h"
#include "API/Core/System/clanstring.h"
#include "soundprovider_mikmod_generic.h"
#include "soundprovider_mikmod_session.h"

/////////////////////////////////////////////////////////////////////////////
// CL_SoundProvider_MikMod construction:

CL_SoundProvider_MikMod::CL_SoundProvider_MikMod(
	const std::string &filename,
	CL_InputSourceProvider *provider,
	bool stream) : impl(new CL_SoundProvider_MikMod_Generic)
{
	if (provider == 0) provider = CL_InputSourceProvider::create_file_provider(".");
	else provider = provider->clone();

	impl->provider = provider;
	impl->filename = filename;
	impl->stream = stream;
}

CL_SoundProvider_MikMod::~CL_SoundProvider_MikMod()
{
	delete impl->provider;
	delete impl;
}

/////////////////////////////////////////////////////////////////////////////
// CL_SoundProvider_MikMod operations:

CL_SoundProvider_Session *CL_SoundProvider_MikMod::begin_session()
{
	return new CL_SoundProvider_MikMod_Session(impl);
}

void CL_SoundProvider_MikMod::end_session(CL_SoundProvider_Session *session)
{
	delete session;
}

/////////////////////////////////////////////////////////////////////////////
// CL_SoundProvider_MikMod implementation:
