mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 15:49:41 +02:00
Bug 2493 - No command for setting multi-view
Bug 2460 - Enh: Can't select "Multi-view" as default view mode in Tracks preferences This fixes both.
This commit is contained in:
parent
a20f1cdf13
commit
7e573b9b2f
@ -568,6 +568,7 @@ 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 {
|
||||
@ -622,6 +623,7 @@ 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 );
|
||||
@ -746,8 +748,16 @@ 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,6 +929,12 @@ 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,9 +29,11 @@ namespace WaveTrackViewConstants
|
||||
obsolete3, // was SpectralSelectionLogDisplay
|
||||
obsolete4, // was PitchDisplay
|
||||
|
||||
Multiview,
|
||||
|
||||
// Add values here, and update MaxDisplay.
|
||||
|
||||
MaxDisplay = Spectrum,
|
||||
MaxDisplay = Multiview,
|
||||
|
||||
NoDisplay, // Preview track has no display
|
||||
};
|
||||
|
@ -36,12 +36,18 @@ Paul Licameli split from WaveTrackView.cpp
|
||||
#include <wx/graphics.h>
|
||||
#include <wx/dc.h>
|
||||
|
||||
static WaveTrackSubView::Type sType{
|
||||
static WaveTrackSubView::Type sTypeWave{
|
||||
WaveTrackViewConstants::Waveform,
|
||||
{ wxT("Waveform"), XXO("Wa&veform") }
|
||||
};
|
||||
|
||||
static WaveTrackSubViewType::RegisteredType reg{ sType };
|
||||
static WaveTrackSubView::Type sTypeMulti{
|
||||
WaveTrackViewConstants::Multiview,
|
||||
{ wxT("Multiview"), XXO("&Multi-view") }
|
||||
};
|
||||
|
||||
static WaveTrackSubViewType::RegisteredType regWave{ sTypeWave };
|
||||
static WaveTrackSubViewType::RegisteredType regMulti{ sTypeMulti };
|
||||
|
||||
WaveformView::~WaveformView() = default;
|
||||
|
||||
@ -128,7 +134,7 @@ void WaveformView::DoSetMinimized( bool minimized )
|
||||
|
||||
auto WaveformView::SubViewType() const -> const Type &
|
||||
{
|
||||
return sType;
|
||||
return sTypeWave;
|
||||
}
|
||||
|
||||
std::shared_ptr<TrackVRulerControls> WaveformView::DoGetVRulerControls()
|
||||
|
Loading…
x
Reference in New Issue
Block a user