Commit Graph

52 Commits

Author SHA1 Message Date
Paul Licameli d5a22dfb15 Eliminate last use of PluginManager by ModuleManager, breaking cycle 2021-06-30 21:15:20 -04:00
Paul Licameli 02b61532fe ModuleManager doesn't use PluginManager to initialize providers 2021-06-30 21:15:20 -04:00
Paul Licameli 2e7f7114d2 ModuleManager defines the ID strings for modules, not PluginManager 2021-06-30 21:15:19 -04:00
Paul Licameli 8fda526577 Simplify memory management in PluginManager 2021-06-30 21:15:19 -04:00
Paul Licameli 434f3919f9 MemoryX.h does not include wx/utils.h 2021-06-02 07:08:19 -04:00
Paul Licameli e6e96de0fd Replace most inclusions of MemoryX.h with <memory> ...
... Most often it was needed for a custom definition of std::make_unique, but
we build C++14 now.
2021-06-02 07:08:19 -04:00
Paul Licameli f7d9602a42 TranslatableString.h does not include Identifier.h 2021-05-27 09:51:32 -04:00
Paul Licameli dcdddcb7f2 ModuleManager::mLibs never becomes non-empty. Remove it. 2021-05-16 07:03:12 -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 6242be0a8e ModuleInterface.h needn't distinguish built-in from external usage...
... All is set up so that plug-in providers can be modules that register
their instance-creating function pointers directly with RegisterProvider; no
special symbol name needs to be exported.

That is, they now just need to export ModuleDispatch and GetVersionString, just
like other modules for other purposes.

Duplication of logic from ModuleManager::InitializeBuiltins() is removed.

No examples yet in the previous commits, but it does work in my misc-modules
branch.
2021-05-16 07:03:12 -04:00
Paul Licameli 861470dd77 Complementary un-registration of providers; change function name 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 e85ddf4a6d Remove track panel hijack hooks from ModuleManager...
... It ended up not used, and long ago superseded by other TrackPanel
reorganization.

Such things as that (and many more) will be implemented with different
idioms (registries in various higher level code) without requiring changes in
this low level protocol for loading modules.
2021-05-16 07:03:12 -04:00
Paul Licameli c7834257d8 Crude way to let modules depend on others: multiple load passes...
... Repeatedly pass through the list of modules that need to be opened, so
long as the list is not empty and at least one module loaded in the last pass.

This discovers dependencies of modules on other modules, avoiding the need to
describe the dependencies and make one pass in some topologically sorted order.

Which would be smarter, but would require much other work.
2021-05-16 07:03:12 -04:00
Paul Licameli 059f96173b Some factoring of ModuleManager::Initialize 2021-05-16 07:03:12 -04:00
Paul Licameli 332ed4ab61 Separate detection of module load failure from error messaging 2021-05-16 07:03:12 -04:00
Paul Licameli fd94b66483 Don't duplicate defs of DLL_IMPORT, DLL_API, ModuleDispatchTypes 2021-05-16 07:03:11 -04:00
Paul Licameli e52115630a Remove argument of ModuleManager::Initialize() unused since a6d0b3f 2021-05-16 07:03:11 -04:00
Paul Licameli 406b23cae7 More uses of AUDACITY_DLL_API...
... in many places where the function call will later need to be between
modules (or libraries, or the executable) and the annotation will be a necessity
to keep the linkage working on Windows.

That's all that this sweeping commit does.
2021-05-10 10:46:55 -04:00
Paul Licameli fbfccf1393 Delete or un-inline some constructors, assignments, others...
... Which will be needed for various reasons for Windows builds of certain
modularizations, which will otherwise complain that they can no longer
generate them as inlines.

In one case, deleted copies require explicitly defaulted moves, but they will
work as generated inline.
2021-05-10 10:46:55 -04: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 eb038972b0 Remove unused function and data member 2020-05-28 11:23:09 -04:00
Leland Lucius ff20948d57 Bug 2229 - Audacity may fail to load a "bad" module silently, with no error message 2020-03-29 15:33:23 -05:00
Paul Licameli 571f42df79 Add some comments 2020-02-20 08:51:39 -05:00
Paul Licameli 56cd24a062 Rewrite insertion of menu items by null and Nyquist modules...
... using the new registration system, and without the fragile hacks making
assumptions about the positions of menus within the menu bar.
2020-01-30 15:09:30 -05:00
Paul Licameli 1537930195 DiscoverPluginsAtPath reports error as TranslatableString 2019-12-20 22:06:18 -05:00
Paul Licameli 5be54c5612 ModuleManager::CreateProviderInstance returns more specific type 2019-05-16 12:30:26 -04:00
Paul Licameli de60edc62f Remove wx/{app,statbmp,spinctrl,scrolbar,dynlib,dcmemory}.h from *.h 2019-03-30 07:57:37 -04:00
Paul Licameli 40b4361732 Remove wx/arrstr.h from headers 2019-03-26 12:41:44 -04:00
Paul Licameli 71036bed01 Remove PluginManager.h from other headers 2019-03-17 15:05:19 -04:00
Paul Licameli a30000cf74 Use type aliases FilePath, FilePaths...
... for wxString and wxArrayStringEx, holding file paths (absolute or relative,
directory or plain file); to be replaced later with different types

(not yet using std::vector, becase of some uses of wxArrayString::Index with
two arguments)
2019-03-15 15:18:11 -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 cc92c7605e Rename typedef PluginIDList to PluginIDs 2019-03-14 17:15:41 -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
Paul Licameli a9e7a7e5d5 movable_ptr(_with_deleter) -> std::unique_ptr 2018-05-10 00:56:37 -04: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
Paul Licameli 0f8bd45a7c ModuleInterface::RegisterPlugin can report an error message 2017-12-27 15:19:36 -05:00
Steve Daulton 1dd6b848c2 Enable Help button for Nyquist effects 2017-05-20 14:49:07 +01:00
James Crook e4260e9581 Bug 1587 - Mac: Ghost duplicate Nyquist effects after upgrade
Fix removes ghost Nyquist effects from the effects menu and generators from generate menu.
2017-02-05 20:27:56 +00:00
Paul Licameli 942c62b6f6 Remove some naked new amd delete in: various 2016-08-08 07:51:24 -04:00
Paul Licameli df5fcc3581 Make static "Destroy" methods for certain singletons unnecessary. 2016-04-06 16:24:46 -04:00
Paul Licameli 29349fedbb Loaded modules managed by smart pointers 2016-04-06 16:06:31 -04:00
Paul Licameli e0476b5e71 Module interfaces managed by smart pointers 2016-04-06 16:06:30 -04:00
Paul Licameli 990080ae7d Replace virtual with override wherever possible; eliminate needless virtual...
... for functions in final classes.

override is like const -- it's not necessary, but it helps the compiler to
catch mistakes.

There may be some overriding functions not explicitly declared virtual and I did
not identify such cases, in which I might also add override.
2016-02-26 12:35:38 -05:00
Paul Licameli 7824e94030 Harmlessly qualify classes as final (or explicitly comment not)...
... Should have no effect on generated code, except perhaps some slight faster
virtual function calls.  Mostly useful as documentation of design intent.

Tried to mark every one of our classes that inherits from another, or is a
base for others, or has abstract virtual functions, and a few others besides.
2016-02-24 20:58:30 -05:00
Paul Licameli 9bf098c7d9 Sweep unnecessary wxString copies: rest 2016-02-23 02:15:56 -05:00
lllucius@gmail.com e73b7e70a3 Fix for bug #857
Even though this is only a P2, I felt it would be
quite bothersome for the users and might cause some
confusion.

The problem was the the wxLocale was being deleted
before all usage of it was complete.  The fix was
to explicitly delete the plugin and module managers.
2015-02-12 02:30:30 +00:00
lllucius 10f62cdae5 Fix for bug #833
This allows duplicate items in the effects menus and provides a
means to uniquely identify each item.
2015-01-19 16:28:48 +00:00
lllucius 41083f74cc Another round of effects bashing.
I've added some of the new plugin stuff to LV2, Nyquist, and
Vamp so that they play better in the new system.  They no
longer get bunched in with the Audacity effects when sorting
or grouping the menus.  They have not been fully converted
but they should be good for 2.1.0.

Nyquist plugins now include ";author" and ";copyright"
statements.

Added the 4 new Nyquist plugins to the Windows build.

Audiounits are still coming...had to push them to the back
burner to get this other stuff out of the way.

Scanning for new plugins has been improved so that newly
discovered ones will be shown to the user when Audacity starts.

Effects menu sorting has been fixed and improved.

Disabling effect types in Preferences works again and you
no longer have to restart Audacity for them the change to work.

Effect usage in chains works again.

Plugin registration dialog code simplified a bit.

Group names in the pluginregistry are now base64 encoded.  I
never really thought about it, but wxFileConfig group names
are case insensitive and since I was using the group name as
the plugin ID, I ran into a conflict on Linux where there
were two plugins with the same name, just different case.  (And
they were different plugins.)  Hoping all of this will change
when/if the config file gets converted to XML.  (wx3 if finally
including XML support)

A fair amount of cleanup of this new code has been done and
will continue as more stuff is converted.
2014-11-19 06:58:44 +00:00
lllucius ad92e8c4bf One more round of effects changes.
The big thing is the common efffects UI.  Right now Ladspa and VST
have been converted to use it and Audiounits will be next.  It makes
everything nice and consistent while reducing the clutter in the
dialog.

Other goodies are:

Ladspa effects now show output controls when supplied by the effect
Ladspa effects now work fine as Analyze type effects
Ladspa now has user presets
VST effects dialog is now less cluttered...leaving more room for the effect
Ladspa and VST effects now share a common UI
Ladspa and VST effects are now usable in chains
Ladspa and VST effects now handle user presets the same way
Currently active effects settings automatically saved and reloaded
Can now do numeric range checking on input fields.

And, as always, plenty of critter squashing.
2014-11-14 03:03:17 +00:00