Commit graph

554 commits

Author SHA1 Message Date
pereverzev_v
3f130f69fe Removed unused method from Note class 2020-06-01 11:57:31 +02:00
pereverzev_v
e3bc8f8790 Added the separate method for the updating note head group 2020-06-01 11:57:31 +02:00
pereverzev_v
c9183efd12 Added to elements the way to get their representative "base" element, like a chord for the note 2020-06-01 11:57:31 +02:00
Igor Korsukov
b6dabf5e0b fixed ctor colon 2020-05-29 21:15:25 +02:00
Igor Korsukov
45b9887603 changed code style 2020-05-28 09:50:45 +02:00
Unknown
be8a618b88 fix #278988 Copy and paste notes in Piano Roll Editor
Can now copy and paste notes in piano roll editor using the right click menu.

Allowing cut and paste of nodes in piano roll editor.


Allowing cut and paste of nodes in piano roll editor.


Cleaning code.

Using Fraction::fromTicks to convert ticks.

Changing variable names.

Updating cut/paste to use Fraction

Adding cut shortcut.

Undo now reverts all notes from paste.

Cleaning up code

Refactoring method

Fixing rebase

Making PRE child of main window.

Can now drag notes in PRE

Fixing layout of PRE levels window

Now showing note blocks when dragging.

Can now drag notes with relative offset

Escape will now cancel drag

Fixing rebase

Removing code that accidentally undid PR #6006

Fixing text, can now set voices of selected notes.
2020-04-29 09:55:44 -04:00
Dmitri Ovodok
ad6c8581d7 Restructure drag-related variables to have them defined more clearly
Also restore an ability to use Ctrl or Shift for horizontal/vertical drag of lines
2020-04-17 00:05:38 +03:00
Matt McClinch
4c0db9b19b fix #294542: Allow setting notehead scheme on a note-by-note basis in the Inspector
Resolves: https://musescore.org/en/node/294542.

Up until now, notehead scheme has only been a StaffType property. If a Note is going to have its own notehead scheme, it seems fitting to do a bit of reorganization. Here is a summary of the changes made:
- Moved enum class NoteHeadScheme to NoteHead::Scheme, alongside NoteHead::Group and NoteHead::Type.
- Added HEAD_AUTO as a possible value for NoteHead::Scheme.
- Moved scheme2userName(), scheme2name(), and name2scheme() from class StaffType to class NoteHead.
- Renamed Pid::STAFF_NOTEHEAD_SCHEME to Pid::HEAD_SCHEME. This change is reflected in the Plugin API, with Element property staffNoteheadScheme being renamed to headScheme. This should not break too many existing plugins, because the NoteHeadScheme enum values have never been exposed until now. Speaking of which,
- Exposed the NoteHead::Scheme enum values to the Plugin API as NoteHeadScheme.HEAD_AUTO, etc. And finally, (and the main point of all of this):
- Added a property of type NoteHead::Scheme to class Note, and exposed it via the Inspector. If set to HEAD_AUTO (the default), the StaffType’s noteHeadScheme will be used. Otherwise, this will override the StaffType’s noteHeadScheme.
2020-04-14 10:26:09 -04:00
anatoly-os
96c03195e3
Merge pull request #5745 from dmitrio95/layout-opt
Layout optimizations
2020-04-09 17:39:23 +03:00
Igor Korsukov
33675a8fa6 try fix crash on Note::drag 2020-03-21 12:49:14 +02:00
Dmitri Ovodok
5f975282f2
Merge pull request #5838 from igorkorsukov/pvs_fixeds_step1
Fixed some issues from PVS-Studio report (step1)
2020-03-20 14:10:12 +02:00
Igor Korsukov
68b3415c47 fixed some issues from PVS-Studio report (step1) 2020-03-20 12:18:07 +02:00
Igor Korsukov
cf73e02022 try fixed crash on Note::endDrag 2020-03-20 11:48:52 +02:00
Joachim Schmitz
b1ab9574cc Use C++ casts 2020-03-03 15:49:37 +01:00
Matt McClinch
58d603b499 fix #290987: B# and Cb octave change
Resolves: https://musescore.org/en/node/290987.

Make sure that B#, B##, Cb, and Cbb describe themselves as being in the correct octave. This is accomplished by calculating the octave based on what the pitch would be if there were no accidental. Thus, there is no need to special-case certain tpcs.
2020-03-03 01:10:40 -05:00
Dmitri Ovodok
43573a9edd
Merge pull request #5741 from mattmcclinch/301414-paste-tie
fix #301414: Corrupt tie created on paste of tied note that requires additional tie
2020-02-27 14:54:48 +02:00
Matt McClinch
7e185d280e fix #301605: Undoing slur addition to a range only removes one slur
Resolves: https://musescore.org/en/node/301605.

Prior to this commit, ScoreView::cmdAddSlur() could be called multiple times from within ScoreView::addSlur(), resulting in the need for multiple "undo" commands to completely undo a single "add-slur" command. This commit swaps the names of these two functions, and, more importantly, only calls Score::startCmd() and Score::endCmd() once for the entire operation.
2020-02-25 11:08:45 -05:00
Dmitri Ovodok
86abf57d45 Avoid redundant Element::staff() calls 2020-02-21 22:27:47 +02:00
Dmitri Ovodok
dc4c3040a0 Optimize segment tick calculation when searching for staff type 2020-02-21 22:27:43 +02:00
Matt McClinch
2341f8192b fix #301414: Corrupt tie created on paste of tied note that requires additional tie
Resolves: https://musescore.org/en/node/301414.

During paste, if a note has a tie, that tie is remembered as a pending connector which is later added to the score when XmlReader::checkConnectors() is called. If a note is too long to fit in the measure, it is split up into a series of tied notes, but the pending tie needs to be adjusted to begin at the last tied note in the series, instead of at the original note.
2020-02-21 13:15:06 -05:00
Dmitri Ovodok
6631fee136
Merge pull request #5718 from Howard-C/cross-staff-offset
fix #284682: position offset when moving cross-beam notes with the mouse
2020-02-20 13:45:21 +02:00
Niek van den Berg
66be5a18fa fix #293593 - Issues with ottavas
Corrects first problem: Status doesn't display the pitch of note that have an
ottave line. This is solved in Note::tpcUserName().

Solves the second problem in issue 293593: Accidentals do apply if 8va sign is added.
This is solved in Note::updateAccidental(). All calculations are based on the
effective pitch of the a note rather than the actual pitch. The solution now
takes to ottava signs into account by using the actual pitch.

For easily find out wheather an ottava is applied, a new method ottavaCapoFret()
is added which returns the pitch offset by an ottava (or capo fret). To prevent
code dublication, ppitch() also use this new ottavaCapoFret() method.
2020-02-18 11:44:04 +01:00
Howard-C
cd342246f6 fix #284682: position offset when moving cross-beam notes with the mouse
The staff index did not count `staffMove()` in, which resulted in possibly getting the wrong clef for `line2pitch()`. This commit uses `chord->vStaffIdx()` to get the right staff index.
2020-02-15 20:23:43 +08:00
James Thistlewood
48693311d4 fix #300635: crash when dropping symbol on text that had just been moved
This happened because the acceptDrop check wasn't checking that the
editData it had for the text element was TextEditData. So, if the text
had been moved before, then it would have ElementEditData, and
acceptDrop would incorrectly return true.

This fixes the problem by adding a type() method to ElementEditData and
its derived classes so a proper check can be carried out in acceptDrop.
2020-02-09 09:25:11 +00:00
Howard-C
d7d0465b03 code formatting (for single-click implementation) 2019-12-26 00:24:52 +08:00
Dmitri Ovodok
1dd409d417
Merge pull request #5341 from mattmcclinch/279179-accidental-state
fix #279179, fix #293984: Natural-sharp/natural-flat not recognized as same accidental as sharp/flat
2019-12-25 12:08:03 +02:00
pereverzev_v
bc8d6ffcd1 Adjusted code formatting for NoteEditData and recovered note direction angle limit to origin 15 degrees 2019-12-24 14:20:36 +02:00
pereverzev_v
e1073c5c98 Added boundaries for the left-side note dragging 2019-12-24 14:20:36 +02:00
pereverzev_v
6318b490e2 Synchronized position of the cursor to note position while dragging 2019-12-24 14:20:36 +02:00
pereverzev_v
e0c9e8d353 Adjusted note drag direction recognition 2019-12-24 14:20:36 +02:00
pereverzev_v
767fcae3b1 Allowed to drag note in both directions at normal mode accordingly to angle 2019-12-24 14:20:35 +02:00
Dmitri Ovodok
2f443cf898 Fix inability to horizontally move hairpin with its middle or left handle with mouse 2019-12-24 14:16:06 +02:00
luz.paz
f31624d746 fix various typos
* Found via `codespell -q 3 -S ./share/locale,./thirdparty -L ba,cann,clas,dur,foto,iff,nd,ois,ot,pres,possibile,snaped,strack,tage,te,uint,thru,valu`  
* Some revisions made per feedback given during review.
* Follow-up typos for review  
* Add revisions per feedback
2019-12-19 06:13:30 -05:00
Matt McClinch
f6998a40e3 fix #297957: Ties extended in region after time signature change
Resolves: https://musescore.org/en/node/297957.

When searching for a note to complete a tie, what matters is not so much that the note doesn't already have a tieBack(), but rather that the two notes have the same unisonIndex().
2019-12-01 22:45:48 -05:00
Dmitri Ovodok
62412f2650
Merge pull request #5492 from dmitrio95/palettes-fixes
Miscellaneous visual and UX fixes
2019-11-25 11:41:53 +02:00
Git-Lior
d6a27f86a3 fix #297514: Cannot copy and paste stickings
when handling paste, a switch statement is used on dropElement.type() (result is of type ElementType). Before this commit, there was no case for ElementType::STICKING, and paste wouldn't work (default behavior).
2019-11-23 17:30:22 +02:00
Dmitri Ovodok
85eb26a5eb Warn for note being out of instrument range if note is selected 2019-11-23 13:19:54 +02:00
Dmitri Ovodok
ba07089407 fix #296915: honor slur properties when adding slur from a palette 2019-11-22 16:16:59 +02:00
Dmitri Ovodok
6638eaf980
Merge pull request #5275 from mattmcclinch/293459-tied-unisons
fix #293459: Tie command does not properly handle chords with unisons
2019-11-18 11:48:19 +02:00
Dmitri Ovodok
99c7b0d746 Add more information to setLayout() 2019-10-25 16:18:41 +02:00
Marc Sabatella
68a3791c47 fix #295107: hang or crash on fingering mode after last note
There turned out to be several aspects to this.
In 3.2.3, we could get a hang if there was literally only one note,
as the navigation would loop back around and we didn't always catch it.
For 3.3 I eliminated the looping back around on navigation,
but neglected to add a check for start/end of score in "fingering mode".
This adds that check (in ScoreView::textTab(), the test for el2 == el).
But further testing revealed further checks we need to make to be safe.
The checks that the current element is actually a child of the note
in Note::nextInEl() and Note::prevInEl() prevents a crash
if one navigates before the fingering has been added to its parent
or after it has been removed (which happens with empty fingering elements).
For consistency with how chord symbols work, and to circumvent other future problems,
I elected to have Space *exit* "fingering mode" after reaching the end of the score.
This required making a reasonable selection (the "exit cleanly" code in textTab)
but also calling mscore->endCmd() and returning immediately in events.cpp in that case.
This had the side benefit of allowing me to remove the updateInspector() call
in textTab(), as it is covered by the endCmd() call.
I should note there are other code paths in, for example, the harmony tab functions,
that can leave an empty / deleted element still selected
when hitting space upon reaching the last note of a score.
But I could cause an actual problem to occur and chose to not deal with that here.

Script test added to cover the basic issue here.
2019-10-01 11:42:46 -06:00
Dmitri Ovodok
9a45615065
Merge pull request #5311 from MarcSabatella/239186-accessible-tab
fix #239186: read string/fret info for tablature
2019-10-01 15:11:49 +02:00
Marc Sabatella
2d844d6c7d fix #293318: crash on paste of note onto grace note
Paste of a note onto a grace note has never worked;
the operation has always been silently rejected.
Now, however, it crashes, because we are attempting to select the note
we think we just pasted.
But there was no reason to reject the operation;
the same code that handles pasting onto a normal note
also works when pasting onto a grace note.
So this change removes the unnecessary check for grace notes.
By removing these four lines of code, it fixes the crash,
and allow the operation to actually succeed where it never did before.
2019-09-25 13:41:48 -06:00
Matt McClinch
bd5218f8b6 fix #279179, fix #293984: Natural-sharp/natural-flat not recognized as same accidental as sharp/flat
Resolves: https://musescore.org/en/node/279179.
Also resolves: https://musescore.org/en/node/293984, which is really the same issue.

NATURAL_SHARP and NATURAL_FLAT are handled in the same way as microtonal accidentals, but unlike microtonal accidentals, NATURAL_SHARP and NATURAL_FLAT affect the playback pitch of the note. Therefore, when these accidentals are encountered, it is incorrect to set the accidental state to NATURAL. Instead, it must be set to the AccidentalValue that corresponds to the accidental's subtype.
2019-09-23 10:09:03 -04:00
Marc Sabatella
5eccc30d1a fix #294237: optimize reading of extra information for notes and rests
In the original implementation of accessibility,
we had the screenreader always read all extra information associated with a chord
(including articulations, lyrics, staff text, etc)
every time a note in that chord was selected.
This was necessary becayse we had no no way at the time to reach those elements individually.
Now that the next/previous element commands can access those elements directly,
we no longer need to read them on selection of the note.
And yet, reading this information on ordinary navigation (left/right) is not without value.
So this change simply limits the reading of the extra info to the top note of a chord,
and even then also checks voices for segment annotations.
The result is, when navigating, you'll hear the extra information read
when the chord is first hit, because we navigate chords top to bottom,
ut will not hear the extra information repeated for each subsequent note in the chord.
Beat information continues to be read always.
2019-09-17 13:35:09 +02:00
Marc Sabatella
af1fa43758 fix #293300: optimize screenreader feedback for notes and rests
Added code to track the staff & bar number when constructing accessibility text.
If we detect that a navigation has not changed either, we skip reading it,
by constructing a separation "optimized" version of the appropriate text.
Also skip reading voice for measures that have only a single voice,
by suppressing the buiding of that string in screenReaderInfo() for both Note and Rest.
2019-09-17 13:33:35 +02:00
Matt McClinch
682e5b7742 fix #293459: Tie command does not properly handle chords with unisons 2019-09-11 14:04:37 -04:00
Marc Sabatella
e36e8d620c fix #239186: read string/fret info for tablature
The status line and screenreader info do not currently include string or fret info for tab.
This was requested, and seems logical and easy to do, so this commit adds the support
by incorporating the info into the return value of Note::accessibleInfo()
and Note::screenreaderInfo().

This adds addition translation strings for string and fret,
which could be a consideration in the timing for this.
It is not as high a priority for me as my other main accessibility.
2019-09-08 10:22:07 -06:00
anatoly-os
b101167b80
Merge pull request #5210 from MarcSabatella/290047-adjust-segment
fix #290047: require Shift to adjust segment with cursor keys in edit…
2019-08-19 17:35:15 +02:00
anatoly-os
058bb2c657 code cleanup for accessibility changes in PR5221
Partially cherrypicked 38baf32dd5
2019-08-17 10:51:56 +02:00