set start position in RageSound::StartPlaying
This commit is contained in:
@@ -244,8 +244,6 @@ static void StartMusic( MusicToPlay &ToPlay )
|
|||||||
if( ToPlay.bForceLoop )
|
if( ToPlay.bForceLoop )
|
||||||
p.StopMode = RageSoundParams::M_LOOP;
|
p.StopMode = RageSoundParams::M_LOOP;
|
||||||
NewMusic->m_Music->SetParams( p );
|
NewMusic->m_Music->SetParams( p );
|
||||||
|
|
||||||
NewMusic->m_Music->SetPositionSeconds( p.m_StartSecond );
|
|
||||||
NewMusic->m_Music->StartPlaying();
|
NewMusic->m_Music->StartPlaying();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -308,6 +308,9 @@ void RageSound::StartPlaying()
|
|||||||
{
|
{
|
||||||
ASSERT( !m_bPlaying );
|
ASSERT( !m_bPlaying );
|
||||||
|
|
||||||
|
// Move to the start position.
|
||||||
|
SetPositionFrames( lrintf(m_Param.m_StartSecond * samplerate()) );
|
||||||
|
|
||||||
/* If m_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. */
|
* long loading. We don't want that; log it, since it can be unobvious. */
|
||||||
if( !m_Param.m_StartTime.IsZero() && m_Param.m_StartTime.Ago() > 0 )
|
if( !m_Param.m_StartTime.IsZero() && m_Param.m_StartTime.Ago() > 0 )
|
||||||
|
|||||||
@@ -182,9 +182,6 @@ RageSound *RageSoundManager::PlaySound( RageSound &snd, const RageSoundParams *p
|
|||||||
if( params )
|
if( params )
|
||||||
snd.SetParams( *params );
|
snd.SetParams( *params );
|
||||||
|
|
||||||
// Move to the start position.
|
|
||||||
snd.SetPositionSeconds( snd.GetParams().m_StartSecond );
|
|
||||||
|
|
||||||
snd.StartPlaying();
|
snd.StartPlaying();
|
||||||
return &snd;
|
return &snd;
|
||||||
}
|
}
|
||||||
@@ -197,9 +194,6 @@ RageSound *RageSoundManager::PlayCopyOfSound( RageSound &snd, const RageSoundPar
|
|||||||
if( pParams )
|
if( pParams )
|
||||||
pSound->SetParams( *pParams );
|
pSound->SetParams( *pParams );
|
||||||
|
|
||||||
// Move to the start position.
|
|
||||||
pSound->SetPositionSeconds( pSound->GetParams().m_StartSecond );
|
|
||||||
|
|
||||||
pSound->StartPlaying();
|
pSound->StartPlaying();
|
||||||
|
|
||||||
return pSound;
|
return pSound;
|
||||||
|
|||||||
Reference in New Issue
Block a user