mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 08:30:06 +02:00
ScriptCommandRelay.cpp is not link dependent on AudacityApp.cpp ...
... Let it send an event to the application instead of calling the handler directly.
This commit is contained in:
parent
b04387a21d
commit
6e3ebc0938
@ -25,7 +25,7 @@ code out of ModuleManager.
|
|||||||
#include "CommandBuilder.h"
|
#include "CommandBuilder.h"
|
||||||
#include "AppCommandEvent.h"
|
#include "AppCommandEvent.h"
|
||||||
#include "../Project.h"
|
#include "../Project.h"
|
||||||
#include "../AudacityApp.h"
|
#include <wx/app.h>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
|
|
||||||
// Declare static class members
|
// Declare static class members
|
||||||
@ -110,8 +110,10 @@ int ExecCommand2(wxString *pIn, wxString *pOut)
|
|||||||
OldStyleCommandPointer cmd = builder.GetCommand();
|
OldStyleCommandPointer cmd = builder.GetCommand();
|
||||||
AppCommandEvent ev;
|
AppCommandEvent ev;
|
||||||
ev.SetCommand(cmd);
|
ev.SetCommand(cmd);
|
||||||
AudacityApp & App = wxGetApp();
|
|
||||||
App.OnReceiveCommand(ev);
|
// Use SafelyProcessEvent, which stops exceptions, because this is
|
||||||
|
// expected to be reached from within the XLisp runtime
|
||||||
|
wxTheApp->SafelyProcessEvent( ev );
|
||||||
|
|
||||||
*pOut = wxEmptyString;
|
*pOut = wxEmptyString;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user