mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-21 16:37:12 +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:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "../MemoryX.h"
|
||||
|
||||
class AudacityProject;
|
||||
class OldStyleCommand;
|
||||
using OldStyleCommandPointer = std::shared_ptr<OldStyleCommand>;
|
||||
class wxString;
|
||||
@@ -34,11 +35,12 @@ class CommandBuilder
|
||||
|
||||
void Failure(const wxString &msg = {});
|
||||
void Success(const OldStyleCommandPointer &cmd);
|
||||
void BuildCommand(const wxString &cmdName, const wxString &cmdParams);
|
||||
void BuildCommand(const wxString &cmdString);
|
||||
void BuildCommand( AudacityProject *project,
|
||||
const wxString &cmdName, const wxString &cmdParams);
|
||||
void BuildCommand( AudacityProject *project, const wxString &cmdString);
|
||||
public:
|
||||
CommandBuilder(const wxString &cmdString);
|
||||
CommandBuilder(const wxString &cmdName,
|
||||
CommandBuilder(AudacityProject *project, const wxString &cmdString);
|
||||
CommandBuilder(AudacityProject *project, const wxString &cmdName,
|
||||
const wxString &cmdParams);
|
||||
~CommandBuilder();
|
||||
bool WasValid();
|
||||
|
||||
Reference in New Issue
Block a user