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