Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new page support - refactor page layout system layout and system data #94

Merged
merged 107 commits into from
Jun 13, 2020

Conversation

webern
Copy link
Owner

@webern webern commented May 11, 2020

Closes #86

Adds support for new-page attributes and page layout. Unfortunately doing so became a large crusade of breaking changes. The affected fields of ScoreData are layout and systems.

What used to be the LayoutData class has been renamed to DefaultsData. This name change freed up the name LayoutsData to be used for a new class that better fits the name.

The std::set<SystemData> systems field of ScoreData has been replaced by std::map<MeasureIndex, LayoutData>. LayoutData is a new class (not to be confused with DefaultsData which previously held the name). LayoutData holds a SystemData and a PageData (new) to specify system and page layout.

SystemData and DefaultsData (which used to be called LayoutData) have some refactoring with the introduction of the following classes:
- LeftRight
- MarginsData
- PageLayoutData
- PageMarginsData
- SizeData
- SystemLayoutData

@p-groarke , I'm hopeful that you won't be horribly affected by all the churn. I think it's for the better. When you mentioned that you didn't like the way systems are specified, I think that switching to a map probably makes it more usable. Ultimately if you just want to specify system and page breaks, it can be done like this:

// starts a new system at measure index 7
score.layout.emplace( 7, LayoutData{ true } );

// starts a new system at measure index 19
score.layout.emplace( 19, LayoutData{ true } );

// starts a new system and a new page at measure index 30
score.layout.emplace( 30, LayoutData{ true, true } );

Let me know if you need any help with breakage.

Sourcecode/private/mx/impl/LayoutFunctions.cpp Outdated Show resolved Hide resolved
Sourcecode/private/mx/impl/LayoutFunctions.cpp Outdated Show resolved Hide resolved
Sourcecode/private/mx/impl/LayoutFunctions.cpp Outdated Show resolved Hide resolved
Sourcecode/private/mx/impl/LayoutFunctions.cpp Outdated Show resolved Hide resolved
Sourcecode/private/mx/impl/LayoutFunctions.cpp Outdated Show resolved Hide resolved
Sourcecode/private/mx/impl/ScoreReader.cpp Outdated Show resolved Hide resolved
Sourcecode/private/mx/impl/ScoreReader.cpp Outdated Show resolved Hide resolved
Sourcecode/private/mxtest/api/PageDataTest.cpp Outdated Show resolved Hide resolved
Sourcecode/private/mxtest/api/PageDataTest.cpp Outdated Show resolved Hide resolved
Sourcecode/private/mxtest/api/PageDataTest.cpp Outdated Show resolved Hide resolved
@webern webern merged commit 5160811 into master Jun 13, 2020
@webern webern deleted the pages branch June 13, 2020 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Pages
1 participant