MuseScore/mscore3.txt
2016-04-13 11:38:08 +02:00

106 lines
3.7 KiB
Text

====================================================================
MuseScore Version 3 design goals/changes
====================================================================
- Optimize horizontal layout by allowing overlapping segments.
- Compute an outline (Shape) for every Staff/Segment.
- Use the outline to compute the minimum distance between Segments.
- this also avoids collisions between Lyrics and ChordNames
- Automatically increase vertical space between staves to avoid collisions.
- Use the segment shapes to compute the minimum distance between staves.
- Implement a way to (re-)layout only the modified part of the score.
- Do not allow more than one System on a line. In 2.x a horizontal box splits
a line into two systems. In 3.x a horizontal box is handled as a special measure.
This simplifies page layout a lot.
- System bar lines are moved into measures in a special segment type "BeginBarLine".
- Do not undo/redo add/removal of "created" elements.
- It speeds up doLayout() and consumes less memory.
? layout of parts after change in one part not necessary
- incomplete layouts should be possible (layout only up to first page
to speed up program start)
In 2.x all Segments must be on the undo/redo stack to keep the history
consistent, This was necessary as Segments were referring to
previous/next segments to find the proper insertion point.
In 3.x Undo knows were to (re-)insert Segments by only checking type and tick
position.
- remove pre 2.0 compatibility
====================================================================
Programming Style Changes in MuseScore 3
====================================================================
* Instead of
if (e->type() == Element::Type::Chord)
...
write
if (e->isChord())
...
This is shorter and easier to read. Similar
if ((s.segmentType() == Segment::Type::ChordRest))
...
can be written as
if (s.isChordRestType())
...
* Use safer type conversion: instead of
Chord* chord = static_cast<Chord*>(e);
write
Chord* chord = toChord(e);
This adds an Q_ASSERT to make sure e is really a Chord().
* Prefer vector container over list:
- Instead of QList use QVector or even better std::vector if possible.
* Prefer stl style over Qt style when using container:
- use list.push_back(xx) instead of list.append(xx) or
- use list.empty() instead of list.isEmpty()
- etc.
(see https://marcmutz.wordpress.com/effective-qt/containers/)
* In iterating a SegmentList instead of
for (Segment* s = segments->first(); s; s = s->next())
...
you can write
for (Segment& s : segments)
...
* enums
Some scoped enums can be replaced by classes. Example:
class Direction {
...
public:
enum _Direction { AUTO, UP, DOWN };
...
};
Goal is to allow
- allow type conversion (to QVariant for example)
- add conversion to/from string for use in Xml::read(...)/Xml::write(xxx)
====================================================================
Known Issues
====================================================================
* tablature not tested, has likely regressions
* some scripting interface functions are commented out
* horizontal layout mode not working
* disabled relayout for beamed notes