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/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/PluginManager.cpp b/src/PluginManager.cpp index aaea17a6a..11bf19ef2 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, @@ -473,14 +476,13 @@ 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) { mType = type; mEffects = NULL; - SetLabel(_("Plug-in Manager: Effects")); // Provide visual label - SetName(_("Plug-in Manager: Effects")); // Provide audible label + SetName(GetTitle()); mStates.SetCount(STATE_COUNT); mStates[STATE_Enabled] = _("Enabled"); @@ -747,7 +749,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 } } @@ -1343,14 +1345,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/Project.cpp b/src/Project.cpp index 9cef7d3c6..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" @@ -1021,7 +1020,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); 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/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/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 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/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; 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); } } 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(); 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")) { 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(); 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"), diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index 92d6b171c..eb43dd175 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -2232,31 +2232,38 @@ 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.; + 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) { - *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 (m->IsClipping()) + if (clipped) { - *name += wxString::Format(_(" Clipped ")); + *name += wxT(" ") + wxString::Format(_(" Clipped ")); } } 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();