1
0
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:
Paul Licameli 2017-05-18 07:06:22 -04:00
parent 7900aa51ba
commit d36ac2cedb
4 changed files with 11 additions and 44 deletions

View File

@ -1438,8 +1438,8 @@ void AudacityProject::CreateMenusAndCommands()
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("ClipLeft"), _("Clip Left"), FN(OnClipLeft), wxT("\twantKeyup"));
c->AddItem(wxT("ClipRight"), _("Clip Right"), FN(OnClipRight), wxT("\twantKeyup"));
c->AddItem(wxT("ClipLeft"), _("Clip Left"), FN(OnClipLeft), wxT(""));
c->AddItem(wxT("ClipRight"), _("Clip Right"), FN(OnClipRight), wxT(""));
c->EndSubMenu();
//////////////////////////////////////////////////////////////////////////
@ -3081,26 +3081,14 @@ void AudacityProject::OnSelContractRight(const wxEvent * evt)
OnCursorLeft( true, true, bKeyUp );
}
void AudacityProject::OnClipLeft(const wxEvent* evt)
void AudacityProject::OnClipLeft()
{
if (evt) {
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);
}
mTrackPanel->OnClipMove(false);
}
void AudacityProject::OnClipRight(const wxEvent* evt)
void AudacityProject::OnClipRight()
{
if (evt) {
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);
}
mTrackPanel->OnClipMove(true);
}
//this pops up a dialog which allows the left selection to be set.

View File

@ -160,8 +160,8 @@ void OnSelExtendRight(const wxEvent * evt);
void OnSelContractLeft(const wxEvent * evt);
void OnSelContractRight(const wxEvent * evt);
void OnClipLeft(const wxEvent* evt);
void OnClipRight(const wxEvent* evt);
void OnClipLeft();
void OnClipRight();
void OnCursorShortJumpLeft();
void OnCursorShortJumpRight();

View File

@ -455,7 +455,6 @@ TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id,
mMouseCapture = IsUncaptured;
mSlideUpDownOnly = false;
mHSlideAmountTotal = 0.0;
mLabelTrackStartXPos=-1;
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();
// just dealing with clips in wave tracks for the moment. Note tracks??
if (track && track->GetKind() == Track::Wave) {
auto wt = static_cast<WaveTrack*>(track);
@ -4034,7 +4016,6 @@ void TrackPanel::OnClipMove(bool right, bool keyUp)
mHSlideAmount = desiredSlideAmount;
DoSlideHorizontal();
mHSlideAmountTotal += mHSlideAmount;
// update t0 and t1. There is the possibility that the updated
// t0 may no longer be within the clip due to rounding errors,

View File

@ -256,7 +256,7 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
// (ignoring any fisheye)
virtual double GetScreenEndTime() const;
virtual void OnClipMove(bool right, bool keyUp);
virtual void OnClipMove(bool right);
protected:
virtual MixerBoard* GetMixerBoard();
@ -682,8 +682,6 @@ protected:
// us to undo the slide and then slide it by another amount
double mHSlideAmount;
double mHSlideAmountTotal; // used for sliding horizontally using the keyboard
bool mDidSlideVertically;
bool mRedrawAfterStop;