Commit Graph

1150 Commits

Author SHA1 Message Date
Paul Licameli
2fbe04eda0 Replace more Connect with Bind; needed redeclaration of custom events 2018-02-21 19:30:40 -05:00
Paul Licameli
e6e8e3251c Rewrite more Connect() with Bind(), which were type incorrect...
... though harmlessly so.  They called to nonstatic member functions of classes
with improper this pointers; though the functions did not use this.

Bind events to nonmember funtions instead.  Sometimes just to empty lambdas to
consume the event and ignore it, blocking other handlers.
2018-02-21 19:28:12 -05:00
Paul Licameli
2f3604bdea Rewrite many calls to Connect() with Bind()...
... it's the more modern way, and does better type checking, without the
dubious casts of pointers-to-member-functions.
2018-02-21 19:28:11 -05:00
Paul Licameli
bf5228267a Calls to Disconnect or Unbind in destructors are not needed, if...
... it's either the source of the connection that is being destroyed, or other
object (such as an ancestor window) transitively owning it and so causing it to
be destroyed too;

or, the sink is being destroyed, and that sink is a wxEvtHandler (which is
always so for Disconnect, though not for Unbind in case Bind was passed a
member function of a non-wxEvtHandler).

wxWidgets takes care of erasing the connection in such cases.

This removes most calls to Disconnect and Unbind.  Many destructors shrank to
nothing.

Notably, in case of popup menu handling, the call to Disconnect is not removable
because the object being destroyed is neither the source nor the sink.
2018-02-21 19:28:06 -05:00
Paul Licameli
6e7d7447c1 Use an enum class for numeric validator styles 2018-02-21 19:21:08 -05:00
Paul Licameli
97a8cf52d4 More constructor arguments for EffectScienFilter 2018-02-21 19:21:06 -05:00
Paul Licameli
151cbb1305 Follow wxWidgets argument conventions for other ctors 2018-02-21 19:21:03 -05:00
Paul Licameli
ab5ff9060b More constructor arguments for RulerPanel 2018-02-21 19:21:03 -05:00
Paul Licameli
5724780be9 NumericTextControl ctor arguments...
... follow wxWidgets conventions for first two arguments; add Options
2018-02-21 19:21:02 -05:00
Paul Licameli
9dd5b521ea Make the experimental effects rack window compilable and usable...
... though there remain crash bugs to figure out, turning it on and off
during play.
2018-02-21 19:20:54 -05:00
Paul Licameli
0aad028c9b Simplify calls to Effect::Delegate 2018-02-21 19:20:53 -05:00
Paul Licameli
ec31d105bf Simplify conditions 2018-01-26 10:12:14 -05:00
Paul Licameli
c40b254626 while -> if 2018-01-26 10:12:14 -05:00
Paul Licameli
52a7f2320d Re-fix some warnings about mixing signed and unsigned better...
... Assuming that large unsigned magnitudes with high order bit set are not
the problem, but signed negatives of small magnitude may be:

1) Always cast the unsigned to signed in comparisons, not the other way.

Also:

2) Cast unsigned TERM to signed by itself, before subtracting.  Don't cast
the result.

3) Rewrite some comparisons by moving subtracted term to other side.

See commits
d2fe7b1757
f463eda36c
2018-01-23 18:51:53 -05:00
Paul Licameli
9f2ff354f6 Bug1754: Telephone and AM Radio curves should not flatten...
... Problem was a wrongly implemented comparator for wxArray Sort().

The array of points was not really sorted, and results differed with repeated
calls to Sort().

Unlike with std::sort, these comparators are supposed to be trichotomous.

Problem dates to commit 7d5e54e364

See also commit 4a500c77dd
2018-01-18 14:48:48 -05:00
Paul Licameli
af279072b5 Correct recent comments...
... compatiblity of plug-in settings is the real problem, not the plug-in
registry.
2018-01-16 12:28:21 -05:00
Paul Licameli
4628d6afa7 Remap effect type from "Audacity" to "Built-in", carefully...
... doing that only for the user-visible string, seen in the Manage>About menu
of the effect dialog and in the sorted or grouped Effect/Generate/Analyze
menus.

But don't for the string used internally and written into pluginregistry.cfg,
so that compatibility of that file is preserved.

See also commits cafbff9ff8 and
c6bbe4c3da
2018-01-16 11:11:36 -05:00
Paul Licameli
a30defe8ca Redo "Provide STL idiom for iterating tracks..." ...
... Being careful not to use operator == on a default-constructed
std::list::iterator, which violates assertions in the MSVC libraries.

This reverts commit 7fb5ec4b7a.
2018-01-14 14:25:02 -05:00
James Crook
7fb5ec4b7a Revert "Provide STL idiom for iterating tracks..."
Unsafe on MSVC 2013.
2018-01-14 14:24:21 +00:00
Paul Licameli
f9dab3679c Provide STL idiom for iterating tracks...
... and require qualified name access to use the underlying std::list iterators
that return shared_ptr to Track.

Which should not be done very much outside of class TrackList, but a few
places need it.
2018-01-13 19:37:05 -05:00
Paul Licameli
8e0cffb7f2 Simplify GuardedCall and default its return type to void 2018-01-13 01:32:41 -05:00
Paul Licameli
c975de8c5e More use of shared_ptr to Track, for safety...
... This even makes it possible to remove the prohibition of undo and redo
during transport, not that we want to though.  Playback and recording will
continue, using track objects that might not be in the current project.
2018-01-10 20:05:11 -05:00
Paul Licameli
cb403954fa Use std::[tr1::]unordered_(set|map), not the wxWidgets container macros 2018-01-08 18:22:51 -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
c6696f1b49 Move definition of _ and related into Internat.h 2018-01-06 21:03:32 -05:00
Paul Licameli
6f7739464e Fix line endings 2018-01-06 20:15:51 -05:00
Paul Licameli
5358e41510 indentation 2018-01-06 18:41:33 -05:00
James Crook
d2fe7b1757 Clean up most remaining MSVC warnings. 2018-01-06 13:03:48 +00:00
Paul Licameli
77c392d29c AudacityProject::OnEffect wraps new function DoEffect 2018-01-05 09:27:28 -05:00
Paul Licameli
def1d52505 Substitute, don't concatenate, when composing localized strings...
... Avoid English syntax bias.
2018-01-04 04:30:46 -05:00
Paul Licameli
b1f7f921a0 Translate the format "%s: %s" wherever user-visible...
... because some languages, like French, prefer to insert a space before :
2018-01-02 12:59:46 -05:00
Paul Licameli
3fbfef0eb1 Plot Spectrum, Change Pitch localize pitch names; Unicode sharp/flat 2018-01-02 12:20:04 -05:00
Paul Licameli
8b86d46884 Use Unicode 1/3 fraction 2018-01-02 12:20:04 -05:00
Paul Licameli
80a958f8a4 Rewrite empty prompts to ShuttleGUI functions as {} ...
... so we might more easily redefine the type of the function argument,
some other day (not this release)
2018-01-01 22:51:25 -05:00
Paul Licameli
e0970ad1e8 Remove unnecesary Format, Printf, casts to wxString 2018-01-01 21:53:51 -05:00
Paul Licameli
7fd78183d2 Remove needless uses of wxString::c_str() in wxString::Format...
... and similar wx "variadics," which all treat wxString smartly enough that
you don't need this.

Don't need c_str either to convert wxString to const wxChar * because
wxString has a conversion operator that does the same.
2018-01-01 20:34:33 -05:00
Paul Licameli
384300016d Define FileDialogWrapper, with localized default prompt and name 2018-01-01 17:50:04 -05:00
Paul Licameli
e8b875ff81 Define AudacityMessageDialog wrapper around wxMessageDialog...
... Prohibiting use of the default caption which is unlocalized.  (But we
didn't use it in fact anywhere.)
2018-01-01 17:50:03 -05:00
Paul Licameli
af290d73c0 Define AudacityTextEntryDialog wrapper around wxTextEntryDialog...
... Prohibiting use of the default caption which is unlocalized.  (But we
didn't use it in fact anywhere.)
2018-01-01 17:50:03 -05:00
Paul Licameli
ccb4bbac33 Translate "Message" as default title of message box...
... This required a sweeping change of all calls to wxMessageBox!  But it seems
safe to me, despite the great number of touched files.
2018-01-01 17:50:02 -05:00
Paul Licameli
378c96fda1 Consistently use translated effect name in titles of message boxes...
... For built-in and Nyquist effects.
2018-01-01 17:50:01 -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
0c97918bb9 Ladspa, VST: As before eb3bc7e: keep registering even if some errors 2017-12-31 16:18:53 -05:00
Paul Licameli
bdd1358f9b Error messages for failing to load Nyquist effects 2017-12-27 15:46:06 -05:00
Paul Licameli
eb3bc7e642 Minimal error messages for failing to load non-Nyquist effects 2017-12-27 15:19:43 -05:00
Paul Licameli
0f8bd45a7c ModuleInterface::RegisterPlugin can report an error message 2017-12-27 15:19:36 -05:00
James Crook
63de7f0884 Bug 305 - Analysis effects produce false indication that a label is open for editing
This was true of any Nyquist or VAMP effect that created labels.
2017-12-17 21:18:07 +00:00
Paul Licameli
4d978bcefb Use wxPrintf not printf 2017-12-16 11:54:32 -05:00