Commit Graph

158 Commits

Author SHA1 Message Date
Paul Licameli
b351eabf47 ComponentInterfaceSymbol contains TranslatableString 2019-12-01 18:08:56 -05:00
Paul Licameli
911f5eabcc Define TranslatableString...
... Perhaps it should be in Internat.h (which is at the lowest level of the
dependency graph), but later ComponentInterface.h will need to include it, and
I don't want includes/ to depend on src/.

Though there is still a linkage dependency on src if
TranslatableString::Translation() is used.
2019-12-01 18:05:20 -05:00
Paul Licameli
15983499c8 New virtual function in ModuleInterface 2019-11-26 11:02:35 -05:00
David C. Manuelda
db0dceac54 Fix ill-formed std::hash<> specialization 2019-08-30 20:51:01 +01:00
James Crook
de468afd8d Bug 1269 - "backslash percent" not saved in effect presets
wxWidgets does special things with %.
It uses % to tell it of environment variables.

Rather than escaping %, it is simpler to disable the environment variables thing.
2019-07-17 18:32:10 +01:00
Paul Licameli
0f62046313 Define EffectClientInterface::GetBlockSize() 2019-06-24 00:49:14 -04:00
Paul Licameli
a1ff74b5bb Move AudacityPathList & utilities from AudacityApp.h to FileNames.h 2019-05-17 16:29:03 -04:00
Paul Licameli
9bf29f5582 CommandManager keys by CommandId, not plain wxString 2019-05-16 12:30:29 -04:00
Paul Licameli
3eeb91f23a Define class Identifier and template TaggedIdentifier...
... Identifier holds strings used for internal purposes and not shown to users;
TaggedIdentifier generates subclasses of Identifier for different purposes,
which won't implicitly (that is, inadvertently) interconvert as function
arguments.
2019-05-16 12:30:28 -04:00
Paul Licameli
961882838f Move definition of std::hash< wxString > 2019-05-16 12:30:26 -04:00
Paul Licameli
74128156bf ModuleInterface::GetFileExtensions() returns const reference...
... avoiding repeated array allocation
2019-05-16 12:30:23 -04:00
Paul Licameli
685a45d1de Remove wx/{convauto,cmdline,clipbrd,calctrl}.h from *.h 2019-03-30 13:10:16 -04:00
Paul Licameli
d28ae40399 Remove wx/dialog.h from headers 2019-03-30 12:01:39 -04:00
Paul Licameli
c982cf6a41 Remove wx/intl.h, wx/brush.h, wx/bitmap.h from headers 2019-03-30 11:45:20 -04:00
Paul Licameli
08c16b6eb7 Remove wx/{html/htmlwin,fileconf,dragimag,debug,dcclient}.h from *.h 2019-03-30 10:53:22 -04:00
Paul Licameli
40b4361732 Remove wx/arrstr.h from headers 2019-03-26 12:41:44 -04:00
Paul Licameli
1d0247607a Remove wx/string.h from headers 2019-03-26 11:33:55 -04:00
Paul Licameli
5fd6965925 Use type aliases CommandID, CommandIDs...
... for identifiers of menu commands and macros, and for vectors thereof
2019-03-15 15:18:11 -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
485b6bb425 Use type aliases FileExtension, FileExtensions...
... for wxString and wxArrayStringEx, holding file extensions (without dot);
to be replaced later with different types

(not yet using std::vector, becase of some uses of wxArrayString::Index with
two arguments)

And simplify some constructions of arrays
2019-03-15 15:18:11 -04:00
Paul Licameli
df6a2cf479 Use type aliases RegistryPath, RegistryPaths...
... for wxString and vector thereof, holding strings that key into wxConfigBase;
to be replaced later with different types
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
135c2a71ce Replace "" and wxEmptyString with {} in default argument values 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
da33daf197 Some replacements of wxArrayString with auto 2019-03-10 14:47:12 -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
Paul Licameli
f2405f3023 rename a function 2019-03-09 12:02:13 -05: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
Steve Daulton
d716b61b1e Increase precision for doubles/string conversion
Required so that the Select: command has reasonable precision
on tracks longer than 17 minutes.
2018-10-23 20:28:43 +01:00
Paul Licameli
ce9f2e2538 Include Menus.h directly, only where needed, not via Project.h 2018-10-16 16:45:26 -04:00
Paul Licameli
e990fd4f18 Remove unnecessary #include 2018-09-10 20:27:13 -04:00
James Crook
c21855bbca Change ";type tool" to not iterate through tracks or selection.
Also adds the options
;type tool
;type tool process
;type tool generator
;type tool analyze

These tools will appear in the Tools menu, but behave as their second argument (if any)
2018-08-01 20:32:30 +01:00
Paul Licameli
f7515c90d8 Now I can revert my partial reversion of b56059a 2018-05-10 00:56:37 -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
Paul Licameli
2c19e8f81e Use IdentInterfaceSymbol to identify effect families 2018-04-11 11:13:40 -04:00
James Crook
213daba23f Avoid multiple include of configunix.h 2018-04-06 11:54:15 +01:00
James Crook
0885fda459 Fix mod-nyq-bench compilation under Windows. 2018-04-05 19:41:10 +01:00
James Crook
4ae394ff5e Fix some warnings (MSVC) 2018-03-31 19:47:16 +01:00
Paul Licameli
0fb02a8024 IdentInterfaceSymbol in NumericTextCtrl; don't persist translated 2018-03-28 14:00:17 -04:00
Paul Licameli
2065eebff6 IdentInterfaceSymbol to distinguish internal vs visible enum settings 2018-03-27 07:51:44 -04:00
Paul Licameli
81dd580c57 Pass array and count separately to read/write/define enum 2018-03-27 07:51:43 -04:00
Paul Licameli
ab509acdf7 Remove overloads that are not needed after 277537c 2018-03-26 16:57:10 -04:00
Paul Licameli
d1ffb8a5b8 Supply missing #include 2018-03-26 15:15:13 -04:00
Paul Licameli
1e4ac7010c addendum 2018-03-26 14:29:40 -04:00
Paul Licameli
170f92c181 A means to specify legacy values of effect choice controls...
... For Truncate Silence only now, perhaps it will find more future use
2018-03-26 14:26:30 -04:00
Paul Licameli
2ea5741e2e Redo format setting choices in Quality preferences 2018-03-25 14:46:53 -04:00
Paul Licameli
47d76e49b7 IdentInterfaceSymbol pairs persistent internal name with i18n msgid 2018-03-25 13:45:29 -04:00
Paul Licameli
7de9b13f68 Revert changes that break Mac build 2018-03-24 15:14:45 -04:00
andheh
b56059a77c fixed some warnings in debug mode (GCC/Linux) 2018-03-24 10:15:47 +00:00
Paul Licameli
dd1ffb0390 Indicative mood for all verbs in command and effect descriptions...
... Some of them have no verb.
2018-03-10 19:07:34 -05:00
James Crook
8cd5d7f4fe Tools menu and EffectTypeTool
- Also add a 'Nyquist Prompt' to the Tools Menu.
- Currently it is the same as the Effects Nyquist Prompt.
- Chains moved into the Tools prompt.
2018-03-03 12:57:32 +00:00
James Crook
0ad533a740 Automation -> Scripting. 2018-02-24 14:20:30 -05:00
James Crook
8ebf502cd6 Cleaner class hierarchy 2018-02-24 14:20:24 -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
Paul Licameli
942175f27b Comments which IdentInterface functions return persistent values 2018-02-21 21:43:03 -05:00
Paul Licameli
097764d94c Distinguish Effect Family Id from Effect Family Name...
... and the distinction makes a difference only for built-in effects.

"Id" is meant to persist in pluginregistry.cfg, and is constrained by how
previous versions of Audacity were written.

"Name" is not persistent, so we have the liberty to change it, as done here
for the built-ins.
2018-02-21 21:43:01 -05:00
Paul Licameli
8a074770e8 IdentInterface::GetDescription() returns a translated string...
... See commit 3b90538b84 which removed the
only use of the untranslated strings.

Also follows better i18n guidelines for composing the VSTEffect description.
2018-01-07 21:16:26 -05:00
Paul Licameli
3c9cdac778 Drag-and-drop checks file extensions first for plug-in candidates...
... Avoids big delays in drag-and-drop importation caused by
765ca0c813
2018-01-01 10:29:26 -05:00
Paul Licameli
2e8a73bab1 Fix Windows build 2017-12-31 20:04:35 -05:00
Paul Licameli
8cfb8d2400 Change ModuleInterface for support of drag-and-drop of plug-in files 2017-12-31 18:09:36 -05:00
Paul Licameli
0f8bd45a7c ModuleInterface::RegisterPlugin can report an error message 2017-12-27 15:19:36 -05:00
James Crook
a49f14ad02 doxygen. Class list completed for letter 'A'. 2017-11-09 18:32:29 +00:00
Paul Licameli
31231a54d2 use override 2017-11-05 21:01:52 -05:00
Paul Licameli
5f298accbd Translated effect name and description in many places in Effect.cpp...
... including titles of dialogs,
messages,
About sub-menu of the Manage button,
long-form names of Undo items (in history view),
message for why command is not allowed when there is no selection

Also one place in Effect Rack code but it's commented out
2017-09-10 19:21:35 -04:00
Paul Licameli
1895994bd8 Effect parameter names containing '=' now work in chain editing...
... There was at least one example of this in the LADSPA swh-plugins.

See Tape Delay Simulation.
2017-08-01 12:24:29 -04:00
Paul Licameli
1a86819b4b Fixes for clang build with 64 bit unsigned long 2017-03-30 10:46:44 -04:00
Paul Licameli
79c3bef2ce Exception safety in: general effect performing functions 2017-03-21 14:11:24 -04: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
a368eda73a Hide implicit conversions sampleCount <-> floating point, -> integer 2016-09-15 21:06:42 -04:00
Paul Licameli
ad04187a41 Change sampleCount arguments, variables, return values to size_t...
... whenever they really describe the size of a buffer that fits in memory, or
of a block file (which is never now more than a megabyte and so could be fit in
memory all at once), or a part thereof.
2016-09-15 21:03:17 -04:00
Paul Licameli
078ff056e2 Make many conversions sampleCount->size_t are explicit and checked...
... with run-time assertions.

I examined each place and reasoned that the narrowing was safe, and commented
why so.

Again, there are places where the sampleCount variable will later be changed
to have a different type, and they are not changed here.
2016-09-15 21:02:32 -04:00
Paul Licameli
78be459fa1 Convert sampleCount <-> floating or -> long long explicitly ...
... A non-narrowing conversion out to long long is a necessity, but the
conversions to float and double are simply conveniences.

Conversion from floating is explicit, to avoid unintended consequences with
arithmetic operators, when later sampleCount ceases to be an alias for an
integral type.

Some conversions are not made explicit, where I expect to change the type of
the variable later to have mere size_t width.
2016-09-15 21:02:31 -04:00
Paul Licameli
26b5e77050 Define sampleCount as a class, not a type alias...
... Define lots of operators for disambiguation, but they will go away after
all conversions from sampleCount to built-in numerical types are forced
to be explicit.
2016-09-15 21:02:31 -04:00
Paul Licameli
67cec5ad83 Make many counts of tracks and channels unsigned...
... And in some places where a library uses signed types, assert that
the reported number is not negative.

What led me to this, is that there are many places where a size_t value for
an allocation is the product of a number of channels and some other number.
2016-09-07 10:11:41 -04:00
James Crook
781de82d02 Workaround build breakers. Needs review.
These changes fix a broken build in Windows.
#include <algorithm> needed for min/max to be in std.
decltype(+name) was declaring a const variable, that could not be incremented.  Changed to auto.
2016-08-23 21:46:12 +01:00
Paul Licameli
1281f1b14b Common function limits buffer size to sampleCount known to be small 2016-08-23 12:46:10 -04:00
Paul Licameli
56586770e0 EffectClientInterface::SetSampleRate takes double...
... All the overrides (except Ladspa) were casting it to floating poing anyway
2016-08-21 09:51:32 -04:00
Paul Licameli
49e699b1df Remove overloads for sampleCount from ConfigInterface...
... The value was always cast to int anyway when writing, and it was used
only for one value in VST effect, which did not need 64 bits
2016-08-21 09:11:44 -04:00
Paul Licameli
df5fcc3581 Make static "Destroy" methods for certain singletons unnecessary. 2016-04-06 16:24:46 -04: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
Leland Lucius
1b369be614 Fix (hopefully final) for bug #1010. 2015-06-12 23:10:23 -05:00
Leland Lucius
9b7cd6be52 Missed a file in the last commit. 2015-06-07 12:37:15 -05:00
Leland Lucius
7d359ef010 Fix bug #923 and allow for varying decimal sepatators in settings 2015-06-02 15:06:52 -05:00
Leland Lucius
0d62be7776 Use a common method for the duration format in generators 2015-05-27 08:42:15 -05:00
Paul-Licameli
bdc2839112 Preliminaries for bug 900
Create WaveTrackCache as a utility class but don't use it anywhere yet.

The possible minor performance problem with effects is fixed by changes
in WaveTrack::GetBestBlockSize().
2015-05-26 20:02:37 -04:00
Leland Lucius
f9061e3916 Let's try Effect management once more
As usual, I started out intending to do as little as possible
to this to get it working and wound up going overboard.

However, I believe it does allow easy management of the effects
and this will provide a basis for the full blown plugin manager
dialog.
2015-05-22 10:15:47 -05:00
James Crook
c85bf1c531 StereoToMono now EffectTypeHidden
This way it does not appear in the list of effects available to choose.
2015-05-14 22:15:44 +01:00
James Crook
8ae6fc42e1 Added 'More...' to Generate and Analyze menus 2015-05-14 16:11:46 +01:00
Leland Lucius
186cdb1248 Make sure "default" builtin effects are always registered
This appears to be a little overboard, but it makes the
registration of defaults a little more generic.
2015-05-12 10:41:22 -05:00
Leland Lucius
8429a97917 Increase precision of floats/doubles 2015-04-26 21:57:43 -05:00
Leland Lucius
4f4acffad1 Allow chains to use current/factory presets/settings
Also gives builtin effects a mean to determine if batch processing
is active, IsBatchProcessing() returns true if so.
2015-04-26 16:41:05 -05:00
Leland Lucius
0f3358248b Nyquist prompt updates
Based on Robert's and Steve's suggestions, I removed the "Clear"
button, replaced FileDialog usage with wxFileDialog to restore
extension suffixing, and escaped newlines in save settings so
that chains work properly.

I also attempted to locate the issue where code isn't being
parsed and made a couple of changes, but I doubt I got it.
2015-04-19 22:24:04 -05:00
Leland Lucius
5e27710495 All generator effects now use common Duration handling
(Also updated a few windows IDs to fit the pattern)
2015-04-19 19:48:04 -05:00
Leland Lucius
8fbfa460c4 Migrating the remaining effects
This brings the builtin, LV2, and VAMP effects inline with the
Audio Units, LADSPA, and VST effects.  All effects now share
a common UI.

This gives all effects (though not implemented for all):

User and factory preset capability
Preset import/export capability
Shared or private configuration options

Builtin effects can now be migrated to RTP, depending on algorithm.
LV2 effects now support graphical interfaces if the plugin supplies one.
Nyquist prompt enhanced to provide some features of the Nyquist Workbench.

It may not look like it, but this was a LOT of work, so trust me, there
WILL be problems and everything effect related should be suspect.  Keep
a sharp eye (or two) open.
2015-04-16 23:36:28 -05: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@gmail.com
aa49817563 Fixes 2 VST issues, an RTP issue, and relaxes an AU restriction
1)  Shell VSTs were completely unrecognized...that is no longer the case
2)  All VSTs will now ALWAYS be initialized and cleaned up from the main
    GUI thread.  I found that some Waves VSTs would freeze Audacity when
    initialized in the audio thread and closed in the GUI thread.
3)  While realtime previewing, it was possible that the wrong slave 
    could be used to process new blocks of audio.
4)  I found that the Waves AUs don't crash on a real Mac (instead of a
    virtual machine), so I removed the "black list" I'd put in just for
    them.  (Something to do with needing full 3D support I think.)

Anyway, #2 and #3 were quite intrusive, so as much RTP testing as possible
would be a good thing.
2015-01-02 05:24:43 +00:00
lllucius
7b6cbeec22 Distinct button bars for graphical and textual modes
This bit the textual mode plain old text based buttons
and retains the bitmap buttons for graphical mode.

It also allowed me to remove the manual accelerator table 
building (no access keys in GUI mode) which was a good 
thing as I really didn't know if the was gonna work for
non-English keyboards anyway.
2014-12-16 21:41:58 +00:00
lllucius
16ca4f17eb Re-adding localized menu labels for effects
If you can believe it, this whole big mess is
just to get localized effect labels back into
the menus.

I sure wish I'd had a little bit more time to
finish up all of the effects.  It sure would 
be a lot cleaner (code wise).
2014-12-15 21:54:23 +00:00
lllucius@gmail.com
cddff18025 Resolves reported bugs and (most) recommendations
All:

Export/Import now disabled if the Effect (family) doesn't support it
Options disabled if the Effect (family) doesn't support it
Standarized on "Latency compensation" instead of "Buffer delay compensation"
Correct loading/saving of factory default settings
Fixed "Mannage" to be "Manage"
Removed conditional code since we're keeping the transport buttons
Play bases state on actual playback status
Play no longer monkeys with selection
Play will now start from where it left off IF:
   The user stops the playback via the Effect Stop button
   If the user wants to restart from the beginning of the selection
   then the user can click Rewind while stopped.
Rewind will not go past start of selection (sorry Steve ;-))
   If Rewind is clicked while not playing, playback will next
   start at beginning of selection.
Fast Forward will stop at end of selection
   However, if FFwd is clicked while not playing, it will
   put playback at the end of selection and the next time
   the user clicks the Effect play button, playback will
   continue from the end of selection to the end of track.
Deleting a preset now prompts user to confirm
Button faces should now look a little better
Bypass (should we rename that???) button now grays when disabled

Audio Units:

Corrected all user visible "AudioUnit" strings to be "Audio Unit"
Removed unneeded "Buffer Size" in settings dialog
Only uses latency if user said it was okay

Ladspa:

Added settings dialog to allow control of latency usage
Removed unused "user selectable" buffer size
Only use latency if user wants it
Refresh controls when presets are loaded

VST:

Removed unused "Rescan at startup" setting
Propogate parameter loads to slave effects
2014-12-04 06:10:27 +00:00