14#include "../../../../RefreshCode.h"
15#include "../../../ui/CommonTrackInfo.h"
16#include "../../../../TrackPanel.h"
22(
SliderFn sliderFn,
const wxRect &rect,
23 const std::shared_ptr<Track> &pTrack )
33 return std::static_pointer_cast<NoteTrack>(
mpTrack.lock());
51 pTrack->SetVelocity(newValue);
74 value = pTrack->GetVelocity();
87 return XO(
"%s: %s").Format(
XO(
"Velocity"), val);
91(std::weak_ptr<VelocitySliderHandle> &holder,
92 const wxMouseState &state,
const wxRect &rect,
93 const std::shared_ptr<Track> &pTrack)
95 if (!state.ButtonIsDown(wxMOUSE_BTN_LEFT))
102 if (sliderRect.Contains(state.m_x, state.m_y)) {
106 (sliderRect,
static_cast<NoteTrack*
>( pTrack ),
true,
109 auto result = std::make_shared<VelocitySliderHandle>(
110 sliderFn, sliderRect, pTrack );
std::shared_ptr< UIHandle > UIHandlePtr
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
@ kTrackInfoSliderAllowance
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
static LWSlider * VelocitySlider(const wxRect &sliderRect, const NoteTrack *t, bool captured, wxWindow *pParent)
static void GetVelocityRect(const wxRect &rect, wxRect &dest)
A Track that is used for Midi notes. (Somewhat old code).
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
static ProjectHistory & Get(AudacityProject &project)
LWSlider *(*)(AudacityProject *, const wxRect &, Track *) SliderFn
std::weak_ptr< Track > mpTrack
Abstract base class for an object holding data associated with points on a time axis.
static TrackPanel & Get(AudacityProject &project)
Holds a msgid for the translation catalog; may also bind format arguments.
TranslatableString & Format(Args &&...args) &
Capture variadic format arguments (by copy) when there is no plural.
std::shared_ptr< NoteTrack > GetNoteTrack() const
TranslatableString Tip(const wxMouseState &state, AudacityProject &) const override
Result SetValue(AudacityProject *pProject, float newValue) override
Result CommitChanges(const wxMouseEvent &event, AudacityProject *pProject) override
VelocitySliderHandle(const VelocitySliderHandle &)=delete
virtual ~VelocitySliderHandle()
static UIHandlePtr HitTest(std::weak_ptr< VelocitySliderHandle > &holder, const wxMouseState &state, const wxRect &rect, const std::shared_ptr< Track > &pTrack)
float GetValue() override
AUDACITY_DLL_API bool HideTopItem(const wxRect &rect, const wxRect &subRect, int allowance=0)