1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 16:49:41 +02:00

Merge branch 'master' into scrubbing

This commit is contained in:
Paul Licameli 2015-05-30 00:11:11 -04:00
commit dae7992c1f
40 changed files with 29 additions and 56 deletions

0
lib-src/FileDialog/FileDialog.h Executable file → Normal file
View File

0
lib-src/FileDialog/win/FileDialogPrivate.cpp Executable file → Normal file
View File

0
src/AudacityApp.cpp Executable file → Normal file
View File

0
src/AutoRecovery.cpp Executable file → Normal file
View File

0
src/Experimental.h Executable file → Normal file
View File

0
src/FreqWindow.cpp Executable file → Normal file
View File

0
src/Menus.cpp Executable file → Normal file
View File

0
src/PluginManager.cpp Executable file → Normal file
View File

0
src/PluginManager.h Executable file → Normal file
View File

24
src/Project.cpp Executable file → Normal file
View File

@ -1879,6 +1879,9 @@ bool AudacityProject::HandleKeyDown(wxKeyEvent & event)
if (wxGetTopLevelParent(wxWindow::FindFocus()) != this)
return false;
if (event.GetKeyCode() == WXK_ESCAPE)
mTrackPanel->HandleEscapeKey(true);
if (event.GetKeyCode() == WXK_ALT)
mTrackPanel->HandleAltKey(true);
@ -1925,6 +1928,9 @@ bool AudacityProject::HandleKeyUp(wxKeyEvent & event)
if (wxGetTopLevelParent(wxWindow::FindFocus()) != this)
return false;
if (event.GetKeyCode() == WXK_ESCAPE)
mTrackPanel->HandleEscapeKey(false);
if (event.GetKeyCode() == WXK_ALT)
mTrackPanel->HandleAltKey(false);
@ -3287,10 +3293,28 @@ void AudacityProject::UnlockAllBlocks()
}
}
class ProjectDisabler
{
public:
ProjectDisabler(wxWindow *w)
: mWindow(w)
{
mWindow->GetEventHandler()->SetEvtHandlerEnabled(false);
}
~ProjectDisabler()
{
mWindow->GetEventHandler()->SetEvtHandlerEnabled(true);
}
private:
wxWindow *mWindow;
};
bool AudacityProject::Save(bool overwrite /* = true */ ,
bool fromSaveAs /* = false */,
bool bWantSaveCompressed /*= false*/)
{
ProjectDisabler disabler(this);
if (bWantSaveCompressed)
wxASSERT(fromSaveAs);
else

0
src/Project.h Executable file → Normal file
View File

0
src/ShuttleGui.cpp Executable file → Normal file
View File

59
src/TrackPanel.cpp Executable file → Normal file
View File

@ -1565,8 +1565,11 @@ void TrackPanel::MakeParentResize()
mListener->TP_HandleResize();
}
void TrackPanel::HandleEscapeKey()
void TrackPanel::HandleEscapeKey(bool down)
{
if (!down)
return;
switch (mMouseCapture)
{
case IsSelecting:
@ -6335,60 +6338,6 @@ void TrackPanel::OnKeyDown(wxKeyEvent & event)
{
Track *t = GetFocusedTrack();
if (event.GetKeyCode() == WXK_ESCAPE) {
HandleEscapeKey();
return;
}
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
#ifdef SPECTRAL_EDITING_ESC_KEY
// Test for pinning and unpinning of the center frequency
bool logF;
if (mAdjustSelectionEdges &&
event.GetKeyCode() == WXK_ESCAPE) {
if (mFreqSelMode == FREQ_SEL_SNAPPING_CENTER) {
// Toggle center snapping off
// (left click can also turn it off)
mFreqSelMode = FREQ_SEL_INVALID;
}
else if (isSpectrogramTrack(t, &logF)) {
WaveTrack *wt = static_cast<WaveTrack*>(t);
if (mFreqSelMode == FREQ_SEL_INVALID) {
// Toggle center snapping on (the only way to do this)
mFreqSelMode = FREQ_SEL_SNAPPING_CENTER;
StartSnappingFreqSelection(wt);
}
else {
// Handle ESC during frequency drag
wxMouseState state(::wxGetMouseState());
wxCoord yy = state.GetY();
ScreenToClient(NULL, &yy);
wxRect r;
if (wt == FindTrack(state.GetX(), yy, false, false, &r)) {
eFreqSelMode saveMode = mFreqSelMode;
mFreqSelMode = FREQ_SEL_PINNED_CENTER;
StartSnappingFreqSelection(wt);
MoveSnappingFreqSelection(yy, r.y, r.height, wt);
ExtendFreqSelection(yy, r.y, r.height);
UpdateSelectionDisplay();
mFreqSelMode = saveMode;
double hint = -1.0;
if (mFreqSelMode == FREQ_SEL_FREE) {
hint = PositionToFrequency
(true, yy, r.y, r.height, wt->GetRate(), logF);
}
ResetFreqSelectionPin(hint, logF);
// MakeParentModifyState(false);
}
}
// And don't skip event, yet
}
}
#endif
#endif
// Only deal with LabelTracks
if (!t || t->GetKind() != Track::Label) {
event.Skip();

2
src/TrackPanel.h Executable file → Normal file
View File

@ -182,7 +182,7 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
//virtual void SetSelectionFormat(int iformat)
//virtual void SetSnapTo(int snapto)
void HandleEscapeKey();
virtual void HandleEscapeKey(bool down);
virtual void HandleAltKey(bool down);
virtual void HandleShiftKey(bool down);
virtual void HandleControlKey(bool down);

0
src/effects/Contrast.cpp Executable file → Normal file
View File

0
src/effects/Contrast.h Executable file → Normal file
View File

0
src/effects/DtmfGen.cpp Executable file → Normal file
View File

0
src/effects/Effect.cpp Executable file → Normal file
View File

0
src/effects/Effect.h Executable file → Normal file
View File

0
src/effects/EffectManager.cpp Executable file → Normal file
View File

0
src/effects/EffectManager.h Executable file → Normal file
View File

0
src/effects/Equalization.cpp Executable file → Normal file
View File

0
src/effects/Equalization.h Executable file → Normal file
View File

0
src/effects/Noise.cpp Executable file → Normal file
View File

0
src/effects/Normalize.cpp Executable file → Normal file
View File

0
src/effects/Silence.cpp Executable file → Normal file
View File

0
src/effects/ToneGen.cpp Executable file → Normal file
View File

0
src/effects/VST/VSTEffect.cpp Executable file → Normal file
View File

0
src/effects/ladspa/LadspaEffect.cpp Executable file → Normal file
View File

0
src/effects/lv2/LV2Effect.cpp Executable file → Normal file
View File

0
src/effects/nyquist/Nyquist.cpp Executable file → Normal file
View File

0
src/effects/vamp/VampEffect.cpp Executable file → Normal file
View File

0
src/export/Export.cpp Executable file → Normal file
View File

0
src/export/ExportPCM.cpp Executable file → Normal file
View File

0
src/import/ImportOGG.cpp Executable file → Normal file
View File

0
src/prefs/ModulePrefs.cpp Executable file → Normal file
View File

0
src/prefs/ModulePrefs.h Executable file → Normal file
View File

0
src/widgets/ASlider.cpp Executable file → Normal file
View File

0
src/widgets/ProgressDialog.cpp Executable file → Normal file
View File

0
src/widgets/numformatter.cpp Executable file → Normal file
View File