1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 06:01:13 +02:00

Define and use wxArrayStringEx...

reducing verbosity where there were repeated calls of Add(), and defining
move construction and assignment for efficient returns from functions
This commit is contained in:
Paul Licameli
2019-02-12 16:30:22 -05:00
parent 07a42e8e19
commit 6d5bc21d50
30 changed files with 383 additions and 262 deletions

View File

@@ -465,7 +465,7 @@ void ScreenshotCommand::CaptureEffects(
#define CAPTURE_NYQUIST_TOO
// Commented out the effects that don't have dialogs.
// Also any problematic ones,
const wxString EffectNames[] = {
CaptureCommands( context, {
#ifdef TRICKY_CAPTURE
//"Contrast...", // renamed
"ContrastAnalyser",
@@ -542,9 +542,7 @@ void ScreenshotCommand::CaptureEffects(
"Silence Finder...",
"Sound Finder...",
#endif
};
wxArrayString Commands( sizeof(EffectNames)/sizeof(EffectNames[0]), EffectNames );
CaptureCommands( context, Commands );
} );
}
void ScreenshotCommand::CaptureScriptables(
@@ -555,7 +553,7 @@ void ScreenshotCommand::CaptureScriptables(
(void)&FileName;//compiler food.
(void)&context;
const wxString ScriptablesNames[] = {
CaptureCommands( context, {
"SelectTime",
"SelectFrequencies",
"SelectTracks",
@@ -581,16 +579,13 @@ void ScreenshotCommand::CaptureScriptables(
"Drag",
"CompareAudio",
"Screenshot",
};
wxArrayString Commands( sizeof(ScriptablesNames)/sizeof(ScriptablesNames[0]), ScriptablesNames );
CaptureCommands( context, Commands );
} );
}
void ScreenshotCommand::CaptureCommands(
const CommandContext & context, wxArrayString & Commands ){
const CommandContext & context, const wxArrayStringEx & Commands ){
AudacityProject * pProject = context.GetProject();
CommandManager * pMan = pProject->GetCommandManager();
wxString Str;

View File

@@ -120,7 +120,7 @@ private:
bool CaptureToolbar(const CommandContext & Context, ToolManager *man, int type, const wxString &name);
bool CaptureDock(const CommandContext & Context, wxWindow *win, const wxString &fileName);
void CaptureCommands(const CommandContext & Context, wxArrayString &Commands );
void CaptureCommands(const CommandContext & Context, const wxArrayStringEx &Commands );
void CaptureEffects(const CommandContext & Context, AudacityProject * pProject, const wxString &fileName );
void CaptureScriptables(const CommandContext & Context, AudacityProject * pProject, const wxString &fileName );
void CapturePreferences(const CommandContext & Context, AudacityProject * pProject, const wxString &fileName );