mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-27 17:48:38 +02:00
Merge branch 'master' into scrubbing
This commit is contained in:
commit
d379012b77
@ -4756,7 +4756,11 @@ void AudacityProject::DoNextPeakFrequency(bool up)
|
|||||||
WaveTrack *const wt = static_cast<WaveTrack*>(t);
|
WaveTrack *const wt = static_cast<WaveTrack*>(t);
|
||||||
const int display = wt->GetDisplay();
|
const int display = wt->GetDisplay();
|
||||||
if (display == WaveTrack::SpectrumDisplay ||
|
if (display == WaveTrack::SpectrumDisplay ||
|
||||||
display == WaveTrack::SpectrumLogDisplay) {
|
display == WaveTrack::SpectrumLogDisplay ||
|
||||||
|
display == WaveTrack::SpectralSelectionDisplay ||
|
||||||
|
display == WaveTrack::SpectralSelectionLogDisplay
|
||||||
|
|
||||||
|
) {
|
||||||
pTrack = wt;
|
pTrack = wt;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -438,6 +438,12 @@ void TrackArtist::DrawTrack(const Track * t,
|
|||||||
case WaveTrack::SpectrumLogDisplay:
|
case WaveTrack::SpectrumLogDisplay:
|
||||||
DrawSpectrum(wt, dc, r, viewInfo, false, true);
|
DrawSpectrum(wt, dc, r, viewInfo, false, true);
|
||||||
break;
|
break;
|
||||||
|
case WaveTrack::SpectralSelectionDisplay:
|
||||||
|
DrawSpectrum(wt, dc, r, viewInfo, false, false);
|
||||||
|
break;
|
||||||
|
case WaveTrack::SpectralSelectionLogDisplay:
|
||||||
|
DrawSpectrum(wt, dc, r, viewInfo, false, true);
|
||||||
|
break;
|
||||||
case WaveTrack::PitchDisplay:
|
case WaveTrack::PitchDisplay:
|
||||||
DrawSpectrum(wt, dc, r, viewInfo, true, false);
|
DrawSpectrum(wt, dc, r, viewInfo, true, false);
|
||||||
break;
|
break;
|
||||||
@ -763,7 +769,10 @@ void TrackArtist::UpdateVRuler(Track *t, wxRect & r)
|
|||||||
vruler->SetLabelEdges(true);
|
vruler->SetLabelEdges(true);
|
||||||
vruler->SetLog(false);
|
vruler->SetLog(false);
|
||||||
}
|
}
|
||||||
else if (display == WaveTrack::SpectrumDisplay) {
|
else if (
|
||||||
|
(display == WaveTrack::SpectrumDisplay) ||
|
||||||
|
(display == WaveTrack::SpectralSelectionDisplay) )
|
||||||
|
{
|
||||||
// Spectrum
|
// Spectrum
|
||||||
|
|
||||||
if (r.height < 60)
|
if (r.height < 60)
|
||||||
@ -806,7 +815,10 @@ void TrackArtist::UpdateVRuler(Track *t, wxRect & r)
|
|||||||
}
|
}
|
||||||
vruler->SetLog(false);
|
vruler->SetLog(false);
|
||||||
}
|
}
|
||||||
else if (display == WaveTrack::SpectrumLogDisplay) {
|
else if (
|
||||||
|
(display == WaveTrack::SpectrumLogDisplay) ||
|
||||||
|
(display == WaveTrack::SpectralSelectionLogDisplay) )
|
||||||
|
{
|
||||||
// SpectrumLog
|
// SpectrumLog
|
||||||
|
|
||||||
if (r.height < 10)
|
if (r.height < 10)
|
||||||
@ -1792,25 +1804,24 @@ static float sumFreqValues(
|
|||||||
// Helper function to decide on which color set to use.
|
// Helper function to decide on which color set to use.
|
||||||
// dashCount counts both dashes and the spaces between them.
|
// dashCount counts both dashes and the spaces between them.
|
||||||
AColor::ColorGradientChoice ChooseColorSet( float bin0, float bin1, float selBinLo,
|
AColor::ColorGradientChoice ChooseColorSet( float bin0, float bin1, float selBinLo,
|
||||||
float selBinCenter, float selBinHi, int dashCount )
|
float selBinCenter, float selBinHi, int dashCount, bool isSpectral )
|
||||||
{
|
{
|
||||||
if ( (selBinCenter >= 0) && (bin0 <= selBinCenter) && (selBinCenter < bin1) )
|
if (!isSpectral)
|
||||||
|
return AColor::ColorGradientTimeSelected;
|
||||||
|
if ((selBinCenter >= 0) && (bin0 <= selBinCenter) &&
|
||||||
|
(selBinCenter < bin1))
|
||||||
return AColor::ColorGradientEdge;
|
return AColor::ColorGradientEdge;
|
||||||
else if (
|
if ((0 == dashCount % 2) &&
|
||||||
(0 == dashCount % 2) &&
|
(((selBinLo >= 0) && (bin0 <= selBinLo) && ( selBinLo < bin1)) ||
|
||||||
(((selBinLo >= 0) && (bin0 <= selBinLo) && ( selBinLo < bin1)) ||
|
((selBinHi >= 0) && (bin0 <= selBinHi) && ( selBinHi < bin1))))
|
||||||
((selBinHi >= 0) && (bin0 <= selBinHi) && ( selBinHi < bin1)) ) )
|
|
||||||
return AColor::ColorGradientEdge;
|
return AColor::ColorGradientEdge;
|
||||||
else if (
|
if ((selBinLo < 0 || selBinLo < bin1) && (selBinHi < 0 || selBinHi > bin0))
|
||||||
(selBinLo < 0 || selBinLo < bin1) &&
|
|
||||||
(selBinHi < 0 || selBinHi > bin0) )
|
|
||||||
return AColor::ColorGradientTimeAndFrequencySelected;
|
return AColor::ColorGradientTimeAndFrequencySelected;
|
||||||
else
|
|
||||||
return AColor::ColorGradientTimeSelected;
|
return AColor::ColorGradientTimeSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void TrackArtist::DrawClipSpectrum(WaveTrackCache &cache,
|
void TrackArtist::DrawClipSpectrum(WaveTrackCache &cache,
|
||||||
WaveClip *clip,
|
WaveClip *clip,
|
||||||
wxDC & dc,
|
wxDC & dc,
|
||||||
@ -2098,7 +2109,9 @@ void TrackArtist::DrawClipSpectrum(WaveTrackCache &cache,
|
|||||||
// If we are in the time selected range, then we may use a differnt color set.
|
// If we are in the time selected range, then we may use a differnt color set.
|
||||||
if (ssel0 <= w0 && w1 < ssel1)
|
if (ssel0 <= w0 && w1 < ssel1)
|
||||||
{
|
{
|
||||||
selected = ChooseColorSet( bin0, bin1, selBinLo, selBinCenter, selBinHi, x/DASH_LENGTH );
|
bool isSpectral = ((track->GetDisplay() == WaveTrack::SpectralSelectionDisplay) ||
|
||||||
|
(track->GetDisplay() == WaveTrack::SpectralSelectionLogDisplay));
|
||||||
|
selected = ChooseColorSet( bin0, bin1, selBinLo, selBinCenter, selBinHi, x/DASH_LENGTH, isSpectral );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2210,7 +2223,9 @@ void TrackArtist::DrawClipSpectrum(WaveTrackCache &cache,
|
|||||||
// If we are in the time selected range, then we may use a differnt color set.
|
// If we are in the time selected range, then we may use a differnt color set.
|
||||||
if (ssel0 <= w0 && w1 < ssel1)
|
if (ssel0 <= w0 && w1 < ssel1)
|
||||||
{
|
{
|
||||||
selected = ChooseColorSet( bin0, bin1, selBinLo, selBinCenter, selBinHi, x/DASH_LENGTH );
|
bool isSpectral = ((track->GetDisplay() == WaveTrack::SpectralSelectionDisplay) ||
|
||||||
|
(track->GetDisplay() == WaveTrack::SpectralSelectionLogDisplay));
|
||||||
|
selected = ChooseColorSet( bin0, bin1, selBinLo, selBinCenter, selBinHi, x/DASH_LENGTH, isSpectral );
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!usePxCache) {
|
if(!usePxCache) {
|
||||||
|
@ -322,6 +322,8 @@ enum {
|
|||||||
OnWaveformDBID,
|
OnWaveformDBID,
|
||||||
OnSpectrumID,
|
OnSpectrumID,
|
||||||
OnSpectrumLogID,
|
OnSpectrumLogID,
|
||||||
|
OnSpectralSelID,
|
||||||
|
OnSpectralSelLogID,
|
||||||
OnPitchID,
|
OnPitchID,
|
||||||
|
|
||||||
OnSplitStereoID,
|
OnSplitStereoID,
|
||||||
@ -720,6 +722,11 @@ void TrackPanel::BuildMenus(void)
|
|||||||
mWaveTrackMenu->Append(OnSpectrumID, _("&Spectrogram"));
|
mWaveTrackMenu->Append(OnSpectrumID, _("&Spectrogram"));
|
||||||
/* i18n-hint: short form of 'logarithm'*/
|
/* i18n-hint: short form of 'logarithm'*/
|
||||||
mWaveTrackMenu->Append(OnSpectrumLogID, _("Spectrogram l&og(f)"));
|
mWaveTrackMenu->Append(OnSpectrumLogID, _("Spectrogram l&og(f)"));
|
||||||
|
/* i18n-hint: Spectral Selection is spectrogram with ability to select frequencies too'*/
|
||||||
|
mWaveTrackMenu->Append(OnSpectralSelID, _("S&pectral Selection"));
|
||||||
|
/* i18n-hint: short form of 'logarithm'*/
|
||||||
|
mWaveTrackMenu->Append(OnSpectralSelLogID, _("Spectral Selection lo&g(f)"));
|
||||||
|
|
||||||
mWaveTrackMenu->Append(OnPitchID, _("Pitc&h (EAC)"));
|
mWaveTrackMenu->Append(OnPitchID, _("Pitc&h (EAC)"));
|
||||||
mWaveTrackMenu->AppendSeparator();
|
mWaveTrackMenu->AppendSeparator();
|
||||||
mWaveTrackMenu->AppendRadioItem(OnChannelMonoID, _("&Mono"));
|
mWaveTrackMenu->AppendRadioItem(OnChannelMonoID, _("&Mono"));
|
||||||
@ -1721,8 +1728,7 @@ void TrackPanel::SetCursorAndTipWhenInLabel( Track * t,
|
|||||||
{
|
{
|
||||||
if (event.m_x >= GetVRulerOffset() &&
|
if (event.m_x >= GetVRulerOffset() &&
|
||||||
(t->GetKind() == Track::Wave) &&
|
(t->GetKind() == Track::Wave) &&
|
||||||
(((WaveTrack *) t)->GetDisplay() <= WaveTrack::SpectrumDisplay ||
|
( ((WaveTrack *) t)->GetDisplay() <= WaveTrack::SpectralSelectionLogDisplay) )
|
||||||
((WaveTrack *) t)->GetDisplay() <= WaveTrack::SpectrumLogDisplay))
|
|
||||||
{
|
{
|
||||||
*ppTip = _("Click to vertically zoom in. Shift-click to zoom out. Drag to specify a zoom region.");
|
*ppTip = _("Click to vertically zoom in. Shift-click to zoom out. Drag to specify a zoom region.");
|
||||||
SetCursor(event.ShiftDown()? *mZoomOutCursor : *mZoomInCursor);
|
SetCursor(event.ShiftDown()? *mZoomOutCursor : *mZoomInCursor);
|
||||||
@ -1796,15 +1802,17 @@ void TrackPanel::SetCursorAndTipWhenInLabelTrack( LabelTrack * pLT,
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
// This returns true if we're a spectral editing track.
|
||||||
inline bool isSpectrogramTrack(const Track *pTrack, bool *pLogf = NULL) {
|
inline bool isSpectrogramTrack(const Track *pTrack, bool *pLogf = NULL) {
|
||||||
if (pTrack &&
|
if (pTrack &&
|
||||||
pTrack->GetKind() == Track::Wave) {
|
pTrack->GetKind() == Track::Wave) {
|
||||||
const int display =
|
const int display =
|
||||||
static_cast<const WaveTrack*>(pTrack)->GetDisplay();
|
static_cast<const WaveTrack*>(pTrack)->GetDisplay();
|
||||||
const bool logF = (display == WaveTrack::SpectrumLogDisplay);
|
const bool logF = (display == WaveTrack::SpectrumLogDisplay) ||
|
||||||
|
(display == WaveTrack::SpectralSelectionLogDisplay);
|
||||||
if (pLogf)
|
if (pLogf)
|
||||||
*pLogf = logF;
|
*pLogf = logF;
|
||||||
return logF || (display == WaveTrack::SpectrumDisplay);
|
return (display == WaveTrack::SpectralSelectionLogDisplay) || (display == WaveTrack::SpectralSelectionDisplay);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (pLogf)
|
if (pLogf)
|
||||||
@ -3083,7 +3091,9 @@ void TrackPanel::ExtendFreqSelection(int mouseYCoordinate, int trackTopEdge,
|
|||||||
|
|
||||||
const WaveTrack* wt = mFreqSelTrack;
|
const WaveTrack* wt = mFreqSelTrack;
|
||||||
const int display = wt->GetDisplay();
|
const int display = wt->GetDisplay();
|
||||||
const bool logF = display == WaveTrack::SpectrumLogDisplay;
|
const bool logF = (display == WaveTrack::SpectrumLogDisplay) ||
|
||||||
|
(display == WaveTrack::SpectralSelectionLogDisplay)
|
||||||
|
;
|
||||||
const double rate = wt->GetRate();
|
const double rate = wt->GetRate();
|
||||||
const double frequency =
|
const double frequency =
|
||||||
PositionToFrequency(true, mouseYCoordinate,
|
PositionToFrequency(true, mouseYCoordinate,
|
||||||
@ -4566,7 +4576,7 @@ void TrackPanel::HandleVZoomClick( wxMouseEvent & event )
|
|||||||
|
|
||||||
// don't do anything if track is not wave or Spectrum/log Spectrum
|
// don't do anything if track is not wave or Spectrum/log Spectrum
|
||||||
if (((mCapturedTrack->GetKind() == Track::Wave) &&
|
if (((mCapturedTrack->GetKind() == Track::Wave) &&
|
||||||
(((WaveTrack*)mCapturedTrack)->GetDisplay() <= WaveTrack::SpectrumLogDisplay))
|
(((WaveTrack*)mCapturedTrack)->GetDisplay() <= WaveTrack::SpectralSelectionLogDisplay))
|
||||||
#ifdef USE_MIDI
|
#ifdef USE_MIDI
|
||||||
|| mCapturedTrack->GetKind() == Track::Note
|
|| mCapturedTrack->GetKind() == Track::Note
|
||||||
#endif
|
#endif
|
||||||
@ -4655,8 +4665,11 @@ void TrackPanel::HandleVZoomButtonUp( wxMouseEvent & event )
|
|||||||
int fftSkipPoints=0;
|
int fftSkipPoints=0;
|
||||||
#endif //EXPERIMENTAL_FFT_SKIP_POINTS
|
#endif //EXPERIMENTAL_FFT_SKIP_POINTS
|
||||||
double rate = ((WaveTrack *)track)->GetRate();
|
double rate = ((WaveTrack *)track)->GetRate();
|
||||||
spectrum = ((WaveTrack *) track)->GetDisplay() == WaveTrack::SpectrumDisplay;
|
spectrum = (((WaveTrack *) track)->GetDisplay() == WaveTrack::SpectrumDisplay) ||
|
||||||
spectrumLog=(((WaveTrack *) track)->GetDisplay() == WaveTrack::SpectrumLogDisplay);
|
(((WaveTrack *) track)->GetDisplay() == WaveTrack::SpectralSelectionDisplay) ;
|
||||||
|
spectrumLog=(((WaveTrack *) track)->GetDisplay() == WaveTrack::SpectrumLogDisplay) ||
|
||||||
|
(((WaveTrack *) track)->GetDisplay() == WaveTrack::SpectralSelectionLogDisplay)
|
||||||
|
;
|
||||||
if(spectrum) {
|
if(spectrum) {
|
||||||
min = mTrackArtist->GetSpectrumMinFreq(0);
|
min = mTrackArtist->GetSpectrumMinFreq(0);
|
||||||
if(min < 0)
|
if(min < 0)
|
||||||
@ -8457,6 +8470,8 @@ void TrackPanel::OnTrackMenu(Track *t)
|
|||||||
display != WaveTrack::WaveformDBDisplay);
|
display != WaveTrack::WaveformDBDisplay);
|
||||||
theMenu->Enable(OnSpectrumID, display != WaveTrack::SpectrumDisplay);
|
theMenu->Enable(OnSpectrumID, display != WaveTrack::SpectrumDisplay);
|
||||||
theMenu->Enable(OnSpectrumLogID, display != WaveTrack::SpectrumLogDisplay);
|
theMenu->Enable(OnSpectrumLogID, display != WaveTrack::SpectrumLogDisplay);
|
||||||
|
theMenu->Enable(OnSpectralSelID, display != WaveTrack::SpectralSelectionDisplay);
|
||||||
|
theMenu->Enable(OnSpectralSelLogID, display != WaveTrack::SpectralSelectionLogDisplay);
|
||||||
theMenu->Enable(OnPitchID, display != WaveTrack::PitchDisplay);
|
theMenu->Enable(OnPitchID, display != WaveTrack::PitchDisplay);
|
||||||
|
|
||||||
WaveTrack * track = (WaveTrack *)t;
|
WaveTrack * track = (WaveTrack *)t;
|
||||||
|
@ -409,6 +409,8 @@ class AUDACITY_DLL_API WaveTrack: public Track {
|
|||||||
WaveformDBDisplay,
|
WaveformDBDisplay,
|
||||||
SpectrumDisplay,
|
SpectrumDisplay,
|
||||||
SpectrumLogDisplay,
|
SpectrumLogDisplay,
|
||||||
|
SpectralSelectionDisplay,
|
||||||
|
SpectralSelectionLogDisplay,
|
||||||
PitchDisplay,
|
PitchDisplay,
|
||||||
NoDisplay // Preview track has no display
|
NoDisplay // Preview track has no display
|
||||||
} WaveTrackDisplay;
|
} WaveTrackDisplay;
|
||||||
@ -417,6 +419,10 @@ class AUDACITY_DLL_API WaveTrack: public Track {
|
|||||||
if(mDisplay<2)
|
if(mDisplay<2)
|
||||||
mLastDisplay=mDisplay; // remember last display mode for wave and wavedb so they can remap
|
mLastDisplay=mDisplay; // remember last display mode for wave and wavedb so they can remap
|
||||||
mDisplay = display;
|
mDisplay = display;
|
||||||
|
if( mDisplay == SpectralSelectionDisplay ){
|
||||||
|
}
|
||||||
|
if( mDisplay == SpectralSelectionLogDisplay ){
|
||||||
|
}
|
||||||
}
|
}
|
||||||
int GetDisplay() const {return mDisplay;}
|
int GetDisplay() const {return mDisplay;}
|
||||||
int GetLastDisplay() {return mLastDisplay;}
|
int GetLastDisplay() {return mLastDisplay;}
|
||||||
|
@ -780,6 +780,8 @@ bool NyquistEffect::ProcessOne()
|
|||||||
case WaveTrack::WaveformDBDisplay: view = wxT("\"Waveform (dB)\""); break;
|
case WaveTrack::WaveformDBDisplay: view = wxT("\"Waveform (dB)\""); break;
|
||||||
case WaveTrack::SpectrumDisplay: view = wxT("\"Spectrogram\""); break;
|
case WaveTrack::SpectrumDisplay: view = wxT("\"Spectrogram\""); break;
|
||||||
case WaveTrack::SpectrumLogDisplay: view = wxT("\"Spectrogram log(f)\""); break;
|
case WaveTrack::SpectrumLogDisplay: view = wxT("\"Spectrogram log(f)\""); break;
|
||||||
|
case WaveTrack::SpectralSelectionDisplay: view = wxT("\"Spectral Selection\""); break;
|
||||||
|
case WaveTrack::SpectralSelectionLogDisplay: view = wxT("\"Spectral Selection log(f)\""); break;
|
||||||
case WaveTrack::PitchDisplay: view = wxT("\"Pitch (EAC)\""); break;
|
case WaveTrack::PitchDisplay: view = wxT("\"Pitch (EAC)\""); break;
|
||||||
default: view = wxT("NIL"); break;
|
default: view = wxT("NIL"); break;
|
||||||
}
|
}
|
||||||
|
@ -48,17 +48,22 @@ void TracksPrefs::Populate()
|
|||||||
mSoloChoices.Add(_("None"));
|
mSoloChoices.Add(_("None"));
|
||||||
|
|
||||||
|
|
||||||
// Keep the same order as in TrackPanel.cpp menu: OnWaveformID, OnWaveformDBID, OnSpectrumID, OnSpectrumLogID, OnPitchID
|
// Keep the same order as in TrackPanel.cpp menu: OnWaveformID, OnWaveformDBID, OnSpectrumID, OnSpectrumLogID,
|
||||||
|
// OnSpectralSelID, OnSpectralSelLogID, OnPitchID
|
||||||
mViewCodes.Add(0);
|
mViewCodes.Add(0);
|
||||||
mViewCodes.Add(1);
|
mViewCodes.Add(1);
|
||||||
mViewCodes.Add(2);
|
mViewCodes.Add(2);
|
||||||
mViewCodes.Add(3);
|
mViewCodes.Add(3);
|
||||||
mViewCodes.Add(4);
|
mViewCodes.Add(4);
|
||||||
|
mViewCodes.Add(5);
|
||||||
|
mViewCodes.Add(6);
|
||||||
|
|
||||||
mViewChoices.Add(_("Waveform"));
|
mViewChoices.Add(_("Waveform"));
|
||||||
mViewChoices.Add(_("Waveform (dB)"));
|
mViewChoices.Add(_("Waveform (dB)"));
|
||||||
mViewChoices.Add(_("Spectrogram"));
|
mViewChoices.Add(_("Spectrogram"));
|
||||||
mViewChoices.Add(_("Spectrogram log(f)"));
|
mViewChoices.Add(_("Spectrogram log(f)"));
|
||||||
|
mViewChoices.Add(_("Spectral Selection"));
|
||||||
|
mViewChoices.Add(_("Spectrogram Selection log(f)"));
|
||||||
mViewChoices.Add(_("Pitch (EAC)"));
|
mViewChoices.Add(_("Pitch (EAC)"));
|
||||||
|
|
||||||
//------------------------- Main section --------------------
|
//------------------------- Main section --------------------
|
||||||
|
@ -198,7 +198,7 @@ void SpectralSelectionBar::UpdatePrefs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set label to pull in language change
|
// Set label to pull in language change
|
||||||
SetLabel(_("SpectralSelection"));
|
SetLabel(_("Spectral Selection"));
|
||||||
|
|
||||||
// Give base class a chance
|
// Give base class a chance
|
||||||
ToolBar::UpdatePrefs();
|
ToolBar::UpdatePrefs();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user