Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
WaveTrackAffordanceHandle Class Referencefinal

Implements some features which are specific to Wave Clips. More...

#include <WaveTrackAffordanceHandle.h>

Inheritance diagram for WaveTrackAffordanceHandle:
[legend]
Collaboration diagram for WaveTrackAffordanceHandle:
[legend]

Public Member Functions

 WaveTrackAffordanceHandle (const std::shared_ptr< Track > &track, const std::shared_ptr< WaveClip > &target)
 
Result Click (const TrackPanelMouseEvent &event, AudacityProject *project) override
 
UIHandle::Result SelectAt (const TrackPanelMouseEvent &event, AudacityProject *project) override
 
- Public Member Functions inherited from AffordanceHandle
void Enter (bool forward, AudacityProject *pProject) override
 
HitTestPreview Preview (const TrackPanelMouseState &mouseState, AudacityProject *pProject) override
 
 AffordanceHandle (const std::shared_ptr< Track > &track)
 
Result Click (const TrackPanelMouseEvent &evt, AudacityProject *pProject) override
 
Result Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
 
- Public Member Functions inherited from TimeShiftHandle
 TimeShiftHandle (const std::shared_ptr< Track > &pTrack, bool gripHit)
 
TimeShiftHandleoperator= (TimeShiftHandle &&)=default
 
bool IsGripHit () const
 
virtual ~TimeShiftHandle ()
 
void Enter (bool forward, AudacityProject *) override
 
Result Click (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 
Result Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 
HitTestPreview Preview (const TrackPanelMouseState &state, AudacityProject *pProject) override
 
Result Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
 
Result Cancel (AudacityProject *pProject) override
 
bool StopsOnKeystroke () 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)
 
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 Attributes

std::shared_ptr< WaveClipmTarget
 

Additional Inherited Members

- Public Types inherited from UIHandle
using Result = unsigned
 
using Cell = TrackPanelCell
 
- Static Public Member Functions inherited from TimeShiftHandle
static bool DoSlideVertical (ViewInfo &viewInfo, wxCoord xx, ClipMoveState &state, TrackList &trackList, Track &dstTrack, double &desiredSlideAmount)
 
static UIHandlePtr HitAnywhere (std::weak_ptr< TimeShiftHandle > &holder, const std::shared_ptr< Track > &pTrack, bool gripHit)
 
static UIHandlePtr HitTest (std::weak_ptr< TimeShiftHandle > &holder, const wxMouseState &state, const wxRect &rect, const std::shared_ptr< Track > &pTrack)
 
- 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)
 
virtual Result SelectAt (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0
 
- Protected Member Functions inherited from TimeShiftHandle
std::shared_ptr< TrackGetTrack () const
 
bool WasMoved () const
 
- Protected Attributes inherited from UIHandle
Result mChangeHighlight { 0 }
 

Detailed Description

Implements some features which are specific to Wave Clips.

Definition at line 18 of file WaveTrackAffordanceHandle.h.

Constructor & Destructor Documentation

◆ WaveTrackAffordanceHandle()

WaveTrackAffordanceHandle::WaveTrackAffordanceHandle ( const std::shared_ptr< Track > &  track,
const std::shared_ptr< WaveClip > &  target 
)

Definition at line 23 of file WaveTrackAffordanceHandle.cpp.

24 : AffordanceHandle(track), mTarget(target)
25{ }
AffordanceHandle(const std::shared_ptr< Track > &track)
std::shared_ptr< WaveClip > mTarget

Member Function Documentation

◆ Click()

UIHandle::Result WaveTrackAffordanceHandle::Click ( const TrackPanelMouseEvent event,
AudacityProject project 
)
overridevirtual

Implements UIHandle.

Definition at line 27 of file WaveTrackAffordanceHandle.cpp.

28{
31 {
32 auto affordanceControl = std::dynamic_pointer_cast<WaveTrackAffordanceControls>(event.pCell);
33
34 if (affordanceControl)
35 {
36 result |= affordanceControl->OnAffordanceClick(event, project);
37 if (!event.event.GetSkipped())//event is "consumed"
38 return result | RefreshCode::Cancelled;
39 event.event.Skip(false);
40 }
41 }
42 return result | AffordanceHandle::Click(event, project);
43}
Result Click(const TrackPanelMouseEvent &evt, AudacityProject *pProject) override
unsigned Result
Definition: UIHandle.h:38
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235
static bool ClipDetailsVisible(const WaveClip &clip, const ZoomInfo &zoomInfo, const wxRect &viewRect)
std::shared_ptr< TrackPanelCell > pCell

References RefreshCode::Cancelled, AffordanceHandle::Click(), WaveTrackView::ClipDetailsVisible(), TrackPanelMouseEvent::event, ViewInfo::Get(), mTarget, TrackPanelMouseEvent::pCell, TrackPanelMouseEvent::rect, and RefreshCode::RefreshNone.

Here is the call graph for this function:

◆ SelectAt()

UIHandle::Result WaveTrackAffordanceHandle::SelectAt ( const TrackPanelMouseEvent event,
AudacityProject project 
)
overridevirtual

Implements AffordanceHandle.

Definition at line 45 of file WaveTrackAffordanceHandle.cpp.

46{
47 auto& viewInfo = ViewInfo::Get(*project);
48 viewInfo.selectedRegion.setTimes(mTarget->GetPlayStartTime(), mTarget->GetPlayEndTime());
49
50 ProjectHistory::Get(*project).ModifyState(false);
51
53}
void ModifyState(bool bWantsAutoSave)
static ProjectHistory & Get(AudacityProject &project)

References RefreshCode::Cancelled, ProjectHistory::Get(), ViewInfo::Get(), ProjectHistory::ModifyState(), mTarget, and RefreshCode::RefreshAll.

Here is the call graph for this function:

Member Data Documentation

◆ mTarget

std::shared_ptr<WaveClip> WaveTrackAffordanceHandle::mTarget
private

Definition at line 20 of file WaveTrackAffordanceHandle.h.

Referenced by Click(), and SelectAt().


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