1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-18 17:10:05 +02:00

Merge branch 'master' into scrubbing-temp

This commit is contained in:
Paul Licameli 2015-06-08 09:56:04 -04:00
commit 70d9e7b746
3 changed files with 27 additions and 21 deletions

View File

@ -122,7 +122,7 @@ public:
// or child.
virtual wxAccStatus GetValue( int childId, wxString *strValue );
void SetSelected( int item );
void SetSelected( int item, bool focused = true );
private:
wxListCtrl *mParent;
@ -140,7 +140,7 @@ CheckListAx::~CheckListAx()
{
}
void CheckListAx::SetSelected( int item )
void CheckListAx::SetSelected( int item, bool focused )
{
if (mLastId != -1)
{
@ -153,10 +153,13 @@ void CheckListAx::SetSelected( int item )
if (item != -1)
{
NotifyEvent( wxACC_EVENT_OBJECT_FOCUS,
mParent,
wxOBJID_CLIENT,
item + 1 );
if (focused)
{
NotifyEvent( wxACC_EVENT_OBJECT_FOCUS,
mParent,
wxOBJID_CLIENT,
item + 1 );
}
NotifyEvent( wxACC_EVENT_OBJECT_SELECTION,
mParent,
@ -747,7 +750,7 @@ void PluginRegistrationDialog::RegenerateEffectsList(int filter)
// mEffects->SetFocus();
mEffects->SetItemState(0, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
#if wxUSE_ACCESSIBILITY
mAx->SetSelected(0);
mAx->SetSelected(0, false);
#endif
}
}

View File

@ -1021,7 +1021,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
mTrackFactory = new TrackFactory(mDirManager);
int widths[] = {0, GetControlToolBar()->WidthForStatusBar(mStatusBar), -2, -1};
int widths[] = {0, GetControlToolBar()->WidthForStatusBar(mStatusBar), -1, 150};
mStatusBar->SetStatusWidths(4, widths);
wxString msg = wxString::Format(_("Welcome to Audacity version %s"),
AUDACITY_VERSION_STRING);

View File

@ -850,14 +850,18 @@ void SpecCache::CalculateOneSpectrum
sampleCount len = windowSize;
if (start <= 0 || start >= numSamples) {
// Pixel column is out of bounds of the clip! Should not happen.
std::fill(results, results + half, 0.0f);
}
else {
bool copy = !autocorrelation || (padding > 0);
float *useBuffer = 0;
float *adj = scratch + padding;
// Take a window of the track centered at this sample.
start -= windowSize >> 1;
if (start < 0) {
// Near the start of the clip, pad left with zeroes as needed.
for (sampleCount ii = start; ii < 0; ++ii)
*adj++ = 0;
len += start;
@ -874,6 +878,7 @@ void SpecCache::CalculateOneSpectrum
}
#else //!EXPERIMENTAL_FFT_SKIP_POINTS
if (start + len > numSamples) {
// Near the end of the clip, pad right with zeroes as needed.
int newlen = numSamples - start;
for (sampleCount ii = newlen; ii < (sampleCount)len; ++ii)
adj[ii] = 0;
@ -883,6 +888,7 @@ void SpecCache::CalculateOneSpectrum
#endif //EXPERIMENTAL_FFT_SKIP_POINTS
if (len > 0) {
// Copy samples out of the track.
#ifdef EXPERIMENTAL_FFT_SKIP_POINTS
useBuffer = (float*)(waveTrackCache.Get(floatSample,
floor(0.5 + start + offset * rate), len*fftSkipPoints1));
@ -912,6 +918,10 @@ void SpecCache::CalculateOneSpectrum
rate, results,
autocorrelation, settings.windowType);
else
// Do the FFT. Note that scratch is multiplied by the window,
// and the window is initialized with leading and trailing zeroes
// when there is padding. Therefore we did not need to reinitialize
// the part of scratch in the padding zones.
ComputeSpectrumUsingRealFFTf
(useBuffer, settings.hFFT, settings.window, fftLen, results);
#else // EXPERIMENTAL_USE_REALFFTF
@ -964,26 +974,19 @@ void SpecCache::Populate
#endif //EXPERIMENTAL_FFT_SKIP_POINTS
);
// Initialize zero padding in the buffer
for (int ii = 0; ii < padding; ++ii) {
buffer[ii] = 0.0;
buffer[fftLen - ii - 1] = 0.0;
}
std::vector<float> gainFactors;
ComputeSpectrogramGainFactors(fftLen, rate, frequencyGain, gainFactors);
// Loop over the ranges before and after the copied portion and compute anew.
// One of the ranges may be empty.
for (sampleCount xx = 0; xx < copyBegin; ++xx)
CalculateOneSpectrum(
settings, waveTrackCache, xx, numSamples,
offset, rate, autocorrelation, gainFactors, &buffer[0]);
for (sampleCount xx = copyEnd; xx < numPixels; ++xx)
CalculateOneSpectrum(
for (int jj = 0; jj < 2; ++jj) {
const int lowerBoundX = jj == 0 ? 0 : copyEnd;
const int upperBoundX = jj == 0 ? copyBegin : numPixels;
for (sampleCount xx = lowerBoundX; xx < upperBoundX; ++xx)
CalculateOneSpectrum(
settings, waveTrackCache, xx, numSamples,
offset, rate, autocorrelation, gainFactors, &buffer[0]);
}
}
bool WaveClip::GetSpectrogram(WaveTrackCache &waveTrackCache,