mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 09:00:52 +02:00
Added missing header declarations for AudacityProjectCommandFunctor.
This commit is contained in:
parent
21851193de
commit
98fec31a3e
@ -130,54 +130,43 @@ enum {
|
||||
kAlign
|
||||
};
|
||||
|
||||
typedef void (AudacityProject::*audCommandFunction)();
|
||||
typedef void (AudacityProject::*audCommandListFunction)(int);
|
||||
|
||||
class AudacityProjectCommandFunctor:public CommandFunctor
|
||||
AudacityProjectCommandFunctor::AudacityProjectCommandFunctor(AudacityProject *project,
|
||||
audCommandFunction commandFunction)
|
||||
{
|
||||
public:
|
||||
AudacityProjectCommandFunctor(AudacityProject *project,
|
||||
audCommandFunction commandFunction)
|
||||
{
|
||||
mProject = project;
|
||||
mCommandFunction = commandFunction;
|
||||
mCommandListFunction = NULL;
|
||||
}
|
||||
mProject = project;
|
||||
mCommandFunction = commandFunction;
|
||||
mCommandListFunction = NULL;
|
||||
}
|
||||
|
||||
AudacityProjectCommandFunctor(AudacityProject *project,
|
||||
audCommandListFunction commandFunction)
|
||||
{
|
||||
mProject = project;
|
||||
mCommandFunction = NULL;
|
||||
mCommandListFunction = commandFunction;
|
||||
}
|
||||
AudacityProjectCommandFunctor::AudacityProjectCommandFunctor(AudacityProject *project,
|
||||
audCommandListFunction commandFunction)
|
||||
{
|
||||
mProject = project;
|
||||
mCommandFunction = NULL;
|
||||
mCommandListFunction = commandFunction;
|
||||
}
|
||||
|
||||
AudacityProjectCommandFunctor(AudacityProject *project,
|
||||
audCommandListFunction commandFunction,
|
||||
wxArrayInt explicitIndices)
|
||||
{
|
||||
mProject = project;
|
||||
mCommandFunction = NULL;
|
||||
mCommandListFunction = commandFunction;
|
||||
mExplicitIndices = explicitIndices;
|
||||
}
|
||||
AudacityProjectCommandFunctor::AudacityProjectCommandFunctor(AudacityProject *project,
|
||||
audCommandListFunction commandFunction,
|
||||
wxArrayInt explicitIndices)
|
||||
{
|
||||
mProject = project;
|
||||
mCommandFunction = NULL;
|
||||
mCommandListFunction = commandFunction;
|
||||
mExplicitIndices = explicitIndices;
|
||||
}
|
||||
|
||||
virtual void operator()(int index = 0)
|
||||
{
|
||||
if (mCommandListFunction && mExplicitIndices.GetCount() > 0)
|
||||
(mProject->*(mCommandListFunction)) (mExplicitIndices[index]);
|
||||
else if (mCommandListFunction)
|
||||
(mProject->*(mCommandListFunction)) (index);
|
||||
else
|
||||
(mProject->*(mCommandFunction)) ();
|
||||
}
|
||||
void AudacityProjectCommandFunctor::operator()(int index )
|
||||
{
|
||||
if (mCommandListFunction && mExplicitIndices.GetCount() > 0)
|
||||
(mProject->*(mCommandListFunction)) (mExplicitIndices[index]);
|
||||
else if (mCommandListFunction)
|
||||
(mProject->*(mCommandListFunction)) (index);
|
||||
else
|
||||
(mProject->*(mCommandFunction)) ();
|
||||
}
|
||||
|
||||
private:
|
||||
AudacityProject *mProject;
|
||||
audCommandFunction mCommandFunction;
|
||||
audCommandListFunction mCommandListFunction;
|
||||
wxArrayInt mExplicitIndices;
|
||||
};
|
||||
|
||||
#define FN(X) new AudacityProjectCommandFunctor(this, &AudacityProject:: X )
|
||||
#define FNI(X, I) new AudacityProjectCommandFunctor(this, &AudacityProject:: X, I)
|
||||
|
@ -571,5 +571,28 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
typedef void (AudacityProject::*audCommandFunction)();
|
||||
typedef void (AudacityProject::*audCommandListFunction)(int);
|
||||
|
||||
// Previously this was in menus.cpp, and the declaration of the
|
||||
// command functor was not visible anywhere else.
|
||||
class AudacityProjectCommandFunctor : public CommandFunctor
|
||||
{
|
||||
public:
|
||||
AudacityProjectCommandFunctor(AudacityProject *project,
|
||||
audCommandFunction commandFunction);
|
||||
AudacityProjectCommandFunctor(AudacityProject *project,
|
||||
audCommandListFunction commandFunction);
|
||||
AudacityProjectCommandFunctor(AudacityProject *project,
|
||||
audCommandListFunction commandFunction,
|
||||
wxArrayInt explicitIndices);
|
||||
virtual void operator()(int index = 0);
|
||||
private:
|
||||
AudacityProject *mProject;
|
||||
audCommandFunction mCommandFunction;
|
||||
audCommandListFunction mCommandListFunction;
|
||||
wxArrayInt mExplicitIndices;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user