diff --git a/src/deh_tables.c b/src/deh_tables.c index 474db3b43..ba35d6a94 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -20,7 +20,6 @@ #include "lua_script.h" // Lua stuff #include "m_cond.h" // Emblem constants #include "v_video.h" // video flags (for lua) -#include "i_sound.h" // musictype_t (for lua) #include "g_state.h" // gamestate_t (for lua) #include "r_data.h" // patchalphastyle_t #include "k_boss.h" // spottype_t (for lua) @@ -6776,18 +6775,6 @@ struct int_const_s const INT_CONST[] = { {"MA_NOCUTSCENES",MA_NOCUTSCENES}, {"MA_INGAME",MA_INGAME}, - // music types - {"MU_NONE", MU_NONE}, - {"MU_WAV", MU_WAV}, - {"MU_MOD", MU_MOD}, - {"MU_MID", MU_MID}, - {"MU_OGG", MU_OGG}, - {"MU_MP3", MU_MP3}, - {"MU_FLAC", MU_FLAC}, - {"MU_GME", MU_GME}, - {"MU_MOD_EX", MU_MOD_EX}, - {"MU_MID_EX", MU_MID_EX}, - // gamestates {"GS_NULL",GS_NULL}, {"GS_LEVEL",GS_LEVEL}, diff --git a/src/i_sound.h b/src/i_sound.h index a26aa5a8a..cacb96923 100644 --- a/src/i_sound.h +++ b/src/i_sound.h @@ -22,20 +22,6 @@ extern "C" { #endif -// copied from SDL mixer, plus GME -typedef enum { - MU_NONE, - MU_WAV, - MU_MOD, - MU_MID, - MU_OGG, - MU_MP3, - MU_FLAC, - MU_GME, - MU_MOD_EX, // libopenmpt - MU_MID_EX // Non-native MIDI -} musictype_t; - /** \brief Sound subsystem runing and waiting */ extern UINT8 sound_started; @@ -139,7 +125,7 @@ void I_ShutdownMusic(void); // MUSIC PROPERTIES /// ------------------------ -musictype_t I_SongType(void); +const char *I_SongType(void); boolean I_SongPlaying(void); boolean I_SongPaused(void); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 54f3bacf1..6e855717d 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2603,7 +2603,7 @@ static int lib_sMusicType(lua_State *L) return LUA_ErrInvalid(L, "player_t"); } if (!player || P_IsLocalPlayer(player)) - lua_pushinteger(L, S_MusicType()); + lua_pushstring(L, S_MusicType()); else lua_pushnil(L); return 1; diff --git a/src/p_setup.c b/src/p_setup.c index 52441c62e..1e0a6b08e 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -36,6 +36,7 @@ #include "r_fps.h" // R_ResetViewInterpolation in level load #include "s_sound.h" +#include "i_sound.h" // I_FreeSfx #include "st_stuff.h" #include "w_wad.h" #include "z_zone.h" diff --git a/src/s_sound.c b/src/s_sound.c index 0d3746d33..b8b621f95 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1701,7 +1701,7 @@ boolean S_MusicNotInFocus(void) ); } -musictype_t S_MusicType(void) +const char *S_MusicType(void) { return I_SongType(); } diff --git a/src/s_sound.h b/src/s_sound.h index bc55cc0e7..bd3ad99e4 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -14,7 +14,6 @@ #ifndef __S_SOUND__ #define __S_SOUND__ -#include "i_sound.h" // musictype_t #include "sounds.h" #include "m_fixed.h" #include "command.h" @@ -162,7 +161,7 @@ boolean S_MusicDisabled(void); boolean S_MusicPlaying(void); boolean S_MusicPaused(void); boolean S_MusicNotInFocus(void); -musictype_t S_MusicType(void); +const char *S_MusicType(void); const char *S_MusicName(void); boolean S_MusicExists(const char *mname); diff --git a/src/sdl/new_sound.cpp b/src/sdl/new_sound.cpp index 0415778f1..fc948dbb5 100644 --- a/src/sdl/new_sound.cpp +++ b/src/sdl/new_sound.cpp @@ -338,27 +338,27 @@ void I_ShutdownMusic(void) { // MUSIC PROPERTIES /// ------------------------ -musictype_t I_SongType(void) { +const char* I_SongType(void) { if (!music_player) - return MU_NONE; + return nullptr; SdlAudioLockHandle _; std::optional music_type = music_player->music_type(); if (music_type == std::nullopt) { - return MU_NONE; + return nullptr; } switch (*music_type) { case audio::MusicType::kOgg: - return MU_OGG; + return "OGG"; case audio::MusicType::kGme: - return MU_GME; + return "GME"; case audio::MusicType::kMod: - return MU_MOD; + return "Mod"; default: - return MU_NONE; + return nullptr; } }