mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-17 16:50:26 +02:00
Bug2155: Deleting last track should reset play region to [0,0]
This commit is contained in:
parent
20772c995d
commit
2d6e8f3964
@ -1131,20 +1131,22 @@ void AdornedRulerPanel::DoIdle()
|
|||||||
const auto &selectedRegion = viewInfo.selectedRegion;
|
const auto &selectedRegion = viewInfo.selectedRegion;
|
||||||
auto &playRegion = ViewInfo::Get( project ).playRegion;
|
auto &playRegion = ViewInfo::Get( project ).playRegion;
|
||||||
|
|
||||||
bool changedSelectedRegion = mLastDrawnSelectedRegion != selectedRegion;
|
|
||||||
|
|
||||||
auto gAudioIO = AudioIOBase::Get();
|
auto gAudioIO = AudioIOBase::Get();
|
||||||
if (!gAudioIO->IsBusy() && !playRegion.Locked() && changedSelectedRegion)
|
if (!gAudioIO->IsBusy() && !playRegion.Locked() && mDirtySelectedRegion)
|
||||||
SetPlayRegion( selectedRegion.t0(), selectedRegion.t1() );
|
SetPlayRegion( selectedRegion.t0(), selectedRegion.t1() );
|
||||||
else {
|
else {
|
||||||
changed = changed || changedSelectedRegion;
|
changed = changed
|
||||||
changed = changed || mLastDrawnH != viewInfo.h;
|
|| mDirtySelectedRegion
|
||||||
changed = changed || mLastDrawnZoom != viewInfo.GetZoom();
|
|| mLastDrawnH != viewInfo.h
|
||||||
|
|| mLastDrawnZoom != viewInfo.GetZoom()
|
||||||
|
;
|
||||||
if (changed)
|
if (changed)
|
||||||
// Cause ruler redraw anyway, because we may be zooming or scrolling,
|
// Cause ruler redraw anyway, because we may be zooming or scrolling,
|
||||||
// showing or hiding the scrub bar, etc.
|
// showing or hiding the scrub bar, etc.
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mDirtySelectedRegion = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdornedRulerPanel::OnRecordStartStop(wxCommandEvent & evt)
|
void AdornedRulerPanel::OnRecordStartStop(wxCommandEvent & evt)
|
||||||
@ -1168,7 +1170,7 @@ void AdornedRulerPanel::OnRecordStartStop(wxCommandEvent & evt)
|
|||||||
|
|
||||||
if ( evt.GetInt() == 0 ) {
|
if ( evt.GetInt() == 0 ) {
|
||||||
// So that the play region is updated
|
// So that the play region is updated
|
||||||
mLastDrawnSelectedRegion.setTimes( -1, -1 );
|
mDirtySelectedRegion = true;
|
||||||
DoIdle();
|
DoIdle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1178,6 +1180,7 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
|
|||||||
auto &viewInfo = ViewInfo::Get( *GetProject() );
|
auto &viewInfo = ViewInfo::Get( *GetProject() );
|
||||||
mLastDrawnH = viewInfo.h;
|
mLastDrawnH = viewInfo.h;
|
||||||
mLastDrawnZoom = viewInfo.GetZoom();
|
mLastDrawnZoom = viewInfo.GetZoom();
|
||||||
|
mDirtySelectedRegion = (mLastDrawnSelectedRegion != viewInfo.selectedRegion);
|
||||||
mLastDrawnSelectedRegion = viewInfo.selectedRegion;
|
mLastDrawnSelectedRegion = viewInfo.selectedRegion;
|
||||||
// To do, note other fisheye state when we have that
|
// To do, note other fisheye state when we have that
|
||||||
|
|
||||||
|
@ -225,6 +225,7 @@ private:
|
|||||||
SelectedRegion mLastDrawnSelectedRegion;
|
SelectedRegion mLastDrawnSelectedRegion;
|
||||||
double mLastDrawnH{};
|
double mLastDrawnH{};
|
||||||
double mLastDrawnZoom{};
|
double mLastDrawnZoom{};
|
||||||
|
bool mDirtySelectedRegion{};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //define __AUDACITY_ADORNED_RULER_PANEL__
|
#endif //define __AUDACITY_ADORNED_RULER_PANEL__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user