raze-gles/source/audiolib/include/music.h
terminx d6e52ed526 Use SDL audiolib driver on Windows
This shitcans the SDL_mixer requirement but leaves platforms other than Windows without built-in MIDI playback capability until Nuke.YKT's OPL3 emulator is merged. This also reworks sdlmusic.cpp into music_external.cpp, including an untested port of the code to Windows.

git-svn-id: https://svn.eduke32.com/eduke32@8214 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	GNUmakefile
#	platform/Windows/eduke32.vcxproj
#	platform/Windows/props/build_common.props
#	source/audiolib/src/sdlmusic.cpp

# Conflicts:
#	Common.mak
#	GNUmakefile
#	platform/Windows/audiolib.vcxproj
#	platform/Windows/eduke32.vcxproj
#	platform/Windows/eduke32.vcxproj.filters
#	platform/Windows/props/build_common.props
#	source/audiolib/src/driver_sdl.cpp
#	source/audiolib/src/sdlmusic.cpp
#	source/build/include/vfs.h
#	source/build/include/winbits.h
#	source/build/src/winbits.cpp
2019-10-24 19:22:06 +02:00

87 lines
2.3 KiB
C

/*
Copyright (C) 1994-1995 Apogee Software, Ltd.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
*/
/**********************************************************************
module: MUSIC.H
author: James R. Dose
date: March 25, 1994
Public header for MUSIC.C
(c) Copyright 1994 James R. Dose. All Rights Reserved.
**********************************************************************/
#ifndef __MUSIC_H
#define __MUSIC_H
#include "compat.h"
extern int32_t MUSIC_ErrorCode;
enum MUSIC_ERRORS
{
MUSIC_Error = -1,
MUSIC_Ok = 0,
MUSIC_FileError,
};
typedef struct
{
uint32_t tickposition;
uint32_t milliseconds;
uint32_t measure;
uint32_t beat;
uint32_t tick;
} songposition;
#define MUSIC_LoopSong ( 1 == 1 )
#define MUSIC_PlayOnce ( !MUSIC_LoopSong )
#define MUSIC_SetErrorCode(status) MUSIC_ErrorCode = (status);
extern char const *errorMessage;
static inline const char *MUSIC_ErrorString(int32_t ErrorNumber)
{
switch (ErrorNumber)
{
case MUSIC_Error: return errorMessage;
case MUSIC_Ok: return "Music ok.";
case MUSIC_FileError: return "Error playing file.";
default: return "Unknown error.";
}
return NULL;
}
int32_t MUSIC_Init(int32_t SoundCard, int32_t Address);
int32_t MUSIC_Shutdown(void);
void MUSIC_SetVolume(int32_t volume);
int32_t MUSIC_GetVolume(void);
void MUSIC_SetLoopFlag(int32_t loopflag);
void MUSIC_Continue(void);
void MUSIC_Pause(void);
int32_t MUSIC_StopSong(void);
int32_t MUSIC_PlaySong(char *song, int32_t songsize, int32_t loopflag, const char *fn = nullptr);
void MUSIC_Update(void);
#endif