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 
49  (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
50 
51  Result Drag
52  (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
53 
55  (const TrackPanelMouseState &state, AudacityProject *pProject)
56  override;
57 
59  (const TrackPanelMouseEvent &event, AudacityProject *pProject,
60  wxWindow *pParent) override;
61 
62  Result Cancel(AudacityProject *pProject) override;
63 
64  bool StopsOnKeystroke() override { return true; }
65 
66 private:
67  std::shared_ptr<WaveTrack> mpTrack{};
70  double mStartTime{}, mEndTime{};
72 };
73 
74 #endif
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:68
CutlineHandle
Definition: CutlineHandle.h:22
CutlineHandle::operator=
CutlineHandle & operator=(const CutlineHandle &)=default
CutlineHandle::Merge
@ Merge
Definition: CutlineHandle.h:68
CutlineHandle::Enter
void Enter(bool forward, AudacityProject *) override
Definition: CutlineHandle.cpp:32
WaveTrackLocation
Definition: WaveTrackLocation.h:14
CutlineHandle::Operation
Operation
Definition: CutlineHandle.h:68
CutlineHandle::mStartTime
double mStartTime
Definition: CutlineHandle.h:70
CutlineHandle::mEndTime
double mEndTime
Definition: CutlineHandle.h:70
CutlineHandle::mOperation
Operation mOperation
Definition: CutlineHandle.h:69
UIHandle
Short-lived drawing and event-handling object associated with a TrackPanelCell.
Definition: UIHandle.h:34
CutlineHandle::Remove
@ Remove
Definition: CutlineHandle.h:68
CutlineHandle::Drag
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: CutlineHandle.cpp:201
CutlineHandle::GetTrack
std::shared_ptr< WaveTrack > GetTrack()
Definition: CutlineHandle.h:44
UIHandle::Result
unsigned Result
Definition: UIHandle.h:37
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:64
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:67
CutlineHandle::mLocation
WaveTrackLocation mLocation
Definition: CutlineHandle.h:71
CutlineHandle::Preview
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Definition: CutlineHandle.cpp:207
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:112
CutlineHandle::Cancel
Result Cancel(AudacityProject *pProject) override
Definition: CutlineHandle.cpp:241
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:215
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::CutlineHandle
CutlineHandle(const CutlineHandle &)=delete
CutlineHandle::Expand
@ Expand
Definition: CutlineHandle.h:68
CutlineHandle::Click
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: CutlineHandle.cpp:120