1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-25 15:53:52 +02:00

Now implement scrubbing default to unpinned, see commit ac1017e...

... This was motivated by punch and roll recording:  it appears most convenient
to pin the head for recording purposes, and drag it near the right, but when
stopping and finding the splice point for the correction, it is better to
scrub unpinned.
This commit is contained in:
Paul Licameli
2018-08-30 11:51:28 -04:00
parent 3eccdd9bd1
commit af276ac4f9
7 changed files with 59 additions and 6 deletions

View File

@@ -49,6 +49,18 @@ void PlaybackPrefs::Populate()
// ----------------------- End of main section --------------
}
namespace {
const char *UnpinnedScrubbingPreferenceKey()
{
return "/AudioIO/UnpinnedScrubbing";
}
bool UnpinnedScrubbingPreferenceDefault()
{
return true;
}
int iPreferenceUnpinned = -1;
}
void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S)
{
wxTextCtrl *w;
@@ -126,7 +138,9 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S)
S.StartTwoColumn();
{
S.TieCheckBox(_("Always scrub un&pinned"), "/AudioIO/UnpinnedScrubbing", true);
S.TieCheckBox(_("Always scrub un&pinned"),
UnpinnedScrubbingPreferenceKey(),
UnpinnedScrubbingPreferenceDefault());
}
S.EndTwoColumn();
}
@@ -137,8 +151,21 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S)
}
bool PlaybackPrefs::GetUnpinnedScrubbingPreference()
{
if ( iPreferenceUnpinned >= 0 )
return iPreferenceUnpinned == 1;
bool bResult = gPrefs->ReadBool(
UnpinnedScrubbingPreferenceKey(),
UnpinnedScrubbingPreferenceDefault());
iPreferenceUnpinned = bResult ? 1: 0;
return bResult;
}
bool PlaybackPrefs::Commit()
{
iPreferenceUnpinned = -1;
ShuttleGui S(this, eIsSavingToPrefs);
PopulateOrExchange(S);

View File

@@ -28,6 +28,8 @@ class PlaybackPrefs final : public PrefsPanel
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
static bool GetUnpinnedScrubbingPreference();
private:
void Populate();