Revert "Don't store default sample format in ProjectSettings..."
This reverts commit 44d9916f85
.
This commit is contained in:
parent
44d9916f85
commit
7532677781
|
@ -55,11 +55,11 @@ AliasedFile s.
|
|||
#include "FileFormats.h"
|
||||
#include "Prefs.h"
|
||||
#include "Project.h"
|
||||
#include "ProjectSettings.h"
|
||||
#include "Sequence.h"
|
||||
#include "ShuttleGui.h"
|
||||
#include "WaveTrack.h"
|
||||
#include "WaveClip.h"
|
||||
#include "prefs/QualityPrefs.h"
|
||||
#include "widgets/AudacityMessageBox.h"
|
||||
#include "widgets/ProgressDialog.h"
|
||||
|
||||
|
@ -110,7 +110,8 @@ static void ReplaceBlockFiles(BlockPtrArray &blocks,
|
|||
void FindDependencies(AudacityProject *project,
|
||||
AliasedFileArray &outAliasedFiles)
|
||||
{
|
||||
sampleFormat format = QualityPrefs::SampleFormatChoice();
|
||||
const auto &settings = ProjectSettings::Get( *project );
|
||||
sampleFormat format = settings.GetDefaultFormat();
|
||||
|
||||
BlockPtrArray blocks;
|
||||
GetAllSeqBlocks(project, &blocks);
|
||||
|
@ -167,6 +168,7 @@ static void RemoveDependencies(AudacityProject *project,
|
|||
// STRONG-GUARANTEE
|
||||
{
|
||||
auto &dirManager = DirManager::Get( *project );
|
||||
const auto &settings = ProjectSettings::Get( *project );
|
||||
|
||||
ProgressDialog progress(
|
||||
XO("Removing Dependencies"),
|
||||
|
@ -186,7 +188,7 @@ static void RemoveDependencies(AudacityProject *project,
|
|||
BlockPtrArray blocks;
|
||||
GetAllSeqBlocks(project, &blocks);
|
||||
|
||||
const sampleFormat format = QualityPrefs::SampleFormatChoice();
|
||||
const sampleFormat format = settings.GetDefaultFormat();
|
||||
ReplacedBlockFileHash blockFileHash;
|
||||
wxLongLong completedBytes = 0;
|
||||
for (const auto blockFile : blocks) {
|
||||
|
|
|
@ -14,6 +14,7 @@ Paul Licameli split from AudacityProject.cpp
|
|||
|
||||
#include "AudioIOBase.h"
|
||||
#include "Project.h"
|
||||
#include "prefs/QualityPrefs.h"
|
||||
#include "widgets/NumericTextCtrl.h"
|
||||
#include "prefs/TracksBehaviorsPrefs.h"
|
||||
|
||||
|
@ -61,6 +62,7 @@ ProjectSettings::ProjectSettings( AudacityProject &project )
|
|||
NumericConverter::BANDWIDTH,
|
||||
gPrefs->Read(wxT("/BandwidthSelectionFormatName"), wxT("")) )
|
||||
}
|
||||
, mDefaultFormat{ QualityPrefs::SampleFormatChoice() }
|
||||
, mSnapTo( gPrefs->Read(wxT("/SnapTo"), SNAP_OFF) )
|
||||
{
|
||||
if (!gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"), &mRate,
|
||||
|
@ -113,6 +115,8 @@ void ProjectSettings::UpdatePrefs()
|
|||
bar.SetRate( mRate );
|
||||
}
|
||||
#endif
|
||||
|
||||
mDefaultFormat = QualityPrefs::SampleFormatChoice();
|
||||
}
|
||||
|
||||
const NumericFormatSymbol &
|
||||
|
|
|
@ -64,6 +64,8 @@ public:
|
|||
ProjectSettings( const ProjectSettings & ) PROHIBITED;
|
||||
ProjectSettings &operator=( const ProjectSettings & ) PROHIBITED;
|
||||
|
||||
sampleFormat GetDefaultFormat() const { return mDefaultFormat; }
|
||||
|
||||
double GetRate() const { return mRate; }
|
||||
void SetRate( double value ) { mRate = value; }
|
||||
|
||||
|
@ -129,6 +131,7 @@ private:
|
|||
// the main
|
||||
std::atomic<double> mPlaySpeed{};
|
||||
|
||||
sampleFormat mDefaultFormat;
|
||||
int mSnapTo;
|
||||
|
||||
int mCurrentTool;
|
||||
|
|
|
@ -54,7 +54,6 @@ Track classes.
|
|||
#include "Prefs.h"
|
||||
|
||||
#include "effects/TimeWarper.h"
|
||||
#include "prefs/QualityPrefs.h"
|
||||
#include "prefs/SpectrogramSettings.h"
|
||||
#include "prefs/TracksPrefs.h"
|
||||
#include "prefs/WaveformSettings.h"
|
||||
|
@ -81,7 +80,7 @@ WaveTrack::Holder TrackFactory::DuplicateWaveTrack(const WaveTrack &orig)
|
|||
WaveTrack::Holder TrackFactory::NewWaveTrack(sampleFormat format, double rate)
|
||||
{
|
||||
if (format == (sampleFormat)0)
|
||||
QualityPrefs::SampleFormatChoice();
|
||||
format = mSettings.GetDefaultFormat();
|
||||
if (rate == 0)
|
||||
rate = mSettings.GetRate();
|
||||
return std::make_shared<WaveTrack> ( mDirManager, format, rate );
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "../commands/CommandManager.h"
|
||||
#include "../effects/EffectManager.h"
|
||||
#include "../effects/EffectUI.h"
|
||||
#include "../prefs/QualityPrefs.h"
|
||||
#include "../tracks/playabletrack/wavetrack/ui/WaveTrackControls.h"
|
||||
#include "../widgets/ASlider.h"
|
||||
#include "../widgets/AudacityMessageBox.h"
|
||||
|
@ -54,7 +53,7 @@ void DoMixAndRender
|
|||
auto &tracks = TrackList::Get( project );
|
||||
auto &trackFactory = TrackFactory::Get( project );
|
||||
auto rate = settings.GetRate();
|
||||
auto defaultFormat = QualityPrefs::SampleFormatChoice();
|
||||
auto defaultFormat = settings.GetDefaultFormat();
|
||||
auto &trackPanel = TrackPanel::Get( project );
|
||||
auto &window = ProjectWindow::Get( project );
|
||||
|
||||
|
@ -598,8 +597,7 @@ void OnNewWaveTrack(const CommandContext &context)
|
|||
auto &trackFactory = TrackFactory::Get( project );
|
||||
auto &window = ProjectWindow::Get( project );
|
||||
|
||||
auto defaultFormat = QualityPrefs::SampleFormatChoice();
|
||||
|
||||
auto defaultFormat = settings.GetDefaultFormat();
|
||||
auto rate = settings.GetRate();
|
||||
|
||||
auto t = tracks.Add( trackFactory.NewWaveTrack( defaultFormat, rate ) );
|
||||
|
@ -622,7 +620,7 @@ void OnNewStereoTrack(const CommandContext &context)
|
|||
auto &trackFactory = TrackFactory::Get( project );
|
||||
auto &window = ProjectWindow::Get( project );
|
||||
|
||||
auto defaultFormat = QualityPrefs::SampleFormatChoice();
|
||||
auto defaultFormat = settings.GetDefaultFormat();
|
||||
auto rate = settings.GetRate();
|
||||
|
||||
SelectUtilities::SelectNone( project );
|
||||
|
|
Loading…
Reference in New Issue