1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-24 15:15:52 +01:00

Remove CommandContext::GetProject() ...

... which called ::GetActiveProject(), but one purpose of the CommandContext
class was to eliminate many uses of that global function, because a
CommandContext must always be constructed from a reference to a project
(which was always in fact the active one), then passed around to where it is
needed!

Also, just use the project member directly -- because CommandContext was
intended as just a P.O.D (plain-old-data) structure.

This also eliminates a dependency of CommandContext.cpp on Project.cpp.

This is not enough by itself to break any dependency cycles.
This commit is contained in:
Paul Licameli
2019-05-11 16:19:43 -04:00
parent 1c0453106d
commit 9eb9104859
16 changed files with 86 additions and 90 deletions

View File

@@ -66,8 +66,8 @@ bool SetLabelCommand::Apply(const CommandContext & context)
// this code could be put in subroutines/reduced.
//wxString mode = GetString(wxT("Type"));
AudacityProject * p = context.GetProject();
TrackList *tracks = context.GetProject()->GetTracks();
AudacityProject * p = &context.project;
TrackList *tracks = context.project.GetTracks();
LabelStruct * pLabel = NULL;
int i=0;
int nn=0;