Commit Graph

44 Commits

Author SHA1 Message Date
saker
b451e40b51 clang-tidy: Apply modernize-use-using everywhere (#6453) 2022-07-07 10:54:34 +02:00
Levin Oehlmann
5904b249c0 clang-tidy: Apply modernize-use-override everywhere (#6439)
... to mark overriding functions `override` instead of `virtual`.
2022-06-19 23:03:55 +02:00
Levin Oehlmann
7227c89847 Namespace lmms (#6174)
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>
2022-06-19 20:08:46 +02:00
Johannes Lorenz
7db3fa94a1 Improve includes (#6320)
* Update ringbuffer submodule to fix includes

* Remove cyclic includes

* Remove Qt include prefixes

* Include C++ versions of C headers

E.g.: assert.h -> cassert

* Move CLIP_BORDER_WIDTH into ClipView

This allows to remove includes to TrackView.h in ClipView cpp files.

* Elliminate useless includes

This improves the include structure by elliminating includes that are
not used. Most of this was done by using `include-what-you-use` with
`CMAKE_C_INCLUDE_WHAT_YOU_USE` and `CMAKE_CXX_INCLUDE_WHAT_YOU_USE`
set to (broken down here):

```
include-what-you-use;
    -Xiwyu;--mapping_file=/usr/share/include-what-you-use/qt5_11.imp;
    -Xiwyu;--keep=*/xmmintrin.h;
    -Xiwyu;--keep=*/lmmsconfig.h;
    -Xiwyu;--keep=*/weak_libjack.h;
    -Xiwyu;--keep=*/sys/*;
    -Xiwyu;--keep=*/debug.h;
    -Xiwyu;--keep=*/SDL/*;
    -Xiwyu;--keep=*/alsa/*;
    -Xiwyu;--keep=*/FL/x.h;
    -Xiwyu;--keep=*/MidiApple.h;
    -Xiwyu;--keep=*/MidiWinMM.h;
    -Xiwyu;--keep=*/AudioSoundIo.h
```

* Fixup: Remove empty #if-#ifdef pairs

* Remove LMMS_HAVE_STD(LIB|INT)_H
2022-03-02 13:30:43 +01:00
Alexandre Almeida
eee1a81ff3 Rename "mixer" to "audioengine" on lmmsrc.xml (#6181) 2021-11-20 21:43:32 +01:00
Levin Oehlmann
f742710758 Macro cleanup (#6095)
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.
2021-09-30 18:01:27 +02:00
IanCaio
1dab416c6c Improvements to the upgrade routines (#5660)
* First commit

This commit starts the improvements on the upgrade methods. We are going to change both the DataFile and ConfigManager to use separate version values from LMMS release versions, so we can easily bump those versions for new upgrade routines. This first commit starts implementing a new version value for the ConfigManager.

* Change code as per requested on review

	As requested, the "configVersion" method was replaced by "legacyConfigVersion" instead, which is only used to return a configuration version if none is present in the configuration file.
	The configuration version of the current build is stored in a local variable called CONFIG_VERSION, making version bumping easier.
	Uses a switch statement instead of if-else to be able to make use of case-cascading.

TODO:
	- Change the CONFIG_VERSION variable to a unsigned int?
	- Start working on the DataFile.cpp.

* Changes the upgrade logic on DataFile.cpp

	Starts refactoring the upgrade logic on DataFile.cpp. Now the "version" attribute is used to indicate which fileVersion we are loading. If the value of version is "1.0", we have a legacy file and use the legacyFileVersion method to retrieve the integer version using the LMMS version. If the value of version is an integer, we just read it. The integer indicates the position in a list of upgrade methods where we should start from and run the upgrade methods. The file version of the build is held in the FILE_VERSION const on DataFile.h. It HAS TO match the number of upgrade methods that we have on our list.
	One of the versions had 2 upgrade routines (upgrade_1_2_0_rc3 and upgrade_1_2_0_rc2_42). They were merged into a single one (upgrade_1_2_0_rc3) because they were both called from a single version check, meaning that they are both part of a single fileVersion.
	Two fatal errors were added (which can later be improved to show an error messagebox): One if the version attribute doesn't exist, and another one if we are using a FILE_VERSION that doesn't match the number of upgrade methods (to avoid mistakes while coding new upgrades later).

	The configVersion variables and methods were changed to use unsigned int instead of int.

TODO:
	- Make the list of upgrade methods static.
	- Add debug messages for each upgrade routine for testing purposes.

* Make method vector a static const variable

	On DataFile.cpp, we now use the vector list of upgrade methods as a static const variable, so it only has to be constructed once.

* Reorganize vector lists

	Reorganize vector lists so they are more easily readable.

	Revert changes on upgrade method names from ConfigManager.cpp.

* Makes the file version bumping automatic

	The file version bumping on DataFile.cpp is now automatic (using the size of the m_upgradeMethods vector as a reference). FILE_VERSION constant was removed, and with it the qFatal error when it doesn't match the size of the methods vector.

* Improve formatting of version and upgrades lists

	Improves the formatting of the vector lists of upgrade routines and LMMS versions (2 upgrade routines per line and 3 LMMS versions per line).
	Adds a qWarning for every upgrade routine for testing purposes, plus a qWarning that tells the current fileVersion/configVersion when upgrade is called.
	Removes extra space characters after the opening bracket of ConfigManager::upgrade_1_1_91.

* Changes ConfigManager to use a vector of methods

	Changes ConfigManager to use a vector of upgrade methods, just like DataFile. The new Config Version can be calculated automatically now, so the CONFIG_VERSION constant was removed.
	Corrects a small comment on Datafile.h.

* Addresses Dom's review requests

	- Changes legacyConfigVersion and legacyFileVersion from const unsigned int to just unsigned int, since the const is irrelevant in this context.
	- Changes the type alias for upgrade methods to start with an uppercase as per the code style guidelines. Moves the aliasing of the type to the class declaration so it can be used on both the method and on the vector list declaration.
	- Changes the vector list names from m_upgradeMethods to UPGRADE_METHODS, so it's more visible they are a static constant.
	- Move the upgradeVersions list from the legacyFileVersion method to the DataFile class, as an static const called UPGRADE_VERSIONS.
	- Uses std::upper_bound instead of std::find_if for the legacyFileVersion method.

* Uses type alias on vector assignment

	Uses the UpgradeMethod type alias when defining the upgrade methods vector from both ConfigManager and DataFile.

* Removes debugging warnings

	Removes the qWarning() calls that were placed for debugging purposes.
2020-09-18 00:45:46 +02:00
LAMCILAK Theo
37d85ef24a Implement portable mode (#5561)
Adds portable mode by creating a file named portable_mode.txt next to lmms
and fixed a typo in the name of the function
2020-07-20 11:39:53 +09:00
Hussam al-Homsi
84d1091100 Rewrite the setup dialog (#3820) 2019-09-05 20:32:17 -04:00
Lukas W
966bf1c6de Use CMake GenerateExportHeader 2018-07-07 11:20:54 +02:00
Lukas W
7019cabb51 Merge branch 'stable-1.2' into fix/qt5-vst 2017-11-25 12:36:34 +01:00
Hyunin Song
55ce90ec00 Try to improve embedding method logic 2017-11-20 15:46:57 +09:00
Tres Finocchiaro
de98781df4 Use "soundfonts" folder, not "sf2" 2017-11-14 21:55:25 -05:00
Lukas W
358a251cff VstEmbed: Support changing embed method without restart 2017-11-10 09:18:40 +01:00
Lukas W
6839746344 VstEmbed: Allow selecting method at runtime 2017-11-06 11:17:10 +01:00
Tres Finocchiaro
17b37e02a9 Provide support for fallback config values (#3551)
Provide support for fallback config values

Makes autosave and some other values checked by default.  Supersedes #3541
2017-05-13 23:15:10 -04:00
Lukas W
29f832034a Remove unused includes (#3429) 2017-03-16 11:35:18 +00:00
grejppi
9e85d7c66e update all copyright headers to the proper url (#3326) 2017-02-06 02:41:15 +02:00
Umcaruje
c9618961d6 dBV is actually mislabeled dBFS (#3095)
* Relabel "dBV" to "dBFS" in function names and GUI
* Write a ConfigManager upgrade for older versions
2016-11-06 22:44:18 -05:00
Javier Serrano Polo
17e977dc2b Removed FLP configuration 2016-07-19 02:29:55 +02:00
midi-pascal
2a7bdf3fe8 Fix cmd-line help, add config option, use local lmmsrc file in dev (#2570)
* Fix command-line help, add --config option and use local lmmsrc file in dev mode

* Fix a typo in help screen for option --geometry (second dash missing)

* Replace tabs with spaces in help screen
Update man page

* Lineup items in help screen

* Accept both -geometry and --geometry as valid options
2016-04-23 23:27:34 +02:00
Colin Wallace
c519921306 Rename Engine to LmmsCore, but typedef'd as Engine to prevent name conflicts with ZASFx
Document the Engine renaming better & link to relevant issues/PRs
2015-12-29 23:29:35 -08:00
Colin Wallace
39133ab0ea Move update_1_2_0() functionality into upgrade_1_1_90();
Next release candidate will be named 1.1.90
2015-09-05 21:38:36 -07:00
Colin Wallace
f6b696fa0f Don't use underscore parameter names in value, setValue functions 2015-09-05 11:38:30 -07:00
Colin Wallace
0f2da6f68b Provide upgrade path to copy the MidiAlsaRaw 'Device' property to new 'device' 2015-09-05 11:38:29 -07:00
Michael Gregorius
8c93b6bfee Fixes #2272 and other problems with the templates
Removes the non-intuitive saving of the default template in
MainWindow::createNewProject.

Other fixed problems:
* User entries were not shown in the menu of the tool button that
creates new projects from templates. Now they are shown as well.

Other changes:
* Adds a new option "New from template" in the file menu. It shows the
same menu as the tool button.
2015-08-16 15:46:10 +02:00
Colin Wallace
4d3250bb42 Fix 'create working dir' prompt & move it from ConfigManager to GuiApplication;
also sets the default choice to 'yes' (do create directories) instead of 'no'
2015-08-05 20:14:02 -07:00
Lukas W
422fbbc8d3 Merge branch 'master' into cmake_dist
# Conflicts:
#	include/ConfigManager.h
#	include/Engine.h
#	plugins/CMakeLists.txt
#	plugins/vst_base/CMakeLists.txt
#	plugins/vst_base/Win64/CMakeLists.txt
#	src/core/Engine.cpp
2015-05-30 22:59:06 +02:00
Tres Finocchiaro
d516c74b73 Merge pull request #1908 from curlymorphic/pathDialog
Re organizing of the user LMMS directory
2015-04-13 21:21:05 +00:00
Dave French
54ddfd3a2b Config manager. added a userVstDir function
Added a userVstDir function for consistancy
use the userVstDir() function to create new folder
2015-03-30 18:59:54 +01:00
Dave French
9516b7cf0e Added user Vst and ladspa folders
the user vst folder nowbecome the default vstfolder. this is configurable
in the setup dialog.

The user ladspa folder is added to the list of folder to search
2015-03-27 15:19:57 +00:00
Dave French
345e05831d Change the location of the default template directory
Changed the location from lmms/projects/templates to
lmms/templates. This new location is used for loading and saving
of the default tempate default.mpt
2015-03-27 13:45:43 +00:00
Dave French
7335b98fdb Create User project template folder and default project template.
During the creation of the user directories, added the creation of
the projects/templates directory.

When creating a new song, if there is no default template create one.
2015-03-27 13:28:47 +00:00
Dave French
d9995f5548 Add default path for SF2
added a default path for sf
create folder
add folder to setup dialog
sf player now uses this location
2015-03-27 12:45:40 +00:00
Dave French
2271af81c4 Added a Gig directory to user lmms folder
Added option to set gig folder in setup dialog
Gig player now opens at this location
2015-03-27 12:45:40 +00:00
Lukas W
e0f077ba02 Merge branch 'master' into cmake_dist
# Conflicts:
#	include/Plugin.h
#	src/core/Plugin.cpp
2015-03-21 11:53:00 +01:00
tresf
afb0777a6e Remove "(bad latency!)" warning from PulseAudio 2015-02-08 18:22:14 -05:00
Lukas W
0a48b2f7bc Fix: Respect custom working directory whenw riting recovery file
Fixes #1726
2015-02-05 17:40:34 +01:00
Lukas W
7be47230e3 Introduce PluginFactory class
This singleton class handles management of plugin search paths and plugin
discovery. Search paths are (if they exist):
  * <lmms-exe-dir>/../lib/lmms: This is the common location on Unixoids
    (Not included in Windows builds)
  * <lmms-exe-dir>/plugins: For portable and Windows installations
  * The path given by the compile define LMMS_PLUGIN_DIR
  * Environment variable LMMS_PLUGIN_DIR if given

This commit also tweaks the build script to output built plugins to
"${CMAKE_BINARY_DIR}/plugins". This way lmms can find plugins during
development without the need to use `make install`.

Plugin::getDescriptorsOfAvailPlugins and ConfigManager::pluginDir were
removed.
2015-01-29 13:48:52 +01:00
Lukas W
968909c07c Rename engine to Engine 2014-11-26 00:49:55 +01:00
Vesa
9c25be1bde LMMS Memory Manager 2014-11-18 13:58:36 +02:00
Lukas W
8e8879f735 Merge stable-1.1
Conflicts:
	include/ConfigManager.h
	include/MidiTime.h
	include/string_pair_drag.h
	src/gui/string_pair_drag.cpp
	src/gui/widgets/rubberband.cpp
2014-11-10 19:26:59 +01:00
Lukas W
f6f44d0c5c Rename ConfigManager files (3) 2014-11-02 01:26:46 +01:00
Lukas W
c9c8bf1c77 Rename ConfigManager files (1) 2014-11-02 01:06:13 +01:00