Skip to content

Commit 2d7ebfd

Browse files
committed
Rename paren -> parenthesis
1 parent 7447017 commit 2d7ebfd

File tree

15 files changed

+94
-94
lines changed

15 files changed

+94
-94
lines changed

src/engraving/dom/chord.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ Chord::Chord(const Chord& c, bool link)
395395
}
396396
}
397397

398-
if (!c.noteParens().empty()) {
399-
for (const NoteParenthesisInfo* info : c.noteParens()) {
398+
if (!c.noteParentheses().empty()) {
399+
for (const NoteParenthesisInfo* info : c.noteParentheses()) {
400400
Parenthesis* newLeftParen = toParenthesis(info->leftParen()->clone());
401401
newLeftParen->setParent(this);
402402
Parenthesis* newRightParen = toParenthesis(info->rightParen()->clone());
@@ -1323,7 +1323,7 @@ void Chord::scanElements(std::function<void(EngravingItem*)> func)
13231323
ChordRest::scanElements(func);
13241324
}
13251325

1326-
NoteParenthesisInfo* Chord::findNoteParenInfo(const Parenthesis* paren)
1326+
NoteParenthesisInfo* Chord::findNoteParenthesisInfo(const Parenthesis* paren)
13271327
{
13281328
for (NoteParenthesisInfo* infoPtr : m_noteParens) {
13291329
if (paren == infoPtr->leftParen() || paren == infoPtr->rightParen()) {
@@ -1334,7 +1334,7 @@ NoteParenthesisInfo* Chord::findNoteParenInfo(const Parenthesis* paren)
13341334
return nullptr;
13351335
}
13361336

1337-
const NoteParenthesisInfo* Chord::findNoteParenInfo(const Note* note) const
1337+
const NoteParenthesisInfo* Chord::findNoteParenthesisInfo(const Note* note) const
13381338
{
13391339
for (const NoteParenthesisInfo* infoPtr : m_noteParens) {
13401340
for (const Note* parenNote : infoPtr->notes()) {
@@ -1348,12 +1348,12 @@ const NoteParenthesisInfo* Chord::findNoteParenInfo(const Note* note) const
13481348
return nullptr;
13491349
}
13501350

1351-
void Chord::addNoteParenInfo(NoteParenthesisInfo* noteParenInfo)
1351+
void Chord::addNoteParenthesisInfo(NoteParenthesisInfo* noteParenInfo)
13521352
{
13531353
m_noteParens.push_back(noteParenInfo);
13541354
}
13551355

1356-
void Chord::removeNoteParenInfo(const NoteParenthesisInfo* noteParenInfo)
1356+
void Chord::removeNoteParenthesisInfo(const NoteParenthesisInfo* noteParenInfo)
13571357
{
13581358
if (m_noteParens.empty()) {
13591359
return;
@@ -1372,9 +1372,9 @@ void Chord::removeNoteParenInfo(const NoteParenthesisInfo* noteParenInfo)
13721372
}
13731373
}
13741374

1375-
void Chord::addNoteToParenInfo(Note* note, const Parenthesis* paren)
1375+
void Chord::addNoteToParenthesisInfo(Note* note, const Parenthesis* paren)
13761376
{
1377-
NoteParenthesisInfo* noteParenInfo = findNoteParenInfo(paren);
1377+
NoteParenthesisInfo* noteParenInfo = findNoteParenthesisInfo(paren);
13781378

13791379
if (!noteParenInfo) {
13801380
return;
@@ -1383,9 +1383,9 @@ void Chord::addNoteToParenInfo(Note* note, const Parenthesis* paren)
13831383
noteParenInfo->insertNote(note);
13841384
}
13851385

1386-
void Chord::removeNoteFromParenInfo(Note* note, const Parenthesis* paren)
1386+
void Chord::removeNoteFromParenthesisInfo(Note* note, const Parenthesis* paren)
13871387
{
1388-
NoteParenthesisInfo* noteParenInfo = findNoteParenInfo(paren);
1388+
NoteParenthesisInfo* noteParenInfo = findNoteParenthesisInfo(paren);
13891389

13901390
if (!noteParenInfo) {
13911391
return;

src/engraving/dom/chord.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ class Chord final : public ChordRest
177177
std::vector<Note*>& notes() { return m_notes; }
178178
const std::vector<Note*>& notes() const { return m_notes; }
179179

180-
const NoteParenthesisInfoList& noteParens() const { return m_noteParens; }
181-
const NoteParenthesisInfo* findNoteParenInfo(const Note* note) const;
182-
NoteParenthesisInfo* findNoteParenInfo(const Parenthesis* paren);
183-
void addNoteParenInfo(NoteParenthesisInfo* noteParenInfo);
184-
void removeNoteParenInfo(const NoteParenthesisInfo* noteParenInfo);
185-
void addNoteToParenInfo(Note* note, const Parenthesis* paren);
186-
void removeNoteFromParenInfo(Note* note, const Parenthesis* paren);
180+
const NoteParenthesisInfoList& noteParentheses() const { return m_noteParens; }
181+
const NoteParenthesisInfo* findNoteParenthesisInfo(const Note* note) const;
182+
NoteParenthesisInfo* findNoteParenthesisInfo(const Parenthesis* paren);
183+
void addNoteParenthesisInfo(NoteParenthesisInfo* noteParenInfo);
184+
void removeNoteParenthesisInfo(const NoteParenthesisInfo* noteParenInfo);
185+
void addNoteToParenthesisInfo(Note* note, const Parenthesis* paren);
186+
void removeNoteFromParenthesisInfo(Note* note, const Parenthesis* paren);
187187

188188
bool isChordPlayable() const;
189189
void setIsChordPlayable(const bool isPlayable);

src/engraving/dom/note.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,11 +1497,11 @@ bool Note::shouldForceShowFret() const
14971497
void Note::setVisible(bool v)
14981498
{
14991499
EngravingItem::setVisible(v);
1500-
if (!chord() || chord()->noteParens().empty()) {
1500+
if (!chord() || chord()->noteParentheses().empty()) {
15011501
return;
15021502
}
15031503

1504-
const NoteParenthesisInfo* noteParenInfo = chord()->findNoteParenInfo(this);
1504+
const NoteParenthesisInfo* noteParenInfo = chord()->findNoteParenthesisInfo(this);
15051505

15061506
if (!noteParenInfo) {
15071507
return;
@@ -3959,7 +3959,7 @@ void Note::setParenthesesMode(const ParenthesesMode& v, bool addToLinked, bool g
39593959
return;
39603960
}
39613961

3962-
const NoteParenthesisInfo* noteParenInfo = parenInfo();
3962+
const NoteParenthesisInfo* noteParenInfo = parenthesisInfo();
39633963

39643964
Parenthesis* leftParen = noteParenInfo ? noteParenInfo->leftParen() : nullptr;
39653965

@@ -3985,9 +3985,9 @@ void Note::setParenthesesMode(const ParenthesesMode& v, bool addToLinked, bool g
39853985
}
39863986
}
39873987

3988-
const NoteParenthesisInfo* Note::parenInfo() const
3988+
const NoteParenthesisInfo* Note::parenthesisInfo() const
39893989
{
3990-
return chord() ? chord()->findNoteParenInfo(this) : nullptr;
3990+
return chord() ? chord()->findNoteParenthesisInfo(this) : nullptr;
39913991
}
39923992

39933993
bool Note::isGrace() const

src/engraving/dom/note.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ class Note final : public EngravingItem
410410

411411
void setParenthesesMode(const ParenthesesMode& v, bool addToLinked = true, bool generated = false) override;
412412

413-
const NoteParenthesisInfo* parenInfo() const;
413+
const NoteParenthesisInfo* parenthesisInfo() const;
414414

415415
void setHarmonic(bool val) { m_harmonic = val; }
416416
bool harmonic() const { return m_harmonic; }

src/engraving/dom/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ std::unordered_set<EngravingItem*> collectElementsAnchoredToNote(const Note* not
14171417
elems.emplace(sp);
14181418
}
14191419
}
1420-
const NoteParenthesisInfo* noteParenInfo = note->parenInfo();
1420+
const NoteParenthesisInfo* noteParenInfo = note->parenthesisInfo();
14211421
if (noteParenInfo && noteParenInfo->notes().size()) {
14221422
elems.emplace(noteParenInfo->leftParen());
14231423
elems.emplace(noteParenInfo->rightParen());

src/engraving/editing/editchord.cpp

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void EditChord::addChordParentheses(Chord* chord, std::vector<Note*> notes, bool
3939
if (notes.empty()) {
4040
return;
4141
}
42-
undoAddParensToNotes(chord, notes, addToLinked, generated);
42+
undoAddParenthesesToNotes(chord, notes, addToLinked, generated);
4343
}
4444

4545
void EditChord::removeChordParentheses(Chord* chord, std::vector<Note*> notes, bool addToLinked, bool generated)
@@ -51,7 +51,7 @@ void EditChord::removeChordParentheses(Chord* chord, std::vector<Note*> notes, b
5151
std::map<const NoteParenthesisInfo*, std::vector<Note*> > notesByGroup;
5252

5353
for (Note* n : notes) {
54-
const NoteParenthesisInfo* noteParenInfo = chord->findNoteParenInfo(n);
54+
const NoteParenthesisInfo* noteParenInfo = chord->findNoteParenthesisInfo(n);
5555
if (!noteParenInfo) {
5656
continue;
5757
}
@@ -72,7 +72,7 @@ void EditChord::removeChordParentheses(Chord* chord, std::vector<Note*> notes, b
7272
const NoteParenthesisInfo* parenInfo = groupNotesPair.first;
7373
if (parenInfo->notes().size() == groupNotesPair.second.size()) {
7474
// All notes marked for paren removal, clear parentheses group
75-
undoClearParenGroup(chord, parenInfo->notes(), parenInfo->leftParen(), parenInfo->rightParen(), addToLinked);
75+
undoClearParenthesisGroup(chord, parenInfo->notes(), parenInfo->leftParen(), parenInfo->rightParen(), addToLinked);
7676
continue;
7777
}
7878

@@ -81,7 +81,7 @@ void EditChord::removeChordParentheses(Chord* chord, std::vector<Note*> notes, b
8181
noteIterator = std::next(noteIterator)) {
8282
// Remove paren from single note and create new paren group for all notes below
8383
Note* note = *noteIterator;
84-
const NoteParenthesisInfo* curParenInfo = note->parenInfo();
84+
const NoteParenthesisInfo* curParenInfo = note->parenthesisInfo();
8585
const std::vector<Note*> notesList = curParenInfo->notes();
8686
Parenthesis* leftParen = curParenInfo->leftParen();
8787
Parenthesis* rightParen = curParenInfo->rightParen();
@@ -93,24 +93,24 @@ void EditChord::removeChordParentheses(Chord* chord, std::vector<Note*> notes, b
9393

9494
for (Note* noteToRemove : newNoteGroup) {
9595
if (curParenInfo->notes().size() == 1) {
96-
undoClearParenGroup(chord, { noteToRemove }, leftParen, rightParen, addToLinked);
96+
undoClearParenthesisGroup(chord, { noteToRemove }, leftParen, rightParen, addToLinked);
9797
} else {
98-
undoRemoveParenFromNote(chord, noteToRemove, leftParen, addToLinked);
98+
undoRemoveParenthesesFromNote(chord, noteToRemove, leftParen, addToLinked);
9999
}
100100
}
101101

102-
undoAddParensToNotes(chord, newNoteGroup, addToLinked, generated);
102+
undoAddParenthesesToNotes(chord, newNoteGroup, addToLinked, generated);
103103
}
104104
if (curParenInfo->notes().size() == 1) {
105-
undoClearParenGroup(chord, { note }, leftParen, rightParen, addToLinked);
105+
undoClearParenthesisGroup(chord, { note }, leftParen, rightParen, addToLinked);
106106
} else {
107-
undoRemoveParenFromNote(chord, note, leftParen, addToLinked);
107+
undoRemoveParenthesesFromNote(chord, note, leftParen, addToLinked);
108108
}
109109
}
110110
}
111111
}
112112

113-
void EditChord::undoAddParensToNotes(Chord* chord, std::vector<Note*> notes, bool addToLinked, bool generated)
113+
void EditChord::undoAddParenthesesToNotes(Chord* chord, std::vector<Note*> notes, bool addToLinked, bool generated)
114114
{
115115
track_idx_t track = chord->track();
116116
Parenthesis* leftParen = Factory::createParenthesis(chord);
@@ -157,16 +157,16 @@ void EditChord::undoAddParensToNotes(Chord* chord, std::vector<Note*> notes, boo
157157
}
158158
}
159159

160-
void EditChord::undoRemoveParenFromNote(Chord* chord, Note* note, Parenthesis* leftParen, bool removeFromLinked)
160+
void EditChord::undoRemoveParenthesesFromNote(Chord* chord, Note* note, Parenthesis* leftParen, bool removeFromLinked)
161161
{
162162
if (!removeFromLinked) {
163-
doRemoveSingleNoteParen(chord, note, leftParen);
163+
doRemoveSingleNoteParenthesis(chord, note, leftParen);
164164
return;
165165
}
166166

167167
for (EngravingObject* linkedObject : chord->linkList()) {
168168
if (linkedObject == chord) {
169-
doRemoveSingleNoteParen(chord, note, leftParen);
169+
doRemoveSingleNoteParenthesis(chord, note, leftParen);
170170
continue;
171171
}
172172

@@ -178,24 +178,24 @@ void EditChord::undoRemoveParenFromNote(Chord* chord, Note* note, Parenthesis* l
178178
}
179179
Note* linkedNote = toNote(note->findLinkedInStaff(linkedStaff));
180180

181-
const NoteParenthesisInfo* noteParenInfo = linkedChord->findNoteParenInfo(linkedNote);
181+
const NoteParenthesisInfo* noteParenInfo = linkedChord->findNoteParenthesisInfo(linkedNote);
182182
if (noteParenInfo) {
183-
doRemoveSingleNoteParen(linkedChord, linkedNote, linkedLeftParen);
183+
doRemoveSingleNoteParenthesis(linkedChord, linkedNote, linkedLeftParen);
184184
}
185185
}
186186
}
187187

188-
void EditChord::undoClearParenGroup(Chord* chord, std::vector<Note*> notes, Parenthesis* leftParen, Parenthesis* rightParen,
189-
bool removeFromLinked)
188+
void EditChord::undoClearParenthesisGroup(Chord* chord, std::vector<Note*> notes, Parenthesis* leftParen, Parenthesis* rightParen,
189+
bool removeFromLinked)
190190
{
191191
if (!removeFromLinked) {
192-
doRemoveAllNoteParens(chord, leftParen);
192+
doRemoveAllNoteParentheses(chord, leftParen);
193193
return;
194194
}
195195

196196
for (EngravingObject* linkedObject : chord->linkList()) {
197197
if (linkedObject == chord) {
198-
doRemoveAllNoteParens(chord, leftParen);
198+
doRemoveAllNoteParentheses(chord, leftParen);
199199
continue;
200200
}
201201

@@ -214,25 +214,25 @@ void EditChord::undoClearParenGroup(Chord* chord, std::vector<Note*> notes, Pare
214214
linkedNotes.push_back(linkedNote);
215215
}
216216

217-
doRemoveAllNoteParens(linkedChord, linkedLeftParen);
217+
doRemoveAllNoteParentheses(linkedChord, linkedLeftParen);
218218
}
219219
}
220220

221221
void EditChord::doAddNoteParentheses(Chord* chord, std::vector<Note*> notes, Parenthesis* leftParen, Parenthesis* rightParen)
222222
{
223223
NoteParenthesisInfo* parenInfo = new NoteParenthesisInfo(leftParen, rightParen, notes);
224224
if (leftParen->generated()) {
225-
chord->addNoteParenInfo(parenInfo);
225+
chord->addNoteParenthesisInfo(parenInfo);
226226
} else {
227227
Score* score = chord->score();
228228
score->undo(new AddNoteParenthesisInfo(chord, parenInfo));
229229
}
230230
}
231231

232-
void EditChord::doRemoveSingleNoteParen(Chord* chord, Note* note, Parenthesis* leftParen)
232+
void EditChord::doRemoveSingleNoteParenthesis(Chord* chord, Note* note, Parenthesis* leftParen)
233233
{
234234
if (leftParen->generated()) {
235-
chord->removeNoteFromParenInfo(note, leftParen);
235+
chord->removeNoteFromParenthesisInfo(note, leftParen);
236236

237237
chord->triggerLayout();
238238
} else {
@@ -241,19 +241,19 @@ void EditChord::doRemoveSingleNoteParen(Chord* chord, Note* note, Parenthesis* l
241241
}
242242
}
243243

244-
void EditChord::doRemoveAllNoteParens(Chord* chord, Parenthesis* leftParen)
244+
void EditChord::doRemoveAllNoteParentheses(Chord* chord, Parenthesis* leftParen)
245245
{
246246
if (leftParen->generated()) {
247-
const NoteParenthesisInfo* noteParenInfo = chord->findNoteParenInfo(leftParen);
247+
const NoteParenthesisInfo* noteParenInfo = chord->findNoteParenthesisInfo(leftParen);
248248

249-
chord->removeNoteParenInfo(noteParenInfo);
249+
chord->removeNoteParenthesisInfo(noteParenInfo);
250250
//! HACK: don't delete as it may still be used in Inspector - see Score::doUndoRemoveElement
251251
// delete noteParenInfo
252252

253253
chord->triggerLayout();
254254
} else {
255255
Score* score = chord->score();
256-
NoteParenthesisInfo* noteParenInfo = chord->findNoteParenInfo(leftParen);
256+
NoteParenthesisInfo* noteParenInfo = chord->findNoteParenthesisInfo(leftParen);
257257

258258
score->undo(new RemoveNoteParenthesisInfo(chord, noteParenInfo));
259259
}
@@ -327,14 +327,14 @@ void ChangeSpanArpeggio::flip(EditData*)
327327

328328
void AddNoteParenthesisInfo::redo(EditData*)
329329
{
330-
m_chord->addNoteParenInfo(m_noteParenInfo);
330+
m_chord->addNoteParenthesisInfo(m_noteParenInfo);
331331

332332
m_chord->triggerLayout();
333333
}
334334

335335
void mu::engraving::AddNoteParenthesisInfo::undo(EditData*)
336336
{
337-
m_chord->removeNoteParenInfo(m_noteParenInfo);
337+
m_chord->removeNoteParenthesisInfo(m_noteParenInfo);
338338

339339
m_chord->triggerLayout();
340340
}
@@ -349,14 +349,14 @@ void AddNoteParenthesisInfo::cleanup(bool undo)
349349

350350
void RemoveNoteParenthesisInfo::redo(EditData*)
351351
{
352-
m_chord->removeNoteParenInfo(m_noteParenInfo);
352+
m_chord->removeNoteParenthesisInfo(m_noteParenInfo);
353353

354354
m_chord->triggerLayout();
355355
}
356356

357357
void RemoveNoteParenthesisInfo::undo(EditData*)
358358
{
359-
m_chord->addNoteParenInfo(m_noteParenInfo);
359+
m_chord->addNoteParenthesisInfo(m_noteParenInfo);
360360

361361
m_chord->triggerLayout();
362362
}
@@ -371,14 +371,14 @@ void RemoveNoteParenthesisInfo::cleanup(bool undo)
371371

372372
void RemoveSingleNoteParentheses::redo(EditData*)
373373
{
374-
m_chord->removeNoteFromParenInfo(m_note, m_paren);
374+
m_chord->removeNoteFromParenthesisInfo(m_note, m_paren);
375375

376376
m_chord->triggerLayout();
377377
}
378378

379379
void RemoveSingleNoteParentheses::undo(EditData*)
380380
{
381-
m_chord->addNoteToParenInfo(m_note, m_paren);
381+
m_chord->addNoteToParenthesisInfo(m_note, m_paren);
382382

383383
m_chord->triggerLayout();
384384
}

src/engraving/editing/editchord.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ class EditChord
3434

3535
private:
3636

37-
static void undoAddParensToNotes(Chord* chord, std::vector<Note*> notes, bool addToLinked = true, bool generated = false);
38-
static void undoRemoveParenFromNote(Chord* chord, Note* note, Parenthesis* leftParen, bool removeFromLinked = true);
39-
static void undoClearParenGroup(Chord* chord, std::vector<Note*> notes, Parenthesis* leftParen, Parenthesis* rightParen,
40-
bool removeFromLinked = true);
37+
static void undoAddParenthesesToNotes(Chord* chord, std::vector<Note*> notes, bool addToLinked = true, bool generated = false);
38+
static void undoRemoveParenthesesFromNote(Chord* chord, Note* note, Parenthesis* leftParen, bool removeFromLinked = true);
39+
static void undoClearParenthesisGroup(Chord* chord, std::vector<Note*> notes, Parenthesis* leftParen, Parenthesis* rightParen,
40+
bool removeFromLinked = true);
4141

4242
static void doAddNoteParentheses(Chord* chord, std::vector<Note*> notes, Parenthesis* leftParen, Parenthesis* rightParen);
43-
static void doRemoveSingleNoteParen(Chord* chord, Note* note, Parenthesis* leftParen);
44-
static void doRemoveAllNoteParens(Chord* chord, Parenthesis* leftParen);
43+
static void doRemoveSingleNoteParenthesis(Chord* chord, Note* note, Parenthesis* leftParen);
44+
static void doRemoveAllNoteParentheses(Chord* chord, Parenthesis* leftParen);
4545
};
4646

4747
class ChangeChordStaffMove : public UndoCommand

0 commit comments

Comments
 (0)