mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
Move choice of waveform scale from TCP menu to ruler context menu
This commit is contained in:
parent
e787694f07
commit
389d04459a
@ -152,7 +152,7 @@ const TranslatableStrings &WaveformSettings::GetScaleNames()
|
||||
static const TranslatableStrings result{
|
||||
// Keep in correspondence with enum WaveTrack::WaveTrackDisplay:
|
||||
XO("Linear"),
|
||||
XO("Logarithmic"),
|
||||
XO("dB"),
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
@ -121,7 +121,6 @@ enum {
|
||||
OnFloatID, // <---
|
||||
|
||||
OnWaveformID,
|
||||
OnWaveformDBID,
|
||||
OnSpectrumID,
|
||||
OnSpectrogramSettingsID,
|
||||
|
||||
@ -607,8 +606,7 @@ void WaveTrackMenuTable::InitMenu(Menu *pMenu, void *pUserData)
|
||||
for ( auto display : displays ) {
|
||||
checkedIds.push_back(
|
||||
display == WaveTrackViewConstants::Waveform
|
||||
? (pTrack->GetWaveformSettings().isLinear()
|
||||
? OnWaveformID : OnWaveformDBID)
|
||||
? OnWaveformID
|
||||
: OnSpectrumID);
|
||||
}
|
||||
|
||||
@ -696,7 +694,6 @@ BEGIN_POPUP_MENU(WaveTrackMenuTable)
|
||||
// spectrogram, after a mouse drag. Clicking any of these three makes that
|
||||
// view take up all the height.
|
||||
POPUP_MENU_CHECK_ITEM(OnWaveformID, XO("Wa&veform"), OnSetDisplay)
|
||||
POPUP_MENU_CHECK_ITEM(OnWaveformDBID, XO("&Waveform (dB)"), OnSetDisplay)
|
||||
POPUP_MENU_CHECK_ITEM(OnSpectrumID, XO("&Spectrogram"), OnSetDisplay)
|
||||
|
||||
POPUP_MENU_ITEM(OnSpectrogramSettingsID, XO("S&pectrogram Settings..."), OnSpectrogramSettings)
|
||||
@ -741,13 +738,10 @@ void WaveTrackMenuTable::OnSetDisplay(wxCommandEvent & event)
|
||||
wxASSERT(idInt >= OnWaveformID && idInt <= OnSpectrumID);
|
||||
const auto pTrack = static_cast<WaveTrack*>(mpData->pTrack);
|
||||
|
||||
bool linear = false;
|
||||
WaveTrackView::WaveTrackDisplay id;
|
||||
switch (idInt) {
|
||||
default:
|
||||
case OnWaveformID:
|
||||
linear = true, id = Waveform; break;
|
||||
case OnWaveformDBID:
|
||||
id = Waveform; break;
|
||||
case OnSpectrumID:
|
||||
id = Spectrum; break;
|
||||
@ -755,18 +749,11 @@ void WaveTrackMenuTable::OnSetDisplay(wxCommandEvent & event)
|
||||
|
||||
const auto displays = WaveTrackView::Get( *pTrack ).GetDisplays();
|
||||
const bool wrongType = !(displays.size() == 1 && displays[0] == id);
|
||||
const bool wrongScale =
|
||||
(id == Waveform &&
|
||||
pTrack->GetWaveformSettings().isLinear() != linear);
|
||||
if (wrongType || wrongScale) {
|
||||
if (wrongType) {
|
||||
for (auto channel : TrackList::Channels(pTrack)) {
|
||||
channel->SetLastScaleType();
|
||||
WaveTrackView::Get( *channel )
|
||||
.SetDisplay(WaveTrackView::WaveTrackDisplay(id));
|
||||
if (wrongScale)
|
||||
channel->GetIndependentWaveformSettings().scaleType = linear
|
||||
? WaveformSettings::stLinear
|
||||
: WaveformSettings::stLogarithmic;
|
||||
}
|
||||
|
||||
AudacityProject *const project = ::GetActiveProject();
|
||||
|
@ -271,12 +271,10 @@ void WaveformVRulerMenuTable::InitMenu(Menu *pMenu, void *pUserData)
|
||||
WaveTrackVRulerMenuTable::InitMenu(pMenu, pUserData);
|
||||
|
||||
// DB setting is already on track drop down.
|
||||
#if 0
|
||||
WaveTrack *const wt = mpData->pTrack;
|
||||
const int id =
|
||||
OnFirstWaveformScaleID + (int)(wt->GetWaveformSettings().scaleType);
|
||||
pMenu->Check(id, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
BEGIN_POPUP_MENU(WaveformVRulerMenuTable)
|
||||
@ -292,9 +290,7 @@ BEGIN_POPUP_MENU(WaveformVRulerMenuTable)
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_ITEM(OnZoomInVerticalID, XO("Zoom In\tLeft-Click/Left-Drag"), OnZoomInVertical)
|
||||
POPUP_MENU_ITEM(OnZoomOutVerticalID, XO("Zoom Out\tShift-Left-Click"), OnZoomOutVertical)
|
||||
// The log and linear options are already available as waveform db.
|
||||
// So don't repeat them here.
|
||||
#if 0
|
||||
|
||||
POPUP_MENU_SEPARATOR()
|
||||
{
|
||||
const auto & names = WaveformSettings::GetScaleNames();
|
||||
@ -303,7 +299,7 @@ BEGIN_POPUP_MENU(WaveformVRulerMenuTable)
|
||||
OnWaveformScaleType);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
END_POPUP_MENU()
|
||||
|
||||
#include "../../../../Project.h" // for GetActiveProject
|
||||
|
Loading…
x
Reference in New Issue
Block a user