Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 8781 → Rev 8782

/source/audiolib/include/fx_man.h
82,7 → 82,11
extern int FX_ErrorCode;
extern int FX_MixRate;
 
#define FX_SetErrorCode(status) FX_ErrorCode = (status);
static FORCE_INLINE int FX_SetErrorCode(int status)
{
FX_ErrorCode = status;
return FX_Error;
}
 
static FORCE_INLINE int FX_CheckMVErr(int status)
{
/source/audiolib/src/fx_man.cpp
47,18 → 47,14
 
const char *FX_ErrorString(int const ErrorNumber)
{
const char *ErrorString;
 
switch (ErrorNumber)
{
case FX_Warning:
case FX_Error: ErrorString = FX_ErrorString(FX_ErrorCode); break;
case FX_Ok: ErrorString = "Fx ok."; break;
case FX_MultiVocError: ErrorString = MV_ErrorString(MV_Error); break;
default: ErrorString = "Unknown Fx error code."; break;
case FX_Error: return FX_ErrorString(FX_ErrorCode);
case FX_Ok: return "Fx ok.";
case FX_MultiVocError: return MV_ErrorString(MV_Error);
default: return "Unknown Fx error code.";
}
 
return ErrorString;
}
 
static int osdcmd_cvar_set_audiolib(osdcmdptr_t parm)
144,7 → 140,7
 
MV_Printf("Initializing sound: ");
 
if (SoundCard < 0 || SoundCard >= ASS_NumSoundCards)
if ((unsigned)SoundCard >= ASS_NumSoundCards)
{
FX_SetErrorCode(FX_InvalidCard);
MV_Printf("failed! %s\n", FX_ErrorString(FX_InvalidCard));
196,11 → 192,9
return status;
}
 
int FX_GetDevice()
{
return ASS_PCMSoundDriver;
}
int FX_GetDevice(void) { return ASS_PCMSoundDriver; }
 
 
static wavefmt_t FX_DetectFormat(char const * const ptr, uint32_t length)
{
if (length < 12)
/source/audiolib/src/music.cpp
35,20 → 35,16
 
#define MUSIC_SetErrorCode(status) MUSIC_ErrorCode = (status);
 
const char *MUSIC_ErrorString(int ErrorNumber)
const char *MUSIC_ErrorString(int const ErrorNumber)
{
const char *ErrorString;
 
switch (ErrorNumber)
{
case MUSIC_Warning:
case MUSIC_Error: ErrorString = MUSIC_ErrorString(MUSIC_ErrorCode); break;
case MUSIC_Ok: ErrorString = "Music ok."; break;
case MUSIC_MidiError: ErrorString = "Error playing MIDI file."; break;
default: ErrorString = "Unknown Music error code."; break;
case MUSIC_Error: return MUSIC_ErrorString(MUSIC_ErrorCode);
case MUSIC_Ok: return "Music ok.";
case MUSIC_MidiError: return "Error playing MIDI file.";
default: return "Unknown Music error code.";
}
 
return ErrorString;
}
 
 
108,19 → 104,16
int MUSIC_Shutdown(void)
{
MIDI_StopSong();
 
return MUSIC_Ok;
}
 
 
void MUSIC_SetVolume(int volume) { MIDI_SetVolume(min(max(0, volume), 255)); }
void MUSIC_SetVolume(int volume) { MIDI_SetVolume(clamp(volume, 0, 255)); }
int MUSIC_GetVolume(void) { return MIDI_GetVolume(); }
void MUSIC_SetLoopFlag(int loop) { MIDI_SetLoopFlag(loop); }
void MUSIC_Continue(void) { MIDI_ContinueSong(); }
void MUSIC_Pause(void) { MIDI_PauseSong(); }
 
 
int MUSIC_GetVolume(void) { return MIDI_GetVolume(); }
void MUSIC_SetLoopFlag(int loopflag) { MIDI_SetLoopFlag(loopflag); }
void MUSIC_Continue(void) { MIDI_ContinueSong(); }
void MUSIC_Pause(void) { MIDI_PauseSong(); }
 
int MUSIC_StopSong(void)
{
MIDI_StopSong();
146,6 → 139,4
}
 
 
void MUSIC_Update(void)
{
}
void MUSIC_Update(void) {}