1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-31 22:23:54 +01:00

Ability to enable/disable loading of modules. Resized Prefs. Same-machine flag set when scripting (used by vista and later).

This commit is contained in:
james.k.crook@gmail.com
2012-07-14 22:45:12 +00:00
parent 584e712eab
commit 2bf327fec7
3 changed files with 26 additions and 3 deletions

View File

@@ -71,8 +71,30 @@ wxWindow * MakeHijackPanel()
// starts a thread and reads script commands.
tpRegScriptServerFunc scriptFn;
bool IsAllowedModule( wxString fname )
{
bool bLoad = false;
wxString ShortName = wxFileName( fname ).GetName();
if( (ShortName.CmpNoCase( wxT("mod-script-pipe")) == 0 ))
{
gPrefs->Read(wxT("/Module/mod-script-pipe"), &bLoad, false);
}
else if( (ShortName.CmpNoCase( wxT("mod-nyq-bench")) == 0 ))
{
gPrefs->Read(wxT("/Module/mod-nyq-bench"), &bLoad, false);
}
else if( (ShortName.CmpNoCase( wxT("mod-track-panel")) == 0 ))
{
gPrefs->Read(wxT("/Module/mod-track-panel"), &bLoad, false);
}
return bLoad;
}
void LoadModule(wxString fname)
{
if( !IsAllowedModule( fname ) )
return;
wxLogDebug(wxT("About to load module %s"), fname.c_str());
wxLogNull logNo; // Don't show wxWidgets Error if cannot load within this method. (Fix bug 544.)