I_MusicPlaying, I_MusicPaused other targets

(cherry picked from commit d5ec388159)
This commit is contained in:
mazmazz 2018-08-23 12:31:01 -04:00
parent 011a043dba
commit 44557d9c9d
5 changed files with 58 additions and 2 deletions

View file

@ -65,6 +65,16 @@ musictype_t I_GetMusicType(void)
return MU_NONE;
}
boolean I_MusicPlaying(void)
{
return false;
}
boolean I_MusicPaused(void)
{
return false;
}
void I_InitMusic(void){}
void I_ShutdownMusic(void){}

View file

@ -321,6 +321,7 @@ static MIDI* currsong; //im assuming only 1 song will be played at once
static int islooping=0;
static int musicdies=-1;
UINT8 music_started=0;
boolean songpaused=false;
musictype_t I_GetMusicType(void)
{
@ -330,6 +331,16 @@ musictype_t I_GetMusicType(void)
return MU_NONE;
}
boolean I_MusicPlaying()
{
return (boolean)currsong;
}
boolean I_MusicPaused()
{
return songpaused;
}
/* load_midi_mem:
* Loads a standard MIDI file from memory, returning a pointer to
* a MIDI structure, * or NULL on error.
@ -403,6 +414,7 @@ void I_InitMusic(void)
I_AddExitFunc(I_ShutdownMusic);
music_started = true;
songpaused = false;
}
void I_ShutdownMusic(void)
@ -433,8 +445,8 @@ void I_PauseSong (INT32 handle)
handle = 0;
if (nomidimusic)
return;
midi_pause();
songpaused = true;
}
void I_ResumeSong (INT32 handle)
@ -442,8 +454,8 @@ void I_ResumeSong (INT32 handle)
handle = 0;
if (nomidimusic)
return;
midi_resume();
songpaused = false;
}
void I_StopSong(void)
@ -455,6 +467,7 @@ void I_StopSong(void)
islooping = 0;
musicdies = 0;
stop_midi();
songpaused = false;
}
// Is the song playing?

View file

@ -66,6 +66,16 @@ musictype_t I_GetMusicType(void)
return MU_NONE;
}
boolean I_MusicPlaying(void)
{
return false;
}
boolean I_MusicPaused(void)
{
return false;
}
void I_InitMusic(void){}
void I_ShutdownMusic(void){}

View file

@ -1336,6 +1336,16 @@ musictype_t I_GetMusicType(void)
#endif
}
boolean I_MusicPlaying(void)
{
return music_started;
}
boolean I_MusicPaused(void)
{
return Mix_PausedMusic();
}
#ifdef HAVE_LIBGME
static void I_ShutdownGMEMusic(void)
{

View file

@ -478,6 +478,19 @@ musictype_t I_GetMusicType(void)
return MU_NONE;
}
boolean I_MusicPlaying(void)
{
return (boolean)music_stream;
}
boolean I_MusicPaused(void)
{
boolean fmpaused = false;
if (music_stream)
FMOD_Channel_GetPaused(music_channel, &fmpaused);
return fmpaused;
}
void I_InitMusic(void)
{
}