mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 15:49:36 +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" );
|
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 {
|
||||||
@ -622,16 +623,17 @@ BEGIN_POPUP_MENU(WaveTrackMenuTable)
|
|||||||
menu.Enable( id, false );
|
menu.Enable( id, false );
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
Append( [type, id]( My &table ) -> Registry::BaseItemPtr {
|
if( id < OnSetDisplayId + 2 )
|
||||||
const auto pTrack = &table.FindWaveTrack();
|
Append( [type, id]( My &table ) -> Registry::BaseItemPtr {
|
||||||
const auto &view = WaveTrackView::Get( *pTrack );
|
const auto pTrack = &table.FindWaveTrack();
|
||||||
const auto itemType =
|
const auto &view = WaveTrackView::Get( *pTrack );
|
||||||
view.GetMultiView() ? Entry::CheckItem : Entry::RadioItem;
|
const auto itemType =
|
||||||
return std::make_unique<Entry>( type.name.Internal(), itemType,
|
view.GetMultiView() ? Entry::CheckItem : Entry::RadioItem;
|
||||||
id, type.name.Msgid(),
|
return std::make_unique<Entry>( type.name.Internal(), itemType,
|
||||||
POPUP_MENU_FN( OnSetDisplay ), table,
|
id, type.name.Msgid(),
|
||||||
initFn( !view.GetMultiView() ) );
|
POPUP_MENU_FN( OnSetDisplay ), table,
|
||||||
} );
|
initFn( !view.GetMultiView() ) );
|
||||||
|
} );
|
||||||
++id;
|
++id;
|
||||||
}
|
}
|
||||||
BeginSection( "Extra" );
|
BeginSection( "Extra" );
|
||||||
@ -746,8 +748,16 @@ 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,6 +929,12 @@ 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,9 +29,11 @@ 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 = Spectrum,
|
MaxDisplay = Multiview,
|
||||||
|
|
||||||
NoDisplay, // Preview track has no display
|
NoDisplay, // Preview track has no display
|
||||||
};
|
};
|
||||||
|
@ -36,12 +36,18 @@ 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 sType{
|
static WaveTrackSubView::Type sTypeWave{
|
||||||
WaveTrackViewConstants::Waveform,
|
WaveTrackViewConstants::Waveform,
|
||||||
{ wxT("Waveform"), XXO("Wa&veform") }
|
{ 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;
|
WaveformView::~WaveformView() = default;
|
||||||
|
|
||||||
@ -128,7 +134,7 @@ void WaveformView::DoSetMinimized( bool minimized )
|
|||||||
|
|
||||||
auto WaveformView::SubViewType() const -> const Type &
|
auto WaveformView::SubViewType() const -> const Type &
|
||||||
{
|
{
|
||||||
return sType;
|
return sTypeWave;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<TrackVRulerControls> WaveformView::DoGetVRulerControls()
|
std::shared_ptr<TrackVRulerControls> WaveformView::DoGetVRulerControls()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user