Audacity 3.2.0
WaveTrackControls.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5WavelTrackControls.h
6
7Paul Licameli split from TrackPanel.cpp
8
9**********************************************************************/
10
11#ifndef __AUDACITY_WAVE_TRACK_CONTROLS__
12#define __AUDACITY_WAVE_TRACK_CONTROLS__
13
14#include "../../ui/PlayableTrackControls.h" // to inherit
15#include "Observer.h"
16
17class CellularPanel;
18class LWSlider;
23class PanSliderHandle;
24class WaveTrack;
25class wxEvent;
26class wxWindow;
27
28class AUDACITY_DLL_API WaveTrackControls final : public PlayableTrackControls
29{
32
33public:
34 explicit
35 WaveTrackControls( std::shared_ptr<Track> pTrack )
36 : PlayableTrackControls( pTrack ) {}
38
39 std::vector<UIHandlePtr> HitTest
40 (const TrackPanelMouseState &state,
41 const AudacityProject *pProject) override;
42
43 PopupMenuTable *GetMenuExtension(Track *pTrack) override;
44
45 const TCPLines& GetTCPLines() const override;
46
47 static unsigned DefaultWaveTrackHeight();
48 static void GetGainRect(const wxPoint & topLeft, wxRect &dest);
49 static void GetPanRect(const wxPoint & topLeft, wxRect &dest);
50
51 static LWSlider *GainSlider( CellularPanel &panel, const WaveTrack &wt );
52 static LWSlider * GainSlider
53 (const wxRect &sliderRect, const WaveTrack *t, bool captured,
54 wxWindow *pParent);
55
56 static LWSlider *PanSlider( CellularPanel &panel, const WaveTrack &wt );
57 static LWSlider * PanSlider
58 (const wxRect &sliderRect, const WaveTrack *t, bool captured,
59 wxWindow *pParent);
60
61 static void ReCreateSliders();
62
63private:
64 static void ReCreatePanSlider(struct ThemeChangeMessage);
65 static void ReCreateGainSlider(struct ThemeChangeMessage);
66
67 std::weak_ptr<MuteButtonHandle> mMuteHandle;
68 std::weak_ptr<SoloButtonHandle> mSoloHandle;
69 std::weak_ptr<EffectsButtonHandle> mEffectsHandle;
70 std::weak_ptr<GainSliderHandle> mGainHandle;
71 std::weak_ptr<PanSliderHandle> mPanHandle;
72};
73
74#include "../../../../widgets/PopupMenuTable.h"
75
76struct AUDACITY_DLL_API WaveTrackPopupMenuTable : public PopupMenuTable
77{
80 WaveTrack &FindWaveTrack () const;
81 int ReserveId() { return mNextId++; }
82protected:
83 int mNextId = 0;
84};
85
86// Expose the wave track menu table to registration of menu items
87AUDACITY_DLL_API
89
90#endif
TrackInfo::TCPLines TCPLines
Definition: TrackInfo.cpp:102
AUDACITY_DLL_API WaveTrackPopupMenuTable & GetWaveTrackMenuTable()
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
Formerly part of TrackPanel, this abstract base class has no special knowledge of Track objects and i...
Definition: CellularPanel.h:34
virtual std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *) override=0
virtual const TCPLines & GetTCPLines() const
Definition: TrackInfo.cpp:191
virtual PopupMenuTable * GetMenuExtension(Track *pTrack)=0
Lightweight version of ASlider. In other words it does not have a window permanently associated with ...
Definition: ASlider.h:62
PopupMenuTable(const Identifier &id, const TranslatableString &caption={})
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:225
std::weak_ptr< MuteButtonHandle > mMuteHandle
WaveTrackControls(std::shared_ptr< Track > pTrack)
std::weak_ptr< PanSliderHandle > mPanHandle
static void ReCreateSliders()
WaveTrackControls & operator=(const WaveTrackControls &)=delete
std::weak_ptr< EffectsButtonHandle > mEffectsHandle
std::weak_ptr< GainSliderHandle > mGainHandle
WaveTrackControls(const WaveTrackControls &)=delete
std::weak_ptr< SoloButtonHandle > mSoloHandle
A Track that contains audio waveform data.
Definition: WaveTrack.h:57