mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +02:00
Use Settings for default sample rate and format...
... The first is an example of a Setting with a computed default value. Also making a new file to hold them, separate from the GUI that changes them in QualityPrefs; fewer things depend on QualityPrefs
This commit is contained in:
parent
8c04ed3990
commit
f1de843246
@ -466,7 +466,7 @@ time warp info and AudioIOListener and whether the playback is looped.
|
|||||||
#include "WaveTrack.h"
|
#include "WaveTrack.h"
|
||||||
|
|
||||||
#include "effects/RealtimeEffectManager.h"
|
#include "effects/RealtimeEffectManager.h"
|
||||||
#include "prefs/QualityPrefs.h"
|
#include "prefs/QualitySettings.h"
|
||||||
#include "prefs/RecordingPrefs.h"
|
#include "prefs/RecordingPrefs.h"
|
||||||
#include "widgets/MeterPanelBase.h"
|
#include "widgets/MeterPanelBase.h"
|
||||||
#include "widgets/AudacityMessageBox.h"
|
#include "widgets/AudacityMessageBox.h"
|
||||||
@ -1445,7 +1445,7 @@ void AudioIO::StartMonitoring( const AudioIOStartStreamOptions &options )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
bool success;
|
bool success;
|
||||||
auto captureFormat = QualityPrefs::SampleFormatChoice();
|
auto captureFormat = QualitySettings::SampleFormatChoice();
|
||||||
auto captureChannels = AudioIORecordChannels.Read();
|
auto captureChannels = AudioIORecordChannels.Read();
|
||||||
gPrefs->Read(wxT("/AudioIO/SWPlaythrough"), &mSoftwarePlaythrough, false);
|
gPrefs->Read(wxT("/AudioIO/SWPlaythrough"), &mSoftwarePlaythrough, false);
|
||||||
int playbackChannels = 0;
|
int playbackChannels = 0;
|
||||||
|
@ -718,6 +718,8 @@ list( APPEND SOURCES
|
|||||||
prefs/PrefsPanel.h
|
prefs/PrefsPanel.h
|
||||||
prefs/QualityPrefs.cpp
|
prefs/QualityPrefs.cpp
|
||||||
prefs/QualityPrefs.h
|
prefs/QualityPrefs.h
|
||||||
|
prefs/QualitySettings.cpp
|
||||||
|
prefs/QualitySettings.h
|
||||||
prefs/RecordingPrefs.cpp
|
prefs/RecordingPrefs.cpp
|
||||||
prefs/RecordingPrefs.h
|
prefs/RecordingPrefs.h
|
||||||
prefs/SpectrogramSettings.cpp
|
prefs/SpectrogramSettings.cpp
|
||||||
|
@ -36,7 +36,7 @@ Paul Licameli split from AudacityProject.cpp
|
|||||||
#include "wxFileNameWrapper.h"
|
#include "wxFileNameWrapper.h"
|
||||||
#include "import/Import.h"
|
#include "import/Import.h"
|
||||||
#include "import/ImportMIDI.h"
|
#include "import/ImportMIDI.h"
|
||||||
#include "prefs/QualityPrefs.h"
|
#include "prefs/QualitySettings.h"
|
||||||
#include "toolbars/MixerToolBar.h"
|
#include "toolbars/MixerToolBar.h"
|
||||||
#include "toolbars/SelectionBar.h"
|
#include "toolbars/SelectionBar.h"
|
||||||
#include "toolbars/SpectralSelectionBar.h"
|
#include "toolbars/SpectralSelectionBar.h"
|
||||||
@ -1052,7 +1052,7 @@ int ProjectManager::GetEstimatedRecordingMinsLeftOnDisk(long lCaptureChannels) {
|
|||||||
auto &project = mProject;
|
auto &project = mProject;
|
||||||
|
|
||||||
// Obtain the current settings
|
// Obtain the current settings
|
||||||
auto oCaptureFormat = QualityPrefs::SampleFormatChoice();
|
auto oCaptureFormat = QualitySettings::SampleFormatChoice();
|
||||||
if (lCaptureChannels == 0)
|
if (lCaptureChannels == 0)
|
||||||
lCaptureChannels = AudioIORecordChannels.Read();
|
lCaptureChannels = AudioIORecordChannels.Read();
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ Paul Licameli split from AudacityProject.cpp
|
|||||||
|
|
||||||
#include "AudioIOBase.h"
|
#include "AudioIOBase.h"
|
||||||
#include "Project.h"
|
#include "Project.h"
|
||||||
|
#include "prefs/QualitySettings.h"
|
||||||
#include "widgets/NumericTextCtrl.h"
|
#include "widgets/NumericTextCtrl.h"
|
||||||
#include "prefs/TracksBehaviorsPrefs.h"
|
#include "prefs/TracksBehaviorsPrefs.h"
|
||||||
|
|
||||||
@ -67,15 +68,17 @@ ProjectSettings::ProjectSettings(AudacityProject &project)
|
|||||||
}
|
}
|
||||||
, mSnapTo( gPrefs->Read(wxT("/SnapTo"), SNAP_OFF) )
|
, mSnapTo( gPrefs->Read(wxT("/SnapTo"), SNAP_OFF) )
|
||||||
{
|
{
|
||||||
if (!gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"), &mRate,
|
int intRate;
|
||||||
AudioIOBase::GetOptimalSupportedSampleRate())) {
|
if ( !QualitySettings::DefaultSampleRate.Read( &intRate ) ) {
|
||||||
// The default given above can vary with host/devices. So unless there is
|
// 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
|
// 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.
|
// with a rate which is different from the rate with which it closed.
|
||||||
// See bug 1879.
|
// See bug 1879.
|
||||||
gPrefs->Write(wxT("/SamplingRate/DefaultProjectSampleRate"), mRate);
|
QualitySettings::DefaultSampleRate.Write( mRate );
|
||||||
gPrefs->Flush();
|
gPrefs->Flush();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
mRate = intRate;
|
||||||
gPrefs->Read(wxT("/GUI/SyncLockTracks"), &mIsSyncLocked, false);
|
gPrefs->Read(wxT("/GUI/SyncLockTracks"), &mIsSyncLocked, false);
|
||||||
|
|
||||||
bool multiToolActive = false;
|
bool multiToolActive = false;
|
||||||
@ -110,8 +113,7 @@ void ProjectSettings::UpdatePrefs()
|
|||||||
// The DefaultProjectSample rate is the rate for new projects.
|
// The DefaultProjectSample rate is the rate for new projects.
|
||||||
// Do not change this project's rate, unless there are no tracks.
|
// Do not change this project's rate, unless there are no tracks.
|
||||||
if( TrackList::Get( *this ).size() == 0){
|
if( TrackList::Get( *this ).size() == 0){
|
||||||
gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"), &mRate,
|
mRate = QualityDefaultSampleRate.Read();
|
||||||
AudioIOBase::GetOptimalSupportedSampleRate());
|
|
||||||
// If necessary, we change this rate in the selection toolbar too.
|
// If necessary, we change this rate in the selection toolbar too.
|
||||||
auto bar = SelectionBar::Get( *this );
|
auto bar = SelectionBar::Get( *this );
|
||||||
bar.SetRate( mRate );
|
bar.SetRate( mRate );
|
||||||
|
@ -51,7 +51,7 @@ from the project that will own the track.
|
|||||||
#include "Prefs.h"
|
#include "Prefs.h"
|
||||||
|
|
||||||
#include "effects/TimeWarper.h"
|
#include "effects/TimeWarper.h"
|
||||||
#include "prefs/QualityPrefs.h"
|
#include "prefs/QualitySettings.h"
|
||||||
#include "prefs/SpectrogramSettings.h"
|
#include "prefs/SpectrogramSettings.h"
|
||||||
#include "prefs/TracksPrefs.h"
|
#include "prefs/TracksPrefs.h"
|
||||||
#include "prefs/TracksBehaviorsPrefs.h"
|
#include "prefs/TracksBehaviorsPrefs.h"
|
||||||
@ -85,7 +85,7 @@ WaveTrack::Holder WaveTrackFactory::DuplicateWaveTrack(const WaveTrack &orig)
|
|||||||
WaveTrack::Holder WaveTrackFactory::NewWaveTrack(sampleFormat format, double rate)
|
WaveTrack::Holder WaveTrackFactory::NewWaveTrack(sampleFormat format, double rate)
|
||||||
{
|
{
|
||||||
if (format == (sampleFormat)0)
|
if (format == (sampleFormat)0)
|
||||||
format = QualityPrefs::SampleFormatChoice();
|
format = QualitySettings::SampleFormatChoice();
|
||||||
if (rate == 0)
|
if (rate == 0)
|
||||||
rate = mSettings.GetRate();
|
rate = mSettings.GetRate();
|
||||||
return std::make_shared<WaveTrack> ( mpFactory, format, rate );
|
return std::make_shared<WaveTrack> ( mpFactory, format, rate );
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "../ProjectAudioManager.h"
|
#include "../ProjectAudioManager.h"
|
||||||
#include "../ProjectFileIO.h"
|
#include "../ProjectFileIO.h"
|
||||||
#include "../ProjectSettings.h"
|
#include "../ProjectSettings.h"
|
||||||
|
#include "../prefs/QualitySettings.h"
|
||||||
#include "../ShuttleGui.h"
|
#include "../ShuttleGui.h"
|
||||||
#include "../Shuttle.h"
|
#include "../Shuttle.h"
|
||||||
#include "../ViewInfo.h"
|
#include "../ViewInfo.h"
|
||||||
@ -112,9 +113,8 @@ Effect::Effect()
|
|||||||
// PRL: I think this initialization of mProjectRate doesn't matter
|
// PRL: I think this initialization of mProjectRate doesn't matter
|
||||||
// because it is always reassigned in DoEffect before it is used
|
// because it is always reassigned in DoEffect before it is used
|
||||||
// STF: but can't call AudioIOBase::GetOptimalSupportedSampleRate() here.
|
// STF: but can't call AudioIOBase::GetOptimalSupportedSampleRate() here.
|
||||||
gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"),
|
// (Which is called to compute the default-default value.) (Bug 2280)
|
||||||
&mProjectRate,
|
mProjectRate = QualitySettings::DefaultSampleRate.ReadWithDefault(44100);
|
||||||
44100);
|
|
||||||
|
|
||||||
mIsBatch = false;
|
mIsBatch = false;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ Paul Licameli split from Import.cpp
|
|||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
||||||
#include "../WaveTrack.h"
|
#include "../WaveTrack.h"
|
||||||
#include "../widgets/ProgressDialog.h"
|
#include "../widgets/ProgressDialog.h"
|
||||||
#include "../prefs/QualityPrefs.h"
|
#include "../prefs/QualitySettings.h"
|
||||||
|
|
||||||
ImportPlugin::ImportPlugin(FileExtensions supportedExtensions):
|
ImportPlugin::ImportPlugin(FileExtensions supportedExtensions):
|
||||||
mExtensions( std::move( supportedExtensions ) )
|
mExtensions( std::move( supportedExtensions ) )
|
||||||
@ -54,7 +54,7 @@ void ImportFileHandle::CreateProgress()
|
|||||||
sampleFormat ImportFileHandle::ChooseFormat(sampleFormat effectiveFormat)
|
sampleFormat ImportFileHandle::ChooseFormat(sampleFormat effectiveFormat)
|
||||||
{
|
{
|
||||||
// Consult user preference
|
// Consult user preference
|
||||||
auto defaultFormat = QualityPrefs::SampleFormatChoice();
|
auto defaultFormat = QualitySettings::SampleFormatChoice();
|
||||||
|
|
||||||
// Don't choose format narrower than effective or default
|
// Don't choose format narrower than effective or default
|
||||||
auto format = std::max(effectiveFormat, defaultFormat);
|
auto format = std::max(effectiveFormat, defaultFormat);
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "../commands/CommandManager.h"
|
#include "../commands/CommandManager.h"
|
||||||
#include "../effects/EffectManager.h"
|
#include "../effects/EffectManager.h"
|
||||||
#include "../effects/EffectUI.h"
|
#include "../effects/EffectUI.h"
|
||||||
#include "../prefs/QualityPrefs.h"
|
#include "../prefs/QualitySettings.h"
|
||||||
#include "../tracks/playabletrack/wavetrack/ui/WaveTrackControls.h"
|
#include "../tracks/playabletrack/wavetrack/ui/WaveTrackControls.h"
|
||||||
#include "../widgets/ASlider.h"
|
#include "../widgets/ASlider.h"
|
||||||
#include "../widgets/AudacityMessageBox.h"
|
#include "../widgets/AudacityMessageBox.h"
|
||||||
@ -52,7 +52,7 @@ void DoMixAndRender
|
|||||||
auto &tracks = TrackList::Get( project );
|
auto &tracks = TrackList::Get( project );
|
||||||
auto &trackFactory = WaveTrackFactory::Get( project );
|
auto &trackFactory = WaveTrackFactory::Get( project );
|
||||||
auto rate = settings.GetRate();
|
auto rate = settings.GetRate();
|
||||||
auto defaultFormat = QualityPrefs::SampleFormatChoice();
|
auto defaultFormat = QualitySettings::SampleFormatChoice();
|
||||||
auto &trackPanel = TrackPanel::Get( project );
|
auto &trackPanel = TrackPanel::Get( project );
|
||||||
auto &window = ProjectWindow::Get( project );
|
auto &window = ProjectWindow::Get( project );
|
||||||
|
|
||||||
@ -609,7 +609,7 @@ void OnNewWaveTrack(const CommandContext &context)
|
|||||||
auto &trackFactory = WaveTrackFactory::Get( project );
|
auto &trackFactory = WaveTrackFactory::Get( project );
|
||||||
auto &window = ProjectWindow::Get( project );
|
auto &window = ProjectWindow::Get( project );
|
||||||
|
|
||||||
auto defaultFormat = QualityPrefs::SampleFormatChoice();
|
auto defaultFormat = QualitySettings::SampleFormatChoice();
|
||||||
|
|
||||||
auto rate = settings.GetRate();
|
auto rate = settings.GetRate();
|
||||||
|
|
||||||
@ -633,7 +633,7 @@ void OnNewStereoTrack(const CommandContext &context)
|
|||||||
auto &trackFactory = WaveTrackFactory::Get( project );
|
auto &trackFactory = WaveTrackFactory::Get( project );
|
||||||
auto &window = ProjectWindow::Get( project );
|
auto &window = ProjectWindow::Get( project );
|
||||||
|
|
||||||
auto defaultFormat = QualityPrefs::SampleFormatChoice();
|
auto defaultFormat = QualitySettings::SampleFormatChoice();
|
||||||
auto rate = settings.GetRate();
|
auto rate = settings.GetRate();
|
||||||
|
|
||||||
SelectUtilities::SelectNone( project );
|
SelectUtilities::SelectNone( project );
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "QualityPrefs.h"
|
#include "QualityPrefs.h"
|
||||||
|
#include "QualitySettings.h"
|
||||||
|
|
||||||
#include <wx/choice.h>
|
#include <wx/choice.h>
|
||||||
#include <wx/defs.h>
|
#include <wx/defs.h>
|
||||||
@ -30,26 +31,6 @@
|
|||||||
|
|
||||||
#define ID_SAMPLE_RATE_CHOICE 7001
|
#define ID_SAMPLE_RATE_CHOICE 7001
|
||||||
|
|
||||||
//////////
|
|
||||||
|
|
||||||
static EnumSetting< sampleFormat > formatSetting{
|
|
||||||
wxT("/SamplingRate/DefaultProjectSampleFormatChoice"),
|
|
||||||
{
|
|
||||||
{ wxT("Format16Bit"), XO("16-bit") },
|
|
||||||
{ wxT("Format24Bit"), XO("24-bit") },
|
|
||||||
{ wxT("Format32BitFloat"), XO("32-bit float") }
|
|
||||||
},
|
|
||||||
2, // floatSample
|
|
||||||
|
|
||||||
// for migrating old preferences:
|
|
||||||
{
|
|
||||||
int16Sample,
|
|
||||||
int24Sample,
|
|
||||||
floatSample
|
|
||||||
},
|
|
||||||
wxT("/SamplingRate/DefaultProjectSampleFormat"),
|
|
||||||
};
|
|
||||||
|
|
||||||
//////////
|
//////////
|
||||||
BEGIN_EVENT_TABLE(QualityPrefs, PrefsPanel)
|
BEGIN_EVENT_TABLE(QualityPrefs, PrefsPanel)
|
||||||
EVT_CHOICE(ID_SAMPLE_RATE_CHOICE, QualityPrefs::OnSampleRateChoice)
|
EVT_CHOICE(ID_SAMPLE_RATE_CHOICE, QualityPrefs::OnSampleRateChoice)
|
||||||
@ -85,9 +66,7 @@ void QualityPrefs::Populate()
|
|||||||
{
|
{
|
||||||
// First any pre-processing for constructing the GUI.
|
// First any pre-processing for constructing the GUI.
|
||||||
GetNamesAndLabels();
|
GetNamesAndLabels();
|
||||||
gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"),
|
mOtherSampleRateValue = QualitySettings::DefaultSampleRate.Read();
|
||||||
&mOtherSampleRateValue,
|
|
||||||
AudioIOBase::GetOptimalSupportedSampleRate());
|
|
||||||
|
|
||||||
//------------------------- Main section --------------------
|
//------------------------- Main section --------------------
|
||||||
// Now construct the GUI itself.
|
// Now construct the GUI itself.
|
||||||
@ -148,17 +127,17 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
{
|
{
|
||||||
// First the choice...
|
// First the choice...
|
||||||
// We make sure it uses the ID we want, so that we get changes
|
// We make sure it uses the ID we want, so that we get changes
|
||||||
S.Id(ID_SAMPLE_RATE_CHOICE);
|
|
||||||
// We make sure we have a pointer to it, so that we can drive it.
|
// We make sure we have a pointer to it, so that we can drive it.
|
||||||
mSampleRates = S.TieNumberAsChoice( {},
|
mSampleRates =
|
||||||
{wxT("/SamplingRate/DefaultProjectSampleRate"),
|
S
|
||||||
AudioIOBase::GetOptimalSupportedSampleRate()},
|
.Id(ID_SAMPLE_RATE_CHOICE)
|
||||||
|
.TieNumberAsChoice( {},
|
||||||
|
QualitySettings::DefaultSampleRate,
|
||||||
mSampleRateNames,
|
mSampleRateNames,
|
||||||
&mSampleRateLabels,
|
&mSampleRateLabels,
|
||||||
// If the value in Prefs isn't in the list, then we want
|
// If the value in Prefs isn't in the list, then we want
|
||||||
// the last item, 'Other...' to be shown.
|
// the last item, 'Other...' to be shown.
|
||||||
mSampleRateNames.size() - 1
|
mSampleRateNames.size() - 1 );
|
||||||
);
|
|
||||||
|
|
||||||
// Now do the edit box...
|
// Now do the edit box...
|
||||||
mOtherSampleRate = S.TieNumericTextBox( {},
|
mOtherSampleRate = S.TieNumericTextBox( {},
|
||||||
@ -167,8 +146,9 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
}
|
}
|
||||||
S.EndHorizontalLay();
|
S.EndHorizontalLay();
|
||||||
|
|
||||||
S.TieChoice(XXO("Default Sample &Format:"),
|
S
|
||||||
formatSetting);
|
.TieChoice( XXO("Default Sample &Format:"),
|
||||||
|
QualitySettings::SampleFormatSetting );
|
||||||
}
|
}
|
||||||
S.EndMultiColumn();
|
S.EndMultiColumn();
|
||||||
}
|
}
|
||||||
@ -223,7 +203,7 @@ bool QualityPrefs::Commit()
|
|||||||
// The complex compound control may have value 'other' in which case the
|
// The complex compound control may have value 'other' in which case the
|
||||||
// value in prefs comes from the second field.
|
// value in prefs comes from the second field.
|
||||||
if (mOtherSampleRate->IsEnabled()) {
|
if (mOtherSampleRate->IsEnabled()) {
|
||||||
gPrefs->Write(wxT("/SamplingRate/DefaultProjectSampleRate"), mOtherSampleRateValue);
|
QualitySettings::DefaultSampleRate.Write( mOtherSampleRateValue );
|
||||||
gPrefs->Flush();
|
gPrefs->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,8 +223,3 @@ PrefsPanel::Registration sAttachment{ "Quality",
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
sampleFormat QualityPrefs::SampleFormatChoice()
|
|
||||||
{
|
|
||||||
return formatSetting.ReadEnum();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -37,8 +37,6 @@ class AUDACITY_DLL_API QualityPrefs final : public PrefsPanel
|
|||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
void PopulateOrExchange(ShuttleGui & S) override;
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
static sampleFormat SampleFormatChoice();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void GetNamesAndLabels();
|
void GetNamesAndLabels();
|
||||||
|
41
src/prefs/QualitySettings.cpp
Normal file
41
src/prefs/QualitySettings.cpp
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/**********************************************************************
|
||||||
|
|
||||||
|
Audacity: A Digital Audio Editor
|
||||||
|
|
||||||
|
QualitySettings.cpp
|
||||||
|
|
||||||
|
Paul Licameli split from QualityPrefs.cpp
|
||||||
|
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
#include "QualitySettings.h"
|
||||||
|
#include "AudioIOBase.h"
|
||||||
|
#include "Internat.h"
|
||||||
|
|
||||||
|
IntSetting QualitySettings::DefaultSampleRate{
|
||||||
|
L"/SamplingRate/DefaultProjectSampleRate",
|
||||||
|
AudioIOBase::GetOptimalSupportedSampleRate
|
||||||
|
};
|
||||||
|
|
||||||
|
EnumSetting< sampleFormat > QualitySettings::SampleFormatSetting{
|
||||||
|
L"/SamplingRate/DefaultProjectSampleFormatChoice",
|
||||||
|
{
|
||||||
|
{ L"Format16Bit", XO("16-bit") },
|
||||||
|
{ L"Format24Bit", XO("24-bit") },
|
||||||
|
{ L"Format32BitFloat", XO("32-bit float") }
|
||||||
|
},
|
||||||
|
2, // floatSample
|
||||||
|
|
||||||
|
// for migrating old preferences:
|
||||||
|
{
|
||||||
|
int16Sample,
|
||||||
|
int24Sample,
|
||||||
|
floatSample
|
||||||
|
},
|
||||||
|
L"/SamplingRate/DefaultProjectSampleFormat",
|
||||||
|
};
|
||||||
|
|
||||||
|
sampleFormat QualitySettings::SampleFormatChoice()
|
||||||
|
{
|
||||||
|
return SampleFormatSetting.ReadEnum();
|
||||||
|
}
|
24
src/prefs/QualitySettings.h
Normal file
24
src/prefs/QualitySettings.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/**********************************************************************
|
||||||
|
|
||||||
|
Audacity: A Digital Audio Editor
|
||||||
|
|
||||||
|
QualitySettings.h
|
||||||
|
|
||||||
|
Paul Licameli split from QualityPrefs.h
|
||||||
|
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
#ifndef __AUDACITY_QUALITY_SETTINGS__
|
||||||
|
#define __AUDACITY_QUALITY_SETTINGS__
|
||||||
|
|
||||||
|
#include "Prefs.h" // for EnumSetting
|
||||||
|
|
||||||
|
class IntSetting;
|
||||||
|
|
||||||
|
namespace QualitySettings {
|
||||||
|
extern IntSetting DefaultSampleRate;
|
||||||
|
extern EnumSetting< sampleFormat > SampleFormatSetting;
|
||||||
|
extern sampleFormat SampleFormatChoice();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -60,6 +60,7 @@ with changes in the SelectionBar.
|
|||||||
#include "../ProjectSettings.h"
|
#include "../ProjectSettings.h"
|
||||||
#include "../Snap.h"
|
#include "../Snap.h"
|
||||||
#include "../ViewInfo.h"
|
#include "../ViewInfo.h"
|
||||||
|
#include "../prefs/QualitySettings.h"
|
||||||
#include "../AllThemeResources.h"
|
#include "../AllThemeResources.h"
|
||||||
|
|
||||||
#if wxUSE_ACCESSIBILITY
|
#if wxUSE_ACCESSIBILITY
|
||||||
@ -123,8 +124,7 @@ SelectionBar::SelectionBar( AudacityProject &project )
|
|||||||
// Refer to bug #462 for a scenario where the division-by-zero causes
|
// Refer to bug #462 for a scenario where the division-by-zero causes
|
||||||
// Audacity to fail.
|
// Audacity to fail.
|
||||||
// We expect mRate to be set from the project later.
|
// We expect mRate to be set from the project later.
|
||||||
mRate = (double) gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"),
|
mRate = (double) QualitySettings::DefaultSampleRate.Read();
|
||||||
AudioIOBase::GetOptimalSupportedSampleRate());
|
|
||||||
|
|
||||||
// Selection mode of 0 means showing 'start' and 'end' only.
|
// Selection mode of 0 means showing 'start' and 'end' only.
|
||||||
mSelectionMode = gPrefs->ReadLong(wxT("/SelectionToolbarMode"), 0);
|
mSelectionMode = gPrefs->ReadLong(wxT("/SelectionToolbarMode"), 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user