Audacity 3.2.0
Public Member Functions | Private Member Functions | List of all members
AdornedRulerPanel::MovePlayRegionHandle Class Referencefinal
Inheritance diagram for AdornedRulerPanel::MovePlayRegionHandle:
[legend]
Collaboration diagram for AdornedRulerPanel::MovePlayRegionHandle:
[legend]

Public Member Functions

 MovePlayRegionHandle (AdornedRulerPanel *pParent, wxCoord xx)
 
 ~MovePlayRegionHandle ()
 
- Public Member Functions inherited from AdornedRulerPanel::PlayRegionAdjustingHandle
 PlayRegionAdjustingHandle (AdornedRulerPanel *pParent, wxCoord xx, MenuChoice menuChoice, wxCursor *cursor, size_t numGuides=1)
 
 PlayRegionAdjustingHandle (AdornedRulerPanel *pParent, wxCoord xx, MenuChoice menuChoice, wxCursor cursor, size_t numGuides=1)
 
void SetCursor (wxCursor cursor)
 
HitTestPreview Preview (const TrackPanelMouseState &state, AudacityProject *pProject) override
 
Result Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 
Result Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
 
Result Cancel (AudacityProject *pProject) override
 
bool HasEscape (AudacityProject *pProject) const override
 
bool Escape (AudacityProject *pProject) override
 
- Public Member Functions inherited from AdornedRulerPanel::CommonRulerHandle
 CommonRulerHandle (AdornedRulerPanel *pParent, wxCoord xx, MenuChoice menuChoice)
 
std::shared_ptr< const TrackFindTrack () const override
 
bool Clicked () const
 
- Public Member Functions inherited from UIHandle
virtual ~UIHandle ()=0
 
virtual void Enter (bool forward, AudacityProject *pProject)
 
virtual bool HasRotation () const
 
virtual bool Rotate (bool forward)
 
virtual bool HasEscape (AudacityProject *pProject) const
 
virtual bool Escape (AudacityProject *pProject)
 
virtual bool HandlesRightClick ()
 Whether the handle has any special right-button handling. More...
 
virtual Result Click (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0
 
virtual Result Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0
 
virtual HitTestPreview Preview (const TrackPanelMouseState &state, AudacityProject *pProject)=0
 
virtual Result Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)=0
 
virtual Result Cancel (AudacityProject *pProject)=0
 
virtual bool StopsOnKeystroke ()
 
virtual void OnProjectChange (AudacityProject *pProject)
 
virtual std::shared_ptr< const TrackFindTrack () const =0
 
virtual bool IsDragging () const
 
Result GetChangeHighlight () const
 
void SetChangeHighlight (Result val)
 
- Public Member Functions inherited from TrackPanelDrawable
virtual ~TrackPanelDrawable ()=0
 
virtual void Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
 
virtual wxRect DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass)
 

Private Member Functions

void DoStartAdjust (AudacityProject &project, double) override
 
void DoAdjust (AudacityProject &project) override
 

Additional Inherited Members

- Public Types inherited from UIHandle
using Result = unsigned
 
using Cell = TrackPanelCell
 
- Static Public Member Functions inherited from AdornedRulerPanel::CommonRulerHandle
static UIHandle::Result NeedChangeHighlight (const CommonRulerHandle &oldState, const CommonRulerHandle &newState)
 
- Static Public Member Functions inherited from UIHandle
static UIHandle::Result NeedChangeHighlight (const UIHandle &, const UIHandle &)
 
static std::shared_ptr< const TrackTrackFromChannel (const std::shared_ptr< const Channel > &pChannel)
 A frequent convenience in the definition of UIHandles. More...
 
- Static Public Member Functions inherited from TrackPanelDrawable
static wxRect MaximizeWidth (const wxRect &rect, const wxRect &panelRect)
 
static wxRect MaximizeHeight (const wxRect &rect, const wxRect &panelRect)
 
- Protected Types inherited from AdornedRulerPanel::CommonRulerHandle
enum class  Button { None , Left , Right }
 
- Protected Member Functions inherited from AdornedRulerPanel::PlayRegionAdjustingHandle
double SnappedTime (AudacityProject &project, size_t ii)
 
std::pair< double, double > SnappedTimes (AudacityProject &project)
 
void Unsnap (bool use, AudacityProject *pProject)
 
virtual void DoStartAdjust (AudacityProject &, double)=0
 
virtual void DoAdjust (AudacityProject &)=0
 
void SavePlayRegion (AudacityProject &project)
 
- Protected Member Functions inherited from AdornedRulerPanel::CommonRulerHandle
bool HandlesRightClick () override
 Whether the handle has any special right-button handling. More...
 
Result Click (const TrackPanelMouseEvent &event, AudacityProject *) override
 
Result Drag (const TrackPanelMouseEvent &, AudacityProject *) override
 
Result Release (const TrackPanelMouseEvent &event, AudacityProject *, wxWindow *) override
 
double Time (AudacityProject &project) const
 
void StartPlay (AudacityProject &project, const wxMouseEvent &event)
 
Result Cancel (AudacityProject *) override
 
void Enter (bool, AudacityProject *) override
 
- Protected Attributes inherited from AdornedRulerPanel::CommonRulerHandle
wxWeakRef< AdornedRulerPanelmParent
 
wxCoord mX
 
wxCoord mClickedX
 
MenuChoice mChoice
 
Button mClicked { Button::None }
 
- Protected Attributes inherited from UIHandle
Result mChangeHighlight { 0 }
 

Detailed Description

Definition at line 800 of file AdornedRulerPanel.cpp.

Constructor & Destructor Documentation

◆ MovePlayRegionHandle()

AdornedRulerPanel::MovePlayRegionHandle::MovePlayRegionHandle ( AdornedRulerPanel pParent,
wxCoord  xx 
)
inline

Definition at line 802 of file AdornedRulerPanel.cpp.

804 {
805 if (!handOpenCursor) {
806 handOpenCursor = MakeCursor(wxCURSOR_HAND, RearrangeCursorXpm, 16, 16);
808 }
809 }
static std::unique_ptr< wxCursor > handOpenCursor
std::unique_ptr< wxCursor > MakeCursor(int WXUNUSED(CursorId), const char *const pXpm[36], int HotX, int HotY)
Definition: TrackPanel.cpp:189
PlayRegionAdjustingHandle(AdornedRulerPanel *pParent, wxCoord xx, MenuChoice menuChoice, wxCursor *cursor, size_t numGuides=1)

References handOpenCursor, MakeCursor(), and AdornedRulerPanel::PlayRegionAdjustingHandle::SetCursor().

Here is the call graph for this function:

◆ ~MovePlayRegionHandle()

AdornedRulerPanel::MovePlayRegionHandle::~MovePlayRegionHandle ( )
inline

Definition at line 811 of file AdornedRulerPanel.cpp.

812 {
813 mParent->mQuickPlayOffset[0] = 0;
814 mParent->mQuickPlayOffset[1] = 0;
815 }
wxWeakRef< AdornedRulerPanel > mParent

References AdornedRulerPanel::CommonRulerHandle::mParent.

Member Function Documentation

◆ DoAdjust()

void AdornedRulerPanel::MovePlayRegionHandle::DoAdjust ( AudacityProject project)
inlineoverrideprivatevirtual

Implements AdornedRulerPanel::PlayRegionAdjustingHandle.

Definition at line 827 of file AdornedRulerPanel.cpp.

828 {
829 // Move the whole play region rigidly (usually)
830 // though the length might change slightly if only one edge snaps
831 const auto times = SnappedTimes(project);
832
833 auto &playRegion = ViewInfo::Get(project).playRegion;
834 playRegion.SetTimes(times.first, times.second);
835 }
const auto project
std::pair< double, double > SnappedTimes(AudacityProject &project)
void SetTimes(double start, double end)
Definition: ViewInfo.cpp:181
PlayRegion playRegion
Definition: ViewInfo.h:217
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235

References ViewInfo::Get(), ViewInfo::playRegion, project, PlayRegion::SetTimes(), and AdornedRulerPanel::PlayRegionAdjustingHandle::SnappedTimes().

Here is the call graph for this function:

◆ DoStartAdjust()

void AdornedRulerPanel::MovePlayRegionHandle::DoStartAdjust ( AudacityProject project,
double   
)
inlineoverrideprivatevirtual

Implements AdornedRulerPanel::PlayRegionAdjustingHandle.

Definition at line 818 of file AdornedRulerPanel.cpp.

819 {
820 // Ignore the snapping of the time at the mouse
821 const auto time = Time(project);
822 auto &playRegion = ViewInfo::Get(project).playRegion;
823 mParent->mQuickPlayOffset[0] = playRegion.GetStart() - time;
824 mParent->mQuickPlayOffset[1] = playRegion.GetEnd() - time;
825 }
double Time(AudacityProject &project) const

References ViewInfo::Get(), AdornedRulerPanel::CommonRulerHandle::mParent, ViewInfo::playRegion, project, and AdornedRulerPanel::CommonRulerHandle::Time().

Here is the call graph for this function:

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