From 0e321133c11381773269c8e4e75b1e05823b5fa7 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sat, 6 Jun 2015 11:09:03 -0500 Subject: [PATCH 01/10] Move instructions from the static box label to standalone --- src/PluginManager.cpp | 50 ++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index 4b361206d..c14f4f3f6 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -516,25 +516,41 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S) { /*i18n-hint: The dialog shows a list of plugins with check-boxes beside each one.*/ - S.StartStatic(_("Select Plug-ins, click the Enable or Disable button, then click OK."), true); + S.StartStatic(_("Effects"), true); { - S.StartHorizontalLay(wxALIGN_LEFT,0 ); + S.StartHorizontalLay(wxEXPAND, 0); { - wxRadioButton* rb; - /* i18n-hint: This is before radio buttons selecting which effects to show */ - S.AddPrompt(_("Show:")); - /* i18n-hint: Radio button to show all effects */ - rb = S.Id(ID_ShowAll).AddRadioButton(_("&All")); - rb->SetName(_("Show all")); - /* i18n-hint: Radio button to show just the currently disabled effects */ - rb = S.Id(ID_ShowDisabled).AddRadioButtonToGroup(_("D&isabled")); - rb->SetName(_("Show disabled")); - /* i18n-hint: Radio button to show just the currently enabled effects */ - rb = S.Id(ID_ShowEnabled).AddRadioButtonToGroup(_("E&nabled")); - rb->SetName(_("Show enabled")); - /* i18n-hint: Radio button to show just the newly discovered effects */ - rb = S.Id(ID_ShowNew).AddRadioButtonToGroup(_("Ne&w")); - rb->SetName(_("Show new")); + S.StartHorizontalLay(wxALIGN_LEFT, 0); + { + S.AddPrompt(_("Select effects, click the Enable or Disable button, then click OK.")); + } + S.EndHorizontalLay(); + + S.StartHorizontalLay(wxCENTER, 1); + { + S.AddSpace(1); + } + S.EndHorizontalLay(); + + S.StartHorizontalLay(wxALIGN_RIGHT, 0); + { + wxRadioButton* rb; + /* i18n-hint: This is before radio buttons selecting which effects to show */ + S.AddPrompt(_("Show:")); + /* i18n-hint: Radio button to show all effects */ + rb = S.Id(ID_ShowAll).AddRadioButton(_("&All")); + rb->SetName(_("Show all")); + /* i18n-hint: Radio button to show just the currently disabled effects */ + rb = S.Id(ID_ShowDisabled).AddRadioButtonToGroup(_("D&isabled")); + rb->SetName(_("Show disabled")); + /* i18n-hint: Radio button to show just the currently enabled effects */ + rb = S.Id(ID_ShowEnabled).AddRadioButtonToGroup(_("E&nabled")); + rb->SetName(_("Show enabled")); + /* i18n-hint: Radio button to show just the newly discovered effects */ + rb = S.Id(ID_ShowNew).AddRadioButtonToGroup(_("Ne&w")); + rb->SetName(_("Show new")); + } + S.EndHorizontalLay(); } S.EndHorizontalLay(); From 2ba22cafb4d85f4fd97c1b631b65267458e6db89 Mon Sep 17 00:00:00 2001 From: James Crook Date: Sat, 6 Jun 2015 18:25:23 +0100 Subject: [PATCH 02/10] "Manage XYZ..." -> "Manage..." on menus. To clear residual issue on http://bugzilla.audacityteam.org/show_bug.cgi?id=1011 Bug 1011 was a P1, and the residual is (in my estimation) P3, but it is still as well to clear it. --- src/Menus.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Menus.cpp b/src/Menus.cpp index f603abec8..b969785ce 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -982,7 +982,7 @@ void AudacityProject::CreateMenusAndCommands() c->SetDefaultFlags(AudioIONotBusyFlag, AudioIONotBusyFlag); #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT - c->AddItem(wxT("ManageGenerators"), _("Manage Generators..."), FN(OnManageGenerators)); + c->AddItem(wxT("ManageGenerators"), _("Manage..."), FN(OnManageGenerators)); c->AddSeparator(); #endif @@ -1009,7 +1009,7 @@ void AudacityProject::CreateMenusAndCommands() buildMenuLabel.Printf(_("Repeat Last Effect")); #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT - c->AddItem(wxT("ManageEffects"), _("Manage Effects..."), FN(OnManageEffects)); + c->AddItem(wxT("ManageEffects"), _("Manage..."), FN(OnManageEffects)); c->AddSeparator(); #endif @@ -1033,7 +1033,7 @@ void AudacityProject::CreateMenusAndCommands() c->BeginMenu(_("&Analyze")); #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT - c->AddItem(wxT("ManageAnalyzers"), _("Manage Analyzers..."), FN(OnManageAnalyzers)); + c->AddItem(wxT("ManageAnalyzers"), _("Manage..."), FN(OnManageAnalyzers)); c->AddSeparator(); #endif From c56fb03fd1d066bc40a95e9242572d90c82d7146 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sat, 6 Jun 2015 12:54:05 -0500 Subject: [PATCH 03/10] Further adjustments for SR friendliness --- src/PluginManager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index c14f4f3f6..aaea17a6a 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -516,7 +516,8 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S) { /*i18n-hint: The dialog shows a list of plugins with check-boxes beside each one.*/ - S.StartStatic(_("Effects"), true); +// S.StartStatic(_("Effects"), true); + S.StartVerticalLay(); { S.StartHorizontalLay(wxEXPAND, 0); { @@ -584,7 +585,8 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S) } S.EndHorizontalLay(); } - S.EndStatic(); +// S.EndStatic(); + S.EndVerticalLay(); S.AddStandardButtons(eOkButton | eCancelButton); } @@ -742,7 +744,7 @@ void PluginRegistrationDialog::RegenerateEffectsList(int filter) if (mEffects->GetItemCount() > 0) { // Make sure first item is selected/focused. - mEffects->SetFocus(); +// mEffects->SetFocus(); mEffects->SetItemState(0, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED); #if wxUSE_ACCESSIBILITY mAx->SetSelected(0); From a13be332ff24c23d9ff57ebd41e32249ad7b7021 Mon Sep 17 00:00:00 2001 From: James Crook Date: Sat, 6 Jun 2015 19:16:25 +0100 Subject: [PATCH 04/10] Enabled most built-in effects by default. Now that Manage... is at the top, there is less reason to shorten the menu. Forum team were strongly in favour of more rather than fewer effects being enabled by default. --- src/effects/LoadEffects.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/effects/LoadEffects.cpp b/src/effects/LoadEffects.cpp index 82195e543..fc171765b 100644 --- a/src/effects/LoadEffects.cpp +++ b/src/effects/LoadEffects.cpp @@ -129,17 +129,17 @@ EFFECT( WAHWAH, EffectWahwah() ) \ EFFECT( FINDCLIPPING, EffectFindClipping() ) \ NOISEREDUCTION_EFFECT \ - SOUNDTOUCH_EFFECTS + SOUNDTOUCH_EFFECTS \ + EFFECT( AUTODUCK, EffectAutoDuck() ) \ + EFFECT( LEVELLER, EffectLeveller() ) \ + EFFECT( PAULSTRETCH, EffectPaulstretch() ) \ + SBSMS_EFFECTS // // Define the list of effects that do not get autoregistered // #define EXCLUDE_LIST \ - EFFECT( AUTODUCK, EffectAutoDuck() ) \ - EFFECT( LEVELLER, EffectLeveller() ) \ - EFFECT( PAULSTRETCH, EffectPaulstretch() ) \ - CLASSICFILTER_EFFECT \ - SBSMS_EFFECTS + CLASSICFILTER_EFFECT // // Define the EFFECT() macro to generate enum names From b1591b5767e7abde2ec7c1aa3cadc2240b2d9c1e Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sun, 7 Jun 2015 07:08:41 -0500 Subject: [PATCH 05/10] Fix initialization when running from a chain If the effect was run from a chain without first going into the effect's dialog, it would error out cause the duration hadn't been set properly. --- src/effects/DtmfGen.cpp | 7 +++++++ src/effects/DtmfGen.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/effects/DtmfGen.cpp b/src/effects/DtmfGen.cpp index 90ba2a300..98b9de60f 100644 --- a/src/effects/DtmfGen.cpp +++ b/src/effects/DtmfGen.cpp @@ -282,6 +282,13 @@ bool EffectDtmf::Startup() return true; } +bool EffectDtmf::Init() +{ + Recalculate(); + + return true; +} + void EffectDtmf::PopulateOrExchange(ShuttleGui & S) { // dialog will be passed values from effect diff --git a/src/effects/DtmfGen.h b/src/effects/DtmfGen.h index 10bfa84c0..0010a973d 100644 --- a/src/effects/DtmfGen.h +++ b/src/effects/DtmfGen.h @@ -52,6 +52,7 @@ public: // Effect implementation virtual bool Startup(); + virtual bool Init(); virtual void PopulateOrExchange(ShuttleGui & S); virtual bool TransferDataFromWindow(); virtual bool TransferDataToWindow(); From a1edf31c9970fdb7eb8f8176ef02acf7d6a91629 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sun, 7 Jun 2015 08:03:18 -0500 Subject: [PATCH 06/10] Hopefully this will "fix" the Serbian (Cyrillic) issues on OSX. Since I ran out of time, I put OSX back to the way it was in 2.1.0...forced locale to en_US. Heck, I'm not sure there is a "real" fix anyway. At least, the problem languages appear to be happy now, even when using the validators. --- src/AudacityApp.cpp | 22 ++--- src/widgets/numformatter.cpp | 167 ++++------------------------------- 2 files changed, 24 insertions(+), 165 deletions(-) diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index e1fcdbc87..77dc90412 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -971,36 +971,24 @@ wxLanguageInfo userLangs[] = void AudacityApp::InitLang( const wxString & lang ) { - if( mLocale ) + if (mLocale) delete mLocale; - wxString canon = lang; - #if defined(__WXMAC__) // This should be reviewed again during the wx3 conversion. - // On OSX, the eventual call to setlocale() will fail to completely - // set the locale causing printf() and kin to still use the period - // as the decimal separator when the locale specifies something - // else. - const wxLanguageInfo *info = wxLocale::FindLanguageInfo(lang); - if (info) { - canon = info->CanonicalName; - } - // On OSX, if the LANG environment variable isn't set when // using a language like Japanese, an assertion will trigger // because conversion to Japanese from "?" doesn't return a // valid length, so make OSX happy by defining/overriding - // the LANG environment variable with what the user has - // chosen. - wxSetEnv(wxT("LANG"), canon); + // the LANG environment variable with U.S. English for now. + wxSetEnv(wxT("LANG"), wxT("en_US.UTF-8")); #endif #if wxCHECK_VERSION(3,0,0) - mLocale = new wxLocale(wxT(""), canon, wxT(""), true); + mLocale = new wxLocale(wxT(""), lang, wxT(""), true); #else - mLocale = new wxLocale(wxT(""), canon, wxT(""), true, true); + mLocale = new wxLocale(wxT(""), lang, wxT(""), true, true); #endif for(unsigned int i=0; idecimal_point) : wxT("."); + if (s.empty()) + { + // We really must have something for decimal separator, so fall + // back to the C locale default. + s = wxT("."); + } - // Remember the locale which was current when we initialized, we must redo - // the initialization if the locale changed. - static LocaleId s_localeUsedForInit; - - if ( s_localeUsedForInit.NotInitializedOrHasChanged() ) - { - const wxString - s = wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER); - if ( s.empty() ) - { - // We really must have something for decimal separator, so fall - // back to the C locale default. - s_decimalSeparator = '.'; - } - else - { - // To the best of my knowledge there are no locales like this. - wxASSERT_MSG( s.length() == 1, - wxT("Multi-character decimal separator?") ); - - s_decimalSeparator = s[0]; - } - } - - return s_decimalSeparator; + return s[0]; #else // !wxUSE_INTL - return wxT('.'); + return wxT('.'); #endif // wxUSE_INTL/!wxUSE_INTL } bool NumberFormatter::GetThousandsSeparatorIfUsed(wxChar *sep) { #if wxUSE_INTL - static wxChar s_thousandsSeparator = 0; - static LocaleId s_localeUsedForInit; + struct lconv *info = localeconv(); + wxString s = info ? wxString::FromUTF8(info->thousands_sep) : wxT(""); - if ( s_localeUsedForInit.NotInitializedOrHasChanged() ) - { -#if defined(__WXMSW__) - wxUint32 lcid = LOCALE_USER_DEFAULT; + if (s.IsEmpty()) + { + return false; + } - if (wxGetLocale()) - { - const wxLanguageInfo *info = wxLocale::GetLanguageInfo(wxGetLocale()->GetLanguage()); - if (info) - { ; - lcid = MAKELCID(MAKELANGID(info->WinLang, info->WinSublang), - SORT_DEFAULT); - } - } - - wxString s; - wxChar buffer[256]; - buffer[0] = wxT('\0'); - size_t count = GetLocaleInfo(lcid, LOCALE_STHOUSAND, buffer, 256); - if (!count) - s << wxT(","); - else - s << buffer; -#else - wxString - s = wxLocale::GetInfo(wxLOCALE_THOUSANDS_SEP, wxLOCALE_CAT_NUMBER); -#endif - if ( !s.empty() ) - { - wxASSERT_MSG( s.length() == 1, - wxT("Multi-character thousands separator?") ); - - s_thousandsSeparator = s[0]; - } - //else: Unlike above it's perfectly fine for the thousands separator to - // be empty if grouping is not used, so just leave it as 0. - } - - if ( !s_thousandsSeparator ) - return false; - - if ( sep ) - *sep = s_thousandsSeparator; - - return true; + *sep = s[0]; + return true; #else // !wxUSE_INTL wxUnusedVar(sep); return false; From 9b7cd6be527290a895fc2f504d84201208e14cd1 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sun, 7 Jun 2015 12:37:15 -0500 Subject: [PATCH 07/10] Missed a file in the last commit. --- include/audacity/EffectAutomationParameters.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/audacity/EffectAutomationParameters.h b/include/audacity/EffectAutomationParameters.h index 0f6b519a8..a7b99f1c6 100644 --- a/include/audacity/EffectAutomationParameters.h +++ b/include/audacity/EffectAutomationParameters.h @@ -42,6 +42,8 @@ #ifndef __AUDACITY_EFFECTAUTOMATIONPARAMETERS_H__ #define __AUDACITY_EFFECTAUTOMATIONPARAMETERS_H__ +#include + #include #include #include @@ -88,7 +90,8 @@ public: wxString str; if (Read(key, &str)) { - wxString dec = wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER); + struct lconv *info = localeconv(); + wxString dec = info ? wxString::FromUTF8(info->decimal_point) : wxT("."); str.Replace(wxT(","), dec); str.Replace(wxT("."), dec); From f3f8e9cedb93218fc87b6a4a62d520234a4fcd0d Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sun, 7 Jun 2015 12:38:29 -0500 Subject: [PATCH 08/10] Make autosave filename English to work with Arabic translation on LInux And just fix up a few comments. --- src/AutoRecovery.cpp | 8 ++++---- src/Project.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/AutoRecovery.cpp b/src/AutoRecovery.cpp index b04997618..8a88210fb 100644 --- a/src/AutoRecovery.cpp +++ b/src/AutoRecovery.cpp @@ -383,7 +383,7 @@ XMLTagHandler* RecordingRecoveryHandler::HandleXMLChild(const wxChar *tag) // // It is not intended that the user view or modify the file. // -// It IS intended that as little work be done during auto save, so numbers +// It IS intended that very little work be done during auto save, so numbers // and strings are written in their native format. They will be converted // during recovery. // @@ -393,8 +393,8 @@ XMLTagHandler* RecordingRecoveryHandler::HandleXMLChild(const wxChar *tag) // name dictionary dictionary of all names used in the document // data fields the "encoded" XML document // -// If a subtree is added, it will be preceeded with FT_Push tell the decoder -// to preserve the active dictionary. The decoder when then restore the +// If a subtree is added, it will be preceeded with FT_Push to tell the decoder +// to preserve the active dictionary. The decoder will then restore the // dictionary when an FT_Pop is encountered. Nesting is unlimited. // // To save space, each name (attribute or element) encountered is stored in @@ -402,7 +402,7 @@ XMLTagHandler* RecordingRecoveryHandler::HandleXMLChild(const wxChar *tag) // // All strings are in native unicode format, 2-byte or 4-byte. // -// All "lengths" are 2-byte signed, so are limited to 32767 bytes long/ +// All "lengths" are 2-byte signed, so are limited to 32767 bytes long. enum FieldTypes { diff --git a/src/Project.cpp b/src/Project.cpp index c64d0e0ef..9cef7d3c6 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -4730,7 +4730,7 @@ void AudacityProject::AutoSave() wxString projName; if (mFileName.IsEmpty()) - projName = _("New Project"); + projName = wxT("New Project"); else projName = wxFileName(mFileName).GetName(); From bc11576d22414c6776e028dcdb0f77b0b29b71a1 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sun, 7 Jun 2015 13:26:49 -0500 Subject: [PATCH 09/10] Don't save interpreted strings to settings --- src/effects/ToneGen.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/effects/ToneGen.cpp b/src/effects/ToneGen.cpp index dd425bc35..ca64e26c9 100644 --- a/src/effects/ToneGen.cpp +++ b/src/effects/ToneGen.cpp @@ -258,16 +258,16 @@ bool EffectToneGen::GetAutomationParameters(EffectAutomationParameters & parms) parms.Write(KEY_Amplitude, mAmplitude[0]); } - parms.Write(KEY_Waveform, mWaveforms[mWaveform]); - parms.Write(KEY_Interp, mInterpolations[mInterpolation]); + parms.Write(KEY_Waveform, kWaveStrings[mWaveform]); + parms.Write(KEY_Interp, kInterStrings[mInterpolation]); return true; } bool EffectToneGen::SetAutomationParameters(EffectAutomationParameters & parms) { - ReadAndVerifyEnum(Waveform, mWaveforms); - ReadAndVerifyEnum(Interp, mInterpolations); + ReadAndVerifyEnum(Waveform, wxArrayString(kNumWaveforms, kWaveStrings)); + ReadAndVerifyEnum(Interp, wxArrayString(kNumInterpolations, kInterStrings)); if (mChirp) { ReadAndVerifyDouble(StartFreq); From e94338295344a797f52ac8118a271a4da73e8b34 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 7 Jun 2015 17:05:59 -0400 Subject: [PATCH 10/10] Bug1014: Do not change the cursor for selection adjustment while scrubbing. (Cursor may still change to the "forbidden" symbol at a boundary between clips.) --- src/TrackPanel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index c88df224d..209eff2ff 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -1950,8 +1950,11 @@ void TrackPanel::SetCursorAndTipWhenSelectTool( Track * t, // If not shift-down and not snapping center, then // choose boundaries only in snapping tolerance, - // and may choose center - SelectionBoundary boundary = ChooseBoundary(event, t, r, !bShiftDown, !bShiftDown); + // and may choose center. + // But don't change the cursor when scrubbing. + SelectionBoundary boundary = IsScrubbing() + ? SBNone + : ChooseBoundary(event, t, r, !bShiftDown, !bShiftDown); #ifdef USE_MIDI // The MIDI HitTest will only succeed if we are on a midi track, so