1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-01 16:19:43 +02:00

Bug 1860 - Enh: Add preference to disable half-wave view on collapse.

This commit is contained in:
James Crook 2018-03-27 14:40:15 +01:00
parent 886388e02c
commit 2db691dc67
2 changed files with 17 additions and 7 deletions

View File

@ -456,14 +456,19 @@ float WaveTrack::GetChannelGain(int channel) const
void WaveTrack::DoSetMinimized(bool isMinimized){
#ifdef EXPERIMENTAL_HALF_WAVE
// Show half wave on collapse, full on restore.
std::shared_ptr<TrackVRulerControls> pTvc = GetVRulerControls();
bool bHalfWave;
gPrefs->Read(wxT("/GUI/CollapseToHalfWave"), &bHalfWave, false);
if( bHalfWave )
{
// 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);
// 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
PlayableTrack::DoSetMinimized( isMinimized );

View File

@ -265,6 +265,11 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S)
S.TieCheckBox(_("Sho&w audio track name as overlay"),
wxT("/GUI/ShowTrackNameInWaveform"),
false);
#ifdef EXPERIMENTAL_HALF_WAVE
S.TieCheckBox(_("Use &half-wave display when collapsed"),
wxT("/GUI/CollapseToHalfWave"),
false);
#endif
S.AddSpace(10);