Skip to content

Commit

Permalink
add access to grace notes from plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Sep 23, 2013
1 parent 4d30f4e commit f3e7de1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
9 changes: 6 additions & 3 deletions libmscore/chord.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ enum TremoloChordType { TremoloSingle, TremoloFirstNote, TremoloSecondNote };
//
// @P notes array[Note] the list of notes (read only)
// @P lyrics array[Lyrics] the list of lyrics (read only)
// @P graceNotes array[Chord] the list of grace note chords (read only)
//---------------------------------------------------------

class Chord : public ChordRest {
Expand All @@ -62,6 +63,7 @@ class Chord : public ChordRest {

Q_PROPERTY(QQmlListProperty<Ms::Note> notes READ qmlNotes)
Q_PROPERTY(QQmlListProperty<Ms::Lyrics> lyrics READ qmlLyrics)
Q_PROPERTY(QQmlListProperty<Ms::Chord> graceNotes READ qmlGraceNotes)

QList<Note*> _notes; // sorted to decreasing line step
LedgerLine* _ledgerLines; // single linked list
Expand All @@ -74,7 +76,7 @@ class Chord : public ChordRest {
Tremolo* _tremolo;
Glissando* _glissando;
ElementList _el; ///< chordline, slur
std::vector<Chord*> _graceNotes;
QList<Chord*> _graceNotes;
int _graceIndex; ///< if this is a grace note, index in parent list

MScore::Direction _stemDirection;
Expand Down Expand Up @@ -123,6 +125,7 @@ class Chord : public ChordRest {

QQmlListProperty<Ms::Note> qmlNotes() { return QQmlListProperty<Ms::Note>(this, _notes); }
QQmlListProperty<Ms::Lyrics> qmlLyrics() { return QQmlListProperty<Ms::Lyrics>(this, _lyricsList); }
QQmlListProperty<Ms::Chord> qmlGraceNotes() { return QQmlListProperty<Ms::Chord>(this, _graceNotes); }
QList<Note*>& notes() { return _notes; }
const QList<Note*>& notes() const { return _notes; }

Expand All @@ -147,8 +150,8 @@ class Chord : public ChordRest {
StemSlash* stemSlash() const { return _stemSlash; }
void setStemSlash(StemSlash* s);

const std::vector<Chord*>& graceNotes() const { return _graceNotes; }
std::vector<Chord*>& graceNotes() { return _graceNotes; }
const QList<Chord*>& graceNotes() const { return _graceNotes; }
QList<Chord*>& graceNotes() { return _graceNotes; }
int graceIndex() const { return _graceIndex; }
void setGraceIndex(int val) { _graceIndex = val; }

Expand Down
2 changes: 1 addition & 1 deletion libmscore/ledgerline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ qreal LedgerLine::measureXPos() const

void LedgerLine::layout()
{
setLineWidth(score()->styleS(ST_ledgerLineWidth));
setLineWidth(score()->styleS(ST_ledgerLineWidth) * chord()->mag());
Line::layout();
}

Expand Down
1 change: 0 additions & 1 deletion mscore/propertymenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ void ScoreView::createElementPropertyMenu(Element* e, QMenu* popup)
genPropertyMenu1(e, popup);
popup->addSeparator();
popup->addAction(tr("Harmony Properties..."))->setData("ha-props");
popup->addAction(tr("Text Properties..."))->setData("text-props");
}
else if (e->type() == Element::INSTRUMENT_NAME) {
popup->addAction(tr("Staff Properties..."))->setData("staff-props");
Expand Down

0 comments on commit f3e7de1

Please sign in to comment.