I don't like shadowed variables.
This commit is contained in:
+10
-4
@@ -250,18 +250,24 @@ void SpeedSegment::SetUnit(const int i)
|
|||||||
this->unit = static_cast<unsigned short>(i);
|
this->unit = static_cast<unsigned short>(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpeedSegment::Scale( int start, int length, int newLength )
|
void SpeedSegment::Scale( int start, int oldLength, int newLength )
|
||||||
{
|
{
|
||||||
if( GetUnit() == 0 )
|
if( GetUnit() == 0 )
|
||||||
{
|
{
|
||||||
// XXX: this function is duplicated, there should be a better way
|
// XXX: this function is duplicated, there should be a better way
|
||||||
float startBeat = GetBeat();
|
float startBeat = GetBeat();
|
||||||
float endBeat = startBeat + GetLength();
|
float endBeat = startBeat + GetLength();
|
||||||
float newStartBeat = ScalePosition( NoteRowToBeat(start), NoteRowToBeat(length), NoteRowToBeat(newLength), startBeat );
|
float newStartBeat = ScalePosition(NoteRowToBeat(start),
|
||||||
float newEndBeat = ScalePosition( NoteRowToBeat(start), NoteRowToBeat(length), NoteRowToBeat(newLength), endBeat );
|
NoteRowToBeat(oldLength),
|
||||||
|
NoteRowToBeat(newLength),
|
||||||
|
startBeat);
|
||||||
|
float newEndBeat = ScalePosition(NoteRowToBeat(start),
|
||||||
|
NoteRowToBeat(oldLength),
|
||||||
|
NoteRowToBeat(newLength),
|
||||||
|
endBeat);
|
||||||
SetLength( newEndBeat - newStartBeat );
|
SetLength( newEndBeat - newStartBeat );
|
||||||
}
|
}
|
||||||
TimingSegment<SpeedSegment>::Scale( start, length, newLength );
|
TimingSegment<SpeedSegment>::Scale( start, oldLength, newLength );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SpeedSegment::operator<( const SpeedSegment &other ) const
|
bool SpeedSegment::operator<( const SpeedSegment &other ) const
|
||||||
|
|||||||
Reference in New Issue
Block a user