mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +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
45581b263b
commit
5197f69c6f
11 changed files with 28 additions and 28 deletions
|
|
@ -158,13 +158,13 @@ boolean I_SetSongSpeed(float speed)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongPosition(UINT32 position)
|
boolean I_SetMusicPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
(void)position;
|
(void)position;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 I_GetSongPosition(void)
|
UINT32 I_GetMusicPosition(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4045,7 +4045,7 @@ static void Command_Tunes_f(void)
|
||||||
if (argc > 4)
|
if (argc > 4)
|
||||||
{
|
{
|
||||||
UINT32 position = (UINT32)atoi(COM_Argv(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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongPosition(UINT32 position)
|
boolean I_SetMusicPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
(void)position;
|
(void)position;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 I_GetSongPosition(void)
|
UINT32 I_GetMusicPosition(void)
|
||||||
{
|
{
|
||||||
return 0.;
|
return 0.;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,13 +146,13 @@ boolean I_SetSongTrack(int track)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongPosition(UINT32 position)
|
boolean I_SetMusicPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
(void)position;
|
(void)position;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 I_GetSongPosition(void)
|
UINT32 I_GetMusicPosition(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -224,9 +224,9 @@ void I_ShutdownDigMusic(void);
|
||||||
|
|
||||||
boolean I_SetSongSpeed(float speed);
|
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);
|
boolean I_SetSongTrack(INT32 track);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2255,7 +2255,7 @@ static int lib_sSpeedMusic(lua_State *L)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lib_sPositionMusic(lua_State *L)
|
static int lib_sSetMusicPosition(lua_State *L)
|
||||||
{
|
{
|
||||||
UINT32 position = 0;
|
UINT32 position = 0;
|
||||||
player_t *player = NULL;
|
player_t *player = NULL;
|
||||||
|
|
@ -2267,16 +2267,16 @@ static int lib_sPositionMusic(lua_State *L)
|
||||||
return LUA_ErrInvalid(L, "player_t");
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
}
|
}
|
||||||
if (!player || P_IsLocalPlayer(player))
|
if (!player || P_IsLocalPlayer(player))
|
||||||
lua_pushboolean(L, S_PositionMusic(position));
|
lua_pushboolean(L, S_SetMusicPosition(position));
|
||||||
else
|
else
|
||||||
lua_pushboolean(L, false);
|
lua_pushboolean(L, false);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lib_sGetPositionMusic(lua_State *L)
|
static int lib_sGetMusicPosition(lua_State *L)
|
||||||
{
|
{
|
||||||
NOHUD
|
NOHUD
|
||||||
lua_pushinteger(L, (UINT32)S_GetPositionMusic());
|
lua_pushinteger(L, (UINT32)S_GetMusicPosition());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2790,8 +2790,8 @@ static luaL_Reg lib[] = {
|
||||||
{"S_StopSound",lib_sStopSound},
|
{"S_StopSound",lib_sStopSound},
|
||||||
{"S_ChangeMusic",lib_sChangeMusic},
|
{"S_ChangeMusic",lib_sChangeMusic},
|
||||||
{"S_SpeedMusic",lib_sSpeedMusic},
|
{"S_SpeedMusic",lib_sSpeedMusic},
|
||||||
{"S_PositionMusic",lib_sPositionMusic},
|
{"S_SetMusicPosition",lib_sSetMusicPosition},
|
||||||
{"S_GetPositionMusic",lib_sGetPositionMusic},
|
{"S_GetMusicPosition",lib_sGetMusicPosition},
|
||||||
{"S_PauseMusic",lib_sPauseMusic},
|
{"S_PauseMusic",lib_sPauseMusic},
|
||||||
{"S_ResumeMusic",lib_sResumeMusic},
|
{"S_ResumeMusic",lib_sResumeMusic},
|
||||||
{"S_StopMusic",lib_sStopMusic},
|
{"S_StopMusic",lib_sStopMusic},
|
||||||
|
|
|
||||||
|
|
@ -1417,14 +1417,14 @@ boolean S_SpeedMusic(float speed)
|
||||||
return I_SetSongSpeed(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)
|
void S_StopMusic(void)
|
||||||
|
|
|
||||||
|
|
@ -136,10 +136,10 @@ void S_ChangeMusic(const char *mmusic, UINT16 mflags, boolean looping);
|
||||||
boolean S_SpeedMusic(float speed);
|
boolean S_SpeedMusic(float speed);
|
||||||
|
|
||||||
// Set Position of Music
|
// Set Position of Music
|
||||||
boolean S_PositionMusic(UINT32 position);
|
boolean S_SetMusicPosition(UINT32 position);
|
||||||
|
|
||||||
// Get Position of Music
|
// Get Position of Music
|
||||||
UINT32 S_GetPositionMusic(void);
|
UINT32 S_GetMusicPosition(void);
|
||||||
|
|
||||||
// Stops the music.
|
// Stops the music.
|
||||||
void S_StopMusic(void);
|
void S_StopMusic(void);
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ static void music_loop(void)
|
||||||
{
|
{
|
||||||
Mix_PlayMusic(music, 0);
|
Mix_PlayMusic(music, 0);
|
||||||
Mix_SetMusicPosition(loop_point);
|
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)
|
static void count_music_bytes(int chan, void *stream, int len, void *udata)
|
||||||
|
|
@ -788,7 +788,7 @@ boolean I_SetSongSpeed(float speed)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongPosition(UINT32 position)
|
boolean I_SetMusicPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
if(midimode || !music)
|
if(midimode || !music)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -804,7 +804,7 @@ boolean I_SetSongPosition(UINT32 position)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 I_GetSongPosition(void)
|
UINT32 I_GetMusicPosition(void)
|
||||||
{
|
{
|
||||||
if(midimode)
|
if(midimode)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -1989,13 +1989,13 @@ boolean I_SetSongSpeed(float speed)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongPosition(UINT32 position)
|
boolean I_SetMusicPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
(void)position;
|
(void)position;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 I_GetSongPosition(void)
|
UINT32 I_GetMusicPosition(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -774,7 +774,7 @@ boolean I_SetSongSpeed(float speed)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongPosition(UINT32 position)
|
boolean I_SetMusicPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
if(midimode)
|
if(midimode)
|
||||||
// Dummy out; this works for some MIDI, but not others.
|
// 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)
|
if(midimode)
|
||||||
// Dummy out because unsupported, even though FMOD does this correctly.
|
// Dummy out because unsupported, even though FMOD does this correctly.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue