Commit Graph

41 Commits

Author SHA1 Message Date
Paul Licameli 8fda526577 Simplify memory management in PluginManager 2021-06-30 21:15:19 -04:00
Paul Licameli bd6fb75886 moduleMain functions were never called but with nullptr; so simplify 2021-05-16 07:03:12 -04:00
Paul Licameli 64bbc31c54 Remove macro making extern declaration of RegisterBuiltinModule...
... Forcing other places that use RegisterBuiltinModule to be more explicit
about their link dependencies on ModuleManager, with a new #include directive.

Does this make scripts/graph.pl show a new dependency cycle?  Happily no.  But
now we know.
2021-05-16 07:03:12 -04:00
Paul Licameli d7f643768c Bugs 2778, 2339, Issue 887: Translation of some effect names...
... Those for which the internal name and the user-visible English names differ,
or that needed disambiguating context for i18n,  were always shown as English
in the menus.

Silence and Filter Curve were the only two examples. There are others.
2021-05-14 14:27:23 -04:00
Paul Licameli c5ebc396eb Audacity.h has shrunk to nothing, now remove it! 2021-05-10 00:05:23 -05:00
Paul Licameli 9360359e9d
Module manager (#549)
* Eliminate ModuleManagerInterface...

... It was there only to provide RegisterModule(), but that was not used
anywhere.  So simplify.

* Remove nested #include of ModuleInterface.h
2020-05-29 10:48:52 -05:00
Paul Licameli b5c59b29a7 LoadCommands.cpp doesn't depend on individual command classes...
... Remove many #includes and macros.  Use instead a hash generated from the
registry.
2020-01-19 19:21:12 -05:00
Paul Licameli 2522459637 Each command class registers itself 2020-01-19 19:21:12 -05:00
Paul Licameli 0ca5775234 Eliminate one of the ## macro hacks in LoadCommands 2020-01-19 19:21:12 -05:00
Paul Licameli 1537930195 DiscoverPluginsAtPath reports error as TranslatableString 2019-12-20 22:06:18 -05:00
Paul Licameli 618fee21ec TranslatableString for ComponentInterface::GetDescription() 2019-12-16 14:21:57 -05:00
Paul Licameli 15983499c8 New virtual function in ModuleInterface 2019-11-26 11:02:35 -05:00
Paul Licameli b9399e5550 Remove some #include directives 2019-07-19 13:55:49 -04:00
Paul Licameli 6c57948d8f Remove unnecessary #include-s from .cpp files...
... Unnecessary because transitively included.

But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
2019-05-16 17:21:00 -04:00
Paul Licameli 74128156bf ModuleInterface::GetFileExtensions() returns const reference...
... avoiding repeated array allocation
2019-05-16 12:30:23 -04:00
Paul Licameli 957e5eee63 Remove unnecessary #include from LoadCommands.h and LoadEffects.h 2019-03-22 13:35:13 -04:00
Paul Licameli 5e7d41ec07 Each .cpp/.mm file includes corresponding header before any other...
... except Audacity.h

This forces us to make each header contain all forward declarations or nested
headers that it requires, rather than depend on context.
2019-03-17 22:54:52 -04:00
Paul Licameli 906e55f047 Experimental.h in all .h or .cpp files that directly use EXPERIMENTALs...
... except Audacity.h; and in no others.

Do so even if Experimental.h gets multiply included, as in both the .h and
.cpp files.

This makes it easier to do a text scan to be sure there are no unintended quiet
changes of meaning because of omission of Experimental.h when the flag is
an enabled one.

Also move inclusions of Experimental.h earlier.

Also don't require Experimental.h to be preceded by Audacity.h to define
EXPERIMENTAL_MIDI_OUT correctly.
2019-03-17 22:54:00 -04:00
Paul Licameli 173a300427 Include nothing before Audacity.h, as comments say we should...
... and remove some duplicated inclusions
2019-03-17 21:41:39 -04:00
Paul Licameli dcd211affa Use type aliases PluginPath, PluginPaths...
... for wxString and vector thereof, when holding plugin paths (which may or
may not be interpreted as file paths, depending on the module); to be replaced
later with different types
2019-03-15 15:18:11 -04:00
Paul Licameli dfeb7e18aa Type aliases for some uses of ComponentInterfaceSymbol...
... to be replaced later with distinct types

Also changing FamilyId => Family in function names

Also NumericFormatId => NumericFormatSymbol
2019-03-14 17:26:20 -04:00
Paul Licameli dd8eb9e3d9 Less use of wxArrayString::Index() ...
... instead use the utility make_iterator_range and its index() or contains()
method.  This generic utility works with any container defining begin() and
end().

This further lessens dependency on wxWidgets container idioms.
2019-03-10 14:45:06 -04:00
Paul Licameli 2db49dc1f0 Use standard library style members of wxArrayString (and wxString) ...
... which will make it easier to change the types of those containers to
std::vectors of other string-like classes

for wxString,

IsEmpty => empty
Clear => clear
Alloc => reserve

for wxArrayString,

Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
2019-03-10 14:43:57 -04:00
James Crook 466e9c179e Create ComponentInterface
It combines the old IdentInterface with the ParamsInterface, providing an identifier and parameters (if needed).
The main purpose of the change is to make the class hierarchy (as viewed via doxygen) much easier to follow.
2018-11-02 17:04:43 +00:00
James Crook 0ea56874a6 Comment out a debug message. 2018-07-22 20:30:53 +01:00
Paul Licameli 0c99501bfb Initialize tables of effect and command names properly 2018-04-12 17:09:43 -04:00
Paul Licameli b200819f75 Use IdentInterfaceSymbol to identify commands and effects 2018-04-11 11:51:10 -04:00
Paul Licameli 0394660e9e Use IdentInterfaceSymbol for vendor strings, which are used in paths 2018-04-11 11:13:41 -04:00
James Crook 825160b755 Add six (smaller) dialogs to commands.
- These are the big dialogs, Select and SetTrack split into three smaller dialogs.
2018-03-18 19:08:31 +00:00
James Crook a5d06ff257 Fix comments needed for Doxygen. 2018-03-06 21:42:58 +00:00
andheh e6ba33c247 fixed "/*" in comment warnings 2018-03-06 21:30:33 +00:00
andheh d72028de26 fixed more "statement has no effect" warnings 2018-03-06 21:29:58 +00:00
James Crook e3ef968d57 Add DragCommand. Default Y/N on optional fields. Open/Save project items.
- More Y/N in Optional, making it easier to omit parameters.
- AT removed from Envelope, since T already gives it.
2018-02-24 14:20:29 -05:00
James Crook f7fe295651 Make Message command into an AudacityCommand. 2018-02-24 14:20:27 -05:00
James Crook edf90d6e2c Add envelope commands
- Added SetEnvelope (which can also delete/clear an envelope.)
- Added GetInfo: Type=Envelope
2018-02-24 14:20:27 -05:00
James Crook 5d36890cb0 Shorter command names. General tidying.
-More commands now have shorter names for parameters.
-New scripts for generating images.
-Several old-style commands retired.
2018-02-24 14:20:26 -05:00
James Crook 1d9477a455 SetClip, SetLabel, SetProject added
- SetTrack also updated with more options.
2018-02-24 14:20:24 -05:00
James Crook 8ebf502cd6 Cleaner class hierarchy 2018-02-24 14:20:24 -05:00
James Crook ca5dac59ff Support: JSON, Lispy or Other formats 2018-02-24 14:20:23 -05:00
James Crook b83b862b3f OldStyleCommandType - It's on the way out.
This renaming makes it clearer which code is still using Dan Horgan's Command system.
2018-02-24 14:20:23 -05:00
James Crook 1c988b4e3a 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
2018-02-24 14:20:22 -05:00