Commit Graph

42 Commits

Author SHA1 Message Date
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
Johannes Lorenz
e0298891e4 clang-format: Prepare plugin descriptor init'ers 2021-09-22 22:46:12 +02:00
Alexandre Almeida
770d2498b5 Rename Mixer to AudioEngine (#6127) 2021-09-12 01:00:21 +02:00
Levin Oehlmann
0abbd6cb79 Remove 'using namespace std;' from some headers (#6076) 2021-07-23 19:16:51 +02:00
Dominic Clark
5efb3a19cb Fix use of translation functions (#5629) 2020-08-30 19:27:17 +01:00
Spekular
17565caf53 Improved relative paths (#5117)
* Create PathUtils

* Replace old SampleBuffer calls

* Fix automatic track names

* Fix things

* Remove accidental duplicate file

* Add includes

* More incldues

* PhysSong's code review + style

* Fix vestige loading?

Seems more reasonable to convert from relative on load and to relative on save than vice versa.

* Typo fix

* More Bases

* Enable more bases

* Add missing semicolons in prefixes

* Nicer sample track tooltip

* Use correct directories

"userXDir" gives the default dir for ladspa, sf2, and gig. "xDir" gives the user dir.

* Make relative to both default and custom locations

Part 1

* Make relative to both default and custom locations

Part 2

* Typofix

* Typofix

* Fix upgrade function after base renaming

* Fix Tests

* Update tests/src/core/RelativePathsTest.cpp

Co-Authored-By: Hyunjin Song <tteu.ingog@gmail.com>

* Choose UserXBase over DefaultXBase if identical

toShortestRelative sticks with the first base found if two bases give the same path length. By placing UserXBase Bases before DefaultXBase Bases in the relativeBases vector, toShortestRelative will prioritize them.

* Ensure baseLocation always has trailing slash

Otherwise, a user configuring a path without one will break things.

* Move loc declaration out of switch

* Semicolon

* Apply suggestions from code review...

* Include PathUtil and sort includes

* More granular includes

* Apply suggestions from code review

Co-Authored-By: Hyunjin Song <tteu.ingog@gmail.com>

* Update include/PathUtil.h

* Leave empty paths alone

* Fix stupid merge

* Really fix merge. Hopefully

* Switch Base from enum to class enum

* Don't pass Base by reference

* Use QStringLiteral for static QString allocation in basePrefix method

* Make VST loading more similar to previous implementation

* Fix tests after enum change

* Attempt to fix VST loading, nicer name for sample clips

* Fix last review comment

Don't append a "/" that will be removed by cleanPath later

* Apply suggestions from code review

Co-authored-by: Dominic Clark <mrdomclark@gmail.com>

Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
2020-07-28 17:07:35 +02:00
Johannes Lorenz
73c2c70d96 Merge branch 'variable-tab-widget' 2019-07-17 22:21:47 +02:00
Johannes Lorenz
aa8f9361c6 Rename InstrumentView250 to InstrumentViewFixedSize 2019-07-17 22:20:25 +02:00
Johannes Lorenz
a4df7a9765 Split InstrumentView into itself and InstrumentView250 2019-07-14 10:20:54 +02:00
Johannes Lorenz
a1b355828e Allow sub plugins for instruments aswell
* Move m_key member of Effect into Plugin
* Pass key to Instrument ctors and instantiaters
* Add pluginKeys to all plugin selector widgets, and let them pass the keys
  when instantiating the instruments; or, if the keys must be passed over
  threads, pass the keys to the Engine using `Engine::setDndPluginKey()`
* As instrument plugin libraries now also need to get their key passed, their
  second argument, which was always the same as the first, is now used to pass
  the sub plugin keys. This affects *all* instrument plugins.
* Plugin.h: Add more virtuals to `SubPluginFeatures` in order to draw logos
  and images into instrument selector widgets
* LadspaSubPluginFeatures: Implement the `displayName` virtual because the
  new behaviour to resolve displayNames is to first look at the
  SubPluginFeatures, which, without override, returns the superior plugin's
  name (Plugin.cpp)

Additional:

* PluginFactory.h: Allow setting up search paths without discovering plugins
  yet
* Plugin.h: Add full documentation (should be checked)
2018-12-27 21:24:19 +01:00
Lukas W
d454ef60e2 More export fixes 2018-07-07 17:16:08 +02:00
Lukas W
47a5248d1d Linux compile fixes 2018-07-07 16:40:37 +02:00
Hussam al-Homsi
6d46bd473f Remove "What's This?" and update tooltips (#4128) 2018-06-06 01:50:11 +03:00
Hyunin Song
cc3822141e Merge branch 'stable-1.2' into master (@liushuyu) 2017-07-15 08:08:07 +09:00
Karmo Rosental
635b50bfb5 VeSTige opens correct folder (#3550)
Open correct VST folder in previously saved projects with existing VeSTige instruments.
2017-05-31 14:55:22 -04:00
Lukas W
9f905bce3e Use Qt's Resource System (2nd approach) (#1891)
* Remove bin2res, use Qt's resource system
* Use QDir search paths and QImageReader in getIconPixmap
* Don't include "embed.cpp" in plugins
* getIconPixmap: Use QPixmapCache, use QPixmap::fromImageReader
* Require CMake 2.8.9

* Fix ReverbSC embed usage
2017-03-26 22:06:43 +02:00
grejppi
9e85d7c66e update all copyright headers to the proper url (#3326) 2017-02-06 02:41:15 +02:00
Javier Serrano Polo
5606a04ad7 Defer updates to SampleBuffer
Removed global lock from the Mixer
2016-06-18 05:29:21 +02:00
Javier Serrano Polo
d31089ceb5 Fixed removal of track when notes are playing 2016-06-16 17:42:00 +02:00
Karmo Rosental
a31b8c4ff3 Fixes #2537. GigaSampler can load both relative and absolute paths from project file. File dialog shows correctly directory of current file. 2016-03-26 00:07:50 +02:00
Fastigium
da8040764f Require explicit types when removing PlayHandles in the Mixer
This fixes a few deadlocks where a PresetPreviewPlayHandle would be removed by
the creation of a new PresetPreviewPlayHandle.
2016-02-16 19:23:08 +01:00
Lukas W
8b0b2df38e Fix compilation for Qt 5.0 2015-06-21 15:41:26 +02: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
1bbf7455a4 Rename a lot… 2014-11-26 10:09:49 +01:00
Lukas W
5b77abd9a5 Rename fixes 2014-11-26 01:46:12 +01:00
Garrett
205056621c Fixed release samples never being deleted
I removed code in a previous commit that deleted ended samples since
that sometimes caused issues when the samples had loop points. However,
removing the code caused issues with the release samples. Thus, now it
removes ended samples only if they are release samples. Otherwise, the
keyup event and ADSR handle ending the note.
2014-11-23 14:24:51 -08:00
Garrett
366e799791 More What's This messages 2014-11-23 10:31:18 -08:00
Garrett
76e182e586 Release only one note on keyup
Previously if you release a C4 then all C4 notes would be released. Now
it stores the pointer to the plugin data which is unique for each key
press and determines which to release based on the matching pointers.
2014-11-18 09:02:50 -08:00
Garrett
3f641c2c55 Make it work with MemoryManager 2014-11-18 08:30:31 -08:00
Garrett
702e2a1ee3 Added loop support and fixed fine tunings
Now it'll honor the loop regions specified in the file and it'll
properly use the fine tuning for the samples if specified. Also,
modified the exponential decay code again since it was glitching at the
end of some notes for some reason.
2014-11-18 08:05:28 -08:00
Garrett
71b6814729 Change pitch of notes if PitchTrack is set
Now if a Gig file provides a few samples per octave, it'll change the
pitch of the sample specified for a note instead of just assuming it is
the right pitch.

Also, fixed issue where if attack length was zero the note would never
sound.
2014-11-18 08:05:28 -08:00
Garrett
2c0b1ef4b0 Use stack array for buffer instead of gig::buffer_t 2014-11-18 08:05:28 -08:00
Garrett
8693623758 Fixed resampling glitches when deleting notes
Moving the code to detect the sample rates of the currently used samples
after the code deleting notes seemed to fix these glitches. Also, fixed a
few ADSR issues that could have resulted in clipping in the attack or
glitching after the release.
2014-11-18 08:05:27 -08:00
Garrett
a251391249 Always use linear interpolation for resampling 2014-11-18 08:05:27 -08:00
Garrett
4e8508b8a3 Exponential decay for release instead of linear
It now sounds much more like the release in Linux Sampler.
2014-11-18 08:05:27 -08:00
Garrett
822a3c52bb Convert 24-bit data if on big endian system
This is needed since libgig returns 24-bit data in a little endian.
Note: untested as I don't have a big endian system.
2014-11-18 08:05:27 -08:00
Garrett
c0ad77dfca Stack buffers instead of allocating on the heap 2014-11-18 08:05:27 -08:00
Garrett
d1bf19ef4a Don't use "note" as a variable name 2014-11-18 08:05:27 -08:00
Garrett
d0a821947a Fixed resampling issues
When providing extra frames, libsamplerate stores the extras internally
and outputs them in the next period. But, when it has enough internally
to output a whole period, it just outputs the internal buffer while not
using any more input frames. Now I provide some extra frames, check to
see how many frames we used actually used, and update the sample
positions and ADSR accordingly.
2014-11-18 08:05:27 -08:00
Garrett
a679e4e938 Fixed detuned resampling
Apparently the most noticeable detuning issues were caused by rounding
error by integer division.
2014-11-18 08:05:27 -08:00
Garrett
07032260e8 configManager to ConfigManager rename 2014-11-18 08:05:27 -08:00
Garrett
3aaa7ac6c4 Coding style fixes 2014-11-18 08:05:27 -08:00