1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-11 15:16:27 +01:00

Use a dedicated velocity slider for note tracks

This gets rid of the offset rectangle hack that was needed to re-use gain
sliders for note track velocities.  It also removes the need for changing
the style of a single slider.  Perhaps most importantly, it fixes link
errors regarding GainSlider(int).

See https://sourceforge.net/p/audacity/mailman/message/35752524/ for
details on why this change is needed and what caused it.
This commit is contained in:
Pokechu22
2017-02-21 18:05:35 -08:00
committed by Paul Licameli
parent 1f0e01b8ca
commit 59d740ad77
3 changed files with 173 additions and 120 deletions

View File

@@ -92,10 +92,10 @@ private:
void DrawTitleBar(wxDC * dc, const wxRect & rect, Track * t, bool down) const;
void DrawMuteSolo(wxDC * dc, const wxRect & rect, Track * t, bool down, bool solo, bool bHasSoloButton) const;
void DrawVRuler(wxDC * dc, const wxRect & rect, Track * t) const;
#ifdef EXPERIMENTAL_MIDI_OUT
void DrawVelocitySlider(wxDC * dc, NoteTrack *t, wxRect rect) const ;
#endif
void DrawSliders(wxDC * dc, WaveTrack *t, wxRect rect, bool captured) const;
#ifdef EXPERIMENTAL_MIDI_OUT
void DrawVelocitySlider(wxDC * dc, NoteTrack *t, wxRect rect, bool captured) const;
#endif
// Draw the minimize button *and* the sync-lock track icon, if necessary.
void DrawMinimize(wxDC * dc, const wxRect & rect, Track * t, bool down) const;
@@ -103,9 +103,13 @@ private:
void GetTrackControlsRect(const wxRect & rect, wxRect &dest) const;
void GetCloseBoxRect(const wxRect & rect, wxRect &dest) const;
void GetTitleBarRect(const wxRect & rect, wxRect &dest) const;
void GetMuteSoloRect(const wxRect & rect, wxRect &dest, bool solo, bool bHasSoloButton) const;
void GetMuteSoloRect(const wxRect & rect, wxRect &dest, bool solo, bool bHasSoloButton,
const Track *pTrack) const;
void GetGainRect(const wxRect & rect, wxRect &dest) const;
void GetPanRect(const wxRect & rect, wxRect &dest) const;
#ifdef EXPERIMENTAL_MIDI_OUT
void GetVelocityRect(const wxRect & rect, wxRect &dest) const;
#endif
void GetMinimizeRect(const wxRect & rect, wxRect &dest) const;
void GetSyncLockIconRect(const wxRect & rect, wxRect &dest) const;
@@ -114,7 +118,7 @@ public:
LWSlider * PanSlider(WaveTrack *t, bool captured = false) const;
#ifdef EXPERIMENTAL_MIDI_OUT
LWSlider *GainSlider(int index) const;
LWSlider * VelocitySlider(NoteTrack *t, bool captured = false) const;
#endif
private:
@@ -124,6 +128,9 @@ private:
wxFont mFont;
std::unique_ptr<LWSlider>
mGainCaptured, mPanCaptured, mGain, mPan;
#ifdef EXPERIMENTAL_MIDI_OUT
std::unique_ptr<LWSlider> mVelocityCaptured, mVelocity;
#endif
friend class TrackPanel;
};
@@ -415,6 +422,9 @@ protected:
virtual void HandleMutingSoloing(wxMouseEvent & event, bool solo);
virtual void HandleMinimizing(wxMouseEvent & event);
virtual void HandleSliders(wxMouseEvent &event, bool pan);
#ifdef EXPERIMENTAL_MIDI_OUT
virtual void HandleVelocitySlider(wxMouseEvent &event);
#endif
// These *Func methods are used in TrackPanel::HandleLabelClick to set up
@@ -434,6 +444,10 @@ protected:
int x, int y);
virtual bool PanFunc(Track * t, wxRect rect, wxMouseEvent &event,
int x, int y);
#ifdef EXPERIMENTAL_MIDI_OUT
virtual bool VelocityFunc(Track * t, wxRect rect, wxMouseEvent &event,
int x, int y);
#endif
virtual void MakeParentRedrawScrollbars();
@@ -747,6 +761,9 @@ protected:
IsStretching,
#endif
IsZooming,
#ifdef EXPERIMENTAL_MIDI_OUT
IsVelocitySliding,
#endif
};