From b65a3e00b7a55f413ce49922f05d0979c01c4c95 Mon Sep 17 00:00:00 2001 From: David Bailes Date: Mon, 8 Jun 2015 11:43:22 +0100 Subject: [PATCH 01/15] Screen reader fix for radio buttons in Plug-in manager dialog. When setting radio button, nvda was also reading the selected item in the list. Fix is that the accessibility object for the list item is selected by not focused. --- src/PluginManager.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index aaea17a6a..611f12ae5 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -122,7 +122,7 @@ public: // or child. virtual wxAccStatus GetValue( int childId, wxString *strValue ); - void SetSelected( int item ); + void SetSelected( int item, bool focused = true ); private: wxListCtrl *mParent; @@ -140,7 +140,7 @@ CheckListAx::~CheckListAx() { } -void CheckListAx::SetSelected( int item ) +void CheckListAx::SetSelected( int item, bool focused ) { if (mLastId != -1) { @@ -153,10 +153,13 @@ void CheckListAx::SetSelected( int item ) if (item != -1) { - NotifyEvent( wxACC_EVENT_OBJECT_FOCUS, - mParent, - wxOBJID_CLIENT, - item + 1 ); + if (focused) + { + NotifyEvent( wxACC_EVENT_OBJECT_FOCUS, + mParent, + wxOBJID_CLIENT, + item + 1 ); + } NotifyEvent( wxACC_EVENT_OBJECT_SELECTION, mParent, @@ -747,7 +750,7 @@ void PluginRegistrationDialog::RegenerateEffectsList(int filter) // mEffects->SetFocus(); mEffects->SetItemState(0, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED); #if wxUSE_ACCESSIBILITY - mAx->SetSelected(0); + mAx->SetSelected(0, false); #endif } } From d395a61450f327e7e942821cc0dd6bfa1eb2e973 Mon Sep 17 00:00:00 2001 From: David Bailes Date: Mon, 8 Jun 2015 12:33:20 +0100 Subject: [PATCH 02/15] Fix for initial width of actual rate field of status bar. This was too big, and causing messages in the main field to be truncated. --- src/Project.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Project.cpp b/src/Project.cpp index 9cef7d3c6..2a37d66a5 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -1021,7 +1021,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id, mTrackFactory = new TrackFactory(mDirManager); - int widths[] = {0, GetControlToolBar()->WidthForStatusBar(mStatusBar), -2, -1}; + int widths[] = {0, GetControlToolBar()->WidthForStatusBar(mStatusBar), -1, 150}; mStatusBar->SetStatusWidths(4, widths); wxString msg = wxString::Format(_("Welcome to Audacity version %s"), AUDACITY_VERSION_STRING); From 0bed89419f254f15a04cb242e43b8117b29a2190 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 8 Jun 2015 09:50:43 -0400 Subject: [PATCH 03/15] More for bug 1014: stop scrubbing when switching out of select tool... ... Verified that this works for presses on tool buttons, and keys A, D, F1, ..., F6. Also fix conditional compilation with EXPERIMENTAL_SCRUBBING_BASIC not defined. --- src/Experimental.h | 16 ++++++++-------- src/TrackPanel.cpp | 10 ++++++++-- src/TrackPanel.h | 2 ++ src/toolbars/ToolsToolBar.cpp | 29 ++++++++++++++++++++++++++++- 4 files changed, 46 insertions(+), 11 deletions(-) diff --git a/src/Experimental.h b/src/Experimental.h index cbdefb7bd..3f271f1f2 100644 --- a/src/Experimental.h +++ b/src/Experimental.h @@ -172,14 +172,14 @@ // Paul Licameli (PRL) 16 Apr 2015 // Support for scrubbing in the AudioIO engine, without calls to it #define EXPERIMENTAL_SCRUBBING_SUPPORT - -// The following enable parts of the scrubbing user interface. -// You must define EXPERIMENTAL_SCRUBBING_SUPPORT if you enable this: -#define EXPERIMENTAL_SCRUBBING_BASIC -// You must define EXPERIMENTAL_SCRUBBING_BASIC if you enable this: -#define EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL -// You must define EXPERIMENTAL_SCRUBBING_BASIC if you enable this: -#define EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL +#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT + // The following enable parts of the scrubbing user interface. + #define EXPERIMENTAL_SCRUBBING_BASIC + #ifdef EXPERIMENTAL_SCRUBBING_BASIC + #define EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL + #define EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL + #endif +#endif // Paul Licameli (PRL) 24 May 2015 // Allow scrolling up to one half of a screenful beyond either end of the project, diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 209eff2ff..8ae4f3712 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -1952,9 +1952,13 @@ void TrackPanel::SetCursorAndTipWhenSelectTool( Track * t, // choose boundaries only in snapping tolerance, // and may choose center. // But don't change the cursor when scrubbing. - SelectionBoundary boundary = IsScrubbing() + SelectionBoundary boundary = +#ifdef EXPERIMENTAL_SCRUBBING_BASIC + IsScrubbing() ? SBNone - : ChooseBoundary(event, t, r, !bShiftDown, !bShiftDown); + : +#endif + ChooseBoundary(event, t, r, !bShiftDown, !bShiftDown); #ifdef USE_MIDI // The MIDI HitTest will only succeed if we are on a midi track, so @@ -6852,6 +6856,7 @@ void TrackPanel::HandleTrackSpecificMouseEvent(wxMouseEvent & event) return; } +#ifdef EXPERIMENTAL_SCRUBBING_BASIC if ((!pTrack || pTrack->GetKind() == Track::Wave) && IsScrubbing()) { @@ -6862,6 +6867,7 @@ void TrackPanel::HandleTrackSpecificMouseEvent(wxMouseEvent & event) else if (event.LeftIsDown()) return; } +#endif if (pTrack && (pTrack->GetKind() == Track::Wave) && (mMouseCapture == IsUncaptured || mMouseCapture == IsOverCutLine || diff --git a/src/TrackPanel.h b/src/TrackPanel.h index 3b7510f24..80800b03c 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -316,7 +316,9 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel { ); bool MaybeStartScrubbing(wxMouseEvent &event); bool ContinueScrubbing(wxCoord position, bool hasFocus, bool seek); +public: bool StopScrubbing(); +protected: #endif virtual void SelectionHandleClick(wxMouseEvent &event, diff --git a/src/toolbars/ToolsToolBar.cpp b/src/toolbars/ToolsToolBar.cpp index e3d3998c9..a25276e71 100644 --- a/src/toolbars/ToolsToolBar.cpp +++ b/src/toolbars/ToolsToolBar.cpp @@ -33,6 +33,7 @@ #include "../Audacity.h" +#include "ToolsToolBar.h" // For compilers that support precompilation, includes "wx/wx.h". #include @@ -46,12 +47,14 @@ #include #include "MeterToolBar.h" -#include "ToolsToolBar.h" #include "../Prefs.h" #include "../AllThemeResources.h" #include "../ImageManipulation.h" #include "../Project.h" +#ifdef EXPERIMENTAL_SCRUBBING_BASIC +#include "../TrackPanel.h" +#endif #include "../Theme.h" #include "../widgets/AButton.h" @@ -215,6 +218,18 @@ void ToolsToolBar::SetCurrentTool(int tool, bool show) //In multi-mode the current tool is shown by the //cursor icon. The buttons are not updated. +#ifdef EXPERIMENTAL_SCRUBBING_BASIC + if (tool != selectTool) { + AudacityProject *p = GetActiveProject(); + if (p) { + TrackPanel *tp = p->GetTrackPanel(); + if (tp) { + tp->StopScrubbing(); + } + } + } +#endif + bool leavingMulticlipMode = IsDown(multiTool) && show && tool != multiTool; @@ -278,6 +293,18 @@ void ToolsToolBar::OnTool(wxCommandEvent & evt) else mTool[i]->PopUp(); +#ifdef EXPERIMENTAL_SCRUBBING_BASIC + if (0 != mCurrentTool) { + AudacityProject *p = GetActiveProject(); + if (p) { + TrackPanel *tp = p->GetTrackPanel(); + if (tp) { + tp->StopScrubbing(); + } + } + } +#endif + RedrawAllProjects(); gPrefs->Write(wxT("/GUI/ToolBars/Tools/MultiToolActive"), From 7d3c055200bcad0d05f42e27ddfac8b553f11da1 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Tue, 9 Jun 2015 00:36:57 -0500 Subject: [PATCH 04/15] Fix for bug #1017 --- src/PluginManager.cpp | 11 +++++++---- src/PluginManager.h | 2 +- src/effects/LoadEffects.cpp | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index 611f12ae5..be4deaf50 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -1346,14 +1346,17 @@ void PluginDescriptor::SetImporterExtensions(const wxArrayString & extensions) // // ============================================================================ -bool PluginManager::IsPluginRegistered(const PluginID & ID) +bool PluginManager::IsPluginRegistered(const wxString & path) { - if (mPlugins.find(ID) == mPlugins.end()) + for (PluginMap::iterator iter = mPlugins.begin(); iter != mPlugins.end(); ++iter) { - return false; + if (iter->second.GetPath().IsSameAs(path)) + { + return true; + } } - return true; + return false; } const PluginID & PluginManager::RegisterPlugin(ModuleInterface *module) diff --git a/src/PluginManager.h b/src/PluginManager.h index 4c18c2f0d..5b7b61f83 100644 --- a/src/PluginManager.h +++ b/src/PluginManager.h @@ -172,7 +172,7 @@ public: // PluginManagerInterface implementation - virtual bool IsPluginRegistered(const PluginID & ID); + virtual bool IsPluginRegistered(const wxString & path); virtual const PluginID & RegisterPlugin(ModuleInterface *module); virtual const PluginID & RegisterPlugin(ModuleInterface *provider, EffectIdentInterface *effect); diff --git a/src/effects/LoadEffects.cpp b/src/effects/LoadEffects.cpp index fc171765b..614f47f14 100644 --- a/src/effects/LoadEffects.cpp +++ b/src/effects/LoadEffects.cpp @@ -288,11 +288,11 @@ bool BuiltinEffectsModule::AutoRegisterPlugins(PluginManagerInterface & pm) { for (size_t i = 0; i < WXSIZEOF(kEffectNames); i++) { - PluginID ID(wxString(BUILTIN_EFFECT_PREFIX) + kEffectNames[i]); + wxString path(wxString(BUILTIN_EFFECT_PREFIX) + kEffectNames[i]); - if (!pm.IsPluginRegistered(ID)) + if (!pm.IsPluginRegistered(path)) { - RegisterPlugin(pm, ID); + RegisterPlugin(pm, path); } } From 19baefd1862e15d850d4a2ddfd67beff0e3991b3 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Tue, 9 Jun 2015 12:35:01 -0500 Subject: [PATCH 05/15] Change plugin manager title --- src/PluginManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index be4deaf50..99c6d5c4c 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -476,7 +476,7 @@ END_EVENT_TABLE() PluginRegistrationDialog::PluginRegistrationDialog(wxWindow *parent, EffectType type) : wxDialog(parent, wxID_ANY, - _("Plug-in Manager: Effects"), + _("Plug-in Manager: Effects, Generators and Analyzers"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { From f040dd75b04d1d0dbee3232070b7a805cb69a41d Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Tue, 9 Jun 2015 12:48:16 -0500 Subject: [PATCH 06/15] Change accessible title as well --- src/PluginManager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index 99c6d5c4c..2f682d98b 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -482,8 +482,7 @@ PluginRegistrationDialog::PluginRegistrationDialog(wxWindow *parent, EffectType { mType = type; mEffects = NULL; - SetLabel(_("Plug-in Manager: Effects")); // Provide visual label - SetName(_("Plug-in Manager: Effects")); // Provide audible label + SetLabel(GetTitle()); mStates.SetCount(STATE_COUNT); mStates[STATE_Enabled] = _("Enabled"); From 2e06d9c4fec744ca2d0b7c91734edebea4e505c8 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 9 Jun 2015 13:59:25 -0400 Subject: [PATCH 07/15] class not struct, minor change --- src/prefs/SpectrumPrefs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/prefs/SpectrumPrefs.h b/src/prefs/SpectrumPrefs.h index 9a3ad1370..61cc0f89b 100644 --- a/src/prefs/SpectrumPrefs.h +++ b/src/prefs/SpectrumPrefs.h @@ -74,8 +74,9 @@ class SpectrumPrefs:public PrefsPanel }; -struct SpectrogramSettings +class SpectrogramSettings { +public: static SpectrogramSettings &defaults(); SpectrogramSettings(); ~SpectrogramSettings(); From e8d676c96198f9a2f2a6e4ef8a65093f612751bb Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 9 Jun 2015 14:22:13 -0400 Subject: [PATCH 08/15] fix compilation warning --- src/WaveClip.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/WaveClip.cpp b/src/WaveClip.cpp index ad59a8954..95a50d5ac 100644 --- a/src/WaveClip.cpp +++ b/src/WaveClip.cpp @@ -964,7 +964,6 @@ void SpecCache::Populate // FFT length may be longer than the window of samples that affect results // because of zero padding done for increased frequency resolution const int fftLen = windowSize * zeroPaddingFactor; - const int padding = (windowSize * (zeroPaddingFactor - 1)) / 2; std::vector buffer( #ifdef EXPERIMENTAL_FFT_SKIP_POINTS From 34114aa1f7641df87de77534c1d0a85edf3bfab1 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Tue, 9 Jun 2015 14:00:54 -0500 Subject: [PATCH 09/15] Change "Builtin" to "Built-in" --- src/effects/Effect.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/effects/Effect.h b/src/effects/Effect.h index 7cd3b861a..0fcc070f7 100644 --- a/src/effects/Effect.h +++ b/src/effects/Effect.h @@ -34,7 +34,7 @@ class wxWindow; #include "../Internat.h" #include "../widgets/ProgressDialog.h" -#define BUILTIN_EFFECT_PREFIX wxT("Builtin Effect: ") +#define BUILTIN_EFFECT_PREFIX wxT("Built-in Effect: ") class SelectedRegion; class TimeWarper; From 3a3b2d066c0d78fcdc3a717ecd1068abc8467abb Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 9 Jun 2015 15:27:41 -0400 Subject: [PATCH 10/15] fix compilation warnings --- src/widgets/Ruler.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index 496012014..0061eea37 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -1677,9 +1677,9 @@ AdornedRulerPanel::AdornedRulerPanel(wxWindow* parent, mIsRecording = false; - mTimelineToolTip = gPrefs->Read(wxT("/QuickPlay/ToolTips"), 1L); + mTimelineToolTip = !!gPrefs->Read(wxT("/QuickPlay/ToolTips"), 1L); mPlayRegionDragsSelection = (gPrefs->Read(wxT("/QuickPlay/DragSelection"), 0L) == 1)? true : false; - mQuickPlayEnabled = gPrefs->Read(wxT("/QuickPlay/QuickPlayEnabled"), 1L); + mQuickPlayEnabled = !!gPrefs->Read(wxT("/QuickPlay/QuickPlayEnabled"), 1L); UpdatePrefs(); @@ -2188,7 +2188,7 @@ void AdornedRulerPanel::ShowMenu(const wxPoint & pos) DrawQuickPlayIndicator(&cdc, true); } -void AdornedRulerPanel::OnToggleQuickPlay(wxCommandEvent& evt) +void AdornedRulerPanel::OnToggleQuickPlay(wxCommandEvent&) { mQuickPlayEnabled = (mQuickPlayEnabled)? false : true; gPrefs->Write(wxT("/QuickPlay/QuickPlayEnabled"), mQuickPlayEnabled); @@ -2196,7 +2196,7 @@ void AdornedRulerPanel::OnToggleQuickPlay(wxCommandEvent& evt) RegenerateTooltips(); } -void AdornedRulerPanel::OnSyncSelToQuickPlay(wxCommandEvent& evt) +void AdornedRulerPanel::OnSyncSelToQuickPlay(wxCommandEvent&) { mPlayRegionDragsSelection = (mPlayRegionDragsSelection)? false : true; gPrefs->Write(wxT("/QuickPlay/DragSelection"), mPlayRegionDragsSelection); @@ -2233,7 +2233,7 @@ void AdornedRulerPanel::HandleSnapping() } -void AdornedRulerPanel::OnTimelineToolTips(wxCommandEvent& evt) +void AdornedRulerPanel::OnTimelineToolTips(wxCommandEvent&) { mTimelineToolTip = (mTimelineToolTip)? false : true; gPrefs->Write(wxT("/QuickPlay/ToolTips"), mTimelineToolTip); @@ -2244,7 +2244,7 @@ void AdornedRulerPanel::OnTimelineToolTips(wxCommandEvent& evt) } -void AdornedRulerPanel::OnAutoScroll(wxCommandEvent& evt) +void AdornedRulerPanel::OnAutoScroll(wxCommandEvent&) { if (mViewInfo->bUpdateTrackIndicator) gPrefs->Write(wxT("/GUI/AutoScroll"), false); @@ -2255,7 +2255,7 @@ void AdornedRulerPanel::OnAutoScroll(wxCommandEvent& evt) } -void AdornedRulerPanel::OnLockPlayRegion(wxCommandEvent& evt) +void AdornedRulerPanel::OnLockPlayRegion(wxCommandEvent&) { if (mProject->IsPlayRegionLocked()) mProject->OnUnlockPlayRegion(); From 79305db179bf624e0c01b09cfa62d44b11b6ee4f Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 10 Jun 2015 00:24:13 -0400 Subject: [PATCH 11/15] Project.h does not need Meter.h --- src/Project.cpp | 3 +-- src/Project.h | 2 +- src/prefs/SpectrumPrefs.cpp | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Project.cpp b/src/Project.cpp index 2a37d66a5..e2e4b0f39 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -50,6 +50,7 @@ scroll information. It also has some status flags. *//*******************************************************************/ #include "Audacity.h" +#include "Project.h" #include #include @@ -90,8 +91,6 @@ scroll information. It also has some status flags. #endif #endif -#include "Project.h" - #include "FreqWindow.h" #include "effects/Contrast.h" #include "AutoRecovery.h" diff --git a/src/Project.h b/src/Project.h index 9afa280ec..c741eac83 100644 --- a/src/Project.h +++ b/src/Project.h @@ -31,7 +31,6 @@ #include "xml/XMLTagHandler.h" #include "toolbars/SelectionBarListener.h" #include "toolbars/SpectralSelectionBarListener.h" -#include "widgets/Meter.h" #include #include @@ -63,6 +62,7 @@ class EffectPlugs; class TrackPanel; class FreqWindow; class ContrastDialog; +class Meter; // toolbar classes class ControlToolBar; diff --git a/src/prefs/SpectrumPrefs.cpp b/src/prefs/SpectrumPrefs.cpp index cd2920ec1..6d3f405ac 100644 --- a/src/prefs/SpectrumPrefs.cpp +++ b/src/prefs/SpectrumPrefs.cpp @@ -26,6 +26,8 @@ #include "../ShuttleGui.h" #include "../FFT.h" +#include + SpectrumPrefs::SpectrumPrefs(wxWindow * parent) : PrefsPanel(parent, _("Spectrograms")) { From 162418ff071af5bad1b15cb9bdd74578a35ead8e Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 10 Jun 2015 02:04:07 -0400 Subject: [PATCH 12/15] Fix compilation warnings --- src/Envelope.cpp | 4 ++-- src/commands/CommandHandler.cpp | 2 +- src/effects/nyquist/Nyquist.cpp | 2 +- src/import/ImportMIDI.cpp | 2 +- src/prefs/LibraryPrefs.cpp | 3 +++ 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Envelope.cpp b/src/Envelope.cpp index 6504be230..61b719e47 100644 --- a/src/Envelope.cpp +++ b/src/Envelope.cpp @@ -336,7 +336,7 @@ float Envelope::ValueOfPixel( int y, int height, bool upper, bool dB, // TODO: Cache the gPrefs value. Reading it every time is inefficient. dBRange = gPrefs->Read(wxT("/GUI/EnvdBRange"), ENV_DB_RANGE); - float v = ::ValueOfPixel(y, height, mContourOffset, dB, dBRange, zoomMin, zoomMax); + float v = ::ValueOfPixel(y, height, 0 != mContourOffset, dB, dBRange, zoomMin, zoomMax); // MB: this is mostly equivalent to what the old code did, I'm not sure // if anything special is needed for asymmetric ranges @@ -1413,7 +1413,7 @@ double Envelope::SolveIntegralOfInverse( double t0, double area ) if(area == 0.0) return t0; - unsigned int count = mEnv.Count(); + int count = mEnv.Count(); if(count == 0) // 'empty' envelope return t0 + area * mDefaultValue; diff --git a/src/commands/CommandHandler.cpp b/src/commands/CommandHandler.cpp index 82d3f4094..d117d22d4 100644 --- a/src/commands/CommandHandler.cpp +++ b/src/commands/CommandHandler.cpp @@ -32,7 +32,7 @@ CommandHandler::~CommandHandler() delete mCurrentContext; } -void CommandHandler::SetProject(AudacityProject *proj) +void CommandHandler::SetProject(AudacityProject *) { // TODO: Review if the extend command handling is ever utilized // mCurrentContext->proj = proj; diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 1d91ea46a..244067e6f 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -1391,7 +1391,7 @@ void NyquistEffect::Parse(wxString line) long v; // Splits are restored by default. Set to 0 to prevent. tokens[1].ToLong(&v); - mRestoreSplits = v; + mRestoreSplits = !!v; return; } #endif diff --git a/src/import/ImportMIDI.cpp b/src/import/ImportMIDI.cpp index 3d5aae7cd..e03aff042 100644 --- a/src/import/ImportMIDI.cpp +++ b/src/import/ImportMIDI.cpp @@ -69,7 +69,7 @@ bool ImportMIDI(wxString fName, NoteTrack * dest) Alg_event_ptr evt; int note_count = 0; int pitch_sum = 0; - while ((evt = iterator.next())) { + while (NULL != (evt = iterator.next())) { // if the event is a note if (evt->get_type() == 'n') { Alg_note_ptr note = (Alg_note_ptr) evt; diff --git a/src/prefs/LibraryPrefs.cpp b/src/prefs/LibraryPrefs.cpp index ed67ab3c8..b1b42ec33 100644 --- a/src/prefs/LibraryPrefs.cpp +++ b/src/prefs/LibraryPrefs.cpp @@ -140,6 +140,9 @@ void LibraryPrefs::PopulateOrExchange(ShuttleGui & S) #if !defined(USE_FFMPEG) || defined(DISABLE_DYNAMIC_LOADING_FFMPEG) bdwn->Enable(FALSE); bfnd->Enable(FALSE); +#else + // fix compilation warnings about unused variables + bfnd, bdwn; #endif } S.EndTwoColumn(); From f98678c03a9c99cb62fec59e47bf0404955718a5 Mon Sep 17 00:00:00 2001 From: David Bailes Date: Wed, 10 Jun 2015 09:00:39 +0100 Subject: [PATCH 13/15] Fix for accessibility name of plug-in manager dialog. Just fixing a typo. --- src/PluginManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index 2f682d98b..11bf19ef2 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -482,7 +482,7 @@ PluginRegistrationDialog::PluginRegistrationDialog(wxWindow *parent, EffectType { mType = type; mEffects = NULL; - SetLabel(GetTitle()); + SetName(GetTitle()); mStates.SetCount(STATE_COUNT); mStates[STATE_Enabled] = _("Enabled"); From cc9ac9804f643700b648ae775c84437a55d884cd Mon Sep 17 00:00:00 2001 From: David Bailes Date: Wed, 10 Jun 2015 13:56:47 +0100 Subject: [PATCH 14/15] Meters: fix indication of clipping for screen readers. --- src/widgets/Meter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index 92d6b171c..49743e99f 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -2240,9 +2240,12 @@ wxAccStatus MeterAx::GetName(int WXUNUSED(childId), wxString* name) } float peak = 0.; + bool clipped = false; for (int i = 0; i < m->mNumBars; i++) { peak = wxMax(peak, m->mBar[i].peakPeakHold); + if (m->mBar[i].clipping) + clipped = true; } if (m->mDB) @@ -2254,7 +2257,7 @@ wxAccStatus MeterAx::GetName(int WXUNUSED(childId), wxString* name) *name += wxString::Format(_(" Peak %.2f "), peak); } - if (m->IsClipping()) + if (clipped) { *name += wxString::Format(_(" Clipped ")); } From d5ea9a678e7b71cace748d9aae96dffe8c6288e5 Mon Sep 17 00:00:00 2001 From: David Bailes Date: Wed, 10 Jun 2015 14:09:56 +0100 Subject: [PATCH 15/15] Fix for translations of strings for screen readers in MeterAx::GetName. The translations of strings which had a leading space did not always preserve this leading space, resulting in merged words. Therefore separate spaces were added, and the original strings left unchanged so that no new translation work is required. --- src/widgets/Meter.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index 49743e99f..eb43dd175 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -2232,11 +2232,15 @@ wxAccStatus MeterAx::GetName(int WXUNUSED(childId), wxString* name) if (m->mMonitoring) { - *name += wxString::Format(_(" Monitoring ")); + // translations of strings such as " Monitoring " did not + // always retain the leading space. Therefore a space has + // been added to ensure at least one space, and stop + // words from being merged + *name += wxT(" ") + wxString::Format(_(" Monitoring ")); } else if (m->mActive) { - *name += wxString::Format(_(" Active ")); + *name += wxT(" ") + wxString::Format(_(" Active ")); } float peak = 0.; @@ -2250,16 +2254,16 @@ wxAccStatus MeterAx::GetName(int WXUNUSED(childId), wxString* name) if (m->mDB) { - *name += wxString::Format(_(" Peak %2.f dB"), (peak * m->mDBRange) - m->mDBRange); + *name += wxT(" ") + wxString::Format(_(" Peak %2.f dB"), (peak * m->mDBRange) - m->mDBRange); } else { - *name += wxString::Format(_(" Peak %.2f "), peak); + *name += wxT(" ") + wxString::Format(_(" Peak %.2f "), peak); } if (clipped) { - *name += wxString::Format(_(" Clipped ")); + *name += wxT(" ") + wxString::Format(_(" Clipped ")); } }