Bug in Cursor.next()?
How to increment cursor? I'm stuck with this in a few days! Can't find a way to programmatically enter notes/rests and other elements instead of using cmd(). I also need a way to get current measure (in a case when cursor walk through several measures) and get elements under cursor. The problem is that It looks like the next() method of the Cursor didn't work as it should. If I do so:
cursor.setDuration(1, 4); cursor.addNote(60); cursor.next(); cursor.addNote(62); cursor.next(); cursor.addNote(64); cursor.next(); cursor.addNote(65); cursor.next();
the cursor behavior identical to Cursor's nextMeasure() method. It doesn't adds the notes one after another.
But, ok, there is a solution:
cursor.setDuration(1, 4); cursor.addNote(60); cursor.addNote(62); cursor.addNote(64); cursor.addNote(65);
But the cursor don't incrementing in this case. You can check it by log segments and measures (in a case of "multimeasure" selection) - they are always the same. It's impossible to get segment/element under the cursor on the next position, because the position is always the start of the selection or the start of the next measure. Is it a bug in next() or don't I understand something basic? Is there another way?