Commit Graph

271 Commits

Author SHA1 Message Date
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 b8c0125143 Replace comparisons against wxEmptyString with empty() 2019-03-14 16:20:18 -04:00
Paul Licameli da33daf197 Some replacements of wxArrayString with auto 2019-03-10 14:47:12 -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 c68e336247 More use of std:: style members of wxString...
... replacing:

Length => length
Len => length
2019-03-10 14:44:54 -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
Steve Daulton 226851ab91 Fix empty string a no-op for all Nyquist plug-ins
Previously an empty string would preven ;type process plug-ins
from continuing to other tracks.
2019-01-14 16:25:53 +00:00
Steve Daulton 5a7b6a7323 Fix multiple selection Nyquist file widget
Wx "Style" flags are 4 bytes, not 1 byte.
Also update a couple of comments in passing.
2018-12-27 19:44:15 +00:00
Steve Daulton 800ddae34b Fix bug 2041
Nyquist: Generating audio at a point within a track, deletes audio
after the generated audio.

This fix corrects errors in b9ec434.
2018-11-29 11:43:00 +00:00
Steve Daulton e65e1d39d8 Fix for bug 2013
Bug 2013 - Extended ASCII characters in Nyquist plug-ins freeze Audacity

We previously assumed that plug-ins would always be valid UTF8, but
if it isn't then the conversion to wxTextInputStream fails, causing
pgm.ReadLine() to perpetually return a zero length line.
2018-11-18 21:37:15 +00: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 46a3f91d59 Add some useful path definitions for Nyquist 2018-10-29 20:01:21 +00:00
Paul Licameli 0fbea5f9ea Fix failure of Nyquist to translate some multiline strings...
... Don't trim leading whitespace from source file lines before passing them
to eval.

So when a string in Lisp code is (_ "like
   this")

(the Lisp reader allows embedded newlines in quoted strings),

then the string extracted to the .pot file by xgettext contains the spaces, and
the string literal seen by our Lisp interpreter will also retain the spaces and
match the msgid in the catalog exactly.
2018-10-29 13:49:14 -04:00
Paul Licameli 38f97349f5 Don't form translated strings with concatenation 2018-10-25 04:13:44 -04:00
Paul Licameli df3c2a7b2f Don't mutate uninitialized Maybe 2018-10-23 06:02:19 -04:00
Paul Licameli 48a1538b37 Comment, to deter repeat of the mistake corrected in the last commit! 2018-10-22 20:02:33 -04:00
Paul Licameli 2b8c4aa816 Fix the binding of ngettext in XLisp 2018-10-22 19:58:13 -04:00
James Crook 657159d542 Fix C4189 and C4100 Warnings
C4189 is 'Local variable initialised but not used'
C4100 is 'Unreferenced parameter'

Fixed some other warnings, e.g. about empty if, too.
2018-10-10 19:46:24 +01:00
James Crook 5fd95dd131 Fix C4456 Warnings.
"C4456 declaration hides previous local declaration."
These arise from repeated declarations of the same name.
2018-10-10 17:28:50 +01:00
Paul Licameli df1103822e Don't crash in Nyquist tools with mOutputTracks undefined 2018-10-04 10:56:03 -04:00
Paul Licameli 4aa990e835 Remove GetLink(ed) in various other places 2018-10-01 13:42:33 -04:00
Paul Licameli aee4005044 Rewrite many iterations over tracks and channels in src/effects 2018-10-01 11:24:04 -04:00
Paul Licameli b6a6b8e73e Rewrite iterations over sync-lock groups 2018-10-01 11:09:20 -04:00
Paul Licameli bb3aa00f50 Effect::CopyInputTracks was only called with two values...
So now it simply takes a bool.
2018-10-01 11:06:31 -04:00
Paul Licameli 51842fc78b Use TypeSwitch and track_cast 2018-10-01 10:58:47 -04:00
James Crook fd21a0f6fd Bug 1943 - Nyquist prompt loses data when Audacity is closed 2018-09-17 21:56:28 +01:00
James Crook 8ed0edd599 Fix two problems with Nyquist translation.
1. The 'Select a File' button (which comes from wxFileSelectorPrompt) was not being translated.
2. rhythmtrack.ny was missing an (_ ) on one string.
2018-08-31 22:51:20 +01:00
James Crook 792fddbd22 Bug 1962 - Nyquist effect dialog labels not translated 2018-08-31 10:51:10 +01:00
James Crook 0ea4ff1395 Add internationalization hints. 2018-08-28 16:35:06 +01:00
James Crook e31fe6b242 Make AUD-DO return T or NIL as result status.
Previously it was returning 1 or NIL
2018-08-27 10:25:53 +01:00
Steve Daulton 70467e1523 Enable (most) Nyquist property lists for tool scripts
The global *TRACK* variable and its properties remain unavailable for
;type tool scripts.
2018-08-26 16:47:00 +01:00
Steve Daulton f296f42392 Fix misleading error message
We are testing specifically for a selection in an 'audio' track.
2018-08-25 12:41:29 +01:00
Paul Licameli c86a46dc99 fix Mac build 2018-08-24 17:59:18 -04:00
James Crook 66df5786de Make AUD-DO return a cons.
This is simple parsing of the response from AUD-DO.  The first part is the string message, the second 1 or NIL depending on if scripting reported OK or not.  Note that illegal scripting options often don't produce a 'Failed' but are silently substituted with valid ones.
2018-08-24 18:45:09 +01:00
James Crook 9b84deb43b Bug 1946 - Nyquist ;type tool effects crash if returning labels from Nyquist 2018-08-24 16:53:34 +01:00
Steve Daulton 4ec1393c27 Error if Nyquist Prompt requires track election 2018-08-21 16:28:59 +01:00
Steve Daulton b9ec43433e Bug 1934 residual
Allow generate type plug-ins spawned from Nyquist Prompt to create
a new track if none selected.

This commit also fixes preview in generators when there is no selection.
2018-08-21 14:02:48 +01:00
Steve Daulton 5be7f7db0b White space changes
The Objective C++ syntax '[[' used in a couple of places (Mac only),
breaks the parser in kdevelop. As suggested by Paul, a space between the
brackets fixes the problem.
Also removed some trailing spaces.
2018-08-15 11:29:12 +01:00
Steve Daulton 8eef6dc3ef Fix bug 1938
Nyquist / Adagio variable 'S' should have the value 0.25 in all but
legacy process and analyze effects.
2018-08-13 16:45:21 +01:00
Steve Daulton 0d9cd4b024 Fix bug 1937
';type tool' effects cannot return audio from Nyquist.
2018-08-13 14:28:33 +01:00
James Crook 3480f5aa3a Bug 1934 - Generate audio from Nyquist prompt crash
We now default to Effect (EffectTypeProcess), if no type was specified.
2018-08-13 12:29:31 +01:00
James Crook 1192914460 Fix duplication of Nyquist Prompt.
Now just one Nyquist Prompt, and it's in the tools menu.
2018-08-03 16:11:44 +01:00
James Crook ecd09a19de Preserve selection on exit from Nyquist prompt.
This is required, because AUD-DO could change the selection.
2018-08-02 16:51:23 +01:00
Paul Licameli 06eee27b9a Rewrite commit 1bc0f0f without further changes to lib-src...
... Reuse the external function registration added earlier in 2.3.0
development, for support of internationalization in Nyquist.

This way, we avoid making cyclic static linkage dependencies between the
library and the application.
2018-08-01 23:11:30 -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
James Crook b975956812 Add re-entrancy checks to Nyquist
These changes below are paving the way for aud-do:

Nyquist Effect now detects self reentrancy and skips reentry if so.
Nyquist Effect now detects if another effect has run during effect processing, and does not send Nyquist
output if so.

Neither of these preparatory changes have an effect in absence of AUD-DO (or other function
that allows Nyquist effect to call out to Audacity functions).
2018-08-01 20:31:03 +01:00
James Crook 848b66f4fa Make title of Nyquist Prompt dialog change appropriately.
Previously it was being overwritten each Init() by the string suitable for the Nyquist Effects Prompt.
2018-07-14 17:38:57 +01:00
James Crook 2739020342 Bug 1902 - "Nyquist Prompt" confusingly shown only as "Nyquist" when "Grouped by Type" is active
Now shown as "Nyquist Effects Prompt" (in Effects menu) and "Nyquist Tools Prompt" (in Tools Menu).
These prompts will have slightly different behaviour, e.g. only tools allow aud-do.
2018-07-14 16:51:49 +01:00
Steve Daulton a06e561cb7 Support version strings in Nyquist plug-ins
For shipped plug-ins, the version number is the same as the Audacity
release version when the plug-in was last modified.
2018-07-02 22:41:59 +01:00
Steve Daulton 5cdf642133 Fix Travis build 2018-06-18 22:14:38 +01:00