mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Change get/set music position to UINT32 parameter, milliseconds
# Conflicts: # src/d_netcmd.c # 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
f8f71422ca
commit
55ef2d1d20
10 changed files with 54 additions and 56 deletions
|
|
@ -143,13 +143,13 @@ boolean I_SetSongSpeed(float speed)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongPosition(float position)
|
boolean I_SetSongPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
(void)position;
|
(void)position;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
float I_GetSongPosition(void)
|
UINT32 I_GetSongPosition(void)
|
||||||
{
|
{
|
||||||
return 0.0f;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4041,6 +4041,15 @@ static void Command_Tunes_f(void)
|
||||||
if (speed > 0.0f)
|
if (speed > 0.0f)
|
||||||
S_SpeedMusic(speed);
|
S_SpeedMusic(speed);
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
|
||||||
|
if (argc > 4)
|
||||||
|
{
|
||||||
|
UINT32 position = (UINT32)atoi(COM_Argv(4));
|
||||||
|
S_PositionMusic(position);
|
||||||
|
}
|
||||||
|
>>>>>>> f453fb65... Change get/set music position to UINT32 parameter, milliseconds
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Command_RestartAudio_f(void)
|
static void Command_RestartAudio_f(void)
|
||||||
|
|
|
||||||
|
|
@ -550,13 +550,13 @@ boolean I_SetSongSpeed(float speed)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongPosition(float position)
|
boolean I_SetSongPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
(void)position;
|
(void)position;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
float I_GetSongPosition(void)
|
UINT32 I_GetSongPosition(void)
|
||||||
{
|
{
|
||||||
return 0.0f;
|
return 0.;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,13 +146,13 @@ boolean I_SetSongTrack(int track)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongPosition(float position)
|
boolean I_SetSongPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
(void)position;
|
(void)position;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
float I_GetSongPosition(void)
|
UINT32 I_GetSongPosition(void)
|
||||||
{
|
{
|
||||||
return 0.0f;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -206,9 +206,9 @@ void I_ShutdownDigMusic(void);
|
||||||
|
|
||||||
boolean I_SetSongSpeed(float speed);
|
boolean I_SetSongSpeed(float speed);
|
||||||
|
|
||||||
boolean I_SetSongPosition(float position);
|
boolean I_SetSongPosition(UINT32 position);
|
||||||
|
|
||||||
float I_GetSongPosition(void);
|
UINT32 I_GetSongPosition(void);
|
||||||
|
|
||||||
boolean I_SetSongTrack(INT32 track);
|
boolean I_SetSongTrack(INT32 track);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1404,12 +1404,12 @@ boolean S_SpeedMusic(float speed)
|
||||||
return I_SetSongSpeed(speed);
|
return I_SetSongSpeed(speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean S_PositionMusic(float position)
|
boolean S_PositionMusic(UINT32 position)
|
||||||
{
|
{
|
||||||
return I_SetSongPosition(position);
|
return I_SetSongPosition(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
float S_GetPositionMusic(void)
|
UINT32 S_GetPositionMusic(void)
|
||||||
{
|
{
|
||||||
return I_GetSongPosition();
|
return I_GetSongPosition();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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(float position);
|
boolean S_PositionMusic(UINT32 position);
|
||||||
|
|
||||||
// Get Position of Music
|
// Get Position of Music
|
||||||
float S_GetPositionMusic(void);
|
UINT32 S_GetPositionMusic(void);
|
||||||
|
|
||||||
// Stops the music.
|
// Stops the music.
|
||||||
void S_StopMusic(void);
|
void S_StopMusic(void);
|
||||||
|
|
|
||||||
|
|
@ -736,21 +736,17 @@ boolean I_SetSongSpeed(float speed)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongPosition(float position)
|
boolean I_SetSongPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
if (position > 0.0f)
|
int r;
|
||||||
{
|
|
||||||
Mix_RewindMusic(); // needed for MP3
|
Mix_RewindMusic(); // needed for MP3
|
||||||
Mix_SetMusicPosition(position);
|
r = Mix_SetMusicPosition(position*1000);
|
||||||
return true;
|
return r == 0;
|
||||||
}
|
|
||||||
(void)position;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float I_GetSongPosition(void)
|
UINT32 I_GetSongPosition(void)
|
||||||
{
|
{
|
||||||
return 0.0f;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongTrack(int track)
|
boolean I_SetSongTrack(int track)
|
||||||
|
|
|
||||||
|
|
@ -1973,15 +1973,15 @@ boolean I_SetSongSpeed(float speed)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongPosition(float position)
|
boolean I_SetSongPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
(void)position;
|
(void)position;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
float I_GetSongPosition(void)
|
UINT32 I_GetSongPosition(void)
|
||||||
{
|
{
|
||||||
return 0.0f;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongTrack(int track)
|
boolean I_SetSongTrack(int track)
|
||||||
|
|
|
||||||
|
|
@ -756,13 +756,10 @@ boolean I_SetSongSpeed(float speed)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongPosition(float position)
|
boolean I_SetSongPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
if(position > 0.0f)
|
|
||||||
{
|
|
||||||
FMOD_RESULT e;
|
FMOD_RESULT e;
|
||||||
position *= 1000.0f;
|
e = FMOD_Channel_SetPosition(music_channel, position, FMOD_TIMEUNIT_MS);
|
||||||
e = FMOD_Channel_SetPosition(music_channel, (UINT32)position, FMOD_TIMEUNIT_MS);
|
|
||||||
if (e == FMOD_OK)
|
if (e == FMOD_OK)
|
||||||
return true;
|
return true;
|
||||||
else if (e == FMOD_ERR_UNSUPPORTED // Only music modules, numbnuts!
|
else if (e == FMOD_ERR_UNSUPPORTED // Only music modules, numbnuts!
|
||||||
|
|
@ -773,21 +770,17 @@ boolean I_SetSongPosition(float position)
|
||||||
FMR_MUSIC(e);
|
FMR_MUSIC(e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
(void)position;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float I_GetSongPosition(void)
|
UINT32 I_GetSongPosition(void)
|
||||||
{
|
{
|
||||||
FMOD_RESULT e;
|
FMOD_RESULT e;
|
||||||
UINT32 fmposition = 0.0;
|
unsigned int fmposition = 0;
|
||||||
e = FMOD_Channel_GetPosition(music_channel, &fmposition, FMOD_TIMEUNIT_MS);
|
e = FMOD_Channel_GetPosition(music_channel, &fmposition, FMOD_TIMEUNIT_MS);
|
||||||
if (e == FMOD_OK)
|
if (e == FMOD_OK)
|
||||||
return fmposition / 1000.0f;
|
return (UINT32)fmposition;
|
||||||
else
|
else
|
||||||
return 0.0f;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_SetSongTrack(INT32 track)
|
boolean I_SetSongTrack(INT32 track)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue