Audacity 3.2.0
AffordanceHandle.h
Go to the documentation of this file.
1/*!********************************************************************
2*
3 Audacity: A Digital Audio Editor
4
5 AffordanceHandle.h
6
7 Vitaly Sverchinsky
8
9 **********************************************************************/
10
11#pragma once
12
13#include "TimeShiftHandle.h"
14
15class AUDACITY_DLL_API AffordanceHandle : public TimeShiftHandle
16{
17 constexpr static double MoveThreshold { 5.0 };
18
19 static HitTestPreview HitPreview(const AudacityProject*, bool unsafe, bool moving);
20
21 bool mMoving { false };
22 wxPoint mClickPosition { };
23public:
24
25 void Enter(bool forward, AudacityProject* pProject) override;
26 HitTestPreview Preview(const TrackPanelMouseState& mouseState, AudacityProject* pProject) override;
27
28 AffordanceHandle(const std::shared_ptr<Track>& track);
29
30 Result Click(const TrackPanelMouseEvent& evt, AudacityProject* pProject) override;
31 Result Drag(const TrackPanelMouseEvent& event, AudacityProject* pProject) override;
32 Result Release(const TrackPanelMouseEvent& event, AudacityProject* pProject, wxWindow* pParent) override;
33
34protected:
35 virtual Result SelectAt(const TrackPanelMouseEvent& event, AudacityProject* pProject) = 0;
36
37private:
38 Result UpdateTrackSelection(
39 const TrackPanelMouseEvent& event, AudacityProject* pProject);
40};
virtual Result SelectAt(const TrackPanelMouseEvent &event, AudacityProject *pProject)=0
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static HitTestPreview HitPreview(const AudacityProject *pProject, bool unsafe)
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
void Enter(bool forward, AudacityProject *) override
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
unsigned Result
Definition: UIHandle.h:40