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