Audacity  3.0.3
CutlineHandle.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3 Audacity: A Digital Audio Editor
4 
5 CutlineHandle.h
6 
7 Paul Licameli
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_CUTLINE_HANDLE__
12 #define __AUDACITY_CUTLINE_HANDLE__
13 
14 #include "../../../../UIHandle.h"
15 #include "../../../../WaveTrackLocation.h"
16 
17 class wxMouseEvent;
18 class wxMouseState;
19 class WaveTrack;
20 
21 class CutlineHandle final : public UIHandle
22 {
23  CutlineHandle(const CutlineHandle&) = delete;
24  static HitTestPreview HitPreview(bool cutline, bool unsafe);
25 
26 public:
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 
53  Result Drag
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 
68 private:
69  std::shared_ptr<WaveTrack> mpTrack{};
72  double mStartTime{}, mEndTime{};
74 };
75 
76 #endif
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:70
CutlineHandle
Definition: CutlineHandle.h:22
CutlineHandle::operator=
CutlineHandle & operator=(const CutlineHandle &)=default
CutlineHandle::Merge
@ Merge
Definition: CutlineHandle.h:70
CutlineHandle::Enter
void Enter(bool forward, AudacityProject *) override
Definition: CutlineHandle.cpp:32
WaveTrackLocation
Definition: WaveTrackLocation.h:14
CutlineHandle::Operation
Operation
Definition: CutlineHandle.h:70
CutlineHandle::mStartTime
double mStartTime
Definition: CutlineHandle.h:72
CutlineHandle::mEndTime
double mEndTime
Definition: CutlineHandle.h:72
CutlineHandle::mOperation
Operation mOperation
Definition: CutlineHandle.h:71
UIHandle
Short-lived drawing and event-handling object associated with a TrackPanelCell.
Definition: UIHandle.h:35
CutlineHandle::Remove
@ Remove
Definition: CutlineHandle.h:70
CutlineHandle::Drag
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: CutlineHandle.cpp:206
CutlineHandle::GetTrack
std::shared_ptr< WaveTrack > GetTrack()
Definition: CutlineHandle.h:44
UIHandle::Result
unsigned Result
Definition: UIHandle.h:38
CutlineHandle::~CutlineHandle
virtual ~CutlineHandle()
Definition: CutlineHandle.cpp:115
UIHandlePtr
std::shared_ptr< UIHandle > UIHandlePtr
Definition: CellularPanel.h:28
CutlineHandle::StopsOnKeystroke
bool StopsOnKeystroke() override
Definition: CutlineHandle.h:66
HitTestPreview
Definition: HitTestResult.h:20
CutlineHandle::HitAnywhere
static UIHandlePtr HitAnywhere(const AudacityProject *pProject, bool cutline, UIHandlePtr ptr)
CutlineHandle::HitPreview
static HitTestPreview HitPreview(bool cutline, bool unsafe)
Definition: CutlineHandle.cpp:39
CutlineHandle::GetLocation
const WaveTrackLocation & GetLocation()
Definition: CutlineHandle.h:43
CutlineHandle::mpTrack
std::shared_ptr< WaveTrack > mpTrack
Definition: CutlineHandle.h:69
CutlineHandle::mLocation
WaveTrackLocation mLocation
Definition: CutlineHandle.h:73
CutlineHandle::Preview
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Definition: CutlineHandle.cpp:212
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
CutlineHandle::Cancel
Result Cancel(AudacityProject *pProject) override
Definition: CutlineHandle.cpp:246
TrackPanelMouseEvent
Definition: TrackPanelMouseEvent.h:46
TrackPanelMouseState
Definition: TrackPanelMouseEvent.h:28
CutlineHandle::Release
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
Definition: CutlineHandle.cpp:220
CutlineHandle::HitTest
static UIHandlePtr HitTest(std::weak_ptr< CutlineHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< WaveTrack > &pTrack)
Definition: CutlineHandle.cpp:97
CutlineHandle::HandlesRightClick
bool HandlesRightClick() override
Whether the handle has any special right-button handling.
Definition: CutlineHandle.cpp:119
CutlineHandle::CutlineHandle
CutlineHandle(const CutlineHandle &)=delete
CutlineHandle::Expand
@ Expand
Definition: CutlineHandle.h:70
CutlineHandle::Click
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: CutlineHandle.cpp:125