mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-05 22:28:57 +02:00
Revert "Fix for keyboard commands for time shifting clips"
This reverts commit b91160795dedce54745102027f8bb0908828772a.
This commit is contained in:
parent
7900aa51ba
commit
d36ac2cedb
@ -1438,8 +1438,8 @@ void AudacityProject::CreateMenusAndCommands()
|
|||||||
c->AddItem(wxT("CursorLongJumpLeft"), _("Cursor Long Jump Left"), FN(OnCursorLongJumpLeft), wxT("Shift+,"));
|
c->AddItem(wxT("CursorLongJumpLeft"), _("Cursor Long Jump Left"), FN(OnCursorLongJumpLeft), wxT("Shift+,"));
|
||||||
c->AddItem(wxT("CursorLongJumpRight"), _("Cursor Long Jump Right"), FN(OnCursorLongJumpRight), wxT("Shift+."));
|
c->AddItem(wxT("CursorLongJumpRight"), _("Cursor Long Jump Right"), FN(OnCursorLongJumpRight), wxT("Shift+."));
|
||||||
|
|
||||||
c->AddItem(wxT("ClipLeft"), _("Clip Left"), FN(OnClipLeft), wxT("\twantKeyup"));
|
c->AddItem(wxT("ClipLeft"), _("Clip Left"), FN(OnClipLeft), wxT(""));
|
||||||
c->AddItem(wxT("ClipRight"), _("Clip Right"), FN(OnClipRight), wxT("\twantKeyup"));
|
c->AddItem(wxT("ClipRight"), _("Clip Right"), FN(OnClipRight), wxT(""));
|
||||||
c->EndSubMenu();
|
c->EndSubMenu();
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
@ -3081,26 +3081,14 @@ void AudacityProject::OnSelContractRight(const wxEvent * evt)
|
|||||||
OnCursorLeft( true, true, bKeyUp );
|
OnCursorLeft( true, true, bKeyUp );
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudacityProject::OnClipLeft(const wxEvent* evt)
|
void AudacityProject::OnClipLeft()
|
||||||
{
|
{
|
||||||
if (evt) {
|
mTrackPanel->OnClipMove(false);
|
||||||
mTrackPanel->OnClipMove(false, evt->GetEventType() == wxEVT_KEY_UP);
|
|
||||||
}
|
|
||||||
else { // called from menu item, so simulate keydown and keyup
|
|
||||||
mTrackPanel->OnClipMove(false, false);
|
|
||||||
mTrackPanel->OnClipMove(false, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudacityProject::OnClipRight(const wxEvent* evt)
|
void AudacityProject::OnClipRight()
|
||||||
{
|
{
|
||||||
if (evt) {
|
mTrackPanel->OnClipMove(true);
|
||||||
mTrackPanel->OnClipMove(true, evt->GetEventType() == wxEVT_KEY_UP);
|
|
||||||
}
|
|
||||||
else { // called from menu item, so simulate keydown and keyup
|
|
||||||
mTrackPanel->OnClipMove(true, false);
|
|
||||||
mTrackPanel->OnClipMove(true, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//this pops up a dialog which allows the left selection to be set.
|
//this pops up a dialog which allows the left selection to be set.
|
||||||
|
@ -160,8 +160,8 @@ void OnSelExtendRight(const wxEvent * evt);
|
|||||||
void OnSelContractLeft(const wxEvent * evt);
|
void OnSelContractLeft(const wxEvent * evt);
|
||||||
void OnSelContractRight(const wxEvent * evt);
|
void OnSelContractRight(const wxEvent * evt);
|
||||||
|
|
||||||
void OnClipLeft(const wxEvent* evt);
|
void OnClipLeft();
|
||||||
void OnClipRight(const wxEvent* evt);
|
void OnClipRight();
|
||||||
|
|
||||||
void OnCursorShortJumpLeft();
|
void OnCursorShortJumpLeft();
|
||||||
void OnCursorShortJumpRight();
|
void OnCursorShortJumpRight();
|
||||||
|
@ -455,7 +455,6 @@ TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id,
|
|||||||
|
|
||||||
mMouseCapture = IsUncaptured;
|
mMouseCapture = IsUncaptured;
|
||||||
mSlideUpDownOnly = false;
|
mSlideUpDownOnly = false;
|
||||||
mHSlideAmountTotal = 0.0;
|
|
||||||
mLabelTrackStartXPos=-1;
|
mLabelTrackStartXPos=-1;
|
||||||
mCircularTrackNavigation = false;
|
mCircularTrackNavigation = false;
|
||||||
|
|
||||||
@ -3984,28 +3983,11 @@ void TrackPanel::DoSlideHorizontal()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackPanel::OnClipMove(bool right, bool keyUp)
|
void TrackPanel::OnClipMove(bool right)
|
||||||
{
|
{
|
||||||
if (keyUp) {
|
|
||||||
if (mHSlideAmountTotal != 0.0) {
|
|
||||||
wxString message;
|
|
||||||
message.Printf(wxT("%s %s %.03f %s"),
|
|
||||||
_("Time shifted clips"),
|
|
||||||
mHSlideAmountTotal > 0 ?
|
|
||||||
/* i18n-hint: a direction as in left or right */
|
|
||||||
_("right") :
|
|
||||||
/* i18n-hint: a direction as in left or right */
|
|
||||||
_("left"),
|
|
||||||
fabs(mHSlideAmountTotal),
|
|
||||||
_("seconds"));
|
|
||||||
MakeParentPushState(message, _("Time-Shift"), UndoPush::CONSOLIDATE);
|
|
||||||
mHSlideAmountTotal = 0.0;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto track = GetFocusedTrack();
|
auto track = GetFocusedTrack();
|
||||||
|
|
||||||
|
|
||||||
// just dealing with clips in wave tracks for the moment. Note tracks??
|
// just dealing with clips in wave tracks for the moment. Note tracks??
|
||||||
if (track && track->GetKind() == Track::Wave) {
|
if (track && track->GetKind() == Track::Wave) {
|
||||||
auto wt = static_cast<WaveTrack*>(track);
|
auto wt = static_cast<WaveTrack*>(track);
|
||||||
@ -4034,7 +4016,6 @@ void TrackPanel::OnClipMove(bool right, bool keyUp)
|
|||||||
|
|
||||||
mHSlideAmount = desiredSlideAmount;
|
mHSlideAmount = desiredSlideAmount;
|
||||||
DoSlideHorizontal();
|
DoSlideHorizontal();
|
||||||
mHSlideAmountTotal += mHSlideAmount;
|
|
||||||
|
|
||||||
// update t0 and t1. There is the possibility that the updated
|
// update t0 and t1. There is the possibility that the updated
|
||||||
// t0 may no longer be within the clip due to rounding errors,
|
// t0 may no longer be within the clip due to rounding errors,
|
||||||
|
@ -256,7 +256,7 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
|
|||||||
// (ignoring any fisheye)
|
// (ignoring any fisheye)
|
||||||
virtual double GetScreenEndTime() const;
|
virtual double GetScreenEndTime() const;
|
||||||
|
|
||||||
virtual void OnClipMove(bool right, bool keyUp);
|
virtual void OnClipMove(bool right);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual MixerBoard* GetMixerBoard();
|
virtual MixerBoard* GetMixerBoard();
|
||||||
@ -682,8 +682,6 @@ protected:
|
|||||||
// us to undo the slide and then slide it by another amount
|
// us to undo the slide and then slide it by another amount
|
||||||
double mHSlideAmount;
|
double mHSlideAmount;
|
||||||
|
|
||||||
double mHSlideAmountTotal; // used for sliding horizontally using the keyboard
|
|
||||||
|
|
||||||
bool mDidSlideVertically;
|
bool mDidSlideVertically;
|
||||||
|
|
||||||
bool mRedrawAfterStop;
|
bool mRedrawAfterStop;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user