mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-25 00:30:07 +02:00
Consistent vert/horizontal waveform zoom/scroll
Shift+Wheel -> scroll Ctrl+Wheel -> zoom Ctrl+Shift+Wheel -> Waveform dB end range adjust (when visible).
This commit is contained in:
parent
6089c94971
commit
256a8aaedd
@ -5578,7 +5578,7 @@ void TrackPanel::HandleWheelRotation(wxMouseEvent & event)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Special case of pointer in the vertical ruler
|
// Special case of pointer in the vertical ruler
|
||||||
{
|
if (event.ShiftDown() || event.CmdDown()) {
|
||||||
wxRect rect;
|
wxRect rect;
|
||||||
Track *const pTrack = FindTrack(event.m_x, event.m_y, true, false, &rect);
|
Track *const pTrack = FindTrack(event.m_x, event.m_y, true, false, &rect);
|
||||||
if (pTrack && event.m_x >= GetVRulerOffset()) {
|
if (pTrack && event.m_x >= GetVRulerOffset()) {
|
||||||
@ -5682,15 +5682,13 @@ void TrackPanel::HandleWheelRotationInVRuler
|
|||||||
const bool isDB =
|
const bool isDB =
|
||||||
wt->GetDisplay() == WaveTrack::Waveform &&
|
wt->GetDisplay() == WaveTrack::Waveform &&
|
||||||
wt->GetWaveformSettings().scaleType == WaveformSettings::stLogarithmic;
|
wt->GetWaveformSettings().scaleType == WaveformSettings::stLogarithmic;
|
||||||
if (isDB && event.ShiftDown()) {
|
|
||||||
// Special cases for Waveform dB only
|
|
||||||
|
|
||||||
// Vary the bottom of the dB scale, but only if the midline is visible
|
// Special cases for Waveform dB only.
|
||||||
|
// Set the bottom of the dB scale but only if it's visible
|
||||||
|
if (isDB && event.ShiftDown() && event.CmdDown()) {
|
||||||
float min, max;
|
float min, max;
|
||||||
wt->GetDisplayBounds(&min, &max);
|
wt->GetDisplayBounds(&min, &max);
|
||||||
if (!(min < 0.0 && max > 0.0))
|
if (min < 0.0 && max > 0.0) {
|
||||||
return;
|
|
||||||
|
|
||||||
WaveformSettings &settings = wt->GetIndependentWaveformSettings();
|
WaveformSettings &settings = wt->GetIndependentWaveformSettings();
|
||||||
float olddBRange = settings.dBRange;
|
float olddBRange = settings.dBRange;
|
||||||
if (steps < 0)
|
if (steps < 0)
|
||||||
@ -5708,10 +5706,6 @@ void TrackPanel::HandleWheelRotationInVRuler
|
|||||||
else
|
else
|
||||||
settings.NextHigherDBRange();
|
settings.NextHigherDBRange();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!event.CmdDown()) {
|
|
||||||
// extra-special case that varies the db limit without changing
|
|
||||||
// magnification
|
|
||||||
const float extreme = (LINEAR_TO_DB(2) + newdBRange) / newdBRange;
|
const float extreme = (LINEAR_TO_DB(2) + newdBRange) / newdBRange;
|
||||||
max = std::min(extreme, max * olddBRange / newdBRange);
|
max = std::min(extreme, max * olddBRange / newdBRange);
|
||||||
min = std::max(-extreme, min * olddBRange / newdBRange);
|
min = std::max(-extreme, min * olddBRange / newdBRange);
|
||||||
@ -5729,7 +5723,7 @@ void TrackPanel::HandleWheelRotationInVRuler
|
|||||||
wt, false, (steps < 0),
|
wt, false, (steps < 0),
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
else if (!(event.CmdDown() || event.ShiftDown())) {
|
else if (!event.CmdDown() && event.ShiftDown()) {
|
||||||
// Scroll some fixed number of pixels, independent of zoom level or track height:
|
// Scroll some fixed number of pixels, independent of zoom level or track height:
|
||||||
static const float movement = 10.0f;
|
static const float movement = 10.0f;
|
||||||
const int height = wt->GetHeight() - (kTopMargin + kBottomMargin);
|
const int height = wt->GetHeight() - (kTopMargin + kBottomMargin);
|
||||||
|
@ -154,9 +154,9 @@ void MousePrefs::CreateList()
|
|||||||
// AddItem(_("ESC"), _("Select"), _("Toggle center snapping in spectrogram"), _("same as select tool"));
|
// AddItem(_("ESC"), _("Select"), _("Toggle center snapping in spectrogram"), _("same as select tool"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AddItem(_("Wheel-Rotate"), _("Any"), _("Scroll up or down"));
|
AddItem(_("Shift-Wheel-Rotate"),_("Any"), _("Scroll waveform"));
|
||||||
AddItem(_("Shift-Wheel-Rotate"),_("Any"), _("Scroll left or right"));
|
AddItem(CTRL + _("-Wheel-Rotate"), _("Any"), _("Zoom waveform in or out"));
|
||||||
AddItem(CTRL + _("-Wheel-Rotate"), _("Any"), _("Zoom in or out on Mouse Pointer"));
|
AddItem(CTRL + _("Shift-Wheel-Rotate"),_("Any"), _("Waveform (dB) range"));
|
||||||
|
|
||||||
mList->SetColumnWidth(BlankColumn, 0);
|
mList->SetColumnWidth(BlankColumn, 0);
|
||||||
mList->SetColumnWidth(ToolColumn, wxLIST_AUTOSIZE);
|
mList->SetColumnWidth(ToolColumn, wxLIST_AUTOSIZE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user