1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-27 07:01:12 +01:00

Bug 406 - Label creation/other non-dialogue editing and keyboard selection hang on long projects

This is part 1...

Provides some relief to the selection "hang"

This patch adds the ability for the keyboard based commands (like cursor left,
extend selection right, etc.) to know when the key has been released.

When the patch is applied the current state is saved only when the key is
released and not every time it repeats.

Here's an example of the difference it makes.

This video show the selection "hang", but also watch the CPU usage.  All I'm
doing is pressing SHIFT+RIGHT ARROW.

http://youtu.be/tdMntDwGSkM

This one is the same thing bug with the patch applied.  Notice that the
selection "hang" no longer occurs and look at the CPU usage!

http://youtu.be/EpXNsQ4Cky0
This commit is contained in:
lllucius
2013-10-23 18:01:14 +00:00
parent 0bee195b0e
commit 03f5088b6a
8 changed files with 90 additions and 40 deletions

View File

@@ -569,6 +569,7 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
};
typedef void (AudacityProject::*audCommandFunction)();
typedef void (AudacityProject::*audCommandKeyFunction)(const wxEvent *);
typedef void (AudacityProject::*audCommandListFunction)(int);
// Previously this was in menus.cpp, and the declaration of the
@@ -578,15 +579,18 @@ class AUDACITY_DLL_API AudacityProjectCommandFunctor : public CommandFunctor
public:
AudacityProjectCommandFunctor(AudacityProject *project,
audCommandFunction commandFunction);
AudacityProjectCommandFunctor(AudacityProject *project,
audCommandKeyFunction commandFunction);
AudacityProjectCommandFunctor(AudacityProject *project,
audCommandListFunction commandFunction);
AudacityProjectCommandFunctor(AudacityProject *project,
audCommandListFunction commandFunction,
wxArrayInt explicitIndices);
virtual void operator()(int index = 0);
virtual void operator()(int index = 0, const wxEvent *evt = NULL);
private:
AudacityProject *mProject;
audCommandFunction mCommandFunction;
audCommandKeyFunction mCommandKeyFunction;
audCommandListFunction mCommandListFunction;
wxArrayInt mExplicitIndices;
};