1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 08:27:13 +01:00

Sub-view objects report their complete type, not just an enum value

This commit is contained in:
Paul Licameli
2020-01-18 17:45:52 -05:00
parent 36aad4d1c6
commit 7cff170cf7
9 changed files with 40 additions and 29 deletions

View File

@@ -36,8 +36,11 @@ void DoNextPeakFrequency(AudacityProject &project, bool up)
const WaveTrack *pTrack {};
for ( auto wt : tracks.Selected< const WaveTrack >() ) {
const auto displays = WaveTrackView::Get( *wt ).GetDisplays();
if ( make_iterator_range( displays.begin(), displays.end() )
.contains( WaveTrackViewConstants::Spectrum) ) {
bool hasSpectrum = (displays.end() != std::find(
displays.begin(), displays.end(),
WaveTrackSubView::Type{ WaveTrackViewConstants::Spectrum, {} }
) );
if ( hasSpectrum ) {
pTrack = wt;
break;
}