1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-08 04:32:00 +01:00

VZooming Changes

1: Guard zone 8 pixels wide in VRuler to reduce risk of accidental use.
2: VerticalZooming preference, for VRuler zooming, off by default,
3: Enabled Paul's right-click menu in VRuler with some extra
presets (x2 and x0.5)
4: Rearranged some messy code with lots of ifs to use a switch.

Also, with EXPERIMENTAL_HALF_WAVE defined we now get a
'half wave' option in the VRuler menu, that shows the wave top half.
We also use it in collapsed waves (and collapsing and restoring
a WaveTrack will get you back to normal zoom.
This commit is contained in:
James Crook
2017-12-11 18:41:48 +00:00
parent 8a1f5bb748
commit 13c6fdf663
11 changed files with 355 additions and 145 deletions

View File

@@ -61,6 +61,10 @@ Track classes.
#include "Experimental.h"
#include "TrackPanel.h" // for TrackInfo
// Assumptions in objects separation were wrong. We need to activate
// VZooming (that lives in WaveTrackVRulerHandle) from an action on the
// TCP collapse/expand. So we need visibility here.
#include "tracks/playabletrack/wavetrack/ui/WaveTrackVRulerControls.h"
using std::max;
@@ -540,6 +544,22 @@ float WaveTrack::GetChannelGain(int channel) const
return right*mGain;
}
void WaveTrack::SetMinimized(bool isMinimized){
#ifdef EXPERIMENTAL_HALF_WAVE
// Show half wave on collapse, full on restore.
std::shared_ptr<TrackVRulerControls> pTvc = GetVRulerControls();
// An awkward workaround for a function that lives 'in the wrong place'.
// We use magic numbers, 0 and 1, to tell it to zoom reset or zoom half-wave.
WaveTrackVRulerControls * pWtvc = reinterpret_cast<WaveTrackVRulerControls*>(pTvc.get());
if( pWtvc )
pWtvc->DoZoomPreset( isMinimized ? 1:0);
#endif
Track::SetMinimized( isMinimized );
}
void WaveTrack::SetWaveColorIndex(int colorIndex)
// STRONG-GUARANTEE
{