Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 8782 → Rev 8781

/source/audiolib/include/fx_man.h
82,11 → 82,7
extern int FX_ErrorCode;
extern int FX_MixRate;
 
static FORCE_INLINE int FX_SetErrorCode(int status)
{
FX_ErrorCode = status;
return FX_Error;
}
#define FX_SetErrorCode(status) FX_ErrorCode = (status);
 
static FORCE_INLINE int FX_CheckMVErr(int status)
{
/source/audiolib/src/fx_man.cpp
47,14 → 47,18
 
const char *FX_ErrorString(int const ErrorNumber)
{
const char *ErrorString;
 
switch (ErrorNumber)
{
case FX_Warning:
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.";
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;
}
 
return ErrorString;
}
 
static int osdcmd_cvar_set_audiolib(osdcmdptr_t parm)
140,7 → 144,7
 
MV_Printf("Initializing sound: ");
 
if ((unsigned)SoundCard >= ASS_NumSoundCards)
if (SoundCard < 0 || SoundCard >= ASS_NumSoundCards)
{
FX_SetErrorCode(FX_InvalidCard);
MV_Printf("failed! %s\n", FX_ErrorString(FX_InvalidCard));
192,9 → 196,11
return status;
}
 
int FX_GetDevice(void) { return ASS_PCMSoundDriver; }
int FX_GetDevice()
{
return ASS_PCMSoundDriver;
}
 
 
static wavefmt_t FX_DetectFormat(char const * const ptr, uint32_t length)
{
if (length < 12)
/source/audiolib/src/music.cpp
35,16 → 35,20
 
#define MUSIC_SetErrorCode(status) MUSIC_ErrorCode = (status);
 
const char *MUSIC_ErrorString(int const ErrorNumber)
const char *MUSIC_ErrorString(int ErrorNumber)
{
const char *ErrorString;
 
switch (ErrorNumber)
{
case MUSIC_Warning:
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.";
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;
}
 
return ErrorString;
}
 
 
104,16 → 108,19
int MUSIC_Shutdown(void)
{
MIDI_StopSong();
 
return MUSIC_Ok;
}
 
 
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(); }
void MUSIC_SetVolume(int volume) { MIDI_SetVolume(min(max(0, volume), 255)); }
 
 
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();
139,4 → 146,6
}
 
 
void MUSIC_Update(void) {}
void MUSIC_Update(void)
{
}