@@ -423,7 +423,8 @@ void AudioService::setTrackPos(unsigned int graphPos)
423423
424424 if ( (tracks.size () > 0 ) && (bIsSomeTrackPlaying) )
425425 {
426- unsigned int posInMS = graphPos * tracks[iCurrentlyPlayingTrackIndex]->getLengthInMS () / MAX_X_AXIS_VALUE;
426+ // static_cast<size_t> because overflow may occur if the track is longer than 70 minutes, for example: graphPos = 800 and track length is 110 minutes.
427+ unsigned int posInMS = static_cast <unsigned int >(static_cast <size_t >(graphPos) * tracks[iCurrentlyPlayingTrackIndex]->getLengthInMS () / MAX_X_AXIS_VALUE);
427428 if ( tracks[iCurrentlyPlayingTrackIndex]->setPositionInMS ( posInMS ) )
428429 {
429430 pMainWindow->clearGraph ();
@@ -619,6 +620,8 @@ void AudioService::setPan(float fPan)
619620 pMaster->setPan (fPan );
620621 }
621622
623+ pSystem->update ();
624+
622625 mtxTracksVec.unlock ();
623626}
624627
@@ -628,6 +631,8 @@ void AudioService::setPitch(float fPitch)
628631 {
629632 pPitch->setParameterFloat (FMOD_DSP_PITCHSHIFT_PITCH, fPitch );
630633 pPitch->setParameterInt (FMOD_DSP_PITCHSHIFT_FFTSIZE, 4096 );
634+
635+ pSystem->update ();
631636 }
632637}
633638
@@ -645,6 +650,8 @@ void AudioService::setSpeedByPitch(float fSpeed)
645650 }
646651 }
647652
653+ pSystem->update ();
654+
648655 mtxTracksVec.unlock ();
649656}
650657
@@ -668,6 +675,8 @@ void AudioService::setSpeedByTime(float fSpeed)
668675 if (fSpeed != 1 .0f ) pFaderForTime->setParameterFloat (FMOD_DSP_FADER_GAIN, 3 );
669676 else pFaderForTime->setParameterFloat (FMOD_DSP_FADER_GAIN, 0 );
670677
678+ pSystem->update ();
679+
671680 mtxTracksVec.unlock ();
672681}
673682
@@ -676,6 +685,7 @@ void AudioService::setReverbVolume(float fVolume)
676685 if (pReverb)
677686 {
678687 pReverb->setParameterFloat (FMOD_DSP_SFXREVERB_WETLEVEL, fVolume );
688+ pSystem->update ();
679689 }
680690}
681691
@@ -684,6 +694,7 @@ void AudioService::setEchoVolume(float fEchoVolume)
684694 if (pEcho)
685695 {
686696 pEcho->setParameterFloat (FMOD_DSP_ECHO_WETLEVEL, fEchoVolume );
697+ pSystem->update ();
687698 }
688699}
689700
0 commit comments