Consolidate I_SetDigMusicVolume and I_SetMIDIMusicVolume other targets

(cherry picked from commit 9fb9386f84b3739fe765a78bcb9683eb7e98bc36)
This commit is contained in:
mazmazz 2018-08-23 11:54:58 -04:00
parent a7ed7b2c90
commit e58a8f4fe1
5 changed files with 14 additions and 41 deletions

View file

@ -92,7 +92,7 @@ boolean I_LoadSong(char *data, size_t len)
return -1; return -1;
} }
void I_SetMIDIMusicVolume(INT32 volume) void I_SetMusicVolume(INT32 volume)
{ {
(void)volume; (void)volume;
} }
@ -120,11 +120,6 @@ void I_UnloadSong(void)
UINT8 digmusic_started = 0; UINT8 digmusic_started = 0;
void I_SetDigMusicVolume(INT32 volume)
{
(void)volume;
}
boolean I_SetSongSpeed(float speed) boolean I_SetSongSpeed(float speed)
{ {
(void)speed; (void)speed;

View file

@ -140,7 +140,7 @@ void I_SetSfxVolume(INT32 volume)
set_volume (Volset(volume),-1); set_volume (Volset(volume),-1);
} }
void I_SetMIDIMusicVolume(INT32 volume) void I_SetMusicVolume(INT32 volume)
{ {
if (nomidimusic) if (nomidimusic)
return; return;
@ -503,16 +503,6 @@ boolean I_LoadSong(char *data, size_t len)
return 1; return 1;
} }
void I_SetDigMusicVolume(INT32 volume)
{
volume = 0;
if (nodigimusic)
return;
// Now set volume on output device.
// CONS_Printf("Digital music not yet supported under DOS.\n");
}
boolean I_SetSongSpeed(float speed) boolean I_SetSongSpeed(float speed)
{ {
(void)speed; (void)speed;

View file

@ -70,7 +70,7 @@ void I_InitMusic(void){}
void I_ShutdownMusic(void){} void I_ShutdownMusic(void){}
void I_SetMIDIMusicVolume(UINT8 volume) void I_SetMusicVolume(UINT8 volume)
{ {
(void)volume; (void)volume;
} }
@ -117,11 +117,6 @@ void I_UnloadSong(void)
// DIGMUSIC I/O // DIGMUSIC I/O
// //
void I_SetDigMusicVolume(UINT8 volume)
{
(void)volume;
}
boolean I_SetSongSpeed(float speed) boolean I_SetSongSpeed(float speed)
{ {
(void)speed; (void)speed;

View file

@ -1702,7 +1702,7 @@ boolean I_LoadSong(char *data, size_t len)
return false; return false;
} }
void I_SetMIDIMusicVolume(UINT8 volume) void I_SetMusicVolume(UINT8 volume)
{ {
#ifdef HAVE_MIXER #ifdef HAVE_MIXER
if ((nomidimusic && nodigimusic) || !musicStarted) if ((nomidimusic && nodigimusic) || !musicStarted)
@ -1951,11 +1951,6 @@ static void I_StopGME(void)
#endif #endif
} }
void I_SetDigMusicVolume(UINT8 volume)
{
I_SetMIDIMusicVolume(volume);
}
boolean I_SetSongSpeed(float speed) boolean I_SetSongSpeed(float speed)
{ {

View file

@ -713,14 +713,6 @@ boolean I_LoadSong(char *data, size_t len)
return true; return true;
} }
void I_SetDigMusicVolume(UINT8 volume)
{
// volume is 0 to 31.
music_volume = volume;
if (I_GetMusicType() != MU_MID && music_stream)
FMR_MUSIC(FMOD_Channel_SetVolume(music_channel, volume / 31.0));
}
boolean I_SetSongSpeed(float speed) boolean I_SetSongSpeed(float speed)
{ {
FMOD_RESULT e; FMOD_RESULT e;
@ -803,12 +795,18 @@ boolean I_SetSongTrack(INT32 track)
// Fuck MIDI. ... Okay fine, you can have your silly D_-only mode. // Fuck MIDI. ... Okay fine, you can have your silly D_-only mode.
// //
void I_SetMIDIMusicVolume(UINT8 volume) void I_SetMusicVolume(UINT8 volume)
{ {
if (!music_stream)
return;
// volume is 0 to 31. // volume is 0 to 31.
midi_volume = volume; if (I_GetMusicType() == MU_MID)
if (I_GetMusicType() != MU_MID && music_stream) music_volume = 31; // windows bug hack
FMR_MUSIC(FMOD_Channel_SetVolume(music_channel, volume / 31.0)); else
music_volume = volume;
FMR_MUSIC(FMOD_Channel_SetVolume(music_channel, music_volume / 31.0));
} }
boolean I_PlaySong(boolean looping) boolean I_PlaySong(boolean looping)