From eb52a144337b066a5be942ab2c9e3822bf8d3782 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 15 Aug 2018 01:59:01 -0400 Subject: [PATCH] Implement I_MIDIPlaying, I_MusicPlaying, I_MusicPaused in other targets # Conflicts: # src/nds/i_sound.c # src/sdl12/sdl_sound.c # src/win32ce/win_snd.c --- src/android/i_sound.c | 15 +++++++++++++++ src/djgppdos/i_sound.c | 16 ++++++++++++++++ src/dummy/i_sound.c | 15 +++++++++++++++ src/sdl/sdl_sound.c | 16 ++++++++++++++++ 4 files changed, 62 insertions(+) diff --git a/src/android/i_sound.c b/src/android/i_sound.c index fb43fa070..36281cd0d 100644 --- a/src/android/i_sound.c +++ b/src/android/i_sound.c @@ -74,6 +74,21 @@ void I_ResumeSong(INT32 handle) (void)handle; } +boolean I_MIDIPlaying(void) +{ + return false; +} + +boolean I_MusicPlaying(void) +{ + return false; +} + +boolean I_MusicPaused(void) +{ + return false; +} + // // MIDI I/O // diff --git a/src/djgppdos/i_sound.c b/src/djgppdos/i_sound.c index 7e43d290a..d21eab18f 100644 --- a/src/djgppdos/i_sound.c +++ b/src/djgppdos/i_sound.c @@ -474,6 +474,7 @@ void I_StopSong(INT32 handle) stop_midi(); } + // Is the song playing? #if 0 int I_QrySongPlaying(int handle) @@ -560,3 +561,18 @@ UINT32 I_GetSongPosition(void) { return 0.; } + +boolean I_MIDIPlaying(void) +{ + return (boolean)currsong && music_started; +} + +boolean I_MusicPlaying(void) +{ + return (boolean)currsong && music_started; +} + +boolean I_MusicPaused(void) +{ + return false; +} diff --git a/src/dummy/i_sound.c b/src/dummy/i_sound.c index a0eaf2c69..ba1d98084 100644 --- a/src/dummy/i_sound.c +++ b/src/dummy/i_sound.c @@ -156,3 +156,18 @@ UINT32 I_GetSongPosition(void) { return 0; } + +boolean I_MIDIPlaying(void) +{ + return false; +} + +boolean I_MusicPlaying(void) +{ + return false; +} + +boolean I_MusicPaused(void) +{ + return false; +} diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index 6092402d2..8bf2dfe4a 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -1649,6 +1649,22 @@ void I_StopSong(INT32 handle) #endif } +boolean I_MIDIPlaying(void) +{ + // todo: no way to tell specifically if MIDI is playing, implement midimode + return !nomidimusic && nodigimusic && musicStarted; +} + +boolean I_MusicPlaying(void) +{ + return musicStarted; +} + +boolean I_MusicPaused(void) +{ + return Mix_PausedMusic(); +} + void I_UnRegisterSong(INT32 handle) { #ifdef HAVE_MIXER