beamgroup.getNoteGroup should moved to the Score, and should be generalized
to handle note groups and phrase groups. To enable this feature, the
current implementation of beamgroup.getNoteGroup should be moved to
score.getGroup and changed so it no longer checks for score element
type/category, but simply iterates through score elements until the
applicable group pseudo element is found.
Starting with a group tag where 'endSection == true'
Untested sample code may be similar to the following:
Score.prototype.getGroup = function(elem) {
var mel;
var nested = 0;
var grp = [];
var pos = score.find(mel);
if (!pos) {
return;
}
while (--pos >= 0) {
mel = score.get(pos);
if (mel.type === elem.type) {
if (mel.sectionStart && nested == 0)
break;
if (mel.sectionEnd) {
nested++;
continue;
} else if (mel.sectionStart) {
nested--;
continue;
}
} else {
if (nested == 0)
grp.push(mel);
}
}
grp.reverse();
return grp;
}
Original issue reported on code.google.com by pipemakertjm@gmail.com on 30 Apr 2010 at 6:34
Original issue reported on code.google.com by
pipemakertjm@gmail.com
on 30 Apr 2010 at 6:34