mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-23 15:41:09 +02:00
Changes to the two commands involving the saved cursor position
Changes to "Save Cursor Position" and "(Select) Cursor to Saved Cursor Position" Both the saved cursor position, and the current cursor position are the audio position if audio is active, else selection start. The selected time range is the min, and max of these two values.
This commit is contained in:
parent
53a5c930a4
commit
e50335850f
@ -5188,8 +5188,9 @@ void AudacityProject::OnSelectStartCursor()
|
|||||||
void AudacityProject::OnSelectCursorSavedCursor()
|
void AudacityProject::OnSelectCursorSavedCursor()
|
||||||
{
|
{
|
||||||
if (mCursorPositionHasBeenSaved) {
|
if (mCursorPositionHasBeenSaved) {
|
||||||
mViewInfo.selectedRegion.setT0(std::min(mViewInfo.selectedRegion.t0(), mCursorPositionSaved));
|
double cursorPositionCurrent = IsAudioActive() ? gAudioIO->GetStreamTime() : mViewInfo.selectedRegion.t0();
|
||||||
mViewInfo.selectedRegion.setT1(std::max(mViewInfo.selectedRegion.t1(), mCursorPositionSaved));
|
mViewInfo.selectedRegion.setT0(std::min(cursorPositionCurrent, mCursorPositionSaved));
|
||||||
|
mViewInfo.selectedRegion.setT1(std::max(cursorPositionCurrent, mCursorPositionSaved));
|
||||||
|
|
||||||
ModifyState(false);
|
ModifyState(false);
|
||||||
mTrackPanel->Refresh(false);
|
mTrackPanel->Refresh(false);
|
||||||
@ -5914,7 +5915,7 @@ void AudacityProject::OnSelectionSave()
|
|||||||
|
|
||||||
void AudacityProject::OnCursorPositionSave()
|
void AudacityProject::OnCursorPositionSave()
|
||||||
{
|
{
|
||||||
mCursorPositionSaved = mViewInfo.selectedRegion.t0();
|
mCursorPositionSaved = IsAudioActive() ? gAudioIO->GetStreamTime() : mViewInfo.selectedRegion.t0();
|
||||||
mCursorPositionHasBeenSaved = true;
|
mCursorPositionHasBeenSaved = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user