style cleanup
This commit is contained in:
@@ -238,7 +238,7 @@ static void StartMusic( MusicToPlay &ToPlay )
|
||||
p.m_StartSecond = ToPlay.start_sec;
|
||||
p.m_LengthSeconds = ToPlay.length_sec;
|
||||
p.m_FadeLength = ToPlay.fade_len;
|
||||
p.StartTime = when;
|
||||
p.m_StartTime = when;
|
||||
if( ToPlay.force_loop )
|
||||
p.StopMode = RageSoundParams::M_LOOP;
|
||||
NewMusic->m_Music->SetParams( p );
|
||||
|
||||
@@ -45,7 +45,7 @@ const int internal_buffer_size = 1024*1;
|
||||
const unsigned read_block_size = 1024;
|
||||
|
||||
RageSoundParams::RageSoundParams():
|
||||
StartTime( RageZeroTimer )
|
||||
m_StartTime( RageZeroTimer )
|
||||
{
|
||||
m_StartSecond = 0;
|
||||
m_LengthSeconds = -1;
|
||||
@@ -53,7 +53,7 @@ RageSoundParams::RageSoundParams():
|
||||
m_Volume = -1.0f; // use SOUNDMAN->GetMixVolume()
|
||||
m_Balance = 0; // center
|
||||
speed_input_samples = speed_output_samples = 1;
|
||||
AccurateSync = false;
|
||||
m_bAccurateSync = false;
|
||||
StopMode = M_AUTO;
|
||||
}
|
||||
|
||||
@@ -580,11 +580,11 @@ void RageSound::StartPlaying()
|
||||
|
||||
ASSERT( !m_bPlaying );
|
||||
|
||||
/* If StartTime is in the past, then we probably set a start time but took too
|
||||
/* If m_StartTime is in the past, then we probably set a start time but took too
|
||||
* long loading. We don't want that; log it, since it can be unobvious. */
|
||||
if( !m_Param.StartTime.IsZero() && m_Param.StartTime.Ago() > 0 )
|
||||
if( !m_Param.m_StartTime.IsZero() && m_Param.m_StartTime.Ago() > 0 )
|
||||
LOG->Trace("Sound \"%s\" has a start time %f seconds in the past",
|
||||
GetLoadedFilePath().c_str(), m_Param.StartTime.Ago() );
|
||||
GetLoadedFilePath().c_str(), m_Param.m_StartTime.Ago() );
|
||||
|
||||
/* Tell the sound manager to start mixing us. */
|
||||
// LOG->Trace("set playing true for %p (StartPlaying) (%s)", this, this->GetLoadedFilePath().c_str());
|
||||
@@ -842,7 +842,7 @@ bool RageSound::SetPositionFrames( int iFrames )
|
||||
m_DataBuffer.clear();
|
||||
|
||||
int ret;
|
||||
if( m_Param.AccurateSync )
|
||||
if( m_Param.m_bAccurateSync )
|
||||
ret = m_pSource->SetPosition_Accurate(ms);
|
||||
else
|
||||
ret = m_pSource->SetPosition_Fast(ms);
|
||||
@@ -902,7 +902,7 @@ float RageSound::GetPlaybackRate() const
|
||||
|
||||
RageTimer RageSound::GetStartTime() const
|
||||
{
|
||||
return m_Param.StartTime;
|
||||
return m_Param.m_StartTime;
|
||||
}
|
||||
|
||||
void RageSound::SetParams( const RageSoundParams &p )
|
||||
|
||||
@@ -52,22 +52,24 @@ struct RageSoundParams
|
||||
int speed_input_samples, speed_output_samples;
|
||||
void SetPlaybackRate( float fScale );
|
||||
|
||||
bool AccurateSync;
|
||||
/* If enabled, file seeking will prefer accuracy over speed. */
|
||||
bool m_bAccurateSync;
|
||||
|
||||
/* Optional driver feature: time to actually start playing sounds. If zero, or if not
|
||||
* supported, it'll start immediately. */
|
||||
RageTimer StartTime;
|
||||
* supported, the sound will start immediately. */
|
||||
RageTimer m_StartTime;
|
||||
|
||||
/*
|
||||
* M_STOP (default) stops the sound at the end.
|
||||
* M_STOP stops the sound at the end.
|
||||
* M_LOOP restarts.
|
||||
* M_CONTINUE feeds silence, which is useful to continue timing longer than the actual sound.
|
||||
* M_AUTO (default) stops, obeying filename hints.
|
||||
*/
|
||||
enum StopMode_t {
|
||||
M_STOP, /* stop when finished */
|
||||
M_LOOP, /* loop */
|
||||
M_CONTINUE, /* keep playing silence */
|
||||
M_AUTO /* obey filename hints */
|
||||
M_STOP,
|
||||
M_LOOP,
|
||||
M_CONTINUE,
|
||||
M_AUTO
|
||||
} StopMode;
|
||||
};
|
||||
|
||||
|
||||
@@ -760,7 +760,7 @@ void ScreenEdit::PlayTicks()
|
||||
fSecondsUntil /= m_soundMusic.GetPlaybackRate(); /* 2x music rate means the time until the tick is halved */
|
||||
|
||||
RageSoundParams p;
|
||||
p.StartTime = GAMESTATE->m_LastBeatUpdate + (fSecondsUntil - (float)TICK_EARLY_SECONDS);
|
||||
p.m_StartTime = GAMESTATE->m_LastBeatUpdate + (fSecondsUntil - (float)TICK_EARLY_SECONDS);
|
||||
m_soundAssistTick.Play( &p );
|
||||
}
|
||||
}
|
||||
@@ -2077,7 +2077,7 @@ void ScreenEdit::TransitionEditState( EditState em )
|
||||
RageSoundParams p;
|
||||
p.SetPlaybackRate( GAMESTATE->m_SongOptions.m_fMusicRate );
|
||||
p.m_StartSecond = fStartSeconds;
|
||||
p.AccurateSync = true;
|
||||
p.m_bAccurateSync = true;
|
||||
p.StopMode = RageSoundParams::M_CONTINUE;
|
||||
m_soundMusic.Play( &p );
|
||||
break;
|
||||
|
||||
@@ -1368,7 +1368,7 @@ float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusi
|
||||
fStartSecond = min(fStartSecond, -MinTimeToMusic);
|
||||
|
||||
RageSoundParams p;
|
||||
p.AccurateSync = true;
|
||||
p.m_bAccurateSync = true;
|
||||
p.SetPlaybackRate( GAMESTATE->m_SongOptions.m_fMusicRate );
|
||||
p.StopMode = RageSoundParams::M_CONTINUE;
|
||||
p.m_StartSecond = fStartSecond;
|
||||
@@ -1458,7 +1458,7 @@ void ScreenGameplay::PlayTicks()
|
||||
fSecondsUntil /= GAMESTATE->m_SongOptions.m_fMusicRate; /* 2x music rate means the time until the tick is halved */
|
||||
|
||||
RageSoundParams p;
|
||||
p.StartTime = GAMESTATE->m_LastBeatUpdate + (fSecondsUntil - (float)TICK_EARLY_SECONDS);
|
||||
p.m_StartTime = GAMESTATE->m_LastBeatUpdate + (fSecondsUntil - (float)TICK_EARLY_SECONDS);
|
||||
m_soundAssistTick.Play( &p );
|
||||
}
|
||||
}
|
||||
@@ -1538,7 +1538,7 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
NSMAN->StartRequest(1);
|
||||
|
||||
RageSoundParams p;
|
||||
p.AccurateSync = true;
|
||||
p.m_bAccurateSync = true;
|
||||
p.SetPlaybackRate( 1.0 ); //Force 1.0 playback speed
|
||||
p.StopMode = RageSoundParams::M_CONTINUE;
|
||||
p.m_StartSecond = startOffset;
|
||||
|
||||
Reference in New Issue
Block a user