14#include "../../../HitTestResult.h"
17#include "../../../RefreshCode.h"
19#include "../../../widgets/PopupMenuTable.h"
23#include <wx/spinctrl.h>
59 long lower = (long)(track.GetRangeLower() * 100.0 + 0.5);
60 long upper = (long)(track.GetRangeUpper() * 100.0 + 0.5);
71 S.StartVerticalLay(
true);
73 S.StartStatic(
XO(
"Change speed limit (%) to:"),1);
75 S.StartMultiColumn(2, wxEXPAND);
80 S.AddPrompt(
XXO(
"Lower Speed Limit"));
81 scLower =
safenew wxSpinCtrl(
S.GetParent(), wxID_ANY,
88 .Name(
XO(
"Lower Speed Limit"))
89 .Position( wxALIGN_LEFT | wxALL )
92 S.AddPrompt(
XXO(
"Upper Speed Limit"));
93 scUpper =
safenew wxSpinCtrl(
S.GetParent(), wxID_ANY,
100 .Name(
XO(
"Upper Speed Limit"))
101 .Position( wxALIGN_LEFT | wxALL )
108 S.AddStandardButtons();
114 dlg.CenterOnParent();
115 if (dlg.ShowModal() == wxID_CANCEL)
118 while(scLower->GetValue() >= scUpper->GetValue()) {
120 XO(
"Upper Speed Limit must be greater than the Lower Speed Limit"),
121 XO(
"Invalid Limits"),
125 if (dlg.ShowModal() == wxID_CANCEL)
129 lower = scLower->GetValue();
130 upper = scUpper->GetValue();
135 track.SetRangeLower((
double)lower / 100.0);
136 track.SetRangeUpper((
double)upper / 100.0);
151 .
PushState(
XO(
"Set time track display to linear"),
XO(
"Set Display"));
163 .
PushState(
XO(
"Set time track display to logarithmic"),
XO(
"Set Display"));
173 if (track.GetInterpolateLog()) {
174 track.SetInterpolateLog(
false);
176 .
PushState(
XO(
"Set time track interpolation to linear"),
XO(
"Set Interpolation"));
179 track.SetInterpolateLog(
true);
181 PushState(
XO(
"Set time track interpolation to logarithmic"),
XO(
"Set Interpolation"));
226 return std::make_shared<TimeTrackControls>( track.SharedPointer() );
230#include "../../ui/ChannelView.h"
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
XXO("&Cut/Copy/Paste Toolbar")
AppendCheckItem("LogInterp", OnTimeTrackLogIntID, XXO("Logarithmic &Interpolation"), POPUP_MENU_FN(OnTimeTrackLogInt), [](PopupMenuHandler &handler, wxMenu &menu, int id){ menu.Check(id, findTrack(handler).GetInterpolateLog());})
AppendRadioItem("Linear", OnTimeTrackLinID, XXO("&Linear scale"), POPUP_MENU_FN(OnTimeTrackLin), [](PopupMenuHandler &handler, wxMenu &menu, int id){ menu.Check(id, !findTrack(handler).GetDisplayLog());})
DEFINE_ATTACHED_VIRTUAL_OVERRIDE(DoGetTimeTrackControls)
static const auto findTrack
AppendItem("Range", OnSetTimeTrackRangeID, XXO("&Range..."), POPUP_MENU_FN(OnSetTimeTrackRange))
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
virtual std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *) override=0
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
static ProjectHistory & Get(AudacityProject &project)
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *pProject) override
static const int kRangeMin
static const int kRangeMax
~TimeTrackControls() override
A kind of Track used to 'warp time'.
void SetDisplayLog(bool displayLog)
Abstract base class for an object holding data associated with points on a time axis.
void SetName(const TranslatableString &title)
Namespace containing an enum 'what to do on a refresh?'.
AuthorizationHandler handler
For defining overrides of the method.