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

Public Member Functions

 ResizePlayRegionHandle (AdornedRulerPanel *pParent, wxCoord xx, bool hitLeft)
 
- 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 ChannelFindChannel () 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 ChannelFindChannel () 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 time) override
 
void DoAdjust (AudacityProject &project) override
 

Private Attributes

bool mHitLeft = false
 

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 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 838 of file AdornedRulerPanel.cpp.

Constructor & Destructor Documentation

◆ ResizePlayRegionHandle()

AdornedRulerPanel::ResizePlayRegionHandle::ResizePlayRegionHandle ( AdornedRulerPanel pParent,
wxCoord  xx,
bool  hitLeft 
)
inline

Definition at line 840 of file AdornedRulerPanel.cpp.

842 : PlayRegionAdjustingHandle( pParent, xx, MenuChoice::QuickPlay, {wxCURSOR_SIZEWE} )
843 , mHitLeft{ hitLeft }
844 {
845 }
PlayRegionAdjustingHandle(AdornedRulerPanel *pParent, wxCoord xx, MenuChoice menuChoice, wxCursor *cursor, size_t numGuides=1)

Member Function Documentation

◆ DoAdjust()

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

Implements AdornedRulerPanel::PlayRegionAdjustingHandle.

Definition at line 852 of file AdornedRulerPanel.cpp.

853 {
854 const auto time = SnappedTime(project, 0);
855
856 // Change the play region
857 // The check whether this new time should be start or end isn't
858 // important. The accessors for PlayRegion use min and max of stored
859 // values.
860 auto &playRegion = ViewInfo::Get(project).playRegion;
861 if (mHitLeft)
862 playRegion.SetStart(time);
863 else
864 playRegion.SetEnd(time);
865 }
const auto project
double SnappedTime(AudacityProject &project, size_t ii)
void SetStart(double start)
Definition: ViewInfo.cpp:161
PlayRegion playRegion
Definition: ViewInfo.h:216
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235

References ViewInfo::Get(), mHitLeft, ViewInfo::playRegion, project, PlayRegion::SetStart(), and AdornedRulerPanel::PlayRegionAdjustingHandle::SnappedTime().

Here is the call graph for this function:

◆ DoStartAdjust()

void AdornedRulerPanel::ResizePlayRegionHandle::DoStartAdjust ( AudacityProject project,
double  time 
)
inlineoverrideprivatevirtual

Implements AdornedRulerPanel::PlayRegionAdjustingHandle.

Definition at line 848 of file AdornedRulerPanel.cpp.

849 {
850 }

Member Data Documentation

◆ mHitLeft

bool AdornedRulerPanel::ResizePlayRegionHandle::mHitLeft = false
private

Definition at line 867 of file AdornedRulerPanel.cpp.

Referenced by DoAdjust().


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