Skip to content
Snippets Groups Projects
Commit 6ced7619 authored by SeeLook's avatar SeeLook
Browse files

Fixed preparing beam when occurs more than one in single rhythm group, sketch for beam resolver

parent b2c93690
Branches
Tags
No related merge requests found
......@@ -89,9 +89,12 @@ void TmeasureObject::appendNewNotes(int segmentId, int count) {
auto firstInGrId = m_score->noteSegment(firstNoteId() + m_firstInGr[grWithBeam])->index();
while (firstInGrId < m_score->notesCount()) {
auto ns = m_score->noteSegment(firstInGrId);
TbeamObject *curBeam = nullptr;
if (ns->beam()) {
if (ns->beam() != curBeam) {
ns->beam()->prepareBeam();
break;
curBeam = ns->beam();
}
}
++firstInGrId;
}
......@@ -102,21 +105,6 @@ void TmeasureObject::appendNewNotes(int segmentId, int count) {
}
void TmeasureObject::insertNote(int id, TnotePair* np) {
// qDebug() << debug() << "inserting note at" << id;
m_notes.append(np);
updateRhythmicGroups();
// if (np->object() == nullptr) {
// auto noteObject = new TnoteObject(m_staff);
// noteObject->setMeasure(this);
// noteObject->setNote(*np->note());
// np->setNoteObject(noteObject);
// m_staff->addNote(np);
// }
}
void TmeasureObject::keySignatureChanged() {
for (int n = 0; n < m_notes.size(); ++n) {
m_notes[n]->item()->keySignatureChanged();
......@@ -221,6 +209,26 @@ int TmeasureObject::beamGroup(int segmentId) {
int currGr = m_score->noteSegment(segmentId)->rhythmGroup();
int segId = m_firstInGr[currGr] + 1;
int grWithBeam = -1;
// QList<QList<int>> beamLists;
// QList<int> l1;
// beamLists << l1;
// for (int bb = segId - 1; bb < m_notes.count() && m_notes[bb]->rhythmGroup() == currGr; ++bb) {
// auto prevSeg = m_notes[bb];
// if (!prevSeg->note()->isRest() && prevSeg->note()->rhythm() > Trhythm::Quarter) {
// auto lastBeam = beamLists.last();
// if (!lastBeam.isEmpty()) {
// if (lastBeam.last() < bb - 1) { // a new beam if there was a rest in between notes in current rhythm group
// QList<int> newBeam;
// beamLists << newBeam;
// }
// }
// beamLists.last() << bb;
// }
// }
// for (int b = 0; b < beamLists.size(); ++b)
// qDebug() << debug() << "beam" << b << ":" << beamLists[b];
while (segId < m_notes.count() && m_notes[segId]->rhythmGroup() == currGr) {
auto noteSeg = m_notes[segId];
auto prevSeg = m_notes[segId - 1];
......
......@@ -67,8 +67,6 @@ public:
*/
void appendNewNotes(int segmentId, int count);
void insertNote(int id, TnotePair* np);
TscoreObject* score() { return m_score; }
TstaffObject* staff() { return m_staff; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment