Audacity 3.2.0
WaveTrackSliderHandles.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5WavelTrackSliderHandles.h
6
7Paul Licameli split from TrackPanel.cpp
8
9**********************************************************************/
10
11#ifndef __AUDACITY_WAVE_TRACK_SLIDER_HANDLES__
12#define __AUDACITY_WAVE_TRACK_SLIDER_HANDLES__
13
14#include "../../../ui/SliderHandle.h"
15
16class wxMouseState;
17class WaveTrack;
18
19class VolumeSliderHandle final : public SliderHandle
20{
22
23 std::shared_ptr<WaveTrack> GetWaveTrack() const;
24
25public:
26 explicit VolumeSliderHandle
27 ( SliderFn sliderFn, const wxRect &rect,
28 const std::shared_ptr<Track> &pTrack );
29
31
32 virtual ~VolumeSliderHandle();
33
34protected:
35 float GetValue() override;
37 (AudacityProject *pProject, float newValue) override;
39 (const wxMouseEvent &event, AudacityProject *pProject) override;
40
42 const wxMouseState &state, AudacityProject &) const override;
43
44 bool StopsOnKeystroke () override { return true; }
45
46public:
47 static UIHandlePtr HitTest
48 (std::weak_ptr<VolumeSliderHandle> &holder,
49 const wxMouseState &state, const wxRect &rect,
50 const std::shared_ptr<Track> &pTrack);
51};
52
54
55class PanSliderHandle final : public SliderHandle
56{
58
59 std::shared_ptr<WaveTrack> GetWaveTrack() const;
60
61public:
62 explicit PanSliderHandle
63 ( SliderFn sliderFn, const wxRect &rect,
64 const std::shared_ptr<Track> &pTrack );
65
67
68 virtual ~PanSliderHandle();
69
70protected:
71 float GetValue() override;
72 Result SetValue(AudacityProject *pProject, float newValue) override;
74 (const wxMouseEvent &event, AudacityProject *pProject) override;
75
77 const wxMouseState &state, AudacityProject &) const override;
78
79 bool StopsOnKeystroke () override { return true; }
80
81public:
82 static UIHandlePtr HitTest
83 (std::weak_ptr<PanSliderHandle> &holder,
84 const wxMouseState &state, const wxRect &rect,
85 const std::shared_ptr<Track> &pTrack);
86};
87
88#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
std::shared_ptr< WaveTrack > GetWaveTrack() const
bool StopsOnKeystroke() override
PanSliderHandle(const PanSliderHandle &)=delete
float GetValue() override
PanSliderHandle & operator=(const PanSliderHandle &)=default
Result CommitChanges(const wxMouseEvent &event, AudacityProject *pProject) override
TranslatableString Tip(const wxMouseState &state, AudacityProject &) const override
Result SetValue(AudacityProject *pProject, float newValue) override
static UIHandlePtr HitTest(std::weak_ptr< PanSliderHandle > &holder, const wxMouseState &state, const wxRect &rect, const std::shared_ptr< Track > &pTrack)
LWSlider *(*)(AudacityProject *, const wxRect &, Track *) SliderFn
Definition: SliderHandle.h:27
Holds a msgid for the translation catalog; may also bind format arguments.
unsigned Result
Definition: UIHandle.h:40
Result SetValue(AudacityProject *pProject, float newValue) override
VolumeSliderHandle(const VolumeSliderHandle &)=delete
VolumeSliderHandle & operator=(const VolumeSliderHandle &)=default
std::shared_ptr< WaveTrack > GetWaveTrack() const
bool StopsOnKeystroke() override
static UIHandlePtr HitTest(std::weak_ptr< VolumeSliderHandle > &holder, const wxMouseState &state, const wxRect &rect, const std::shared_ptr< Track > &pTrack)
TranslatableString Tip(const wxMouseState &state, AudacityProject &) const override
Result CommitChanges(const wxMouseEvent &event, AudacityProject *pProject) override
A Track that contains audio waveform data.
Definition: WaveTrack.h:203