mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-01 16:19:43 +02:00
Merge branch 'master' into refactor
This commit is contained in:
commit
77a79c727c
@ -961,35 +961,33 @@ void AudacityApp::InitLang( const wxString & lang )
|
||||
if( mLocale )
|
||||
delete mLocale;
|
||||
|
||||
// LL: I do not know why loading translations fail on the Mac if LANG is not
|
||||
// set, but for some reason it does. So wrap the creation of wxLocale
|
||||
// with the default translation.
|
||||
//
|
||||
// 2013-09-13: I've checked this again and it is still required. Still
|
||||
// no idea why.
|
||||
// 2015-05-26: Disabled the hack since it prevents use of locale specific
|
||||
// formatting (like comma as decimal separator).
|
||||
#if defined(__WXMAC__disabled)
|
||||
wxString oldval;
|
||||
bool existed;
|
||||
wxString canon = lang;
|
||||
|
||||
existed = wxGetEnv(wxT("LANG"), &oldval);
|
||||
wxSetEnv(wxT("LANG"), wxT("en_US"));
|
||||
#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);
|
||||
#endif
|
||||
|
||||
#if wxCHECK_VERSION(3,0,0)
|
||||
mLocale = new wxLocale(wxT(""), lang, wxT(""), true);
|
||||
mLocale = new wxLocale(wxT(""), canon, wxT(""), true);
|
||||
#else
|
||||
mLocale = new wxLocale(wxT(""), lang, wxT(""), true, true);
|
||||
#endif
|
||||
|
||||
#if defined(__WXMAC__disabled)
|
||||
if (existed) {
|
||||
wxSetEnv(wxT("LANG"), oldval);
|
||||
}
|
||||
else {
|
||||
wxUnsetEnv(wxT("LANG"));
|
||||
}
|
||||
mLocale = new wxLocale(wxT(""), canon, wxT(""), true, true);
|
||||
#endif
|
||||
|
||||
for(unsigned int i=0; i<audacityPathList.GetCount(); i++)
|
||||
|
@ -135,6 +135,25 @@ bool EffectAmplify::SetAutomationParameters(EffectAutomationParameters & parms)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EffectAmplify::LoadFactoryDefaults()
|
||||
{
|
||||
Init();
|
||||
|
||||
mRatioClip = 0.0;
|
||||
if (mPeak > 0.0)
|
||||
{
|
||||
mRatio = 1.0 / mPeak;
|
||||
mRatioClip = mRatio;
|
||||
}
|
||||
else
|
||||
{
|
||||
mRatio = 1.0;
|
||||
}
|
||||
mCanClip = false;
|
||||
|
||||
return TransferDataToWindow();
|
||||
}
|
||||
|
||||
// Effect implementation
|
||||
|
||||
bool EffectAmplify::Init()
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
virtual sampleCount ProcessBlock(float **inBlock, float **outBlock, sampleCount blockLen);
|
||||
virtual bool GetAutomationParameters(EffectAutomationParameters & parms);
|
||||
virtual bool SetAutomationParameters(EffectAutomationParameters & parms);
|
||||
virtual bool LoadFactoryDefaults();
|
||||
|
||||
// Effect implementation
|
||||
|
||||
|
@ -2465,11 +2465,13 @@ void Effect::Preview(bool dryOnly)
|
||||
return;
|
||||
}
|
||||
|
||||
mixLeft->Offset(-mixLeft->GetStartTime());
|
||||
mixLeft->InsertSilence(0.0, mT0);
|
||||
mixLeft->SetSelected(true);
|
||||
mixLeft->SetDisplay(WaveTrack::NoDisplay);
|
||||
mTracks->Add(mixLeft);
|
||||
if (mixRight) {
|
||||
mixRight->Offset(-mixRight->GetStartTime());
|
||||
mixRight->InsertSilence(0.0, mT0);
|
||||
mixRight->SetSelected(true);
|
||||
mTracks->Add(mixRight);
|
||||
|
Loading…
x
Reference in New Issue
Block a user