Audacity 3.2.0
TrackSelectHandle.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5TrackSelectHandle.h
6
7Paul Licameli split from TrackPanel.cpp
8
9**********************************************************************/
10
11#ifndef __AUDACITY_TRACK_SELECT_HANDLE__
12#define __AUDACITY_TRACK_SELECT_HANDLE__
13
14#include "../../UIHandle.h"
15
16class wxMouseEvent;
17class Track;
18
19class TrackSelectHandle final : public UIHandle
20{
22
23public:
24 explicit TrackSelectHandle( const std::shared_ptr<Track> &pTrack );
25
27
29 (std::weak_ptr<TrackSelectHandle> &holder,
30 const std::shared_ptr<Track> &pTrack);
31
32 virtual ~TrackSelectHandle();
33
34 std::shared_ptr<const Track> FindTrack() const override;
35
37 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
38
40 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
41
43 (const TrackPanelMouseState &state, AudacityProject *pProject)
44 override;
45
47 (const TrackPanelMouseEvent &event, AudacityProject *pProject,
48 wxWindow *pParent) override;
49
50 Result Cancel(AudacityProject *) override;
51
52 bool StopsOnKeystroke() override { return true; }
53
54private:
55 std::shared_ptr<Track> mpTrack;
56 bool mClicked{};
57
58 // JH: if the user is dragging a track, at what y
59 // coordinate should the dragging track move up or down?
63
65 const wxMouseEvent & event, AudacityProject *project);
66};
67
68#endif
std::shared_ptr< UIHandle > UIHandlePtr
Definition: CellularPanel.h:28
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:110
std::shared_ptr< const Track > FindTrack() const override
static UIHandlePtr HitAnywhere(std::weak_ptr< TrackSelectHandle > &holder, const std::shared_ptr< Track > &pTrack)
std::shared_ptr< Track > mpTrack
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
void CalculateRearrangingThresholds(const wxMouseEvent &event, AudacityProject *project)
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
bool StopsOnKeystroke() override
Result Cancel(AudacityProject *) override
TrackSelectHandle(const TrackSelectHandle &)=delete
TrackSelectHandle & operator=(const TrackSelectHandle &)=default
Short-lived drawing and event-handling object associated with a TrackPanelCell.
Definition: UIHandle.h:37
unsigned Result
Definition: UIHandle.h:40