mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-05 14:49:25 +02:00
Make the SelectionBar match up better with what is visually selected in the tracks.
Shows up when zoomed in to sample level and looking at Start and Length.
This commit is contained in:
parent
f455fa3f22
commit
fb296d0206
@ -400,7 +400,14 @@ void SelectionBar::ValuesToControls()
|
||||
if (mRightEndButton->GetValue())
|
||||
mRightTime->SetTimeValue(mEnd);
|
||||
else
|
||||
mRightTime->SetTimeValue(mEnd - mStart);
|
||||
{ // mRightTime is the length.
|
||||
// Be sure to take into account the sub-sample offset.
|
||||
// See TimeToLongSamples and LongSamplesToTime but here at the project rate.
|
||||
double t = (sampleCount)floor(mEnd * mRate + 0.5);
|
||||
t -= (sampleCount)floor(mStart * mRate + 0.5);
|
||||
t /= mRate;
|
||||
mRightTime->SetTimeValue(t);
|
||||
}
|
||||
|
||||
mAudioTime->SetTimeValue(mAudio);
|
||||
}
|
||||
|
@ -1315,7 +1315,8 @@ void TimeTextCtrl::ValueToControls()
|
||||
|
||||
void TimeConverter::ValueToControls( double RawTime )
|
||||
{
|
||||
double theValue = RawTime * mScalingFactor + .000001;
|
||||
RawTime = (double)((sampleCount)floor(RawTime * mSampleRate + 0.5)) / mSampleRate; // put on a sample
|
||||
double theValue = RawTime * mScalingFactor + .000001; // what's this .000001 for?
|
||||
int t_int = int(theValue);
|
||||
double t_frac = (theValue - t_int);
|
||||
unsigned int i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user