Commit Graph

9686 Commits

Author SHA1 Message Date
Dmitry Vedenko 950d170ae6 Adds context to SQLite3 exceptions 2021-06-08 08:08:26 -07:00
Dmitry Vedenko 690772ccb0 Use ShowExceptionDialog when we want to show ErrorReportDialog 2021-06-08 08:08:26 -07:00
Dmitry Vedenko bbb9ca14a2 Adds ErrorReportDialog and ShowExceptionDialog 2021-06-08 08:08:26 -07:00
Paul Licameli d28554189d Add alpha-build-only crash-me buttons, for testing of crash reporting 2021-06-08 02:23:53 -07:00
Paul Licameli 64d7ca7403 New utility library 2021-06-02 07:08:19 -04:00
Paul Licameli 094675bd42 Remove wx/any.h from MemoryX.h; sacrifice MSVC debug new macro ...
... it never helped us debug much, and polluted the preprocessor namespace and
made this bad depencency
2021-06-02 07:08: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
James Crook 27618eb95f Update AboutDialog
* Move Peter Sampson to emeritus.
* Trademark no longer 'of Dominic Mazzoni'.
2021-06-01 11:31:37 +01:00
Paul Licameli 9c70887c34 A rewrite in Nyquist to make reinterpret_cast unnecessary 2021-05-27 11:38:10 -04:00
Paul Licameli f369b5109b Change almost all uses of WaveTrack::Get() to GetFloats() ...
... A call graph browser easily shows that the extra generality of fetching
samples in some other format is only used in Benchmark -- where the format is
always the same as what the track is constructed with.

This makes re-verification of the claims in comments two commits ago easier.
2021-05-27 11:38:10 -04:00
Paul Licameli 0aa8625cff WaveTrackCache was only used with float; don't support other formats 2021-05-27 11:38:10 -04:00
Paul Licameli 4fcb8bffbf Comments about dithering in SqliteSampleBlock 2021-05-27 11:38:10 -04:00
Paul Licameli 528b57ff8e Comments about dithering in ImportAup 2021-05-27 11:38:10 -04:00
Paul Licameli 43310b6a1e Review of ImportAup.cpp ...
... incidental to a review of CopySamples in it.  This code is used only when
importing an old-style .aup project file into the new project format.

Fixed some RAII for file handle.

Rewrote every call to IsGoodInt or IsGoodInt64 with a narrowly scoped temporary
variable.

Use IsGoodInt64 only for total track lengths and positions; but use IsGoodInt
for block and blockfile sizes, which are not supposed to be huge but are
supposed to fit in memory buffers.
2021-05-27 11:38:10 -04:00
Paul Licameli 0053c61c08 Do not dither samples as they pass through RingBuffer...
... See allocation of RingBuffers in AudioIO.

Playback buffers always used floatSample format so this change has no
effect on them.

But we also want no extra dithering applied during recording, where the capture
format might be narrower than float.
2021-05-27 11:38:10 -04:00
Paul Licameli 50a26d9caf CopySamples gives more than binary choice of dither algorithm...
... And so a separate function CopySamplesNoDither is not needed
2021-05-27 11:38:10 -04:00
Paul Licameli 6eb5f3ac5b Eliminate CopySamples calls where destination is always float...
.. Call the function SamplesToFloats instead, or in one place, where source
is also always float, just do memcpy.

Dithering never happened in these cases.
2021-05-27 11:38:09 -04:00
Paul Licameli c35f7d35cc Startup without pluginregistry.cfg should not violate assertion 2021-05-27 11:07:39 -04:00
Paul Licameli 45c6190c51 New library lib-strings for Identifier and internationalization 2021-05-27 09:51:32 -04:00
Paul Licameli 70c4898648 Move class wxArrayStringEx to its own files 2021-05-27 09:51:32 -04:00
Paul Licameli 7cf153a34b Duplicate MemoryX.h into wxArrayStringEx.h, diff should be empty 2021-05-27 09:51:32 -04:00
Paul Licameli c4487814cf Invert dependency of TranslatableString and audacity/Types.h 2021-05-27 09:51:32 -04:00
Paul Licameli f7d9602a42 TranslatableString.h does not include Identifier.h 2021-05-27 09:51:32 -04:00
Paul Licameli bb14a6016f Move TranslatableString to new files 2021-05-27 09:51:32 -04:00
Paul Licameli 4d45054f4c Duplicate Types.h, Internat.cpp in TranslatableString.{h,cpp} 2021-05-27 09:51:32 -04:00
Paul Licameli d2bdd60e91 Internat doesn't depend on wxCore, ComponentInterface, MemoryX 2021-05-27 09:51:32 -04:00
Paul Licameli 7e697d1d8f Replace many inclusions of Types.h with Identifier.h 2021-05-27 09:51:32 -04:00
Paul Licameli 5a516a7999 Move Identifier, TaggedIdentifier, some type aliases to Identifier.h 2021-05-27 09:51:32 -04:00
Paul Licameli 300b2a1739 Duplicate Types.h into Identifier.h, diff should be empty 2021-05-27 09:51:32 -04:00
Paul Licameli 564235f9c9 GUIPrefs::SetLang wraps new Languages::SetLang ...
... the former uses Prefs, wxApp, and AudacityMessageBox, the latter has no
dependency on them.

Also move some other functions from GUIPrefs into namespace Languages.
2021-05-27 09:51:32 -04:00
Paul Licameli 91e4eeadb8 Remove GUIPrefs::InitLang...
... Expand it in AudacityApp where initializing i18n services.

Just call SetLang directly in CrashReport, because the argument was not null.

Also eliminate call to SetLang in Nyquist, where really only the system language
was needed.
2021-05-27 09:51:32 -04:00
Paul Licameli ad5f895f65 namespace for Languages, which does not depend on FileNames...
(some small code duplication of code for path lists results)
2021-05-27 09:51:32 -04:00
Dmitry Vedenko 4dc4e86863 Make lib-network-manager an opt-in library 2021-05-26 07:41:47 -07:00
Dmitry Vedenko 4e6a1a81a9 Updates the way shared libraries are hadled
1. We put all shared libraries into one place. Both conan and locally built
2. We invoke CopyLibs to copy the libraries to a proper location and to correctly set the RPATH
Fixes CopyLibs script on Windows


Fixes CopyLibs.cmake for Linux

Fixes CopyLibs on macOS


Fixes CopyLibs on macOS
2021-05-26 12:46:45 +03:00
Dmitry Vedenko 77cc7bed6f Adds lib-network-manager 2021-05-26 12:46:45 +03:00
Paul Licameli 9f59879765 Add a header file to hold strings between string and feature freeze 2021-05-25 10:13:18 -04:00
Paul Licameli 5a61428d4d Don't stop recovering projects in case one of them fails...
... This matters now that ProjectManager::OpenProject really can return null.
2021-05-24 20:04:58 -04:00
Paul Licameli 4209c8150a Bug2764: Open Project... in Scriptables shouldn't corrupt project...
... Now new project windows are opened when .aup3 files are opened; but
behavior chages only in that case.

Wherever opening of other files invoked import code, we still do or do
not make a new project in exactly the same cases as before; such as, when
opening multiple files with File > Open, be sure each imported file still opens
in its own separate window.

This means the decision whether to open a new project must be lowered into
ProjectFileManager, where the type of the file is discovered, and we pass it a
function object so it avoids a dependency cycle with ProjectManager.

It also means the checking for errors and closing of new projects in case of
failure must be replicated at all places where ProjectFileManager::OpenProject
is called directly.

The class ProjectManager::ProjectChooser simplifies this.

Recently introduced calls to SafeToOpenProjectInto(), before
ProjectManager::OpenProject(), are now lowered into that class, delaying the
safety check so it might also be called where ProjectFileManager is used
directly.
2021-05-24 20:04:58 -04:00
Paul Licameli a1650771b1 New argument for ProjectManager::OpenProject, not yet implemented...
... It is false in exactly the cases where there is now also a check first for
the safety of opening a project file.

Those are the cases where a new project was made for imports, but this was not
necessary for safety.  Yet old behavior will be preserved in such cases.
2021-05-24 20:04:58 -04:00
Paul Licameli 97cf411dd5 Function for repeated check whether it is safe to overwrite project 2021-05-24 20:04:58 -04:00
Paul Licameli 1bed51ac80 ProjectFileManager::OpenFile returns a pointer to project 2021-05-24 20:04:57 -04:00
Paul Licameli c96d5f12bc Comments; range-for; fix unchecked dereferences of pointer-to-pointer 2021-05-24 20:04:57 -04:00
Dmitry Vedenko 8aca9d02de Add the first Conan-based dependecies
add_conan_lib cmake function is defined, that allows to add a dependency using Conan with two possible system fallbacks:

1. pkg_check_modules is invoked, if `PGK_CONFIG ...` is present
2. find_package is invoked if `FIND_PACKAGE_OPTIONS` is present and `pkg_check_modules` has failed

If `ALWAYS_ALLOW_CONAN_FALLBACK` is present - `obey_system_dependencies` will be ignored for the package

Currently, the following dependencies are retrieved using Conan:

* zlib
* expat
* wxwidgets
* libmp3lame
* libid3tag
* libmad

The last three libraries are included in this commit, as they depend on zlib.
Properly pass **arch** and **os.version** to Conan
2021-05-24 06:53:53 -07:00
Dmitry Vedenko 576b7e66d2 Update min-macos to 10.9
Since XCode 10, Apple does not recommend building for macOS <10.9

Reason - 10.7 and 10.8 require libstdc++

We enforce libc++ 

```# Shouldn't cmake do this???
   string( APPEND CMAKE_CXX_FLAGS " -stdlib=libc++" )```

While this generally works, it makes the proper dependency management tricky.
 
Compiler message for the library support:

```
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
    ld: library not found for -lstdc++
```
2021-05-24 06:53:53 -07:00
Paul Licameli 48cacdd961 More AUDACITY_DLL_API linkage specifications 2021-05-21 21:43:59 -04:00
Paul Licameli 010fe7bff2 Fix complaint from xgettext about empty string 2021-05-21 20:41:27 -04:00
James Crook 7605763fa0 Bug 2784 - Filter Curve EQ; Height increase.
Comment in closing of this bug requested an increase in height.
No reason not to, so height increased too.
2021-05-20 17:52:47 +01:00
James Crook df91d14c9e Bug 2793 - AUP3 projects fail to compact if project's path contains a single-quote 2021-05-20 11:27:21 +01:00
James Crook 2b10309fb3 Bug 2784 - Enh: Filter Curve EQ does not remember window size
Per comment 1 in that Bugzilla bug report, this
change makes the default/initial/minimum size larger.
2021-05-19 13:16:42 +01:00
Paul Licameli 906bd94826 Linux build doesn't need environment variable to find the modules 2021-05-18 20:51:55 -04:00
Paul Licameli 7fd53e8778 Auto-enable list of regularly shipped modules (except script-pipe) 2021-05-18 20:51:55 -04:00
Paul Licameli bacf06944a Bug2792: Audacity fails to launch...
... bug was introduced at f1de843
2021-05-18 17:11:46 -04:00
Paul Licameli dfbf3d25c1 Support for our own libraries, distinct from modules 2021-05-18 00:12:44 -04:00
James Crook ea04eef7e4 Fix Windows button style on Mac toolbar.
Removing audacity.h also removed #define USE_AQUA_THEME
2021-05-17 18:56:03 +01:00
Paul Licameli f1de843246 Use Settings for default sample rate and format...
... The first is an example of a Setting with a computed default value.

Also making a new file to hold them, separate from the GUI that changes them
in QualityPrefs; fewer things depend on QualityPrefs
2021-05-17 08:46:08 -04:00
Paul Licameli 8c04ed3990 Settings objects used in AudioIOBase...
... Giving many examples of use of Settings objects.  Many other rewrites like
this should be made to eliminate as many direct uses of gPrefs as we can.

Don't rely on long distance coincidences of literals for paths or defaults.

For each of several paths like /AudioIO/Host, all uses of that path are replaced
with use of a global Settings object defined in one place, in AudioIOBase.  The
object also gives the benefit of caching the last-read or written value.

Other users of those preferences must then include "AudioIOBase.h" to make the
dependency explicit at compile time.

It should be checked that no other mentions of those paths remain in the source,
and that there was no unintended change in default values.

This also inverts dependency of AudioIOBase on RecordingPrefs, which is GUI for
changing some of these settings.
2021-05-17 08:46:08 -04:00
Paul Licameli 5fef82dccf Define Setting classes, bundling config path with settings value...
... the intention being, that no string literal for a path, or its default
value, shall ever occur twice in the code, relying on long-distance coincidence
of literal values.  Instead, a named Setting object is constructed once, then
read and written.

For now, the Tie... functions in ShuttleGuiBase will take references to
implicitly constructed temporary Setting objects.  But all should later be
made static objects, and the constructors made explicit.
2021-05-17 08:46:08 -04:00
Paul Licameli ff07130ac4 Bug2763: Certain Scriptable commands should push Undo stack...
... Exhaustive examination convinces me that Set Labels and Set Envelope are
the only two needing this.  (The special problems of Open Project merited a
different bug number 2764.)
2021-05-16 07:08:44 -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 a4c3840861 Initialize ModuleManager before PluginManager...
... So that the plugin providers might themselves become modules, and so that
putting built-in commands and effects into modules will work
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 b92f2579b7 ModuleManager does not depend on ModulePrefs, which contains GUI code 2021-05-16 07:03:12 -04:00
Paul Licameli f5be1de058 Copy ModulePrefs.* into new files ModuleSettings.* which aren't built 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 bbda68c079 ModuleManager doesn't specially start up mod-script-pipe...
... The standard module dispatch can do that.
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 e7f8f36700 A macro for boilerplate to generate required module entry points 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 dcd8bca896 Nonlazy resolution of symbols at load time for modules...
... Forcing appropriate failure to load modules with unsatisfied symbols on all
platforms.
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
James Crook d0ff48f3bd Bug 2754 - Change Tempo & Pitch and Sliding Stretch with selected audio in negative time crash Audacity on windows (error on Mac) 2021-05-15 11:36:53 +01:00
Paul Licameli 7302fc584f Move RecordingSchedule, PlaybackSchedule to new files 2021-05-14 16:26:29 -04:00
Paul Licameli a12ec0d11b Duplicate AudioIOBase into PlaybackSchedule...
... please verify empty file diffs; this simplifies review of the next commit
2021-05-14 16:25:53 -04:00
Paul Licameli 9a66255013 Move AudioIOBase::mPlaybackSchedule up into AudioIoCallback 2021-05-14 16:25:41 -04:00
Paul Licameli d92a68f076 ViewInfo does not depend on AudioIOBase...
... ViewInfo should only be concerned with screen geometry.

(And so it won't depend on AudioIO (even higher level) after stream time moves
there.)

PlaybackScroller receives the timer event directly (not from ViewInfo) and
caches playback position instead.  Then, as before, it propagates the event
to PlayIndicatorOverlay.
2021-05-14 16:25:14 -04:00
Paul Licameli aa8e4eef06 Windows builds need a complete type for wxWeakRef parameter...
... Guarantee that in header files that declare such wxWeakRefs
2021-05-14 16:24:59 -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 cf948ece52 Eliminate duplications of string literal "Nyquist Prompt" 2021-05-14 13:08:02 -04:00
Paul Licameli 9e70fa71ba Issue 887: Some strings didn't translate, though in catalogs...
... What they had in common was the use of the XC macro to specify a
disambiguating context string.  Example: "Interface" page of preferences.

TranslatableString had not implemented this
correctly except in the less usual case of plurals.
2021-05-13 10:27:08 +01:00
Paul Licameli 5b77d19324 Missing $ -- thank you vladkosi 2021-05-12 16:30:15 -04:00
Paul Licameli b52192c4c4 Fix builds with precompiled headers, which broke at 794f4e5 2021-05-12 13:02:29 -05:00
Paul Licameli 82a1534226 Remove redundant test of USE_MIDI ...
... See instead how cmake_proxies/CMakeLists.txt already enforces that
if EXPERIMENTAL_MIDI_OUT is true, then USE_MIDI must be true
2021-05-12 13:02:29 -05:00
Paul Licameli 85a8d0ac97 Keep !EXPERIMENTAL_MIDI_OUT compilable 2021-05-11 19:32:10 -05:00
Dennis Braun 8bb55b8bbf Fix CVE-2020-11867 2021-05-10 20:53:33 +03:00
Leland Lucius 95bcb08b4b Revert "Cleanup and update FFmpeg support to v4.3.1 (#741)"
Removing until a decision is made on how to handle the required
library upgrade.
2021-05-10 10:33:01 -05: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 3060530b4f Remove outdated comments about Audacity.h and AUDACITY_DLL_API 2021-05-10 08:03:31 -04:00
Paul Licameli c5ebc396eb Audacity.h has shrunk to nothing, now remove it! 2021-05-10 00:05:23 -05:00
Paul Licameli d51f505cd9 Define Audacity version constants in CMake not Audacity.h 2021-05-10 00:05:23 -05:00
Paul Licameli d9b868334b Remove special version string for Dark Audacity 2021-05-10 00:05:23 -05:00
Paul Licameli e6cd0b88bc Don't forward declare wxWindow in Audacity.h 2021-05-10 00:05:23 -05:00
Paul Licameli 794f4e5877 Inclusion of the correct config header on command line using CMake 2021-05-10 00:05:23 -05:00
Paul Licameli 229b82a502 Move definitions of safenew, PROHIBITED, _DEBUG into CMake 2021-05-10 00:05:23 -05:00