mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Lift a call to GetActiveProject into ScriptCommandRelay...
... Don't do it at the low level of construction of a command object. Do it only at the highest possible level, where an external scripting module or Nyquist calls into the command framework. Pass the project pointer down where it is needed.
This commit is contained in:
@@ -24,6 +24,7 @@ code out of ModuleManager.
|
||||
#include "CommandTargets.h"
|
||||
#include "CommandBuilder.h"
|
||||
#include "AppCommandEvent.h"
|
||||
#include "../Project.h"
|
||||
#include <wx/app.h>
|
||||
#include <wx/window.h>
|
||||
#include <wx/string.h>
|
||||
@@ -70,7 +71,7 @@ void ScriptCommandRelay::PostCommand(
|
||||
int ExecCommand(wxString *pIn, wxString *pOut)
|
||||
{
|
||||
{
|
||||
CommandBuilder builder(*pIn);
|
||||
CommandBuilder builder(::GetActiveProject(), *pIn);
|
||||
if (builder.WasValid())
|
||||
{
|
||||
OldStyleCommandPointer cmd = builder.GetCommand();
|
||||
@@ -105,7 +106,7 @@ int ExecCommand(wxString *pIn, wxString *pOut)
|
||||
int ExecCommand2(wxString *pIn, wxString *pOut)
|
||||
{
|
||||
{
|
||||
CommandBuilder builder(*pIn);
|
||||
CommandBuilder builder(::GetActiveProject(), *pIn);
|
||||
if (builder.WasValid())
|
||||
{
|
||||
OldStyleCommandPointer cmd = builder.GetCommand();
|
||||
|
||||
Reference in New Issue
Block a user