mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-04-04 17:02:24 +00:00
Refactor to SetMusicPosition, GetMusicPosition
# Conflicts: # src/lua_baselib.c # src/nds/i_sound.c # src/sdl12/mixer_sound.c # src/sdl12/sdl_sound.c # src/win32ce/win_snd.c
This commit is contained in:
parent
0ea40321ca
commit
47423a69ed
11 changed files with 28 additions and 28 deletions
|
@ -158,13 +158,13 @@ boolean I_SetSongSpeed(float speed)
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean I_SetSongPosition(UINT32 position)
|
||||
boolean I_SetMusicPosition(UINT32 position)
|
||||
{
|
||||
(void)position;
|
||||
return false;
|
||||
}
|
||||
|
||||
UINT32 I_GetSongPosition(void)
|
||||
UINT32 I_GetMusicPosition(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -4045,7 +4045,7 @@ static void Command_Tunes_f(void)
|
|||
if (argc > 4)
|
||||
{
|
||||
UINT32 position = (UINT32)atoi(COM_Argv(4));
|
||||
S_PositionMusic(position);
|
||||
S_SetMusicPosition(position);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -551,13 +551,13 @@ boolean I_SetSongSpeed(float speed)
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean I_SetSongPosition(UINT32 position)
|
||||
boolean I_SetMusicPosition(UINT32 position)
|
||||
{
|
||||
(void)position;
|
||||
return false;
|
||||
}
|
||||
|
||||
UINT32 I_GetSongPosition(void)
|
||||
UINT32 I_GetMusicPosition(void)
|
||||
{
|
||||
return 0.;
|
||||
}
|
||||
|
|
|
@ -146,13 +146,13 @@ boolean I_SetSongTrack(int track)
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean I_SetSongPosition(UINT32 position)
|
||||
boolean I_SetMusicPosition(UINT32 position)
|
||||
{
|
||||
(void)position;
|
||||
return false;
|
||||
}
|
||||
|
||||
UINT32 I_GetSongPosition(void)
|
||||
UINT32 I_GetMusicPosition(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -224,9 +224,9 @@ void I_ShutdownDigMusic(void);
|
|||
|
||||
boolean I_SetSongSpeed(float speed);
|
||||
|
||||
boolean I_SetSongPosition(UINT32 position);
|
||||
boolean I_SetMusicPosition(UINT32 position);
|
||||
|
||||
UINT32 I_GetSongPosition(void);
|
||||
UINT32 I_GetMusicPosition(void);
|
||||
|
||||
boolean I_SetSongTrack(INT32 track);
|
||||
|
||||
|
|
|
@ -2255,7 +2255,7 @@ static int lib_sSpeedMusic(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int lib_sPositionMusic(lua_State *L)
|
||||
static int lib_sSetMusicPosition(lua_State *L)
|
||||
{
|
||||
UINT32 position = 0;
|
||||
player_t *player = NULL;
|
||||
|
@ -2267,16 +2267,16 @@ static int lib_sPositionMusic(lua_State *L)
|
|||
return LUA_ErrInvalid(L, "player_t");
|
||||
}
|
||||
if (!player || P_IsLocalPlayer(player))
|
||||
lua_pushboolean(L, S_PositionMusic(position));
|
||||
lua_pushboolean(L, S_SetMusicPosition(position));
|
||||
else
|
||||
lua_pushboolean(L, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_sGetPositionMusic(lua_State *L)
|
||||
static int lib_sGetMusicPosition(lua_State *L)
|
||||
{
|
||||
NOHUD
|
||||
lua_pushinteger(L, (UINT32)S_GetPositionMusic());
|
||||
lua_pushinteger(L, (UINT32)S_GetMusicPosition());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -2790,8 +2790,8 @@ static luaL_Reg lib[] = {
|
|||
{"S_StopSound",lib_sStopSound},
|
||||
{"S_ChangeMusic",lib_sChangeMusic},
|
||||
{"S_SpeedMusic",lib_sSpeedMusic},
|
||||
{"S_PositionMusic",lib_sPositionMusic},
|
||||
{"S_GetPositionMusic",lib_sGetPositionMusic},
|
||||
{"S_SetMusicPosition",lib_sSetMusicPosition},
|
||||
{"S_GetMusicPosition",lib_sGetMusicPosition},
|
||||
{"S_PauseMusic",lib_sPauseMusic},
|
||||
{"S_ResumeMusic",lib_sResumeMusic},
|
||||
{"S_StopMusic",lib_sStopMusic},
|
||||
|
|
|
@ -1417,14 +1417,14 @@ boolean S_SpeedMusic(float speed)
|
|||
return I_SetSongSpeed(speed);
|
||||
}
|
||||
|
||||
boolean S_PositionMusic(UINT32 position)
|
||||
boolean S_SetMusicPosition(UINT32 position)
|
||||
{
|
||||
return I_SetSongPosition(position);
|
||||
return I_SetMusicPosition(position);
|
||||
}
|
||||
|
||||
UINT32 S_GetPositionMusic(void)
|
||||
UINT32 S_GetMusicPosition(void)
|
||||
{
|
||||
return I_GetSongPosition();
|
||||
return I_GetMusicPosition();
|
||||
}
|
||||
|
||||
void S_StopMusic(void)
|
||||
|
|
|
@ -136,10 +136,10 @@ void S_ChangeMusic(const char *mmusic, UINT16 mflags, boolean looping);
|
|||
boolean S_SpeedMusic(float speed);
|
||||
|
||||
// Set Position of Music
|
||||
boolean S_PositionMusic(UINT32 position);
|
||||
boolean S_SetMusicPosition(UINT32 position);
|
||||
|
||||
// Get Position of Music
|
||||
UINT32 S_GetPositionMusic(void);
|
||||
UINT32 S_GetMusicPosition(void);
|
||||
|
||||
// Stops the music.
|
||||
void S_StopMusic(void);
|
||||
|
|
|
@ -442,7 +442,7 @@ static void music_loop(void)
|
|||
{
|
||||
Mix_PlayMusic(music, 0);
|
||||
Mix_SetMusicPosition(loop_point);
|
||||
music_bytes = loop_point/1000.0L*44100.0L*4; //assume 44.1khz, 4-byte length (see I_GetSongPosition)
|
||||
music_bytes = loop_point/1000.0L*44100.0L*4; //assume 44.1khz, 4-byte length (see I_GetMusicPosition)
|
||||
}
|
||||
|
||||
static void count_music_bytes(int chan, void *stream, int len, void *udata)
|
||||
|
@ -788,7 +788,7 @@ boolean I_SetSongSpeed(float speed)
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean I_SetSongPosition(UINT32 position)
|
||||
boolean I_SetMusicPosition(UINT32 position)
|
||||
{
|
||||
if(midimode || !music)
|
||||
return false;
|
||||
|
@ -804,7 +804,7 @@ boolean I_SetSongPosition(UINT32 position)
|
|||
return true;
|
||||
}
|
||||
|
||||
UINT32 I_GetSongPosition(void)
|
||||
UINT32 I_GetMusicPosition(void)
|
||||
{
|
||||
if(midimode)
|
||||
return 0;
|
||||
|
|
|
@ -1989,13 +1989,13 @@ boolean I_SetSongSpeed(float speed)
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean I_SetSongPosition(UINT32 position)
|
||||
boolean I_SetMusicPosition(UINT32 position)
|
||||
{
|
||||
(void)position;
|
||||
return false;
|
||||
}
|
||||
|
||||
UINT32 I_GetSongPosition(void)
|
||||
UINT32 I_GetMusicPosition(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -774,7 +774,7 @@ boolean I_SetSongSpeed(float speed)
|
|||
return true;
|
||||
}
|
||||
|
||||
boolean I_SetSongPosition(UINT32 position)
|
||||
boolean I_SetMusicPosition(UINT32 position)
|
||||
{
|
||||
if(midimode)
|
||||
// Dummy out; this works for some MIDI, but not others.
|
||||
|
@ -794,7 +794,7 @@ boolean I_SetSongPosition(UINT32 position)
|
|||
}
|
||||
}
|
||||
|
||||
UINT32 I_GetSongPosition(void)
|
||||
UINT32 I_GetMusicPosition(void)
|
||||
{
|
||||
if(midimode)
|
||||
// Dummy out because unsupported, even though FMOD does this correctly.
|
||||
|
|
Loading…
Reference in a new issue