Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
SelectActions::Handler Struct Reference
Inheritance diagram for SelectActions::Handler:
[legend]
Collaboration diagram for SelectActions::Handler:
[legend]

Public Member Functions

void OnSelectAll (const CommandContext &context)
 
void OnSelectNone (const CommandContext &context)
 
void OnSelectAllTracks (const CommandContext &context)
 
void OnSelectSyncLockSel (const CommandContext &context)
 
void OnSetLeftSelection (const CommandContext &context)
 
void OnSetRightSelection (const CommandContext &context)
 
void OnSelectStartCursor (const CommandContext &context)
 
void OnSelectCursorEnd (const CommandContext &context)
 
void OnSelectTrackStartToEnd (const CommandContext &context)
 
void OnSelectionSave (const CommandContext &context)
 
void OnSelectionRestore (const CommandContext &context)
 
void OnSelectCursorStoredCursor (const CommandContext &context)
 
void OnCursorPositionStore (const CommandContext &context)
 
void OnZeroCrossing (const CommandContext &context)
 
void OnSnapToOff (const CommandContext &context)
 
void OnSnapToNearest (const CommandContext &context)
 
void OnSnapToPrior (const CommandContext &context)
 
void OnSelToStart (const CommandContext &context)
 
void OnSelToEnd (const CommandContext &context)
 
void OnSelExtendLeft (const CommandContext &context)
 
void OnSelExtendRight (const CommandContext &context)
 
void OnSelSetExtendLeft (const CommandContext &context)
 
void OnSelSetExtendRight (const CommandContext &context)
 
void OnSelContractLeft (const CommandContext &context)
 
void OnSelContractRight (const CommandContext &context)
 
void OnCursorSelStart (const CommandContext &context)
 
void OnCursorSelEnd (const CommandContext &context)
 
void OnCursorTrackStart (const CommandContext &context)
 
void OnCursorTrackEnd (const CommandContext &context)
 
void OnSkipStart (const CommandContext &context)
 
void OnSkipEnd (const CommandContext &context)
 
void OnCursorLeft (const CommandContext &context)
 
void OnCursorRight (const CommandContext &context)
 
void OnCursorShortJumpLeft (const CommandContext &context)
 
void OnCursorShortJumpRight (const CommandContext &context)
 
void OnCursorLongJumpLeft (const CommandContext &context)
 
void OnCursorLongJumpRight (const CommandContext &context)
 
void OnSeekLeftShort (const CommandContext &context)
 
void OnSeekRightShort (const CommandContext &context)
 
void OnSeekLeftLong (const CommandContext &context)
 
void OnSeekRightLong (const CommandContext &context)
 
void OnSelectAllTime (const CommandContext &context)
 
void UpdatePrefs () override
 
 Handler ()
 
 Handler (const Handler &) PROHIBITED
 
Handleroperator= (const Handler &) PROHIBITED
 
- Public Member Functions inherited from ClientData::Base
virtual ~Base ()
 
- Public Member Functions inherited from PrefsListener
 PrefsListener ()
 
virtual ~PrefsListener ()
 
virtual void UpdatePrefs ()=0
 

Public Attributes

SelectedRegion mRegionSave {}
 
bool mCursorPositionHasBeenStored { false }
 
double mCursorPositionStored { 0.0 }
 
SeekInfo mSeekInfo
 

Additional Inherited Members

- Static Public Member Functions inherited from PrefsListener
static void Broadcast (int id=0)
 Call this static function to notify all PrefsListener objects. More...
 
- Protected Member Functions inherited from PrefsListener
virtual void UpdateSelectedPrefs (int id)
 

Detailed Description

Definition at line 426 of file SelectMenus.cpp.

Constructor & Destructor Documentation

◆ Handler() [1/2]

SelectActions::Handler::Handler ( )
inline

Definition at line 890 of file SelectMenus.cpp.

891{
892 UpdatePrefs();
893}
void UpdatePrefs() override

References UpdatePrefs().

Here is the call graph for this function:

◆ Handler() [2/2]

SelectActions::Handler::Handler ( const Handler )

Member Function Documentation

◆ OnCursorLeft()

void SelectActions::Handler::OnCursorLeft ( const CommandContext context)
inline

Definition at line 814 of file SelectMenus.cpp.

815{
816 if( !OnlyHandleKeyUp( context ) )
818 mSeekInfo );
819}
AudacityProject & project
bool OnlyHandleKeyUp(const CommandContext &context)
void SeekLeftOrRight(AudacityProject &project, double direction, SelectionOperation operation, SeekInfo &info)

References anonymous_namespace{SelectMenus.cpp}::CURSOR_MOVE, anonymous_namespace{SelectMenus.cpp}::DIRECTION_LEFT, mSeekInfo, anonymous_namespace{SelectMenus.cpp}::OnlyHandleKeyUp(), CommandContext::project, and anonymous_namespace{SelectMenus.cpp}::SeekLeftOrRight().

Here is the call graph for this function:

◆ OnCursorLongJumpLeft()

void SelectActions::Handler::OnCursorLongJumpLeft ( const CommandContext context)
inline

Definition at line 840 of file SelectMenus.cpp.

841{
842 DoCursorMove( context.project,
843 -mSeekInfo.mSeekLong, mSeekInfo.mLastSelectionAdjustment );
844}
void DoCursorMove(AudacityProject &project, double seekStep, wxLongLong &lastSelectionAdjustment)

References anonymous_namespace{SelectMenus.cpp}::DoCursorMove(), mSeekInfo, and CommandContext::project.

Here is the call graph for this function:

◆ OnCursorLongJumpRight()

void SelectActions::Handler::OnCursorLongJumpRight ( const CommandContext context)
inline

Definition at line 846 of file SelectMenus.cpp.

847{
848 DoCursorMove( context.project,
849 mSeekInfo.mSeekLong, mSeekInfo.mLastSelectionAdjustment );
850}

References anonymous_namespace{SelectMenus.cpp}::DoCursorMove(), mSeekInfo, and CommandContext::project.

Here is the call graph for this function:

◆ OnCursorPositionStore()

void SelectActions::Handler::OnCursorPositionStore ( const CommandContext context)
inline

Definition at line 615 of file SelectMenus.cpp.

616{
617 auto &project = context.project;
618 auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
619 auto isAudioActive = ProjectAudioIO::Get( project ).IsAudioActive();
620
621 auto gAudioIO = AudioIO::Get();
623 isAudioActive ? gAudioIO->GetStreamTime() : selectedRegion.t0();
625}
static AudioIO * Get()
Definition: AudioIO.cpp:147
bool IsAudioActive() const
static ProjectAudioIO & Get(AudacityProject &project)
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:219
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235

References AudioIO::Get(), ProjectAudioIO::Get(), ViewInfo::Get(), ProjectAudioIO::IsAudioActive(), mCursorPositionHasBeenStored, mCursorPositionStored, CommandContext::project, and ViewInfo::selectedRegion.

Here is the call graph for this function:

◆ OnCursorRight()

void SelectActions::Handler::OnCursorRight ( const CommandContext context)
inline

Definition at line 821 of file SelectMenus.cpp.

References anonymous_namespace{SelectMenus.cpp}::CURSOR_MOVE, anonymous_namespace{SelectMenus.cpp}::DIRECTION_RIGHT, mSeekInfo, anonymous_namespace{SelectMenus.cpp}::OnlyHandleKeyUp(), CommandContext::project, and anonymous_namespace{SelectMenus.cpp}::SeekLeftOrRight().

Here is the call graph for this function:

◆ OnCursorSelEnd()

void SelectActions::Handler::OnCursorSelEnd ( const CommandContext context)
inline

Definition at line 731 of file SelectMenus.cpp.

732{
733 auto &project = context.project;
734 auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
735 auto &window = ProjectWindow::Get( project );
736
737 selectedRegion.collapseToT1();
738 ProjectHistory::Get( project ).ModifyState(false);
739 window.ScrollIntoView(selectedRegion.t1());
740}
void ModifyState(bool bWantsAutoSave)
static ProjectHistory & Get(AudacityProject &project)
static ProjectWindow & Get(AudacityProject &project)

References ProjectHistory::Get(), ViewInfo::Get(), ProjectWindow::Get(), ProjectHistory::ModifyState(), CommandContext::project, and ViewInfo::selectedRegion.

Here is the call graph for this function:

◆ OnCursorSelStart()

void SelectActions::Handler::OnCursorSelStart ( const CommandContext context)
inline

Definition at line 720 of file SelectMenus.cpp.

721{
722 auto &project = context.project;
723 auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
724 auto &window = ProjectWindow::Get( project );
725
726 selectedRegion.collapseToT0();
727 ProjectHistory::Get( project ).ModifyState(false);
728 window.ScrollIntoView(selectedRegion.t0());
729}

References ProjectHistory::Get(), ViewInfo::Get(), ProjectWindow::Get(), ProjectHistory::ModifyState(), CommandContext::project, and ViewInfo::selectedRegion.

Here is the call graph for this function:

◆ OnCursorShortJumpLeft()

void SelectActions::Handler::OnCursorShortJumpLeft ( const CommandContext context)
inline

Definition at line 828 of file SelectMenus.cpp.

829{
830 DoCursorMove( context.project,
831 -mSeekInfo.mSeekShort, mSeekInfo.mLastSelectionAdjustment );
832}

References anonymous_namespace{SelectMenus.cpp}::DoCursorMove(), mSeekInfo, and CommandContext::project.

Here is the call graph for this function:

◆ OnCursorShortJumpRight()

void SelectActions::Handler::OnCursorShortJumpRight ( const CommandContext context)
inline

Definition at line 834 of file SelectMenus.cpp.

835{
836 DoCursorMove( context.project,
837 mSeekInfo.mSeekShort, mSeekInfo.mLastSelectionAdjustment );
838}

References anonymous_namespace{SelectMenus.cpp}::DoCursorMove(), mSeekInfo, and CommandContext::project.

Here is the call graph for this function:

◆ OnCursorTrackEnd()

void SelectActions::Handler::OnCursorTrackEnd ( const CommandContext context)
inline

Definition at line 768 of file SelectMenus.cpp.

769{
770 auto &project = context.project;
771 auto &tracks = TrackList::Get( project );
772 auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
773 auto &window = ProjectWindow::Get( project );
774
775 double kWayOverToLeft = std::numeric_limits<double>::lowest();
776
777 auto trackRange = tracks.Selected() + &Track::SupportsBasicEditing;
778 if (trackRange.empty())
779 // This should have been prevented by command manager
780 return;
781
782 // Range is surely nonempty now
783 auto maxEndOffset = trackRange.max( &Track::GetEndTime );
784
785 if( maxEndOffset <
786 (kWayOverToLeft * (1 - std::numeric_limits<double>::epsilon()) ))
787 return;
788
789 selectedRegion.setTimes(maxEndOffset, maxEndOffset);
790 ProjectHistory::Get( project ).ModifyState(false);
791 window.ScrollIntoView(selectedRegion.t1());
792}
virtual bool SupportsBasicEditing() const
Whether this track type implements cut-copy-paste; by default, true.
Definition: Track.cpp:1259
virtual double GetEndTime() const =0
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:487

References ProjectHistory::Get(), ViewInfo::Get(), TrackList::Get(), ProjectWindow::Get(), Track::GetEndTime(), ProjectHistory::ModifyState(), CommandContext::project, ViewInfo::selectedRegion, and Track::SupportsBasicEditing().

Here is the call graph for this function:

◆ OnCursorTrackStart()

void SelectActions::Handler::OnCursorTrackStart ( const CommandContext context)
inline

Definition at line 742 of file SelectMenus.cpp.

743{
744 auto &project = context.project;
745 auto &tracks = TrackList::Get( project );
746 auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
747 auto &window = ProjectWindow::Get( project );
748
749 double kWayOverToRight = std::numeric_limits<double>::max();
750
751 auto trackRange = tracks.Selected() + &Track::SupportsBasicEditing;
752 if (trackRange.empty())
753 // This should have been prevented by command manager
754 return;
755
756 // Range is surely nonempty now
757 auto minOffset = std::max( 0.0, trackRange.min( &Track::GetOffset ) );
758
759 if( minOffset >=
760 (kWayOverToRight * (1 - std::numeric_limits<double>::epsilon()) ))
761 return;
762
763 selectedRegion.setTimes(minOffset, minOffset);
764 ProjectHistory::Get( project ).ModifyState(false);
765 window.ScrollIntoView(selectedRegion.t0());
766}
virtual double GetOffset() const =0

References ProjectHistory::Get(), ViewInfo::Get(), TrackList::Get(), ProjectWindow::Get(), Track::GetOffset(), ProjectHistory::ModifyState(), CommandContext::project, ViewInfo::selectedRegion, and Track::SupportsBasicEditing().

Here is the call graph for this function:

◆ OnSeekLeftLong()

void SelectActions::Handler::OnSeekLeftLong ( const CommandContext context)
inline

Definition at line 864 of file SelectMenus.cpp.

865{
866 auto &project = context.project;
868}

References anonymous_namespace{SelectMenus.cpp}::DIRECTION_LEFT, mSeekInfo, CommandContext::project, anonymous_namespace{SelectMenus.cpp}::SeekLeftOrRight(), and anonymous_namespace{SelectMenus.cpp}::SELECTION_EXTEND.

Here is the call graph for this function:

◆ OnSeekLeftShort()

void SelectActions::Handler::OnSeekLeftShort ( const CommandContext context)
inline

Definition at line 852 of file SelectMenus.cpp.

853{
854 auto &project = context.project;
856}

References anonymous_namespace{SelectMenus.cpp}::CURSOR_MOVE, anonymous_namespace{SelectMenus.cpp}::DIRECTION_LEFT, mSeekInfo, CommandContext::project, and anonymous_namespace{SelectMenus.cpp}::SeekLeftOrRight().

Here is the call graph for this function:

◆ OnSeekRightLong()

void SelectActions::Handler::OnSeekRightLong ( const CommandContext context)
inline

Definition at line 870 of file SelectMenus.cpp.

871{
872 auto &project = context.project;
874}

References anonymous_namespace{SelectMenus.cpp}::DIRECTION_RIGHT, mSeekInfo, CommandContext::project, anonymous_namespace{SelectMenus.cpp}::SeekLeftOrRight(), and anonymous_namespace{SelectMenus.cpp}::SELECTION_EXTEND.

Here is the call graph for this function:

◆ OnSeekRightShort()

void SelectActions::Handler::OnSeekRightShort ( const CommandContext context)
inline

Definition at line 858 of file SelectMenus.cpp.

859{
860 auto &project = context.project;
862}

References anonymous_namespace{SelectMenus.cpp}::CURSOR_MOVE, anonymous_namespace{SelectMenus.cpp}::DIRECTION_RIGHT, mSeekInfo, CommandContext::project, and anonymous_namespace{SelectMenus.cpp}::SeekLeftOrRight().

Here is the call graph for this function:

◆ OnSelContractLeft()

void SelectActions::Handler::OnSelContractLeft ( const CommandContext context)
inline

Definition at line 706 of file SelectMenus.cpp.

References anonymous_namespace{SelectMenus.cpp}::DIRECTION_RIGHT, mSeekInfo, anonymous_namespace{SelectMenus.cpp}::OnlyHandleKeyUp(), CommandContext::project, anonymous_namespace{SelectMenus.cpp}::SeekLeftOrRight(), and anonymous_namespace{SelectMenus.cpp}::SELECTION_CONTRACT.

Here is the call graph for this function:

◆ OnSelContractRight()

void SelectActions::Handler::OnSelContractRight ( const CommandContext context)
inline

Definition at line 713 of file SelectMenus.cpp.

714{
715 if( !OnlyHandleKeyUp( context ) )
717 mSeekInfo );
718}

References anonymous_namespace{SelectMenus.cpp}::DIRECTION_LEFT, mSeekInfo, anonymous_namespace{SelectMenus.cpp}::OnlyHandleKeyUp(), CommandContext::project, anonymous_namespace{SelectMenus.cpp}::SeekLeftOrRight(), and anonymous_namespace{SelectMenus.cpp}::SELECTION_CONTRACT.

Here is the call graph for this function:

◆ OnSelectAll()

void SelectActions::Handler::OnSelectAll ( const CommandContext context)
inline

Definition at line 432 of file SelectMenus.cpp.

433{
434 auto& trackPanel = TrackPanel::Get(context.project);
435 auto& tracks = TrackList::Get(context.project);
436
437 for (auto lt : tracks.Selected< LabelTrack >()) {
438 auto& view = LabelTrackView::Get(*lt);
439 if (view.SelectAllText(context.project)) {
440 trackPanel.Refresh(false);
441 return;
442 }
443 }
444
445 //Presumably, there might be not more than one track
446 //that expects text input
447 for (auto wt : tracks.Any<WaveTrack>()) {
448 auto& view = WaveTrackView::Get(*wt);
449 if (view.SelectAllText(context.project)) {
450 trackPanel.Refresh(false);
451 return;
452 }
453 }
454
456}
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:87
static LabelTrackView & Get(LabelTrack &)
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:231
A Track that contains audio waveform data.
Definition: WaveTrack.h:51
static WaveTrackView & Get(WaveTrack &track)
void DoSelectAll(AudacityProject &project)

References SelectUtilities::DoSelectAll(), TrackList::Get(), TrackPanel::Get(), LabelTrackView::Get(), WaveTrackView::Get(), and CommandContext::project.

Here is the call graph for this function:

◆ OnSelectAllTime()

void SelectActions::Handler::OnSelectAllTime ( const CommandContext context)
inline

Definition at line 878 of file SelectMenus.cpp.

879{
880 auto &project = context.project;
881 SelectUtilities::DoSelectTimeAndTracks( project, true, false );
882}
void DoSelectTimeAndTracks(AudacityProject &project, bool bAllTime, bool bAllTracks)

References SelectUtilities::DoSelectTimeAndTracks(), and CommandContext::project.

Here is the call graph for this function:

◆ OnSelectAllTracks()

void SelectActions::Handler::OnSelectAllTracks ( const CommandContext context)
inline

Definition at line 468 of file SelectMenus.cpp.

469{
470 auto &project = context.project;
471 SelectUtilities::DoSelectTimeAndTracks( project, false, true );
472}

References SelectUtilities::DoSelectTimeAndTracks(), and CommandContext::project.

Here is the call graph for this function:

◆ OnSelectCursorEnd()

void SelectActions::Handler::OnSelectCursorEnd ( const CommandContext context)
inline

Definition at line 525 of file SelectMenus.cpp.

526{
527 auto &project = context.project;
528 auto &tracks = TrackList::Get( project );
529 auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
530
531 double kWayOverToLeft = std::numeric_limits<double>::lowest();
532
533 auto range = tracks.Selected();
534 if ( ! range )
535 return;
536
537 double maxEndOffset = range.max( &Track::GetEndTime );
538
539 if( maxEndOffset <=
540 (kWayOverToLeft * (1 - std::numeric_limits<double>::epsilon()) ))
541 return;
542
543 selectedRegion.setT1(maxEndOffset);
544
545 ProjectHistory::Get( project ).ModifyState(false);
546}

References ProjectHistory::Get(), ViewInfo::Get(), TrackList::Get(), Track::GetEndTime(), ProjectHistory::ModifyState(), CommandContext::project, and ViewInfo::selectedRegion.

Here is the call graph for this function:

◆ OnSelectCursorStoredCursor()

void SelectActions::Handler::OnSelectCursorStoredCursor ( const CommandContext context)
inline

Definition at line 596 of file SelectMenus.cpp.

597{
598 auto &project = context.project;
599 auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
600 auto isAudioActive = ProjectAudioIO::Get( project ).IsAudioActive();
601
603 auto gAudioIO = AudioIO::Get();
604 double cursorPositionCurrent = isAudioActive
605 ? gAudioIO->GetStreamTime()
606 : selectedRegion.t0();
607 selectedRegion.setTimes(
608 std::min(cursorPositionCurrent, mCursorPositionStored),
609 std::max(cursorPositionCurrent, mCursorPositionStored));
610
611 ProjectHistory::Get( project ).ModifyState(false);
612 }
613}
int min(int a, int b)

References AudioIO::Get(), ProjectAudioIO::Get(), ProjectHistory::Get(), ViewInfo::Get(), ProjectAudioIO::IsAudioActive(), mCursorPositionHasBeenStored, mCursorPositionStored, min(), ProjectHistory::ModifyState(), CommandContext::project, and ViewInfo::selectedRegion.

Here is the call graph for this function:

◆ OnSelectionRestore()

void SelectActions::Handler::OnSelectionRestore ( const CommandContext context)
inline

Definition at line 576 of file SelectMenus.cpp.

577{
578 auto &project = context.project;
579 auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
580 auto &window = ProjectWindow::Get(project);
581
582 if ((mRegionSave.t0() == 0.0) &&
583 (mRegionSave.t1() == 0.0))
584 return;
585
586 selectedRegion = mRegionSave;
587 window.ScrollIntoView(selectedRegion.t0());
588
589 ProjectHistory::Get( project ).ModifyState(false);
590}
double t1() const
double t0() const
SelectedRegion mRegionSave

References ProjectHistory::Get(), ViewInfo::Get(), ProjectWindow::Get(), ProjectHistory::ModifyState(), mRegionSave, CommandContext::project, ViewInfo::selectedRegion, SelectedRegion::t0(), and SelectedRegion::t1().

Here is the call graph for this function:

◆ OnSelectionSave()

void SelectActions::Handler::OnSelectionSave ( const CommandContext context)
inline

Definition at line 568 of file SelectMenus.cpp.

569{
570 auto &project = context.project;
571 auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
572
573 mRegionSave = selectedRegion;
574}

References ViewInfo::Get(), mRegionSave, CommandContext::project, and ViewInfo::selectedRegion.

Here is the call graph for this function:

◆ OnSelectNone()

void SelectActions::Handler::OnSelectNone ( const CommandContext context)
inline

Definition at line 458 of file SelectMenus.cpp.

459{
460 auto &project = context.project;
461 auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
462
463 selectedRegion.collapseToT0();
465 ProjectHistory::Get( project ).ModifyState(false);
466}
void SelectNone(AudacityProject &project)

References NotifyingSelectedRegion::collapseToT0(), ProjectHistory::Get(), ViewInfo::Get(), ProjectHistory::ModifyState(), CommandContext::project, ViewInfo::selectedRegion, and SelectUtilities::SelectNone().

Here is the call graph for this function:

◆ OnSelectStartCursor()

void SelectActions::Handler::OnSelectStartCursor ( const CommandContext context)
inline

Definition at line 502 of file SelectMenus.cpp.

503{
504 auto &project = context.project;
505 auto &tracks = TrackList::Get( project );
506 auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
507
508 double kWayOverToRight = std::numeric_limits<double>::max();
509
510 auto range = tracks.Selected();
511 if ( ! range )
512 return;
513
514 double minOffset = range.min( &Track::GetStartTime );
515
516 if( minOffset >=
517 (kWayOverToRight * (1 - std::numeric_limits<double>::epsilon()) ))
518 return;
519
520 selectedRegion.setT0(minOffset);
521
522 ProjectHistory::Get( project ).ModifyState(false);
523}
virtual double GetStartTime() const =0

References ProjectHistory::Get(), ViewInfo::Get(), TrackList::Get(), Track::GetStartTime(), ProjectHistory::ModifyState(), CommandContext::project, and ViewInfo::selectedRegion.

Here is the call graph for this function:

◆ OnSelectSyncLockSel()

void SelectActions::Handler::OnSelectSyncLockSel ( const CommandContext context)
inline

Definition at line 474 of file SelectMenus.cpp.

475{
476 auto &project = context.project;
477 auto &tracks = TrackList::Get( project );
478
479 bool selected = false;
480 for (auto t : tracks.Any() + &Track::SupportsBasicEditing
482 t->SetSelected(true);
483 selected = true;
484 }
485
486 if (selected)
487 ProjectHistory::Get( project ).ModifyState(false);
488}
static bool IsSyncLockSelected(const Track *pTrack)
Definition: SyncLock.cpp:82
bool IsSelected() const
Definition: Track.cpp:403

References ProjectHistory::Get(), TrackList::Get(), Track::IsSelected(), SyncLock::IsSyncLockSelected(), ProjectHistory::ModifyState(), CommandContext::project, and Track::SupportsBasicEditing().

Here is the call graph for this function:

◆ OnSelectTrackStartToEnd()

void SelectActions::Handler::OnSelectTrackStartToEnd ( const CommandContext context)
inline

Definition at line 548 of file SelectMenus.cpp.

549{
550 auto &project = context.project;
551 auto &viewInfo = ViewInfo::Get( project );
552 auto &tracks = TrackList::Get( project );
553
554 auto range = tracks.Selected();
555 double maxEndOffset = range.max( &Track::GetEndTime );
556 double minOffset = range.min( &Track::GetStartTime );
557
558 if( maxEndOffset < minOffset)
559 return;
560
561 viewInfo.selectedRegion.setTimes( minOffset, maxEndOffset );
562 ProjectHistory::Get( project ).ModifyState(false);
563}

References ProjectHistory::Get(), ViewInfo::Get(), TrackList::Get(), Track::GetEndTime(), Track::GetStartTime(), ProjectHistory::ModifyState(), and CommandContext::project.

Here is the call graph for this function:

◆ OnSelExtendLeft()

void SelectActions::Handler::OnSelExtendLeft ( const CommandContext context)
inline

Definition at line 682 of file SelectMenus.cpp.

683{
684 if( !OnlyHandleKeyUp( context ) )
686 mSeekInfo );
687}

References anonymous_namespace{SelectMenus.cpp}::DIRECTION_LEFT, mSeekInfo, anonymous_namespace{SelectMenus.cpp}::OnlyHandleKeyUp(), CommandContext::project, anonymous_namespace{SelectMenus.cpp}::SeekLeftOrRight(), and anonymous_namespace{SelectMenus.cpp}::SELECTION_EXTEND.

Here is the call graph for this function:

◆ OnSelExtendRight()

void SelectActions::Handler::OnSelExtendRight ( const CommandContext context)
inline

Definition at line 689 of file SelectMenus.cpp.

690{
691 if( !OnlyHandleKeyUp( context ) )
693 mSeekInfo );
694}

References anonymous_namespace{SelectMenus.cpp}::DIRECTION_RIGHT, mSeekInfo, anonymous_namespace{SelectMenus.cpp}::OnlyHandleKeyUp(), CommandContext::project, anonymous_namespace{SelectMenus.cpp}::SeekLeftOrRight(), and anonymous_namespace{SelectMenus.cpp}::SELECTION_EXTEND.

Here is the call graph for this function:

◆ OnSelSetExtendLeft()

void SelectActions::Handler::OnSelSetExtendLeft ( const CommandContext context)
inline

Definition at line 696 of file SelectMenus.cpp.

697{
699}
void DoBoundaryMove(AudacityProject &project, int step, SeekInfo &info)

References anonymous_namespace{SelectMenus.cpp}::DIRECTION_LEFT, anonymous_namespace{SelectMenus.cpp}::DoBoundaryMove(), mSeekInfo, and CommandContext::project.

Here is the call graph for this function:

◆ OnSelSetExtendRight()

void SelectActions::Handler::OnSelSetExtendRight ( const CommandContext context)
inline

Definition at line 701 of file SelectMenus.cpp.

702{
704}

References anonymous_namespace{SelectMenus.cpp}::DIRECTION_RIGHT, anonymous_namespace{SelectMenus.cpp}::DoBoundaryMove(), mSeekInfo, and CommandContext::project.

Here is the call graph for this function:

◆ OnSelToEnd()

void SelectActions::Handler::OnSelToEnd ( const CommandContext context)
inline

Definition at line 671 of file SelectMenus.cpp.

672{
673 auto &project = context.project;
674 auto &window = ProjectWindow::Get( project );
675 window.SkipEnd(true);
676 ProjectHistory::Get( project ).ModifyState(false);
677}

References ProjectHistory::Get(), ProjectWindow::Get(), ProjectHistory::ModifyState(), and CommandContext::project.

Here is the call graph for this function:

◆ OnSelToStart()

void SelectActions::Handler::OnSelToStart ( const CommandContext context)
inline

Definition at line 663 of file SelectMenus.cpp.

664{
665 auto &project = context.project;
666 auto &window = ProjectWindow::Get( project );
667 window.Rewind(true);
668 ProjectHistory::Get( project ).ModifyState(false);
669}

References ProjectHistory::Get(), ProjectWindow::Get(), ProjectHistory::ModifyState(), and CommandContext::project.

Here is the call graph for this function:

◆ OnSetLeftSelection()

void SelectActions::Handler::OnSetLeftSelection ( const CommandContext context)
inline

Definition at line 490 of file SelectMenus.cpp.

491{
493 true, true, XO("Set Left Selection Boundary"));
494}
XO("Cut/Copy/Paste")
void OnSetRegion(AudacityProject &project, bool left, bool selection, const TranslatableString &dialogTitle)
Adjust left or right of selection or play region.

References SelectUtilities::OnSetRegion(), CommandContext::project, and XO().

Here is the call graph for this function:

◆ OnSetRightSelection()

void SelectActions::Handler::OnSetRightSelection ( const CommandContext context)
inline

Definition at line 496 of file SelectMenus.cpp.

497{
499 false, true, XO("Set Right Selection Boundary"));
500}

References SelectUtilities::OnSetRegion(), CommandContext::project, and XO().

Here is the call graph for this function:

◆ OnSkipEnd()

void SelectActions::Handler::OnSkipEnd ( const CommandContext context)
inline

Definition at line 804 of file SelectMenus.cpp.

805{
806 auto &project = context.project;
807 wxCommandEvent evt;
808
809 auto &controlToolBar = ControlToolBar::Get( project );
810 controlToolBar.OnFF(evt);
811 ProjectHistory::Get( project ).ModifyState(false);
812}
static ControlToolBar & Get(AudacityProject &project)

References ProjectHistory::Get(), ControlToolBar::Get(), ProjectHistory::ModifyState(), and CommandContext::project.

Here is the call graph for this function:

◆ OnSkipStart()

void SelectActions::Handler::OnSkipStart ( const CommandContext context)
inline

Definition at line 794 of file SelectMenus.cpp.

795{
796 auto &project = context.project;
797 wxCommandEvent evt;
798
799 auto &controlToolBar = ControlToolBar::Get( project );
800 controlToolBar.OnRewind(evt);
801 ProjectHistory::Get( project ).ModifyState(false);
802}

References ProjectHistory::Get(), ControlToolBar::Get(), ProjectHistory::ModifyState(), and CommandContext::project.

Here is the call graph for this function:

◆ OnSnapToNearest()

void SelectActions::Handler::OnSnapToNearest ( const CommandContext context)
inline

Definition at line 651 of file SelectMenus.cpp.

652{
653 auto &project = context.project;
655}
@ SNAP_NEAREST
void AS_SetSnapTo(int snap) override
static ProjectSelectionManager & Get(AudacityProject &project)

References ProjectSelectionManager::AS_SetSnapTo(), ProjectSelectionManager::Get(), CommandContext::project, and SNAP_NEAREST.

Here is the call graph for this function:

◆ OnSnapToOff()

void SelectActions::Handler::OnSnapToOff ( const CommandContext context)
inline

Definition at line 645 of file SelectMenus.cpp.

646{
647 auto &project = context.project;
649}
@ SNAP_OFF

References ProjectSelectionManager::AS_SetSnapTo(), ProjectSelectionManager::Get(), CommandContext::project, and SNAP_OFF.

Here is the call graph for this function:

◆ OnSnapToPrior()

void SelectActions::Handler::OnSnapToPrior ( const CommandContext context)
inline

Definition at line 657 of file SelectMenus.cpp.

658{
659 auto &project = context.project;
661}
@ SNAP_PRIOR

References ProjectSelectionManager::AS_SetSnapTo(), ProjectSelectionManager::Get(), CommandContext::project, and SNAP_PRIOR.

Here is the call graph for this function:

◆ OnZeroCrossing()

void SelectActions::Handler::OnZeroCrossing ( const CommandContext context)
inline

Definition at line 627 of file SelectMenus.cpp.

628{
629 auto &project = context.project;
630 auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
631
632 const double t0 = NearestZeroCrossing(project, selectedRegion.t0());
633 if (selectedRegion.isPoint())
634 selectedRegion.setTimes(t0, t0);
635 else {
636 const double t1 = NearestZeroCrossing(project, selectedRegion.t1());
637 // Empty selection is generally not much use, so do not make it if empty.
638 if( fabs( t1 - t0 ) * ProjectRate::Get(project).GetRate() > 1.5 )
639 selectedRegion.setTimes(t0, t1);
640 }
641
642 ProjectHistory::Get( project ).ModifyState(false);
643}
static ProjectRate & Get(AudacityProject &project)
Definition: ProjectRate.cpp:28
double NearestZeroCrossing(AudacityProject &project, double t0)
Definition: SelectMenus.cpp:31
double GetRate(const Track &track)
Definition: TimeTrack.cpp:179

References ProjectHistory::Get(), ProjectRate::Get(), ViewInfo::Get(), anonymous_namespace{TimeTrack.cpp}::GetRate(), ProjectHistory::ModifyState(), anonymous_namespace{SelectMenus.cpp}::NearestZeroCrossing(), CommandContext::project, and ViewInfo::selectedRegion.

Here is the call graph for this function:

◆ operator=()

Handler & SelectActions::Handler::operator= ( const Handler )

◆ UpdatePrefs()

void SelectActions::Handler::UpdatePrefs ( )
inlineoverridevirtual

Implements PrefsListener.

Definition at line 885 of file SelectMenus.cpp.

886{
887 gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &mSeekInfo.mSeekShort, 1.0);
888 gPrefs->Read(wxT("/AudioIO/SeekLongPeriod"), &mSeekInfo.mSeekLong, 15.0);
889}
wxT("CloseDown"))
FileConfig * gPrefs
Definition: Prefs.cpp:70

References gPrefs, mSeekInfo, and wxT().

Referenced by Handler().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mCursorPositionHasBeenStored

bool SelectActions::Handler::mCursorPositionHasBeenStored { false }

Definition at line 593 of file SelectMenus.cpp.

Referenced by OnCursorPositionStore(), and OnSelectCursorStoredCursor().

◆ mCursorPositionStored

double SelectActions::Handler::mCursorPositionStored { 0.0 }

Definition at line 594 of file SelectMenus.cpp.

Referenced by OnCursorPositionStore(), and OnSelectCursorStoredCursor().

◆ mRegionSave

SelectedRegion SelectActions::Handler::mRegionSave {}

Definition at line 566 of file SelectMenus.cpp.

Referenced by OnSelectionRestore(), and OnSelectionSave().

◆ mSeekInfo

SeekInfo SelectActions::Handler::mSeekInfo

The documentation for this struct was generated from the following file: