* Fix arithmetic overflow in `Lv2Ports::Meta::get()` in case min and
max are not set
* Fix combo boxes with >16 values being wrongly visualized as knobs
* Rename `Lv2Ports::Vis` enum value `None` to `Generic`
This also adds more min/max checks, mostly for logarithmic scales.
Since this raised some warnings for logarithmic CV ports, the CV
metadata is now also read (but CV ports are still not supported).
This multiplies port's min/max value with the processing sample rate
that is used for the plugin. This fixes damaged audio in GLAME
Butterworth High-/Lowpass from #5767.
* Fix for the font of truncated sidebar items (#5714).
For windows platforms, retrieve the system font and set it for the FileBrowserTreeWidget. This makes sure that truncated items will use the font as non-truncated items.
* Add TODO to remove the fix when all builds use a recent enough version of qt.
* Add check on QT version and conditionally include the fix.
Hack to take care of the assertion sent by the rpmalloc memory manager. Creates a static "free" function for NotePlayHandleManager and then shoves it right before the program ends.
Co-authored-by: Pause for Affliction <47124830+Epsilon-13@users.noreply.github.com>
* Fix EffectRackView appearance (GUI).
* Elide the name of the effect when it tends to be too big. (#5752)
* Evenly space the controls (W/D, Decay Gate). (#5750)
* Show the scrollbar in the default theme to close the gap. (#5752)
* Reduce the gap between the effect and the scrollbar. (#5757)
* Use always the same width for the EffectRackview (InstrumentTrack and SampleTrack) to avoid gaps or cutoffs of the background.
* Widen the background in the default theme.
* Widen the embossed space in the background in the classic theme to fit the controls.
* Changes for improving the EffectRackView after reviews.
* Reduce the background for the default theme by 1 pixel.
* Reduce the background for the classic theme by 2 pixels and remove the darker line at the bottom right.
* Reduce the width of long names of the plugin also by 2 pixels.
* Put the controls 2 pixels closer to each other.
* Fixes createTCO method on some classes
Classes that inherit from "Track", also inherit the createTCO method. That method takes a MidiTime position as an argument, but except on the class SampleTrack that argument was ignored. That lead to unnecessary calls to TCO->movePosition after creating a TCO in many parts of the codebase (making the argument completely redundant) and even to a bug on the BBEditor, caused by a call to createTCO that expected the position to be set on the constructor (see issue #5673).
That PR adds code to move the TCO to the appropriate position inside the constructor of the classes that didn't have it, fixes the code style on the SampleTrack createTCO method and removes the now unneeded calls to movePosition from source files on src/ and plugins/. On Track::loadSettings there was a call to saveJournallingState(false) followed immediately by restoreJournallingState() which was deleted because it's redundant (probably a left over from copying the code from pasteSelection?).
* Fix code style issues
Fixes code style issues on some files (except for ones where the current statements already had a different code style. In those the used code style was kept for consistency).
* Fixes more code style issues
* Fixes code style issues on the parameter name
Fixes code style issue on the parameter name of createTCO, where _pos was supposed to be just pos. The existing code had the old style and I ended up replicating it on the other methods.
* Code style fixes
Fixes code style in the changed lines.
* Fixes bug with dragging to negative positions
There was a bug (already present before this PR) where dragging
a selection before MidiTime 0 would result in some TCOs being placed on
negative positions. This PR fixes this bug by applying the following
changes:
1) TrackContentObject::movePosition now moves the TCO to
positions equal or above 0 only.
2) Because of the previous change, I removed the line that
calculated the max value between 0 and the new position on
TrackContentObjectView::mouseMoveEvent when dragging a single TCO (and
added a line updating the value to the real new position of the TCO so
the label displays the position correctly).
3) Unrelated to this bug, but removed an unnecessary call to
TrackContentWidget::changePosition on the left resize of sample TCOs
because it will already be called when movePosition triggers the
positionChanged signal.
4) Added some logic to the TrackContentWidget::pasteSelection
method to find the left most TCO being pasted and make sure that the
offset is corrected so it doesn't end up on a negative position (similar
to the logic for the MoveSelection action).
5) Removed another line that calculated the max between 0 and
the new position on Track::removeBar since it's now safe to call
movePosition with negative values.
* Uses std::max instead of a conditional statement
As suggested by Spekular, we use std::max instead of a
conditional statement to correct the value of offset if it positions a
TCO on a negative position.
* Enable track-wide color coding
* Add support for automation tracks
* Allow saving & loading track colors
* Allow track color to be reset to default
* Partially migrate common settings to Track.cpp, fix bug
* Completely migrate local TCO color functions to TCO class, fix bug
* Set QColorDialog colors to better colors
* Color the side of the track according to TCO colors
* Disable color gradient when muted
* Change selection color to depend on TCO color
* Fix breaking builds
* Bug fix
* Fix another bug where BB track colors wouldn't load
* Restore changed demo to original state
* Fix BB Editor bug
* Fix breaking builds
* Allow random color picking
* Fix copy-paste bug
* Change how color is painted on a track
* Cleanup, and implement per-pattern colors
* Cleanup comments
* Migrate some functions
* Remove redundant function
* Rename some functions
* Migrate duplicates to superclass
* Use ColorChooser and reorder some includes
* Change how colors are saved
* Fix some formatting
* Fix some code
* Change how clip colors work
* Fix some unexpected behaviors
* Fix note border coloring being green on colored tracks
* Change name of an option
* Remove redundant code
* Fix ghost changes
* Remove colorRgb
* Rename backgroundColor, remove some variables we don't use
* Remove a redundant variable
* Migrate some duplicates to superclass
* Check for nullpointer
* Remove redundant variable
* Update some logic
* Change how muted colors are displayed
* Change how dark muted tracks become
* Place setModified() in appropriate places
* Make getColorForDisplay() function
* Change how colors are organised and saved
* Remove m_useStyleColor
* Remove a comment
* Quick changes
* Change how colors are saved
* Remove redundant stuff
* Remove redundant stuff pt. 2
* Change how colors are copied
* Fixes pt. 3
* Fixes pt. 4
* Change spaces to tabs
* Fix pseudochanges
* Remove s_lastTCOColor
* Fix pseudochanges pt. 2
* Fix breaking builds
* Add files via upload
* Add comments (again)
All Atom ports are now being created and connected. Currently only MIDI
input ports are supplied with data.
Major contribution to #562 ("lv2 support").
Tool to glue selected notes together. Selected notes that are
adjacent to each other or overlapping are transformed into one note
stretching over the combined notes on/off times.
Key command: <Shift> + G
Partially fixes: #746 which is part of #4877
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Co-authored-by: IanCaio <iancaio_dev@hotmail.com>
Co-authored-by: Spekular <Spekularr@gmail.com>
Co-authored-by: Kevin Zander <veratil@gmail.com>
Co-authored-by: Oskar Wallgren <oskar.wallgren13@gmail.com>
* Moves mimeType from StringPairDrag to Clipboard
* Simplifies decodeKey and decodeValue methods
* Adds method to copy a string to clipboard
* Adds method to copy a string pair to the Clipboard
* Adds convenience methods to Clipboard.h to retrieve the QMimeData from the clipboard and checking whether a particular mime type format is present on it
* Uses only the TCOV copy/paste methods on the song editor
To keep consistency on the behavior of the TCOV copy and paste operations, we now only use the TCOV::copy() and TCOV::paste() methods for copying both individual and multiple TCOs.
* Removes obsolete TrackContentObject::cut() and merge copy() and paste() methods to single function TrackContentObject::copyStateTo()
* Adds Clipboard::getString method to get data for particular mime type
* Makes AutomatableModelView.cpp use the Clipboard class instead of calling Qt clipboard directly
- Extract file item preview start and end into new methods `previewFileItem` and `stopPreview`.
- Add event handlers:
- `keyPressEvent` to allow auto preview (on up/down arrow navigation), manual preview (space), and send to editors (enter)
- `keyReleaseEvent` to end previews when preview key is released
- `hideEvent` to end previews when switching sidebar tab or hiding sidebar
- Functions that operate on a `FileItem` now take it as an argument instead of using a member variable
- `getContextActions` provides menu items for sending clips to the song editor and BB editor with minimal duplicate code
- Some formatting changes in affected code
- Replace many instances of `NULL` with `nullptr`
* Automatic formatting changes
* Give clips an empty name by default, display all names
- Stop giving clips the same name as their parent track on creation
- Stop hiding clip names that match the parent track name
- Never rename clips on track rename
- Never clear clip name when a clip is copied to another track
- Create an upgrade routine to clear default names from old projects (< 1.3.0-alpha-1)
- Bump version to 1.3.0-alpha-1
* Revert now-unnecessary version bump
* Merge with master and fix conflicts
* Formatting changes from review
* Change weird for loop conditions
* Properly revert AutomationPatter.h changes
* Only clear names that match our parent track, be more generous with use of legacyFileVersion
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
... in order to make standard containers be able to store it. Required for
#5532 (#4899) and the recording PR.
This includes:
* removing the `LocklessRingBuffer<sampleFrame>` specialization
* passing samplerame in `StereoDelay::tick` as a reference
Additional cleanups:
* removing already unused typedef `sampleFrameA`
* add some `const_cast` to make code more readable
Add m_conversionFactor to the AutomatableModelView. This factor will be applied to the model->value when displaying
it in the contextmenu of the control for the reset and copy actions. The factor will be applied when copying the value to
the clipboard. When pasting from the clipboard, the value will be divided by the factor.
Remove the model->displayValue() calls when updating the reset/copy/paste action text labels as this gives e.g. in the
Equalizer the wrong action text for the Frequency knobs.
In the Fader class, remove the m_displayConversion variable but rather use the new m_conversionFactor variable.
Rewire the setDisplayConversion() function to set the m_conversionFactor to 1.0 or 100.0.
Faders in FxMixer show now the correct context menu. Copying and pasting values between faders or even volume knobs
in tracks shows consistent behavior. Other faders (like in Eq) show the old behavior.
* 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.
* Fix ProjectVersion handling of pre-releases
* Add workaround for old, non-standard version
* Attempt to fix versioning
* More consistent comments
* Apply suggestions from code review
- Set CompareType's underlying type to int and revert change to ProjectVersion::compare's parameters
- Add "None" and "All" as names elements of CompareType enum
- Preserve hyphens in prerelease identifiers
- Pad invalid (too short) versions to prevent crashes or nasty behavior
- Compare numeric identifiers to non-numeric ones correctly
- Don't interpret identifiers of form "-#" as numeric (where '#' is any number of digits)
- Add tests to ensure fixes in this commit work and won't regress in the future
* CMAKE fixes from code review
Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
* Remove unnecessary changes to CMake logic
* More const, more reference
* Apply suggestions from code review
Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
The internal waveforms of the class Oscillator produces the wrong amplitude when the input is a
negative phase. When doing PM or FM, negative phases may occur. When a negative phase is e.g. passed
to the the saw sample, it produces values less than -1.0, hence going out of range.
Converted all fraction calls to absFraction calls.
Removed the +2 in the function Oscillator::recalcPhase. The comment here was that it was needed to avoid
negative phases in case of PM. But by converting fraction to absFraction in the waveforms, negative phases
are not an issue anymore. On top of that the m_phase variable gains about 2 extra bits in precision.
As side effect of that, it improves the behaviour of the issue #2047 - TripleOscillator: Oscillators are getting out of sync.
Though I did not investigate it thoroughly over different notes and samplerates.
Add documentation to the fraction and absFraction functions in lmms_math.h as it was not immediately clear by the name what the
functions do. Correct the implementation of the functions in case the flag __INTEL_COMPILER is set. (floorf rounds always down).
* Fix for Icons and comboboxes mismatch in arpeggiator in Instrument Editor #5494
(https://github.com/LMMS/lmms/issues/5494)
Introduce a static const int variable for the default height of a ComboBox.
Set this height already in the constructor of the ComboBox object.
Update all modules setting the height of a ComboBox object to make use of the new constant.
* Replace 'const int' by 'constexpr int' after review.