Audacity 3.2.0
CutlineHandle.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5CutlineHandle.h
6
7Paul Licameli
8
9**********************************************************************/
10
11#ifndef __AUDACITY_CUTLINE_HANDLE__
12#define __AUDACITY_CUTLINE_HANDLE__
13
14#include "../../../../UIHandle.h"
15#include "../../../../WaveTrackLocation.h"
16
17class wxMouseEvent;
18class wxMouseState;
19class WaveTrack;
20
21class CutlineHandle final : public UIHandle
22{
23 CutlineHandle(const CutlineHandle&) = delete;
24 static HitTestPreview HitPreview(bool cutline, bool unsafe);
25
26public:
27 explicit CutlineHandle
28 ( const std::shared_ptr<WaveTrack> &pTrack,
29 WaveTrackLocation location );
30
32
34 (const AudacityProject *pProject, bool cutline, UIHandlePtr ptr);
35 static UIHandlePtr HitTest
36 (std::weak_ptr<CutlineHandle> &holder,
37 const wxMouseState &state, const wxRect &rect,
38 const AudacityProject *pProject,
39 const std::shared_ptr<WaveTrack> &pTrack);
40
41 virtual ~CutlineHandle();
42
44 std::shared_ptr<WaveTrack> GetTrack() { return mpTrack; }
45
46 void Enter(bool forward, AudacityProject *) override;
47
48 bool HandlesRightClick() override;
49
51 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
52
54 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
55
57 (const TrackPanelMouseState &state, AudacityProject *pProject)
58 override;
59
61 (const TrackPanelMouseEvent &event, AudacityProject *pProject,
62 wxWindow *pParent) override;
63
64 Result Cancel(AudacityProject *pProject) override;
65
66 bool StopsOnKeystroke() override { return true; }
67
68private:
69 std::shared_ptr<WaveTrack> mpTrack{};
72 double mStartTime{}, mEndTime{};
74};
75
76#endif
std::shared_ptr< UIHandle > UIHandlePtr
Definition: CellularPanel.h:28
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
const WaveTrackLocation & GetLocation()
Definition: CutlineHandle.h:43
Operation mOperation
Definition: CutlineHandle.h:71
bool StopsOnKeystroke() override
Definition: CutlineHandle.h:66
CutlineHandle(const CutlineHandle &)=delete
static HitTestPreview HitPreview(bool cutline, bool unsafe)
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
static UIHandlePtr HitAnywhere(const AudacityProject *pProject, bool cutline, UIHandlePtr ptr)
WaveTrackLocation mLocation
Definition: CutlineHandle.h:73
CutlineHandle & operator=(const CutlineHandle &)=default
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
std::shared_ptr< WaveTrack > mpTrack
Definition: CutlineHandle.h:69
std::shared_ptr< WaveTrack > GetTrack()
Definition: CutlineHandle.h:44
virtual ~CutlineHandle()
double mStartTime
Definition: CutlineHandle.h:72
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
void Enter(bool forward, AudacityProject *) override
static UIHandlePtr HitTest(std::weak_ptr< CutlineHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< WaveTrack > &pTrack)
bool HandlesRightClick() override
Whether the handle has any special right-button handling.
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Result Cancel(AudacityProject *pProject) override
Short-lived drawing and event-handling object associated with a TrackPanelCell.
Definition: UIHandle.h:35
unsigned Result
Definition: UIHandle.h:38
A Track that contains audio waveform data.
Definition: WaveTrack.h:57