parent
b1f05e5747
commit
bacf06944a
11
src/Prefs.h
11
src/Prefs.h
|
@ -120,10 +120,17 @@ public:
|
|||
return mDefaultValue;
|
||||
}
|
||||
|
||||
//! overload of Read returning a success flag
|
||||
/*! The cache is unchanged if that is false */
|
||||
//! overload of Read returning a boolean that is true if the value was previously defined */
|
||||
bool Read( T *pVar ) const
|
||||
{
|
||||
return ReadWithDefault( pVar, GetDefault() );
|
||||
}
|
||||
|
||||
//! overload of ReadWithDefault returning a boolean that is true if the value was previously defined */
|
||||
bool ReadWithDefault( T *pVar, const T& defaultValue ) const
|
||||
{
|
||||
if ( pVar )
|
||||
*pVar = defaultValue;
|
||||
if ( pVar && this->mValid ) {
|
||||
*pVar = this->mCurrentValue;
|
||||
return true;
|
||||
|
|
|
@ -68,8 +68,10 @@ ProjectSettings::ProjectSettings(AudacityProject &project)
|
|||
}
|
||||
, mSnapTo( gPrefs->Read(wxT("/SnapTo"), SNAP_OFF) )
|
||||
{
|
||||
int intRate;
|
||||
if ( !QualitySettings::DefaultSampleRate.Read( &intRate ) ) {
|
||||
int intRate = 0;
|
||||
bool wasDefined = QualitySettings::DefaultSampleRate.Read( &intRate );
|
||||
mRate = intRate;
|
||||
if ( !wasDefined ) {
|
||||
// The default given above can vary with host/devices. So unless there is
|
||||
// an entry for the default sample rate in audacity.cfg, Audacity can open
|
||||
// with a rate which is different from the rate with which it closed.
|
||||
|
@ -77,8 +79,6 @@ ProjectSettings::ProjectSettings(AudacityProject &project)
|
|||
QualitySettings::DefaultSampleRate.Write( mRate );
|
||||
gPrefs->Flush();
|
||||
}
|
||||
else
|
||||
mRate = intRate;
|
||||
gPrefs->Read(wxT("/GUI/SyncLockTracks"), &mIsSyncLocked, false);
|
||||
|
||||
bool multiToolActive = false;
|
||||
|
|
Loading…
Reference in New Issue