This PR places all LMMS symbols into namespaces to eliminate any potential future name collisions between LMMS and third-party modules.
Also, this PR changes back `LmmsCore` to `Engine`, reverting c519921306 .
Co-authored-by: allejok96 <allejok96@gmail.com>
Summary:
* `NULL` -> `nullptr`
* `gui` -> Function `getGUI()`
* `pluginFactory` -> Function `getPluginFactory()`
* `assert` (redefinition) -> using `NDEBUG` instead, which standard `assert` respects.
* `powf` (C stdlib symbol clash) -> removed and all expansions replaced with calls to `std::pow`.
* `exp10` (nonstandard function symbol clash) -> removed and all expansions replaced with calls to `std::pow`.
* `PATH_DEV_DSP` -> File-scope QString of identical name and value.
* `VST_SNC_SHM_KEY_FILE` -> constexpr char* with identical name and value.
* `MM_ALLOC` and `MM_FREE` -> Functions with identical name and implementation.
* `INVAL`, `OUTVAL`, etc. for automation nodes -> Functions with identical names and implementations.
* BandLimitedWave.h: All integer constant macros replaced with constexpr ints of same name and value.
* `FAST_RAND_MAX` -> constexpr int of same name and value.
* `QSTR_TO_STDSTR` -> Function with identical name and equivalent implementation.
* `CCONST` -> constexpr function template with identical name and implementation.
* `F_OPEN_UTF8` -> Function with identical name and equivalent implementation.
* `LADSPA_PATH_SEPARATOR` -> constexpr char with identical name and value.
* `UI_CTRL_KEY` -> constexpr char* with identical name and value.
* `ALIGN_SIZE` -> Renamed to `LMMS_ALIGN_SIZE` and converted from a macro to a constexpr size_t.
* `JACK_MIDI_BUFFER_MAX` -> constexpr size_t with identical name and value.
* versioninfo.h: `PLATFORM`, `MACHINE` and `COMPILER_VERSION` -> prefixed with `LMMS_BUILDCONF_` and converted from macros to constexpr char* literals.
* Header guard _OSCILLOSCOPE -> renamed to OSCILLOSCOPE_H
* Header guard _TIME_DISPLAY_WIDGET -> renamed to TIME_DISPLAY_WIDGET_H
* C-style typecasts in DrumSynth.cpp have been replaced with `static_cast`.
* constexpr numerical constants are initialized with assignment notation instead of curly brace intializers.
* In portsmf, `Alg_seq::operator[]` will throw an exception instead of returning null if the operator index is out of range.
Additionally, in many places, global constants that were declared as `const T foo = bar;` were changed from const to constexpr, leaving them const and making them potentially evaluable at compile time.
Some macros that only appeared in single source files and were unused in those files have been removed entirely.
* Add FLAC export, based on WAV renderer
* Depend on sndfile>=1.0.18 (previously >=1.0.11)
* Add compression option to FLAC export, if available.
The code related to compression is only generated if LMMS_HAVE_SF_COMPLEVEL is defined(libsndfile>=1.0.26).
* Save into the correct file extension upon single-export.
* Use unique_ptr in FLAC renderer and be more expressive about involved types.
* Use unique_ptr and remove manual memory management in ExportProjectDialog
* Add 'flac' format info to --help and manpage
* Respect build options in ExportProjectDialog
* Use QItem user data instead of hard ordering to identify export format in ExportProjectDialog
* For compatibility with QVariant, ExportFileFormats is now explicitly an int.
* Don't break out of format identifier loop prematurely in Song export.
* Respect build options in ExportProjectDialog
* Use QItem user data instead of hard ordering to identify export format in ExportProjectDialog
* For compatibility with QVariant, ExportFileFormats is now explicitly an int.
* Don't break out of format identifier loop prematurely in Song export.
Pull the class OutputSettings out of the class ProjectRenderer so that
it can be used in other contexts as well. Also move the enum
ProjectRenderer::Depth into the new class OutputSettings and rename it
to BitDepth. Adjust all places that referenced
ProjectRenderer::OutputSettings accordingly.
Adjust the two places where an instance of OutputSettings is created:
the main function and ExportProjectDialog::startExport.
Store an instance of OutputSettings in AudioFileDevice and remove
several members and methods which are now replaced by this instance. Add
a getter for the OutputSettings to AudioFileDevice. Storing an instance
of OutputSettings in the base class AudioFileDevice enables the
simplification of the following constructors and general code in the
following classes:
* AudioFileDevice
* AudioFileOgg
* AudioFileWave
Because OutputSettings contains everything related to sample rate, bit
rate settings and bit depth these parameters could be removed from the
parameter list of the aforementioned constructors.
Simplify the signature of the factory method AudioFileDeviceInstantiaton
(defined in AudioFileDevice.h) and reorder the parameters by significance.
Move the logic of how the minimum and maximum bitrate is calculated
using the nominal bitrate into AudioFileOgg::minBitrate() and
AudioFileOgg::maxBitrate(). Previously this was defined in the
constructor of ProjectRenderer where it does not belong as it an
implementation detail of the OGG export.
Remove the code that converted the bit depth enum to an integer from
ProjectRenderer as it is now solely represented as an enum.
Remove class members for the minimum and maximum bit rate from
AudioFileOgg and adjust the code in the implementation to use the values
stored in OutputSettings.
Add a new value of "24 Bit Float" to the "Depth" combo box in the
project export dialog.
Add a new enum value to ProjectRenderer::Depth and extend the evaluation
of the different enum values in ProjectRenderer.
Add the new case of a depth of 24 to AudioFileWave and remove some
repetition with regards to SF_FORMAT_WAV in the code. It's only set once
now and then the depth is "added" in a switch statement.
Currently ProjectRenderer has a helper getFileFormatFromExtension, this adds a
similar helper getFileExtensionFromFormat.
This will, for example, return "ogg" for OggFile.