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