14#include <wx/textctrl.h>
22 parent, wxID_ANY,
XO(
"Change Speed"), wxDefaultPosition, { 480, 250 },
23 wxDEFAULT_DIALOG_STYLE)
24 , mTrack { waveTrack }
25 , mTrackInterval { interval }
26 , mClipSpeed { 100.0 / interval.GetStretchRatio() }
27 , mOldClipSpeed { mClipSpeed }
33 PopulateOrExchange(s);
39 assert(mOldClipSpeed > 0.0);
49 if (!IsEscapeKey(evt))
55 EndModal(wxID_CANCEL);
74 ->Bind(wxEVT_TEXT_ENTER, [
this](
auto&) {
OnOk(); });
93 ->Bind(wxEVT_BUTTON, [
this](
auto&) { EndModal(wxID_CANCEL); });
98 okBtn->Bind(wxEVT_BUTTON, [
this](
auto&) {
OnOk(); });
126 XO(
"Clip speed must be a positive value"), {});
132 const auto maxEndTime = nextClip !=
nullptr ?
134 std::numeric_limits<double>::infinity();
139 const auto expectedEndTime =
142 if (expectedEndTime >= maxEndTime)
146 XO(
"There is not enough space to stretch the clip to the selected speed"), {});
XXO("&Cut/Copy/Paste Toolbar")
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
WaveTrack::Interval & mTrackInterval
bool SetClipSpeedFromDialog()
ChangeClipSpeedDialog(WaveTrack &track, WaveTrack::Interval &interval, wxWindow *parent=nullptr)
~ChangeClipSpeedDialog() override
void PopulateOrExchange(ShuttleGui &s)
void SetBorder(int Border)
wxStaticText * AddPrompt(const TranslatableString &Prompt, int wrapWidth=0)
Right aligned text string.
wxPanel * StartInvisiblePanel(int border=0)
void StartVerticalLay(int iProp=1)
wxButton * AddButton(const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, int &Value, const int nChars=0, bool acceptEnter=false)
void AddFixedText(const TranslatableString &Str, bool bCenter=false, int wrapWidth=0)
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
ShuttleGui & NameSuffix(const TranslatableString &suffix)
wxSizerItem * AddSpace(int width, int height, int prop=0)
ShuttleGui & Name(const TranslatableString &name)
double GetStretchRatio() const
void StretchRightTo(double t)
A Track that contains audio waveform data.
IntervalConstHolder GetNextInterval(const Interval &interval, PlaybackDirection searchDirection) const
void ShowErrorDialog(const WindowPlacement &placement, const TranslatableString &dlogTitle, const TranslatableString &message, const ManualPageID &helpPage, const ErrorDialogOptions &options={})
Show an error dialog with a link to the manual for further help.
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.