#include <WaveTrackSliderHandles.h>
|
| PanSliderHandle (SliderFn sliderFn, const wxRect &rect, const std::shared_ptr< Track > &pTrack) |
|
PanSliderHandle & | operator= (const PanSliderHandle &)=default |
|
virtual | ~PanSliderHandle () |
|
Public Member Functions inherited from SliderHandle |
| SliderHandle (SliderFn sliderFn, const wxRect &rect, const std::shared_ptr< Track > &pTrack) |
|
SliderHandle & | operator= (const SliderHandle &)=default |
|
std::shared_ptr< const Track > | FindTrack () const override |
|
std::shared_ptr< Track > | GetTrack () const |
|
bool | IsDragging () const override |
|
Public Member Functions inherited from UIHandle |
virtual | ~UIHandle ()=0 |
|
virtual void | Enter (bool forward, AudacityProject *pProject) |
|
virtual bool | HasRotation () const |
|
virtual bool | Rotate (bool forward) |
|
virtual bool | HasEscape (AudacityProject *pProject) const |
|
virtual bool | Escape (AudacityProject *pProject) |
|
virtual bool | HandlesRightClick () |
| Whether the handle has any special right-button handling. More...
|
|
virtual Result | Click (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0 |
|
virtual Result | Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0 |
|
virtual HitTestPreview | Preview (const TrackPanelMouseState &state, AudacityProject *pProject)=0 |
|
virtual Result | Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)=0 |
|
virtual Result | Cancel (AudacityProject *pProject)=0 |
|
virtual bool | StopsOnKeystroke () |
|
virtual void | OnProjectChange (AudacityProject *pProject) |
|
virtual std::shared_ptr< const Track > | FindTrack () const =0 |
|
virtual bool | IsDragging () const |
|
Result | GetChangeHighlight () const |
|
void | SetChangeHighlight (Result val) |
|
virtual | ~TrackPanelDrawable ()=0 |
|
virtual void | Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) |
|
virtual wxRect | DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass) |
|
|
float | GetValue () override |
|
Result | SetValue (AudacityProject *pProject, float newValue) override |
|
Result | CommitChanges (const wxMouseEvent &event, AudacityProject *pProject) override |
|
TranslatableString | Tip (const wxMouseState &state, AudacityProject &) const override |
|
bool | StopsOnKeystroke () override |
|
Protected Member Functions inherited from SliderHandle |
virtual | ~SliderHandle () |
|
virtual float | GetValue ()=0 |
|
virtual Result | SetValue (AudacityProject *pProject, float newValue)=0 |
|
virtual Result | CommitChanges (const wxMouseEvent &event, AudacityProject *pProject)=0 |
|
virtual TranslatableString | Tip (const wxMouseState &state, AudacityProject &project) const =0 |
|
void | Enter (bool forward, AudacityProject *) override |
|
Result | Click (const TrackPanelMouseEvent &event, AudacityProject *pProject) final override |
|
Result | Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) final override |
|
HitTestPreview | Preview (const TrackPanelMouseState &state, AudacityProject *pProject) final override |
|
Result | Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) final override |
|
Result | Cancel (AudacityProject *pProject) final override |
|
LWSlider * | GetSlider (AudacityProject *pProject) |
|
Definition at line 55 of file WaveTrackSliderHandles.h.
◆ PanSliderHandle() [1/2]
◆ PanSliderHandle() [2/2]
PanSliderHandle::PanSliderHandle |
( |
SliderFn |
sliderFn, |
|
|
const wxRect & |
rect, |
|
|
const std::shared_ptr< Track > & |
pTrack |
|
) |
| |
|
explicit |
◆ ~PanSliderHandle()
PanSliderHandle::~PanSliderHandle |
( |
| ) |
|
|
virtual |
◆ CommitChanges()
◆ GetValue()
float PanSliderHandle::GetValue |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ GetWaveTrack()
std::shared_ptr< WaveTrack > PanSliderHandle::GetWaveTrack |
( |
| ) |
const |
|
private |
◆ HitTest()
UIHandlePtr PanSliderHandle::HitTest |
( |
std::weak_ptr< PanSliderHandle > & |
holder, |
|
|
const wxMouseState & |
state, |
|
|
const wxRect & |
rect, |
|
|
const std::shared_ptr< Track > & |
pTrack |
|
) |
| |
|
static |
Definition at line 193 of file WaveTrackSliderHandles.cpp.
197{
198 if (!state.ButtonIsDown(wxMOUSE_BTN_LEFT))
199 return {};
200
201 wxRect sliderRect;
204 return {};
205 if (sliderRect.Contains(state.m_x, state.m_y)) {
206 auto sliderFn =
209 (sliderRect,
static_cast<WaveTrack*
>( pTrack ),
true,
211 };
212 auto result = std::make_shared<PanSliderHandle>(
213 sliderFn, sliderRect, pTrack );
215
216 return result;
217 }
218 else
219 return {};
220}
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Abstract base class for an object holding data associated with points on a time axis.
static TrackPanel & Get(AudacityProject &project)
static void GetPanRect(const wxRect &rect, wxRect &dest)
static LWSlider * PanSlider(CellularPanel &panel, const WaveTrack &wt)
A Track that contains audio waveform data.
AUDACITY_DLL_API bool HideTopItem(const wxRect &rect, const wxRect &subRect, int allowance=0)
References AssignUIHandlePtr(), TrackPanel::Get(), WaveTrackControls::GetPanRect(), CommonTrackInfo::HideTopItem(), and WaveTrackControls::PanSlider().
Referenced by WaveTrackControls::HitTest().
◆ operator=()
◆ SetValue()
◆ StopsOnKeystroke()
bool PanSliderHandle::StopsOnKeystroke |
( |
| ) |
|
|
inlineoverrideprotectedvirtual |
◆ Tip()
Implements SliderHandle.
Definition at line 161 of file WaveTrackSliderHandles.cpp.
163{
165 float value = 0.0;
166
168 if (pTrack)
169 value = pTrack->GetPan();
170
171
172
173
174 if (value == 0.0)
175 {
177 }
178 else
179 {
180 const auto v = 100.0f * fabsf(value);
181 if (value < 0.0)
182
183 val =
XO(
"%.0f%% Left").Format(v);
184 else
185
186 val =
XO(
"%.0f%% Right").Format(v);
187 }
188
189
190 return XO(
"%s: %s").Format(
XO(
"Pan"), val);
191}
Holds a msgid for the translation catalog; may also bind format arguments.
References GetWaveTrack(), and XO().
The documentation for this class was generated from the following files: