1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-21 05:31:13 +01:00

Add code from merging.

This brings more of the code from DarkAudacity into Audacity, though not yet enabled.  This will make cherry picking later easier.
- Changing colour of html displays now possible, as colour links are visible for substitution.  (Can't use css as wxHTML is very limited).
- Export can now be preset to a particular format independent of preferences.
- SnapTo reversion on zoom now a DA controlled option.
- Caching of pinning preference for faster repaint because preferences are slow.
- Record Append now has sensible limit on number of tracks, rather than giving an error, and flipping the meaning of shift is now DA controlled.
This commit is contained in:
James Crook
2016-09-10 21:34:14 +01:00
parent 796b98de8b
commit 923eefaf90
8 changed files with 110 additions and 46 deletions

View File

@@ -30,6 +30,7 @@
#include "../Experimental.h"
int TracksPrefs::iPreferencePinned = -1;
namespace {
const wxChar *PinnedHeadPreferenceKey()
@@ -179,11 +180,18 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S)
bool TracksPrefs::GetPinnedHeadPreference()
{
return gPrefs->ReadBool(PinnedHeadPreferenceKey(), PinnedHeadPreferenceDefault());
// JKC: Cache this setting as it is read many times during drawing, and otherwise causes screen flicker.
// Correct solution would be to re-write wxFileConfig to be efficient.
if( iPreferencePinned >= 0 )
return iPreferencePinned == 1;
bool bResult = gPrefs->ReadBool(PinnedHeadPreferenceKey(), PinnedHeadPreferenceDefault());
iPreferencePinned = bResult ? 1: 0;
return bResult;
}
void TracksPrefs::SetPinnedHeadPreference(bool value, bool flush)
{
iPreferencePinned = value ? 1 :0;
gPrefs->Write(PinnedHeadPreferenceKey(), value);
if(flush)
gPrefs->Flush();