Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 12 additions & 10 deletions src/braille/internal/notationbraille.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,14 +718,16 @@ bool NotationBraille::addTie()
}

score()->startCmd(TranslatableString("undoableAction", "Add tie"));
Note* note = toNote(currentEngravingItem());

Tie* tie = Factory::createTie(score()->dummy());
tie->setStartNote(brailleInput()->tieStartNote());
tie->setEndNote(note);
tie->setTrack(brailleInput()->tieStartNote()->track());
tie->setTick(brailleInput()->tieStartNote()->chord()->segment()->tick());
tie->setTicks(note->chord()->segment()->tick() - brailleInput()->tieStartNote()->chord()->segment()->tick());

Note* startNote = brailleInput()->tieStartNote();
Note* endNote = toNote(currentEngravingItem());

Tie* tie = Factory::createTie(startNote);
tie->setStartNote(startNote);
tie->setEndNote(endNote);
tie->setTrack(startNote->track());
tie->setTick(startNote->chord()->segment()->tick());
tie->setTicks(endNote->chord()->segment()->tick() - startNote->chord()->segment()->tick());
score()->undoAddElement(tie);
score()->endCmd();
return true;
Expand All @@ -745,7 +747,7 @@ bool NotationBraille::addSlur()

score()->startCmd(TranslatableString("undoableAction", "Add slur"));

Slur* slur = Factory::createSlur(firstChordRest->measure()->system());
Slur* slur = Factory::createSlur(firstChordRest->score()->dummy());
slur->setScore(firstChordRest->score());
slur->setTick(firstChordRest->tick());
slur->setTick2(secondChordRest->tick());
Expand Down Expand Up @@ -790,7 +792,7 @@ bool NotationBraille::addLongSlur()

score()->startCmd(TranslatableString("undoableAction", "Add long slur"));

Slur* slur = Factory::createSlur(firstChordRest->measure()->system());
Slur* slur = Factory::createSlur(firstChordRest->score()->dummy());
slur->setScore(firstChordRest->score());
slur->setTick(firstChordRest->tick());
slur->setTick2(secondChordRest->tick());
Expand Down
2 changes: 0 additions & 2 deletions src/engraving/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,6 @@ target_sources(engraving PRIVATE
compat/pageformat.h
compat/writescorehook.cpp
compat/writescorehook.h
compat/dummyelement.cpp
compat/dummyelement.h
compat/engravingcompat.cpp
compat/engravingcompat.h

Expand Down
14 changes: 7 additions & 7 deletions src/engraving/api/tests/score_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ TEST_F(Engraving_ApiScoreTests, fretDiagramHarmonyAtDomLevel)
{
// [GIVEN] A score and a FretDiagram with no harmony
MasterScore* score = compat::ScoreAccess::createMasterScore(nullptr);
FretDiagram* fd = Factory::createFretDiagram(score->dummy()->segment());
FretDiagram* fd = Factory::createFretDiagram(score->dummy());

EXPECT_EQ(fd->harmony(), nullptr);
EXPECT_EQ(fd->harmonyPlainText(), String());
Expand All @@ -1564,7 +1564,7 @@ TEST_F(Engraving_ApiScoreTests, fretDiagramHarmonyApi)
{
// [GIVEN] A score with a FretDiagram carrying a chord symbol
MasterScore* domScore = compat::ScoreAccess::createMasterScore(nullptr);
FretDiagram* domFd = Factory::createFretDiagram(domScore->dummy()->segment());
FretDiagram* domFd = Factory::createFretDiagram(domScore->dummy());
domFd->setHarmony(u"Fdim7");

// Construct the wrapper through the public dispatcher so that
Expand Down Expand Up @@ -1615,7 +1615,7 @@ TEST_F(Engraving_ApiScoreTests, fretDiagramSetDotApi)
// FretDiagram::dot(s) returns a placeholder Dot(fret=0) when no dot is set,
// so we check fret values rather than vector emptiness.
MasterScore* domScore = compat::ScoreAccess::createMasterScore(nullptr);
FretDiagram* domFd = Factory::createFretDiagram(domScore->dummy()->segment());
FretDiagram* domFd = Factory::createFretDiagram(domScore->dummy());

apiv1::FretDiagram* apiFd
= qobject_cast<apiv1::FretDiagram*>(apiv1::wrap(domFd, apiv1::Ownership::SCORE));
Expand Down Expand Up @@ -1658,7 +1658,7 @@ TEST_F(Engraving_ApiScoreTests, fretDiagramSetMarkerApi)
{
// [GIVEN] A score and an empty FretDiagram, wrapped via the API
MasterScore* domScore = compat::ScoreAccess::createMasterScore(nullptr);
FretDiagram* domFd = Factory::createFretDiagram(domScore->dummy()->segment());
FretDiagram* domFd = Factory::createFretDiagram(domScore->dummy());

apiv1::FretDiagram* apiFd
= qobject_cast<apiv1::FretDiagram*>(apiv1::wrap(domFd, apiv1::Ownership::SCORE));
Expand Down Expand Up @@ -1696,7 +1696,7 @@ TEST_F(Engraving_ApiScoreTests, fretDiagramSetBarreApi)
{
// [GIVEN] A score and an empty FretDiagram, wrapped via the API
MasterScore* domScore = compat::ScoreAccess::createMasterScore(nullptr);
FretDiagram* domFd = Factory::createFretDiagram(domScore->dummy()->segment());
FretDiagram* domFd = Factory::createFretDiagram(domScore->dummy());

apiv1::FretDiagram* apiFd
= qobject_cast<apiv1::FretDiagram*>(apiv1::wrap(domFd, apiv1::Ownership::SCORE));
Expand Down Expand Up @@ -1737,7 +1737,7 @@ TEST_F(Engraving_ApiScoreTests, fretDiagramClearApi)
{
// [GIVEN] A score and a FretDiagram populated with a dot and a marker
MasterScore* domScore = compat::ScoreAccess::createMasterScore(nullptr);
FretDiagram* domFd = Factory::createFretDiagram(domScore->dummy()->segment());
FretDiagram* domFd = Factory::createFretDiagram(domScore->dummy());
domFd->setDot(0, 3);
domFd->setMarker(1, FretMarkerType::CROSS);

Expand Down Expand Up @@ -1780,7 +1780,7 @@ TEST_F(Engraving_ApiScoreTests, fretDiagramGettersApi)
{
// [GIVEN] A FretDiagram populated with known content
MasterScore* domScore = compat::ScoreAccess::createMasterScore(nullptr);
FretDiagram* domFd = Factory::createFretDiagram(domScore->dummy()->segment());
FretDiagram* domFd = Factory::createFretDiagram(domScore->dummy());

// Set a dot on string 0 fret 3, a marker on string 1, and a barre at fret 2
domFd->setDot(0, 3);
Expand Down
1 change: 0 additions & 1 deletion src/engraving/api/v1/cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ void Cursor::addTuplet(Fraction* ratio, Fraction* duration)
m_score->changeCRlen(cr, fDuration);

mu::engraving::Tuplet* tuplet = new mu::engraving::Tuplet(tupletMeasure);
tuplet->setOwnershipParent(tupletMeasure);
tuplet->setTrack(track());
tuplet->setTick(tupletTick);
tuplet->setRatio(fRatio);
Expand Down
1 change: 0 additions & 1 deletion src/engraving/api/v1/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ void Score::addText(const QString& type, const QString& txt)
}

mu::engraving::Text* text = mu::engraving::Factory::createText(mb, tid);
text->setOwnershipParent(mb);
text->setXmlText(txt);
score()->undoAddElement(text);
}
Expand Down
149 changes: 0 additions & 149 deletions src/engraving/compat/dummyelement.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion src/engraving/dom/accidental.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ AccidentalVal sym2accidentalVal(SymId id)
// Accidental
//---------------------------------------------------------

Accidental::Accidental(EngravingItem* parent)
Accidental::Accidental(DummyParentOr<EngravingItem> parent)
: EngravingItem(ElementType::ACCIDENTAL, parent, ElementFlag::MOVABLE)
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/dom/accidental.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class Accidental final : public EngravingItem

friend class Factory;

Accidental(EngravingItem* parent);
Accidental(DummyParentOr<EngravingItem> parent);

AccidentalType m_accidentalType = AccidentalType::NONE;
AccidentalBracket m_bracket = AccidentalBracket::NONE;
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/dom/actionicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using namespace mu;
using namespace muse::draw;
using namespace mu::engraving;

ActionIcon::ActionIcon(EngravingItem* parent)
ActionIcon::ActionIcon(DummyParentOr<EngravingItem> parent)
: EngravingItem(ElementType::ACTION_ICON, parent)
{
m_iconFont = Font(configuration()->iconsFontFamily(), Font::Type::Icon);
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/dom/actionicon.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ActionIcon final : public EngravingItem
DECLARE_CLASSOF(ElementType::ACTION_ICON)

public:
ActionIcon(EngravingItem* score);
ActionIcon(DummyParentOr<EngravingItem> score);
~ActionIcon() override = default;

ActionIcon* clone() const override;
Expand Down
4 changes: 1 addition & 3 deletions src/engraving/dom/ambitus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ using namespace mu::engraving;
// Ambitus
//---------------------------------------------------------

Ambitus::Ambitus(Segment* parent)
Ambitus::Ambitus(DummyParentOr<Segment> parent)
: EngravingItem(ElementType::AMBITUS, parent, ElementFlag::ON_STAFF)
{
m_noteHeadGroup = NOTEHEADGROUP_DEFAULT;
Expand All @@ -59,8 +59,6 @@ Ambitus::Ambitus(Segment* parent)

m_topAccidental = Factory::createAccidental(this, false);
m_bottomAccidental = Factory::createAccidental(this, false);
m_topAccidental->setOwnershipParent(this);
m_bottomAccidental->setOwnershipParent(this);
}

Ambitus::Ambitus(const Ambitus& a)
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/dom/ambitus.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Ambitus final : public EngravingItem
private:

friend class Factory;
Ambitus(Segment* parent);
Ambitus(DummyParentOr<Segment> parent);
Ambitus(const Ambitus& a);

void normalize();
Expand Down
3 changes: 1 addition & 2 deletions src/engraving/dom/anchors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ TimeTickAnchor* EditTimeTickAnchors::createTimeTickAnchor(Measure* measure, Frac
TimeTickAnchor* anchor = element ? toTimeTickAnchor(element) : nullptr;
if (!anchor) {
anchor = Factory::createTimeTickAnchor(segment);
anchor->setOwnershipParent(segment);
anchor->setTrack(track);
segment->add(anchor);
}
Expand Down Expand Up @@ -571,7 +570,7 @@ void MoveElementAnchors::rebaseOffsetOnMoveSegment(EngravingItem* element, const
* TimeTickAnchor
* *****************************************/

TimeTickAnchor::TimeTickAnchor(Segment* parent)
TimeTickAnchor::TimeTickAnchor(DummyParentOr<Segment> parent)
: EngravingItem(ElementType::TIME_TICK_ANCHOR, parent,
ElementFlag::ON_STAFF
| ElementFlag::NOT_SELECTABLE
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/dom/anchors.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class MoveElementAnchors

class TimeTickAnchor : public EngravingItem
{
TimeTickAnchor(Segment* parent);
TimeTickAnchor(DummyParentOr<Segment> parent);
friend class Factory;

public:
Expand Down
7 changes: 4 additions & 3 deletions src/engraving/dom/arpeggio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
using namespace mu;
using namespace mu::engraving;

Arpeggio::Arpeggio(Chord* parent, ElementType type)
Arpeggio::Arpeggio(DummyParentOr<Chord> parent, ElementType type)
: EngravingItem(type, parent, ElementFlag::MOVABLE)
{
m_arpeggioType = ArpeggioType::NORMAL;
Expand All @@ -51,8 +51,9 @@ Arpeggio::Arpeggio(Chord* parent, ElementType type)
m_playArpeggio = true;
m_stretch = 1.0;

if (type == ElementType::ARPEGGIO) {
parent->setSpanArpeggio(this);
EngravingObject* p = parent;
if (type == ElementType::ARPEGGIO && p->isChord()) {
toChord(p)->setSpanArpeggio(this);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/engraving/dom/arpeggio.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Arpeggio : public EngravingItem
protected:
friend class Factory;

Arpeggio(Chord* parent, ElementType type = ElementType::ARPEGGIO);
Arpeggio(DummyParentOr<Chord> parent, ElementType type = ElementType::ARPEGGIO);

private:
void spatiumChanged(double /*oldValue*/, double /*newValue*/) override;
Expand Down
Loading
Loading