Audacity 3.2.0
PlayableTrackButtonHandles.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5PlayableTrackButtonHandles.h
6
7Paul Licameli split from TrackPanel.cpp
8
9**********************************************************************/
10
11#ifndef __AUDACITY_PLAYABLE_TRACK_BUTTON_HANDLES__
12#define __AUDACITY_PLAYABLE_TRACK_BUTTON_HANDLES__
13
14#include "../../ui/ButtonHandle.h"
15class wxMouseState;
16
17class AUDACITY_DLL_API MuteButtonHandle final : public ButtonHandle
18{
20
21public:
22 explicit MuteButtonHandle
23 ( const std::shared_ptr<Track> &pTrack, const wxRect &rect );
24
26
27 virtual ~MuteButtonHandle();
28
29protected:
31 (const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)
32 override;
33
35 const wxMouseState &state, AudacityProject &) const override;
36
37 bool StopsOnKeystroke () override { return true; }
38
39public:
40 static UIHandlePtr HitTest
41 (std::weak_ptr<MuteButtonHandle> &holder,
42 const wxMouseState &state, const wxRect &rect,
43 const AudacityProject *pProject, const std::shared_ptr<Track> &pTrack);
44};
45
47
48class AUDACITY_DLL_API SoloButtonHandle final : public ButtonHandle
49{
51
52public:
53 explicit SoloButtonHandle
54 ( const std::shared_ptr<Track> &pTrack, const wxRect &rect );
55
57
58 virtual ~SoloButtonHandle();
59
60protected:
62 (const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)
63 override;
64
66 const wxMouseState &state, AudacityProject &) const override;
67
68 bool StopsOnKeystroke () override { return true; }
69
70public:
71 static UIHandlePtr HitTest
72 (std::weak_ptr<SoloButtonHandle> &holder,
73 const wxMouseState &state, const wxRect &rect,
74 const AudacityProject *pProject, const std::shared_ptr<Track> &pTrack);
75};
76
78
80{
82
83public:
84 explicit EffectsButtonHandle
85 ( const std::shared_ptr<Track> &pTrack, const wxRect &rect );
86
88
89 virtual ~EffectsButtonHandle();
90
91protected:
93 (const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)
94 override;
95
97 const wxMouseState &state, AudacityProject &) const override;
98
99 bool StopsOnKeystroke () override { return true; }
100
101public:
102 static UIHandlePtr HitTest
103 (std::weak_ptr<EffectsButtonHandle> &holder,
104 const wxMouseState &state, const wxRect &rect,
105 const AudacityProject *pProject, const std::shared_ptr<Track> &pTrack);
106};
107
108#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:90
A UIHandle for a TrackPanel button, such as the Mute and Solo buttons.
Definition: ButtonHandle.h:26
virtual Result CommitChanges(const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)=0
virtual TranslatableString Tip(const wxMouseState &state, AudacityProject &project) const =0
TranslatableString Tip(const wxMouseState &state, AudacityProject &) const override
static UIHandlePtr HitTest(std::weak_ptr< EffectsButtonHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< Track > &pTrack)
Result CommitChanges(const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
EffectsButtonHandle & operator=(const EffectsButtonHandle &)=default
EffectsButtonHandle(const EffectsButtonHandle &)=delete
MuteButtonHandle & operator=(const MuteButtonHandle &)=default
bool StopsOnKeystroke() override
MuteButtonHandle(const MuteButtonHandle &)=delete
SoloButtonHandle(const SoloButtonHandle &)=delete
SoloButtonHandle & operator=(const SoloButtonHandle &)=default
bool StopsOnKeystroke() override
Holds a msgid for the translation catalog; may also bind format arguments.
unsigned Result
Definition: UIHandle.h:40
bool HitTest(const RectangleArgs &args, const wxPoint &mousePos)