Skip to content
Permalink
Browse files
Bug 1860 - Enh: Add preference to disable half-wave view on collapse.
  • Loading branch information
JamesCrook committed Mar 27, 2018
1 parent 886388e commit 2db691dc678edc99f7ff0b09f6f9daca06e6594c
Showing with 18 additions and 8 deletions.
  1. +13 −8 src/WaveTrack.cpp
  2. +5 −0 src/prefs/TracksPrefs.cpp
@@ -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();

// 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);
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);
}
#endif

PlayableTrack::DoSetMinimized( isMinimized );
@@ -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);

0 comments on commit 2db691d

Please sign in to comment.