1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Bug2493, Enh2460: Multi-view option in Tracks preferences & macros...

... Implemented giving the Multi-view choice the special implementation that it
needs.

The "multi" choice is always last in the preference and in the command editing
drop-down menus, but that could be changed.

Multi-view should not be treated as another registered kind of sub-view on par
with others.  This would complicate the implementation in worse ways.
This commit is contained in:
Paul Licameli
2020-09-10 14:59:17 -04:00
parent 42d99db8b8
commit c7896a3656
5 changed files with 49 additions and 7 deletions

View File

@@ -297,8 +297,10 @@ static const EnumValueSymbol kZoomTypeStrings[nZoomTypes] =
static EnumValueSymbols DiscoverSubViewTypes()
{
const auto &types = WaveTrackSubViewType::All();
return transform_container< EnumValueSymbols >(
auto result = transform_container< EnumValueSymbols >(
types, std::mem_fn( &WaveTrackSubView::Type::name ) );
result.push_back( WaveTrackViewConstants::MultiViewSymbol );
return result;
}
bool SetTrackVisualsCommand::DefineParams( ShuttleParams & S ){
@@ -374,9 +376,16 @@ bool SetTrackVisualsCommand::ApplyInner(const CommandContext & context, Track *
if( t && bHasHeight )
TrackView::Get( *t ).SetHeight( mHeight );
if( wt && bHasDisplayType )
WaveTrackView::Get( *wt ).SetDisplay(
WaveTrackSubViewType::All()[ mDisplayType ].id );
if( wt && bHasDisplayType ) {
auto &view = WaveTrackView::Get( *wt );
auto &all = WaveTrackSubViewType::All();
if (mDisplayType < all.size())
view.SetDisplay( all[ mDisplayType ].id );
else {
view.SetMultiView( true );
view.SetDisplay( WaveTrackSubViewType::Default(), false );
}
}
if( wt && bHasScaleType )
wt->GetIndependentWaveformSettings().scaleType =
(mScaleType==kLinear) ?