Skip to content

Commit

Permalink
Fix #100396: change "note heads" to "noteheads"
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacWeiss authored and lasconic committed May 6, 2016
1 parent b0dfce9 commit 74ac75b
Show file tree
Hide file tree
Showing 25 changed files with 59 additions and 59 deletions.
26 changes: 13 additions & 13 deletions libmscore/ambitus.cpp
Expand Up @@ -32,7 +32,7 @@ static const qreal LINEWIDTH_DEFAULT = 0.12;
#if 0 // yet(?) unused
static const qreal LEDGEROFFSET_DEFAULT = 0.25;
#endif
static const qreal LINEOFFSET_DEFAULT = 0.8; // the distance between note head and line
static const qreal LINEOFFSET_DEFAULT = 0.8; // the distance between notehead and line

//---------------------------------------------------------
// Ambitus
Expand Down Expand Up @@ -265,7 +265,7 @@ void Ambitus::layout()
}

//
// NOTE HEADS Y POS
// NOTEHEADS Y POS
//
// if pitch == INVALID_PITCH oor tpc == INALID_TPC, set to some default:
// for use in palettes and when actual range cannot be calculated (new ambitus or no notes in staff)
Expand All @@ -277,7 +277,7 @@ void Ambitus::layout()
else
key = Key::C;

// top note head
// top notehead
if (_topPitch == INVALID_PITCH || _topTpc == Tpc::TPC_INVALID)
_topPos.setY(0); // if uninitialized, set to top staff line
else {
Expand All @@ -303,7 +303,7 @@ void Ambitus::layout()
_topAccid.rypos() = _topPos.y();
}

// bottom note head
// bottom notehead
if (_bottomPitch == INVALID_PITCH || _bottomTpc == Tpc::TPC_INVALID)
_bottomPos.setY( (numOfLines-1) * lineDist); // if uninitialized, set to last staff line
else {
Expand All @@ -329,7 +329,7 @@ void Ambitus::layout()
}

//
// NOTE HEAD X POS
// NOTEHEAD X POS
//
// Note: manages colliding accidentals
//
Expand All @@ -353,23 +353,23 @@ void Ambitus::layout()
}

switch (_dir) {
case MScore::DirectionH::AUTO: // note heads one above the other
// left align note heads and right align accidentals 'hanging' on the left
case MScore::DirectionH::AUTO: // noteheads one above the other
// left align noteheads and right align accidentals 'hanging' on the left
_topPos.setX(0.0);
_bottomPos.setX(0.0);
_topAccid.rxpos() = - xAccidOffTop;
_bottomAccid.rxpos() = - xAccidOffBottom;
break;
case MScore::DirectionH::LEFT: // top note head at the left of bottom note head
// place top note head at left margin; bottom note head at right of top head;
case MScore::DirectionH::LEFT: // top notehead at the left of bottom notehead
// place top notehead at left margin; bottom notehead at right of top head;
// top accid. 'hanging' on left of top head and bottom accid. 'hanging' at left of bottom head
_topPos.setX(0.0);
_bottomPos.setX(headWdt);
_topAccid.rxpos() = - xAccidOffTop;
_bottomAccid.rxpos() = collision ? - xAccidOffBottom : headWdt - xAccidOffBottom;
break;
case MScore::DirectionH::RIGHT: // top note head at the right of bottom note head
// bottom note head at left margin; top note head at right of bottomnote head
case MScore::DirectionH::RIGHT: // top notehead at the right of bottom notehead
// bottom notehead at left margin; top notehead at right of bottomnotehead
// top accid. 'hanging' on left of top head and bottom accid. 'hanging' at left of bottom head
_bottomPos.setX(0.0);
_topPos.setX(headWdt);
Expand Down Expand Up @@ -480,7 +480,7 @@ SymId Ambitus::noteHead() const

SymId t = Note::noteHead(hg, _noteHeadGroup, ht);
if (t == SymId::noSym) {
qDebug("invalid note head %hhd/%hhd", _noteHeadGroup, _noteHeadType);
qDebug("invalid notehead %d/%d", int(_noteHeadGroup), int(_noteHeadType));
t = Note::noteHead(0, NoteHead::Group::HEAD_NORMAL, ht);
}
return t;
Expand All @@ -489,7 +489,7 @@ SymId Ambitus::noteHead() const
//---------------------------------------------------------
// headWidth
//
// returns the width of the note head symbol
// returns the width of the notehead symbol
//---------------------------------------------------------

qreal Ambitus::headWidth() const
Expand Down
4 changes: 2 additions & 2 deletions libmscore/chord.cpp
Expand Up @@ -672,7 +672,7 @@ void Chord::addLedgerLines(int move)
int minLine, maxLine;
bool visible = false;
qreal x;
// the extra length of a ledger line with respect to note head (half of it on each side)
// the extra length of a ledger line with respect to notehead (half of it on each side)
qreal extraLen = score()->styleS(StyleIdx::ledgerLineLength).val() * _spatium * 0.5;

// scan chord notes, collecting visibility and x and y extrema
Expand Down Expand Up @@ -2661,7 +2661,7 @@ QPointF Chord::layoutArticulation(Articulation* a)

ArticulationType st = a->articulationType();

// TENUTO and STACCATO: always near the note head (or stem end if beyond a stem)
// TENUTO and STACCATO: always near the notehead (or stem end if beyond a stem)
if ((st == ArticulationType::Tenuto || st == ArticulationType::Staccato || st == ArticulationType::Sforzatoaccent) && (aa != ArticulationAnchor::TOP_STAFF && aa != ArticulationAnchor::BOTTOM_STAFF)) {
bool bottom; // true: artic. is below chord | false: artic. is above chord
bool alignToStem = false;
Expand Down
2 changes: 1 addition & 1 deletion libmscore/drumset.h
Expand Up @@ -42,7 +42,7 @@ static const int DRUM_INSTRUMENTS = 128;

//---------------------------------------------------------
// Drumset
// defines note heads and line position for all
// defines noteheads and line position for all
// possible midi notes in a drumset
//---------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion libmscore/dynamic.cpp
Expand Up @@ -265,7 +265,7 @@ void Dynamic::layout()
if (c->stem() && !c->up()) // stem down
rxpos() += noteHeadWidth * .25; // center on stem + optical correction
else
rxpos() += noteHeadWidth * .5; // center on note head
rxpos() += noteHeadWidth * .5; // center on notehead
}
else
rxpos() += c->width() * .5;
Expand Down
2 changes: 1 addition & 1 deletion libmscore/element.cpp
Expand Up @@ -148,7 +148,7 @@ static const ElementName elementNames[] = {
ElementName("Spacer", QT_TRANSLATE_NOOP("elementName", "Spacer")),
ElementName("StaffState", QT_TRANSLATE_NOOP("elementName", "Staff State")),
ElementName("LedgerLine", QT_TRANSLATE_NOOP("elementName", "Ledger Line")),
ElementName("NoteHead", QT_TRANSLATE_NOOP("elementName", "Note Head")),
ElementName("NoteHead", QT_TRANSLATE_NOOP("elementName", "Notehead")),
ElementName("NoteDot", QT_TRANSLATE_NOOP("elementName", "Note Dot")),
ElementName("Tremolo", QT_TRANSLATE_NOOP("elementName", "Tremolo")),
ElementName("Measure", QT_TRANSLATE_NOOP("elementName", "Measure")),
Expand Down
8 changes: 4 additions & 4 deletions libmscore/glissando.cpp
Expand Up @@ -259,10 +259,10 @@ void Glissando::layout()
// initial point: ipos() (relative to system origin)
// ending point: pos2() (relative to initial point)

// LINE ENDING POINTS TO NOTE HEAD CENTRES
// LINE ENDING POINTS TO NOTEHEAD CENTRES

// assume gliss. line goes from centre of initial note centre to centre of ending note:
// move first segment origin and last segment ending point from note head origin to note head centre
// move first segment origin and last segment ending point from notehead origin to notehead centre
QPointF offs1 = QPointF(anchor1->headWidth() * 0.5, 0.0);
QPointF offs2 = QPointF(anchor2->headWidth() * 0.5, 0.0);

Expand Down Expand Up @@ -332,12 +332,12 @@ void Glissando::layout()

// STAY CLEAR OF NOTE APPENDAGES

// initial note dots / ledger line / note head
// initial note dots / ledger line / notehead
offs1 *= -1.0; // discount changes already applied
int dots = cr1->dots();
LedgerLine * ledLin = cr1->ledgerLines();
// if dots, start at right of last dot
// if no dots, from right of ledger line, if any; from right of note head, if no ledger line
// if no dots, from right of ledger line, if any; from right of notehead, if no ledger line
offs1.rx() += (dots && anchor1->dot(dots-1) ? anchor1->dot(dots-1)->pos().x() + anchor1->dot(dots-1)->width()
: (ledLin ? ledLin->pos().x() + ledLin->width() : anchor1->headWidth()) );

Expand Down
10 changes: 5 additions & 5 deletions libmscore/layout.cpp
Expand Up @@ -553,13 +553,13 @@ qreal Score::layoutChords2(QList<Note*>& notes, bool up)
incIdx = -1;
}

int ll = 1000; // line of previous note head
int ll = 1000; // line of previous notehead
// hack: start high so first note won't show as conflict
bool lvisible = false; // was last note visible?
bool mirror = false; // should current note head be mirrored?
bool mirror = false; // should current notehead be mirrored?
// value is retained and may be used on next iteration
// to track mirror status of previous note
bool isLeft = notes[startIdx]->chord()->up(); // is note head on left?
bool isLeft = notes[startIdx]->chord()->up(); // is notehead on left?
int lmove = notes[startIdx]->chord()->staffMove(); // staff offset of last note (for cross-staff beaming)

for (int idx = startIdx; idx != endIdx; idx += incIdx) {
Expand Down Expand Up @@ -587,7 +587,7 @@ qreal Score::layoutChords2(QList<Note*>& notes, bool up)
bool nmirror = (chord->up() != isLeft);

// by default, notes and dots are not hidden
// this may be changed later to allow unisons to share note heads
// this may be changed later to allow unisons to share noteheads
note->setHidden(false);
note->setDotsHidden(false);

Expand Down Expand Up @@ -781,7 +781,7 @@ void Score::layoutChords3(QList<Note*>& notes, Staff* staff, Segment* segment)
qreal stepDistance = sp * .5;
int stepOffset = staff->staffType()->stepOffset();

qreal lx = 10000.0; // leftmost note head position
qreal lx = 10000.0; // leftmost notehead position
qreal upDotPosX = 0.0;
qreal downDotPosX = 0.0;

Expand Down
2 changes: 1 addition & 1 deletion libmscore/line.cpp
Expand Up @@ -541,7 +541,7 @@ QPointF SLine::linePos(Grip grip, System** sys) const
if (grip == Grip::START) {
cr = static_cast<ChordRest*>(startElement());
if (cr && type() == Element::Type::OTTAVA) {
// some sources say to center the text over the note head
// some sources say to center the text over the notehead
// others say to start the text just to left of notehead
// some say to include accidental, others don't
// our compromise - left align, but account for accidental
Expand Down
12 changes: 6 additions & 6 deletions libmscore/note.cpp
Expand Up @@ -60,7 +60,7 @@ namespace Ms {

//---------------------------------------------------------
// noteHeads
// note head groups
// notehead groups
//---------------------------------------------------------

static const SymId noteHeads[2][int(NoteHead::Group::HEAD_GROUPS)][int(NoteHead::Type::HEAD_TYPES)] = {
Expand Down Expand Up @@ -448,7 +448,7 @@ SymId Note::noteHead() const

SymId t = noteHead(up, _headGroup, ht);
if (t == SymId::noSym) {
qDebug("invalid note head %hhd/%hhd", _headGroup, ht);
qDebug("invalid notehead %d/%d", int(_headGroup), int(ht));
t = noteHead(up, NoteHead::Group::HEAD_NORMAL, ht);
}
return t;
Expand All @@ -457,7 +457,7 @@ SymId Note::noteHead() const
//---------------------------------------------------------
// headWidth
//
// returns the width of the note head symbol
// returns the width of the notehead symbol
// or the width of the string representation of the fret mark
//---------------------------------------------------------

Expand Down Expand Up @@ -494,7 +494,7 @@ qreal Note::tabHeadWidth(StaffType* tab) const
//---------------------------------------------------------
// headHeight
//
// returns the height of the note head symbol
// returns the height of the notehead symbol
// or the height of the string representation of the fret mark
//---------------------------------------------------------

Expand Down Expand Up @@ -746,7 +746,7 @@ void Note::draw(QPainter* painter) const
return;
//
// warn if pitch extends usable range of instrument
// by coloring the note head
// by coloring the notehead
//
if (chord() && chord()->segment() && staff() && !selected()
&& !score()->printing() && MScore::warnPitchRange) {
Expand Down Expand Up @@ -1407,7 +1407,7 @@ Element* Note::drop(const DropData& data)
NoteHead* s = static_cast<NoteHead*>(e);
NoteHead::Group group = s->headGroup();
if (group == NoteHead::Group::HEAD_INVALID) {
qDebug("unknown note head");
qDebug("unknown notehead");
group = NoteHead::Group::HEAD_NORMAL;
}
delete s;
Expand Down
6 changes: 3 additions & 3 deletions libmscore/note.h
Expand Up @@ -119,18 +119,18 @@ struct NoteVal {
// @P accidentalType int note accidental type
// @P dots array[NoteDot] list of note dots (some can be null, read only)
// @P dotsCount int number of note dots (read only)
// @P elements array[Element] list of elements attached to note head
// @P elements array[Element] list of elements attached to notehead
// @P fret int fret number in tablature
// @P ghost bool ghost note (guitar: death note)
// @P headGroup enum (NoteHead.HEAD_NORMAL, .HEAD_BREVIS_ALT, .HEAD_CROSS, .HEAD_DIAMOND, .HEAD_DO, .HEAD_FA, .HEAD_LA, .HEAD_MI, .HEAD_RE, .HEAD_SLASH, .HEAD_SOL, .HEAD_TI, .HEAD_XCIRCLE, .HEAD_TRIANGLE)
// @P headType enum (NoteHead.HEAD_AUTO, .HEAD_BREVIS, .HEAD_HALF, .HEAD_QUARTER, .HEAD_WHOLE)
// @P hidden bool hidden, not played note (read only)
// @P line int notehead position (read only)
// @P mirror bool mirror note head on x axis (read only)
// @P mirror bool mirror notehead on x axis (read only)
// @P pitch int midi pitch
// @P play bool play note
// @P ppitch int actual played midi pitch (honoring ottavas) (read only)
// @P small bool small note head
// @P small bool small notehead
// @P string int string number in tablature
// @P subchannel int midi subchannel (for midi articulation) (read only)
// @P tieBack Tie note backward tie (null if none, read only)
Expand Down
2 changes: 1 addition & 1 deletion libmscore/score.cpp
Expand Up @@ -3008,7 +3008,7 @@ void Score::collectMatch(void* data, Element* e)

if (p->subtypeValid) {
// HACK: grace note is different from normal note
// TODO: this disables the ability to distinguish note heads in subtype
// TODO: this disables the ability to distinguish noteheads in subtype

if (p->type == int(Element::Type::NOTE)) {
if (p->subtype != static_cast<Note*>(e)->chord()->isGrace())
Expand Down
8 changes: 4 additions & 4 deletions libmscore/slur.cpp
Expand Up @@ -885,9 +885,9 @@ void Slur::slurPos(SlurPos* sp)
// place slur starting point at stem base point
pt = sc->stemPos() - sc->pagePos() + sc->stem()->p2();
if (useTablature) // in tabs, stems are centred on note:
pt.rx() = hw1 * 0.5; // skip half note head to touch stem
pt.rx() = hw1 * 0.5; // skip half notehead to touch stem
sp->p1 += pt;
sp->p1 += QPointF(0.35 * _spatium, 0.25 * _spatium); // clear the stem (x) and the note head (y)
sp->p1 += QPointF(0.35 * _spatium, 0.25 * _spatium); // clear the stem (x) and the notehead (y)
break;
case SlurAnchor::NONE:
break;
Expand All @@ -906,8 +906,8 @@ void Slur::slurPos(SlurPos* sp)

//
// default position:
// horizontal: middle of note head
// vertical: _spatium * .4 above/below note head
// horizontal: middle of notehead
// vertical: _spatium * .4 above/below notehead
//
//------p1
// Compute x0, y0 and stemPos
Expand Down
2 changes: 1 addition & 1 deletion libmscore/stem.h
Expand Up @@ -29,7 +29,7 @@ class Chord;
class Stem : public Element {
Q_OBJECT

QLineF line; // p1 is attached to note head
QLineF line; // p1 is attached to notehead
qreal _userLen;
qreal _len; // allways positive

Expand Down

0 comments on commit 74ac75b

Please sign in to comment.