Skip to content

Commit

Permalink
Fix #184246: Add same string option in select notes
Browse files Browse the repository at this point in the history
  • Loading branch information
techiespace authored and lasconic committed Nov 19, 2017
1 parent 6c380c4 commit 41e8120
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 12 deletions.
2 changes: 2 additions & 0 deletions libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3105,6 +3105,8 @@ void Score::collectNoteMatch(void* data, Element* e)
return;
if (p->pitch != -1 && p->pitch != n->pitch())
return;
if (p->string != STRING_NONE && p->string != n->string())
return;
if (p->tpc != Tpc::TPC_INVALID && p->tpc != n->tpc())
return;
if (p->notehead != NoteHead::Group::HEAD_INVALID && p->notehead != n->headGroup())
Expand Down
1 change: 1 addition & 0 deletions libmscore/select.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ struct ElementPattern {
struct NotePattern {
QList<Note*> el;
int pitch = -1;
int string = STRING_NONE;
int tpc = Tpc::TPC_INVALID;;
NoteHead::Group notehead = NoteHead::Group::HEAD_INVALID;
TDuration duration = TDuration();
Expand Down
3 changes: 3 additions & 0 deletions mscore/selectnotedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ SelectNoteDialog::SelectNoteDialog(const Note* _n, QWidget* parent)
n = _n;
notehead->setText(NoteHead::groupToGroupName(n->headGroup()));
pitch->setText(n->tpcUserName(false));
string->setText(QString::number(n->string()+1));
type->setText(n->noteTypeUserName());
duration->setText(n->chord()->durationUserName());
name->setText(tpc2name(n->tpc(), NoteSpellingType::STANDARD, NoteCaseType::AUTO, false));
Expand All @@ -64,6 +65,8 @@ void SelectNoteDialog::setPattern(NotePattern* p)
p->notehead = n->headGroup();
if (samePitch->isChecked())
p->pitch = n->pitch();
if (sameString->isChecked())
p->string = n->string();
if (sameName->isChecked())
p->tpc = n->tpc();
if (sameType->isChecked())
Expand Down
58 changes: 46 additions & 12 deletions mscore/selectnotedialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>395</width>
<height>300</height>
<width>403</width>
<height>439</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -48,28 +48,28 @@
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<item row="7" column="1" colspan="2">
<widget class="QCheckBox" name="sameSystem">
<property name="text">
<string>Same system</string>
</property>
</widget>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="QCheckBox" name="sameVoice">
<property name="text">
<string>Same voice</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1">
<widget class="QLabel" name="duration">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QCheckBox" name="sameDuration">
<property name="text">
<string>Same duration:</string>
Expand All @@ -83,7 +83,7 @@
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="QCheckBox" name="inSelection">
<property name="text">
<string>In selection</string>
Expand All @@ -97,41 +97,55 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QCheckBox" name="sameStaff">
<property name="text">
<string>Same staff</string>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QCheckBox" name="sameType">
<property name="text">
<string>Same type:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="3" column="1">
<widget class="QLabel" name="type">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QCheckBox" name="sameName">
<property name="text">
<string>Same note name:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="QLabel" name="name">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="sameString">
<property name="text">
<string>Same string:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="string">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -216,12 +230,32 @@
<signal>accepted()</signal>
<receiver>SelectNoteDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>SelectNoteDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

0 comments on commit 41e8120

Please sign in to comment.