... 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.
... 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.
... 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.
.. Call the function SamplesToFloats instead, or in one place, where source
is also always float, just do memcpy.
Dithering never happened in these cases.
... the former uses Prefs, wxApp, and AudacityMessageBox, the latter has no
dependency on them.
Also move some other functions from GUIPrefs into namespace Languages.
... 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.
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
... 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.
... 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.
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
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++
```
... 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
... 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.
... 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.
... 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.)
... 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.
... 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.
... 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.
... 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.
... 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.
... 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.
... 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.
... 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.
... 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.