mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
I_MusicPlaying, I_MusicPaused other targets
(cherry picked from commit d5ec388159
)
This commit is contained in:
parent
011a043dba
commit
44557d9c9d
5 changed files with 58 additions and 2 deletions
|
@ -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){}
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -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){}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue