106 lines
1.9 KiB
C
106 lines
1.9 KiB
C
/*
|
|
Copyright (C) 2015 Marco "eukara" Hladik
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; either version 2
|
|
of the License, or (at your option) any later version.
|
|
|
|
This program 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 General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
#include "globaldef.h"
|
|
|
|
/*
|
|
* Handle the different forms of music playback systems handled in the engine.
|
|
* Try to avoid using external libraries for convenience.
|
|
*/
|
|
|
|
void Music_Play(byte track, qboolean looping)
|
|
{
|
|
#ifdef DUMB
|
|
Tracker_Play (track, looping);
|
|
#elif XMMSCTL
|
|
XMMS_Play (track, looping);
|
|
#elif FMOD
|
|
FmodEx_Play(track, looping);
|
|
#endif
|
|
}
|
|
|
|
void Music_Stop(void)
|
|
{
|
|
#ifdef DUMB
|
|
Tracker_Stop();
|
|
#elif XMMSCTL
|
|
XMMS_Stop();
|
|
#elif FMOD
|
|
FmodEx_Stop();
|
|
#endif
|
|
|
|
}
|
|
|
|
void Music_Pause(void)
|
|
{
|
|
#ifdef DUMB
|
|
Tracker_Pause();
|
|
#elif XMMSCTL
|
|
XMMS_Pause();
|
|
#elif FMOD
|
|
FmodEx_Pause();
|
|
#endif
|
|
}
|
|
|
|
void Music_Resume(void)
|
|
{
|
|
#ifdef DUMB
|
|
Tracker_Resume();
|
|
#elif XMMSCTL
|
|
XMMS_Resume();
|
|
#elif FMOD
|
|
FmodEx_Resume();
|
|
#endif
|
|
}
|
|
|
|
void Music_Update(void)
|
|
{
|
|
#ifdef DUMB
|
|
Tracker_Update();
|
|
#elif XMMSCTL
|
|
XMMS_Update();
|
|
#elif FMOD
|
|
FmodEx_Update();
|
|
#endif
|
|
}
|
|
|
|
int Music_Init(void)
|
|
{
|
|
#ifdef DUMB
|
|
Tracker_Init();
|
|
#elif XMMSCTL
|
|
XMMS_Init();
|
|
#elif FMOD
|
|
FmodEx_Init();
|
|
#endif
|
|
return 1;
|
|
}
|
|
|
|
|
|
void Music_Shutdown(void)
|
|
{
|
|
#ifdef DUMB
|
|
Tracker_Shutdown();
|
|
#elif XMMSCTL
|
|
XMMS_Shutdown();
|
|
#elif FMOD
|
|
FmodEx_Shutdown();
|
|
#endif
|
|
}
|