Skip to content

Commit

Permalink
Renamed a local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg68 committed Nov 28, 2024
1 parent 18299f0 commit e174f22
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/grandorgue/sound/GOSoundFader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,19 @@ void GOSoundFader::Process(
}

// Calculate the external volume
float newExternalVolume = m_VelocityVolume * externalVolume;
float targetExternalVolume = m_VelocityVolume * externalVolume;

if (m_LastExternalVolumePoint < 0.0f)
m_LastExternalVolumePoint = newExternalVolume;
m_LastExternalVolumePoint = targetExternalVolume;

float startExternalVolumePoint = m_LastExternalVolumePoint;

// Calculate new m_LastExternalVolumePoint
// the target volume will be changed from startExternalVolumePoint to
// m_LastExternalVolumePoint during the nFrames period
if (newExternalVolume != startExternalVolumePoint)
m_LastExternalVolumePoint += (newExternalVolume - startExternalVolumePoint)
if (targetExternalVolume != startExternalVolumePoint)
m_LastExternalVolumePoint
+= (targetExternalVolume - startExternalVolumePoint)
// Assume that external volume is to be reached in MAX_FRAME_SIZE frames
* std::max(nFrames, EXTERNAL_VOLUME_CHANGE_FRAMES)
/ EXTERNAL_VOLUME_CHANGE_FRAMES;
Expand Down

0 comments on commit e174f22

Please sign in to comment.