From 3c0ee4d3c18d4310e073045c8f562f0faf242496 Mon Sep 17 00:00:00 2001 From: James Crook Date: Sat, 11 Aug 2018 11:41:57 +0100 Subject: [PATCH] Change TrackPrefs Pinned/Unpinned display. The pin and its position can be set directly from the ruler, which is always visible. Displaying the pin/unpinned state and pin position is probably a bit like displaying the toolbar visibility states and positions in prefs - overload of settings that are easier set another way. I've hidden them for now. We should probably come up with a policy as to what prefs should be shown in prefs and what should not. --- src/prefs/TracksPrefs.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/prefs/TracksPrefs.cpp b/src/prefs/TracksPrefs.cpp index 9182facde..aec17e504 100644 --- a/src/prefs/TracksPrefs.cpp +++ b/src/prefs/TracksPrefs.cpp @@ -263,12 +263,6 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S) S.StartStatic(_("Display")); { - S.TieCheckBox(_("&Pinned Recording/Playback head"), - PinnedHeadPreferenceKey(), - PinnedHeadPreferenceDefault()); - S.TieCheckBox(_("A&uto-scroll if head unpinned"), - wxT("/GUI/AutoScroll"), - true); S.TieCheckBox(_("Auto-&fit track height"), wxT("/GUI/TracksFitVerticallyZoomed"), false); @@ -280,11 +274,27 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S) wxT("/GUI/CollapseToHalfWave"), false); #endif +#ifdef SHOW_PINNED_UNPINNED_IN_PREFS + S.TieCheckBox(_("&Pinned Recording/Playback head"), + PinnedHeadPreferenceKey(), + PinnedHeadPreferenceDefault()); +#endif + S.TieCheckBox(_("A&uto-scroll if head unpinned"), + wxT("/GUI/AutoScroll"), + true); S.AddSpace(10); S.StartMultiColumn(2); { +#ifdef SHOW_PINNED_POSITION_IN_PREFS + S.TieNumericTextBox( + _("Pinned &head position"), + PinnedHeadPositionPreferenceKey(), + PinnedHeadPositionPreferenceDefault(), + 30 + ); +#endif S.TieChoice(_("Default &view mode:"), viewModeSetting ); @@ -344,6 +354,7 @@ double TracksPrefs::GetPinnedHeadPositionPreference() void TracksPrefs::SetPinnedHeadPositionPreference(double value, bool flush) { + value = std::max(0.0, std::min(1.0, value)); gPrefs->Write(PinnedHeadPositionPreferenceKey(), value); if(flush) gPrefs->Flush();