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

static ViewInfo::Get() and ZoomInfo::Get()...

... not member functions of AudacityProject
This commit is contained in:
Paul Licameli
2019-04-28 06:49:47 -04:00
parent 14ab93a01f
commit b5a57682b6
52 changed files with 450 additions and 306 deletions

View File

@@ -78,6 +78,7 @@ and in the spectrogram spectral selection.
#include "Prefs.h"
#include "Project.h"
#include "WaveClip.h"
#include "ViewInfo.h"
#include "AllThemeResources.h"
#include "FileNames.h"
@@ -584,10 +585,11 @@ void FreqWindow::GetAudio()
int selcount = 0;
bool warning = false;
for (auto track : TrackList::Get( *p ).Selected< const WaveTrack >()) {
auto &selectedRegion = ViewInfo::Get( *p ).selectedRegion;
if (selcount==0) {
mRate = track->GetRate();
auto start = track->TimeToLongSamples(p->mViewInfo.selectedRegion.t0());
auto end = track->TimeToLongSamples(p->mViewInfo.selectedRegion.t1());
auto start = track->TimeToLongSamples(selectedRegion.t0());
auto end = track->TimeToLongSamples(selectedRegion.t1());
auto dataLen = end - start;
if (dataLen > 10485760) {
warning = true;
@@ -608,7 +610,7 @@ void FreqWindow::GetAudio()
mDataLen = 0;
return;
}
auto start = track->TimeToLongSamples(p->mViewInfo.selectedRegion.t0());
auto start = track->TimeToLongSamples(selectedRegion.t0());
Floats buffer2{ mDataLen };
// Again, stop exceptions
track->Get((samplePtr)buffer2.get(), floatSample, start, mDataLen,