Feature: PianoRoll Knife (#5845)

* 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>
This commit is contained in:
cyber-bridge
2021-02-26 12:47:16 +01:00
committed by GitHub
parent 1534e90a39
commit 05de59c085
8 changed files with 204 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

View File

@@ -155,6 +155,7 @@ PianoRoll {
qproperty-ghostNoteBorders: true;
qproperty-barColor: #4afd85;
qproperty-markedSemitoneColor: rgba( 0, 255, 200, 60 );
qproperty-knifeCutLine: rgba(255, 0, 0, 255);
/* Piano keys */
qproperty-whiteKeyWidth: 64;
qproperty-whiteKeyActiveTextColor: #000;

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

View File

@@ -187,6 +187,7 @@ PianoRoll {
qproperty-ghostNoteBorders: false;
qproperty-barColor: #078f3a;
qproperty-markedSemitoneColor: rgba(255, 255, 255, 30);
qproperty-knifeCutLine: rgba(255, 0, 0, 255);
/* Piano keys */
qproperty-whiteKeyWidth: 64;
qproperty-whiteKeyActiveTextColor: #000;