Browse Source

Automation: AudacityCommand

This is a squash of 50 commits.

This merges the capabilities of BatchCommands and Effects using a new
AudacityCommand class.  AudacityCommand provides one function to specify the
parameters, and then we leverage that one function in automation, whether by chains,
mod-script-pipe or (future) Nyquist.

- Now have AudacityCommand which is using the same mechanism as Effect
- Has configurable parameters
- Has data-entry GUI (built using shuttle GUI)
- Registers with PluginManager.
- Menu commands now provided in chains, and to python batch.
   - Tested with Zoom Toggle.

- ShuttleParams now can set, get, set defaults, validate and specify
the parameters.
- Bugfix: Don't overwrite values with defaults first time out.
- Add DefineParams function for all built-in effects.
- Extend CommandContext to carry output channels for results.

We abuse EffectsManager.  It handles both Effects and
AudacityCommands now.  In time an Effect should become a special case of
AudacityCommand and we'll split and rename the EffectManager class.

- Don't use 'default' as a parameter name.
- Massive renaming for CommandDefinitionInterface
- EffectIdentInterface becomes EffectDefinitionInterface
- EffectAutomationParameters becomes CommandAutomationParameters
- PluginType is now a bit field.

This way we can search for related types at the same time.

- Most old batch commands made into AudacityCommands.
The ones that weren't are for a reason.  They are used by mod-script-pipe
to carry commands and responses across from a non-GUI thread to the GUI
thread.

- Major tidy up of ScreenshotCommand
- Reworking of SelectCommand
- GetPreferenceCommand and SetPreferenceCommand
- GetTrackInfo and SetTrackInfo
- GetInfoCommand
- Help, Open, Save, Import and Export commands.
- Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo
  which are now better handled by other commands.

- JSONify "GetInfo: Commands" output, i.e. commas in the right places.

- General work on better Doxygen.
    - Lyrics -> LyricsPanel
    - Meter -> MeterPanel
- Updated Linux makefile.
- Scripting commands added into Extra menu.
- Distinct names for previously duplicated find-clipping parameters.
- Fixed longstanding error with erroneous status field number which
  previously caused an ASSERT in debug.
- Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
au-ny-api
James Crook 4 years ago
committed by Paul Licameli
parent
commit
1c988b4e3a
  1. 65
      Makefile.in
  2. 7
      audacity.dox
  3. 13
      configure
  4. 24
      help/Makefile.in
  5. 28
      images/Makefile.in
  6. 18
      include/audacity/ConfigInterface.h
  7. 25
      include/audacity/EffectAutomationParameters.h
  8. 89
      include/audacity/EffectInterface.h
  9. 5
      include/audacity/IdentInterface.h
  10. 5
      include/audacity/ModuleInterface.h
  11. 8
      include/audacity/PluginInterface.h
  12. 6
      lib-src/FileDialog/FileDialog.h
  13. 2
      lib-src/FileDialog/win/FileDialogPrivate.h
  14. 27
      lib-src/Makefile.in
  15. 54
      mac/Audacity.xcodeproj/project.pbxproj
  16. 6
      scripts/piped-work/pipe-test.py
  17. 3
      src/AudacityApp.cpp
  18. 136
      src/BatchCommands.cpp
  19. 5
      src/BatchCommands.h
  20. 2
      src/BatchProcessDialog.cpp
  21. 3
      src/BatchProcessDialog.h
  22. 18
      src/Makefile.am
  23. 204
      src/Makefile.in
  24. 6
      src/MemoryX.h
  25. 131
      src/Menus.cpp
  26. 6
      src/Menus.h
  27. 4
      src/ModuleManager.cpp
  28. 2
      src/ModuleManager.h
  29. 120
      src/PluginManager.cpp
  30. 27
      src/PluginManager.h
  31. 7
      src/Project.cpp
  32. 16
      src/Project.h
  33. 50
      src/Registrar.h
  34. 89
      src/Screenshot.cpp
  35. 230
      src/Shuttle.cpp
  36. 131
      src/Shuttle.h
  37. 1
      src/ShuttleGui.h
  38. 1
      src/TimerRecordDialog.cpp
  39. 4
      src/TrackPanel.h
  40. 4
      src/commands/AppCommandEvent.cpp
  41. 10
      src/commands/AppCommandEvent.h
  42. 342
      src/commands/AudacityCommand.cpp
  43. 187
      src/commands/AudacityCommand.h
  44. 70
      src/commands/AutomationCommands.h
  45. 11
      src/commands/BatchEvalCommand.cpp
  46. 9
      src/commands/BatchEvalCommand.h
  47. 146
      src/commands/Command.cpp
  48. 92
      src/commands/Command.h
  49. 22
      src/commands/CommandBuilder.cpp
  50. 10
      src/commands/CommandBuilder.h
  51. 99
      src/commands/CommandContext.cpp
  52. 49
      src/commands/CommandContext.h
  53. 77
      src/commands/CommandDirectory.cpp
  54. 27
      src/commands/CommandFunctors.h
  55. 9
      src/commands/CommandHandler.cpp
  56. 6
      src/commands/CommandHandler.h
  57. 17
      src/commands/CommandManager.cpp
  58. 5
      src/commands/CommandManager.h
  59. 2
      src/commands/CommandTargets.h
  60. 2
      src/commands/CommandType.cpp
  61. 25
      src/commands/CommandType.h
  62. 69
      src/commands/CompareAudioCommand.cpp
  63. 30
      src/commands/CompareAudioCommand.h
  64. 60
      src/commands/Demo.cpp
  65. 43
      src/commands/Demo.h
  66. 44
      src/commands/ExecMenuCommand.cpp
  67. 45
      src/commands/ExecMenuCommand.h
  68. 201
      src/commands/GetInfoCommand.cpp
  69. 66
      src/commands/GetInfoCommand.h
  70. 172
      src/commands/GetProjectInfoCommand.cpp
  71. 66
      src/commands/GetProjectInfoCommand.h
  72. 164
      src/commands/GetTrackInfoCommand.cpp
  73. 29
      src/commands/GetTrackInfoCommand.h
  74. 47
      src/commands/HelpCommand.cpp
  75. 25
      src/commands/HelpCommand.h
  76. 103
      src/commands/ImportExportCommands.cpp
  77. 57
      src/commands/ImportExportCommands.h
  78. 295
      src/commands/LoadCommands.cpp
  79. 70
      src/commands/LoadCommands.h
  80. 9
      src/commands/MessageCommand.cpp
  81. 11
      src/commands/MessageCommand.h
  82. 86
      src/commands/OpenSaveCommands.cpp
  83. 61
      src/commands/OpenSaveCommands.h
  84. 78
      src/commands/PreferenceCommands.cpp
  85. 64
      src/commands/PreferenceCommands.h
  86. 694
      src/commands/ScreenshotCommand.cpp
  87. 74
      src/commands/ScreenshotCommand.h
  88. 5
      src/commands/ScriptCommandRelay.cpp
  89. 6
      src/commands/ScriptCommandRelay.h
  90. 187
      src/commands/SelectCommand.cpp
  91. 69
      src/commands/SelectCommand.h
  92. 111
      src/commands/SetProjectInfoCommand.cpp
  93. 66
      src/commands/SetProjectInfoCommand.h
  94. 101
      src/commands/SetTrackInfoCommand.cpp
  95. 47
      src/commands/SetTrackInfoCommand.h
  96. 10
      src/effects/Amplify.cpp
  97. 7
      src/effects/Amplify.h
  98. 16
      src/effects/AutoDuck.cpp
  99. 7
      src/effects/AutoDuck.h
  100. 13
      src/effects/BassTreble.cpp

65
Makefile.in

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -16,17 +16,7 @@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -90,6 +80,21 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(top_srcdir)/autotools/depcomp $(dist_doc_DATA) \
$(dist_pkgdata_DATA) $(nobase_dist_pkgdata_DATA) ABOUT-NLS \
INSTALL autotools/ar-lib autotools/compile \
autotools/config.guess autotools/config.rpath \
autotools/config.sub autotools/depcomp autotools/install-sh \
autotools/missing autotools/ltmain.sh \
$(top_srcdir)/autotools/ar-lib $(top_srcdir)/autotools/compile \
$(top_srcdir)/autotools/config.guess \
$(top_srcdir)/autotools/config.rpath \
$(top_srcdir)/autotools/config.sub \
$(top_srcdir)/autotools/install-sh \
$(top_srcdir)/autotools/ltmain.sh \
$(top_srcdir)/autotools/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
@ -132,9 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(dist_doc_DATA) $(dist_pkgdata_DATA) \
$(nobase_dist_pkgdata_DATA) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@ -259,18 +261,6 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/autotools/ar-lib \
$(top_srcdir)/autotools/compile \
$(top_srcdir)/autotools/config.guess \
$(top_srcdir)/autotools/config.rpath \
$(top_srcdir)/autotools/config.sub \
$(top_srcdir)/autotools/depcomp \
$(top_srcdir)/autotools/install-sh \
$(top_srcdir)/autotools/ltmain.sh \
$(top_srcdir)/autotools/missing ABOUT-NLS INSTALL \
autotools/ar-lib autotools/compile autotools/config.guess \
autotools/config.rpath autotools/config.sub autotools/depcomp \
autotools/install-sh autotools/ltmain.sh autotools/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@ -623,6 +613,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@ -984,15 +975,15 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@ -1028,17 +1019,17 @@ distcheck: dist
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
mkdir $(distdir)/_build $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
&& $(am__cd) $(distdir)/_build \
&& ../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
--srcdir=.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@ -1228,8 +1219,6 @@ uninstall-am: uninstall-binPROGRAMS uninstall-dist_docDATA \
uninstall-dist_docDATA uninstall-dist_pkgdataDATA \
uninstall-nobase_dist_pkgdataDATA
.PRECIOUS: Makefile
audacity$(EXEEXT): src/audacity$(EXEEXT)
rm -f audacity$(EXEEXT)

7
audacity.dox

@ -791,7 +791,9 @@ WARN_LOGFILE =
# Note: If this tag is empty the current directory is searched.
INPUT = src/ \
dox2-src/
dox2-src/ \
include/ \
lib-src/FileDialog/
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@ -2059,7 +2061,8 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED =
PREDEFINED = AUDACITY_DLL_API \
=
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The

13
configure

@ -2902,7 +2902,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
am__api_version='1.15'
am__api_version='1.14'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@ -3074,8 +3074,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
@ -3094,7 +3094,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh+set}" != xset; then
if test x"${install_sh}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@ -3422,8 +3422,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
@ -3597,7 +3597,6 @@ END
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.

24
help/Makefile.in

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -15,17 +15,7 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -89,6 +79,8 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = help
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(dist_man_MANS) $(dist_appdata_DATA)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
@ -131,8 +123,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_appdata_DATA) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/configwin.h \
$(top_builddir)/src/configunix.h
@ -190,7 +180,6 @@ NROFF = nroff
MANS = $(dist_man_MANS)
DATA = $(dist_appdata_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -416,6 +405,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign help/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign help/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@ -661,8 +651,6 @@ uninstall-man: uninstall-man1
tags-am uninstall uninstall-am uninstall-dist_appdataDATA \
uninstall-man uninstall-man1
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

28
images/Makefile.in

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -15,17 +15,7 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -89,6 +79,10 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = images
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(dist_icons16_DATA) $(dist_icons22_DATA) $(dist_icons24_DATA) \
$(dist_icons32_DATA) $(dist_icons48_DATA) \
$(dist_iconsscalable_DATA) $(dist_pixmap_DATA)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
@ -131,10 +125,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_icons16_DATA) \
$(dist_icons22_DATA) $(dist_icons24_DATA) $(dist_icons32_DATA) \
$(dist_icons48_DATA) $(dist_iconsscalable_DATA) \
$(dist_pixmap_DATA) $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/configwin.h \
$(top_builddir)/src/configunix.h
@ -194,7 +184,6 @@ DATA = $(dist_icons16_DATA) $(dist_icons22_DATA) $(dist_icons24_DATA) \
$(dist_icons32_DATA) $(dist_icons48_DATA) \
$(dist_iconsscalable_DATA) $(dist_pixmap_DATA) $(pixmap_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -498,6 +487,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign images/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign images/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@ -857,8 +847,6 @@ uninstall-am: uninstall-dist_icons16DATA uninstall-dist_icons22DATA \
uninstall-dist_iconsscalableDATA uninstall-dist_pixmapDATA \
uninstall-pixmapDATA
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

18
include/audacity/ConfigInterface.h

@ -42,6 +42,15 @@
#ifndef __AUDACITY_CONFIGINTERFACE_H__
#define __AUDACITY_CONFIGINTERFACE_H__
/*************************************************************************************//**
\class ConfigClientInterface
\brief ConfigClientInterface is an unholy get/set configuration class, which
differentiates between private and shared config. It should probably be replaced
with a Shuttle.
*******************************************************************************************/
class AUDACITY_DLL_API ConfigClientInterface /* not final */
{
public:
@ -84,11 +93,20 @@ public:
virtual bool RemovePrivateConfig(const wxString & group, const wxString & key) = 0;
};
#if 0
/*************************************************************************************//**
\class ConfigHostInterface
\brief ConfigHostInterface appears not to be used.
*******************************************************************************************/
class ConfigHostInterface
{
public:
virtual ~ConfigHostInterface() {};
};
#endif
#endif // __AUDACITY_CONFIGINTERFACE_H__

25
include/audacity/EffectAutomationParameters.h

@ -3,6 +3,7 @@
Audacity: A Digital Audio Editor
EffectAutomationParameters.h
(defining CommandAutomationParameters)
Leland Lucius
@ -39,8 +40,8 @@
**********************************************************************/
#ifndef __AUDACITY_EFFECTAUTOMATIONPARAMETERS_H__
#define __AUDACITY_EFFECTAUTOMATIONPARAMETERS_H__
#ifndef __AUDACITY_COMMAND_AUTOMATION_PARAMETERS_H__
#define __AUDACITY_COMMAND_AUTOMATION_PARAMETERS_H__
#include <locale.h>
@ -48,10 +49,22 @@
#include <wx/fileconf.h>
#include <wx/intl.h>
class EffectAutomationParameters : public wxFileConfig
/**
\brief CommandAutomationParameters, derived from wxFileConfig, is essentially doing
the same things as the Shuttle classes. It does text <-> binary conversions of
parameters. It does not seem to be using actual file read/writing.
Should it be converted to using Shuttle? Probably yes. Shuttle leads to shorter code.
And Shuttle is more multi-functional since Shuttle can report on signature, do the work of
wxWidget validators, and can create default dialogs. However until that conversion is
done, we need this class, and we use a pointer to one from within a Shuttle when interfacing
with the code that still uses it.
*/
class CommandAutomationParameters final : public wxFileConfig
{
public:
EffectAutomationParameters(const wxString & parms = wxEmptyString)
CommandAutomationParameters(const wxString & parms = wxEmptyString)
: wxFileConfig(wxEmptyString,
wxEmptyString,
wxEmptyString,
@ -61,7 +74,7 @@ public:
SetParameters(parms);
}
virtual ~EffectAutomationParameters()
virtual ~CommandAutomationParameters()
{
}
@ -114,7 +127,7 @@ public:
virtual bool DoWriteDouble(const wxString & key, double value) override
{
return DoWriteString(key, wxString::Format(wxT("%.12f"), value));
return DoWriteString(key, wxString::Format(wxT("%g"), value));
}
bool ReadFloat(const wxString & key, float *pf) const

89
include/audacity/EffectInterface.h

@ -45,7 +45,7 @@
#include "audacity/Types.h"
#include "audacity/IdentInterface.h"
#include "audacity/ConfigInterface.h"
#include "audacity/EffectAutomationParameters.h"
#include "audacity/EffectAutomationParameters.h" // for command automation
#include <wx/dialog.h>
@ -58,10 +58,35 @@ typedef enum EffectType
EffectTypeAnalyze
} EffectType;
class AUDACITY_DLL_API EffectIdentInterface /* not final */ : public IdentInterface
class ShuttleParams;
/*************************************************************************************//**
\class CommandDefinitionInterface
\brief CommandDefinitionInterface is an IdentInterface (to name the command) along with a
DefineParameters virtual function, that defines the parameters of the command.
*******************************************************************************************/
class AUDACITY_DLL_API CommandDefinitionInterface /* not final */ : public IdentInterface
{
public:
virtual ~EffectIdentInterface() {};
virtual ~CommandDefinitionInterface() {};
// returns true if implemented.
virtual bool DefineParams( ShuttleParams & WXUNUSED(S) ){ return false;};
};
/*************************************************************************************//**
\class EffectDefinitionInterface
\brief EffectDefinitionInterface is a CommandDefinitionInterface that additionally tracks
flag-functions for interactivity, play-preview and whether the effect can run without a GUI.
*******************************************************************************************/
class AUDACITY_DLL_API EffectDefinitionInterface /* not final */ : public CommandDefinitionInterface
{
public:
virtual ~EffectDefinitionInterface() {};
virtual EffectType GetType() = 0;
@ -94,6 +119,15 @@ public:
class EffectUIHostInterface;
class EffectUIClientInterface;
/*************************************************************************************//**
\class EffectHostInterface
\brief EffectHostInterface is a decorator of a EffectUIClientInterface. It adds
virtual (abstract) functions to get presets and actually apply the effect. It uses
ConfigClientInterface to add Getters/setters for private and shared configs.
*******************************************************************************************/
class AUDACITY_DLL_API EffectHostInterface /* not final */ : public ConfigClientInterface
{
public:
@ -116,7 +150,16 @@ public:
virtual wxString GetFactoryDefaultsGroup() = 0;
};
class AUDACITY_DLL_API EffectClientInterface /* not final */ : public EffectIdentInterface
/*************************************************************************************//**
\class EffectClientInterface
\brief EffectClientInterface provides the ident interface to Effect, and is what makes
Effect into a plug-in command. It has functions for realtime that are not part of
AudacityCommand.
*******************************************************************************************/
class AUDACITY_DLL_API EffectClientInterface /* not final */ : public EffectDefinitionInterface
{
public:
virtual ~EffectClientInterface() {};
@ -151,9 +194,15 @@ public:
virtual bool RealtimeProcessEnd() = 0;
virtual bool ShowInterface(wxWindow *parent, bool forceModal = false) = 0;
virtual bool GetAutomationParameters(EffectAutomationParameters & parms) = 0;
virtual bool SetAutomationParameters(EffectAutomationParameters & parms) = 0;
// Some effects will use define params to define what parameters they take.
// If they do, they won't need to implement Get or SetAutomation parameters.
// since the Effect class can do it. Or at least that is how things happen
// in AudacityCommand. IF we do the same in class Effect, then Effect maybe
// should derive by some route from AudacityCommand to pick up that
// functionality.
//virtual bool DefineParams( ShuttleParams & S){ return false;};
virtual bool GetAutomationParameters(CommandAutomationParameters & parms) = 0;
virtual bool SetAutomationParameters(CommandAutomationParameters & parms) = 0;
virtual bool LoadUserPreset(const wxString & name) = 0;
virtual bool SaveUserPreset(const wxString & name) = 0;
@ -163,12 +212,29 @@ public:
virtual bool LoadFactoryDefaults() = 0;
};
/*************************************************************************************//**
\class EffectUIHostInterface
\brief EffectUIHostInterface has nothing in it. It is provided so that an Effect
can call SetHostUI passing in a pointer to an EffectUIHostInterface. It contains no
functionality and is provided, apparently, for type checking. Since only EffectUIHost
uses it, EffectUIHost could be used instead.
*******************************************************************************************/
class AUDACITY_DLL_API EffectUIHostInterface
{
public:
virtual ~EffectUIHostInterface() {};
};
/*************************************************************************************//**
\class EffectUIClientInterface
\brief EffectUIClientInterface is an abstract base class to populate a UI and validate UI
values. It can import and export presets.
*******************************************************************************************/
class AUDACITY_DLL_API EffectUIClientInterface /* not final */
{
public:
@ -189,6 +255,15 @@ public:
virtual void ShowOptions() = 0;
};
/*************************************************************************************//**
\class EffectManagerInterface
\brief UNUSED. EffectManagerInterface provides a single function to find files matching
a pattern in a list.
*******************************************************************************************/
class AUDACITY_DLL_API EffectManagerInterface
{
public:

5
include/audacity/IdentInterface.h

@ -44,6 +44,11 @@
#include "audacity/Types.h"
/**************************************************************************//**
\brief IdentInterface provides name / vendor / version functions to identify
plugins. It is what makes a class a plug-in.
********************************************************************************/
class AUDACITY_DLL_API IdentInterface /* not final */
{
public:

5
include/audacity/ModuleInterface.h

@ -120,11 +120,10 @@ public:
// Return value is the number of plugins found.
using RegistrationCallback =
std::function<
const PluginID &(ModuleInterface *, EffectIdentInterface *) >;
const PluginID &(ModuleInterface *, CommandDefinitionInterface *) >;
virtual unsigned DiscoverPluginsAtPath(
const wxString & path, wxString &errMsg,
const RegistrationCallback &callback =
PluginManagerInterface::DefaultRegistrationCallback)
const RegistrationCallback &callback )
= 0;
// For modules providing an interface to other dynamically loaded plugins,

8
include/audacity/PluginInterface.h

@ -48,19 +48,23 @@
#include "audacity/ImporterInterface.h"
#include "audacity/ModuleInterface.h"
class ModuleInterface;
class PluginManagerInterface /* not final */
{
public:
static const PluginID &DefaultRegistrationCallback(
ModuleInterface *provider, EffectIdentInterface *ident );
ModuleInterface *provider, CommandDefinitionInterface *ident );
static const PluginID &GenericRegistrationCallback(
ModuleInterface *provider, CommandDefinitionInterface *ident );
virtual bool IsPluginRegistered(const wxString & path) = 0;
virtual const PluginID & RegisterPlugin(ModuleInterface *module) = 0;
virtual const PluginID & RegisterPlugin(ModuleInterface *provider, EffectIdentInterface *effect) = 0;
virtual const PluginID & RegisterPlugin(ModuleInterface *provider, EffectDefinitionInterface *effect, int type) = 0;
virtual const PluginID & RegisterPlugin(ModuleInterface *provider, ImporterInterface *importer) = 0;
virtual void FindFilesInPathList(const wxString & pattern,

6
lib-src/FileDialog/FileDialog.h

@ -21,7 +21,11 @@ custom controls.
#include <wx/filectrl.h>
#include <wx/filedlg.h>
class FileDialogBase : public wxFileDialogBase
#ifndef AUDACITY_DLL_API
#define AUDACITY_DLL_API
#endif
class AUDACITY_DLL_API FileDialogBase : public wxFileDialogBase
{
public:
FileDialogBase();

2
lib-src/FileDialog/win/FileDialogPrivate.h

@ -22,7 +22,7 @@
// FileDialog
//-------------------------------------------------------------------------
class FileDialog : public FileDialogBase
class AUDACITY_DLL_API FileDialog : public FileDialogBase
{
public:
FileDialog();

27
lib-src/Makefile.in

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -14,17 +14,7 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -87,6 +77,9 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(srcdir)/dist-libsoxr.mk $(srcdir)/dist-libvamp.mk \
$(srcdir)/dist-portaudio.mk $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am
@USE_LOCAL_EXPAT_TRUE@am__append_1 = expat
@USE_LOCAL_LIBID3TAG_TRUE@am__append_2 = libid3tag
@USE_LOCAL_LIBMAD_TRUE@am__append_3 = libmad
@ -149,7 +142,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/configwin.h \
$(top_builddir)/src/configunix.h
@ -209,8 +201,6 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/dist-libsoxr.mk \
$(srcdir)/dist-libvamp.mk $(srcdir)/dist-portaudio.mk
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@ -978,6 +968,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/di
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib-src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign lib-src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@ -986,7 +977,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(srcdir)/dist-libsoxr.mk $(srcdir)/dist-libvamp.mk $(srcdir)/dist-portaudio.mk $(am__empty):
$(srcdir)/dist-libsoxr.mk $(srcdir)/dist-libvamp.mk $(srcdir)/dist-portaudio.mk:
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@ -1254,8 +1245,6 @@ uninstall-am:
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Overwrite install* targets from automake. We do not want to install anything
# from the lib-src libraries, because we statically link these libraries.

54
mac/Audacity.xcodeproj/project.pbxproj

@ -486,8 +486,6 @@
2840CF760AEB807E00F49FC3 /* util.h in Headers */ = {isa = PBXBuildFile; fileRef = 2840CF4C0AEB807E00F49FC3 /* util.h */; };
2840CF860AEB83DB00F49FC3 /* ExportMP2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2840CF840AEB83DB00F49FC3 /* ExportMP2.cpp */; };
2840CFA80AEB883500F49FC3 /* libtwolame.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2840CF220AEB803C00F49FC3 /* libtwolame.a */; };
284249EE10D337CE004330A6 /* GetProjectInfoCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 284249EA10D337CE004330A6 /* GetProjectInfoCommand.cpp */; };
284249EF10D337CE004330A6 /* SetProjectInfoCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 284249EC10D337CE004330A6 /* SetProjectInfoCommand.cpp */; };
28456AC20A2C180E00C23C1E /* ThemePrefs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28456AC00A2C180E00C23C1E /* ThemePrefs.cpp */; };
284750541AD4EB84000AD751 /* common.h in Headers */ = {isa = PBXBuildFile; fileRef = 2847504D1AD4EB84000AD751 /* common.h */; };
284750551AD4EB84000AD751 /* digest.c in Sources */ = {isa = PBXBuildFile; fileRef = 2847504E1AD4EB84000AD751 /* digest.c */; };
@ -887,7 +885,6 @@
28BB98051A15BE6800D1CC80 /* NoiseReduction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28BB98031A15BE6800D1CC80 /* NoiseReduction.cpp */; };
28BD8AB1101DF4C700686679 /* BatchEvalCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28BD8AA9101DF4C600686679 /* BatchEvalCommand.cpp */; };
28BD8AB2101DF4C700686679 /* CommandDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28BD8AAA101DF4C600686679 /* CommandDirectory.cpp */; };
28BD8AB3101DF4C700686679 /* ExecMenuCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28BD8AAC101DF4C600686679 /* ExecMenuCommand.cpp */; };
28C3946D1818356800FDDAC9 /* AudacityLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28C3946B1818356800FDDAC9 /* AudacityLogger.cpp */; };
28C816BA131255790035BB10 /* Audacity.sh in Install wrapper */ = {isa = PBXBuildFile; fileRef = 28C816B81312555B0035BB10 /* Audacity.sh */; };
28C8211D1B5C661E00B53328 /* ViewInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28C8211C1B5C661E00B53328 /* ViewInfo.cpp */; };
@ -1265,8 +1262,12 @@
5ED1D0AE1CDE55BD00471E3C /* OverlayPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5ED1D0AB1CDE55BD00471E3C /* OverlayPanel.cpp */; };
5ED1D0B11CDE560C00471E3C /* BackedPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5ED1D0AF1CDE560C00471E3C /* BackedPanel.cpp */; };
5EF17C231D1F0A690090A642 /* ScrubbingToolBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EF17C211D1F0A690090A642 /* ScrubbingToolBar.cpp */; };
5EF3E64D203FBAFB006C6882 /* AudacityCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EF3E643203FBAFB006C6882 /* AudacityCommand.cpp */; };
5EF3E64E203FBAFB006C6882 /* CommandContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EF3E645203FBAFB006C6882 /* CommandContext.cpp */; };
5EF3E64F203FBAFB006C6882 /* Demo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EF3E647203FBAFB006C6882 /* Demo.cpp */; };
5EF3E650203FBAFB006C6882 /* GetInfoCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EF3E649203FBAFB006C6882 /* GetInfoCommand.cpp */; };
5EF3E651203FBAFB006C6882 /* LoadCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EF3E64B203FBAFB006C6882 /* LoadCommands.cpp */; };
5EF958851DEB121800191280 /* InconsistencyException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EF958831DEB121800191280 /* InconsistencyException.cpp */; };
65BD96CF200150D5004090BD /* AutomationCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65BD96CD200150D5004090BD /* AutomationCommands.cpp */; };
8406A93812D0F2510011EA01 /* EQDefaultCurves.xml in Resources */ = {isa = PBXBuildFile; fileRef = 8406A93712D0F2510011EA01 /* EQDefaultCurves.xml */; };
8484F31413086237002DF7F0 /* DeviceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8484F31213086237002DF7F0 /* DeviceManager.cpp */; };
AA0084191EA8C6E70070CCE3 /* TracksBehaviorsPrefs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA0084181EA8C6E70070CCE3 /* TracksBehaviorsPrefs.cpp */; };
@ -2227,10 +2228,6 @@
2840CF4C0AEB807E00F49FC3 /* util.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = util.h; path = twolame/libtwolame/util.h; sourceTree = "<group>"; tabWidth = 3; };
2840CF840AEB83DB00F49FC3 /* ExportMP2.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportMP2.cpp; sourceTree = "<group>"; tabWidth = 3; };
2840CF850AEB83DB00F49FC3 /* ExportMP2.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportMP2.h; sourceTree = "<group>"; tabWidth = 3; };
284249EA10D337CE004330A6 /* GetProjectInfoCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = GetProjectInfoCommand.cpp; sourceTree = "<group>"; tabWidth = 3; };
284249EB10D337CE004330A6 /* GetProjectInfoCommand.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = GetProjectInfoCommand.h; sourceTree = "<group>"; tabWidth = 3; };
284249EC10D337CE004330A6 /* SetProjectInfoCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = SetProjectInfoCommand.cpp; sourceTree = "<group>"; tabWidth = 3; };
284249ED10D337CE004330A6 /* SetProjectInfoCommand.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = SetProjectInfoCommand.h; sourceTree = "<group>"; tabWidth = 3; };
284416391B82D6BC0000574D /* TranslatableStringArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TranslatableStringArray.h; sourceTree = "<group>"; };
2844163A1B82D6BC0000574D /* WaveTrackLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WaveTrackLocation.h; sourceTree = "<group>"; };
28456AC00A2C180E00C23C1E /* ThemePrefs.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ThemePrefs.cpp; sourceTree = "<group>"; tabWidth = 3; };
@ -2694,8 +2691,6 @@
28BD8AA9101DF4C600686679 /* BatchEvalCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = BatchEvalCommand.cpp; sourceTree = "<group>"; tabWidth = 3; };
28BD8AAA101DF4C600686679 /* CommandDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = CommandDirectory.cpp; sourceTree = "<group>"; tabWidth = 3; };
28BD8AAB101DF4C600686679 /* CommandDirectory.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = CommandDirectory.h; sourceTree = "<group>"; tabWidth = 3; };
28BD8AAC101DF4C600686679 /* ExecMenuCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExecMenuCommand.cpp; sourceTree = "<group>"; tabWidth = 3; };
28BD8AAD101DF4C600686679 /* ExecMenuCommand.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExecMenuCommand.h; sourceTree = "<group>"; tabWidth = 3; };
28BD8AB0101DF4C600686679 /* Validators.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = Validators.h; sourceTree = "<group>"; tabWidth = 3; };
28C3946B1818356800FDDAC9 /* AudacityLogger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudacityLogger.cpp; sourceTree = "<group>"; };
28C3946C1818356800FDDAC9 /* AudacityLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudacityLogger.h; sourceTree = "<group>"; };
@ -3160,10 +3155,18 @@
5ED1D0B01CDE560C00471E3C /* BackedPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackedPanel.h; sourceTree = "<group>"; };
5EF17C211D1F0A690090A642 /* ScrubbingToolBar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrubbingToolBar.cpp; sourceTree = "<group>"; };
5EF17C221D1F0A690090A642 /* ScrubbingToolBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrubbingToolBar.h; sourceTree = "<group>"; };
5EF3E643203FBAFB006C6882 /* AudacityCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudacityCommand.cpp; sourceTree = "<group>"; };
5EF3E644203FBAFB006C6882 /* AudacityCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudacityCommand.h; sourceTree = "<group>"; };
5EF3E645203FBAFB006C6882 /* CommandContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommandContext.cpp; sourceTree = "<group>"; };
5EF3E646203FBAFB006C6882 /* CommandContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommandContext.h; sourceTree = "<group>"; };
5EF3E647203FBAFB006C6882 /* Demo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Demo.cpp; sourceTree = "<group>"; };
5EF3E648203FBAFB006C6882 /* Demo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Demo.h; sourceTree = "<group>"; };
5EF3E649203FBAFB006C6882 /* GetInfoCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetInfoCommand.cpp; sourceTree = "<group>"; };
5EF3E64A203FBAFB006C6882 /* GetInfoCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetInfoCommand.h; sourceTree = "<group>"; };
5EF3E64B203FBAFB006C6882 /* LoadCommands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadCommands.cpp; sourceTree = "<group>"; };
5EF3E64C203FBAFB006C6882 /* LoadCommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadCommands.h; sourceTree = "<group>"; };
5EF958831DEB121800191280 /* InconsistencyException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InconsistencyException.cpp; sourceTree = "<group>"; };
5EF958841DEB121800191280 /* InconsistencyException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InconsistencyException.h; sourceTree = "<group>"; };
65BD96CD200150D5004090BD /* AutomationCommands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AutomationCommands.cpp; sourceTree = "<group>"; };
65BD96CE200150D5004090BD /* AutomationCommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutomationCommands.h; sourceTree = "<group>"; };
82FF184D13CF01A600C1B664 /* dBTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dBTable.cpp; path = sbsms/src/dBTable.cpp; sourceTree = "<group>"; };
82FF184E13CF01A600C1B664 /* dBTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dBTable.h; path = sbsms/src/dBTable.h; sourceTree = "<group>"; };
82FF184F13CF01A600C1B664 /* slide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = slide.cpp; path = sbsms/src/slide.cpp; sourceTree = "<group>"; };
@ -3751,23 +3754,25 @@
174D9025098C78AF00D5909F /* commands */ = {
isa = PBXGroup;
children = (
65BD96CD200150D5004090BD /* AutomationCommands.cpp */,
28D53FFA0FD1912A00FA7C75 /* AppCommandEvent.cpp */,
5EF3E643203FBAFB006C6882 /* AudacityCommand.cpp */,
28BD8AA9101DF4C600686679 /* BatchEvalCommand.cpp */,
28851F9C1027F16400152EE1 /* Command.cpp */,
28D53FFE0FD1912A00FA7C75 /* CommandBuilder.cpp */,
5EF3E645203FBAFB006C6882 /* CommandContext.cpp */,
28BD8AAA101DF4C600686679 /* CommandDirectory.cpp */,
28D540000FD1912A00FA7C75 /* CommandHandler.cpp */,
174D9026098C78AF00D5909F /* CommandManager.cpp */,
28851F9D1027F16400152EE1 /* CommandSignature.cpp */,
28851F9F1027F16400152EE1 /* CommandType.cpp */,
28851FA11027F16400152EE1 /* CompareAudioCommand.cpp */,
28BD8AAC101DF4C600686679 /* ExecMenuCommand.cpp */,
284249EA10D337CE004330A6 /* GetProjectInfoCommand.cpp */,
5EF3E647203FBAFB006C6882 /* Demo.cpp */,
5EF3E649203FBAFB006C6882 /* GetInfoCommand.cpp */,
28851FA31027F16400152EE1 /* GetTrackInfoCommand.cpp */,
28851FA51027F16400152EE1 /* HelpCommand.cpp */,
EDD94ED9103CB520000873F1 /* ImportExportCommands.cpp */,
174D902A098C78AF00D5909F /* Keyboard.cpp */,
5EF3E64B203FBAFB006C6882 /* LoadCommands.cpp */,
28851FA71027F16400152EE1 /* MessageCommand.cpp */,
EDFCEB9A18894AE600C98E51 /* OpenSaveCommands.cpp */,
28DE72AA10388583007E18EC /* PreferenceCommands.cpp */,
@ -3775,13 +3780,13 @@
181855950FFE916C0026D190 /* ScreenshotCommand.cpp */,
28D540030FD1912A00FA7C75 /* ScriptCommandRelay.cpp */,
28851FA91027F16400152EE1 /* SelectCommand.cpp */,
284249EC10D337CE004330A6 /* SetProjectInfoCommand.cpp */,
28DE72AC10388583007E18EC /* SetTrackInfoCommand.cpp */,
65BD96CE200150D5004090BD /* AutomationCommands.h */,
28D53FFB0FD1912A00FA7C75 /* AppCommandEvent.h */,
5EF3E644203FBAFB006C6882 /* AudacityCommand.h */,
28D53FFC0FD1912A00FA7C75 /* BatchEvalCommand.h */,
28D53FFD0FD1912A00FA7C75 /* Command.h */,
28D53FFF0FD1912A00FA7C75 /* CommandBuilder.h */,
5EF3E646203FBAFB006C6882 /* CommandContext.h */,
28BD8AAB101DF4C600686679 /* CommandDirectory.h */,
5E7838931DE4BBC2003270C0 /* CommandFlag.h */,
5E4685F81CCA9D84008741F2 /* CommandFunctors.h */,
@ -3792,12 +3797,13 @@
181855900FFE916C0026D190 /* CommandTargets.h */,
28851FA01027F16400152EE1 /* CommandType.h */,
28851FA21027F16400152EE1 /* CompareAudioCommand.h */,
28BD8AAD101DF4C600686679 /* ExecMenuCommand.h */,
284249EB10D337CE004330A6 /* GetProjectInfoCommand.h */,
5EF3E648203FBAFB006C6882 /* Demo.h */,
5EF3E64A203FBAFB006C6882 /* GetInfoCommand.h */,
28851FA41027F16400152EE1 /* GetTrackInfoCommand.h */,
28851FA61027F16400152EE1 /* HelpCommand.h */,
EDD94EDA103CB520000873F1 /* ImportExportCommands.h */,
174D902B098C78AF00D5909F /* Keyboard.h */,
5EF3E64C203FBAFB006C6882 /* LoadCommands.h */,
28851FA81027F16400152EE1 /* MessageCommand.h */,
EDFCEB9B18894AE600C98E51 /* OpenSaveCommands.h */,
28DE72AB10388583007E18EC /* PreferenceCommands.h */,
@ -3805,7 +3811,6 @@
181855960FFE916C0026D190 /* ScreenshotCommand.h */,
28D540040FD1912A00FA7C75 /* ScriptCommandRelay.h */,
28851FAA1027F16400152EE1 /* SelectCommand.h */,
284249ED10D337CE004330A6 /* SetProjectInfoCommand.h */,
28DE72AD10388583007E18EC /* SetTrackInfoCommand.h */,
28BD8AB0101DF4C600686679 /* Validators.h */,
);
@ -7745,6 +7750,7 @@
1790B17009883BFD008A330A /* Internat.cpp in Sources */,
1790B17109883BFD008A330A /* LabelTrack.cpp in Sources */,
1790B17309883BFD008A330A /* LangChoice.cpp in Sources */,
5EF3E651203FBAFB006C6882 /* LoadCommands.cpp in Sources */,
282B70331B682342009A1618 /* WaveformPrefs.cpp in Sources */,
1790B17409883BFD008A330A /* Languages.cpp in Sources */,
1790B17509883BFD008A330A /* Legacy.cpp in Sources */,
@ -7831,6 +7837,7 @@
2897F6F40AB3DB5A003C20C5 /* SelectionBar.cpp in Sources */,
2897F6F50AB3DB5A003C20C5 /* ToolBar.cpp in Sources */,
2897F6F60AB3DB5A003C20C5 /* ToolDock.cpp in Sources */,
5EF3E64E203FBAFB006C6882 /* CommandContext.cpp in Sources */,
2897F6F70AB3DB5A003C20C5 /* ToolManager.cpp in Sources */,
2897F6F80AB3DB5A003C20C5 /* ToolsToolBar.cpp in Sources */,
2897F6F90AB3DB5A003C20C5 /* TranscriptionToolBar.cpp in Sources */,
@ -7923,7 +7930,6 @@
28BD8AB1101DF4C700686679 /* BatchEvalCommand.cpp in Sources */,
28BD8AB2101DF4C700686679 /* CommandDirectory.cpp in Sources */,
5E10D9061EC8F81300B3AC57 /* PlayableTrackButtonHandles.cpp in Sources */,
28BD8AB3101DF4C700686679 /* ExecMenuCommand.cpp in Sources */,
28948427101DF8FC005B0713 /* EffectsPrefs.cpp in Sources */,
287E207F102561F300BF47A2 /* PluginManager.cpp in Sources */,
5E7396501DAFD98400BA0A4D /* SliderHandle.cpp in Sources */,
@ -7941,11 +7947,10 @@
28DE72AF10388583007E18EC /* SetTrackInfoCommand.cpp in Sources */,
28DE72B2103885AA007E18EC /* TimeWarper.cpp in Sources */,
EDD94EDB103CB520000873F1 /* ImportExportCommands.cpp in Sources */,
284249EE10D337CE004330A6 /* GetProjectInfoCommand.cpp in Sources */,
284249EF10D337CE004330A6 /* SetProjectInfoCommand.cpp in Sources */,
18CE3C951145511200282C50 /* ODDecodeFFmpegTask.cpp in Sources */,
ED90976D116CAD49002F7479 /* ExtImportPrefs.cpp in Sources */,
ED64C823124567ED007CF2FC /* ScoreAlignDialog.cpp in Sources */,
5EF3E650203FBAFB006C6882 /* GetInfoCommand.cpp in Sources */,
8484F31413086237002DF7F0 /* DeviceManager.cpp in Sources */,
5EBD243D1F74C50800132E0A /* eu_ES.po in Sources */,
5EBD35861F78D37A0084D13F /* pt_PT.po in Sources */,
@ -7956,6 +7961,7 @@
28884945131B6CF600B59735 /* be.po in Sources */,
28884946131B6CF600B59735 /* bg.po in Sources */,
28884947131B6CF600B59735 /* bn.po in Sources */,
5EF3E64D203FBAFB006C6882 /* AudacityCommand.cpp in Sources */,
AA0084191EA8C6E70070CCE3 /* TracksBehaviorsPrefs.cpp in Sources */,
28884948131B6CF600B59735 /* bs.po in Sources */,
28884949131B6CF600B59735 /* ca.po in Sources */,
@ -7995,6 +8001,7 @@
28884969131B6CF600B59735 /* ro.po in Sources */,
2888496A131B6CF600B59735 /* ru.po in Sources */,
2888496B131B6CF600B59735 /* sk.po in Sources */,
5EF3E64F203FBAFB006C6882 /* Demo.cpp in Sources */,
EDAD326B1544452E009C6220 /* sl.po in Sources */,
EDAD326C1544452E009C6220 /* sr_RS.po in Sources */,
EDAD326D1544452E009C6220 /* sr_RS@latin.po in Sources */,
@ -8008,7 +8015,6 @@
28884971131B6CF600B59735 /* vi.po in Sources */,
289D127A1B44D57F00B5B6AA /* VSTControlOSX.mm in Sources */,
28884972131B6CF600B59735 /* zh_TW.po in Sources */,
65BD96CF200150D5004090BD /* AutomationCommands.cpp in Sources */,
EDF3B7B01588C0D50032D35F /* Paulstretch.cpp in Sources */,
ED920CAF15B19F61008CA12C /* ModulePrefs.cpp in Sources */,
EDD2431416934A6100D9DEC2 /* BassTreble.cpp in Sources */,

6
scripts/piped-work/pipe-test.py

@ -64,8 +64,8 @@ def do( command ) :
doCommand( command )
def quickTest() :
do( 'Help: CommandName=Help' )
do( 'Help: CommandName=SetPreference' )
do( 'SetPreference: PrefName=GUI/Theme PrefValue=light' )
do( 'Help: Command=Help' )
do( 'Help: Command="SetTrackInfo"' )
do( 'SetPreference: Name=GUI/Theme Value=light Reload=false' )
quickTest()

3
src/AudacityApp.cpp

@ -68,6 +68,7 @@ It handles initialization and termination by subclassing wxApp.
#include "DirManager.h"
#include "commands/CommandHandler.h"
#include "commands/AppCommandEvent.h"
#include "commands/CommandContext.h"
#include "effects/Contrast.h"
#include "widgets/ASlider.h"
#include "FFmpeg.h"
@ -1643,7 +1644,7 @@ bool AudacityApp::OnInit()
void AudacityApp::InitCommandHandler()
{
mCmdHandler = std::make_unique<CommandHandler>(*this);
mCmdHandler = std::make_unique<CommandHandler>();
//SetNextHandler(mCmdHandler);
}

136
src/BatchCommands.cpp

@ -44,6 +44,9 @@ See also BatchCommandDialog and BatchProcessDialog.
#include "Track.h"
#include "widgets/ErrorDialog.h"
#include "commands/CommandFunctors.h"
#include "commands/CommandContext.h"
// KLUDGE: All commands should be on the same footing
// however, for historical reasons we distinguish between
// - Effects (which are looked up in effects lists)
@ -153,23 +156,6 @@ bool BatchCommands::ReadChain(const wxString & chain)
wxString cmd = tf[i].Left(splitAt).Strip(wxString::both);
wxString parm = tf[i].Mid(splitAt + 1).Strip(wxString::trailing);
// Backward compatibility for old Chain scripts
// Please comment the version of audacity these are introduced in, so
// that old ones can easily be removed once users have had a chance to
// migrate
if (cmd == wxT("SaveMP3_56k_before"))
cmd = wxT("ExportMP3_56k_before");
else if (cmd == wxT("SaveMP3_56k_after"))
cmd = wxT("ExportMP3_56k_after");
else if (cmd == wxT("ExportFlac"))
cmd = wxT("ExportFLAC");
else if (cmd == wxT("ExportMp3"))
cmd = wxT("ExportMP3");
else if (cmd == wxT("ExportWav"))
cmd = wxT("ExportWAV");
else if (cmd == wxT("Compressor") && (parm.find(wxT("DecayTime")) != parm.npos))
parm.Replace(wxT("DecayTime"), wxT("ReleaseTime"), NULL); // 2.0.6
// Add to lists
mCommandChain.Add(cmd);
mParamsChain.Add(parm);
@ -210,18 +196,6 @@ bool BatchCommands::WriteChain(const wxString & chain)
// Copy over the commands
int lines = mCommandChain.GetCount();
for (int i = 0; i < lines; i++) {
// restore deprecated commands in chain script
if (mCommandChain[i] == wxT("ExportMP3_56k_before"))
mCommandChain[i] = wxT("SaveMP3_56k_before");
else if (mCommandChain[i] == wxT("ExportMP3_56k_after"))
mCommandChain[i] = wxT("SaveMP3_56k_after");
else if (mCommandChain[i] == wxT("ExportFLAC"))
mCommandChain[i] = wxT("ExportFlac");
else if (mCommandChain[i] == wxT("ExportMP3"))
mCommandChain[i] = wxT("ExportMp3");
else if (mCommandChain[i] == wxT("ExportWAV"))
mCommandChain[i] = wxT("ExportWav");
tf.AddLine(mCommandChain[i] + wxT(":") + mParamsChain[ i ]);
}
@ -294,16 +268,37 @@ auto BatchCommands::GetAllCommands() -> CommandNameVector
PluginManager & pm = PluginManager::Get();
EffectManager & em = EffectManager::Get();
const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeEffect);
while (plug)
{
auto command = em.GetEffectIdentifier(plug->GetID());
if (!command.IsEmpty())
commands.push_back( {
plug->GetUntranslatedName(), // plug->GetTranslatedName(),
command
} );
plug = pm.GetNextPlugin(PluginTypeEffect);
const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeEffect|PluginTypeGeneric);
while (plug)
{
auto command = em.GetCommandIdentifier(plug->GetID());
if (!command.IsEmpty())
commands.push_back( {
plug->GetUntranslatedName(), // plug->GetTranslatedName(),
command
} );
plug = pm.GetNextPlugin(PluginTypeEffect|PluginTypeGeneric);
}
}
CommandManager * mManager = project->GetCommandManager();
wxArrayString mLabels;
wxArrayString mNames;
mLabels.Clear();
mNames.Clear();
mManager->GetAllCommandLabels(mLabels, false);
mManager->GetAllCommandNames(mNames, false);
for(size_t i=0; i<mNames.GetCount(); i++) {
if( !mLabels[i].Contains( "..." ) ){
mLabels[i].Replace( "&", "" );
commands.push_back(
{
mLabels[i] + " (" + mNames[i] + ")", // User readable name
mNames[i] // Internal name.
}
);
}
}
// Sort commands by their user-visible names.
@ -315,15 +310,8 @@ auto BatchCommands::GetAllCommands() -> CommandNameVector
{ return a.first < b.first; }
);
/* This is for later in development: include the menu commands.
CommandManager * mManager = project->GetCommandManager();
wxArrayString mNames;
mNames.Clear();
mManager->GetAllCommandNames(mNames, false);
for(i=0; i<mNames.GetCount(); i++) {
commands.Add( mNames[i] );
}
*/
return commands;
}
@ -479,6 +467,7 @@ wxString BatchCommands::BuildCleanFileName(const wxString &fileName, const wxStr
return cleanedName;
}
// TODO Move this out of Batch Commands
bool BatchCommands::WriteMp3File( const wxString & Name, int bitrate )
{ //check if current project is mono or stereo
unsigned numChannels = 2;
@ -611,18 +600,23 @@ bool BatchCommands::ApplySpecialCommand(int WXUNUSED(iCommand), const wxString &
}
// end CLEANSPEECH remnant
bool BatchCommands::ApplyEffectCommand(const PluginID & ID, const wxString & command, const wxString & params)
bool BatchCommands::ApplyEffectCommand(const PluginID & ID, const wxString & command, const wxString & params, const CommandContext & Context)
{
//Possibly end processing here, if in batch-debug
if( ReportAndSkip(command, params))
return true;
const PluginDescriptor *plug = PluginManager::Get().GetPlugin(ID);
if (!plug)
return false;
AudacityProject *project = GetActiveProject();
// FIXME: for later versions may want to not select-all in batch mode.
// IF nothing selected, THEN select everything
// (most effects require that you have something selected).
project->SelectAllIfNone();
if( plug->GetPluginType() != PluginTypeGeneric )
project->SelectAllIfNone();
bool res = false;
@ -631,16 +625,26 @@ bool BatchCommands::ApplyEffectCommand(const PluginID & ID, const wxString & com
// transfer the parameters to the effect...
if (EffectManager::Get().SetEffectParameters(ID, params))
{
// and apply the effect...
res = project->DoEffect(ID, AudacityProject::OnEffectFlags::kConfigured |
AudacityProject::OnEffectFlags::kSkipState |
AudacityProject::OnEffectFlags::kDontRepeatLast);
if( plug->GetPluginType() == PluginTypeGeneric )
// and apply the effect...
res = project->DoAudacityCommand(ID,
Context,
AudacityProject::OnEffectFlags::kConfigured |
AudacityProject::OnEffectFlags::kSkipState |
AudacityProject::OnEffectFlags::kDontRepeatLast);
else
// and apply the effect...
res = project->DoEffect(ID,
Context,
AudacityProject::OnEffectFlags::kConfigured |
AudacityProject::OnEffectFlags::kSkipState |
AudacityProject::OnEffectFlags::kDontRepeatLast);
}
return res;
}
bool BatchCommands::ApplyCommand(const wxString & command, const wxString & params)
bool BatchCommands::ApplyCommand(const wxString & command, const wxString & params, CommandContext const * pContext)
{
unsigned int i;
@ -656,7 +660,26 @@ bool BatchCommands::ApplyCommand(const wxString & command, const wxString & para
const PluginID & ID = EffectManager::Get().GetEffectByIdentifier( command );
if (!ID.empty())
{
return ApplyEffectCommand(ID, command, params);
if( pContext )
return ApplyEffectCommand(ID, command, params, *pContext);
const CommandContext context( *GetActiveProject() );
return ApplyEffectCommand(ID, command, params, context);
}
AudacityProject *project = GetActiveProject();
CommandManager * pManager = project->GetCommandManager();
if( pContext ){
if( pManager->HandleTextualCommand( command, *pContext, AlwaysEnabledFlag, AlwaysEnabledFlag ) )
return true;
pContext->Status( wxString::Format(
_("Your batch command of %s was not recognized."), command ));
return false;
}
else
{
const CommandContext context( *GetActiveProject() );
if( pManager->HandleTextualCommand( command, context, AlwaysEnabledFlag, AlwaysEnabledFlag ) )
return true;
}
AudacityMessageBox(
@ -681,7 +704,8 @@ bool BatchCommands::ApplyCommandInBatchMode(const wxString & command, const wxSt
}
// ApplyChain returns true on success, false otherwise.
// Any error reporting to the user has already been done.
// Any error reporting to the user in setting up the chain
// has already been done.
bool BatchCommands::ApplyChain(const wxString & filename)
{
mFileName = filename;

5
src/BatchCommands.h

@ -18,6 +18,7 @@
#include "export/Export.h"
class Effect;
class CommandContext;
class BatchCommands final {
public:
@ -25,10 +26,10 @@ class BatchCommands final {
BatchCommands();
public:
bool ApplyChain(const wxString & filename = wxT(""));
bool ApplyCommand( const wxString & command, const wxString & params );
bool ApplyCommand( const wxString & command, const wxString & params, CommandContext const * pContext=NULL );
bool ApplyCommandInBatchMode(const wxString & command, const wxString &params);
bool ApplySpecialCommand(int iCommand, const wxString & command,const wxString & params);
bool ApplyEffectCommand(const PluginID & ID, const wxString & command, const wxString & params);
bool ApplyEffectCommand(const PluginID & ID, const wxString & command, const wxString & params, const CommandContext & Context);
bool ReportAndSkip( const wxString & command, const wxString & params );
void AbortBatch();

2
src/BatchProcessDialog.cpp