m_gridMode was not being initialized on the PianoRoll
constructor. For that reason the first note drag without changing the
GridMode would result in m_gridMode being used unintialized and neither
the Snap nor Nudge mode being used. Here, the result of this was a note
being moved unquantized.
This fixes it by calling changeSnapMode() after setting up the
snapModel on the constructor.
* pianoroll: nudge/snap while dragging notes
combobox for switching behavior
old behavior (nudge) is default
* snap note start or note end to nearest grid line
* fix member variable name
* change default width of pianoroll
* remove trailing white space
* use mouse position instead of m_draggednote
* Uses enum instead of text for GridMode selection
To avoid problems with translations breaking the conditional,
PianoRoll::changeSnapMode now uses the value of the ComboBox model,
casted to the GridMode enum instead of the text.
* Fixes last code style issues
A few code style issues were left, those are fixed in this
commit.
* Removes forgotten comma on enum
Since the last enum value was commented out, there's an
unnecessary comma left that was removed.
* Rewrites some of the grid logic
Separates Nudge logic and Snap logic more explicitly.
Avoids recalculation of mouse conversion to time line ticks.
Disables shift resizing for Snap mode.
Removes unnecessary range checks.
Fixes bug with note key boundary checks (which is present in master).
* Make noteOffset an int instead of TimePos
Co-authored-by: Ian Caio <iancaio_dev@hotmail.com>
* Add new note length modification tools
* "Last" instead of "latest"
* Code formatting
Co-authored-by: IanCaio <iancaio_dev@hotmail.com>
* Fix sort
* Fix incorrect cut of last note
* Fix Fill not stretching last note to end
* Fill from end positions
* Rename limitNoteLengths
* Compare with non-selected notes when filling
* Style changes by IanCaio + bugfix
* break instead of continue
Co-authored-by: IanCaio <iancaio_dev@hotmail.com>
* Initial PianoRoll razor feature
* Restore PianoRoll edit mode after focusOut and in razor mode.
* Show changes directly after cut.
* Fix hanging note after adjusting vol/pan with razor action.
* Extract the split action to a separate method
This PR addresses some suggestions from a review, the most
important ones being:
- Extracting the note split action to a separate method, called
Pattern::splitNotes
- Removing getMouseTickPos method
- Adding a variable that holds the current razor position and a
method to update it (quantizing if CTRL is not pressed)
- Using [this] to capture "this" on the lambda function instead
of [=], since the latter doesn't work as intended from C++20 forward
- Fixing some code style and adding comments
* Removes an extra call to noteUnderMouse
By removing "&& noteUnderMouse()" from the mousePressEvent
conditional, we avoid an extra call to noteUnderMouse. The only
difference in the behavior of the tool is that now clicking on a place
that doesn't have a note will exit Razor mode.
* Style change suggested by @russiankumar
* Cancel razor action on SHIFT release.
* Make razor cut-line (color) themable.
* Add razor cut-line color to classic theme style.css
* Rename razor to knife.
* Change pixmap from razor to knife (from https://github.com/LMMS/lmms/pull/5524)
* Remove SHIFT behavior.
* Change knife shortcut to SHIFT+K
Co-authored-by: CYBERDEViL <cyberdevil@notabug.org>
Co-authored-by: Ian Caio <iancaio_dev@hotmail.com>
FE_UNDERFLOW gives a fair amount of hits with LMMS but is of lower
importance than the other tests and slows down debugging considerably.
Commenting out for the time being.
* Automatic formatting changes
* Add copy constructor and assignemnt to SampleBuffer
* Add copy constructor to SampleTCO
* Delete SampleTCO copy assignment, initial work on SampleBuffer swap method
* SampleBuffer: Finish(?) swap and use it for copy assignment, lock for read in copy constructor
* Don't forget to unlock in copy assignment!
* Formatting changes
* Lock ordering in swap
* Fix leak and constness
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
* Fix multiplication style, ensure lock is held when necessary
... by switching from an initializer list to manual assignments.
* Fixes from review
* Avoid more undefined behavior
* Update src/tracks/SampleTrack.cpp
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
* Fixes bug with pasting of TCOs (#5840)
TimePos::quantize works for negative values, but ends
up snapping the TCO to the opposite direction. This is because the
snapping happens in the direction of the origin, which is left for
positive values and right for negative values.
That wasn't accounted for in the pasteSelection method
and we ended up with wrong positions when pasting before the
TCO(s) we copied.
This PR fixes the issue by ensuring that we snap in the same direction when halfway through an interval, regardless of negative or positive offset.
* Fixes a calculation on TimePos::quantize
Since we are working with integers, using "offset /
(interval/2)" would be problematic if interval was odd. We instead
multiply both sides by two and use "(2 * offset) / interval" to obtain
the result for snapUp.
Implement `LV2_OPTIONS__options` feature and some buf-size properties.
The code currently assumes that the LMMS buffersize never changes, which
is currently true in the LMMS code base.
* 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).
As requested, this PR extracts the bug fix from #5971. More
details about the bug on the mentioned PR page, but basically the
variable sf_rr was declared with the wrong type causing the conditional
that checks for errors on the loading to return true even when there
were no errors (only noticeable with DEBUG builds).
This renames the variable and uses the correct type.