Revert "Bug 2493 - No command for setting multi-view"
This reverts commit 7e573b9b2f
.
This commit is contained in:
parent
f06b9a9c71
commit
42d99db8b8
|
@ -568,7 +568,6 @@ BEGIN_POPUP_MENU(WaveTrackMenuTable)
|
|||
};
|
||||
|
||||
BeginSection( "SubViews" );
|
||||
|
||||
// Multi-view check mark item, if more than one track sub-view type is
|
||||
// known
|
||||
Append( []( My &table ) -> Registry::BaseItemPtr {
|
||||
|
@ -623,17 +622,16 @@ BEGIN_POPUP_MENU(WaveTrackMenuTable)
|
|||
menu.Enable( id, false );
|
||||
};
|
||||
};
|
||||
if( id < OnSetDisplayId + 2 )
|
||||
Append( [type, id]( My &table ) -> Registry::BaseItemPtr {
|
||||
const auto pTrack = &table.FindWaveTrack();
|
||||
const auto &view = WaveTrackView::Get( *pTrack );
|
||||
const auto itemType =
|
||||
view.GetMultiView() ? Entry::CheckItem : Entry::RadioItem;
|
||||
return std::make_unique<Entry>( type.name.Internal(), itemType,
|
||||
id, type.name.Msgid(),
|
||||
POPUP_MENU_FN( OnSetDisplay ), table,
|
||||
initFn( !view.GetMultiView() ) );
|
||||
} );
|
||||
Append( [type, id]( My &table ) -> Registry::BaseItemPtr {
|
||||
const auto pTrack = &table.FindWaveTrack();
|
||||
const auto &view = WaveTrackView::Get( *pTrack );
|
||||
const auto itemType =
|
||||
view.GetMultiView() ? Entry::CheckItem : Entry::RadioItem;
|
||||
return std::make_unique<Entry>( type.name.Internal(), itemType,
|
||||
id, type.name.Msgid(),
|
||||
POPUP_MENU_FN( OnSetDisplay ), table,
|
||||
initFn( !view.GetMultiView() ) );
|
||||
} );
|
||||
++id;
|
||||
}
|
||||
BeginSection( "Extra" );
|
||||
|
@ -748,16 +746,8 @@ void WaveTrackMenuTable::OnSetDisplay(wxCommandEvent & event)
|
|||
const auto pTrack = static_cast<WaveTrack*>(mpData->pTrack);
|
||||
|
||||
auto id = AllTypes()[ idInt - OnSetDisplayId ].id;
|
||||
|
||||
auto &view = WaveTrackView::Get( *pTrack );
|
||||
|
||||
if (id == WaveTrackViewConstants::Multiview)
|
||||
{
|
||||
// Only set it to multiview, if not already multi view.
|
||||
if( !view.GetMultiView() )
|
||||
OnMultiView(event);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( view.GetMultiView() ) {
|
||||
for (auto channel : TrackList::Channels(pTrack)) {
|
||||
if ( !WaveTrackView::Get( *channel )
|
||||
|
|
|
@ -929,12 +929,6 @@ bool WaveTrackView::ToggleSubView(Display display)
|
|||
// Be sure the sequence in which the other views appear is determinate.
|
||||
void WaveTrackView::DoSetDisplay(Display display, bool exclusive)
|
||||
{
|
||||
if (display == WaveTrackViewConstants::Multiview) {
|
||||
SetMultiView(true);
|
||||
display = WaveTrackViewConstants::Waveform;
|
||||
exclusive = false;
|
||||
}
|
||||
|
||||
// Some generality here anticipating more than two views.
|
||||
// The order of sub-views in the array is not specified, so make it definite
|
||||
// by sorting by the view type constants.
|
||||
|
|
|
@ -29,11 +29,9 @@ namespace WaveTrackViewConstants
|
|||
obsolete3, // was SpectralSelectionLogDisplay
|
||||
obsolete4, // was PitchDisplay
|
||||
|
||||
Multiview,
|
||||
|
||||
// Add values here, and update MaxDisplay.
|
||||
|
||||
MaxDisplay = Multiview,
|
||||
MaxDisplay = Spectrum,
|
||||
|
||||
NoDisplay, // Preview track has no display
|
||||
};
|
||||
|
|
|
@ -36,18 +36,12 @@ Paul Licameli split from WaveTrackView.cpp
|
|||
#include <wx/graphics.h>
|
||||
#include <wx/dc.h>
|
||||
|
||||
static WaveTrackSubView::Type sTypeWave{
|
||||
static WaveTrackSubView::Type sType{
|
||||
WaveTrackViewConstants::Waveform,
|
||||
{ wxT("Waveform"), XXO("Wa&veform") }
|
||||
};
|
||||
|
||||
static WaveTrackSubView::Type sTypeMulti{
|
||||
WaveTrackViewConstants::Multiview,
|
||||
{ wxT("Multiview"), XXO("&Multi-view") }
|
||||
};
|
||||
|
||||
static WaveTrackSubViewType::RegisteredType regWave{ sTypeWave };
|
||||
static WaveTrackSubViewType::RegisteredType regMulti{ sTypeMulti };
|
||||
static WaveTrackSubViewType::RegisteredType reg{ sType };
|
||||
|
||||
WaveformView::~WaveformView() = default;
|
||||
|
||||
|
@ -134,7 +128,7 @@ void WaveformView::DoSetMinimized( bool minimized )
|
|||
|
||||
auto WaveformView::SubViewType() const -> const Type &
|
||||
{
|
||||
return sTypeWave;
|
||||
return sType;
|
||||
}
|
||||
|
||||
std::shared_ptr<TrackVRulerControls> WaveformView::DoGetVRulerControls()
|
||||
|
|
Loading…
Reference in New Issue
Block a user