1
0
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:
Paul Licameli
2019-05-21 21:20:58 -04:00
parent 1e3779c2f3
commit a1eeb528b7
6 changed files with 28 additions and 18 deletions

View File

@@ -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();