Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Bug 1860 - Enh: Add preference to disable half-wave view on collapse.
- Loading branch information
Showing
with
18 additions
and
8 deletions.
-
+13
−8
src/WaveTrack.cpp
-
+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); |
|
|
|
|
|
|