diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..99067a0b6 --- /dev/null +++ b/.clang-format @@ -0,0 +1,3 @@ +BasedOnStyle: Microsoft +ColumnLimit: 120 +SeparateDefinitionBlocks: Always diff --git a/.claude/.gitignore b/.claude/.gitignore new file mode 100644 index 000000000..d4338d645 --- /dev/null +++ b/.claude/.gitignore @@ -0,0 +1,8 @@ +# ignore memory items that claude might write when you get mad at it +projects/ + +# ignore this high churn file that is written whenever you allow a tool use +settings.local.json + +# allow developers to write their own instructions here without checking them in +CLAUDE.local.md diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md new file mode 100644 index 000000000..00faa28c1 --- /dev/null +++ b/.claude/CLAUDE.md @@ -0,0 +1 @@ +Do not edit this file. Read and edit AGENTS.md instead. diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 000000000..89f051566 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,18 @@ +{ + "hooks": + { + "SessionStart": + [ + { + "hooks": + [ + { + "type": "command", + "command": "printf '{\"hookSpecificOutput\":{\"hookEventName\":\"SessionStart\",\"additionalContext\":\"Before doing any work in this session, read AGENTS.md.\"}}'", + "statusMessage": "Reading AGENTS.md..." + } + ] + } + ] + } +} diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..b6d3f5466 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +# Allowlist: ignore everything, then re-include only what the quality gates +# need (the source tree + build configuration). Tests are not run in Docker, +# so the MusicXML corpus, the Rust gen/version-b codegen tool, IDE/build dirs, .git, etc. +# are all excluded. This keeps the build context tiny and stable even when +# stray build dirs (CLion's cmake-build-debug, etc.) appear at the repo root. +* + +!src +!CMakeLists.txt +!Makefile +!.clang-format +!Dockerfile diff --git a/.gitattributes b/.gitattributes index c6c7ba39e..bd2cb7b14 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,74 +1,84 @@ -# trying to preserve xml input files as-is -*.xml binary +# XML and XML-like files: preserve as-is (downloaded fixtures and spec files) +*.xml binary +*.xsd binary +*.musicxml binary +*.mxl binary -# seems like we shouldn't be changine xcode files -*.xc* binary +# Xcode project files: preserve as-is +*.xc* binary +*.pbxproj binary -# These files are text and should be normalized (Convert crlf => lf) -*.rb text -*.h text -*.cpp text -*.hpp text -*.c text -*.cc text -*.sh text -*.bat text -*.m text -*.mm text -*.swift text -*.php text -*.css text -*.js text -*.htm text -*.html text -*.txt text -*.ini text -*.inc text -.htaccess text +# Text files: normalize to LF +*.rb text eol=lf +*.h text eol=lf +*.cpp text eol=lf +*.hpp text eol=lf +*.c text eol=lf +*.cc text eol=lf +*.sh text eol=lf +*.m text eol=lf +*.mm text eol=lf +*.swift text eol=lf +*.css text eol=lf +*.js text eol=lf +*.htm text eol=lf +*.html text eol=lf +*.txt text eol=lf +*.ini text eol=lf +*.inc text eol=lf +*.md text eol=lf +*.json text eol=lf +*.toml text eol=lf +*.rs text eol=lf +*.yml text eol=lf +*.yaml text eol=lf +*.cmake text eol=lf +*.lock text eol=lf +*.csv text eol=lf +*.plist text eol=lf +Makefile text eol=lf +.htaccess text eol=lf -# These files are binary and should be left untouched +# Binary files: leave untouched # (binary is a macro for -text -diff) -*.tiff binary -*.mxl binary -*.mp3 binary -*.wav binary -*.aiff binary -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.mov binary -*.mp4 binary -*.mp3 binary -*.flv binary -*.fla binary -*.swf binary -*.gz binary -*.zip binary -*.7z binary -*.ttf binary -*.musx -*.dorico +*.tiff binary +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.mp3 binary +*.wav binary +*.aiff binary +*.mov binary +*.mp4 binary +*.flv binary +*.fla binary +*.swf binary +*.gz binary +*.zip binary +*.7z binary +*.ttf binary +*.musx binary +*.dorico binary +*.sib binary +*.pdf binary +*.xlsx binary +*.webarchive binary -# Auto detect text files and perform LF normalization -# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ -# * text=auto +# Windows-only files: keep CRLF +*.sln text eol=crlf +*.vcxproj text eol=crlf +*.vsproj text eol=crlf +*.csproj text eol=crlf +*.bat text eol=crlf -# Documents +# Diff drivers for binary-ish document formats *.doc diff=astextplain *.DOC diff=astextplain *.docx diff=astextplain *.DOCX diff=astextplain *.dot diff=astextplain *.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain - -# Declare files that will always have CRLF line endings on checkout. -*.sln text eol=crlf -*.vcxproj text eol=crlf -*.vsproj text eol=crlf -*.csproj text eol=crlf diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml deleted file mode 100644 index 83da0c90d..000000000 --- a/.github/workflows/ccpp.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: C/C++ CI - -on: [pull_request] - -jobs: - linux: - name: Linux - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Cmake - run: | - [ "$(git rev-parse --abbrev-ref HEAD)" == "master" ] && \ - cmake -DMX_BUILD_EXAMPLES=on -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=on . || \ - cmake -DMX_BUILD_EXAMPLES=on -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=off . - - name: Check Cores - run: | - export CORE_COUNT=$(nproc --all) && echo "CORE_COUNT: $CORE_COUNT" && \ - lscpu - - - name: Build - run: export CORE_COUNT=$(nproc --all) && make -j$CORE_COUNT - - - name: Run Examples - run: ./mxread && ./mxwrite - - - name: Run Tests - run: ./mxtest - - windows: - name: Windows - runs-on: windows-latest - - steps: - - uses: actions/checkout@v2 - - - name: Cmake - run: | - cmake -DMX_BUILD_EXAMPLES=on -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=off . - - - name: Build - run: | - cmake --build . - - - name: List Directory - run: dir - - - name: Run Example mxwrite - run: Debug\mxwrite.exe - - - name: Run Example mxread - run: Debug\mxread.exe - - - name: Run Tests - run: Debug\mxtest.exe - - macos: - name: macOS - runs-on: macos-latest - - steps: - - uses: actions/checkout@v2 - - - name: Cmake - run: | - cmake -DMX_BUILD_EXAMPLES=on -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=off . - - - name: Build - run: | - cmake --build . - - - name: Run Example mxwrite - run: ./mxwrite - - - name: Run Example mxread - run: ./mxread - - - name: Run Tests - run: ./mxtest - - xcode: - name: Xcode - runs-on: macos-latest - - steps: - - uses: actions/checkout@v2 - - - name: Build Cache - uses: actions/cache@v2 - env: - cache-name: cargo-home - with: - path: ./xcode-build - key: ${{ hashFiles('.github/cache-bust') }}-${{ hashFiles('Xcode/mx.xcworkspace', 'Xcode/Mx.xcodeproj', 'Xcode/MxTest.xcodeproj') }}-${{ hashFiles('Sourcecode/*') }} - restore-keys: | - ${{ hashFiles('.github/cache-bust') }}-${{ hashFiles('Xcode/mx.xcworkspace', 'Xcode/Mx.xcodeproj', 'Xcode/MxTest.xcodeproj') }}- - ${{ hashFiles('.github/cache-bust') }}- - - - name: Build - run: | - DevScripts/build-for-apple.sh \ - --outdir ./xcode-out \ - --build-dir ./xcode-build \ - --test false \ - --configuration Release \ - --cleanup false diff --git a/.github/workflows/ccpp.yml.archived b/.github/workflows/ccpp.yml.archived new file mode 100644 index 000000000..43598cc57 --- /dev/null +++ b/.github/workflows/ccpp.yml.archived @@ -0,0 +1,108 @@ +name: C/C++ CI + +on: [pull_request] + +jobs: + linux: + name: Linux + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Cmake + run: | + [ "$(git rev-parse --abbrev-ref HEAD)" == "master" ] && \ + cmake -DMX_BUILD_EXAMPLES=on -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=on . || \ + cmake -DMX_BUILD_EXAMPLES=on -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=off . + - name: Check Cores + run: | + export CORE_COUNT=$(nproc --all) && echo "CORE_COUNT: $CORE_COUNT" && \ + lscpu + + - name: Build + run: export CORE_COUNT=$(nproc --all) && make -j$CORE_COUNT + + - name: Run Examples + run: ./mxread && ./mxwrite + + - name: Run Tests + run: ./mxtest + + windows: + name: Windows + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Cmake + run: | + cmake -DMX_BUILD_EXAMPLES=on -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=off . + + - name: Build + run: | + cmake --build . + + - name: List Directory + run: dir + + - name: Run Example mxwrite + run: Debug\mxwrite.exe + + - name: Run Example mxread + run: Debug\mxread.exe + + - name: Run Tests + run: Debug\mxtest.exe + + macos: + name: macOS + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + + - name: Cmake + run: | + cmake -DMX_BUILD_EXAMPLES=on -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=off . + + - name: Build + run: | + cmake --build . + + - name: Run Example mxwrite + run: ./mxwrite + + - name: Run Example mxread + run: ./mxread + + - name: Run Tests + run: ./mxtest + + xcode: + name: Xcode + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + + - name: Build Cache + uses: actions/cache@v2 + env: + cache-name: cargo-home + with: + path: ./xcode-build + key: ${{ hashFiles('.github/cache-bust') }}-${{ hashFiles('xcode/mx.xcworkspace', 'xcode/Mx.xcodeproj', 'xcode/MxTest.xcodeproj') }}-${{ hashFiles('src/*') }} + restore-keys: | + ${{ hashFiles('.github/cache-bust') }}-${{ hashFiles('xcode/mx.xcworkspace', 'xcode/Mx.xcodeproj', 'xcode/MxTest.xcodeproj') }}- + ${{ hashFiles('.github/cache-bust') }}- + + - name: Build + run: | + gen/version-a/build-for-apple.sh \ + --outdir ./xcode-out \ + --build-dir ./xcode-build \ + --test false \ + --configuration Release \ + --cleanup false diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..57fd9952c --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,94 @@ +name: CI + +on: + pull_request: + push: + branches: [master] + +jobs: + linux-gate: + name: Linux (quality gate + tests) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + # Container-driver builder (needed to export the gha layer cache) plus + # the runtime-token export so the Makefile auto-detects + # ACTIONS_RUNTIME_TOKEN and pushes/pulls the Docker layer cache. Keeps + # the toolchain-install layer warm across runs. The same `make check` + # runs locally with no cache (token absent -> plain build). + - uses: docker/setup-buildx-action@v3 + - uses: crazy-max/ghaction-github-runtime@v3 + + - name: Quality gate + run: make check + + - name: Run tests + run: make test + + linux-core: + name: Linux (full test suite, GCC) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Cache build + uses: actions/cache@v4 + with: + path: build/ + key: ${{ runner.os }}-core-${{ hashFiles('CMakeLists.txt', 'src/**') }} + restore-keys: | + ${{ runner.os }}-core- + + - name: Full test suite + run: make test-all + + macos: + name: macOS (build + tests) + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Cache build + uses: actions/cache@v4 + with: + path: build/ + key: ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt', 'src/**') }} + restore-keys: | + ${{ runner.os }}-build- + + - name: Run tests + run: make test + + windows: + name: Windows (build + tests) + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install make + run: choco install make -y + + - name: Run tests + shell: bash + run: make test + + xcode: + name: Xcode (advisory) + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Generate project + run: make xcode-gen + + - name: Build + run: make xcode-build + + - name: Test + run: make xcode-test diff --git a/.gitignore b/.gitignore index 6c2fcb0ca..0c12c09a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ build/ cmake-build-* -Sourcecode/private/mxtest/file/PathRoot.h +src/private/mxtest/file/PathRoot.h **/Mx.xcframework **/xcuserdata/ **/xcshareddata/ *.DS_Store +compile_commands.json diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..bcea149fa --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,79 @@ +# mx + +@./README.md + +## Project Index + +Keep this section as a Markdown table. When updating entries, maintain the table format. + +| Path | Description | +|---------------------------------|-----------------------------------------------------------------------------| +| `src/` | Main C++ source tree (public API, core elements, implementation, tests) | +| `src/include/mx/api/` | Public API headers: `*Data` structs and `DocumentManager` entry point | +| `src/private/mx/api/` | Implementation backing the public API headers | +| `src/private/mx/core/` | Strongly-typed MusicXML element classes (mostly code-generated) | +| `src/private/mx/core/elements/` | Generated element classes, one pair per MusicXML element (1182 files) | +| `src/private/mx/impl/` | Conversion layer mapping the core DOM to the public API | +| `src/private/mx/ezxml/` | Embedded lightweight XML reader/writer used by the core | +| `src/private/mx/utility/` | Shared helpers (string, parsing, file system utilities) | +| `src/private/mxtest/` | Test suite (api, core, file, import, impl, control) | +| `src/private/cpul/` | Catch-based unit-test harness and test runner main | +| `gen/version-a/` | Historical Ruby/shell scripts from the original brute-force code gen | +| `gen/version-b/` | Active Rust code generator for reproducing MusicXML 4.0 element classes | +| `data/` | MusicXML test files and expected-output suites for round-trip tests | +| `docs/musicxml.xsd` | MusicXML specification (reference) | +| `docs/ai/project/` | AI-assisted project planning and codegen design documents | +| `Makefile` | Primary build-and-test entry point (wraps CMake; `make help` lists targets) | +| `CMakeLists.txt` | CMake build configuration | + +## Code Generation - Historical Context + +`src/private/mx/core/` and `src/private/mx/core/elements/` was originally "hand-generated" by human +brute-force using Ruby scripts which can still be found in `./gen/version-a`. This was never a +one-shot solution to generating the code from the XSD spec. Rather, it was an iterative process, +solving problems encountered one-at-a-time until the XSD spec was entirely covered. As such, it is +not viable for re-use at this time, but can be used to understand the historical nature of how the +types were first generated. + +At some point, I tried to create a Rust based codegenerator in order to be able to regenerate +`mx/core`. However, this devolved and failed. It is kept in `gen/version-b` for historical +curiosity, but it never worked. + +### The Problem + +We are stuck somewhere around MusicXML 3.1 (or maybe 3.0) because we cannot reliably re-generate the +types from a newer version of the specification. MusicxML 4.0 has been out for a long time, and we +want to support it. But we need to write new code-gen tooling to reproduce the emission of the core +types and then expose the new features in `src/include/mx/api/`. + +Furthermore, many decisions in the original gen process were taken by hand. Using a hand-rolled +type, for example, instead of what would have strictly implemented the spec. There are human choices +throughout `mx/core` that will need to be preserved with future code generating efforts. + +Code generation was never, and should not in the future, be designed to generate any valid XSD +specification. Rather, the goal of code generation is bespoke, to produce what is needed for the +`mx` library from the MusicXML specification. + +## Quality Gates + +When modifying any file under `src/`, run: + +``` +make fmt && make check && make test +``` + +If the changes include anything under `src/private/mx/core/`, use `make test-all` instead of +`make test`. + +`make fmt` and `make check` run inside Docker (requires Docker on the host). + +On `make check` failure, run `make fmt` to fix formatting, then address any remaining warnings +manually. + +See `docs/ai/project/build-and-ci-design.md` for full details on the CI pipeline and quality gate +design. + +## The Project + +We are working on reverse engineering a new codegen system to regenerate mx/core for MusicXML 4.0. +See the project directory @./docs/ai/project/AGENTS.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c6fcddd8..41595da5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,21 +1,66 @@ # Changelog -All notable changes to this project will be documented in this file. -On 2020-05-31, two tags were deleted from origin, `v1.0.0` and `v1.0.1` and replaced with `v0.4.0` and `v0.4.1` respectively. -If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0` and `v1.0.1` and pull tags. + +All notable changes to this project will be documented in this file. On 2020-05-31, two tags were +deleted from origin, `v1.0.0` and `v1.0.1` and replaced with `v0.4.0` and `v0.4.1` respectively. If +you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0` and `v1.0.1` and pull +tags. ## [Unreleased] + ### API Changes + - Add support for setting an instrument's transposition at the start of the score. [#116] +- Add reading and writing of `arpeggiate`; move mark reading functions into helper classes. [#138] + +### Behavior Fixes + +- Export `stop` elements before `start` elements. [#140] +- Fix a missing `break` in `DocumentSpec` enum `toStream` that produced incorrect text (for example + `timewise` rendered as `timewiseerror`). [#145] ### Internal Changes -- Change the default-constructed value of `DynamicsEnum` to `mf` instead of `otherDynamics`. [#106]/[8a5cd6b] + +- Change the default-constructed value of `DynamicsEnum` to `mf` instead of `otherDynamics`. + [#106]/[8a5cd6b] - Change the spelling of `KindValue` enums from, e.g. `dominant11Th` to `dominant11th`. [#105] -- Break up `Strings.h` into multiple `.h` files, one for each type [#107]. (Related to codegen, [#58]). -- Rewrite `Integers.h` and `Integers.cpp`. Changed `NonNegativeInteger` to default to 0, and changed the tests that had locked-in that behavior. [#109]. (Related to codegen, [#58]). +- Break up `Strings.h` into multiple `.h` files, one for each type [#107]. (Related to codegen, + [#58]). +- Rewrite `Integers.h` and `Integers.cpp`. Changed `NonNegativeInteger` to default to 0, and changed + the tests that had locked-in that behavior. [#109]. (Related to codegen, [#58]). - Rewrite `Decimals.h` and `Decimals.cpp`. [#111]. (Related to codegen, [#58]). -- Rewrite `Enums`, `Integers` and `Decimals`. Add try parse and return bool from parse methods. [#112]. (Related to codegen, [#58]). -- Rewrite union types `FontSize` and `YesNoNumber`. Also reformat a bunch of documentation. [#113]. (Related to codegen, [#58]). +- Rewrite `Enums`, `Integers` and `Decimals`. Add try parse and return bool from parse methods. + [#112]. (Related to codegen, [#58]). +- Rewrite union types `FontSize` and `YesNoNumber`. Also reformat a bunch of documentation. [#113]. + (Related to codegen, [#58]). +- Change the example binary names to lowercase (`mxread`, `mxwrite`, `mxhide`). [#82] +- Add missing `` includes for stricter standard libraries and remove an ignored-qualifier + cast. [#145] + +### Repository, Build, and CI + +- Set up the repository for AI-assisted development: agent guides (`AGENTS.md`, + `docs/ai/project/`) and a build/CI design document. [#145] +- Replace `build.sh` with a portable `Makefile` wrapping CMake (build modes, run targets, knobs); + `make test` and `make test-all` also run the example programs. [#145] +- Add a `.clang-format` (Microsoft base) and reformat the entire `src/` tree; `make fmt` + formats in place. [#145] +- Add a pinned-toolchain Docker quality gate: `make check` runs a format check plus a warning-free + `g++-14` build, reproducible regardless of the floating CI runner images. [#145] +- Replace the single workflow with a five-job GitHub Actions pipeline (Linux quality gate, Linux GCC + full suite, macOS, Windows, advisory Xcode); archive the old workflow. [#145] +- Rename repository directories to lowercase conventional names: `Sourcecode` -> `src`, + `Documents` -> `docs`, `Resources` -> `data`, `CodeGen` -> `gen/version-b`, + `DevScripts` -> `gen/version-a`, `Xcode` -> `xcode`. +- Rename `LICENSE.txt` to `LICENSE`. +- Fix stale information in `README.md` and `docs/ai/project/build-and-ci-design.md`: remove + CircleCI badge, correct `make test-core` to `make test-all`, correct `LICENSE.txt` reference, + fix incorrect compiler attribution in CI job description, fix element file count. +- Add Apple `XCFramework` build support. [#124] +- Update the Catch2 test library to v3.2.1. [#135] +- Remove the CircleCI configuration. [#136] +[#58]: https://github.com/webern/mx/issues/58 +[#82]: https://github.com/webern/mx/pull/82 [#105]: https://github.com/webern/mx/pull/105 [#106]: https://github.com/webern/mx/pull/106 [#107]: https://github.com/webern/mx/pull/107 @@ -24,20 +69,31 @@ If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0 [#112]: https://github.com/webern/mx/pull/112 [#113]: https://github.com/webern/mx/pull/113 [#116]: https://github.com/webern/mx/pull/116 -[#58]: https://github.com/webern/mx/issues/58 +[#124]: https://github.com/webern/mx/pull/124 +[#135]: https://github.com/webern/mx/pull/135 +[#136]: https://github.com/webern/mx/pull/136 +[#138]: https://github.com/webern/mx/pull/138 +[#140]: https://github.com/webern/mx/pull/140 +[#145]: https://github.com/webern/mx/pull/145 [8a5cd6b]: https://github.com/webern/mx/commit/8a5cd6b ## [v0.5.1] - 2020-06-13 + - Fix xcode build, new headers were missing from frameworks. ## [v0.5.0] - 2020-06-13 + ### Breaking Changes + - Add support for `new-page` attributes and page layout [#94] - The `LayoutData layout` field of `ScoreData` has been renamed to `DefaultsData defaults` [#94] - 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 systems` field of `ScoreData` has been replaced by `std::map`. [#94] - - `LayoutData` is a new class (not to be confused with `DefaultsData` which previously held the name). + - This name change freed up the name `LayoutsData` to be used for a new class that better fits the + name. +- The `std::set systems` field of `ScoreData` has been replaced by + `std::map`. [#94] + - `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. - Some recurring data patterns were factored out into new classes. [#94] - The existing classes affected by these changes are: @@ -52,6 +108,7 @@ If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0 - `SystemLayoutData` ### Other Changes + - Bump C++ standard to 17 [#93] - Support non-traditional key signatures in `mx::api`. [#81] - Add a constructor for `PitchData`. [#90] @@ -71,19 +128,24 @@ If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0 [#97]: https://github.com/webern/mx/pull/97 ## [v0.4.1] - 2019-11-23 + - Mostly internal changes related to the xml parser. ## [v0.4.0] - 2019-04-08 + - A simplified data model, called `mx::api`. ## [v0.3.0] - 2017-11-20 + - MusicXML files can be parsed into the C++ classes. ## [v0.2.0] - 2016-08-21 + - MusicXML 3.0 represented in C++ classes, mostly generated from XSD using custom Ruby scripts. - MusicXML DOM classes can serialize to XML. ## [v0.1.0] - 2016-06-20 + - Initial Commit [v0.1.0]: https://github.com/webern/mx/commit/5d46609 @@ -97,44 +159,55 @@ If you cloned/forked the repository before 2020-05-31, you should delete `v1.0.0 #### Historical Notes -**Historical Note: April 7, 2019** Trying to button up a '1.0' 'release' by tying up some of the loose ends with the build, continuous integration, testing, and header leakage. -The use of the semver `1.0` implies that we hope there won't be many breaking changes. -I suppose the way I will use semver is as follows: a patch release may cause slight compilation annoyances, but nothing that would cause any rewriting of code. -A minor release may similarly require some tweaks but hopefully nothing too major. -A major release could be anything up-to a complete re-write. +**Historical Note: April 7, 2019** Trying to button up a '1.0' 'release' by tying up some of the +loose ends with the build, continuous integration, testing, and header leakage. The use of the +semver `1.0` implies that we hope there won't be many breaking changes. I suppose the way I will use +semver is as follows: a patch release may cause slight compilation annoyances, but nothing that +would cause any rewriting of code. A minor release may similarly require some tweaks but hopefully +nothing too major. A major release could be anything up-to a complete re-write. -**Historical Note: October 6, 2016:** Significant progress has been made on the `api` namespace, which is a simplified set of data structures to represent a MusicXML document. -These are being implemented as mostly-POD structs. -Currently the importing of data into these structures is well-underway, but the exporting from these data structures has not been implemented. +**Historical Note: October 6, 2016:** Significant progress has been made on the `api` namespace, +which is a simplified set of data structures to represent a MusicXML document. These are being +implemented as mostly-POD structs. Currently the importing of data into these structures is +well-underway, but the exporting from these data structures has not been implemented. -**Historical Note: August 16, 2016:** All tests are passing (core, xml and import). -The remaining items to do on the ximport feature are +**Historical Note: August 16, 2016:** All tests are passing (core, xml and import). The remaining +items to do on the ximport feature are - search for all `\\TODO's` and fix those that can be fixed - Standardize the code file copyrights and bump to version 0.2 - Rename XElement functions to better names -- Update the readme including information about the XDoc XElement classes and how to implement those interfaces. +- Update the readme including information about the XDoc XElement classes and how to implement those + interfaces. -**Historical Note: August 11, 2016:** The feature to import MusicXML files is essentially complete with most "round-trip" integration tests passing. +**Historical Note: August 11, 2016:** The feature to import MusicXML files is essentially complete +with most "round-trip" integration tests passing. **Historical Note: June 27, 2016:** An "integration" tester has been added to the MxTest executable. -This exists in ImportTest.cpp, and ImportTestImpl.h/cpp. -A top level directory "Resources" has been added to hold test input (i.e. "golden") files. -The input files are gathered from Recordare, Lilypond and MuseScore and to this I have added a few of my own scores as exported by Finale Dolet. - -Each of these test input files has been "scrubbed" using the XDoc classes (i.e. it has been round-tripped through pugixml and has been updated to a normalized MusicXML 3.0 header format. -The resultant scrubbed files are in Resources/expected. -During the test run, a csv file is written in Resources/testOutput recording a row for each test (Pass/Fail, duration of test, messages, etc). -Each time a test failure is encountered the expected file and the error file will be saved to the Resources/testOutput directory to allow for visual inspection. - -Currently this tester is a "wire-up". -All 263 of these round-trip import/export tests fail because the implementation does not yet exist in mx::core. -The next body of work will be the mx::core implementation. - -**Historical Note: June 20, 2016:** A simple interface to for XML DOM has been added in the ::ezxml:: namespace. -The key classes (pure virtual) are XDoc, XElement, XAttribute, XElementIterator, XAttributeIterator. -These are implemented by concrete classes PugiDoc, PugiElement, etc. which serve as a wrapper for the pugixml library (http://pugixml.org/). -Although this is a static library, a class XFactory can be used to create a Pugi instance of the XDoc interface. - -The idea behind using a pure virtual interface is that the client of the Music XML Class Library can, in theory choose a different XML DOM library (Xerces, TinyXML, etc) and wrap with instances of the XDoc interfaces and the Music XML core classes will not know the difference. - -**Historical Note: June 20, 2016:** The GitHub repo was bloated and has been entirely wiped-out and restarted. +This exists in ImportTest.cpp, and ImportTestImpl.h/cpp. A top level directory "data" has been +added to hold test input (i.e. "golden") files. The input files are gathered from Recordare, +Lilypond and MuseScore and to this I have added a few of my own scores as exported by Finale Dolet. + +Each of these test input files has been "scrubbed" using the XDoc classes (i.e. it has been +round-tripped through pugixml and has been updated to a normalized MusicXML 3.0 header format. The +resultant scrubbed files are in data/expected. During the test run, a csv file is written in +data/testOutput recording a row for each test (Pass/Fail, duration of test, messages, etc). +Each time a test failure is encountered the expected file and the error file will be saved to the +data/testOutput directory to allow for visual inspection. + +Currently this tester is a "wire-up". All 263 of these round-trip import/export tests fail because +the implementation does not yet exist in mx::core. The next body of work will be the mx::core +implementation. + +**Historical Note: June 20, 2016:** A simple interface to for XML DOM has been added in the +::ezxml:: namespace. The key classes (pure virtual) are XDoc, XElement, XAttribute, +XElementIterator, XAttributeIterator. These are implemented by concrete classes PugiDoc, +PugiElement, etc. which serve as a wrapper for the pugixml library (http://pugixml.org/). Although +this is a static library, a class XFactory can be used to create a Pugi instance of the XDoc +interface. + +The idea behind using a pure virtual interface is that the client of the Music XML Class Library +can, in theory choose a different XML DOM library (Xerces, TinyXML, etc) and wrap with instances of +the XDoc interfaces and the Music XML core classes will not know the difference. + +**Historical Note: June 20, 2016:** The GitHub repo was bloated and has been entirely wiped-out and +restarted. diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c7afa2e8..70a860f80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,9 @@ -cmake_minimum_required(VERSION 3.7.2) +cmake_minimum_required(VERSION 3.13) project(mx) include(GNUInstallDirs) include(CMakePackageConfigHelpers) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CPP_VERSION 17) option(MX_BUILD_TESTS "build or skip the test suite" OFF) @@ -16,7 +17,7 @@ option( set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) -set(SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/Sourcecode") +set(SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/src") set(PRIVATE_DIR "${SOURCE_ROOT}/private") set(PUBLIC_DIR "${SOURCE_ROOT}/include") @@ -46,6 +47,12 @@ source_group( "utility" FILES ${SRC_MX_UTILITY} ) source_group( "ezxml" FILES ${SRC_MX_EZXML} ) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD ${CPP_VERSION}) +if(MSVC) + target_compile_options(${PROJECT_NAME} PRIVATE /W4) +else() + target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra) +endif() + target_include_directories(${PROJECT_NAME} PRIVATE ${PRIVATE_DIR}) # these header paths are a little different to make it easier to copy-and-paste the ezxml code over to diff --git a/CodeGen/.idea/.gitignore b/CodeGen/.idea/.gitignore deleted file mode 100644 index e54edd16d..000000000 --- a/CodeGen/.idea/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/shelf/ -/workspace.xml -/dataSources/ -/dataSources.local.xml -/httpRequests/ -vcs.xml diff --git a/CodeGen/.idea/CodeGen.iml b/CodeGen/.idea/CodeGen.iml deleted file mode 100644 index 1b9b74e8c..000000000 --- a/CodeGen/.idea/CodeGen.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CodeGen/.idea/codeStyles/codeStyleConfig.xml b/CodeGen/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index a55e7a179..000000000 --- a/CodeGen/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/CodeGen/.idea/inspectionProfiles/Project_Default.xml b/CodeGen/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 1a6adf94a..000000000 --- a/CodeGen/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/CodeGen/.idea/modules.xml b/CodeGen/.idea/modules.xml deleted file mode 100644 index 185e828dd..000000000 --- a/CodeGen/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/CodeGen/.idea/runConfigurations/run.xml b/CodeGen/.idea/runConfigurations/run.xml deleted file mode 100644 index 52f5cfcb8..000000000 --- a/CodeGen/.idea/runConfigurations/run.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - \ No newline at end of file diff --git a/CodeGen/.idea/runConfigurations/show.xml b/CodeGen/.idea/runConfigurations/show.xml deleted file mode 100644 index 84ec8c5ca..000000000 --- a/CodeGen/.idea/runConfigurations/show.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - \ No newline at end of file diff --git a/DevScripts/adjustElementsCpp.rb b/DevScripts/adjustElementsCpp.rb deleted file mode 100755 index aad14a7d4..000000000 --- a/DevScripts/adjustElementsCpp.rb +++ /dev/null @@ -1,25 +0,0 @@ -lines = [] - -File.open("../Sourcecode/mx/core/Elements.cpp", "r") do |input_file| - input_file.each_line do |line| - lines << line - end -end - -File.open("../Sourcecode/mx/core/Elements.cpp.replace", "w") do |f| - write_line = true - lines.each do |line| - - rx = /^\s*$/ - skip_line = ( line =~ rx ) != nil - - - if !skip_line - f << line - end - - - - end -end - diff --git a/DevScripts/parseXsd.rb b/DevScripts/parseXsd.rb deleted file mode 100644 index fdd310759..000000000 --- a/DevScripts/parseXsd.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'rexml/document' -require 'rexml/xpath' -doc = REXML::Document.new(File.new('../Documents/musicxml.xsd')) - -stuff = doc.elements.to_a - -REXML::XPath.each(doc, "//xs:element") { |element| - puts element.attributes["name"] -} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..8375b9e1a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,54 @@ +# syntax=docker/dockerfile:1 +# +# Pinned quality-gate toolchain for mx. +# +# This image is not a deliverable. It is a deterministic environment for the +# `make fmt` and `make check` quality gates: Ubuntu 24.04 with a pinned +# g++-14 / clang-format-18 toolchain. It compiles with GCC (not clang) so the +# gate matches the GCC the required Linux CI jobs use - the same standard +# library, so a `make check` pass locally means the GCC jobs compile too. +# Pinning keeps clang-format output and the warning set deterministic +# regardless of the floating CI runner image. +# +# The Makefile drives this file: outside the container `make check` runs +# `docker buildx build --target ...`; inside the container (where +# MX_RUNNING_IN_DOCKER=1) the same `make check` runs the tools directly. +# +# See docs/ai/project/build-and-ci-design.md. + +FROM ubuntu:24.04 AS base + +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc-14 \ + g++-14 \ + clang-format-18 \ + cmake \ + make \ + && rm -rf /var/lib/apt/lists/* + +# Unversioned name so the Makefile invokes the pinned formatter without +# knowing the version suffix. The compiler is selected via CC/CXX below. +RUN ln -sf /usr/bin/clang-format-18 /usr/local/bin/clang-format + +# Build with the pinned GCC so the gate matches the GCC the required Linux CI +# jobs use (same compiler family + libstdc++). CMake reads CC/CXX at first +# configure. MX_RUNNING_IN_DOCKER tells the Makefile it is inside the +# container and should run the tools directly. +ENV MX_RUNNING_IN_DOCKER=1 \ + CC=gcc-14 \ + CXX=g++-14 + +WORKDIR /workspace +COPY . . + +# --- run stage: run `make check` for its exit code -------------------------- +FROM base AS run +RUN --mount=type=cache,target=/workspace/build make check + +# --- fmt stage: format in place, then export only the src tree ------- +FROM base AS fmt +RUN --mount=type=cache,target=/workspace/build make fmt + +FROM scratch AS fmt-out +COPY --from=fmt /workspace/src /src diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..4d022c751 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Matthew James Briggs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 2d9c94606..000000000 --- a/LICENSE.txt +++ /dev/null @@ -1,8 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2017 Matthew James Briggs - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..5f6ab1e9c --- /dev/null +++ b/Makefile @@ -0,0 +1,296 @@ +# mx build/test driver +# ============================================================================ +# +# This Makefile is a thin, portable convenience wrapper around CMake. It does +# not replace CMake; it just encodes the handful of build/test configurations +# this project actually uses so you don't have to remember the option combos. +# +# It assumes a POSIX shell and that `cmake` is on PATH. On Windows it is +# best-effort: install CMake plus GNU make and a POSIX shell (Git Bash, MSYS2, +# or WSL) and it works there too. The underlying compiler/generator can still +# be MSVC -- builds go through `cmake --build`, which is generator-agnostic. +# +# Requires CMake >= 3.13 (for `cmake -S/-B` and `--build --parallel`). +# +# ---------------------------------------------------------------------------- +# Quality gates run in Docker +# ---------------------------------------------------------------------------- +# +# `make fmt` and `make check` run inside a Docker container with a pinned +# toolchain (Ubuntu 24.04 + clang-18 + libc++) so formatting and compiler +# warnings are deterministic on any machine regardless of the floating CI +# runner image. The build/test targets (`make test`, `make test-all`, ...) +# run natively with the local compiler. +# See docs/ai/project/build-and-ci-design.md. +# +# ---------------------------------------------------------------------------- +# Build modes +# ---------------------------------------------------------------------------- +# +# The project exposes three CMake options: MX_BUILD_TESTS, MX_BUILD_CORE_TESTS, +# and MX_BUILD_EXAMPLES. Only three points on that matrix are workflows the +# project actually documents, so those are the three build targets: +# +# lib TESTS=off CORE=off EXAMPLES=off +# +# dev TESTS=on CORE=off EXAMPLES=on +# The README's "recommended configuration for development" +# +# core TESTS=on CORE=on EXAMPLES=on +# "if you make changes in the mx::core namespace" -- +# e.g. regenerating mx::core for a new MusicXML version. Slow compile. +# +# ---------------------------------------------------------------------------- +# Build directory layout +# ---------------------------------------------------------------------------- +# +# Each mode builds into build// with its own CMake cache and +# incremental state, e.g. build/dev/Debug, build/core/Debug. Because the modes +# do not share a directory, switching from `core` back to `dev` (or flipping +# BUILD_TYPE) never reconfigures and never recompiles the slow core tests. +# `build/` is already in .gitignore. +# +# ---------------------------------------------------------------------------- +# Knobs (environment / make variables -- these are overrides, not modes) +# ---------------------------------------------------------------------------- +# +# JOBS Parallel compile jobs. Auto-detected; override: JOBS=8 make dev +# BUILD_TYPE CMake build type, default Debug. Passed as -DCMAKE_BUILD_TYPE +# (single-config generators) AND --config (multi-config: MSVC, +# Xcode), so it is correct on every generator. +# GENERATOR CMake generator. Unset = CMake's platform default (Unix +# Makefiles on Linux/macOS, Visual Studio on Windows). Override: +# GENERATOR=Ninja make dev +# ARGS Forwarded to the mxtest (Catch2) binary, e.g. +# make test ARGS='[core]' or make test ARGS='--list-tests' +# DOCKER Docker executable (default: docker). +# +# ============================================================================ + +CMAKE ?= cmake +DOCKER ?= docker +BUILD_TYPE ?= Debug +BUILD_ROOT := build + +# In GitHub Actions, crazy-max/ghaction-github-runtime exports +# ACTIONS_RUNTIME_TOKEN. When present, push/pull the Docker layer cache to the +# GitHub Actions cache so linux-gate does not reinstall the toolchain every +# run. Absent (local, fork PRs) -> no flags, plain build. Same `make check` +# everywhere. +ifneq ($(ACTIONS_RUNTIME_TOKEN),) +DOCKER_CACHE := --cache-from type=gha --cache-to type=gha,mode=max +endif + +# Portable CPU-count detection. Tried in order; the final echo always succeeds +# (Windows cmd/PowerShell exports NUMBER_OF_PROCESSORS; otherwise fall back 4). +JOBS ?= $(shell nproc 2>/dev/null \ + || sysctl -n hw.ncpu 2>/dev/null \ + || getconf _NPROCESSORS_ONLN 2>/dev/null \ + || echo "$${NUMBER_OF_PROCESSORS:-4}") + +# Optional -G flag. Generator names contain spaces, so quote when set. +ifneq ($(strip $(GENERATOR)),) +GEN_ARG := -G "$(GENERATOR)" +endif + +# build// for the given mode ($1). +mode_dir = $(BUILD_ROOT)/$(1)/$(BUILD_TYPE) + +# Configure + build a mode. $1 = mode name, then the three MX_BUILD_* values. +define cmake_build + $(CMAKE) -S . -B $(call mode_dir,$(1)) \ + -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \ + -DMX_BUILD_TESTS=$(2) \ + -DMX_BUILD_CORE_TESTS=$(3) \ + -DMX_BUILD_EXAMPLES=$(4) \ + $(GEN_ARG) + $(CMAKE) --build $(call mode_dir,$(1)) --parallel $(JOBS) --config $(BUILD_TYPE) +endef + +# Locate and run a built binary. CMake places it at / for +# single-config generators but //(.exe) for +# multi-config ones (MSVC, Xcode), so probe both. $1 = mode dir, $2 = binary +# name, $3 = extra args. +define run_bin + @d='$(1)'; b='$(2)'; found=''; \ + for p in "$$d/$$b" "$$d/$$b.exe" "$$d/$(BUILD_TYPE)/$$b" "$$d/$(BUILD_TYPE)/$$b.exe"; do \ + if [ -x "$$p" ]; then found="$$p"; break; fi; \ + done; \ + if [ -z "$$found" ]; then echo "error: $$b not found under $$d" >&2; exit 1; fi; \ + echo ">> $$found $(3)"; \ + "$$found" $(3) +endef + +# Run the three example programs from the given mode dir ($1). The test +# targets run these too, so the examples are exercised everywhere tests run. +define run_examples + $(call run_bin,$(1),mxread,) + $(call run_bin,$(1),mxwrite,) + $(call run_bin,$(1),mxhide,) +endef + +.DEFAULT_GOAL := help +.PHONY: help lib dev core test test-all examples-run all clean clean-docker \ + check-docker fmt check xcode-gen xcode-build xcode-test + +help: + @echo 'mx build/test targets (see the comments at the top of the Makefile):' + @echo '' + @echo 'Done with a code change? Run:' + @echo ' make fmt && make check && make test' + @echo ' (use make test-all instead of make test if you touched mx/core)' + @echo '' + @echo 'Quality gates (run in Docker, pinned toolchain):' + @echo ' make fmt Format all C++ files under src/.' + @echo ' make check fmt-check + warning-free build.' + @echo '' + @echo 'Build (native):' + @echo ' make lib Build just the static library (no tests/examples).' + @echo ' make dev Build tests (no slow core tests) + examples.' + @echo ' make core Build the full suite incl. slow mx::core tests.' + @echo '' + @echo 'Run (native):' + @echo ' make test Build dev, run examples + mxtest. ARGS= forwarded.' + @echo ' make test-all Build core, run examples + full mxtest. ARGS= fwd.' + @echo ' make examples-run Build dev, then run mxread/mxwrite/mxhide.' + @echo ' make all Build core, run examples + full mxtest.' + @echo '' + @echo 'Housekeeping:' + @echo ' make clean Remove the entire $(BUILD_ROOT)/ tree.' + @echo ' make clean-docker Remove the Docker build cache.' + @echo '' + @echo 'Xcode:' + @echo ' make xcode-gen Generate Xcode project in build/xcode/.' + @echo ' make xcode-build Build the Xcode project.' + @echo ' make xcode-test Run tests via xcodebuild.' + @echo '' + @echo 'Knobs: JOBS (=$(JOBS)) BUILD_TYPE (=$(BUILD_TYPE)) GENERATOR ARGS DOCKER' + @echo 'Layout: $(BUILD_ROOT)//$(BUILD_TYPE)/' + +# --- Compile-only targets --------------------------------------------------- + +lib: + $(call cmake_build,lib,off,off,off) + +dev: + $(call cmake_build,dev,on,off,on) + +core: + $(call cmake_build,core,on,on,on) + +# --- Run targets ------------------------------------------------------------ + +test: dev + $(call run_examples,$(call mode_dir,dev)) + $(call run_bin,$(call mode_dir,dev),mxtest,$(ARGS)) + +test-all: core + $(call run_examples,$(call mode_dir,core)) + $(call run_bin,$(call mode_dir,core),mxtest,$(ARGS)) + +examples-run: dev + $(call run_examples,$(call mode_dir,dev)) + +# Behavioral replacement for the old build.sh: full build + run everything. +all: core + $(call run_examples,$(call mode_dir,core)) + $(call run_bin,$(call mode_dir,core),mxtest,$(ARGS)) + +# --- Housekeeping ----------------------------------------------------------- + +clean: + rm -rf $(BUILD_ROOT) + +clean-docker: + -$(DOCKER) buildx prune -af + @echo "Removed Docker build cache." + +# --- Quality targets -------------------------------------------------------- +# +# fmt/check run inside a pinned Docker toolchain. The Makefile detects +# MX_RUNNING_IN_DOCKER (set by the Dockerfile): inside the container it runs +# the tools directly; outside it builds the image and runs the target inside +# it via `docker buildx build`. + +FIND_CPP := find src \ + -path 'src/private/cpul' -prune -o \ + -name 'pugixml.cpp' -prune -o \ + -name 'pugixml.hpp' -prune -o \ + -name 'pugiconfig.hpp' -prune -o \ + -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -print + +check-docker: + @command -v $(DOCKER) >/dev/null 2>&1 || \ + { echo "Docker not found. The quality gates (fmt/check/lint) run in"; \ + echo "Docker with a pinned toolchain. Install Docker to continue:"; \ + echo " https://docs.docker.com/get-docker/"; \ + exit 1; } + +ifdef MX_RUNNING_IN_DOCKER + +# ===== Inside the container: run the pinned tools directly ================== + +fmt: + @$(FIND_CPP) | xargs clang-format -i + @echo "Formatted all C++ files under src/" + +check: + @echo "=== fmt-check ===" + @$(FIND_CPP) | xargs clang-format --dry-run --Werror + @echo "=== build (warning-free) ===" + @mkdir -p $(BUILD_ROOT) + @$(CMAKE) -S . -B $(call mode_dir,dev) \ + -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \ + -DMX_BUILD_TESTS=on \ + -DMX_BUILD_CORE_TESTS=off \ + -DMX_BUILD_EXAMPLES=on \ + $(GEN_ARG) > $(BUILD_ROOT)/build.log 2>&1 \ + || { cat $(BUILD_ROOT)/build.log; \ + echo "ERROR: cmake configure failed (see above)"; exit 1; } + @$(CMAKE) --build $(call mode_dir,dev) --parallel $(JOBS) --config $(BUILD_TYPE) \ + >> $(BUILD_ROOT)/build.log 2>&1; status=$$?; \ + cat $(BUILD_ROOT)/build.log; \ + if [ $$status -ne 0 ]; then \ + echo "ERROR: build failed (see above)"; exit $$status; \ + fi; \ + if grep -q 'warning:' $(BUILD_ROOT)/build.log; then \ + echo "ERROR: build emitted warnings (see above)"; exit 1; \ + fi + @echo "=== check passed ===" + +else + +# ===== Outside the container: delegate to Docker =========================== + +fmt: check-docker + $(DOCKER) buildx build --target fmt-out \ + --output type=local,dest=. $(DOCKER_CACHE) . + @echo "Formatted all C++ files under src/" + +check: check-docker + $(DOCKER) buildx build --target run \ + --output type=cacheonly $(DOCKER_CACHE) . + +endif + +# --- Xcode targets ---------------------------------------------------------- + +XCODE_DIR := $(BUILD_ROOT)/xcode + +xcode-gen: + $(CMAKE) -G Xcode -S . -B $(XCODE_DIR) \ + -DMX_BUILD_TESTS=on \ + -DMX_BUILD_CORE_TESTS=off \ + -DMX_BUILD_EXAMPLES=on + +xcode-build: xcode-gen + $(CMAKE) --build $(XCODE_DIR) --config $(BUILD_TYPE) + +xcode-test: xcode-build + @found=''; \ + for p in "$(XCODE_DIR)/$(BUILD_TYPE)/mxtest" "$(XCODE_DIR)/Debug/mxtest"; do \ + if [ -x "$$p" ]; then found="$$p"; break; fi; \ + done; \ + if [ -z "$$found" ]; then echo "error: mxtest not found under $(XCODE_DIR)" >&2; exit 1; fi; \ + echo ">> $$found"; \ + "$$found" diff --git a/README.md b/README.md index 2bcbbd1ea..e3ffbed40 100644 --- a/README.md +++ b/README.md @@ -1,867 +1,894 @@ -MusicXML Class Library -====================== - -- Author: Matthew James Briggs -- License: MIT -- Version: 1.0 -- Supported MusicXML Version: 3.0 -- Language: C++17 - ------------------------------------------ - -[![CircleCI](https://circleci.com/gh/webern/mx.svg?style=svg)](https://circleci.com/gh/webern/mx) - -## Introduction - -This project is a C++ library for working with MusicXML. - -# Build - -Building and running tests should be as simple as: - -``` -git clone https://github.com/webern/mx.git mx -mkdir build -cd build -cmake ../mx -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=off -DMX_BUILD_EXAMPLES=on -make -j6 -./mxtest -``` - -### Cmake Options - -There are three `cmake` options: - -``` - -DMX_BUILD_TESTS=on - -DMX_BUILD_CORE_TESTS=off - -DMX_BUILD_EXAMPLES=on -``` - -The configuration shown above is the recommended configuration for development. -If you just need the lib then turn off all three of the `cmake` options. -The 'core tests' take a long time to compile. -You only need to run them if you make changes in the `mx::core` namespace. - -### Build Tenets - -* `mx` should not depend on any outside libraries (no deps). -* `mx` third-party code should be kept to a minimum. -* `mx` third-party code should be checked into the `mx` repo and compiled as part of the `mx` library. -* `mx` should not depened on any package manager, though it may be published into any package manager. - -### Using `mx` in a Cmake Project - -The following script demonstrates how you can start a new cmake project that uses `mx` by commiting its sourcecode into your project: - -```sh -#!/bin/bash -se -eou pipefail - -# this script demonstrates how to depend on mx by including it in your -# sourcecode tree. - -# if given, the first argument is a path to directory where the new -# project will be created. -REPO="${1:-/tmp/$(uuidgen)}" -echo "Creating a new project in: ${REPO}" - -# create a new git repository for your project -mkdir -p "${REPO}" -cd "${REPO}" -git init -# bring the mx sourcecode into your project into a temporary location -git clone https://github.com/webern/mx.git mxtemp - -# copy only what we need. all we need is the Sourcode directory, the -# cmake file, the license, and the .gitignore file (helpful since there -# is one generated file.) -mkdir mx -mv mxtemp/Sourcecode mx/Sourcecode -mv mxtemp/.gitignore mx/.gitignore -mv mxtemp/LICENSE.txt mx/LICENSE.txt -mv mxtemp/CMakeLists.txt mx/CMakeLists.txt -# we don't need the test code, either -rm -rf mx/Sourcecode/private/mxtest -rm -rf mxtemp - -# commit the mx sourcecode to our project repo -git add --all && git commit -m'mx sourcecode' - -# create a main.cpp file -cat <<- "EOF" > main.cpp -#include -#include "mx/api/ScoreData.h" -#include "mx/api/DocumentManager.h" - -int main () { - using namespace mx::api; - ScoreData score{}; - score.workTitle = "Hello World"; - NoteData note{}; - note.durationData.durationName = DurationName::quarter; - note.pitchData.step = Step::d; - VoiceData voiceData{}; - voiceData.notes.push_back(note); - StaffData staff{}; - staff.voices[0] = voiceData; - MeasureData measure{}; - measure.staves.push_back(staff); - PartData part{}; - part.measures.push_back(measure); - score.parts.push_back(part); - auto& mgr = DocumentManager::getInstance(); - const auto id = mgr.createFromScore(score); - mgr.writeToStream(id, std::cout); - mgr.destroyDocument(id); -} -EOF - -# create a cmake file -cat <<- "EOF" > CMakeLists.txt -cmake_minimum_required(VERSION 3.17) -project(my-musicxml-proj) -set(CMAKE_CXX_STANDARD 17) -set(CPP_VERSION 17) - -add_executable(my-musicxml-proj main.cpp) -add_subdirectory(mx) -target_link_libraries(my-musicxml-proj mx) -target_include_directories(my-musicxml-proj PRIVATE mx/Sourcecode/include) -EOF - -# create a .gitignore file to ignore a build directory -cat <<- "EOF" > .gitignore -build/ -EOF - -git add --all && git commit -m'musicxml hello world' - -# create a build directory -mkdir build - -# build your project -cd build -cmake .. && make -j10 -# run your executable -./my-musicxml-proj -``` - -### Xcode Project - -The Xcode project (checked-in to the repo) has targets for iOS and macOS frameworks and dylibs. -These are not specified in the cmake file. -Contributors are not required to keep the Xcode project up-to-date. -If you add, move or remove files from the codebase, it is likely that the Xcode CI run will fail. -This will not prevent a contribution from being merged, the maintainer will fix the project after-the-fact. - - -# Using `mx` - -## API - -The `mx::api` namespace is intended to be a simplified structural representation of MusicXML. -It should be more intuitive than manipulating the DOM representation directly. -In particular, voices and time positions are more explicitly managed. -Some complexities, on the other hand, are retained in `mx::api`, such as the need to manage beam starts and stops explicitly. - -#### Writing MusicXML with `mx::api` - -```C++ -#include -#include -#include -#include - -#include "mx/api/DocumentManager.h" -#include "mx/api/ScoreData.h" - -// set this to 1 if you want to see the xml in your console -#define MX_WRITE_THIS_TO_THE_CONSOLE 0 - -int main(int argc, const char * argv[]) -{ - using namespace mx::api; - const auto qticks = 4; - - // create a score - auto score = ScoreData{}; - score.workTitle = "Mx Example"; - score.composer = "Matthew James Briggs"; - score.copyright = "Copyright (c) 2019"; - score.ticksPerQuarter = qticks; - - // create a part - score.parts.emplace_back( PartData{} ); - auto& part = score.parts.back(); - - // give the part a name - part.name = "Flute"; - part.abbreviation = "Fl."; - part.displayName = "Flute"; - part.displayAbbreviation = "Fl."; - - // give the part an instrument - part.instrumentData.soundID = SoundID::windFlutesFlute; - part.instrumentData.midiData.channel = 1; - part.instrumentData.midiData.program = 74; - - // add a measure - part.measures.emplace_back( MeasureData{} ); - auto& measure = part.measures.back(); - measure.timeSignature.beats = 4; - measure.timeSignature.beatType = 4; - measure.timeSignature.isImplicit = false; - - // add a staff - measure.staves.emplace_back( StaffData{} ); - auto& staff = measure.staves.back(); - - // set the clef - auto clef = ClefData{}; - clef.setTreble(); - staff.clefs.emplace_back( clef ); - - // add a voice - staff.voices[0] = VoiceData{}; - auto& voice = staff.voices.at( 0 ); - - const auto quarter = qticks; - const auto half = qticks * 2; - const auto eighth = qticks / 2; - - // add a few notes - auto currentTime = 0; - auto note = NoteData{}; - note.pitchData.step = Step::d; - note.pitchData.alter = 1; - note.pitchData.octave = 5; - note.pitchData.accidental = Accidental::sharp; - note.durationData.durationName = DurationName::half; - note.durationData.durationTimeTicks = half; - note.tickTimePosition = currentTime; - voice.notes.push_back( note ); - - // advance our time - currentTime += half; - - note.pitchData.step = Step::e; - note.pitchData.alter = 0; - note.pitchData.octave = 5; - note.pitchData.accidental = Accidental::none; - note.durationData.durationName = DurationName::eighth; - note.durationData.durationTimeTicks = eighth; - note.tickTimePosition = currentTime; - // beams are handled explicitly in musicxml - note.beams.push_back( Beam::begin ); // start an eighth-note beam - voice.notes.push_back( note ); - currentTime += eighth; - - note.pitchData.step = Step::f; - note.pitchData.alter = 0; - note.pitchData.octave = 5; - note.pitchData.accidental = Accidental::none; - note.durationData.durationName = DurationName::eighth; - note.tickTimePosition = currentTime; - note.durationData.durationTimeTicks = eighth; - note.beams.clear(); - note.beams.push_back( Beam::end ); // end the eighth-note beam - voice.notes.push_back( note ); - currentTime += eighth; - - note.pitchData.step = Step::e; - note.pitchData.alter = 0; - note.pitchData.octave = 5; - note.pitchData.accidental = Accidental::none; - note.durationData.durationName = DurationName::quarter; - note.durationData.durationTimeTicks = quarter; - note.tickTimePosition = currentTime; - note.beams.clear(); - voice.notes.push_back( note ); - - // the document manager is the liaison between our score data and the MusicXML DOM. - // it completely hides the MusicXML DOM from us when using mx::api - auto& mgr = DocumentManager::getInstance(); - const auto documentID = mgr.createFromScore( score ); - - // write to the console - #if MX_WRITE_THIS_TO_THE_CONSOLE - mgr.writeToStream( documentID, std::cout ); - std::cout << std::endl; - #endif - - // write to a file - mgr.writeToFile( documentID, "./example.musicxml" ); - - // we need to explicitly delete the object held by the manager - mgr.destroyDocument( documentID ); - - return 0; -} -``` - -#### Reading MusicXML with `mx::api` - -```C++ -#include "mx/api/DocumentManager.h" -#include "mx/api/ScoreData.h" - -#include -#include -#include -#include - -#define MX_IS_A_SUCCESS 0 -#define MX_IS_A_FAILURE 1 - -constexpr const char* const xml = R"( - - - - - - Music - - - - - - 1 - - 0 - - - - G - 2 - - - - - C - 4 - - 4 - whole - - - - -)"; - -int main(int argc, const char * argv[]) -{ - using namespace mx::api; - - // create a reference to the singleton which holds documents in memory for us - auto& mgr = DocumentManager::getInstance(); - - // place the xml from above into a stream object - std::istringstream istr{ xml }; - - // ask the document manager to parse the xml into memory for us, returns a document ID. - const auto documentID = mgr.createFromStream( istr ); - - // get the structural representation of the score from the document manager - const auto score = mgr.getData( documentID ); - - // we need to explicitly destroy the document from memory - mgr.destroyDocument(documentID); - - // make sure we have exactly one part - if( score.parts.size() != 1 ) - { - return MX_IS_A_FAILURE; - } - - // drill down into the data structure to retrieve the note - const auto& part = score.parts.at( 0 ); - const auto& measure = part.measures.at( 0 ); - const auto& staff = measure.staves.at( 0 ); - const auto& voice = staff.voices.at( 0 ); - const auto& note = voice.notes.at( 0 ); - - if( note.durationData.durationName != DurationName::whole ) - { - return MX_IS_A_FAILURE; - } - - if( note.pitchData.step != Step::c ) - { - return MX_IS_A_FAILURE; - } - - return MX_IS_A_SUCCESS; -} -``` - -# Implementation Details - -The MusicXML classes in `mx::core` are tightly bound to the `musicxml.xsd` specification. -MusicXML can be challenging to use and the `mx::core` class structure mirrors the complexity of the MusicXML specification. -A simplified representation is available in `mx::api`. -It is possible to work with a subset of MusicXML using only `mx::api`, without delving into `mx::core`. - -##### Namespaces - -```C++ -using namespace mx::api; // an easier interface for reading and writing MusicXML -using namespace mx::core; // a direct representation of a musicxml document in C++ classes -using namespace mx::impl // the logic that translates between mx::api and mx::core -using namespace mx::utility // a typical catch-all for generic stuff like logging macros -using namespace ezxml; // generic serialization and deserialization of xml -``` - -##### `mx::api` - -The `mx::api` namespace is a set of 'plain old data' structs that represent a simplified model of MusicXML. -For example, here is the `ScoreData.h`, which represents the top level of the object heirarchy: - -```C++ -class ScoreData -{ -public: - MusicXmlVersion musicXmlVersion; - std::string musicXmlType; - std::string workTitle; - std::string workNumber; - std::string movementTitle; - std::string movementNumber; - std::string composer; - std::string lyricist; - std::string arranger; - std::string publisher; - std::string copyright; - EncodingData encoding; - std::vector pageTextItems; - DefaultsData defaults; - std::vector parts; - std::vector partGroups; - int ticksPerQuarter; - std::map layout; -}; -``` - -`mx::api` and `mx::core` are kept completely separate.\ -That is, `mx::api` data is serialized into `mx::core` data, which is then serialized into MusicXML. -The `mx::api` struct allow us to simplify things like specifying a note's tick time position, and allowing the serialization process to take care of details such as `` `` elements. - -##### `mx::core` - -The `mx::core` namespace contains the MusicXML representation objects such as elements and attributes. -`mx::core` was mostly generated from `musicxml.xsd` with plenty of intervention by hand. - -###### XML Choices and Groups - -In the `musicxml.xsd` there are many cases of `xs:choice` or `xs:group` being used. -These constructs are typically represented in the `mx::core` class structure the same way that they are found in the `musicxml.xsd` specification. -The interfaces in this namespace are relatively stable, however they are tightly bound to MusicXML's specification and thus they will change when it comes time to support a future version of MusicXML. - -##### `mx::impl` - -`mx::impl` is the translation layer between `mx::api` and `mx::core`. - -##### `mx::utility` - -This namespace is small. -It mostly contains macros and small, generic functions. - -##### `ezxml` - -The `ezxml` namespace contains generic XML DOM functionality. -Under the hood [pugixml](http://pugixml.org/) is being used. -See the XML DOM section for more information. -Note that, even though `ezxml` can stand alone as a useful abstraction, we build it as if it were entirely owned by the `mx` project. -Additionally, we check the `pugixml` library in and build it as if it were part of the `mx` project. -This is in keeping with the build tenets [above](#build-tenets) - -##### Partwise vs. Timewise -There are two types of MusicXML documents, `partwise` and `timewise`. -A partwise document consists of a set of parts which contain measures. -A timewise document consists of a set of measures which contain parts. -Partwise is used more often by MusicXML applications while Timewise documents seem to be rare or even nonresistant. -Nonetheless *MusicXML Class Library* implements both Timewise and Partwise. -The class `mx::core::Document` can hold *either* a Partwise *or* a Timewise score. -Note that it actually holds both, but only one or the other is 'active' (this is similar to how `xsd` `choice` constructs are handled). -You can check the inner document type with the getChoice function. -You can convert between Partwise and Timewise with the convertContents function. - -##### Elements -Each XML element is represented by a class which derives from ElementInterface. -Elements are created and used by way of shared pointers. -Each element comes with a set of using/typedef statements as well as a convenience function for making the shared pointers. - -##### Shared Pointers -Many elements contain other elements. -When they do, these data members will also be shared pointers. -Get/set functions will allow access to the data members by accepting and returning shared pointers. -If you attempt to set a data member to a nullptr, the setter function will silently do nothing. -Thus we can be reasonably assured our objects will never return nullptr. - -For example - -```C++ -std::shared_ptr foo; /* nullptr! */ -bar->setFoo( foo ); /* no-op because you passed a nullptr */ -auto x = bar->getFoo(); /* guaranteed not to be null */ -x->somefuntion(); /* OK to dereference without checking for nullptr */ -``` - -##### Optional Member Data -Many of the elements in MusicXML are optional. -In these cases there is a bool which indicates whether or not the element is present. -The bool serves as a flag indicating whether or not the optional element will be output when you stream out your MusicXML document. -The bool has no side-effect on the element who's presence/absence it represents. -So for example we may set some data: - -```C++ -foo->setValue( "hello" ); -bar->setFoo( foo ); -``` - -But in this example, if Foo is an optional member of Bar, then we must also set hasFoo to *true* or else foo will not be in the XML output. - -```C++ -bar->toStream(...); /* Foo is not in the output! */ -bar->setHasFoo( true ); -bar->toStream(...); /* Now we see hello in the output. */ -``` - -Also note that setting HasFoo to *false* does not mean that Foo's value is gone. - -```C++ -bar->setHasFoo( false ); /* The XML document no longer has a Foo */ -bar->getFoo()->getValue() == "hello"; /* True! The value still exists but is not present in the XML. */ -``` - -##### Optional Member Data with Unbounded Occurrences -Sometimes an element may contain zero, one, or many occurrences of another element. -For example - -```xml - -``` - -In this case there will be a collection of Key objects and the getter/setters will look like this, where `KeySet` is a typedef of `std::vector`. - -```C++ -const KeySet& getKeySet() const; -void addKey( const KeyPtr& value ); -void removeKey( const KeySetIterConst& value ); -void clearKeySet(); -KeyPtr getKey( const KeySetIterConst& setIterator ) const; -``` - -##### Required Member Data with Unbounded Occurrences -Sometimes an element is required, but you may optionally have more than one. -For example - -```xml - -``` - -In this case, minOccurs="1" (by default per XSD language rules). -The functions will look just like the previous example, but they will behave differently - -```C++ -const DirectionTypeSet& getDirectionTypeSet() const; -void addDirectionType( const DirectionTypePtr& value ); -void removeDirectionType( const DirectionTypeSetIterConst& value ); -void clearDirectionTypeSet(); -DirectionTypePtr getDirectionType( const DirectionTypeSetIterConst& setIterator ) const; -``` - -When the containing element is constructed, a single DirectionType will be default constructed and pushed onto the vector. -Thus you will have one default constructed DirectionType in the set upon construction. - -If you try to call removeDirectionType with only one DirectionType in the set (size==1) nothing will happen. -You will still have a single DirectionType in the collection. - -When you call clearDirectionTypeSet vector.clear() will be called but it will follow up by pushing a default constructed DirectionType onto the vector so you will still have size==1. - -As it turns out, this design choice tends to be annoying in practice. -On the upside, it does guarantee that your MusicXML document will be valid, even if you forget to add a required element. -The downside is that it means you have to deal with the fact that a default constructed element always exists in the set, so you must replace or remove the first element. -Furthermore, you cannot remove the existing element until another one has been added. -Here are the two patterns I have used for this (pseudocode). - -**Pattern 1:** Replace the first element by dereferencing the begin() iterator: - -```C++ -bool isFirstAdded = false; -for( auto stuffElement : stuffElementsIWantToAdd ) -{ - if( !isFirstAdded ) - { - *( myElementIWantToAddThemTo->getStuffSet().begin() ) = stuffElement; - isFirstAdded = true; - } - else - { - myElementIWantToAddThemTo->addStuff( stuffElement ); - } -} -``` - -**Pattern 2:** Remove the default element *After* adding a replacement: - -```C++ -bool isFirstAdded = false; -for( auto stuffElement : stuffIWantToAdd ) -{ - myElementIWantToAddThemTo->addStuff( stuffElement ); - if( !isFirstAdded ) - { - myElementIWantToAddThemTo->removeStuff( myElementIWantToAddThemTo->getStuffSet().cbegin() ) - isFirstAdded = true; - } -} -``` - -Pattern 1 always works, even if you're not sure whether or not the `minOccurs="1"` or `"0"`. -Pattern 2 only works when `minOccurs="1"`. -There are no cases where `minOccurs` is greater than 1. - -##### Member Data with Bounded maxOccurs -```xml - -``` -In this case if you call addBeam when there are already 8 beams in the vector, nothing will happen. - -##### xs:groups -For an xs:group there is usually a single 'element' class which represents the group of elements. -For example this XSD snippet: - -```xml - - - - - - -``` - -is represented by this class: - -```C++ -class EditorialGroup : public ElementInterface -{ -public: - EditorialGroup(); - - /* ... other stuff ... */ - - /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ - FootnotePtr getFootnote() const; - void setFootnote( const FootnotePtr& value ); - bool getHasFootnote() const; - void setHasFootnote( const bool value ); - - /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ - LevelPtr getLevel() const; - void setLevel( const LevelPtr& value ); - bool getHasLevel() const; - void setHasLevel( const bool value ); - - bool fromXElement( std::ostream& message, xml::XElement& xelement ); - -private: - FootnotePtr myFootnote; - bool myHasFootnote; - LevelPtr myLevel; - bool myHasLevel; -}; -``` - -##### xs:choices - -There are a few exceptions (mistakes) but for the most part, `xs:choice` constructs are represented by a class with a name ending in 'Choice'. -The element will have an enum named 'Choice' in the public scope of the class. -Each of the possible 'choices' will exist as data members of the class, but only one of them will be 'active' (was present in, or will be written to, XML). -For example, this xsd construct: - -```xml - - - - The pre-bend element indicates that this is a pre-bend rather than a normal bend or a release. - - - - - The release element indicates that this is a release rather than a normal bend or pre-bend. - - - -``` - -Is represented by this class: - -```C++ -class BendChoice : public ElementInterface -{ -public: - enum class Choice - { - preBend = 1, - release = 2 - }; - BendChoice(); - - /* ... other stuff ... */ - - BendChoice::Choice getChoice() const; - void setChoice( BendChoice::Choice value ); - - /* _________ PreBend minOccurs = 1, maxOccurs = 1 _________ */ - PreBendPtr getPreBend() const; - void setPreBend( const PreBendPtr& value ); - - /* _________ Release minOccurs = 1, maxOccurs = 1 _________ */ - ReleasePtr getRelease() const; - void setRelease( const ReleasePtr& value ); - - bool fromXElement( std::ostream& message, xml::XElement& xelement ); - -private: - Choice myChoice; - PreBendPtr myPreBend; - ReleasePtr myRelease; -}; -``` - -When `getChoice() == BendChoice::Choice::preBend` then we will see `` in the XML, but when `getChoice() == BendChoice::Choice::postBend` then we will see `` in the XML. - -### XML DOM (::ezxml::) - -Any XML document can be read and manipulated with the classes in the `::ezxml::` namespace. -Most notably, look at the following pure virtual interfaces XDoc, XElement, XAttribute. -Also look at the STL-compliant iterators XElementIterator and XAttributeIterator. - -These interfaces are designed to wrap any underlying XML DOM software so that `mx::core` does not care or know about the XML DOM code. -A set of implementation classes wrapping pugixml are provided, but if you need to use, say Xerces or RapidXML, you can look at the PugiElement, PugiDoc, etc classes and wrap whatever library you need. - -Here's how you can read a MusicXML document into `mx::core` classes by way of `::ezxml::`. - -```C++ -#include "mx/core/Document.h" -#include "mx/utility/Utility.h" -#include "functions.h" -#include "ezxml/XFactory.h" -#include "ezxml/XDoc.h" - -#include -#include -#include - -int main(int argc, const char *argv[]) -{ - // allocate the objects - mx::core::DocumentPtr mxDoc = makeDocument(); - ::ezxml::::XDocPtr xmlDoc = ::ezxml::::XFactory::makeXDoc(); - - // read a MusicXML file into the XML DOM structure - xmlDoc->loadFile( "music.xml" ); - - // create an ostream to receive any parsing messages - std::stringstream parseMessages; - - // convert the XML DOM into MusicXML Classes - bool isSuccess = mxDoc->fromXDoc( parseMessages, *xmlDoc ); - - if( !isSuccess ) - { - std::cout << "Parsing of the MusicXML document failed with the following message(s):" << std::endl; - std::cout << parseMessages.str() << std::endl; - return -1; - } - - // maybe the document was timewise document. if so, convert it to partwise - if( mxDoc->getChoice() == mx::core::DocumentChoice::timewise ) - { - mxDoc->convertContents(); - } - - // get the root - auto scorePartwise = mxDoc->getScorePartwise(); - - // change the title - scorePartwise->getScoreHeaderGroup()->setHasWork( true ); - scorePartwise->getScoreHeaderGroup()->getWork()->setHasWorkTitle( true ); - scorePartwise->getScoreHeaderGroup()->getWork()->getWorkTitle()->setValue( mx::core::XsString( "New Title" ) ); - - // write it back out to disk - mxDoc->toXDoc( *xmlDoc ); - xmlDoc->write( "newtitle.xml" ); - - return 0; -} -``` - -### Hello World using mx::core -On the MusicXML home page there is an example of a "Hello World" simple MusicXML file. -Here is a main function that would output this "Hello World" MusicXML example to std::cout. - -```C++ -#include -#include "DocumentPartwise.h" -#include "Elements.h" - -using namespace mx::core; -using namespace std; - -int main(int argc, const char * argv[]) -{ - auto doc = makeDocumentPartwise(); - auto s = doc->getScorePartwise(); - s->getAttributes()->hasVersion = true; - s->getAttributes()->version = XsToken( "3.0" ); - auto header = s->getScoreHeaderGroup(); - header->getPartList()->getScorePart()->getAttributes()->id = XsID( "P1" ); - header->getPartList()->getScorePart()->getPartName()->setValue( XsString( "Music" ) ); - auto part = *( s->getPartwisePartSet().cbegin() ); - part->getAttributes()->id = XsIDREF( "P1" ); - auto measure = *( part->getPartwiseMeasureSet().cbegin() ); - measure->getAttributes()->number = XsToken( "1" ); - auto propertiesChoice = makeMusicDataChoice(); - propertiesChoice->setChoice( MusicDataChoice::Choice::properties ); - auto properties = propertiesChoice->getProperties(); - properties->setHasDivisions( true ); - properties->getDivisions()->setValue( PositiveDivisionsValue( 1 ) ); - properties->addKey( makeKey() ); - auto time = makeTime(); - time->getTimeChoice()->setChoice( TimeChoice::Choice::timeSignature ); - time->getTimeChoice()->getTimeSignature()->getBeats()->setValue( XsString( "4" ) ); - time->getTimeChoice()->getTimeSignature()->getBeatType()->setValue( XsString( "4" ) ); - properties->addTime( time ); - auto clef = makeClef(); - clef->getSign()->setValue( ClefSign::g ); - clef->setHasLine( true ); - clef->getLine()->setValue( StaffLine( 2 ) ); - properties->addClef( clef ); - measure->getMusicDataGroup()->addMusicDataChoice( propertiesChoice ); - auto noteData = makeMusicDataChoice(); - noteData->setChoice( MusicDataChoice::Choice::note ); - noteData->getNote()->getNoteChoice()->setChoice( NoteChoice::Choice::normal ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::pitch ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getStep()->setValue( StepEnum::c ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getOctave()->setValue( OctaveValue( 4 ) ); - noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getDuration()->setValue( PositiveDivisionsValue( 4 ) ); - noteData->getNote()->getType()->setValue( NoteTypeValue::whole ); - measure->getMusicDataGroup()->addMusicDataChoice( noteData ); - - doc->toStream( cout ); /* print Hello World MusicXML document to console */ - return 0; -} -``` - -### Unit Test Framework - -An executable program named mxtest is also included in the project. -mxtest utilizes the Catch2 test framework. -The core tests are slow to compile, see the [`cmake` options](#cmake-options) section for more info on how to skip compilation of the tests. +# MusicXML Class Library + +- Author: Matthew James Briggs +- License: MIT +- Version: 1.0 +- Supported MusicXML Version: 3.0 +- Language: C++17 + +* * * + +## Introduction + +This project is a C++ library for working with MusicXML. + +# Build + +A top-level `Makefile` wraps CMake and encodes the build/test configurations this project uses. It +is a convenience layer, not a replacement for CMake. It needs `cmake` (>= 3.13) and a POSIX shell. +On Windows it is best-effort: install CMake plus GNU make and a POSIX shell (Git Bash, MSYS2, or +WSL); the underlying compiler can still be MSVC, since builds go through `cmake --build`. + +Building and running tests should be as simple as: + +``` +git clone https://github.com/webern/mx.git mx +cd mx +make test +``` + +Run `make` (or `make help`) to list every target. + +### Build Modes + +There are three `cmake` options (`MX_BUILD_TESTS`, `MX_BUILD_CORE_TESTS`, `MX_BUILD_EXAMPLES`). Only +three combinations are useful workflows, exposed as three build targets: + +| Target | Builds | Notes | +|-------------|-------------------------------------------------|-----------------------------------------------------| +| `make lib` | the static library only | fastest; use this if you just need the lib | +| `make dev` | tests (no core tests) + examples | recommended for development | +| `make core` | tests including the `mx::core` tests + examples | slow to compile; only needed for `mx::core` changes | + +The `core` tests take a long time to compile. You only need them if you make changes in the +`mx::core` namespace. + +Run targets build the needed mode first, then run binaries: `make test` (runs `mxtest`), +`make test-all` (full `mxtest`), `make examples-run` (runs the examples), and `make all` (full +build, examples, and full `mxtest`). `make clean` removes the build tree. + +Each mode builds into `build//` with its own cache and incremental state, so +switching modes never recompiles another mode's tree. Knobs: `JOBS` (parallelism, auto-detected), +`BUILD_TYPE` (default `Debug`), `GENERATOR` (default: CMake's platform default), and `ARGS` +(forwarded to `mxtest`, e.g. `make test ARGS='[core]'`). + +### Build Tenets + +* `mx` should not depend on any outside libraries (no deps). +* `mx` third-party code should be kept to a minimum. +* `mx` third-party code should be checked into the `mx` repo and compiled as part of the `mx` + library. +* `mx` should not depened on any package manager, though it may be published into any package + manager. + +### Using `mx` in a Cmake Project + +The following script demonstrates how you can start a new cmake project that uses `mx` by commiting +its sourcecode into your project: + +```sh +#!/bin/bash +se -eou pipefail + +# this script demonstrates how to depend on mx by including it in your +# sourcecode tree. + +# if given, the first argument is a path to directory where the new +# project will be created. +REPO="${1:-/tmp/$(uuidgen)}" +echo "Creating a new project in: ${REPO}" + +# create a new git repository for your project +mkdir -p "${REPO}" +cd "${REPO}" +git init +# bring the mx sourcecode into your project into a temporary location +git clone https://github.com/webern/mx.git mxtemp + +# copy only what we need. all we need is the Sourcode directory, the +# cmake file, the license, and the .gitignore file (helpful since there +# is one generated file.) +mkdir mx +mv mxtemp/src mx/src +mv mxtemp/.gitignore mx/.gitignore +mv mxtemp/LICENSE mx/LICENSE +mv mxtemp/CMakeLists.txt mx/CMakeLists.txt +# we don't need the test code, either +rm -rf mx/src/private/mxtest +rm -rf mxtemp + +# commit the mx sourcecode to our project repo +git add --all && git commit -m'mx sourcecode' + +# create a main.cpp file +cat <<- "EOF" > main.cpp +#include +#include "mx/api/ScoreData.h" +#include "mx/api/DocumentManager.h" + +int main () { + using namespace mx::api; + ScoreData score{}; + score.workTitle = "Hello World"; + NoteData note{}; + note.durationData.durationName = DurationName::quarter; + note.pitchData.step = Step::d; + VoiceData voiceData{}; + voiceData.notes.push_back(note); + StaffData staff{}; + staff.voices[0] = voiceData; + MeasureData measure{}; + measure.staves.push_back(staff); + PartData part{}; + part.measures.push_back(measure); + score.parts.push_back(part); + auto& mgr = DocumentManager::getInstance(); + const auto id = mgr.createFromScore(score); + mgr.writeToStream(id, std::cout); + mgr.destroyDocument(id); +} +EOF + +# create a cmake file +cat <<- "EOF" > CMakeLists.txt +cmake_minimum_required(VERSION 3.17) +project(my-musicxml-proj) +set(CMAKE_CXX_STANDARD 17) +set(CPP_VERSION 17) + +add_executable(my-musicxml-proj main.cpp) +add_subdirectory(mx) +target_link_libraries(my-musicxml-proj mx) +target_include_directories(my-musicxml-proj PRIVATE mx/src/include) +EOF + +# create a .gitignore file to ignore a build directory +cat <<- "EOF" > .gitignore +build/ +EOF + +git add --all && git commit -m'musicxml hello world' + +# create a build directory +mkdir build + +# build your project +cd build +cmake .. && make -j10 +# run your executable +./my-musicxml-proj +``` + +### Xcode Project + +The Xcode project (checked-in to the repo) has targets for iOS and macOS frameworks and dylibs. +These are not specified in the cmake file. Contributors are not required to keep the Xcode project +up-to-date. If you add, move or remove files from the codebase, it is likely that the Xcode CI run +will fail. This will not prevent a contribution from being merged, the maintainer will fix the +project after-the-fact. + +# Using `mx` + +## API + +The `mx::api` namespace is intended to be a simplified structural representation of MusicXML. It +should be more intuitive than manipulating the DOM representation directly. In particular, voices +and time positions are more explicitly managed. Some complexities, on the other hand, are retained +in `mx::api`, such as the need to manage beam starts and stops explicitly. + +#### Writing MusicXML with `mx::api` + +```C++ +#include +#include +#include +#include + +#include "mx/api/DocumentManager.h" +#include "mx/api/ScoreData.h" + +// set this to 1 if you want to see the xml in your console +#define MX_WRITE_THIS_TO_THE_CONSOLE 0 + +int main(int argc, const char * argv[]) +{ + using namespace mx::api; + const auto qticks = 4; + + // create a score + auto score = ScoreData{}; + score.workTitle = "Mx Example"; + score.composer = "Matthew James Briggs"; + score.copyright = "Copyright (c) 2019"; + score.ticksPerQuarter = qticks; + + // create a part + score.parts.emplace_back( PartData{} ); + auto& part = score.parts.back(); + + // give the part a name + part.name = "Flute"; + part.abbreviation = "Fl."; + part.displayName = "Flute"; + part.displayAbbreviation = "Fl."; + + // give the part an instrument + part.instrumentData.soundID = SoundID::windFlutesFlute; + part.instrumentData.midiData.channel = 1; + part.instrumentData.midiData.program = 74; + + // add a measure + part.measures.emplace_back( MeasureData{} ); + auto& measure = part.measures.back(); + measure.timeSignature.beats = 4; + measure.timeSignature.beatType = 4; + measure.timeSignature.isImplicit = false; + + // add a staff + measure.staves.emplace_back( StaffData{} ); + auto& staff = measure.staves.back(); + + // set the clef + auto clef = ClefData{}; + clef.setTreble(); + staff.clefs.emplace_back( clef ); + + // add a voice + staff.voices[0] = VoiceData{}; + auto& voice = staff.voices.at( 0 ); + + const auto quarter = qticks; + const auto half = qticks * 2; + const auto eighth = qticks / 2; + + // add a few notes + auto currentTime = 0; + auto note = NoteData{}; + note.pitchData.step = Step::d; + note.pitchData.alter = 1; + note.pitchData.octave = 5; + note.pitchData.accidental = Accidental::sharp; + note.durationData.durationName = DurationName::half; + note.durationData.durationTimeTicks = half; + note.tickTimePosition = currentTime; + voice.notes.push_back( note ); + + // advance our time + currentTime += half; + + note.pitchData.step = Step::e; + note.pitchData.alter = 0; + note.pitchData.octave = 5; + note.pitchData.accidental = Accidental::none; + note.durationData.durationName = DurationName::eighth; + note.durationData.durationTimeTicks = eighth; + note.tickTimePosition = currentTime; + // beams are handled explicitly in musicxml + note.beams.push_back( Beam::begin ); // start an eighth-note beam + voice.notes.push_back( note ); + currentTime += eighth; + + note.pitchData.step = Step::f; + note.pitchData.alter = 0; + note.pitchData.octave = 5; + note.pitchData.accidental = Accidental::none; + note.durationData.durationName = DurationName::eighth; + note.tickTimePosition = currentTime; + note.durationData.durationTimeTicks = eighth; + note.beams.clear(); + note.beams.push_back( Beam::end ); // end the eighth-note beam + voice.notes.push_back( note ); + currentTime += eighth; + + note.pitchData.step = Step::e; + note.pitchData.alter = 0; + note.pitchData.octave = 5; + note.pitchData.accidental = Accidental::none; + note.durationData.durationName = DurationName::quarter; + note.durationData.durationTimeTicks = quarter; + note.tickTimePosition = currentTime; + note.beams.clear(); + voice.notes.push_back( note ); + + // the document manager is the liaison between our score data and the MusicXML DOM. + // it completely hides the MusicXML DOM from us when using mx::api + auto& mgr = DocumentManager::getInstance(); + const auto documentID = mgr.createFromScore( score ); + + // write to the console + #if MX_WRITE_THIS_TO_THE_CONSOLE + mgr.writeToStream( documentID, std::cout ); + std::cout << std::endl; + #endif + + // write to a file + mgr.writeToFile( documentID, "./example.musicxml" ); + + // we need to explicitly delete the object held by the manager + mgr.destroyDocument( documentID ); + + return 0; +} +``` + +#### Reading MusicXML with `mx::api` + +```C++ +#include "mx/api/DocumentManager.h" +#include "mx/api/ScoreData.h" + +#include +#include +#include +#include + +#define MX_IS_A_SUCCESS 0 +#define MX_IS_A_FAILURE 1 + +constexpr const char* const xml = R"( + + + + + + Music + + + + + + 1 + + 0 + + + + G + 2 + + + + + C + 4 + + 4 + whole + + + + +)"; + +int main(int argc, const char * argv[]) +{ + using namespace mx::api; + + // create a reference to the singleton which holds documents in memory for us + auto& mgr = DocumentManager::getInstance(); + + // place the xml from above into a stream object + std::istringstream istr{ xml }; + + // ask the document manager to parse the xml into memory for us, returns a document ID. + const auto documentID = mgr.createFromStream( istr ); + + // get the structural representation of the score from the document manager + const auto score = mgr.getData( documentID ); + + // we need to explicitly destroy the document from memory + mgr.destroyDocument(documentID); + + // make sure we have exactly one part + if( score.parts.size() != 1 ) + { + return MX_IS_A_FAILURE; + } + + // drill down into the data structure to retrieve the note + const auto& part = score.parts.at( 0 ); + const auto& measure = part.measures.at( 0 ); + const auto& staff = measure.staves.at( 0 ); + const auto& voice = staff.voices.at( 0 ); + const auto& note = voice.notes.at( 0 ); + + if( note.durationData.durationName != DurationName::whole ) + { + return MX_IS_A_FAILURE; + } + + if( note.pitchData.step != Step::c ) + { + return MX_IS_A_FAILURE; + } + + return MX_IS_A_SUCCESS; +} +``` + +# Implementation Details + +The MusicXML classes in `mx::core` are tightly bound to the `musicxml.xsd` specification. MusicXML +can be challenging to use and the `mx::core` class structure mirrors the complexity of the MusicXML +specification. A simplified representation is available in `mx::api`. It is possible to work with a +subset of MusicXML using only `mx::api`, without delving into `mx::core`. + +##### Namespaces + +```C++ +using namespace mx::api; // an easier interface for reading and writing MusicXML +using namespace mx::core; // a direct representation of a musicxml document in C++ classes +using namespace mx::impl // the logic that translates between mx::api and mx::core +using namespace mx::utility // a typical catch-all for generic stuff like logging macros +using namespace ezxml; // generic serialization and deserialization of xml +``` + +##### `mx::api` + +The `mx::api` namespace is a set of 'plain old data' structs that represent a simplified model of +MusicXML. For example, here is the `ScoreData.h`, which represents the top level of the object +heirarchy: + +```C++ +class ScoreData +{ +public: + MusicXmlVersion musicXmlVersion; + std::string musicXmlType; + std::string workTitle; + std::string workNumber; + std::string movementTitle; + std::string movementNumber; + std::string composer; + std::string lyricist; + std::string arranger; + std::string publisher; + std::string copyright; + EncodingData encoding; + std::vector pageTextItems; + DefaultsData defaults; + std::vector parts; + std::vector partGroups; + int ticksPerQuarter; + std::map layout; +}; +``` + +`mx::api` and `mx::core` are kept completely separate.\ +That is, `mx::api` data is serialized into `mx::core` data, which is then serialized into MusicXML. +The `mx::api` struct allow us to simplify things like specifying a note's tick time position, and +allowing the serialization process to take care of details such as `` `` elements. + +##### `mx::core` + +The `mx::core` namespace contains the MusicXML representation objects such as elements and +attributes. `mx::core` was mostly generated from `musicxml.xsd` with plenty of intervention by hand. + +###### XML Choices and Groups + +In the `musicxml.xsd` there are many cases of `xs:choice` or `xs:group` being used. These constructs +are typically represented in the `mx::core` class structure the same way that they are found in the +`musicxml.xsd` specification. The interfaces in this namespace are relatively stable, however they +are tightly bound to MusicXML's specification and thus they will change when it comes time to +support a future version of MusicXML. + +##### `mx::impl` + +`mx::impl` is the translation layer between `mx::api` and `mx::core`. + +##### `mx::utility` + +This namespace is small. It mostly contains macros and small, generic functions. + +##### `ezxml` + +The `ezxml` namespace contains generic XML DOM functionality. Under the hood +[pugixml](http://pugixml.org/) is being used. See the XML DOM section for more information. Note +that, even though `ezxml` can stand alone as a useful abstraction, we build it as if it were +entirely owned by the `mx` project. Additionally, we check the `pugixml` library in and build it as +if it were part of the `mx` project. This is in keeping with the build tenets [above](#build-tenets) + +##### Partwise vs. Timewise + +There are two types of MusicXML documents, `partwise` and `timewise`. A partwise document consists +of a set of parts which contain measures. A timewise document consists of a set of measures which +contain parts. Partwise is used more often by MusicXML applications while Timewise documents seem to +be rare or even nonresistant. Nonetheless *MusicXML Class Library* implements both Timewise and +Partwise. The class `mx::core::Document` can hold *either* a Partwise *or* a Timewise score. Note +that it actually holds both, but only one or the other is 'active' (this is similar to how `xsd` +`choice` constructs are handled). You can check the inner document type with the getChoice function. +You can convert between Partwise and Timewise with the convertContents function. + +##### Elements + +Each XML element is represented by a class which derives from ElementInterface. Elements are created +and used by way of shared pointers. Each element comes with a set of using/typedef statements as +well as a convenience function for making the shared pointers. + +##### Shared Pointers + +Many elements contain other elements. When they do, these data members will also be shared pointers. +Get/set functions will allow access to the data members by accepting and returning shared pointers. +If you attempt to set a data member to a nullptr, the setter function will silently do nothing. Thus +we can be reasonably assured our objects will never return nullptr. + +For example + +```C++ +std::shared_ptr foo; /* nullptr! */ +bar->setFoo( foo ); /* no-op because you passed a nullptr */ +auto x = bar->getFoo(); /* guaranteed not to be null */ +x->somefuntion(); /* OK to dereference without checking for nullptr */ +``` + +##### Optional Member Data + +Many of the elements in MusicXML are optional. In these cases there is a bool which indicates +whether or not the element is present. The bool serves as a flag indicating whether or not the +optional element will be output when you stream out your MusicXML document. The bool has no +side-effect on the element who's presence/absence it represents. So for example we may set some +data: + +```C++ +foo->setValue( "hello" ); +bar->setFoo( foo ); +``` + +But in this example, if Foo is an optional member of Bar, then we must also set hasFoo to *true* or +else foo will not be in the XML output. + +```C++ +bar->toStream(...); /* Foo is not in the output! */ +bar->setHasFoo( true ); +bar->toStream(...); /* Now we see hello in the output. */ +``` + +Also note that setting HasFoo to *false* does not mean that Foo's value is gone. + +```C++ +bar->setHasFoo( false ); /* The XML document no longer has a Foo */ +bar->getFoo()->getValue() == "hello"; /* True! The value still exists but is not present in the XML. */ +``` + +##### Optional Member Data with Unbounded Occurrences + +Sometimes an element may contain zero, one, or many occurrences of another element. For example + +```xml + +``` + +In this case there will be a collection of Key objects and the getter/setters will look like this, +where `KeySet` is a typedef of `std::vector`. + +```C++ +const KeySet& getKeySet() const; +void addKey( const KeyPtr& value ); +void removeKey( const KeySetIterConst& value ); +void clearKeySet(); +KeyPtr getKey( const KeySetIterConst& setIterator ) const; +``` + +##### Required Member Data with Unbounded Occurrences + +Sometimes an element is required, but you may optionally have more than one. For example + +```xml + +``` + +In this case, minOccurs="1" (by default per XSD language rules). The functions will look just like +the previous example, but they will behave differently + +```C++ +const DirectionTypeSet& getDirectionTypeSet() const; +void addDirectionType( const DirectionTypePtr& value ); +void removeDirectionType( const DirectionTypeSetIterConst& value ); +void clearDirectionTypeSet(); +DirectionTypePtr getDirectionType( const DirectionTypeSetIterConst& setIterator ) const; +``` + +When the containing element is constructed, a single DirectionType will be default constructed and +pushed onto the vector. Thus you will have one default constructed DirectionType in the set upon +construction. + +If you try to call removeDirectionType with only one DirectionType in the set (size==1) nothing will +happen. You will still have a single DirectionType in the collection. + +When you call clearDirectionTypeSet vector.clear() will be called but it will follow up by pushing a +default constructed DirectionType onto the vector so you will still have size==1. + +As it turns out, this design choice tends to be annoying in practice. On the upside, it does +guarantee that your MusicXML document will be valid, even if you forget to add a required element. +The downside is that it means you have to deal with the fact that a default constructed element +always exists in the set, so you must replace or remove the first element. Furthermore, you cannot +remove the existing element until another one has been added. Here are the two patterns I have used +for this (pseudocode). + +**Pattern 1:** Replace the first element by dereferencing the begin() iterator: + +```C++ +bool isFirstAdded = false; +for( auto stuffElement : stuffElementsIWantToAdd ) +{ + if( !isFirstAdded ) + { + *( myElementIWantToAddThemTo->getStuffSet().begin() ) = stuffElement; + isFirstAdded = true; + } + else + { + myElementIWantToAddThemTo->addStuff( stuffElement ); + } +} +``` + +**Pattern 2:** Remove the default element *After* adding a replacement: + +```C++ +bool isFirstAdded = false; +for( auto stuffElement : stuffIWantToAdd ) +{ + myElementIWantToAddThemTo->addStuff( stuffElement ); + if( !isFirstAdded ) + { + myElementIWantToAddThemTo->removeStuff( myElementIWantToAddThemTo->getStuffSet().cbegin() ) + isFirstAdded = true; + } +} +``` + +Pattern 1 always works, even if you're not sure whether or not the `minOccurs="1"` or `"0"`. Pattern +2 only works when `minOccurs="1"`. There are no cases where `minOccurs` is greater than 1. + +##### Member Data with Bounded maxOccurs + +```xml + +``` + +In this case if you call addBeam when there are already 8 beams in the vector, nothing will happen. + +##### xs:groups + +For an xs:group there is usually a single 'element' class which represents the group of elements. +For example this XSD snippet: + +```xml + + + + + + +``` + +is represented by this class: + +```C++ +class EditorialGroup : public ElementInterface +{ +public: + EditorialGroup(); + + /* ... other stuff ... */ + + /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ + FootnotePtr getFootnote() const; + void setFootnote( const FootnotePtr& value ); + bool getHasFootnote() const; + void setHasFootnote( const bool value ); + + /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ + LevelPtr getLevel() const; + void setLevel( const LevelPtr& value ); + bool getHasLevel() const; + void setHasLevel( const bool value ); + + bool fromXElement( std::ostream& message, xml::XElement& xelement ); + +private: + FootnotePtr myFootnote; + bool myHasFootnote; + LevelPtr myLevel; + bool myHasLevel; +}; +``` + +##### xs:choices + +There are a few exceptions (mistakes) but for the most part, `xs:choice` constructs are represented +by a class with a name ending in 'Choice'. The element will have an enum named 'Choice' in the +public scope of the class. Each of the possible 'choices' will exist as data members of the class, +but only one of them will be 'active' (was present in, or will be written to, XML). For example, +this xsd construct: + +```xml + + + + The pre-bend element indicates that this is a pre-bend rather than a normal bend or a release. + + + + + The release element indicates that this is a release rather than a normal bend or pre-bend. + + + +``` + +Is represented by this class: + +```C++ +class BendChoice : public ElementInterface +{ +public: + enum class Choice + { + preBend = 1, + release = 2 + }; + BendChoice(); + + /* ... other stuff ... */ + + BendChoice::Choice getChoice() const; + void setChoice( BendChoice::Choice value ); + + /* _________ PreBend minOccurs = 1, maxOccurs = 1 _________ */ + PreBendPtr getPreBend() const; + void setPreBend( const PreBendPtr& value ); + + /* _________ Release minOccurs = 1, maxOccurs = 1 _________ */ + ReleasePtr getRelease() const; + void setRelease( const ReleasePtr& value ); + + bool fromXElement( std::ostream& message, xml::XElement& xelement ); + +private: + Choice myChoice; + PreBendPtr myPreBend; + ReleasePtr myRelease; +}; +``` + +When `getChoice() == BendChoice::Choice::preBend` then we will see `` in the XML, but +when `getChoice() == BendChoice::Choice::postBend` then we will see `` in the XML. + +### XML DOM (::ezxml::) + +Any XML document can be read and manipulated with the classes in the `::ezxml::` namespace. Most +notably, look at the following pure virtual interfaces XDoc, XElement, XAttribute. Also look at the +STL-compliant iterators XElementIterator and XAttributeIterator. + +These interfaces are designed to wrap any underlying XML DOM software so that `mx::core` does not +care or know about the XML DOM code. A set of implementation classes wrapping pugixml are provided, +but if you need to use, say Xerces or RapidXML, you can look at the PugiElement, PugiDoc, etc +classes and wrap whatever library you need. + +Here's how you can read a MusicXML document into `mx::core` classes by way of `::ezxml::`. + +```C++ +#include "mx/core/Document.h" +#include "mx/utility/Utility.h" +#include "functions.h" +#include "ezxml/XFactory.h" +#include "ezxml/XDoc.h" + +#include +#include +#include + +int main(int argc, const char *argv[]) +{ + // allocate the objects + mx::core::DocumentPtr mxDoc = makeDocument(); + ::ezxml::::XDocPtr xmlDoc = ::ezxml::::XFactory::makeXDoc(); + + // read a MusicXML file into the XML DOM structure + xmlDoc->loadFile( "music.xml" ); + + // create an ostream to receive any parsing messages + std::stringstream parseMessages; + + // convert the XML DOM into MusicXML Classes + bool isSuccess = mxDoc->fromXDoc( parseMessages, *xmlDoc ); + + if( !isSuccess ) + { + std::cout << "Parsing of the MusicXML document failed with the following message(s):" << std::endl; + std::cout << parseMessages.str() << std::endl; + return -1; + } + + // maybe the document was timewise document. if so, convert it to partwise + if( mxDoc->getChoice() == mx::core::DocumentChoice::timewise ) + { + mxDoc->convertContents(); + } + + // get the root + auto scorePartwise = mxDoc->getScorePartwise(); + + // change the title + scorePartwise->getScoreHeaderGroup()->setHasWork( true ); + scorePartwise->getScoreHeaderGroup()->getWork()->setHasWorkTitle( true ); + scorePartwise->getScoreHeaderGroup()->getWork()->getWorkTitle()->setValue( mx::core::XsString( "New Title" ) ); + + // write it back out to disk + mxDoc->toXDoc( *xmlDoc ); + xmlDoc->write( "newtitle.xml" ); + + return 0; +} +``` + +### Hello World using mx::core + +On the MusicXML home page there is an example of a "Hello World" simple MusicXML file. Here is a +main function that would output this "Hello World" MusicXML example to std::cout. + +```C++ +#include +#include "DocumentPartwise.h" +#include "Elements.h" + +using namespace mx::core; +using namespace std; + +int main(int argc, const char * argv[]) +{ + auto doc = makeDocumentPartwise(); + auto s = doc->getScorePartwise(); + s->getAttributes()->hasVersion = true; + s->getAttributes()->version = XsToken( "3.0" ); + auto header = s->getScoreHeaderGroup(); + header->getPartList()->getScorePart()->getAttributes()->id = XsID( "P1" ); + header->getPartList()->getScorePart()->getPartName()->setValue( XsString( "Music" ) ); + auto part = *( s->getPartwisePartSet().cbegin() ); + part->getAttributes()->id = XsIDREF( "P1" ); + auto measure = *( part->getPartwiseMeasureSet().cbegin() ); + measure->getAttributes()->number = XsToken( "1" ); + auto propertiesChoice = makeMusicDataChoice(); + propertiesChoice->setChoice( MusicDataChoice::Choice::properties ); + auto properties = propertiesChoice->getProperties(); + properties->setHasDivisions( true ); + properties->getDivisions()->setValue( PositiveDivisionsValue( 1 ) ); + properties->addKey( makeKey() ); + auto time = makeTime(); + time->getTimeChoice()->setChoice( TimeChoice::Choice::timeSignature ); + time->getTimeChoice()->getTimeSignature()->getBeats()->setValue( XsString( "4" ) ); + time->getTimeChoice()->getTimeSignature()->getBeatType()->setValue( XsString( "4" ) ); + properties->addTime( time ); + auto clef = makeClef(); + clef->getSign()->setValue( ClefSign::g ); + clef->setHasLine( true ); + clef->getLine()->setValue( StaffLine( 2 ) ); + properties->addClef( clef ); + measure->getMusicDataGroup()->addMusicDataChoice( propertiesChoice ); + auto noteData = makeMusicDataChoice(); + noteData->setChoice( MusicDataChoice::Choice::note ); + noteData->getNote()->getNoteChoice()->setChoice( NoteChoice::Choice::normal ); + noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::pitch ); + noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getStep()->setValue( StepEnum::c ); + noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup()->getFullNoteTypeChoice()->getPitch()->getOctave()->setValue( OctaveValue( 4 ) ); + noteData->getNote()->getNoteChoice()->getNormalNoteGroup()->getDuration()->setValue( PositiveDivisionsValue( 4 ) ); + noteData->getNote()->getType()->setValue( NoteTypeValue::whole ); + measure->getMusicDataGroup()->addMusicDataChoice( noteData ); + + doc->toStream( cout ); /* print Hello World MusicXML document to console */ + return 0; +} +``` + +### Unit Test Framework + +An executable program named mxtest is also included in the project. mxtest utilizes the Catch2 test +framework. The core tests are slow to compile, see the [Build Modes](#build-modes) section for more +info on how to skip compilation of the tests. diff --git a/Sourcecode/include/mx/api/ApiCommon.h b/Sourcecode/include/mx/api/ApiCommon.h deleted file mode 100644 index 6134cf969..000000000 --- a/Sourcecode/include/mx/api/ApiCommon.h +++ /dev/null @@ -1,57 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include -#include - -namespace mx -{ - namespace api - { - using Double = long double; - using OptionalDouble = std::optional; - constexpr const Double MX_API_EQUALITY_EPSILON = 0.00000001; - - inline bool areSame( Double left, Double right ) - { - return ( std::abs( left - right ) < MX_API_EQUALITY_EPSILON ); - } - - constexpr int DEFAULT_TICKS_PER_QUARTER = 3 * 4 * 5 * 7; - constexpr int TICK_TIME_INFINITY = std::numeric_limits::max(); - - enum class Bool - { - unspecified, - yes, - no - }; - - inline bool toBool( Bool b ) { return b == Bool::yes; } - inline Bool fromBool( bool b ) { return b ? Bool::yes : Bool::no; } - inline bool isSpecified( Bool b ) { return b != Bool::unspecified; } - - enum class Placement - { - unspecified, - above, - below - }; - - enum class MeasureNumbering - { - unspecified, - none, - measure, - system - }; - } -} - -// this defines inline equality comparison macros and functions -// which are mainly used for test code to assert equality -#include "mx/api/ApiEquality.h" diff --git a/Sourcecode/include/mx/api/ApiEquality.h b/Sourcecode/include/mx/api/ApiEquality.h deleted file mode 100644 index 5452b8b83..000000000 --- a/Sourcecode/include/mx/api/ApiEquality.h +++ /dev/null @@ -1,120 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once -#include -#include -#include -#include -#include - -// #define MX_DEBUG // shows traces to std::cout - -namespace mx -{ - namespace api - { - template - inline bool areVectorsEqual( const std::vector& lhs, const std::vector& rhs ) - { - if( lhs.size() != rhs.size() ) - { - return false; - } - auto lit = lhs.cbegin(); - auto rit = rhs.cbegin(); - auto leftend = lhs.cend(); - for( ; lit != leftend; ++lit, ++rit ) - { - if( *lit != *rit ) - { - return false; - } - } - return true; - } - - template - inline bool areIntMapsEqual( const std::map& lhs, const std::map& rhs ) - { - if( lhs.size() != rhs.size() ) - { - return false; - } - auto lit = lhs.cbegin(); - auto rit = rhs.cbegin(); - auto leftend = lhs.cend(); - for( ; lit != leftend; ++lit, ++rit ) - { - if( lit->first != rit->first || lit->second != rit->second ) - { - return false; - } - } - return true; - } - - template - inline bool areEqual( const T& lhs, const T& rhs ) - { - return lhs == rhs; - } - - template <> - inline bool areEqual( const long double& lhs, const long double& rhs ) - { - return areSame( lhs, rhs ); - } - -#ifdef MX_DEBUG - inline void streamComparisonUnequalMessage( const char* const inClassName, const char* const inMemberName ) - { - std::cout << inClassName; - std::cout << " "; - std::cout << inMemberName; - std::cout << " members are not equal "; - std::cout << std::endl; - } -#endif - -#ifndef MX_API_UNUSED - #define MX_API_UNUSED( variable ) (void)variable; -#endif - -#ifdef MX_DEBUG - #define MX_SHOW_UNEQUAL( XtheCurrentClassName, XmxapiMemberName ) streamComparisonUnequalMessage( XtheCurrentClassName, XmxapiMemberName ); -#else - #define MX_SHOW_UNEQUAL( XtheCurrentClassName, XmxapiMemberName ) { MX_API_UNUSED( XtheCurrentClassName ) } -#endif - -#define MXAPI_EQUALS_BEGIN( mxapiClassName ) \ - inline bool operator==( const mxapiClassName& lhs, const mxapiClassName& rhs ) \ - { \ - const char* const theCurrentClassName = #mxapiClassName; - -#define MXAPI_EQUALS_MEMBER( mxapiMemberName ) \ - if( ! ( lhs.mxapiMemberName == rhs.mxapiMemberName ) ) \ - { \ - MX_SHOW_UNEQUAL( theCurrentClassName, #mxapiMemberName ); \ - return false; \ - } - -#define MXAPI_DOUBLES_EQUALS_MEMBER( mxapiMemberName ) \ - if( std::abs( lhs.mxapiMemberName - rhs.mxapiMemberName ) > MX_API_EQUALITY_EPSILON ) \ - { \ - MX_SHOW_UNEQUAL( theCurrentClassName, #mxapiMemberName ); \ - return false; \ - } - -#define MXAPI_EQUALS_END \ - return true; \ - }\ - -#define MXAPI_NOT_EQUALS_AND_VECTORS( mxapiClassName ) \ - inline bool operator!=( const mxapiClassName& lhs, const mxapiClassName& rhs ) { return !( lhs == rhs ); } \ - inline bool operator==( const std::vector& lhs, const std::vector& rhs ) { return areVectorsEqual( lhs, rhs ); } \ - inline bool operator!=( const std::vector& lhs, const std::vector& rhs ) { return !areVectorsEqual( lhs, rhs ); } \ - - } -} diff --git a/Sourcecode/include/mx/api/AppearanceData.h b/Sourcecode/include/mx/api/AppearanceData.h deleted file mode 100644 index 6604d2ce0..000000000 --- a/Sourcecode/include/mx/api/AppearanceData.h +++ /dev/null @@ -1,62 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" - -namespace mx -{ - namespace api - { - enum class AppearanceType - { - /// The line-width-type defines what type of line is being defined - /// in a line-width element. Values include beam, bracket, dashes, - /// enclosure, ending, extend, heavy barline, leger, light barline, - /// octave shift, pedal, slur middle, slur tip, staff, stem, tie middle, - /// tie tip, tuplet bracket, and wedge. This is left as a string so that - /// other application-specific types can be defined, but it is made a - /// separate type so that it can be redefined more strictly. - LineWidth, - - /// The note-size-type type indicates the type of note being defined - /// by a note-size element. The grace type is used for notes of cue - /// size that that include a grace element. The cue type is used for - /// all other notes with cue size, whether defined explicitly or - /// implicitly via a cue element. The large type is used for notes of - /// large size. - NoteSize, - - /// The distance-type defines what type of distance is being defined - /// in a distance element. Values include beam and hyphen. This is - /// left as a string so that other application-specific types can be - /// defined, but it is made a separate type so that it can be redefined - /// more strictly. - Distance, - - /// Anything goes - OtherAppearance, - }; - - class AppearanceData - { - public: - AppearanceData(); - - public: - AppearanceType appearanceType; - std::string appearanceSubType; - long double value; - }; - - MXAPI_EQUALS_BEGIN( AppearanceData ) - MXAPI_EQUALS_MEMBER( appearanceType ) - MXAPI_EQUALS_MEMBER( appearanceSubType ) - MXAPI_EQUALS_MEMBER( value ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( AppearanceData ); - - } -} diff --git a/Sourcecode/include/mx/api/BarlineData.h b/Sourcecode/include/mx/api/BarlineData.h deleted file mode 100644 index 128a2466d..000000000 --- a/Sourcecode/include/mx/api/BarlineData.h +++ /dev/null @@ -1,70 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/PositionData.h" - -namespace mx -{ - namespace api - { - - enum class BarlineType - { - unspecified, - unsupported, - none, - normal, - lightLight, - lightHeavy, - heavyLight, - dotted, - dashed, - heavy, - heavyHeavy - }; - - enum class EndingType - { - none, - start, - stop, - discontinue - }; - - - class BarlineData - { - public: - int tickTimePosition; - BarlineType barlineType; - EndingType endingType; - int endingNumber; - bool repeat; - HorizontalAlignment location; - - BarlineData() - : tickTimePosition{ 0 } - , barlineType{ BarlineType::normal } - , endingType{ EndingType::none } - , endingNumber { 0 } - , repeat { false } - , location{ HorizontalAlignment::unspecified } - { - } - }; - - MXAPI_EQUALS_BEGIN( BarlineData ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( barlineType ) - MXAPI_EQUALS_MEMBER( endingType ) - MXAPI_EQUALS_MEMBER( endingNumber ) - MXAPI_EQUALS_MEMBER( repeat ) - MXAPI_EQUALS_MEMBER( location ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( BarlineData ); - } -} diff --git a/Sourcecode/include/mx/api/ChordData.h b/Sourcecode/include/mx/api/ChordData.h deleted file mode 100644 index c38208098..000000000 --- a/Sourcecode/include/mx/api/ChordData.h +++ /dev/null @@ -1,173 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/PitchData.h" -#include "mx/api/PositionData.h" -#include "mx/api/MiscData.h" - -namespace mx -{ - namespace api - { - enum class ChordKind - { - unspecified, - major, - minor, - augmented, - diminished, - dominant, - majorSeventh, - minorSeventh, - diminishedSeventh, - augmentedSeventh, - halfDiminished, - majorMinor, - majorSixth, - minorSixth, - dominantNinth, - majorNinth, - minorNinth, - dominant11Th, - major11Th, - minor11Th, - dominant13Th, - major13Th, - minor13Th, - suspendedSecond, - suspendedFourth, - neapolitan, - italian, - french, - german, - pedal, - power, - tristan, - other, - none - }; - - enum class ExtensionType - { - add, - remove, - alter - }; - - enum class ExtensionNumber - { - first, - second, - third, - fourth, - fifth, - sixth, - seventh, - ninth, - eleventh, - thirteenth, - }; - - enum class ExtensionAlter - { - none, - flat, - sharp, - doubleFlat, - doubleSharp - }; - - class Extension - { - public: - Extension(); - - ExtensionType extensionType; - ExtensionAlter extensionAlter; - ExtensionNumber extensionNumber; - Bool printObject; - - inline int getAlterValue() const - { - switch( extensionAlter ) - { - case ExtensionAlter::none: return 0; - case ExtensionAlter::flat: return -1; - case ExtensionAlter::sharp: return 1; - case ExtensionAlter::doubleFlat: return -2; - case ExtensionAlter::doubleSharp: return 2; - } - return 0; - } - - inline void setAlterValue( int inAlterValue ) - { - if( inAlterValue <= -2 ) - { - extensionAlter = ExtensionAlter::doubleFlat; - } - else if ( inAlterValue == -1 ) - { - extensionAlter = ExtensionAlter::flat; - } - else if ( inAlterValue == 0 ) - { - extensionAlter = ExtensionAlter::none; - } - else if ( inAlterValue == 1 ) - { - extensionAlter = ExtensionAlter::sharp; - } - else if ( inAlterValue >= 2 ) - { - extensionAlter = ExtensionAlter::doubleSharp; - } - } - }; - - MXAPI_EQUALS_BEGIN( Extension ) - MXAPI_EQUALS_MEMBER( extensionType ) - MXAPI_EQUALS_MEMBER( extensionAlter ) - MXAPI_EQUALS_MEMBER( extensionNumber ) - MXAPI_EQUALS_MEMBER( printObject ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( Extension ); - - class ChordData - { - public: - ChordData(); - - public: - Step root; - int rootAlter; - ChordKind chordKind; - std::string text; - Bool useSymbols; - Step bass; - int bassAlter; - std::vector extensions; - std::vector miscData; - PositionData positionData; - }; - - MXAPI_EQUALS_BEGIN( ChordData ) - MXAPI_EQUALS_MEMBER( root ) - MXAPI_EQUALS_MEMBER( rootAlter ) - MXAPI_EQUALS_MEMBER( chordKind ) - MXAPI_EQUALS_MEMBER( text ) - MXAPI_EQUALS_MEMBER( useSymbols ) - MXAPI_EQUALS_MEMBER( bass ) - MXAPI_EQUALS_MEMBER( bassAlter ) - MXAPI_EQUALS_MEMBER( extensions ) - MXAPI_EQUALS_MEMBER( miscData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( ChordData ); - - } -} diff --git a/Sourcecode/include/mx/api/ClefData.h b/Sourcecode/include/mx/api/ClefData.h deleted file mode 100644 index 51c0e8c13..000000000 --- a/Sourcecode/include/mx/api/ClefData.h +++ /dev/null @@ -1,80 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" - -namespace mx -{ - namespace api - { - enum class ClefSymbol - { - none, - g, - f, - c, - percussion, - tab, - jianpu - }; - - enum class ClefLocation - { - unspecified, - beforeBarline, - afterBarline, - midMeasure - }; - - constexpr ClefSymbol DEFAULT_CLEF_SYMBOL = ClefSymbol::g; - constexpr int DEFAULT_CLEF_LINE = 2; - constexpr int DEFAULT_CLEF_OCTAVE_CHANGE = 0; - - - class ClefData - { - public: - - ClefData(); - - //int staffIndex; - ClefSymbol symbol; - int line; - int octaveChange; - int tickTimePosition; - ClefLocation location; - std::string toString() const; - - // convenience - set symbol, line and octave for common clefs - void setTreble(); - void setBass(); - void setAlto(); - void setTenor(); - void setBaritone(); - void setSoprano(); - void setMezzoSoprano(); - - // convenience - check symbol, line and octave for common clefs - bool isTreble() const; - bool isBass() const; - bool isAlto() const; - bool isTenor() const; - bool isBaritone() const; - bool isSoprano() const; - bool isMezzoSoprano() const; - }; - - MXAPI_EQUALS_BEGIN( ClefData ) - //MXAPI_EQUALS_MEMBER( staffIndex ) - MXAPI_EQUALS_MEMBER( symbol ) - MXAPI_EQUALS_MEMBER( line ) - MXAPI_EQUALS_MEMBER( octaveChange ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( location ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( ClefData ); - } -} diff --git a/Sourcecode/include/mx/api/CodaData.h b/Sourcecode/include/mx/api/CodaData.h deleted file mode 100644 index 48af431e7..000000000 --- a/Sourcecode/include/mx/api/CodaData.h +++ /dev/null @@ -1,37 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/ColorData.h" -#include "mx/api/PositionData.h" - -namespace mx -{ - namespace api - { - class CodaData - { - public: - PositionData positionData; - bool isColorSpecified; - ColorData colorData; - - CodaData() - : positionData{} - , isColorSpecified{ false } - , colorData{} - { - } - }; - - MXAPI_EQUALS_BEGIN( CodaData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( isColorSpecified ) - MXAPI_EQUALS_MEMBER( colorData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( CodaData ); - } -} diff --git a/Sourcecode/include/mx/api/ColorData.h b/Sourcecode/include/mx/api/ColorData.h deleted file mode 100644 index 541d5f3bf..000000000 --- a/Sourcecode/include/mx/api/ColorData.h +++ /dev/null @@ -1,42 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" - -namespace mx -{ - namespace api - { - struct ColorData - { - uint8_t red; - uint8_t green; - uint8_t blue; - bool isAlphaSpecified; - uint8_t alpha; - - inline bool isBlack() { return ( red == 255 && green == 255 && blue == 255 ) && ( ( !isAlphaSpecified ) || ( alpha == 255 ) ); } - ColorData() - : red{ 255 } - , green{ 255 } - , blue{ 255 } - , isAlphaSpecified{ false } - , alpha{ 255 } - { - - } - }; - - MXAPI_EQUALS_BEGIN( ColorData ) - MXAPI_EQUALS_MEMBER( red ) - MXAPI_EQUALS_MEMBER( green ) - MXAPI_EQUALS_MEMBER( blue ) - MXAPI_EQUALS_MEMBER( isAlphaSpecified ) - MXAPI_EQUALS_MEMBER( alpha ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( ColorData ); - } -} diff --git a/Sourcecode/include/mx/api/CurveData.h b/Sourcecode/include/mx/api/CurveData.h deleted file mode 100644 index 7bed4adaf..000000000 --- a/Sourcecode/include/mx/api/CurveData.h +++ /dev/null @@ -1,212 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/LineData.h" -#include "mx/api/ColorData.h" -#include "mx/api/ApiCommon.h" -#include "mx/api/PositionData.h" - -// MusicXML Documentation for Bezier Attributes Group -// The bezier attribute group is used to indicate the curvature of slurs -// and ties, representing the control points for a cubic bezier curve. -// For ties, the bezier attribute group is used with the tied element. -// -// Normal slurs, S-shaped slurs, and ties need only two bezier points: -// one associated with the start of the slur or tie, the other with the -// stop. Complex slurs and slurs divided over system breaks can specify -// additional bezier data at slur elements with a continue type. -// -// The bezier-offset, bezier-x, and bezier-y attributes describe the -// outgoing bezier point for slurs and ties with a start type, and the -// incoming bezier point for slurs and ties with types of stop or continue. -// The attributes bezier-offset2, bezier-x2, and bezier-y2 are only valid -// with slurs of type continue, and describe the outgoing bezier point. -// -// The bezier-offset and bezier-offset2 attributes are measured in terms of -// musical divisions, like the offset element. These are the recommended -// attributes for specifying horizontal position. The other attributes are -// specified in tenths, relative to any position settings associated with -// the slur or tied element. - -// MusicXML Documentation for Slur Element -// Slur types are empty. Most slurs are represented with two elements: one -// with a start type, and one with a stop type. Slurs can add more elements -// using a continue type. This is typically used to specify the formatting -// of cross-system slurs, or to specify the shape of very complex slurs. - -namespace mx -{ - namespace api - { - enum class CurveType - { - unspecified, - slur, - tie - }; - - enum class CurveOrientation - { - unspecified, - overhand, - underhand - }; - - struct CurvePoints - { - // positionData represents a point along the curve. - // either the endpoint in the case of starts and stops, - // or the continuation points in the case of a 'continue'. - // only the following PositionData fields are supported: - // defaultX, defaultY, relativeX, relativeY, placement - PositionData positionData; - - bool isBezierXSpecified; - long double bezierX; - - bool isBezierYSpecified; - long double bezierY; - - bool isBezierOffsetSpecified; - int bezierOffset; - - // convenience, check if any of the available fields - // are specified. - inline bool isSpecified() const - { - return positionData.isDefaultXSpecified - || positionData.isDefaultYSpecified - || isBezierXSpecified - || isBezierYSpecified - || isBezierOffsetSpecified; - } - - CurvePoints() - : positionData{} - , isBezierXSpecified{ false } - , bezierX{ 0.0 } - , isBezierYSpecified{ false } - , bezierY{ 0.0 } - , isBezierOffsetSpecified{ false } - , bezierOffset{ 0 } - { - - } - }; - - struct CurveStart - { - CurveType curveType; - int numberLevel; - CurvePoints curvePoints; - CurveOrientation curveOrientation; - Placement placement; - LineData lineData; - bool isColorSpecified; - ColorData colorData; - - CurveStart( CurveType inCurveType ) - : curveType{ inCurveType } - , numberLevel{ -1 } - , curvePoints{} - , curveOrientation{ CurveOrientation::unspecified } - , placement{ Placement::unspecified } - , lineData{} - , isColorSpecified{ false } - , colorData{} - { - - } - }; - - - struct CurveContinue - { - CurveType curveType; - int numberLevel; - CurvePoints curvePoints; - bool isBezierX2Specified; - long double bezierX2; - bool isBezierY2Specified; - long double bezierY2; - bool isBezierOffset2Specified; - long double bezierOffset2; - - CurveContinue( CurveType inCurveType ) - : curveType{ inCurveType } - , numberLevel{ -1 } - , curvePoints{} - , isBezierX2Specified{ false } - , bezierX2{ 0.0 } - , isBezierY2Specified{ false } - , bezierY2{ 0.0 } - , isBezierOffset2Specified{ false } - , bezierOffset2{ 0.0 } - { - - } - }; - - - struct CurveStop - { - CurveType curveType; - int numberLevel; - CurvePoints curvePoints; - - CurveStop( CurveType inCurveType ) - : curveType{ inCurveType } - , numberLevel{ -1 } - , curvePoints{} - { - - } - }; - - MXAPI_EQUALS_BEGIN( CurvePoints ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( isBezierXSpecified ) - MXAPI_EQUALS_MEMBER( bezierX ) - MXAPI_EQUALS_MEMBER( isBezierYSpecified ) - MXAPI_EQUALS_MEMBER( bezierY ) - MXAPI_EQUALS_MEMBER( isBezierOffsetSpecified ) - MXAPI_EQUALS_MEMBER( bezierOffset ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( CurvePoints ); - - MXAPI_EQUALS_BEGIN( CurveStart ) - MXAPI_EQUALS_MEMBER( curveType ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( curvePoints ) - MXAPI_EQUALS_MEMBER( curveOrientation ) - MXAPI_EQUALS_MEMBER( placement ) - MXAPI_EQUALS_MEMBER( lineData ) - MXAPI_EQUALS_MEMBER( isColorSpecified ) - MXAPI_EQUALS_MEMBER( colorData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( CurveStart ); - - MXAPI_EQUALS_BEGIN( CurveContinue ) - MXAPI_EQUALS_MEMBER( curveType ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( curvePoints ) - MXAPI_EQUALS_MEMBER( isBezierX2Specified ) - MXAPI_EQUALS_MEMBER( bezierX2 ) - MXAPI_EQUALS_MEMBER( isBezierY2Specified ) - MXAPI_EQUALS_MEMBER( bezierY2 ) - MXAPI_EQUALS_MEMBER( isBezierOffset2Specified ) - MXAPI_EQUALS_MEMBER( bezierOffset2 ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( CurveContinue ); - - MXAPI_EQUALS_BEGIN( CurveStop ) - MXAPI_EQUALS_MEMBER( curveType ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( curvePoints ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( CurveStop ); - } -} diff --git a/Sourcecode/include/mx/api/DefaultsData.h b/Sourcecode/include/mx/api/DefaultsData.h deleted file mode 100644 index 81f254f1a..000000000 --- a/Sourcecode/include/mx/api/DefaultsData.h +++ /dev/null @@ -1,133 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/AppearanceData.h" -#include "mx/api/PageLayoutData.h" -#include "mx/api/SystemLayoutData.h" - -#include -#include - -namespace mx -{ - namespace api - { - /// Corresponds to the `` element which is part of the - /// `ScoreHeaderGroup`. Sets the global defaults for the score such as - /// page size, system spacing, and the all-important `` and - /// `` values. - class DefaultsData - { - public: - - /// Sets the standard staff size for the score, in millimeters. - /// However, it does not work the way you might expect. The - /// millimeters value cannot be specified independently of the - /// tenths value (below). The tenths value says, basically, how - /// many tenths of a staff space we are specifying for the scaling - /// for. The simplest way to understand this is to set tenths to 40, - /// by which you are saying the scale you are providing is for 40 - /// tenths of a staff space, which is the same as 4 staff spaces, - /// with is the same as a normal staff. So if you set tenths to 40, - /// then millimeters will specify the size of your staff. - /// - /// Here's an example, if I create a default document with Finale - /// and export it to MusicXML, it writes this: - /// - /// - /// - /// - /// 7.2319 - /// 40 - /// ... - /// - /// - /// - /// In this example, Finale is saying that the size of the staff is - /// 7.2319 millimeters. - /// - /// Please note: we plan to provide types for specifying tenths and - /// millimeters in the future and this field will experience a - /// breaking change: https://github.com/webern/mx/issues/99 - /// - /// Here is the documentation from MusicXML: - /// - /// The millimeters type is a number representing millimeters. This - /// is used in the scaling element to provide a default scaling from - /// tenths to physical units. - Double scalingMillimeters; - - /// All measurements in the score are in 'tenths', which is one - /// tenth of a staff space. In other words, the size of a staff - /// space is 10 `tenths`. - /// - /// Please note: we plan to provide types for specifying tenths and - /// millimeters in the future and this field will experience a - /// breaking change: https://github.com/webern/mx/issues/99 - /// - /// Here is the documentation from MusicXML: - /// - /// The tenths type is a number representing tenths of interline - /// staff space (positive or negative). Both integer and decimal - /// values are allowed, such as 5 for a half space and 2.5 for a - /// quarter space. Interline space is measured from the middle of a - /// staff line. - /// - /// Distances in a MusicXML file are measured in tenths of staff - /// space. Tenths are then scaled to millimeters within the scaling - /// element, used in the defaults element at the start of a score. - /// Individual staves can apply a scaling factor to adjust staff - /// size. When a MusicXML element or attribute refers to tenths, it - /// means the global tenths defined by the scaling element, not the - /// local tenths as adjusted by the staff-size element. - Double scalingTenths; - - inline Double tenthsPerMillimeter() const - { - return scalingTenths / scalingMillimeters; - } - - inline Double tenthsPerInch() const - { - return tenthsPerMillimeter() * 25.4; - } - - /// Page layout. Note all members of PageLayoutData are optional. - PageLayoutData pageLayout; - - /// System layout. Note all members of SystemLayoutData are optional. - SystemLayoutData systemLayout; - - std::vector appearance; - - // TODO - this appears not to be used anywhere, please do not use - /// Measure numbering setting, at the global level, will be stated - /// in first measure's tag. This can can be overridden by a - /// value in the Measure. - MeasureNumbering measureNumbering; - - DefaultsData() - : scalingMillimeters{ -1.0 } - , scalingTenths{ -1.0 } - , pageLayout{} - , systemLayout{} - , appearance{} - , measureNumbering{ MeasureNumbering::unspecified } - { - - } - }; - - MXAPI_EQUALS_BEGIN( DefaultsData ) - MXAPI_EQUALS_MEMBER( pageLayout ) - MXAPI_EQUALS_MEMBER( systemLayout ) - MXAPI_EQUALS_MEMBER( appearance ) - MXAPI_EQUALS_MEMBER( measureNumbering ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( DefaultsData ); - } -} diff --git a/Sourcecode/include/mx/api/DirectionData.h b/Sourcecode/include/mx/api/DirectionData.h deleted file mode 100644 index 2a660267b..000000000 --- a/Sourcecode/include/mx/api/DirectionData.h +++ /dev/null @@ -1,128 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/ChordData.h" -#include "mx/api/CodaData.h" -#include "mx/api/MarkData.h" -#include "mx/api/OttavaData.h" -#include "mx/api/RehearsalData.h" -#include "mx/api/SegnoData.h" -#include "mx/api/TempoData.h" -#include "mx/api/WedgeData.h" -#include "mx/api/WordsData.h" - -namespace mx -{ - namespace api - { - - // MusicXML Documentation: A direction is a musical indication that is not attached to a specific - // note. Two or more may be combined to indicate starts and stops of wedges, dashes, etc. - // - // By default, a series of direction-type elements and a series of child elements of a direction- - // type within a single direction element follow one another in sequence visually. For a series of - // direction-type children, non-positional formatting attributes are carried over from the - // previous element by default. - struct DirectionData - { - int tickTimePosition; - Placement placement; - - // mx::api will place the DirectionData element in the correct place by using an offset element. - // MusicXML Documentation: An offset is represented in terms of divisions, and indicates where - // the direction will appear relative to the current musical location. This affects the visual - // appearance of the direction. If the sound attribute is "yes", then the offset affects - // playback too. If the sound attribute is "no", then any sound associated with the direction - // takes effect at the current location. The sound attribute is "no" by default for - // compatibility with earlier versions of the MusicXML format. If an element within a - // direction includes a default-x attribute, the offset value will be ignored when determining - // the appearance of that element. - - // voice value of -1 means unspecified - int voice; - - // Direction elements are placed inside the StaffData object in mx api. This would mean that - // they are alyways assigned to a staff, however MusicXML makes the staff element optional. - // in the case that we want a direction element to have no element then me must place - // the direction on staffIndex = 0 and set isStaffValueSpecified. otherwise the we will - // assume that the element is present with a value of staffIndex + 1. This bool is - // only relevant for Directions placed on staff zero, it is otherwise ignored. - bool isStaffValueSpecified; - - // TODO - sound element - - std::vector tempos; - std::vector marks; - std::vector wedgeStarts; - std::vector wedgeStops; - std::vector ottavaStarts; - std::vector ottavaStops; - std::vector bracketStarts; - std::vector bracketStops; - std::vector words; - std::vector chords; - std::vector segnos; - std::vector codas; - std::vector rehearsals; - - DirectionData() - : tickTimePosition{ 0 } - , placement{ Placement::unspecified } - , voice{ -1 } - , isStaffValueSpecified{ true } - , marks{} - , wedgeStarts{} - , wedgeStops{} - , ottavaStarts{} - , ottavaStops{} - , bracketStarts{} - , bracketStops{} - , words{} - , chords{} - , segnos{} - { - - } - }; - - inline bool isDirectionDataEmpty( const DirectionData& directionData ) - { - return directionData.tempos.size() == 0 && - directionData.marks.size() == 0 && - directionData.wedgeStarts.size() == 0 && - directionData.wedgeStops.size() == 0 && - directionData.bracketStarts.size() == 0 && - directionData.bracketStops.size() == 0 && - directionData.tempos.size() == 0 && - directionData.ottavaStarts.size() == 0 && - directionData.ottavaStops.size() == 0 && - directionData.words.size() == 0 && - directionData.segnos.size() == 0 && - directionData.codas.size() == 0; - } - - MXAPI_EQUALS_BEGIN( DirectionData ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( placement ) - MXAPI_EQUALS_MEMBER( voice ) - MXAPI_EQUALS_MEMBER( isStaffValueSpecified ) - MXAPI_EQUALS_MEMBER( tempos ) - MXAPI_EQUALS_MEMBER( marks ) - MXAPI_EQUALS_MEMBER( wedgeStarts ) - MXAPI_EQUALS_MEMBER( wedgeStops ) - MXAPI_EQUALS_MEMBER( ottavaStarts ) - MXAPI_EQUALS_MEMBER( ottavaStops ) - MXAPI_EQUALS_MEMBER( bracketStarts ) - MXAPI_EQUALS_MEMBER( bracketStops ) - MXAPI_EQUALS_MEMBER( words ) - MXAPI_EQUALS_MEMBER( chords ) - MXAPI_EQUALS_MEMBER( segnos ) - MXAPI_EQUALS_MEMBER( codas ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( DirectionData ); - } -} diff --git a/Sourcecode/include/mx/api/DocumentManager.h b/Sourcecode/include/mx/api/DocumentManager.h deleted file mode 100644 index 19cceb47c..000000000 --- a/Sourcecode/include/mx/api/DocumentManager.h +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ScoreData.h" - -#include -#include - -namespace mx -{ - namespace core - { - class Document; - using DocumentPtr = std::shared_ptr; - } - - namespace api - { - class DocumentManager - { - public: - DocumentManager( const DocumentManager& other ) = delete; - DocumentManager( DocumentManager&& other ) = delete; - DocumentManager& operator=( const DocumentManager& other ) = delete; - DocumentManager& operator=( DocumentManager&& other ) = delete; - ~DocumentManager(); - - // this class is a singleton, get it like this - // auto& docMngr = DocumentManager::getInstance() - static DocumentManager& getInstance(); - - - // creates a MusicXML document from a file - // and returns the document's ID number, -1 if error - int createFromFile( const std::string& filePath ); - - - // creates a MusicXML document from a character stream - // and returns the document's ID number, -1 if error - int createFromStream( std::istream& stream ); - - - // creates a MusicXML document from a Score structure - // and returns the document's ID number, -1 if error - int createFromScore( const ScoreData& score ); - - - // saves an existing MusicXML document to a - // file, -1 if error - void writeToFile( int documentId, const std::string& filePath ) const; - - - // saves an existing MusicXML document to a - // character stream, -1 if error - void writeToStream( int documentId, std::ostream& stream ) const; - - - // retreives the data from an existing document - // and returns it in the Score structure. if id - // does not exist, returns a default Score object - ScoreData getData( int documentId ) const; - - - // destroys the shared_ptr which is holding the document - // internally and stops tracking ownership of the document - void destroyDocument( int documentId ); - - - // avoid using this function if possible, only use this function - // if your requirements are not met by the Score structure - // note: returns a nullptr if the documentId is bad. if you - // hold a DocumentPtr and call destroyDocument then the - // DocumentManager will no longer know about the object, but the - // object will still exist - mx::core::DocumentPtr getDocument( int documentId ) const; - - // returns a unique number and increments the unique number - // generator. this is here as an aid to any client code that - // needs unique numbers since DocumentManager is already a - // thread-locking singleton, it can easily implement this. - int getUniqueId(); - - private: - DocumentManager(); - class Impl; - std::unique_ptr myImpl; - - }; - } -} diff --git a/Sourcecode/include/mx/api/DurationData.h b/Sourcecode/include/mx/api/DurationData.h deleted file mode 100644 index d63a0b36b..000000000 --- a/Sourcecode/include/mx/api/DurationData.h +++ /dev/null @@ -1,91 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/PrintData.h" -#include "mx/api/PositionData.h" -#include "mx/api/MarkData.h" -#include "mx/api/CurveData.h" - -namespace mx -{ - namespace api - { - enum class DurationName - { - unspecified, - maxima, - longa, - breve, - whole, - half, - quarter, - eighth, - dur16th, - dur32nd, - dur64th, - dur128th, - dur256th, - dur512th, - dur1024th - }; - - - constexpr long double DUR_QUARTERS_VALUE_MAXIMA = 32.0L; - constexpr long double DUR_QUARTERS_VALUE_LONGA = 16.0L; - constexpr long double DUR_QUARTERS_VALUE_BREVE = 8.0L; - constexpr long double DUR_QUARTERS_VALUE_WHOLE = 4.0L; - constexpr long double DUR_QUARTERS_VALUE_HALF = 2.0L; - constexpr long double DUR_QUARTERS_VALUE_QUARTER = 1.0L; - constexpr long double DUR_QUARTERS_VALUE_EIGHTH = 1.0L / 2.0L; - constexpr long double DUR_QUARTERS_VALUE_16TH = 1.0L / 4.0L; - constexpr long double DUR_QUARTERS_VALUE_32ND = 1.0L / 8.0L; - constexpr long double DUR_QUARTERS_VALUE_64TH = 1.0L / 16.0L; - constexpr long double DUR_QUARTERS_VALUE_128TH = 1.0L / 32.0L; - constexpr long double DUR_QUARTERS_VALUE_256TH = 1.0L / 64.0L; - constexpr long double DUR_QUARTERS_VALUE_512TH = 1.0L / 128.0L; - constexpr long double DUR_QUARTERS_VALUE_1024TH = 1.0L / 256.0L; - - inline long double applyDots( long double inUnDottedValue, int inNumDots ) - { - long double outValue = inUnDottedValue; - long double valueToAdd = inUnDottedValue / 0.5; - - for( int i = 0; i < inNumDots; ++i ) - { - outValue += valueToAdd; - valueToAdd /= 0.5; - } - - return outValue; - } - - struct DurationData - { - DurationData(); - - DurationName durationName; // i.e. quarter, eighth etc - int durationDots; // dots - int durationTimeTicks; // length of the note denominated in ticksPerQuarter - bool isTied; // affects sound only. is the note combined sound-wise with the following note of the same pitch - int timeModificationActualNotes; // i.e. for a triplet this would be 3 - int timeModificationNormalNotes; // i.e. for a triplet this would be 2 - api::DurationName timeModificationNormalType; // use this if the time modification ratio involves a different durationName than the main 'durationName' - int timeModificationNormalTypeDots; // in case the time modification ratio involves a dotted type - }; - - MXAPI_EQUALS_BEGIN( DurationData ) - MXAPI_EQUALS_MEMBER( durationName ) - MXAPI_EQUALS_MEMBER( durationDots ) - MXAPI_EQUALS_MEMBER( durationTimeTicks ) - MXAPI_EQUALS_MEMBER( isTied ) - MXAPI_EQUALS_MEMBER( timeModificationActualNotes ) - MXAPI_EQUALS_MEMBER( timeModificationNormalNotes ) - MXAPI_EQUALS_MEMBER( timeModificationNormalType ) - MXAPI_EQUALS_MEMBER( timeModificationNormalTypeDots ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( DurationData ); - } -} diff --git a/Sourcecode/include/mx/api/EncodingData.h b/Sourcecode/include/mx/api/EncodingData.h deleted file mode 100644 index bafd4fdf0..000000000 --- a/Sourcecode/include/mx/api/EncodingData.h +++ /dev/null @@ -1,100 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" - -#include -#include - -namespace mx -{ - namespace api - { - class SupportedItem - { - public: - std::string elementName; - std::string attributeName; - std::string specificValue; - bool isSupported; - - SupportedItem() - : elementName() - , attributeName() - , specificValue() - , isSupported(true) - { - - } - }; - - class MiscellaneousField - { - public: - std::string key; - std::string value; - - MiscellaneousField( std::string inKey, std::string inValue ) - : key{ inKey } - , value{ inValue } - { - - } - }; - - class EncodingDate - { - public: - int year; - int month; - int day; - EncodingDate() : year(-1), month(-1), day(-1) {} - static EncodingDate today(); - }; - - class EncodingData - { - public: - EncodingDate encodingDate; - std::string encoder; - std::string encodingDescription; - std::vector software; - std::vector supportedItems; - std::vector miscelaneousFields; - }; - - MXAPI_EQUALS_BEGIN( SupportedItem ) - MXAPI_EQUALS_MEMBER( elementName ) - MXAPI_EQUALS_MEMBER( attributeName ) - MXAPI_EQUALS_MEMBER( specificValue ) - MXAPI_EQUALS_MEMBER( isSupported ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SupportedItem ); - - MXAPI_EQUALS_BEGIN( MiscellaneousField ) - MXAPI_EQUALS_MEMBER( key ) - MXAPI_EQUALS_MEMBER( value ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MiscellaneousField ); - - MXAPI_EQUALS_BEGIN( EncodingDate ) - MXAPI_EQUALS_MEMBER( year ) - MXAPI_EQUALS_MEMBER( month ) - MXAPI_EQUALS_MEMBER( day ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( EncodingDate ); - - MXAPI_EQUALS_BEGIN( EncodingData ) - MXAPI_EQUALS_MEMBER( encodingDate ) - MXAPI_EQUALS_MEMBER( encoder ) - MXAPI_EQUALS_MEMBER( encodingDescription ) - MXAPI_EQUALS_MEMBER( software ) - MXAPI_EQUALS_MEMBER( supportedItems ) - MXAPI_EQUALS_MEMBER( miscelaneousFields ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( EncodingData ); - } -} diff --git a/Sourcecode/include/mx/api/FontData.h b/Sourcecode/include/mx/api/FontData.h deleted file mode 100644 index 4ce5697c3..000000000 --- a/Sourcecode/include/mx/api/FontData.h +++ /dev/null @@ -1,108 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/PositionData.h" -#include "mx/api/FontData.h" - -#include -#include - -namespace mx -{ - namespace api - { - - enum class FontSizeType - { - unspecified, - css, - point - }; - - - enum class CssSize - { - unspecified, - xxSmall, - xSmall, - small, - medium, - large, - xLarge, - xxLarge - }; - - - enum class FontStyle - { - unspecified, - normal, - italic - }; - - - enum class FontWeight - { - unspecified, - normal, - bold - }; - - - struct FontData - { - - // fontSizeType indicates which fontSize field - // is in use. if css, then use the fontSizeCss - // field, if point then use fontSizePoint - FontSizeType sizeType; - long double sizePoint; - CssSize sizeCss; - - FontStyle style; - FontWeight weight; - - std::vector fontFamily; - - int underline; - int overline; - int lineThrough; - - FontData() - : sizeType{ FontSizeType::unspecified } - , sizePoint{ -1.0L } - , sizeCss{ CssSize::unspecified } - , style{ FontStyle::unspecified } - , weight{ FontWeight::unspecified } - , fontFamily{} - , underline{ 0 } - , overline{ 0 } - , lineThrough{ 0 } - { - - } - }; - - - MXAPI_EQUALS_BEGIN( FontData ) - MXAPI_EQUALS_MEMBER( sizeType ) - MXAPI_EQUALS_MEMBER( sizePoint ) - MXAPI_EQUALS_MEMBER( sizeCss ) - MXAPI_EQUALS_MEMBER( style ) - MXAPI_EQUALS_MEMBER( weight ) - if( ! areVectorsEqual( lhs.fontFamily, rhs.fontFamily ) ) - { - MX_SHOW_UNEQUAL( "FontData", "fontFamily" ); - return false; - } - MXAPI_EQUALS_MEMBER( underline ) - MXAPI_EQUALS_MEMBER( overline ) - MXAPI_EQUALS_MEMBER( lineThrough ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( FontData ); - } -} diff --git a/Sourcecode/include/mx/api/KeyComponent.h b/Sourcecode/include/mx/api/KeyComponent.h deleted file mode 100644 index 7a2891baa..000000000 --- a/Sourcecode/include/mx/api/KeyComponent.h +++ /dev/null @@ -1,60 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once -#include "mx/api/ApiCommon.h" -#include "mx/api/PitchData.h" - -namespace mx -{ - namespace api - { - - // KeyComponent is only used for non-traditional key signatures. It facilitates specifying the - // exact accidentals that are found in the key signature. - struct KeyComponent - { - // The note name that is to be altered by the key signature. - Step step; - - // The amount that notes of this note name should be altered, in semitones. - int alter; - - // Additional amount that notes of this note name should be altered, in cents. If alter = 1 and cents = 25.1 - // then the note is altered by 1.251 semitones in total. - double cents; - - // The accidental to display for this note name. - Accidental accidental; - - KeyComponent() - : step{} - , alter{} - , cents{} - , accidental{} - { - - } - - KeyComponent( Step inStep, int inAlter, double inCents, Accidental inAccidental ) - : step{ inStep } - , alter{ inAlter } - , cents{ inCents } - , accidental{ inAccidental } - { - - } - }; - - - MXAPI_EQUALS_BEGIN( KeyComponent ) - MXAPI_EQUALS_MEMBER( step ) - MXAPI_EQUALS_MEMBER( alter ) - MXAPI_EQUALS_MEMBER( cents ) - MXAPI_EQUALS_MEMBER( accidental ) - MXAPI_EQUALS_END; - - MXAPI_NOT_EQUALS_AND_VECTORS( KeyComponent ); - } -} diff --git a/Sourcecode/include/mx/api/KeyData.h b/Sourcecode/include/mx/api/KeyData.h deleted file mode 100644 index 64464c60a..000000000 --- a/Sourcecode/include/mx/api/KeyData.h +++ /dev/null @@ -1,103 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once -#include "mx/api/KeyComponent.h" - -namespace mx -{ - namespace api - { - enum class KeyMode - { - unspecified, // a mode value was not provided - unsupported, // a mode value was provided but is not supported - major, - minor - }; - - // KeyData represents a key signature. It can be in one of two configurations. Either you specify - // 'fifths' and 'mode', or you can create a custom key signature by adding items to the customKey - // vector. If anything is found in the customKey vector, then fifths and mode will be ignored. - // - // Example, a traditional key signature (D Major): - // KeyData key; - // key.fifths = 2; // (i.e. 2 sharps) - // key.mode = KeyMode::major; // (optional) - // - // Example, a traditional key signature (G Minor): - // KeyData key; - // key.fifths = -2; // (i.e. 2 flats) - // key.mode = KeyMode::minor; // (optional) - // - // If you want to create a custom time signature, you can do so like this. Here we are creating a - // key where C's are sharp and D's are one-quarter-tone sharp. See KeyComponent for details. - // - // KeyComponent cSharp{ Step::c, 1, 0.0, Accidental::sharp }; - // KeyComponent dQuarterTone{ Step::d, 0, 50.0, Accidental:quarterSharp }; - // KeyData key; - // key.nonTraditional.push_back( cSharp ); - // key.nonTraditional.push_back( dQuarterTone ); - // - struct KeyData - { - // From MusicXML Specification: - // The fifths type represents the number of flats or sharps in a - // traditional key signature. Negative numbers are used for flats - // and positive numbers for sharps, reflecting the key's - // placement within the circle of fifths (hence the type name). - int fifths; - - // From MusicXML Specification: - // A cancel element indicates that the old key signature should be - // cancelled before the new one appears. This will always happen - // when changing to C major or A minor and need not be specified - // then. The cancel value matches the fifths value of the cancelled - // key signature (e.g., a cancel of -2 will provide an explicit - // cancellation for changing from B flat major to F major). The - // optional location attribute indicates whether the cancellation - // appears relative to the new key signature. - int cancel; - - // Mode specifies whether the key is major or minor. It is optional. - KeyMode mode; - - // Supports changing the key somewhere other than at the start of a measure. - int tickTimePosition; - - // this value is optional. -1 means unspecified. when value is - // unspecified it means that the key signature applies to all staves - // within the part - int staffIndex; - - // TODO support position data and/or other attributes - - // Supports the creation of customized, non-traditional key signatures by specifying the exact note - // alterations. When custom is non-empty, then fifths and mode are ignored. - std::vector nonTraditional; - - KeyData() - : fifths{ 0 } - , cancel{ 0 } - , mode{ KeyMode::unspecified } - , tickTimePosition{ 0 } - , staffIndex{ -1 } - , nonTraditional{} - { - - } - }; - - MXAPI_EQUALS_BEGIN( KeyData ) - MXAPI_EQUALS_MEMBER( fifths ) - MXAPI_EQUALS_MEMBER( cancel ) - MXAPI_EQUALS_MEMBER( mode ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( staffIndex ) - MXAPI_EQUALS_MEMBER( nonTraditional ) - MXAPI_EQUALS_END; - - MXAPI_NOT_EQUALS_AND_VECTORS( KeyData ); - } -} diff --git a/Sourcecode/include/mx/api/LayoutData.h b/Sourcecode/include/mx/api/LayoutData.h deleted file mode 100644 index 6d1ad5a37..000000000 --- a/Sourcecode/include/mx/api/LayoutData.h +++ /dev/null @@ -1,106 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/MeasureData.h" -#include "mx/api/PageData.h" -#include "mx/api/SystemData.h" - -#include - -namespace mx -{ - namespace api - { - /// LayoutData represents the page and system layout instructions that - /// are found in the element. These are held in `ScoreData` in a - /// map where the key is the measure index. For example, to start a new - /// page at measure index 39: - /// `score.layout.emplace( 39, LayoutData{ true, true } );`, where the - /// constructor `LayoutData{ true, true }` is a constructor indicating - /// that both a new system and a new page are indicated. - class LayoutData - { - public: - /// System information, such as whether a system break should occur. - /// Note: all members are optional. - SystemData system; - - /// Page information, such as whether a page break should occur. - /// Note: all members are optional. - PageData page; - - /// Convenience constructor for the use case where we only care - /// about specifying system breaks and page breaks. That is, if you - /// do not need to fuss with margins or spacing and only want to - /// indicate the start of a new system or page, you can use this - /// constructor. The first bool indicates that a new system should - /// start. The second bool indicates that a new page should also - /// start. For example: `LayoutData{ true }` produces - /// `` and `LayoutData{ true, true }` - /// produces `` - inline explicit LayoutData( bool inNewSystem, bool inNewPage = false ) - : system{ inNewSystem ? Bool::yes : Bool::unspecified } - , page{ inNewPage ? Bool::yes : Bool::unspecified } - { - - } - - /// The default constructor does not specify any page or system - /// details. i.e. a default constructed object will not produce a - /// `` element. - inline LayoutData() - : LayoutData{ SystemData{}, PageData{} } - { - - } - - /// The explicit constructor takes fully constructed members. - inline explicit LayoutData( SystemData inSystem, PageData inPage ) - : system{ std::move( inSystem ) } - , page{ std::move( inPage ) } - { - - } - - /// Tells us whether any members have been specified or not. - inline bool isUsed() const { return system.isUsed() || page.isUsed(); } - }; - - MXAPI_EQUALS_BEGIN( LayoutData ) - MXAPI_EQUALS_MEMBER( system ) - MXAPI_EQUALS_MEMBER( page ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( LayoutData ); - - inline bool operator==( - const std::map& a, - const std::map& b - ) - { - if( a.size() != b.size() ) - { - return false; - } - auto ai = a.cbegin(); - auto bi = b.cbegin(); - const auto aend = a.cend(); - const auto bend = b.cend(); - for( ; ai != aend && bi != bend; ++ai, ++bi ) - { - if( ai->first != bi->first ) - { - return false; - } - if( ai->second != bi->second ) - { - return false; - } - } - return true; - } - } -} diff --git a/Sourcecode/include/mx/api/LeftRight.h b/Sourcecode/include/mx/api/LeftRight.h deleted file mode 100644 index e2c5b949a..000000000 --- a/Sourcecode/include/mx/api/LeftRight.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/AppearanceData.h" -#include "mx/api/PageLayoutData.h" - -#include -#include - -namespace mx -{ - namespace api - { - /// Represents left and right measurements, in tenths, that are inseparable. - class LeftRight - { - public: - - /// Left measurement, in tenths. - Double left; - - /// Right measurement, in tenths. - Double right; - - inline explicit LeftRight( Double inLeft, Double inRight ) - : left{ inLeft } - , right{ inRight } - { - - } - - LeftRight() - : LeftRight{ 0.0, 0.0 } - { - - } - }; - - MXAPI_EQUALS_BEGIN( LeftRight ) - MXAPI_EQUALS_MEMBER( left ) - MXAPI_EQUALS_MEMBER( right ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( LeftRight ); - } -} diff --git a/Sourcecode/include/mx/api/LineData.h b/Sourcecode/include/mx/api/LineData.h deleted file mode 100644 index 0e940c58a..000000000 --- a/Sourcecode/include/mx/api/LineData.h +++ /dev/null @@ -1,76 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" - -namespace mx -{ - namespace api - { - enum class LineType - { - unspecified, - solid, - dashed, - dotted, - wavy - }; - - enum class LineHook - { - unspecified, - down, - up, - both, - arrow, - none - }; - - struct LineData - { - LineType lineType; - LineHook lineHook; - bool isStopLengthSpecified; - long double endLength; - bool isDashLengthSpecified; - long double dashLength; - bool isSpaceLengthSpecified; - long double spaceLength; - - inline bool isSpecified() const - { - return lineType != LineType::unspecified || - isDashLengthSpecified || - isSpaceLengthSpecified; - } - - LineData() - : lineType{ LineType::unspecified } - , lineHook{ LineHook::unspecified } - , isStopLengthSpecified{ false } - , endLength{ 0.0 } - , isDashLengthSpecified{ false } - , dashLength{ 0.0 } - , isSpaceLengthSpecified{ false } - , spaceLength{ 0.0 } - { - - } - }; - - MXAPI_EQUALS_BEGIN( LineData ) - MXAPI_EQUALS_MEMBER( lineType ) - MXAPI_EQUALS_MEMBER( lineHook ) - MXAPI_EQUALS_MEMBER( isStopLengthSpecified ) - MXAPI_EQUALS_MEMBER( endLength ) - MXAPI_EQUALS_MEMBER( isDashLengthSpecified ) - MXAPI_EQUALS_MEMBER( dashLength ) - MXAPI_EQUALS_MEMBER( isSpaceLengthSpecified ) - MXAPI_EQUALS_MEMBER( spaceLength ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( LineData ); - } -} diff --git a/Sourcecode/include/mx/api/LyricData.h b/Sourcecode/include/mx/api/LyricData.h deleted file mode 100644 index 877f58757..000000000 --- a/Sourcecode/include/mx/api/LyricData.h +++ /dev/null @@ -1,25 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" - -namespace mx -{ - namespace api - { - class LyricData - { - public: - LyricData() {} - - std::string text; - }; - - MXAPI_EQUALS_BEGIN( LyricData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( LyricData ); - } -} diff --git a/Sourcecode/include/mx/api/MarginsData.h b/Sourcecode/include/mx/api/MarginsData.h deleted file mode 100644 index 8f72cfcfd..000000000 --- a/Sourcecode/include/mx/api/MarginsData.h +++ /dev/null @@ -1,50 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" - -#include -#include - -namespace mx -{ - namespace api - { - - /// Left, right, top, bottom. Measurements are in tenths. - class MarginsData - { - public: - Double left; - Double right; - Double top; - Double bottom; - - inline MarginsData() - : MarginsData{ 0.0, 0.0, 0.0, 0.0 } - { - - } - - inline explicit MarginsData( Double inLeft, Double inRight, Double inTop, Double inBottom ) - : left{ inLeft } - , right{ inRight } - , top{ inTop } - , bottom{ inBottom } - { - - } - }; - - MXAPI_EQUALS_BEGIN( MarginsData ) - MXAPI_EQUALS_MEMBER( left ) - MXAPI_EQUALS_MEMBER( right ) - MXAPI_EQUALS_MEMBER( top ) - MXAPI_EQUALS_MEMBER( bottom ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MarginsData ); - } -} diff --git a/Sourcecode/include/mx/api/MarkData.h b/Sourcecode/include/mx/api/MarkData.h deleted file mode 100644 index f94ef8bf5..000000000 --- a/Sourcecode/include/mx/api/MarkData.h +++ /dev/null @@ -1,232 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/PositionData.h" -#include "mx/api/PrintData.h" - -#include - -namespace mx -{ - namespace api - { - enum class MarkType - { - unspecified, - - // articulations - accent, - strongAccent, // marcato - staccato, - tenuto, - detachedLegato, // tenuto with dot - staccatissimo, - spiccato, // ? using "StaccatissimoWedge" - scoop, - plop, - doit, - falloff, - breathMark, - caesura, - stress, - unstress, - otherArticulation, - - // dynamics - p, - pp, - ppp, - pppp, - ppppp, - pppppp, - f, - ff, - fff, - ffff, - fffff, - ffffff, - mp, - mf, - sf, - sfp, - sfpp, - fp, - rf, - rfz, - sfz, - sffz, - fz, - otherDynamics, - unknownDynamics, - - // ornaments - trillMark, - turn, - delayedTurn, - invertedTurn, - delayedInvertedTurn, - verticalTurn, - shake, - wavyLine, - mordent, - invertedMordent, - schleifer, - tremoloSingleOne, ///< A tremolo on a single note (a glyph, not a spanner) with 1 slash - tremoloSingleTwo, ///< A tremolo on a single note (a glyph, not a spanner) with 2 slashes - tremoloSingleThree, ///< A tremolo on a single note (a glyph, not a spanner) with 3 slashes - tremoloSingleFour, ///< A tremolo on a single note (a glyph, not a spanner) with 4 slashes - tremoloSingleFive, ///< A tremolo on a single note (a glyph, not a spanner) with 5 slashes - otherOrnament, ///< MusicXML's 'other-ornament' value - unknownOrnament, ///< Error state - - // accidental marks - accidentalMarkSharp, - accidentalMarkNatural, - accidentalMarkFlat, - accidentalMarkDoubleSharp, - accidentalMarkSharpSharp, - accidentalMarkFlatFlat, - accidentalMarkNaturalSharp, - accidentalMarkNaturalFlat, - accidentalMarkQuarterFlat, - accidentalMarkQuarterSharp, - accidentalMarkThreeQuartersFlat, - accidentalMarkThreeQuartersSharp, - accidentalMarkSharpDown, - accidentalMarkSharpUp, - accidentalMarkNaturalDown, - accidentalMarkNaturalUp, - accidentalMarkFlatDown, - accidentalMarkFlatUp, - accidentalMarkTripleSharp, - accidentalMarkTripleFlat, - accidentalMarkSlashQuarterSharp, - accidentalMarkSlashSharp, - accidentalMarkSlashFlat, - accidentalMarkDoubleSlashFlat, - accidentalMarkSharp1, - accidentalMarkSharp2, - accidentalMarkSharp3, - accidentalMarkSharp5, - accidentalMarkFlat1, - accidentalMarkFlat2, - accidentalMarkFlat3, - accidentalMarkFlat4, - accidentalMarkSori, - accidentalMarkKoron, - accidentalUnknown, - - // technical - upBow, - downBow, - harmonic, - openString, - thumbPosition, - // fingering, - // pluck, - doubleTongue, - tripleTongue, - stopped, - snapPizzicato, - // fret, - // string_, - // hammerOn, - // pullOff, - // bend, - // tap, - heel, - toe, - fingernails, - // hole, - // arrow, - // handbell, - otherTechnical, - unknownTechnical, - - // fermata - fermata, // - fermataNormal, // normal - fermataAngled, // angled - fermataSquare, // square - - // sadly, in MusicXML we do not have an 'above' 'below' attribute for the fermata. - // instead it has an attribute 'type' that is either 'upright' or 'inverted'. - // it appears that implementations interpret 'upright' to mean the 'normal' or - // correct orientation and 'inverted' to mean that the fermata should be 'flipped' - // from its correct orientation. in otherwords the implementation has to figure - // out if the fermata is above or below the note on its own (using its own - // algorithm combined with any default-y and relative-y values). this mess is - // going to be beyond the scope of the MusicXML Class Library at this time. You - // cause the fermata 'type' attribute to be set using the enum values below, but - // it's not possible for this library to calculate the correct fermata glyph. - fermataUpright, // - fermataNormalUpright, // normal - fermataAngledUpright, // angled - fermataSquareUpright, // square - fermataInverted, // - fermataNormalInverted, // normal - fermataAngledInverted, // angled - fermataSquareInverted, // square - unknownFermata, // bad state, unknown type, error - - pedal, // the typical piano pedal mark - damp, // the typical piano end-pedal mark - - // arpeggiate - arpeggiate, - arpeggiateDown, - arpeggiateUp, - - // nonArpeggiate - nonArpeggiate, - - // these are cust additions that will be written to, and read from, the - // other-articulations (or other-*) elements. - customErrorUnknown, // used to represent an error when parsing from a string - customAccentTenuto, - }; - - static constexpr const char* const markStringCustomErrorUnknown = ""; - static constexpr const char* const markStringCustomAccentTenuto = "gjhsldjhglskdjhfg"; - - bool isMarkOrnament( MarkType ); - bool isMarkPedal( MarkType ); - bool isMarkTechnical( MarkType ); - bool isMarkArticulation( MarkType ); - bool isMarkTremolo( MarkType ); - bool isMarkDynamic( MarkType ); - bool isMarkFermata( MarkType ); - bool isMarkArpeggiate( MarkType ); - bool isMarkNonArpeggiate( MarkType ); - - bool isMarkCustom( MarkType ); - std::string getCustomMarkName( MarkType ); - MarkType getMarkTypeFromCustomString( const std::string& ); - int numTremoloSlashes( MarkType ); - - struct MarkData - { - MarkType markType; - std::string name; - int tickTimePosition; - PrintData printData; - PositionData positionData; - - MarkData(); - MarkData( MarkType inMarkType ); - MarkData( Placement inPlacement, MarkType inMarkType ); - }; - - MXAPI_EQUALS_BEGIN( MarkData ) - MXAPI_EQUALS_MEMBER( markType ) - MXAPI_EQUALS_MEMBER( name ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( printData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MarkData ); - } -} diff --git a/Sourcecode/include/mx/api/MeasureData.h b/Sourcecode/include/mx/api/MeasureData.h deleted file mode 100644 index 2621f22a0..000000000 --- a/Sourcecode/include/mx/api/MeasureData.h +++ /dev/null @@ -1,120 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/BarlineData.h" -#include "mx/api/ClefData.h" -#include "mx/api/DirectionData.h" -#include "mx/api/KeyData.h" -#include "mx/api/StaffData.h" -#include "mx/api/TempoData.h" -#include "mx/api/TimeSignatureData.h" - -#include -#include - -namespace mx -{ - namespace api - { - /// This typedef help readability in a few places such as the layout map in ScoreData. - using MeasureIndex = int; - - class MeasureData - { - public: - - // this is the notes and other music data - std::vector staves; - - TimeSignatureData timeSignature; - - // an empty measureNumber indicates a normal - // measure number (i.e. the measure's - // index + 1). only read or write to - // this field when handling overridden - // measure numbers - // - // MusicXML Documentation: - // In partwise files, the number attribute - // should be the same for measures in - // different parts that share the same left - // barline. While the number attribute is - // often numeric, it does not have to be. - // Non-numeric values are typically used - // together with the implicit or non- - // controlling attributes being set to "yes". - // For a pickup measure, the number attribute - // is typically set to "0" and the implicit - // attribute is typically set to "yes". - // Further details about measure numbering - // can be defined using the measure-numbering - // element. - std::string number; - - // The measure-numbering-value type - // describes how measure numbers are - // displayed on this part: no numbers, - // numbers every measure, or numbers - // every system. - // - MeasureNumbering measureNumbering; - - // a number greater than zero indicates that - // this measure is the beginning of a mult- - // measure rest that will last for the - // indicated number of measures. following - // measures will be affected by this. - int multiMeasureRest; - - // The implicit attribute is set to "yes" for - // measures where the measure number should - // never appear, such as pickup measures and - // the last half of mid-measure repeats. The - // value is "no" if not specified. - Bool implicit; - - // The non-controlling attribute is intended for - // use in multimetric music like the Don Giovanni - // minuet. If set to "yes", the left barline in - // this measure does not coincide with the left - // barline of measures in other parts. The value - // is "no" if not specified. - Bool nonControlling; - - // a width value less than 0 means 'unspecified' - long double width; - std::vector keys; - std::vector barlines; - - MeasureData() - : staves{} - , timeSignature{} - , number{} - , measureNumbering{ MeasureNumbering::unspecified } - , multiMeasureRest{ -1 } - , implicit{ Bool::unspecified } - , nonControlling{ Bool::unspecified } - , width{ -1.0 } - { - - } - }; - - MXAPI_EQUALS_BEGIN( MeasureData ) - MXAPI_EQUALS_MEMBER( staves ) - MXAPI_EQUALS_MEMBER( timeSignature ) - MXAPI_EQUALS_MEMBER( number ) - MXAPI_EQUALS_MEMBER( measureNumbering ) - MXAPI_EQUALS_MEMBER( multiMeasureRest ) - MXAPI_EQUALS_MEMBER( implicit ) - MXAPI_EQUALS_MEMBER( nonControlling ) - MXAPI_EQUALS_MEMBER( width ) - MXAPI_EQUALS_MEMBER( keys ) - MXAPI_EQUALS_MEMBER( barlines ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MeasureData ); - } -} diff --git a/Sourcecode/include/mx/api/MeasureLocation.h b/Sourcecode/include/mx/api/MeasureLocation.h deleted file mode 100644 index d5076e526..000000000 --- a/Sourcecode/include/mx/api/MeasureLocation.h +++ /dev/null @@ -1,36 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/NoteData.h" - -namespace mx -{ - namespace api - { - class ScoreData; - - class MeasureLocation - { - public: - - MeasureLocation(); - - int partIndex; - int staffIndex; - int measureIndex; - - bool isValid( const ScoreData& scoreData ) const; - - }; - - MXAPI_EQUALS_BEGIN( MeasureLocation ) - MXAPI_EQUALS_MEMBER( partIndex ) - MXAPI_EQUALS_MEMBER( staffIndex ) - MXAPI_EQUALS_MEMBER( measureIndex ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MeasureLocation ); - } -} diff --git a/Sourcecode/include/mx/api/MiscData.h b/Sourcecode/include/mx/api/MiscData.h deleted file mode 100644 index 77a8faaaa..000000000 --- a/Sourcecode/include/mx/api/MiscData.h +++ /dev/null @@ -1,28 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" - -#include - -namespace mx -{ - namespace api - { - class MiscData - { - public: - std::string name; - std::string data; - }; - - MXAPI_EQUALS_BEGIN( MiscData ) - MXAPI_EQUALS_MEMBER( name ) - MXAPI_EQUALS_MEMBER( data ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MiscData ); - } -} diff --git a/Sourcecode/include/mx/api/NoteAttachmentData.h b/Sourcecode/include/mx/api/NoteAttachmentData.h deleted file mode 100644 index 7dfd4c25f..000000000 --- a/Sourcecode/include/mx/api/NoteAttachmentData.h +++ /dev/null @@ -1,40 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/MarkData.h" -#include "mx/api/CurveData.h" -#include "mx/api/TupletData.h" - -namespace mx -{ - namespace api - { - class NoteAttachmentData - { - public: - std::vector marks; - std::vector curveStarts; - std::vector curveContinuations; - std::vector curveStops; - std::vector tupletStarts; - std::vector tupletStops; - //std::vector spannerStarts; - //std::vector spannerStops; - }; - - MXAPI_EQUALS_BEGIN( NoteAttachmentData ) - MXAPI_EQUALS_MEMBER( marks ) - MXAPI_EQUALS_MEMBER( curveStarts ) - MXAPI_EQUALS_MEMBER( curveContinuations ) - MXAPI_EQUALS_MEMBER( curveStops ) - MXAPI_EQUALS_MEMBER( tupletStarts ) - MXAPI_EQUALS_MEMBER( tupletStops ) - //MXAPI_EQUALS_MEMBER( spannerStarts ) - //MXAPI_EQUALS_MEMBER( spannerStops ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( NoteAttachmentData ); - } -} diff --git a/Sourcecode/include/mx/api/NoteData.h b/Sourcecode/include/mx/api/NoteData.h deleted file mode 100644 index 1c1539b02..000000000 --- a/Sourcecode/include/mx/api/NoteData.h +++ /dev/null @@ -1,154 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/PrintData.h" -#include "mx/api/PositionData.h" -#include "mx/api/DurationData.h" -#include "mx/api/PitchData.h" -#include "mx/api/NoteAttachmentData.h" - -#include - - -namespace mx -{ - namespace api - { - enum class NoteType - { - normal, - grace, - cue - }; - - enum class Notehead - { - slash, - triangle, - diamond, - square, - cross, - x, - circleX, - invertedTriangle, - arrowDown, - arrowUp, - slashed, - backSlashed, - normal, - cluster, - circleDot, - leftTriangle, - rectangle, - none, - do_, - re, - mi, - fa, - faUp, - so, - la, - ti - }; - - enum class Beam - { - unspecified, - begin, - end, - extend, - forwardBroken, - backwardBroken - }; - - enum class Stem - { - unspecified, - up, - down, - none, - both - }; - - class NoteData - { - public: - - NoteData(); - - bool isRest; // if isRest is true then isUnpitched can be ignored - bool isMeasureRest; // only valid if isRest is true - bool isUnpitched; // only relevant if isRest is false - bool isDisplayStepOctaveSpecified; // MusicXML can optionally specify display step and octave for rests and unpitched notes - - // This does *not* indicate the presence of absence of a tag. Instead isChord - // denotes whether or not the note is a member of a chord. This is translated from/to - // MusicXML's usage rules (the first note of a chord does *not* have a - // tag, but subsequent chord notes do have the tag). - bool isChord; - - // This is separate from the tie curves themselves. This - // states that the note should be tied but noteAttachment.curve - // items are needed to draw the ties visibly - bool isTieStart; - bool isTieStop; - - NoteType noteType; // normal, cue, grace - Notehead notehead; - PitchData pitchData; // step, alter, octave, accidental, etc - int userRequestedVoiceNumber; - Stem stem; - - // the time location of the note, within the measure, denominated in ticksPerQuarter which - // is defined in ScoreData. in each measure, the note with tickTimePosition 0 is located at - // the start of the measure. if ScoreData defines ticksPerQuarter as N, then the note - // located at tickTimePosition N will be located one quarter note after the start of the - // measure. MusicXML's and tags will be automatically placed into the - // MusicXML as required to facilitate the correct timing of notes based on their - // tickTimePosition values. - int tickTimePosition; - DurationData durationData; - - std::vector beams; - PositionData positionData; - PrintData printData; - - NoteAttachmentData noteAttachmentData; - - // these strings will be stuffed into the editorial element - // preceded by the string ##misc-data##. for example if you have the - // strings Bob, Cat, Hello then we will get: - // ##misc-data##Bob,Cat,Hello - // similarly when parsing if we see ##misc-data## in this element, it - // will be parsed into these strings. do not use commas in your misc - // data strings as these are the delimiter - std::vector miscData; - }; - - - MXAPI_EQUALS_BEGIN( NoteData ) - MXAPI_EQUALS_MEMBER( isRest ) - MXAPI_EQUALS_MEMBER( isMeasureRest ) - MXAPI_EQUALS_MEMBER( isUnpitched ) - MXAPI_EQUALS_MEMBER( isDisplayStepOctaveSpecified ) - MXAPI_EQUALS_MEMBER( isChord ) - MXAPI_EQUALS_MEMBER( isTieStart ) - MXAPI_EQUALS_MEMBER( isTieStop ) - MXAPI_EQUALS_MEMBER( noteType ) - MXAPI_EQUALS_MEMBER( pitchData ) - MXAPI_EQUALS_MEMBER( userRequestedVoiceNumber ) - MXAPI_EQUALS_MEMBER( stem ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( durationData ) - MXAPI_EQUALS_MEMBER( beams ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( printData ) - MXAPI_EQUALS_MEMBER( noteAttachmentData ) - MXAPI_EQUALS_MEMBER( miscData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( NoteData ); - } -} diff --git a/Sourcecode/include/mx/api/OttavaData.h b/Sourcecode/include/mx/api/OttavaData.h deleted file mode 100644 index 67a154b4f..000000000 --- a/Sourcecode/include/mx/api/OttavaData.h +++ /dev/null @@ -1,43 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once -#include "mx/api/SpannerData.h" - -namespace mx -{ - namespace api - { - enum class OttavaType - { - unspecified, - o8va, // octave up - o8vb, // octave down - o15ma, // 2 octaves up - o15mb // 2 octaves down - }; - - class OttavaStart - { - public: - SpannerStart spannerStart; - OttavaType ottavaType; - - OttavaStart() - : spannerStart{} - , ottavaType{ OttavaType::unspecified } - { - - } - }; - - // SpannerStop is used for OttavaStops - - MXAPI_EQUALS_BEGIN( OttavaStart ) - MXAPI_EQUALS_MEMBER( spannerStart ) - MXAPI_EQUALS_MEMBER( ottavaType ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( OttavaStart ); - } -} diff --git a/Sourcecode/include/mx/api/PageData.h b/Sourcecode/include/mx/api/PageData.h deleted file mode 100644 index 9a4cd843a..000000000 --- a/Sourcecode/include/mx/api/PageData.h +++ /dev/null @@ -1,62 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/PageLayoutData.h" - -#include -#include -#include - -namespace mx -{ - namespace api - { - /// PageData allows the specification of a new page, or the prevention of a new page, along with the ability - /// to change the page layout settings. In the score these are stored in a map where the map key is the measure - /// index of where the PageData takes effect in the score. - class PageData - { - public: - inline explicit PageData( - Bool inNewPage = Bool::unspecified, - PageLayoutData inPageLayoutData = PageLayoutData{}, - std::optional inPageNumber = std::nullopt - ) - : newPage{ inNewPage } - , pageLayoutData{ inPageLayoutData } - , pageNumber{ std::move( inPageNumber ) } - { - - } - - /// `yes` will cause a page break at the specified measure index or system index. `no` indicates that a - /// page break should be avoided. 'unspecified' means that no page-break attribute will be shown. - Bool newPage; - - /// Optionally change the page layout settings starting with this page (and continuing thereafter). The - /// default constructed PageLayoutData will not affect page layout. Page layout information will only be - /// written if you set one or more of its optional values. - PageLayoutData pageLayoutData; - - /// The displayed page number. std::nullopt indicates the absence of a page-number attribute. - std::optional pageNumber; - - /// Indicates whether any values have been assigned. - inline bool isUsed() const - { - return isSpecified( newPage ) || pageLayoutData.isUsed() || pageNumber; - } - }; - - MXAPI_EQUALS_BEGIN( PageData ) - MXAPI_EQUALS_MEMBER( newPage ) - MXAPI_EQUALS_MEMBER( pageLayoutData ) - MXAPI_EQUALS_MEMBER( pageNumber ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PageData ); - } -} diff --git a/Sourcecode/include/mx/api/PageLayoutData.h b/Sourcecode/include/mx/api/PageLayoutData.h deleted file mode 100644 index 353740746..000000000 --- a/Sourcecode/include/mx/api/PageLayoutData.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/AppearanceData.h" -#include "mx/api/PageMarginsData.h" -#include "mx/api/SizeData.h" - -#include -#include - -namespace mx -{ - namespace api - { - /// PageLayoutData allows for the setting of page sizes and margins. - class PageLayoutData - { - public: - - /// Page size, in tenths. - std::optional size; - - /// Page margin data (note all members of PageMarginsData are optional). - PageMarginsData margins; - - PageLayoutData() - : size( std::nullopt ) - , margins{} - { - - } - - inline bool isUsed() const - { - return size || margins.isUsed(); - } - }; - - MXAPI_EQUALS_BEGIN( PageLayoutData ) - MXAPI_EQUALS_MEMBER( size ) - MXAPI_EQUALS_MEMBER( margins ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PageLayoutData ); - } -} diff --git a/Sourcecode/include/mx/api/PageMarginsData.h b/Sourcecode/include/mx/api/PageMarginsData.h deleted file mode 100644 index 89146ab8c..000000000 --- a/Sourcecode/include/mx/api/PageMarginsData.h +++ /dev/null @@ -1,57 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/AppearanceData.h" -#include "mx/api/MarginsData.h" - -#include -#include - -namespace mx -{ - namespace api - { - - /// Page margins are specified separately for odd and even pages. If odd and even pages have the same values, - /// then then a type of "both" will be used in the produced MusicXML. All values are optional. - class PageMarginsData - { - public: - /// Margins for odd pages. - std::optional odd; - - /// Margins for even pages. - std::optional even; - - PageMarginsData() - : odd{ std::nullopt } - , even{ std::nullopt } - { - - } - - /// Returns true if any values have been specified. If false, then PageMarginsData can be ignored. - inline bool isUsed() const - { - return odd || even; - } - - /// Returns true if the odd page margins are equal to the even page margins (i.e. if a 'both' attribute - /// type can be used in MusicXML). - inline bool same() const - { - return odd == even; - } - }; - - MXAPI_EQUALS_BEGIN( PageMarginsData ) - MXAPI_EQUALS_MEMBER( odd ) - MXAPI_EQUALS_MEMBER( even ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PageMarginsData ); - } -} diff --git a/Sourcecode/include/mx/api/PageTextData.h b/Sourcecode/include/mx/api/PageTextData.h deleted file mode 100644 index 80e02411e..000000000 --- a/Sourcecode/include/mx/api/PageTextData.h +++ /dev/null @@ -1,40 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/PositionData.h" -#include "mx/api/FontData.h" - -#include -#include - -namespace mx -{ - namespace api - { - - // distance values are in 'tenths' governed by the 'scaling' values - - class PageTextData - { - public: - std::string text; - int pageNumber; - PositionData positionData; - FontData fontData; - std::string description; // e.g. 'composer', 'page number', 'title', etc., this is metadata which does not appear on the printed page - }; - - MXAPI_EQUALS_BEGIN( PageTextData ) - MXAPI_EQUALS_MEMBER( text ) - MXAPI_EQUALS_MEMBER( pageNumber ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( fontData ) - MXAPI_EQUALS_MEMBER( description ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PageTextData ); - } -} diff --git a/Sourcecode/include/mx/api/PartData.h b/Sourcecode/include/mx/api/PartData.h deleted file mode 100644 index 25b3c8e6e..000000000 --- a/Sourcecode/include/mx/api/PartData.h +++ /dev/null @@ -1,223 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/MeasureData.h" -#include "mx/api/SoundID.h" -#include "mx/api/TransposeData.h" - -#include -#include -#include - -namespace mx -{ - namespace api - { - enum class SoloOrEnsemble - { - unspecified, - solo, - ensemble - }; - - struct MidiData - { - std::string virtualLibrary; - std::string virtualName; - std::string device; - std::string name; - - // -1 indicates absence of value - int bank; - - // -1 indicates absence of value - int channel; - - // -1 indicates absence of value - int program; - - // -1 indicates absence of value - int unpitched; - - // percent, valid range 0.0 to 100.0 - long double volume; - bool isVolumeSpecified; - - // rotation degrees, valid range -180.0 to +180.0 - long double pan; - bool isPanSpecified; - - // rotation degrees, valid range -180.0 to +180.0 - long double elevation; - bool isElevationSpecified; - - MidiData() - : virtualLibrary{} - , virtualName{} - , device{} - , name{} - , bank{ -1 } - , channel{ -1 } - , program{ -1 } - , unpitched{ -1 } - , volume{ 0.0 } - , isVolumeSpecified{ false } - , pan{ 0.0 } - , isPanSpecified{ false } - , elevation{ 0.0 } - , isElevationSpecified{ false } - { - - } - }; - - struct InstrumentData - { - std::string uniqueId; - std::string name; - std::string abbreviation; - SoundID soundID; - SoloOrEnsemble soloOrEnsemble; - MidiData midiData; - - InstrumentData() - : uniqueId{} - , name{} - , abbreviation{} - , soundID{ SoundID::unspecified } - , soloOrEnsemble{ SoloOrEnsemble::unspecified } - , midiData{} - { - - } - }; - - class PartData - { - public: - std::string uniqueId; - - // because the MuscXML specification says this "Formatting - // attributes for the part-name element are deprecated in - // Version 2.0 in favor of the new part-name-display and - // part-abbreviation-display elements" the name will always - // be written with 'print-object="no". You must populate - // the displayName field in order to have a name displayed. - std::string name; - - // because the MuscXML specification says this "Formatting - // attributes for the part-name element are deprecated in - // Version 2.0 in favor of the new part-name-display and - // part-abbreviation-display elements" the abbreviation - // will always be written with 'print-object="no". You - // must populate the displayAbbreviation field in order to - // have an abbreviation displayed. - std::string abbreviation; - - std::string displayName; - PrintData displayNamePrintData; - PositionData displayNamePositionData; - - std::string displayAbbreviation; - PrintData displayAbbreviationPrintData; - PositionData displayAbbreviationPositionData; - - InstrumentData instrumentData; - - /// The initial transposition for the part. If the music entered into the part is not in - /// concert pitch, then this field is used to specify the transposition that is in- - /// effect. Note, MusicXML encodes transposition in the measure data, not in the part - /// data. Here we offer a convient way to set the transposition in the first measure of - /// the part. Subsequent transposition changes are not currently supported by mx::api. - std::optional transposition; - - std::vector measures; - - inline int getNumStaves() const - { - int numStaves = 0; - - for( const auto& measure : measures ) - { - int temp = static_cast( measure.staves.size() ); - if( temp > numStaves ) - { - numStaves = temp; - } - } - - return numStaves; - } - - inline int getMaxVoice() const - { - int maxVoice = 0; - - for( const auto& measure : measures ) - { - for( const auto& staff : measure.staves ) - { - for( const auto& voice : staff.voices ) - { - int temp = static_cast( voice.first ); - if( temp > maxVoice ) - { - maxVoice = temp; - } - } - - } - } - - return maxVoice; - } - }; - - MXAPI_EQUALS_BEGIN( MidiData ) - MXAPI_EQUALS_MEMBER( virtualLibrary ) - MXAPI_EQUALS_MEMBER( virtualName ) - MXAPI_EQUALS_MEMBER( device ) - MXAPI_EQUALS_MEMBER( name ) - MXAPI_EQUALS_MEMBER( bank ) - MXAPI_EQUALS_MEMBER( channel ) - MXAPI_EQUALS_MEMBER( program ) - MXAPI_EQUALS_MEMBER( unpitched ) - MXAPI_EQUALS_MEMBER( volume ) - MXAPI_EQUALS_MEMBER( isVolumeSpecified ) - MXAPI_EQUALS_MEMBER( pan ) - MXAPI_EQUALS_MEMBER( isPanSpecified ) - MXAPI_EQUALS_MEMBER( elevation ) - MXAPI_EQUALS_MEMBER( isElevationSpecified ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MidiData ); - - MXAPI_EQUALS_BEGIN( InstrumentData ) - MXAPI_EQUALS_MEMBER( uniqueId ) - MXAPI_EQUALS_MEMBER( name ) - MXAPI_EQUALS_MEMBER( abbreviation ) - MXAPI_EQUALS_MEMBER( soundID ) - MXAPI_EQUALS_MEMBER( soloOrEnsemble ) - MXAPI_EQUALS_MEMBER( midiData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( InstrumentData ); - - MXAPI_EQUALS_BEGIN( PartData ) - MXAPI_EQUALS_MEMBER( uniqueId ) - MXAPI_EQUALS_MEMBER( name ) - MXAPI_EQUALS_MEMBER( abbreviation ) - MXAPI_EQUALS_MEMBER( displayName ) - MXAPI_EQUALS_MEMBER( displayNamePrintData ) - MXAPI_EQUALS_MEMBER( displayNamePositionData ) - MXAPI_EQUALS_MEMBER( displayAbbreviation ) - MXAPI_EQUALS_MEMBER( displayAbbreviationPrintData ) - MXAPI_EQUALS_MEMBER( displayAbbreviationPositionData ) - MXAPI_EQUALS_MEMBER( instrumentData ) - MXAPI_EQUALS_MEMBER( transposition ) - MXAPI_EQUALS_MEMBER( measures ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PartData ); - } -} diff --git a/Sourcecode/include/mx/api/PartGroupData.h b/Sourcecode/include/mx/api/PartGroupData.h deleted file mode 100644 index 42c7e66de..000000000 --- a/Sourcecode/include/mx/api/PartGroupData.h +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include - -namespace mx -{ - namespace api - { - enum class BracketType - { - unspecified, - none, - brace, - line, - bracket, - square - }; - - // The part-group element indicates groupings of parts in the score, usually indicated - // by braces and brackets. Braces that are used for multi-staff parts should be defined - // in the attributes element for that part. The part-group start element appears before - // the first score-part in the group. The part-group stop element appears after the - // last score-part in the group. - - // The number attribute is used to distinguish overlapping and nested part-groups, not - // the sequence of groups. As with parts, groups can have a name and abbreviation. - // Values for the child elements are ignored at the stop of a group. - - // A part-group element is not needed for a single multi-staff part. By default, multi- - // staff parts include a brace symbol and (if appropriate given the bar-style) common - // barlines. The symbol formatting for a multi-staff part can be more fully specified - // using the part-symbol element. - - class PartGroupData - { - public: - int firstPartIndex; - int lastPartIndex; - std::string name; - std::string displayName; - std::string abbreviation; - std::string displayAbbreviation; - BracketType bracketType; - // TODO - group barline - // TODO - group time - // TODO - group editorial - - // The number attribute is used to distinguish overlapping - // and nested part-groups, not the sequence of groups. - // -1 indicates the absence of a number attribute - int number; - - PartGroupData() - : firstPartIndex{ -1 } - , lastPartIndex{ -1 } - , name{} - , number{ -1 } - { - - } - }; - - MXAPI_EQUALS_BEGIN( PartGroupData ) - MXAPI_EQUALS_MEMBER( firstPartIndex ) - MXAPI_EQUALS_MEMBER( lastPartIndex ) - MXAPI_EQUALS_MEMBER( name ) - MXAPI_EQUALS_MEMBER( displayName ) - MXAPI_EQUALS_MEMBER( abbreviation ) - MXAPI_EQUALS_MEMBER( displayAbbreviation ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PartGroupData ); - } -} diff --git a/Sourcecode/include/mx/api/PitchData.h b/Sourcecode/include/mx/api/PitchData.h deleted file mode 100644 index ee8441b4e..000000000 --- a/Sourcecode/include/mx/api/PitchData.h +++ /dev/null @@ -1,153 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" - -namespace mx -{ - namespace api - { - enum class Step - { - c = 0, - d = 1, - e = 2, - f = 3, - g = 4, - a = 5, - b = 6, - unspecified = -1 - }; - - enum class Accidental - { - // none means the note does not have an accidental - none, - - // the rest of these values map to the musicxml specification - sharp, - natural, - flat, - doubleSharp, - sharpSharp, - flatFlat, - naturalSharp, - naturalFlat, - quarterFlat, - quarterSharp, - threeQuartersFlat, - threeQuartersSharp, - sharpDown, - sharpUp, - naturalDown, - naturalUp, - flatDown, - flatUp, - tripleSharp, - tripleFlat, - slashQuarterSharp, - slashSharp, - slashFlat, - doubleSlashFlat, - sharp1, - sharp2, - sharp3, - sharp5, - flat1, - flat2, - flat3, - flat4, - sori, - koron - }; - - struct PitchData - { - // default construction is middle c (c4) - PitchData(); - - constexpr explicit PitchData( - Step inStep, - int inAlter = 0, - int inOctave = 4, - Accidental inAccidental = Accidental::none, - - // less-often used params last - double inCents = 0.0, - bool inIsAccidentalParenthetical = false, - bool inIsAccidentalCautionary = false, - bool inIsAccidentalEditorial = false, - bool inIsAccidentalBracketed = false - ) - : step{ inStep } - , alter{ inAlter } - , cents{ inCents } - , accidental{ inAccidental } - , isAccidentalParenthetical{ inIsAccidentalParenthetical } - , isAccidentalCautionary{ inIsAccidentalCautionary } - , isAccidentalEditorial{ inIsAccidentalEditorial } - , isAccidentalBracketed{ inIsAccidentalBracketed } - , octave{ inOctave } - { - - } - - // the note name. i.e. c, d, e, f, g, a, b - Step step; - - // the alteration (number of semitones of pitch distance) from the step. for example, if step is 'c' and - // alter is 1, then the sounding pitch is c#. if step is 'd' and alter is -2, then the sounding pitch is - // 'c' (i.e. d double flat). alter only affects the sounding pitch of the note. accidentals are applied - // independently. alter is always required to produce the correct sounding pitch, regardless of key - // signature or accidentals. - int alter; - - // additional alteration to the sounding pitch (in hundredths of a semitone). the MusicXML alter value is - // a floating point number to facilitate microtonal music. however for mx::api we wanted the simplicity of - // dealing with integrals for the more common case on non-microtonal music. in order to still support - // microtones without resorting to a floating-point alter value, we break out microtonal adjustments to a - // separate 'cents' field, which will be added to the alter integral: - // = (double)alter + (cents / 100.0) - double cents; - - // in MusicXML, the accidental is completely independent of the sounding pitch and is only present when you - // actually want to show the accidental in the notated music. i.e. accidental is purely visual. for example, - // if you have a measure consisting of repeated c# notes, you would typically notate this with an accidental - // on the first note only. the rest of the notes of the measure would be 'sharped' by virtue of the first - // note's sharp. in MusicXML, the first note should have an accidental of 'sharp' and an alter of '1', and - // the remaining notes of the measure should have an accidental of 'none' and an alter of '1'. - Accidental accidental; - bool isAccidentalParenthetical; - bool isAccidentalCautionary; - bool isAccidentalEditorial; - bool isAccidentalBracketed; - - // which octave the note is located in. middle c is in octave 4. - int octave; - - // automatically set the Accidental enum value by parsing the alter value (does not consider the value of - // cents). this is a convenience function that simply adds the correct accidental given the current value - // of alter. for example, if alter is 1, then showAccidental will set the accidental field to 'sharp'. - void showAccidental(); - - // set the accidental value to 'none' and clear out the other accidental-related values - void hideAccidental(); - }; - - MXAPI_EQUALS_BEGIN( PitchData ) - MXAPI_EQUALS_MEMBER( step ) - MXAPI_EQUALS_MEMBER( alter ) - MXAPI_DOUBLES_EQUALS_MEMBER( cents ) - MXAPI_EQUALS_MEMBER( accidental ) - MXAPI_EQUALS_MEMBER( isAccidentalParenthetical ) - MXAPI_EQUALS_MEMBER( isAccidentalCautionary ) - MXAPI_EQUALS_MEMBER( isAccidentalEditorial ) - MXAPI_EQUALS_MEMBER( isAccidentalBracketed ) - MXAPI_EQUALS_MEMBER( octave ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PitchData ); - } -} diff --git a/Sourcecode/include/mx/api/PositionData.h b/Sourcecode/include/mx/api/PositionData.h deleted file mode 100644 index 1fb9176fe..000000000 --- a/Sourcecode/include/mx/api/PositionData.h +++ /dev/null @@ -1,145 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" - -// From the MusicXML Documentation -// -// The position attributes are based on MuseData print suggestions. For most -// elements, any program will compute a default x and y position. The position -// attributes let this be changed two ways. -// -// The default-x and default-y attributes change the computation of the -// default position. For most elements, the origin is changed relative to the -// left-hand side of the note or the musical position within the bar (x) and -// the top line of the staff (y). -// -// For the following elements, the default-x value changes the origin relative -// to the start of the current measure: -// -// - note -// - figured-bass -// - harmony -// - link -// - directive -// - measure-numbering -// - all descendants of the part-list element -// - all children of the direction-type element -// -// This origin is from the start of the entire measure, at either the left -// barline or the start of the system. -// -// When the default-x attribute is used within a child element of the part- -// name-display, part-abbreviation-display, group-name-display, or group- -// abbreviation-display elements, it changes the origin relative to the start -// of the first measure on the system. These values are used when the current -// measure or a succeeding measure starts a new system. The same change of -// origin is used for the group-symbol element. -// -// For the note, figured-bass, and harmony elements, the default-x value is -// considered to have adjusted the musical position within the bar for its -// descendant elements. -// -// Since the credit-words and credit-image elements are not related to a -// measure, in these cases the default-x and default-y attributes adjust -// the origin relative to the bottom left-hand corner of the specified page. -// -// The relative-x and relative-y attributes change the position relative to -// the default position, either as computed by the individual program, or -// as overridden by the default-x and default-y attributes. -// -// Positive x is right, negative x is left; positive y is up, negative y is -// down. All units are in tenths of interline space. For stems, positive -// relative-y lengthens a stem while negative relative-y shortens it. -// -// The default-x and default-y position attributes provide higher-resolution -// positioning data than related features such as the placement attribute -// and the offset element. Applications reading a MusicXML file that can -// understand both features should generally rely on the default-x and -// default-y attributes for their greater accuracy. For the relative-x -// and relative-y attributes, the offset element, placement attribute, and -// directive attribute provide context for the relative position information, -// so the two features should be interpreted together. -// -// As elsewhere in the MusicXML format, tenths are the global tenths defined -// by the scaling element, not the local tenths of a staff resized by the -// staff-size element. - -namespace mx -{ - namespace api - { - // all distance values are in 'tenths' - - enum class VerticalAlignment - { - unspecified, - top, - middle, - bottom, - baseline - }; - - enum class HorizontalAlignment - { - unspecified, - left, - center, - right - }; - - class PositionData - { - public: - - // decimal values are in 'tenths' - - long double defaultX; - bool isDefaultXSpecified; - long double defaultY; - bool isDefaultYSpecified; - long double relativeX; - bool isRelativeXSpecified; - long double relativeY; - bool isRelativeYSpecified; - Placement placement; - VerticalAlignment verticalAlignment; - HorizontalAlignment horizontalAlignmnet; - - PositionData() - : defaultX( 0.0 ) - , isDefaultXSpecified( false ) - , defaultY( 0.0 ) - , isDefaultYSpecified( false ) - , relativeX( 0.0 ) - , isRelativeXSpecified( false ) - , relativeY( 0.0 ) - , isRelativeYSpecified( false ) - , placement( Placement::unspecified ) - , verticalAlignment( VerticalAlignment::unspecified ) - , horizontalAlignmnet( HorizontalAlignment::unspecified ) - { - - } - }; - - - MXAPI_EQUALS_BEGIN( PositionData ) - MXAPI_DOUBLES_EQUALS_MEMBER( defaultX ) - MXAPI_EQUALS_MEMBER( isDefaultXSpecified ) - MXAPI_DOUBLES_EQUALS_MEMBER( defaultY ) - MXAPI_EQUALS_MEMBER( isDefaultYSpecified ) - MXAPI_DOUBLES_EQUALS_MEMBER( relativeX ) - MXAPI_EQUALS_MEMBER( isRelativeXSpecified ) - MXAPI_DOUBLES_EQUALS_MEMBER( relativeY ) - MXAPI_EQUALS_MEMBER( isRelativeYSpecified ) - MXAPI_EQUALS_MEMBER( placement ) - MXAPI_EQUALS_MEMBER( verticalAlignment ) - MXAPI_EQUALS_MEMBER( horizontalAlignmnet ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PositionData ); - } -} diff --git a/Sourcecode/include/mx/api/PrintData.h b/Sourcecode/include/mx/api/PrintData.h deleted file mode 100644 index ef0cb056e..000000000 --- a/Sourcecode/include/mx/api/PrintData.h +++ /dev/null @@ -1,41 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/PositionData.h" -#include "mx/api/FontData.h" -#include "mx/api/ColorData.h" - -namespace mx -{ - namespace api - { - struct PrintData - { - Bool printObject; - FontData fontData; - bool isColorSpecified; - ColorData color; - - PrintData() - : printObject{ Bool::unspecified } - , fontData{} - , isColorSpecified{ false } - , color{} - { - - } - }; - - MXAPI_EQUALS_BEGIN( PrintData ) - MXAPI_EQUALS_MEMBER( printObject ) - MXAPI_EQUALS_MEMBER( fontData ) - MXAPI_EQUALS_MEMBER( isColorSpecified ) - MXAPI_EQUALS_MEMBER( color ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( PrintData ); - } -} diff --git a/Sourcecode/include/mx/api/RehearsalData.h b/Sourcecode/include/mx/api/RehearsalData.h deleted file mode 100644 index 4d21bc563..000000000 --- a/Sourcecode/include/mx/api/RehearsalData.h +++ /dev/null @@ -1,46 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/ColorData.h" -#include "mx/api/PositionData.h" - -namespace mx -{ - namespace api - { - class RehearsalData - { - public: - std::string text; - PositionData positionData; - bool isColorSpecified; - ColorData colorData; - FontData fontData; - - // Additional data about enclosing shape is available - // but not supported at this time. - - RehearsalData() - : text{} - , positionData{} - , isColorSpecified{ false } - , colorData{} - , fontData{} - { - } - }; - - MXAPI_EQUALS_BEGIN( RehearsalData ) - MXAPI_EQUALS_MEMBER( text ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( isColorSpecified ) - MXAPI_EQUALS_MEMBER( colorData ) - MXAPI_EQUALS_MEMBER( fontData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( RehearsalData ); - } -} diff --git a/Sourcecode/include/mx/api/ScoreData.h b/Sourcecode/include/mx/api/ScoreData.h deleted file mode 100644 index 7e824e8e8..000000000 --- a/Sourcecode/include/mx/api/ScoreData.h +++ /dev/null @@ -1,95 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/DefaultsData.h" -#include "mx/api/EncodingData.h" -#include "mx/api/LayoutData.h" -#include "mx/api/PageData.h" -#include "mx/api/PageTextData.h" -#include "mx/api/PartData.h" -#include "mx/api/PartGroupData.h" -#include "mx/api/SystemData.h" - -#include -#include - -namespace mx -{ - namespace api - { - enum class MusicXmlVersion - { - unspecified, - ThreePointZero, - }; - - class ScoreData - { - public: - ScoreData(); - MusicXmlVersion musicXmlVersion; - std::string musicXmlType; - std::string workTitle; - std::string workNumber; - std::string movementTitle; - std::string movementNumber; - std::string composer; - std::string lyricist; - std::string arranger; - std::string publisher; - std::string copyright; - EncodingData encoding; - std::vector pageTextItems; - - /// Specifies the scaling factor (`tenths` and `millimeters`), the default page sizes and margins, and the - /// default system spacing and margins. Corresponds to the `` MusicXML element. (Note this field - /// used to be named `layout` and was renamed to `defaults` in v0.5.0.) - DefaultsData defaults; - std::vector parts; - std::vector partGroups; - int ticksPerQuarter; - - /// Specifies page breaks, system breaks, and changes to system and page layout. Global/default page and - /// system layout settings should be set in `defaults`. MeasureIndex is the index of the measure in which - /// the layout/break is applied. For example, a newPage at MeasureIndex 10 indicates that measure index 10 - /// will be the first measure on a new page. `layout` corresponds to the `` MusicXML element. (Note: - /// prior to v0.5.0 we had `std::set systems`. The `layout` map replaces `systems`.) - std::map layout; - - int getNumMeasures() const; - int getNumStavesPerSystem() const; - - /// sorts all of the events, directions, etc. - /// it is good to call this before writing to xml. - void sort(); - }; - - std::vector::iterator findPart( std::vector& inParts, const std::string& inPartId ); - - MXAPI_EQUALS_BEGIN( ScoreData ) - MXAPI_EQUALS_MEMBER( musicXmlVersion ) - MXAPI_EQUALS_MEMBER( musicXmlType ) - MXAPI_EQUALS_MEMBER( workTitle ) - MXAPI_EQUALS_MEMBER( workNumber ) - MXAPI_EQUALS_MEMBER( movementTitle ) - MXAPI_EQUALS_MEMBER( movementNumber ) - MXAPI_EQUALS_MEMBER( composer ) - MXAPI_EQUALS_MEMBER( lyricist ) - MXAPI_EQUALS_MEMBER( arranger ) - MXAPI_EQUALS_MEMBER( publisher ) - MXAPI_EQUALS_MEMBER( copyright ) - MXAPI_EQUALS_MEMBER( encoding ) - MXAPI_EQUALS_MEMBER( pageTextItems ) - MXAPI_EQUALS_MEMBER( defaults ) - MXAPI_EQUALS_MEMBER( parts ) - MXAPI_EQUALS_MEMBER( partGroups ) - MXAPI_EQUALS_MEMBER( ticksPerQuarter ) - MXAPI_EQUALS_MEMBER( layout ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( ScoreData ); - } -} diff --git a/Sourcecode/include/mx/api/SegnoData.h b/Sourcecode/include/mx/api/SegnoData.h deleted file mode 100644 index 592b01fd4..000000000 --- a/Sourcecode/include/mx/api/SegnoData.h +++ /dev/null @@ -1,37 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/ColorData.h" -#include "mx/api/PositionData.h" - -namespace mx -{ - namespace api - { - class SegnoData - { - public: - PositionData positionData; - bool isColorSpecified; - ColorData colorData; - - SegnoData() - : positionData{} - , isColorSpecified{ false } - , colorData{} - { - } - }; - - MXAPI_EQUALS_BEGIN( SegnoData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( isColorSpecified ) - MXAPI_EQUALS_MEMBER( colorData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SegnoData ); - } -} diff --git a/Sourcecode/include/mx/api/SizeData.h b/Sourcecode/include/mx/api/SizeData.h deleted file mode 100644 index d8d117210..000000000 --- a/Sourcecode/include/mx/api/SizeData.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/AppearanceData.h" -#include "mx/api/PageMarginsData.h" - -#include -#include - -namespace mx -{ - namespace api { - - /// A separate class is used for page size (and other sizes) because both of its members, height and width are - /// required when either is present. i.e. they are inseparable. - class SizeData { - public: - - /// Page height in tenths. - Double height; - - /// Page width in tenths. - Double width; - - inline explicit SizeData( Double inHeight, Double inWidth ) - : height{ inHeight } - , width{ inWidth } - { - - } - - inline SizeData() - : SizeData{ 0.0, 0.0 } - { - - } - }; - - MXAPI_EQUALS_BEGIN( SizeData ) - MXAPI_EQUALS_MEMBER( height ) - MXAPI_EQUALS_MEMBER( width ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SizeData ); - } -} diff --git a/Sourcecode/include/mx/api/SoundID.h b/Sourcecode/include/mx/api/SoundID.h deleted file mode 100644 index cd420abc0..000000000 --- a/Sourcecode/include/mx/api/SoundID.h +++ /dev/null @@ -1,915 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include - -//#include "mx/api/ApiCommon.h" -//#include "mx/api/PositionData.h" -//#include "mx/api/ColorData.h" -//#include "mx/api/FontData.h" - -namespace mx -{ - namespace api - { - enum class SoundID; - - std::string SoundIDToString( SoundID inSoundID ); - SoundID SoundIDFromString( const std::string& inString ); - - enum class SoundID - { - unspecified, - errorBadString, - brassAlphorn, - brassAltoHorn, - brassBaritoneHorn, - brassBugle, - brassBugleAlto, - brassBugleBaritone, - brassBugleContrabass, - brassBugleEuphoniumBugle, - brassBugleMellophoneBugle, - brassBugleSoprano, - brassCimbasso, - brassConchShell, - brassCornet, - brassCornetSoprano, - brassCornett, - brassCornettTenor, - brassCornettino, - brassDidgeridoo, - brassEuphonium, - brassFiscorn, - brassFlugelhorn, - brassFrenchHorn, - brassGroup, - brassGroupSynth, - brassHelicon, - brassHoragai, - brassKuhlohorn, - brassMellophone, - brassNaturalHorn, - brassOphicleide, - brassPosthorn, - brassRagDung, - brassSackbutt, - brassSackbuttAlto, - brassSackbuttBass, - brassSackbuttTenor, - brassSaxhorn, - brassSerpent, - brassShofar, - brassSousaphone, - brassTrombone, - brassTromboneAlto, - brassTromboneBass, - brassTromboneContrabass, - brassTromboneTenor, - brassTrumpet, - brassTrumpetBaroque, - brassTrumpetBass, - brassTrumpetBflat, - brassTrumpetC, - brassTrumpetD, - brassTrumpetPiccolo, - brassTrumpetPocket, - brassTrumpetSlide, - brassTrumpetTenor, - brassTuba, - brassTubaBass, - brassTubaSubcontrabass, - brassViennaHorn, - brassVuvuzela, - brassWagnerTuba, - drumApentemma, - drumAshiko, - drumAtabaque, - drumAtoke, - drumAtsimevu, - drumAxatse, - drumBassDrum, - drumBata, - drumBataItotele, - drumBataIya, - drumBataOkonkolo, - drumBendir, - drumBodhran, - drumBombo, - drumBongo, - drumBougarabou, - drumBuffaloDrum, - drumCajon, - drumChenda, - drumChuDaiko, - drumConga, - drumCuica, - drumDabakan, - drumDaff, - drumDafli, - drumDaibyosi, - drumDamroo, - drumDarabuka, - drumDef, - drumDhol, - drumDholak, - drumDjembe, - drumDoira, - drumDondo, - drumDounDounBa, - drumDuff, - drumDumbek, - drumFontomfrom, - drumFrameDrum, - drumFrameDrumArabian, - drumGeduk, - drumGhatam, - drumGome, - drumGroup, - drumGroupChinese, - drumGroupEwe, - drumGroupIndian, - drumGroupSet, - drumHandDrum, - drumHiraDaiko, - drumIbo, - drumIgihumurizo, - drumInyahura, - drumIshakwe, - drumJangGu, - drumKagan, - drumKakko, - drumKanjira, - drumKendhang, - drumKendhangAgeng, - drumKendhangCiblon, - drumKenkeni, - drumKhol, - drumKickDrum, - drumKidi, - drumKoDaiko, - drumKpanlogo, - drumKudum, - drumLambeg, - drumLionDrum, - drumLogDrum, - drumLogDrumAfrican, - drumLogDrumNative, - drumLogDrumNigerian, - drumMadal, - drumMaddale, - drumMridangam, - drumNaal, - drumNagadoDaiko, - drumNagara, - drumNaqara, - drumODaiko, - drumOkawa, - drumOkedoDaiko, - drumPahuHula, - drumPakhawaj, - drumPandeiro, - drumPandero, - drumPowwow, - drumPueblo, - drumRepinique, - drumRiq, - drumRototom, - drumSabar, - drumSakara, - drumSampho, - drumSangban, - drumShimeDaiko, - drumSlitDrum, - drumSlitDrumKrin, - drumSnareDrum, - drumSnareDrumElectric, - drumSogo, - drumSurdo, - drumTabla, - drumTablaBayan, - drumTablaDayan, - drumTaiko, - drumTalking, - drumTama, - drumTamborita, - drumTambourine, - drumTamte, - drumTangku, - drumTanTan, - drumTaphon, - drumTar, - drumTasha, - drumTenorDrum, - drumTeponaxtli, - drumThavil, - drumTheBox, - drumTimbale, - drumTimpani, - drumTinaja, - drumToere, - drumTombak, - drumTomTom, - drumTomTomSynth, - drumTsuzumi, - drumTumbak, - drumUchiwaDaiko, - drumUdaku, - drumUdu, - drumZarb, - effectAeolianHarp, - effectAirHorn, - effectApplause, - effectBassStringSlap, - effectBird, - effectBirdNightingale, - effectBirdTweet, - effectBreath, - effectBubble, - effectBullroarer, - effectBurst, - effectCar, - effectCarCrash, - effectCarEngine, - effectCarPass, - effectCarStop, - effectCrickets, - effectDog, - effectDoorCreak, - effectDoorSlam, - effectExplosion, - effectFluteKeyClick, - effectFootsteps, - effectFrogs, - effectGuitarCutting, - effectGuitarFret, - effectGunshot, - effectHandClap, - effectHeartbeat, - effectHelicopter, - effectHighQ, - effectHorseGallop, - effectJetPlane, - effectLaserGun, - effectLaugh, - effectLionsRoar, - effectMachineGun, - effectMarchingMachine, - effectMetronomeBell, - effectMetronomeClick, - effectPat, - effectPunch, - effectRain, - effectScratch, - effectScream, - effectSeashore, - effectSiren, - effectSlap, - effectSnap, - effectStamp, - effectStarship, - effectStream, - effectTelephoneRing, - effectThunder, - effectTrain, - effectTrashCan, - effectWhip, - effectWhistle, - effectWhistleMouthSiren, - effectWhistlePolice, - effectWhistleSlide, - effectWhistleTrain, - effectWind, - keyboardAccordion, - keyboardBandoneon, - keyboardCelesta, - keyboardClavichord, - keyboardClavichordSynth, - keyboardConcertina, - keyboardFortepiano, - keyboardHarmonium, - keyboardHarpsichord, - keyboardOndesMartenot, - keyboardOrgan, - keyboardOrganDrawbar, - keyboardOrganPercussive, - keyboardOrganPipe, - keyboardOrganReed, - keyboardOrganRotary, - keyboardPiano, - keyboardPianoElectric, - keyboardPianoGrand, - keyboardPianoHonkyTonk, - keyboardPianoPrepared, - keyboardPianoToy, - keyboardPianoUpright, - keyboardVirginal, - metalAdodo, - metalAnvil, - metalBabendil, - metalBellsAgogo, - metalBellsAlmglocken, - metalBellsBellPlate, - metalBellsBellTree, - metalBellsCarillon, - metalBellsChimes, - metalBellsChimta, - metalBellsChippli, - metalBellsChurch, - metalBellsCowbell, - metalBellsDawuro, - metalBellsGankokwe, - metalBellsGhungroo, - metalBellsHatheli, - metalBellsJingleBell, - metalBellsKhartal, - metalBellsMarkTree, - metalBellsSistrum, - metalBellsSleighBells, - metalBellsTemple, - metalBellsTibetan, - metalBellsTinklebell, - metalBellsTrychel, - metalBellsWindChimes, - metalBellsZills, - metalBerimbau, - metalBrakeDrums, - metalCrotales, - metalCymbalBo, - metalCymbalCengCeng, - metalCymbalChabara, - metalCymbalChinese, - metalCymbalChing, - metalCymbalClash, - metalCymbalCrash, - metalCymbalFinger, - metalCymbalHand, - metalCymbalKesi, - metalCymbalManjeera, - metalCymbalReverse, - metalCymbalRide, - metalCymbalSizzle, - metalCymbalSplash, - metalCymbalSuspended, - metalCymbalTebyoshi, - metalCymbalTibetan, - metalCymbalTingsha, - metalFlexatone, - metalGong, - metalGongAgeng, - metalGongAgung, - metalGongChanchiki, - metalGongChinese, - metalGongGandingan, - metalGongKempul, - metalGongKempyang, - metalGongKetuk, - metalGongKkwenggwari, - metalGongLuo, - metalGongSinging, - metalGongThai, - metalGuira, - metalHang, - metalHiHat, - metalJawHarp, - metalKengong, - metalMurchang, - metalMusicalSaw, - metalSingingBowl, - metalSpoons, - metalSteelDrums, - metalTamtam, - metalThundersheet, - metalTriangle, - metalWashboard, - pitchedPercussionAngklung, - pitchedPercussionBalafon, - pitchedPercussionBellLyre, - pitchedPercussionBells, - pitchedPercussionBianqing, - pitchedPercussionBianzhong, - pitchedPercussionBonang, - pitchedPercussionCimbalom, - pitchedPercussionCrystalGlasses, - pitchedPercussionDanTamThapLuc, - pitchedPercussionFangxiang, - pitchedPercussionGandinganAKayo, - pitchedPercussionGangsa, - pitchedPercussionGender, - pitchedPercussionGiying, - pitchedPercussionGlassHarmonica, - pitchedPercussionGlockenspiel, - pitchedPercussionGlockenspielAlto, - pitchedPercussionGlockenspielSoprano, - pitchedPercussionGyil, - pitchedPercussionHammerDulcimer, - pitchedPercussionHandbells, - pitchedPercussionKalimba, - pitchedPercussionKantil, - pitchedPercussionKhim, - pitchedPercussionKulintang, - pitchedPercussionKulintangAKayo, - pitchedPercussionKulintangATiniok, - pitchedPercussionLikembe, - pitchedPercussionLuntang, - pitchedPercussionMarimba, - pitchedPercussionMarimbaBass, - pitchedPercussionMbira, - pitchedPercussionMbiraArray, - pitchedPercussionMetallophone, - pitchedPercussionMetallophoneAlto, - pitchedPercussionMetallophoneBass, - pitchedPercussionMetallophoneSoprano, - pitchedPercussionMusicBox, - pitchedPercussionPelogPanerus, - pitchedPercussionPemade, - pitchedPercussionPenyacah, - pitchedPercussionRanatEk, - pitchedPercussionRanatEkLek, - pitchedPercussionRanatThum, - pitchedPercussionRanatThumLek, - pitchedPercussionReyong, - pitchedPercussionSanza, - pitchedPercussionSaronBarung, - pitchedPercussionSaronDemong, - pitchedPercussionSaronPanerus, - pitchedPercussionSlendroPanerus, - pitchedPercussionSlentem, - pitchedPercussionTsymbaly, - pitchedPercussionTubes, - pitchedPercussionTubularBells, - pitchedPercussionVibraphone, - pitchedPercussionXylophone, - pitchedPercussionXylophoneAlto, - pitchedPercussionXylophoneBass, - pitchedPercussionXylophoneSoprano, - pitchedPercussionXylorimba, - pitchedPercussionYangqin, - pluckArchlute, - pluckAutoharp, - pluckBaglama, - pluckBajo, - pluckBalalaika, - pluckBalalaikaAlto, - pluckBalalaikaBass, - pluckBalalaikaContrabass, - pluckBalalaikaPiccolo, - pluckBalalaikaPrima, - pluckBalalaikaSecunda, - pluckBandola, - pluckBandura, - pluckBandurria, - pluckBanjo, - pluckBanjoTenor, - pluckBanjolele, - pluckBarbat, - pluckBass, - pluckBassAcoustic, - pluckBassBolon, - pluckBassElectric, - pluckBassFretless, - pluckBassGuitarron, - pluckBassSynth, - pluckBassSynthLead, - pluckBassWashtub, - pluckBassWhamola, - pluckBegena, - pluckBiwa, - pluckBordonua, - pluckBouzouki, - pluckBouzoukiIrish, - pluckCelticHarp, - pluckCharango, - pluckChitarraBattente, - pluckCithara, - pluckCittern, - pluckCuatro, - pluckDanBau, - pluckDanNguyet, - pluckDanTranh, - pluckDanTyBa, - pluckDiddleyBow, - pluckDomra, - pluckDomu, - pluckDulcimer, - pluckDutar, - pluckDuxianqin, - pluckEktara, - pluckGeomungo, - pluckGottuvadhyam, - pluckGuitar, - pluckGuitarAcoustic, - pluckGuitarElectric, - pluckGuitarNylonString, - pluckGuitarPedalSteel, - pluckGuitarPortuguese, - pluckGuitarRequinto, - pluckGuitarResonator, - pluckGuitarSteelString, - pluckGuitjo, - pluckGuitjoDoubleNeck, - pluckGuqin, - pluckGuzheng, - pluckGuzhengChoazhou, - pluckHarp, - pluckHarpGuitar, - pluckHuapanguera, - pluckJaranaHuasteca, - pluckJaranaJarocha, - pluckJaranaJarochaMosquito, - pluckJaranaJarochaPrimera, - pluckJaranaJarochaSegunda, - pluckJaranaJarochaTercera, - pluckKabosy, - pluckKantele, - pluckKanun, - pluckKayagum, - pluckKobza, - pluckKomuz, - pluckKora, - pluckKoto, - pluckKutiyapi, - pluckLangeleik, - pluckLaud, - pluckLute, - pluckLyre, - pluckMandobass, - pluckMandocello, - pluckMandola, - pluckMandolin, - pluckMandolinOctave, - pluckMandora, - pluckMandore, - pluckMarovany, - pluckMusicalBow, - pluckNgoni, - pluckOud, - pluckPipa, - pluckPsaltery, - pluckRuan, - pluckSallaneh, - pluckSanshin, - pluckSantoor, - pluckSanxian, - pluckSarod, - pluckSaung, - pluckSaz, - pluckSe, - pluckSetar, - pluckShamisen, - pluckSitar, - pluckSynth, - pluckSynthCharang, - pluckSynthChiff, - pluckSynthStick, - pluckTambura, - pluckTamburaBulgarian, - pluckTamburaFemale, - pluckTamburaMale, - pluckTar, - pluckTheorbo, - pluckTimple, - pluckTiple, - pluckTres, - pluckUkulele, - pluckUkuleleTenor, - pluckValiha, - pluckVeena, - pluckVeenaMohan, - pluckVeenaRudra, - pluckVeenaVichitra, - pluckVihuela, - pluckVihuelaMexican, - pluckXalam, - pluckYueqin, - pluckZither, - pluckZitherOvertone, - rattleAfoxe, - rattleBirds, - rattleCabasa, - rattleCaxixi, - rattleCog, - rattleGanza, - rattleHosho, - rattleJawbone, - rattleKayamba, - rattleKpokoKpoko, - rattleLavaStones, - rattleMaraca, - rattleRainStick, - rattleRatchet, - rattleRattle, - rattleShaker, - rattleShakerEgg, - rattleShekere, - rattleSistre, - rattleTelevi, - rattleVibraslap, - rattleWasembe, - stringsAjaeng, - stringsArpeggione, - stringsBaryton, - stringsCello, - stringsCelloPiccolo, - stringsContrabass, - stringsCrwth, - stringsDanGao, - stringsDihu, - stringsErhu, - stringsErxian, - stringsEsraj, - stringsFiddle, - stringsFiddleHardanger, - stringsGadulka, - stringsGaohu, - stringsGehu, - stringsGroup, - stringsGroupSynth, - stringsHaegeum, - stringsHurdyGurdy, - stringsIgil, - stringsKamancha, - stringsKokyu, - stringsLaruan, - stringsLeiqin, - stringsLirone, - stringsLyraByzantine, - stringsLyraCretan, - stringsMorinKhuur, - stringsNyckelharpa, - stringsOctobass, - stringsRebab, - stringsRebec, - stringsSarangi, - stringsStrohViolin, - stringsTrombaMarina, - stringsVielle, - stringsViol, - stringsViolAlto, - stringsViolBass, - stringsViolTenor, - stringsViolTreble, - stringsViolViolone, - stringsViola, - stringsViolaDamore, - stringsViolin, - stringsViolonoPiccolo, - stringsViolotta, - stringsYayliTanbur, - stringsYazheng, - stringsZhonghu, - synthEffects, - synthEffectsAtmosphere, - synthEffectsBrightness, - synthEffectsCrystal, - synthEffectsEchoes, - synthEffectsGoblins, - synthEffectsRain, - synthEffectsSciFi, - synthEffectsSoundtrack, - synthGroup, - synthGroupFifths, - synthGroupOrchestra, - synthPad, - synthPadBowed, - synthPadChoir, - synthPadHalo, - synthPadMetallic, - synthPadPolysynth, - synthPadSweep, - synthPadWarm, - synthTheremin, - synthToneSawtooth, - synthToneSine, - synthToneSquare, - voiceAa, - voiceAlto, - voiceAw, - voiceBaritone, - voiceBass, - voiceChild, - voiceCountertenor, - voiceDoo, - voiceEe, - voiceFemale, - voiceKazoo, - voiceMale, - voiceMezzoSoprano, - voiceMm, - voiceOo, - voicePercussion, - voicePercussionBeatbox, - voiceSoprano, - voiceSynth, - voiceTalkBox, - voiceTenor, - voiceVocals, - windFlutesBansuri, - windFlutesBlownBottle, - windFlutesCalliope, - windFlutesDanso, - windFlutesDiZi, - windFlutesDvojnice, - windFlutesFife, - windFlutesFlageolet, - windFlutesFlute, - windFlutesFluteAlto, - windFlutesFluteBass, - windFlutesFluteContraAlto, - windFlutesFluteContrabass, - windFlutesFluteDoubleContrabass, - windFlutesFluteIrish, - windFlutesFlutePiccolo, - windFlutesFluteSubcontrabass, - windFlutesFujara, - windFlutesGemshorn, - windFlutesHocchiku, - windFlutesHun, - windFlutesKaval, - windFlutesKawala, - windFlutesKhlui, - windFlutesKnotweed, - windFlutesKoncovkaAlto, - windFlutesKoudi, - windFlutesNey, - windFlutesNohkan, - windFlutesNose, - windFlutesOcarina, - windFlutesOvertoneTenor, - windFlutesPalendag, - windFlutesPanpipes, - windFlutesQuena, - windFlutesRecorder, - windFlutesRecorderAlto, - windFlutesRecorderBass, - windFlutesRecorderContrabass, - windFlutesRecorderDescant, - windFlutesRecorderGarklein, - windFlutesRecorderGreatBass, - windFlutesRecorderSopranino, - windFlutesRecorderSoprano, - windFlutesRecorderTenor, - windFlutesRyuteki, - windFlutesShakuhachi, - windFlutesShepherdsPipe, - windFlutesShinobue, - windFlutesShvi, - windFlutesSuling, - windFlutesTarka, - windFlutesTumpong, - windFlutesVenu, - windFlutesWhistle, - windFlutesWhistleAlto, - windFlutesWhistleLowIrish, - windFlutesWhistleShiva, - windFlutesWhistleSlide, - windFlutesWhistleTin, - windFlutesWhistleTinBflat, - windFlutesWhistleTinD, - windFlutesXiao, - windFlutesXun, - windGroup, - windJug, - windPipesBagpipes, - windPipesGaida, - windPipesHighland, - windPipesUilleann, - windPungi, - windReedAlbogue, - windReedAlboka, - windReedAlgaita, - windReedArghul, - windReedBassetHorn, - windReedBassoon, - windReedBawu, - windReedBifora, - windReedBombarde, - windReedChalumeau, - windReedClarinet, - windReedClarinetA, - windReedClarinetAlto, - windReedClarinetBass, - windReedClarinetBasset, - windReedClarinetBflat, - windReedClarinetContraAlto, - windReedClarinetContrabass, - windReedClarinetEflat, - windReedClarinetPiccoloAflat, - windReedClarinetteDamour, - windReedContrabass, - windReedContrabassoon, - windReedCornamuse, - windReedCromorne, - windReedCrumhorn, - windReedCrumhornAlto, - windReedCrumhornBass, - windReedCrumhornGreatBass, - windReedCrumhornSoprano, - windReedCrumhornTenor, - windReedDiple, - windReedDiplica, - windReedDuduk, - windReedDulcian, - windReedDulzaina, - windReedEnglishHorn, - windReedGuanzi, - windReedHarmonica, - windReedHarmonicaBass, - windReedHeckelClarina, - windReedHeckelphone, - windReedHeckelphonePiccolo, - windReedHeckelphoneClarinet, - windReedHichiriki, - windReedHirtenschalmei, - windReedHne, - windReedHornpipe, - windReedHouguan, - windReedHulusi, - windReedJogiBaja, - windReedKenBau, - windReedKhaenMouthOrgan, - windReedLauneddas, - windReedMaqrunah, - windReedMelodica, - windReedMijwiz, - windReedMizmar, - windReedNadaswaram, - windReedOboe, - windReedOboeBass, - windReedOboePiccolo, - windReedOboeDaCaccia, - windReedOboeDamore, - windReedOctavin, - windReedPi, - windReedPibgorn, - windReedPiri, - windReedRackett, - windReedRauschpfeife, - windReedRhaita, - windReedRothphone, - windReedSarrusaphone, - windReedSaxonette, - windReedSaxophone, - windReedSaxophoneAlto, - windReedSaxophoneAulochrome, - windReedSaxophoneBaritone, - windReedSaxophoneBass, - windReedSaxophoneContrabass, - windReedSaxophoneMelody, - windReedSaxophoneMezzoSoprano, - windReedSaxophoneSopranino, - windReedSaxophoneSopranissimo, - windReedSaxophoneSoprano, - windReedSaxophoneSubcontrabass, - windReedSaxophoneTenor, - windReedShawm, - windReedShenai, - windReedSheng, - windReedSipsi, - windReedSopila, - windReedSorna, - windReedSralai, - windReedSuona, - windReedSurnai, - windReedTaepyeongso, - windReedTarogato, - windReedTarogatoAncient, - windReedTrompetaChina, - windReedTubax, - windReedXaphoon, - windReedZhaleika, - windReedZurla, - windReedZurna, - woodAgogoBlock, - woodAgungATamlang, - woodAhoko, - woodBones, - woodCastanets, - woodClaves, - woodDrumSticks, - woodGourd, - woodGraniteBlock, - woodGuban, - woodGuiro, - woodHyoushigi, - woodIpu, - woodJamBlock, - woodKaekeeke, - woodKagul, - woodKalaau, - woodKashiklar, - woodKubing, - woodPanClappers, - woodSandBlock, - woodSlapstick, - woodStirDrum, - woodTempleBlock, - woodTicTocBlock, - woodTonetang, - woodWoodBlock, - }; - } -} diff --git a/Sourcecode/include/mx/api/SpannerData.h b/Sourcecode/include/mx/api/SpannerData.h deleted file mode 100644 index 34bd891e2..000000000 --- a/Sourcecode/include/mx/api/SpannerData.h +++ /dev/null @@ -1,68 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/PositionData.h" -#include "mx/api/PrintData.h" -#include "mx/api/LineData.h" - -#include - -namespace mx -{ - namespace api - { - - struct SpannerStart - { - int numberLevel; - int tickTimePosition; - PositionData positionData; - PrintData printData; - LineData lineData; - - SpannerStart() - : numberLevel{ -1 } - , tickTimePosition{ 0 } - , positionData{} - , printData{} - , lineData{} - { - - } - }; - - struct SpannerStop - { - int numberLevel; - int tickTimePosition; - PositionData positionData; - - SpannerStop() - : numberLevel{ -1 } - , tickTimePosition{ 0 } - , positionData{} - { - - } - }; - - MXAPI_EQUALS_BEGIN( SpannerStart ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( printData ) - MXAPI_EQUALS_MEMBER( lineData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SpannerStart ); - - MXAPI_EQUALS_BEGIN( SpannerStop ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( tickTimePosition ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SpannerStop ); - } -} diff --git a/Sourcecode/include/mx/api/StaffData.h b/Sourcecode/include/mx/api/StaffData.h deleted file mode 100644 index e852f4831..000000000 --- a/Sourcecode/include/mx/api/StaffData.h +++ /dev/null @@ -1,67 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ClefData.h" -#include "mx/api/VoiceData.h" -#include "mx/api/DirectionData.h" -#include "mx/api/KeyData.h" - -#include - -namespace mx -{ - namespace api - { - class StaffData - { - public: - std::vector clefs; - - // for the use case where key signatures - // must differ per staff, use this vector. - // otherwise use the keys vector in - // MeasureData to apply a key to all staves - std::vector keys; - std::vector directions; - std::map voices; - }; - - inline bool voicesAreEqual( const std::map& l, const std::map& r ) - { - if( l.size() != r.size() ) - { - return false; - } - auto li = l.cbegin(); - auto ri = r.cbegin(); - auto le = l.cend(); - for( ; li != le; ++li, ++ri ) - { - if( li->first != ri->first ) - { - return false; - } - else if ( li->second != ri->second ) - { - return false; - } - } - return true; - } - - MXAPI_EQUALS_BEGIN( StaffData ) - MXAPI_EQUALS_MEMBER( clefs ) - MXAPI_EQUALS_MEMBER( keys ) - MXAPI_EQUALS_MEMBER( directions ) - if( !( voicesAreEqual( lhs.voices, rhs.voices ) ) ) - { - MX_SHOW_UNEQUAL( "StaffData", "voices" ); - return false; - } - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( StaffData ); - } -} diff --git a/Sourcecode/include/mx/api/SystemData.h b/Sourcecode/include/mx/api/SystemData.h deleted file mode 100644 index c78d08f28..000000000 --- a/Sourcecode/include/mx/api/SystemData.h +++ /dev/null @@ -1,63 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/SystemLayoutData.h" - -namespace mx -{ - namespace api - { - // TODO - the documentation below if from MusicXML XSD and not very helpful for our case, improve documentation. - // A system is a group of staves that are read and played simultaneously. - // System layout includes left and right margins and the vertical distance - // from the previous system. The system distance is measured from the - // bottom line of the previous system to the top line of the current - // system. It is ignored for the first system on a page. The top system - // distance is measured from the page's top margin to the top line of the - // first system. It is ignored for all but the first system on a page. - // - // Sometimes the sum of measure widths in a system may not equal the system - // width specified by the layout elements due to roundoff or other errors. - // The behavior when reading MusicXML files in these cases is application- - // dependent. For instance, applications may find that the system layout - // data is more reliable than the sum of the measure widths, and adjust the - // measure widths accordingly. - class SystemData - { - public: - /// Should this measure be at the start of a new system, i.e. - Bool newSystem; - - /// System layout. Note, all members of SystemLayoutData are optional. - SystemLayoutData layout; - - /// Returns true if any of the members of SystemData have values. - inline bool isUsed() const { return newSystem != Bool::unspecified || layout.isUsed(); } - - /// Explicit constructor. - inline explicit SystemData( Bool inSystemBreak, SystemLayoutData inLayout = SystemLayoutData{} ) - : newSystem{ inSystemBreak } - , layout{ std::move( inLayout ) } - { - - } - - /// Default constructor. - SystemData() - : SystemData{ Bool::unspecified } - { - - } - }; - - MXAPI_EQUALS_BEGIN( SystemData ) - MXAPI_EQUALS_MEMBER( newSystem ) - MXAPI_EQUALS_MEMBER( layout ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SystemData ); - } -} diff --git a/Sourcecode/include/mx/api/SystemLayoutData.h b/Sourcecode/include/mx/api/SystemLayoutData.h deleted file mode 100644 index 9529b28d7..000000000 --- a/Sourcecode/include/mx/api/SystemLayoutData.h +++ /dev/null @@ -1,62 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/AppearanceData.h" -#include "mx/api/LeftRight.h" -#include "mx/api/PageLayoutData.h" - -#include -#include - -namespace mx -{ - namespace api - { - /// Margins and spacing for staff systems. - class SystemLayoutData - { - public: - - /// The left and right margins for the system, in tenths. - std::optional margins; - - /// Distance from bottom line of one system to top line of next system, in tenths. - OptionalDouble systemDistance; - - /// Distance from the top margin of the page to the top line of the first staff on the page, in tenths. - OptionalDouble topSystemDistance; - - /// the space between staves within the same system, in tenths. - OptionalDouble staffDistance; - - /// Returns true if any of the members have values. - inline bool isUsed() const { return margins || systemDistance || topSystemDistance || staffDistance; } - - explicit inline SystemLayoutData( - std::optional inMargins = std::nullopt, - OptionalDouble inSystemDistance = std::nullopt, - OptionalDouble inTopSystemDistance = std::nullopt, - OptionalDouble inStaffDistance = std::nullopt - ) - : margins( inMargins ) - , systemDistance( inSystemDistance ) - , topSystemDistance{ inTopSystemDistance } - , staffDistance( inStaffDistance ) - { - - } - }; - - MXAPI_EQUALS_BEGIN( SystemLayoutData ) - MXAPI_EQUALS_MEMBER( margins ) - MXAPI_EQUALS_MEMBER( systemDistance ) - MXAPI_EQUALS_MEMBER( topSystemDistance ) - MXAPI_EQUALS_MEMBER( staffDistance ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( SystemLayoutData ); - } -} diff --git a/Sourcecode/include/mx/api/TempoData.h b/Sourcecode/include/mx/api/TempoData.h deleted file mode 100644 index 5349baa20..000000000 --- a/Sourcecode/include/mx/api/TempoData.h +++ /dev/null @@ -1,115 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once -#include "mx/api/PrintData.h" -#include "mx/api/PositionData.h" -#include "mx/api/DurationData.h" - -namespace mx -{ - namespace api - { - enum class TempoType - { - unspecified, - beatsPerMinute, - metricModulation, - tempoText - }; - - struct BeatsPerMinute - { - DurationName durationName; - int dots; - int beatsPerMinute; - - BeatsPerMinute() - : durationName{ DurationName::unspecified } - , dots{ -1 } - , beatsPerMinute{ -1 } - { - - } - }; - - struct MetricModulation - { - DurationName leftDurationName; - int leftDots; - DurationName rightDurationName; - int rightDots; - BeatsPerMinute playbackBeatsPerMinute; - - MetricModulation() - : leftDurationName{ DurationName::unspecified } - , leftDots{ -1 } - , rightDurationName{ DurationName::unspecified } - , rightDots{ -1 } - , playbackBeatsPerMinute{} - { - - } - }; - - struct TempoText - { - std::string tempoText; - BeatsPerMinute playbackBeatsPerMinute; - }; - - class TempoData - { - public: - int tickTime; - Bool isParenthetical; - PrintData printData; - PositionData positionData; - TempoType tempoType; - - // only used when tempoType is 'beatsPerMinute' - BeatsPerMinute beatsPerMinute; - - // only used when tempoType is 'metricModulation' - MetricModulation metricModulation; - - // only used when tempoType is 'tempoText' - TempoText tempoText; - }; - - MXAPI_EQUALS_BEGIN( BeatsPerMinute ) - MXAPI_EQUALS_MEMBER( durationName ) - MXAPI_EQUALS_MEMBER( dots ) - MXAPI_EQUALS_MEMBER( beatsPerMinute ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( BeatsPerMinute ); - - MXAPI_EQUALS_BEGIN( MetricModulation ) - MXAPI_EQUALS_MEMBER( leftDurationName ) - MXAPI_EQUALS_MEMBER( leftDots ) - MXAPI_EQUALS_MEMBER( rightDurationName ) - MXAPI_EQUALS_MEMBER( rightDots ) - MXAPI_EQUALS_MEMBER( playbackBeatsPerMinute ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( MetricModulation ); - - MXAPI_EQUALS_BEGIN( TempoText ) - MXAPI_EQUALS_MEMBER( tempoText ) - MXAPI_EQUALS_MEMBER( playbackBeatsPerMinute ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( TempoText ); - - MXAPI_EQUALS_BEGIN( TempoData ) - MXAPI_EQUALS_MEMBER( tickTime ) - MXAPI_EQUALS_MEMBER( isParenthetical ) - MXAPI_EQUALS_MEMBER( printData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( tempoType ) - MXAPI_EQUALS_MEMBER( beatsPerMinute ) - MXAPI_EQUALS_MEMBER( metricModulation ) - MXAPI_EQUALS_MEMBER( tempoText ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( TempoData ); - } -} diff --git a/Sourcecode/include/mx/api/TimeSignatureData.h b/Sourcecode/include/mx/api/TimeSignatureData.h deleted file mode 100644 index 90a9c2280..000000000 --- a/Sourcecode/include/mx/api/TimeSignatureData.h +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" - -#include - -namespace mx -{ - namespace api - { - enum class TimeSignatureSymbol - { - unspecified, - common, - cut - }; - - class TimeSignatureData - { - public: - - // common, cut - TimeSignatureSymbol symbol; - - // the top number of the time signature, e.g. '5' in a '5/4' signature - int beats; - - // the bottom number of the time signature, e.g. '4' in a '5/4' signature - int beatType; - - // a time signature is implicit when it is not specified by the musicxml - bool isImplicit; - - // use this to hide a time sigature with Bool::no. If a time signature is - // implicit, the 'display' field will be ignored - Bool display; - - inline bool isEqualTo( const TimeSignatureData& other ) const - { - return ( beats == other.beats ) - && ( beatType == other.beatType ) - && ( symbol == other.symbol ); - } - - TimeSignatureData() - : symbol{ TimeSignatureSymbol::unspecified } - , beats{ 4 } - , beatType{ 4 } - , isImplicit{ true } - , display{ Bool::unspecified } - { - - } - }; - - MXAPI_EQUALS_BEGIN( TimeSignatureData ) - MXAPI_EQUALS_MEMBER( symbol ) - MXAPI_EQUALS_MEMBER( beats ) - MXAPI_EQUALS_MEMBER( beatType ) - MXAPI_EQUALS_MEMBER( isImplicit ) - MXAPI_EQUALS_MEMBER( display ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( TimeSignatureData ); - } -} diff --git a/Sourcecode/include/mx/api/TransposeData.h b/Sourcecode/include/mx/api/TransposeData.h deleted file mode 100644 index d1a7aa7ca..000000000 --- a/Sourcecode/include/mx/api/TransposeData.h +++ /dev/null @@ -1,82 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" - -namespace mx -{ - namespace api - { - /// TransposeData is used to instruments for whom the music has been transposed. The - /// transposition is specified by naming the directional diatonic interval between the - /// written pitch and the sounding pitch. For example when C4 is written for Bb Clarinet, - /// the sounding pitch is Bb3 which is a major second lower. The transposition for Bb - /// Clarinet is thus 'down a major second'. There may be cases where such a transposition - /// would produce a painful key signature, and engravers may choose to notate the Bb - /// Clarinet in A# instead. In that case the interval is 'down a diminished third'. - /// - /// In order to distinguish between intervals that are enharmonically equivalent (having - /// the same number of semitones), two values are needed. TransposeData encodes the - /// diatonic interval by providing the number of chromatic steps and the number of diatonic - /// steps where the number of 'diatonic' steps is the number of steps via letter names (or - /// piano white notes). - /// - /// Some examples may help. Clarinet in Bb transposes down a major second, which is two - /// semitones, so `chromatic = -2`. In order to distinguish this from, say A#, or Cbb, we - /// need additional information, so we specify `diatonic = -1`. That is, we want the letter - /// to be B, and B is one letter lower than C. - /// - /// Here is a table of some common transpositions and their TransposeData equivalents. - /// |---------------------|--------------------|----------|---------| - /// | Name | Interval | Chromatic| Diatonic| - /// |---------------------|--------------------|----------|---------| - /// | Glockenspiel | Up two Octaves | 24 | 14 | - /// | Piccolo | Up an Octave | 12 | 7 | - /// | Clarient in Bb | Down a Major Second| -2 | -1 | - /// | French Horn in F | Down a Fifth | -7 | -4 | - /// | Alto Saxophone in Eb| Down a Major Sixth | -9 | -5 | - /// | Bass Clarinet in Bb | Down a Major Ninth | -14 | -8 | - /// |---------------------|--------------------|----------|---------| - /// - /// Note that MusicXML encodes this slightly differently. In MusicXML required (but not - /// enforced) that chromatic should be >= -11 and <= 11, and that diatonic should be - /// <= -6 and >= 6. An additional `` element is used for intervals beyond - /// that range. Additionally, the `` element is optional in MusicXML, but is - /// required in TransposeData. - class TransposeData - { - public: - TransposeData() - : TransposeData{ 0, 0 } - { - - } - - TransposeData( int inChromatic, int inHarmonic ) - : chromatic{ inChromatic } - , diatonic{ inHarmonic } - { - - } - - /// The number of semitones in the interval. - int chromatic; - - /// The number of diatonic steps in the interval - int diatonic; - - /// If both chromatic and diatonic are zero, then TransposeData is unused (i.e. it need - /// not be encoded in the MusicXML output). - inline bool isUsed() const { return chromatic != 0 || diatonic != 0; } - }; - - MXAPI_EQUALS_BEGIN( TransposeData ) - MXAPI_EQUALS_MEMBER( chromatic ) - MXAPI_EQUALS_MEMBER( diatonic ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( TransposeData ); - } -} diff --git a/Sourcecode/include/mx/api/TupletData.h b/Sourcecode/include/mx/api/TupletData.h deleted file mode 100644 index b902d3664..000000000 --- a/Sourcecode/include/mx/api/TupletData.h +++ /dev/null @@ -1,105 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/PositionData.h" -#include "mx/api/LineData.h" -#include "mx/api/DurationData.h" - -namespace mx -{ - namespace api - { - // in the tuplet ratio, for example 2:3 for - // triplets, the 'actual' part of the ratio - // is the '2' and the 'normal' part of the - // ratio is the '3' - - class TupletStart - { - public: - - // used to id when nested - // -1 means unspecified - int numberLevel; - - PositionData positionData; - - int actualNumber; - DurationName actualDurationName; - int actualDots; - - int normalNumber; - DurationName normalDurationName; - int normalDots; - - // show the number of notes in the tuplet - // description ratio, for example 3 for triplets - Bool showActualNumber; - - // show the number of 'normal' notes in the - // tuplet ratio, for example the 2 in 3:2 for - // a triplet or the 4 in 5:4 for quintuplet - Bool showNormalNumber; - - Bool bracket; - - TupletStart() - : numberLevel{ -1 } - , positionData{} - , actualNumber{ -1 } - , actualDurationName{ api::DurationName::unspecified } - , actualDots{ -1 } - , normalNumber{ -1 } - , normalDurationName{ api::DurationName::unspecified } - , normalDots{ -1 } - , showActualNumber{ Bool::unspecified } - , showNormalNumber{ Bool::unspecified } - , bracket{ Bool::unspecified } - { - - } - }; - - class TupletStop - { - public: - // used to id when nested - // -1 means unspecified - int numberLevel; - - PositionData positionData; - - TupletStop() - : numberLevel{ -1 } - , positionData{} - { - - } - }; - - MXAPI_EQUALS_BEGIN( TupletStart ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( actualNumber ) - MXAPI_EQUALS_MEMBER( actualDurationName ) - MXAPI_EQUALS_MEMBER( actualDots ) - MXAPI_EQUALS_MEMBER( normalNumber ) - MXAPI_EQUALS_MEMBER( normalDurationName ) - MXAPI_EQUALS_MEMBER( normalDots ) - MXAPI_EQUALS_MEMBER( showActualNumber ) - MXAPI_EQUALS_MEMBER( showNormalNumber ) - MXAPI_EQUALS_MEMBER( bracket ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( TupletStart ); - - MXAPI_EQUALS_BEGIN( TupletStop ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( TupletStop ); - } -} diff --git a/Sourcecode/include/mx/api/Version.h b/Sourcecode/include/mx/api/Version.h deleted file mode 100644 index e499362fd..000000000 --- a/Sourcecode/include/mx/api/Version.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include - -namespace mx -{ - namespace api - { - /// @brief TODO - /// - /// @detailed TODO - /// - class Version - { - public: - static int getVersionMajor(); - static int getVersionMinor(); - static int getVersionPatch(); - static const std::string& getString(); - - private: - int myMajor; - int myMinor; - int myPatch; - int myBuild; - std::string myString; - - private: - Version(); - static const Version& getInstance(); - }; - } -} diff --git a/Sourcecode/include/mx/api/VoiceData.h b/Sourcecode/include/mx/api/VoiceData.h deleted file mode 100644 index fc281958f..000000000 --- a/Sourcecode/include/mx/api/VoiceData.h +++ /dev/null @@ -1,29 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/NoteData.h" - -#include -#include - -namespace mx -{ - namespace api - { - class VoiceData - { - public: - std::vector notes; - }; - - - inline bool operator==( const VoiceData& lhs, const VoiceData& rhs ) - { - return areVectorsEqual( lhs.notes, rhs.notes ); - } - MXAPI_NOT_EQUALS_AND_VECTORS( VoiceData ); - } -} diff --git a/Sourcecode/include/mx/api/WedgeData.h b/Sourcecode/include/mx/api/WedgeData.h deleted file mode 100644 index 198042e29..000000000 --- a/Sourcecode/include/mx/api/WedgeData.h +++ /dev/null @@ -1,82 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/LineData.h" -#include "mx/api/PositionData.h" -#include "mx/api/ColorData.h" - -namespace mx -{ - namespace api - { - enum class WedgeType - { - unspecified, - crescendo, - diminuendo - }; - - struct WedgeStart - { - int numberLevel; - WedgeType wedgeType; - bool isSpreadSpecified; - long double spread; - LineData lineData; - PositionData positionData; - ColorData colorData; - - WedgeStart() - : numberLevel{ -1 } - , wedgeType{ WedgeType::unspecified } - , isSpreadSpecified{ false } - , spread{ 0.0 } - , lineData{} - , positionData{} - , colorData{} - { - - } - }; - - struct WedgeStop - { - int numberLevel; - PositionData positionData; - bool isSpreadSpecified; - long double spread; - - WedgeStop() - : numberLevel{ -1 } - , positionData{} - , isSpreadSpecified{ false } - , spread{ 0.0 } - { - - } - }; - - MXAPI_EQUALS_BEGIN( WedgeStart ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( wedgeType ) - MXAPI_EQUALS_MEMBER( isSpreadSpecified ) - MXAPI_EQUALS_MEMBER( spread ) - MXAPI_EQUALS_MEMBER( lineData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( colorData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( WedgeStart ); - - MXAPI_EQUALS_BEGIN( WedgeStop ) - MXAPI_EQUALS_MEMBER( numberLevel ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( isSpreadSpecified ) - MXAPI_EQUALS_MEMBER( spread ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( WedgeStop ); - } -} diff --git a/Sourcecode/include/mx/api/WordsData.h b/Sourcecode/include/mx/api/WordsData.h deleted file mode 100644 index 33362d491..000000000 --- a/Sourcecode/include/mx/api/WordsData.h +++ /dev/null @@ -1,44 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/api/ApiCommon.h" -#include "mx/api/PositionData.h" -#include "mx/api/ColorData.h" -#include "mx/api/FontData.h" - -namespace mx -{ - namespace api - { - class WordsData - { - public: - std::string text; - PositionData positionData; - FontData fontData; - bool isColorSpecified; - ColorData colorData; - - WordsData() - : text{} - , positionData{} - , fontData{} - , isColorSpecified{ false } - , colorData{} - { - - } - }; - - MXAPI_EQUALS_BEGIN( WordsData ) - MXAPI_EQUALS_MEMBER( positionData ) - MXAPI_EQUALS_MEMBER( fontData ) - MXAPI_EQUALS_MEMBER( isColorSpecified ) - MXAPI_EQUALS_MEMBER( colorData ) - MXAPI_EQUALS_END; - MXAPI_NOT_EQUALS_AND_VECTORS( WordsData ); - } -} diff --git a/Sourcecode/private/mx/api/ChordData.cpp b/Sourcecode/private/mx/api/ChordData.cpp deleted file mode 100644 index ad8531f96..000000000 --- a/Sourcecode/private/mx/api/ChordData.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/api/ChordData.h" - -namespace mx -{ - namespace api - { - -//////////////////////////////////////////////////////////////////////////////// -// CTOR AND COPY /////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - - Extension::Extension() - : extensionType{ ExtensionType::add } - , extensionAlter{ ExtensionAlter::none } - , extensionNumber{ ExtensionNumber::first } - , printObject{ Bool::unspecified } - { - - } - - - ChordData::ChordData() - : root{ Step::c } - , rootAlter{ 0 } - , chordKind{ ChordKind::unspecified } - , text{} - , useSymbols{ Bool::unspecified } - , bass{ Step::unspecified } - , bassAlter{ 0 } - , extensions{} - , miscData{} - , positionData{} - { - - } - -//////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS //////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////////////////// -// PRIVATE FUNCTIONS /////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - - } -} diff --git a/Sourcecode/private/mx/api/ClefData.cpp b/Sourcecode/private/mx/api/ClefData.cpp deleted file mode 100644 index 440bad23c..000000000 --- a/Sourcecode/private/mx/api/ClefData.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/api/ClefData.h" -#include - -namespace mx -{ - namespace api - { - ClefData::ClefData() - : symbol{ DEFAULT_CLEF_SYMBOL } - , line{ DEFAULT_CLEF_LINE } - , octaveChange{ DEFAULT_CLEF_OCTAVE_CHANGE } - , tickTimePosition{ 0 } - , location{ ClefLocation::unspecified } - { - - } - - - std::string ClefData::toString() const - { - std::stringstream ss; - ss << "Symbol "; - switch(symbol) - { - case ClefSymbol::g: ss << "G"; break; - case ClefSymbol::f: ss << "F"; break; - case ClefSymbol::c: ss << "C"; break; - case ClefSymbol::percussion: ss << "Percussion"; break; - case ClefSymbol::tab: ss << "Tab"; break; - case ClefSymbol::jianpu: ss << "Jianpu"; break; - case ClefSymbol::none: ss << "None"; break; - default: ss << "Unknown"; break; - } - ss << ", Line " << line; - ss << ", OctaveChange " << octaveChange; - return ss.str(); - } - - - void ClefData::setTreble() - { - symbol = ClefSymbol::g; - line = 2; - octaveChange = 0; - } - - - void ClefData::setBass() - { - symbol = ClefSymbol::f; - line = 4; - octaveChange = 0; - } - - - void ClefData::setAlto() - { - symbol = ClefSymbol::c; - line = 3; - octaveChange = 0; - } - - - void ClefData::setTenor() - { - symbol = ClefSymbol::c; - line = 4; - octaveChange = 0; - } - - - void ClefData::setBaritone() - { - symbol = ClefSymbol::c; - line = 5; - octaveChange = 0; - } - - - void ClefData::setSoprano() - { - symbol = ClefSymbol::c; - line = 0; - octaveChange = 0; - } - - - void ClefData::setMezzoSoprano() - { - symbol = ClefSymbol::c; - line = 1; - octaveChange = 0; - } - - - bool ClefData::isTreble() const - { - return ( symbol == ClefSymbol::g ) && ( line == 2 ) && ( octaveChange == 0 ); - } - - - bool ClefData::isBass() const - { - return ( symbol == ClefSymbol::f ) && ( line == 4 ) && ( octaveChange == 0 ); - } - - - bool ClefData::isAlto() const - { - return ( symbol == ClefSymbol::c ) && ( line == 3 ) && ( octaveChange == 0 ); - } - - - bool ClefData::isTenor() const - { - return ( symbol == ClefSymbol::c ) && ( line == 4 ) && ( octaveChange == 0 ); - } - - - bool ClefData::isBaritone() const - { - return ( symbol == ClefSymbol::c ) && ( line == 5 ) && ( octaveChange == 0 ); - } - - - bool ClefData::isSoprano() const - { - return ( symbol == ClefSymbol::c ) && ( line == 0 ) && ( octaveChange == 0 ); - } - - - bool ClefData::isMezzoSoprano() const - { - return ( symbol == ClefSymbol::c ) && ( line == 1 ) && ( octaveChange == 0 ); - } - } -} diff --git a/Sourcecode/private/mx/api/DocumentManager.cpp b/Sourcecode/private/mx/api/DocumentManager.cpp deleted file mode 100644 index a206ce09f..000000000 --- a/Sourcecode/private/mx/api/DocumentManager.cpp +++ /dev/null @@ -1,247 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/api/DocumentManager.h" -#include "mx/impl/ScoreReader.h" -#include "mx/impl/ScoreWriter.h" -#include "mx/core/Document.h" -#include "ezxml/XFactory.h" -#include "mx/utility/Throw.h" - -#define LOCK_DOCUMENT_MANAGER std::lock_guard lock(myImpl->myMutex); - -namespace mx -{ - namespace api - { - using DocumentMap = std::map; - class DocumentManager::Impl - { - public: - std::mutex myMutex; - int myCurrentId; - DocumentMap myMap; - int myCurrentUniqueId; - - Impl() - : myMutex{} - , myCurrentId{0} - , myMap{} - , myCurrentUniqueId{1000000} - { - - } - }; - - DocumentManager::DocumentManager() - : myImpl{ new DocumentManager::Impl() } - { - myImpl->myCurrentId = 1; - } - - - DocumentManager::~DocumentManager() - { - - } - - - DocumentManager& DocumentManager::getInstance() - { - static DocumentManager instance; - return instance; - } - - - int DocumentManager::createFromFile( const std::string& filePath ) - { - auto xdoc = ::ezxml::XFactory::makeXDoc(); - - try - { - xdoc->loadFile( filePath ); - } - catch ( std::exception& e ) - { - const std::string originalMessage = e.what(); - - const auto fileExtension = []( const std::string& filePath ) - { - const auto dotPos = filePath.find_last_of( '.' ); - if( dotPos == std::string::npos || dotPos == filePath.size() - 1 ) - { - return std::string{ "" }; - } - - return filePath.substr( dotPos + 1 ); - }; - - if ( ( originalMessage.find( "status_no_document_element" ) != std::string::npos) && - fileExtension( filePath ) == "mxl" ) - { - std::stringstream ss; - ss << "it looks like you are trying to parse a compressed musicxml file, which is currently " - << "unsupported. https://github.com/webern/mx/issues/66 (" - << originalMessage << ")"; - MX_THROW( ss.str() ); - } - - throw e; - } - - auto mxdoc = mx::core::makeDocument(); - std::stringstream messages; - auto isSuccess = mxdoc->fromXDoc( messages, *xdoc ); - - if( !isSuccess ) - { - MX_THROW( messages.str() ); - } - - LOCK_DOCUMENT_MANAGER - myImpl->myMap[myImpl->myCurrentId] = std::move( mxdoc ); - return myImpl->myCurrentId++; - } - - - int DocumentManager::createFromStream( std::istream& stream ) - { - auto xdoc = ::ezxml::XFactory::makeXDoc(); - xdoc->loadStream( stream ); - auto mxdoc = mx::core::makeDocument(); - - std::stringstream messages; - auto isSuccess = mxdoc->fromXDoc( messages, *xdoc ); - - if( !isSuccess ) - { - MX_THROW( messages.str() ); - } - - LOCK_DOCUMENT_MANAGER - myImpl->myMap[myImpl->myCurrentId] = std::move( mxdoc ); - return myImpl->myCurrentId++; - } - - - int DocumentManager::createFromScore( const ScoreData& score ) - { - impl::ScoreWriter writer{ score }; - auto scorePartwise = writer.getScorePartwise(); - auto mxdoc = core::makeDocument(); - mxdoc->setChoice( core::DocumentChoice::partwise ); - mxdoc->setScorePartwise( scorePartwise ); - - if( score.musicXmlType == "timewise" ) - { - mxdoc->convertContents(); - } - - LOCK_DOCUMENT_MANAGER - myImpl->myMap[myImpl->myCurrentId] = std::move( mxdoc ); - return myImpl->myCurrentId++; - } - - - void DocumentManager::writeToFile( int documentId, const std::string& filePath ) const - { - LOCK_DOCUMENT_MANAGER - - const DocumentMap::const_iterator it = myImpl->myMap.find( documentId ); - - if( it == myImpl->myMap.cend() ) - { - return; - } - - auto xdoc = ::ezxml::XFactory::makeXDoc(); - it->second->toXDoc( *xdoc ); - xdoc->saveFile( filePath ); - } - - - void DocumentManager::writeToStream( int documentId, std::ostream& stream ) const - { - LOCK_DOCUMENT_MANAGER - - const DocumentMap::const_iterator it = myImpl->myMap.find( documentId ); - - if( it == myImpl->myMap.cend() ) - { - return; - } - - auto xdoc = ::ezxml::XFactory::makeXDoc(); - it->second->toXDoc( *xdoc ); - xdoc->saveStream( stream ); - } - - - ScoreData DocumentManager::getData( int documentId ) const - { - LOCK_DOCUMENT_MANAGER - - const DocumentMap::const_iterator it = myImpl->myMap.find( documentId ); - - if( it == myImpl->myMap.cend() ) - { - return ScoreData{}; - } - - bool wasTimewise = false; - - if( it->second->getChoice() == core::DocumentChoice::timewise ) - { - wasTimewise = true; - it->second->convertContents(); - } - - impl::ScoreReader reader{ *it->second->getScorePartwise() }; - auto score = reader.getScoreData(); - - if( wasTimewise ) - { - score.musicXmlType = "timewise"; - it->second->convertContents(); - } - return score; - } - - - void DocumentManager::destroyDocument( int documentId ) - { - LOCK_DOCUMENT_MANAGER - const DocumentMap::const_iterator it = myImpl->myMap.find( documentId ); - - if( it == myImpl->myMap.cend() ) - { - return; - } - - myImpl->myMap.erase( it ); - } - - - mx::core::DocumentPtr DocumentManager::getDocument( int documentId ) const - { - LOCK_DOCUMENT_MANAGER - const DocumentMap::const_iterator it = myImpl->myMap.find( documentId ); - - if( it == myImpl->myMap.cend() ) - { - return mx::core::DocumentPtr{}; - } - - return it->second; - } - - int DocumentManager::getUniqueId() - { - LOCK_DOCUMENT_MANAGER - int returnValue = myImpl->myCurrentUniqueId; - ++myImpl->myCurrentUniqueId; - return returnValue; - } - } -} diff --git a/Sourcecode/private/mx/api/DurationData.cpp b/Sourcecode/private/mx/api/DurationData.cpp deleted file mode 100644 index 13d67667e..000000000 --- a/Sourcecode/private/mx/api/DurationData.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/api/DurationData.h" - -namespace mx -{ - namespace api - { - DurationData::DurationData() - : durationName{ DurationName::unspecified } - , durationDots{ 0 } - , durationTimeTicks{ 1 } - , isTied{ false } - , timeModificationActualNotes{ 1 } - , timeModificationNormalNotes{ 1 } - , timeModificationNormalType{ api::DurationName::unspecified } - , timeModificationNormalTypeDots{ 0 } - { - - } - } -} diff --git a/Sourcecode/private/mx/api/EncodingData.cpp b/Sourcecode/private/mx/api/EncodingData.cpp deleted file mode 100644 index 72e480dff..000000000 --- a/Sourcecode/private/mx/api/EncodingData.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/api/EncodingData.h" -#include "mx/core/Date.h" - -namespace mx -{ - namespace api - { - -//////////////////////////////////////////////////////////////////////////////// -// CTOR AND COPY /////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - - EncodingDate EncodingDate::today() - { - const auto d = mx::core::Date::today(); - mx::api::EncodingDate result{}; - result.year = d.getYear(); - result.month = d.getMonth(); - result.day = d.getDay(); - return result; - } - -//////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS //////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - - -//////////////////////////////////////////////////////////////////////////////// -// PRIVATE FUNCTIONS /////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - - } -} diff --git a/Sourcecode/private/mx/api/MarkData.cpp b/Sourcecode/private/mx/api/MarkData.cpp deleted file mode 100644 index 892015e49..000000000 --- a/Sourcecode/private/mx/api/MarkData.cpp +++ /dev/null @@ -1,269 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/api/MarkData.h" -#include "mx/impl/Converter.h" -#include "mx/core/Enums.h" - -namespace mx -{ - namespace api - { - bool isMarkDynamic( MarkType markType ) - { - return ( markType == MarkType::p ) || - ( markType == MarkType::p ) || - ( markType == MarkType::pp ) || - ( markType == MarkType::ppp ) || - ( markType == MarkType::pppp ) || - ( markType == MarkType::ppppp ) || - ( markType == MarkType::pppppp ) || - ( markType == MarkType::f ) || - ( markType == MarkType::ff ) || - ( markType == MarkType::fff ) || - ( markType == MarkType::ffff ) || - ( markType == MarkType::fffff ) || - ( markType == MarkType::ffffff ) || - ( markType == MarkType::mp ) || - ( markType == MarkType::mf ) || - ( markType == MarkType::sf ) || - ( markType == MarkType::sfp ) || - ( markType == MarkType::sfpp ) || - ( markType == MarkType::fp ) || - ( markType == MarkType::rf ) || - ( markType == MarkType::rfz ) || - ( markType == MarkType::sfz ) || - ( markType == MarkType::sffz ) || - ( markType == MarkType::fz ) || - ( markType == MarkType::otherDynamics ); - } - - bool isMarkArpeggiate( MarkType markType ) - { - return ( markType == MarkType::arpeggiate ) || - ( markType == MarkType::arpeggiateDown ) || - ( markType == MarkType::arpeggiateUp ); - } - - bool isMarkArticulation( MarkType markType ) - { - return ( markType == MarkType::accent ) || - ( markType == MarkType::strongAccent ) || - ( markType == MarkType::staccato ) || - ( markType == MarkType::tenuto ) || - ( markType == MarkType::detachedLegato ) || - ( markType == MarkType::staccatissimo ) || - ( markType == MarkType::spiccato ) || - ( markType == MarkType::scoop ) || - ( markType == MarkType::plop ) || - ( markType == MarkType::doit ) || - ( markType == MarkType::falloff ) || - ( markType == MarkType::breathMark ) || - ( markType == MarkType::caesura ) || - ( markType == MarkType::stress ) || - ( markType == MarkType::unstress ) || - ( markType == MarkType::otherArticulation ); - } - - - bool isMarkOrnament( MarkType markType ) - { - return ( markType == MarkType::trillMark ) || - ( markType == MarkType::turn ) || - ( markType == MarkType::delayedTurn ) || - ( markType == MarkType::invertedTurn ) || - ( markType == MarkType::delayedInvertedTurn ) || - ( markType == MarkType::verticalTurn ) || - ( markType == MarkType::shake ) || - ( markType == MarkType::wavyLine ) || - ( markType == MarkType::mordent ) || - ( markType == MarkType::invertedMordent ) || - ( markType == MarkType::schleifer ) || - ( markType == MarkType::tremoloSingleOne ) || - ( markType == MarkType::tremoloSingleTwo ) || - ( markType == MarkType::tremoloSingleThree ) || - ( markType == MarkType::tremoloSingleFour ) || - ( markType == MarkType::tremoloSingleFive ) || - ( markType == MarkType::otherOrnament ) || - ( markType == MarkType::unknownOrnament ); - } - - - bool isMarkFermata( MarkType markType ) - { - return ( markType == MarkType::fermata ) || - ( markType == MarkType::fermataNormal ) || - ( markType == MarkType::fermataAngled ) || - ( markType == MarkType::fermataSquare ) || - ( markType == MarkType::fermataUpright ) || - ( markType == MarkType::fermataNormalUpright ) || - ( markType == MarkType::fermataAngledUpright ) || - ( markType == MarkType::fermataSquareUpright ) || - ( markType == MarkType::fermataInverted ) || - ( markType == MarkType::fermataNormalInverted ) || - ( markType == MarkType::fermataAngledInverted ) || - ( markType == MarkType::fermataSquareInverted ); - } - - - bool isMarkNonArpeggiate( MarkType markType ) - { - return ( markType == MarkType::nonArpeggiate ); - } - - - bool isMarkPedal( MarkType markType ) - { - return ( markType == MarkType::pedal ) || - ( markType == MarkType::damp ); - } - - - bool isMarkTechnical( MarkType markType ) - { - return ( markType == MarkType::upBow ) || - ( markType == MarkType::downBow ) || - ( markType == MarkType::harmonic ) || - ( markType == MarkType::openString ) || - ( markType == MarkType::thumbPosition ) || - ( markType == MarkType::doubleTongue ) || - ( markType == MarkType::tripleTongue ) || - ( markType == MarkType::stopped ) || - ( markType == MarkType::snapPizzicato ) || - ( markType == MarkType::heel ) || - ( markType == MarkType::toe ) || - ( markType == MarkType::fingernails ) || - ( markType == MarkType::otherTechnical ); - } - - - bool isMarkTremolo( MarkType markType ) - { - return ( markType == MarkType::tremoloSingleOne ) || - ( markType == MarkType::tremoloSingleTwo ) || - ( markType == MarkType::tremoloSingleThree ) || - ( markType == MarkType::tremoloSingleFour ) || - ( markType == MarkType::tremoloSingleFive ); - } - - - bool isMarkCustom( MarkType markType ) - { - return ( markType == MarkType::customAccentTenuto ); - } - - - std::string getCustomMarkName( MarkType markType ) - { - switch ( markType ) - { - case MarkType::customAccentTenuto: - return markStringCustomAccentTenuto; - default: - break; - } - - return ""; - } - - - MarkType getMarkTypeFromCustomString( const std::string& inString ) - { - if( inString == markStringCustomAccentTenuto ) { - return api::MarkType::customAccentTenuto; - } - - return api::MarkType::customErrorUnknown; - } - - - int numTremoloSlashes( MarkType markType ) - { - if( markType == MarkType::tremoloSingleOne ) - { - return 1; - } - - if( markType == MarkType::tremoloSingleTwo ) - { - return 2; - } - - if( markType == MarkType::tremoloSingleThree ) - { - return 3; - } - - if( markType == MarkType::tremoloSingleFour ) - { - return 4; - } - - if( markType == MarkType::tremoloSingleFive ) - { - return 5; - } - - return -1; - } - - - MarkData::MarkData() - : markType( MarkType::unspecified ) - , name{} - , tickTimePosition{ 0 } - , printData{} - , positionData{} - { - - } - - - MarkData::MarkData( MarkType inMarkType ) - : markType( inMarkType ) - , name{} - , tickTimePosition{ 0 } - , printData{} - , positionData{} - { - impl::Converter converter; - if( isMarkDynamic( markType ) ) - { - name = mx::core::toString( converter.convertDynamic( markType ) ); - } - else if( isMarkArticulation( markType ) ) - { - name = "articulation"; - } - else if( isMarkFermata( markType ) ) - { - name = mx::core::toString( converter.convertFermata( markType ) ); - } - } - - - MarkData::MarkData( Placement inPlacement, MarkType inMarkType ) - : markType( inMarkType ) - , name{} - , tickTimePosition{ 0 } - , printData{} - , positionData{} - { - positionData.placement = inPlacement; - impl::Converter converter; - if( isMarkDynamic( markType ) ) - { - name = mx::core::toString( converter.convertDynamic( markType ) ); - } - else if( isMarkArticulation( markType ) ) - { - name = "articulation"; - } - else if( isMarkFermata( markType ) ) - { - name = mx::core::toString( converter.convertFermata( markType ) ); - } - } - } -} diff --git a/Sourcecode/private/mx/api/MeasureLocation.cpp b/Sourcecode/private/mx/api/MeasureLocation.cpp deleted file mode 100644 index ed40c2ef9..000000000 --- a/Sourcecode/private/mx/api/MeasureLocation.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/api/MeasureLocation.h" -#include "mx/api/ScoreData.h" -namespace mx -{ - namespace api - { - MeasureLocation::MeasureLocation() - : partIndex{ 0 } - , staffIndex{ 0 } - , measureIndex{ 0 } - { - - } - - bool MeasureLocation::isValid( const ScoreData& scoreData ) const - { - if( partIndex < 0 || - staffIndex < 0 || - measureIndex < 0 ) - { - return false; - } - - if( static_cast( partIndex ) > scoreData.parts.size() - 1 ) - { - return false; - } - - const auto& part = scoreData.parts.at( static_cast( partIndex ) ); - - if( static_cast( measureIndex) > part.measures.size() - 1 ) - { - return false; - } - - const auto& measure = part.measures.at( static_cast( measureIndex ) ); - - if( static_cast( staffIndex ) > measure.staves.size() - 1 ) - { - return false; - } - - return true; - } - } -} diff --git a/Sourcecode/private/mx/api/NoteData.cpp b/Sourcecode/private/mx/api/NoteData.cpp deleted file mode 100644 index 954163695..000000000 --- a/Sourcecode/private/mx/api/NoteData.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/api/NoteData.h" - -namespace mx -{ - namespace api - { - NoteData::NoteData() - : isRest{ false } - , isMeasureRest{ false } - , isUnpitched{ false } - , isDisplayStepOctaveSpecified{ false } - , isChord{ false } - , isTieStart{ false } - , isTieStop{ false } - , noteType{ NoteType::normal } - , notehead{ Notehead::normal } - , pitchData{} - , userRequestedVoiceNumber{ -1 } - , stem{ Stem::unspecified } - , tickTimePosition{ 0 } - , durationData{} - , beams{} - , positionData{} - , printData{} - , noteAttachmentData{} - { - - } - } -} diff --git a/Sourcecode/private/mx/api/PitchData.cpp b/Sourcecode/private/mx/api/PitchData.cpp deleted file mode 100644 index 078dad7b6..000000000 --- a/Sourcecode/private/mx/api/PitchData.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/api/PitchData.h" - -namespace mx -{ - namespace api - { - PitchData::PitchData() - : PitchData{ Step::c } - { - - } - - void PitchData::showAccidental() - { - switch( alter ) - { - case -3: accidental = Accidental::tripleFlat; break; - case -2: accidental = Accidental::flatFlat; break; - case -1: accidental = Accidental::flat; break; - case 0: accidental = Accidental::natural; break; - case 1: accidental = Accidental::sharp; break; - case 2: accidental = Accidental::doubleSharp; break; - case 3: accidental = Accidental::tripleSharp; break; - default: accidental = Accidental::none; - } - } - - - void PitchData::hideAccidental() - { - accidental = Accidental::none; - isAccidentalBracketed = false; - isAccidentalCautionary = false; - isAccidentalEditorial = false; - isAccidentalParenthetical = false; - } - } -} diff --git a/Sourcecode/private/mx/api/ScoreData.cpp b/Sourcecode/private/mx/api/ScoreData.cpp deleted file mode 100644 index 912f0d014..000000000 --- a/Sourcecode/private/mx/api/ScoreData.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/api/ScoreData.h" - -namespace mx -{ - namespace api - { - - ScoreData::ScoreData() - : musicXmlVersion{ api::MusicXmlVersion::unspecified } - , musicXmlType{ "partwise" } - , workTitle{} - , workNumber{} - , movementTitle{} - , movementNumber{} - , composer{} - , lyricist{} - , copyright{} - , encoding{} - , pageTextItems{} - , defaults{} - , parts{} - , partGroups{} - , ticksPerQuarter{ DEFAULT_TICKS_PER_QUARTER } - { - - } - - - - int ScoreData::getNumMeasures() const - { - int numMeasures = 0; - - for( const auto& part : parts ) - { - int temp = static_cast( part.measures.size() ); - if( temp > numMeasures ) - { - numMeasures = temp; - } - } - - return numMeasures; - } - - - - int ScoreData::getNumStavesPerSystem() const - { - int numStaves = 0; - - for( const auto& p : parts ) - { - numStaves += p.getNumStaves(); - } - - return numStaves; - } - - - void ScoreData::sort() - { - for( auto& part : parts ) - { - for( auto& measure : part.measures ) - { - for ( auto& staff : measure.staves ) - { - - const auto clefCompare = [&]( ClefData& inLeft, ClefData& inRight ) - { - return inLeft.tickTimePosition < inRight.tickTimePosition; - }; - - std::sort( std::begin( staff.clefs ), std::end( staff.clefs ), clefCompare ); - - const auto directionCompare = [&]( DirectionData& inLeft, DirectionData& inRight ) - { - return inLeft.tickTimePosition < inRight.tickTimePosition; - }; - - std::sort( std::begin( staff.directions ), std::end( staff.directions ), directionCompare ); - - for ( auto& voice : staff.voices ) - { - const auto noteCompare = [&]( NoteData& inLeft, NoteData& inRight ) - { - return inLeft.tickTimePosition < inRight.tickTimePosition; - }; - - std::sort( std::begin( voice.second.notes ), std::end( voice.second.notes ), noteCompare ); - } - } - } - } - } - - - std::vector::iterator findPart( std::vector& inParts, const std::string& inPartId ) - { - auto predicate = [&inPartId] ( const PartData& partData ) - { - return inPartId == partData.uniqueId; - }; - - auto it = std::find_if( inParts.begin(), inParts.end(), predicate ); - return it; - } - } -} diff --git a/Sourcecode/private/mx/api/SoundID.cpp b/Sourcecode/private/mx/api/SoundID.cpp deleted file mode 100644 index b16656ca7..000000000 --- a/Sourcecode/private/mx/api/SoundID.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/api/SoundID.h" -#include "mx/core/Enums.h" -#include "mx/impl/Converter.h" - -namespace mx -{ - namespace api - { - std::string SoundIDToString( SoundID inSoundID ) - { - if( inSoundID == SoundID::unspecified ) - { - return "unspecified"; - } - else if( inSoundID == SoundID::errorBadString ) - { - return "error.bad.string"; - } - - impl::Converter c; - return core::PlaybackSoundToString( c.convert( inSoundID ) ); - } - - - SoundID SoundIDFromString( const std::string& inString ) - { - SoundID result = SoundID::keyboardPiano; - - try - { - const auto p = core::PlaybackSoundFromString( inString ); - impl::Converter c; - result = c.convert( p ); - } - catch (...) - { - result = SoundID::errorBadString; - } - - return result; - } - } -} diff --git a/Sourcecode/private/mx/api/Version.cpp b/Sourcecode/private/mx/api/Version.cpp deleted file mode 100644 index ad61597a6..000000000 --- a/Sourcecode/private/mx/api/Version.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/api/Version.h" -#include "mx/impl/MxVersionDefines.h" -#include - -namespace mx -{ - namespace api - { - -//////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS //////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - - int - Version::getVersionMajor() - { - return getInstance().myMajor; - } - - - int - Version::getVersionMinor() - { - return getInstance().myMinor; - } - - - int - Version::getVersionPatch() - { - return getInstance().myPatch; - } - - - const std::string& - Version::getString() - { - return getInstance().myString; - } - -//////////////////////////////////////////////////////////////////////////////// -// PRIVATE FUNCTIONS /////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - - Version::Version() - : myMajor{ MX_VERSION_MAJOR } - , myMinor{ MX_VERSION_MINOR } - , myPatch{ MX_VERSION_PATCH } - , myBuild{ MX_VERSION_BUILD } - , myString{} - { - std::stringstream ss; - ss << - myMajor << "." << - myMinor << "." << - myPatch << " (" << - myBuild << ")"; - myString = ss.str(); - } - - const Version& - Version::getInstance() - { - const static Version v; - return v; - } - } -} diff --git a/Sourcecode/private/mx/core/AttributesInterface.cpp b/Sourcecode/private/mx/core/AttributesInterface.cpp deleted file mode 100644 index ad2ffc3a3..000000000 --- a/Sourcecode/private/mx/core/AttributesInterface.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/AttributesInterface.h" - -namespace mx -{ - namespace core - { - bool AttributesInterface::hasValues() const { return false; } - std::ostream& AttributesInterface::toStream( std::ostream& os ) const - { - return os; - } - - - std::ostream& operator<<( std::ostream& os, const AttributesInterface& value ) - { - return value.toStream( os ); - } - - - bool - AttributesInterface::fromXElement( std::ostream& message, ::ezxml::XElement& xelement ) - { - return this->fromXElementImpl( message, xelement ); - } - } -} diff --git a/Sourcecode/private/mx/core/AttributesInterface.h b/Sourcecode/private/mx/core/AttributesInterface.h deleted file mode 100644 index ff21d60e9..000000000 --- a/Sourcecode/private/mx/core/AttributesInterface.h +++ /dev/null @@ -1,55 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/UnusedParameter.h" - -#include -#include - -namespace ezxml -{ - class XElement; -} - -namespace mx -{ - namespace core - { - struct AttributesInterface; - using AttributesPtr = std::shared_ptr; - using AttributesUPtr = std::unique_ptr; - - struct AttributesInterface - { - virtual ~AttributesInterface() {} - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - virtual bool fromXElement( std::ostream& message, ::ezxml::XElement& xelement ) final; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) = 0; - }; - - std::ostream& operator<<( std::ostream& os, const AttributesInterface& value ); - - template - std::ostream& streamAttribute( std::ostream& os, - const T& value, - const char* attributeName, - const bool isPresent ) - { - if ( isPresent ) - { - os << " "; - os << attributeName; - os << "=\""; - os << value; - os << "\""; - } - return os; - } - } -} diff --git a/Sourcecode/private/mx/core/Color.cpp b/Sourcecode/private/mx/core/Color.cpp deleted file mode 100644 index 6f1f60d4c..000000000 --- a/Sourcecode/private/mx/core/Color.cpp +++ /dev/null @@ -1,267 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/Color.h" -#include -#include - -namespace mx -{ - namespace core - { - class Color::impl - { - public: - impl( const IntType alpha, - const IntType red, - const IntType green, - const IntType blue ) - :myAlpha( alpha ) - ,myRed( red ) - ,myGreen( green ) - ,myBlue( blue ) - ,myColorType( Color::ColorType::ARGB ) - {} - - impl( const IntType red, - const IntType green, - const IntType blue ) - :myAlpha(255 ) - ,myRed( red ) - ,myGreen( green ) - ,myBlue( blue ) - ,myColorType( Color::ColorType::RGB ) - {} - - impl() - :myAlpha( 255 ) - ,myRed( 255 ) - ,myGreen( 255 ) - ,myBlue( 255 ) - ,myColorType( ColorType::RGB ) - {} - - IntType getAlpha() const - { - return (short)myAlpha.getValue(); - } - IntType getRed() const - { - return (IntType)myRed.getValue(); - } - IntType getGreen() const - { - return (IntType)myGreen.getValue(); - } - IntType getBlue() const - { - return (IntType)myBlue.getValue(); - } - ColorType getColorType() const - { - return myColorType; - } - - void setAlpha( const IntType value ) - { - myAlpha.setValue( value ); - myColorType = Color::ColorType::ARGB; - } - void setRed( const IntType value ) - { - myRed.setValue( value ); - } - void setGreen( const IntType value ) - { - myGreen.setValue( value ); - } - void setBlue( const IntType value ) - { - myBlue.setValue( value ); - } - void setColorType( const ColorType value ) - { - myColorType = value; - if ( myColorType == Color::ColorType::RGB ) - { - myAlpha.setValue( 255 ); - } - } - void parse( const std::string& value ) - { - if ( value.length() != 7 && - value.length() != 9 ) - { - return; // bad input - } - auto c = value.cbegin(); - if ( *c != '#' ) - { - return; // bad input - } - if ( value.substr( 1, value.length()-1).find_first_not_of( "ABCDEF0123456789" ) - != std::string::npos ) - { - return; // bad input - } - Color::ColorType colortype = Color::ColorType::RGB; - IntType alpha = 255; - IntType red = 255; - IntType green = 255; - IntType blue = 255; - if ( value.length() == 9 ) - { - colortype = Color::ColorType::ARGB; - alpha = getInt( value, 1 ); - red = getInt( value, 3 ); - green = getInt( value, 5 ); - blue = getInt( value, 7 ); - } - else if ( value.length() == 7 ) - { - colortype = Color::ColorType::RGB; - alpha = 255; - red = getInt( value, 1 ); - green = getInt( value, 3 ); - blue = getInt( value, 5 ); - } - setAlpha( alpha ); - setRed( red ); - setGreen( green ); - setBlue( blue ); - setColorType( colortype ); - } - - private: - Byte myAlpha; - Byte myRed; - Byte myGreen; - Byte myBlue; - Color::ColorType myColorType; - IntType getInt( const std::string& str, int startpos ) - { - IntType val = 0; - std::stringstream ss( str.substr( static_cast( startpos ), 2 ) ); - ss << std::hex; - ss << std::uppercase; - ss >> val; - return val; - } - }; - - - Color::Color( const IntType alpha, - const IntType red, - const IntType green, - const IntType blue ) - :myImpl( new Color::impl( alpha, red, green, blue ) ) - {} - - Color::Color( const IntType red, - const IntType green, - const IntType blue ) - :myImpl( new Color::impl( red, green, blue ) ) - {} - - Color::Color() - :myImpl( new Color::impl() ) - {} - - Color::Color( const std::string& value ) - :myImpl( new Color::impl() ) - { myImpl->parse( value ); } - - Color::~Color() {} - - Color::Color( const Color& other ) - :myImpl( new Color::impl( *other.myImpl ) ) - {} - - Color::Color( Color&& other ) - :myImpl( std::move( other.myImpl ) ) - {} - - Color& Color::operator=( const Color& other ) - { - this->myImpl = std::unique_ptr( new Color::impl( *other.myImpl ) ); - return *this; - } - - IntType Color::getAlpha() const - { - return myImpl->getAlpha(); - } - IntType Color::getRed() const - { - return myImpl->getRed(); - } - IntType Color::getGreen() const - { - return myImpl->getGreen(); - } - IntType Color::getBlue() const - { - return myImpl->getBlue(); - } - Color::ColorType Color::getColorType() const - { - return myImpl->getColorType(); - } - void Color::setAlpha( const IntType value ) - { - myImpl->setAlpha( value ); - } - void Color::setRed( const IntType value ) - { - myImpl->setRed( value ); - } - void Color::setGreen( const IntType value ) - { - myImpl->setGreen( value ); - } - void Color::setBlue( const IntType value ) - { - myImpl->setBlue( value ); - } - void Color::setColorType( const Color::ColorType value ) - { - myImpl->setColorType( value ); - } - void Color::parse( const std::string& value ) - { - myImpl->parse( value ); - } - - std::string toString( const Color& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - std::ostream& toStream( std::ostream& os, const Color& value ) - { - auto flagsval = os.flags(); - auto fillval = os.fill(); - auto widthval = os.width(); - os << "#"; - - if ( value.getColorType() == Color::ColorType::ARGB ) - { - os << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << value.getAlpha(); - } - os << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << value.getRed(); - os << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << value.getGreen(); - os << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << value.getBlue(); - os.flags( flagsval ); - os.width( widthval ); - os.flags( flagsval ); - os.fill( fillval ); - return os; - } - std::ostream& operator<<( std::ostream& os, const Color& value ) - { - return toStream( os, value ); - } - } -} diff --git a/Sourcecode/private/mx/core/Color.h b/Sourcecode/private/mx/core/Color.h deleted file mode 100644 index b632cc0e1..000000000 --- a/Sourcecode/private/mx/core/Color.h +++ /dev/null @@ -1,61 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include "mx/core/Integers.h" -#include - -namespace mx -{ - namespace core - { - class Color - { - public: - enum class ColorType - { - RGB = 0, - ARGB = 1 - }; - explicit Color( const IntType alpha, - const IntType red, - const IntType green, - const IntType blue); - explicit Color( const IntType red, - const IntType green, - const IntType blue); - explicit Color( const std::string& value ); - Color(); - virtual ~Color(); - Color( const Color& other ); - Color( Color&& other ); - Color& operator=( const Color& other ); - - IntType getAlpha() const; - IntType getRed() const; - IntType getGreen() const; - IntType getBlue() const; - ColorType getColorType() const; - - void setAlpha( IntType value ); - void setRed( const IntType value ); - void setGreen( const IntType value ); - void setBlue( const IntType value ); - void setColorType( const ColorType value ); - - void parse( const std::string& value ); - - private: - class impl; - std::unique_ptr myImpl; - }; - - std::string toString( const Color& value ); - std::ostream& toStream( std::ostream& os, const Color& value ); - std::ostream& operator<<( std::ostream& os, const Color& value ); - - } -} diff --git a/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.cpp b/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.cpp deleted file mode 100644 index a7c62c958..000000000 --- a/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.cpp +++ /dev/null @@ -1,150 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/CommaSeparatedPositiveIntegers.h" -#include "mx/core/StringUtils.h" - -namespace mx -{ - namespace core - { - inline std::set copyPositives( const std::set& input ) - { - std::set output; - std::copy_if( input.cbegin(), input.cend(), std::inserter( output, output.begin() ), - [](const int i){ return i > 0; } ); - return output; - } - - CommaSeparatedListOfPositiveIntegers::CommaSeparatedListOfPositiveIntegers() - :myValues() - ,myIsSpacingDesired( false ) - { - - } - - - CommaSeparatedListOfPositiveIntegers::CommaSeparatedListOfPositiveIntegers( const StringType& value ) - :myValues() - ,myIsSpacingDesired(false) - { - parse( value ); - } - - - CommaSeparatedListOfPositiveIntegers::CommaSeparatedListOfPositiveIntegers( const std::set& values ) - :myValues() - { - setValues( values ); - } - - - const std::set& CommaSeparatedListOfPositiveIntegers::getValues() const - { - return myValues; - } - - - std::set::iterator CommaSeparatedListOfPositiveIntegers::getValuesBegin() - { - return myValues.begin(); - } - - - std::set::iterator CommaSeparatedListOfPositiveIntegers::getValuesEnd() - { - return myValues.end(); - } - - - std::set::const_iterator CommaSeparatedListOfPositiveIntegers::getValuesBeginConst() const - { - return myValues.cbegin(); - } - - - std::set::const_iterator CommaSeparatedListOfPositiveIntegers::getValuesEndConst() const - { - return myValues.cend(); - } - - - void CommaSeparatedListOfPositiveIntegers::setValues( const std::set& values ) - { - myValues = copyPositives( values ); - } - - - void CommaSeparatedListOfPositiveIntegers::parse( const StringType& commaSeparatedText ) - { - StringType cleaned = onlyAllow( commaSeparatedText, "", "1234567890,-" ); - myValues.clear(); - std::istringstream iss( cleaned ); - std::string token; - while( std::getline( iss, token, ',' ) ) - { - if ( token.length() > 0 ) - { - std::stringstream ss( token ); - int value = 1; - ss >> value; - if ( value > 0 ) - { - myValues.insert( value ); - } - } - } - } - - - void CommaSeparatedListOfPositiveIntegers::setUseSpaceBetweenItems( bool value ) - { - myIsSpacingDesired = value; - } - - - bool CommaSeparatedListOfPositiveIntegers::getUseSpaceBetweenItems() const - { - return myIsSpacingDesired; - } - - - std::ostream& toStream( std::ostream& os, const CommaSeparatedListOfPositiveIntegers& value ) - { - bool isfirst = true; - for ( auto x : value.getValues() ) - { - if( isfirst ) - { - os << x; - isfirst = false; - } - else - { - os << ","; - if( value.getUseSpaceBetweenItems() ) - { - os << " "; - } - os << x; - } - } - return os; - } - - - std::ostream& operator<<( std::ostream& os, const CommaSeparatedListOfPositiveIntegers& value ) - { - return toStream( os, value ); - } - - - StringType toString( const CommaSeparatedListOfPositiveIntegers& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - } -} diff --git a/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.h b/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.h deleted file mode 100644 index a757de090..000000000 --- a/Sourcecode/private/mx/core/CommaSeparatedPositiveIntegers.h +++ /dev/null @@ -1,39 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/CommaSeparatedText.h" - -#include - -namespace mx -{ - namespace core - { - class CommaSeparatedListOfPositiveIntegers - { - public: - CommaSeparatedListOfPositiveIntegers(); - CommaSeparatedListOfPositiveIntegers( const StringType& value ); - CommaSeparatedListOfPositiveIntegers( const std::set& values ); - const std::set& getValues() const; - std::set::iterator getValuesBegin(); - std::set::iterator getValuesEnd(); - std::set::const_iterator getValuesBeginConst() const; - std::set::const_iterator getValuesEndConst() const; - void setValues( const std::set& values ); - void parse( const StringType& commaSeparatedText ); - void setUseSpaceBetweenItems( bool value ); - bool getUseSpaceBetweenItems() const; - private: - std::set myValues; - bool myIsSpacingDesired; - }; - - StringType toString( const CommaSeparatedListOfPositiveIntegers& value ); - std::ostream& toStream( std::ostream& os, const CommaSeparatedListOfPositiveIntegers& value ); - std::ostream& operator<<( std::ostream& os, const CommaSeparatedListOfPositiveIntegers& value ); - } -} diff --git a/Sourcecode/private/mx/core/CommaSeparatedText.cpp b/Sourcecode/private/mx/core/CommaSeparatedText.cpp deleted file mode 100644 index df95e2d61..000000000 --- a/Sourcecode/private/mx/core/CommaSeparatedText.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/CommaSeparatedText.h" - -#include -#include - -namespace mx -{ - namespace core - { - CommaSeparatedText::CommaSeparatedText() - :myValues() - { - - } - - - CommaSeparatedText::CommaSeparatedText( const XsTokenSet& values ) - :myValues( values ) - { - - } - - - CommaSeparatedText::CommaSeparatedText( const StringType& value ) - :myValues() - { - this->parse( value ); - } - - - void CommaSeparatedText::parse( const StringType& commaSeparatedText ) - { - myValues.clear(); - std::istringstream iss( commaSeparatedText ); - std::string token; - - while( std::getline( iss, token, ',' ) ) - { - myValues.push_back( XsToken( token ) ); - } - } - - - const XsTokenSet& CommaSeparatedText::getValues() const - { - return myValues; - } - - - void CommaSeparatedText::setValues( const XsTokenSet& values ) - { - myValues = values; - } - - - void CommaSeparatedText::addValue( const XsToken& value ) - { - myValues.emplace_back( value ); - } - - - XsTokenSetIter CommaSeparatedText::getValuesBegin() - { - return myValues.begin(); - } - - - XsTokenSetIter CommaSeparatedText::getValuesEnd() - { - return myValues.end(); - } - - - XsTokenSetIterConst CommaSeparatedText::getValuesBeginConst() const - { - return myValues.cbegin(); - } - - - XsTokenSetIterConst CommaSeparatedText::getValuesEndConst() const - { - return myValues.cend(); - } - - - std::ostream& toStream( std::ostream& os, const CommaSeparatedText& value ) - { - bool isfirst = true; - for ( auto x : value.getValues() ) - { - if( isfirst ) - { - toStream( os, x ); - isfirst = false; - } - else - { - os << ","; - toStream( os, x ); - } - } - return os; - } - - - std::ostream& operator<<( std::ostream& os, const CommaSeparatedText& value ) - { - return toStream( os, value ); - } - - - StringType toString( const CommaSeparatedText& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - } -} diff --git a/Sourcecode/private/mx/core/CommaSeparatedText.h b/Sourcecode/private/mx/core/CommaSeparatedText.h deleted file mode 100644 index 85379049d..000000000 --- a/Sourcecode/private/mx/core/CommaSeparatedText.h +++ /dev/null @@ -1,42 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/XsToken.h" -#include - -namespace mx -{ - namespace core - { - using XsTokenSet = std::vector; - using XsTokenSetIter = XsTokenSet::iterator; - using XsTokenSetIterConst = XsTokenSet::const_iterator; - - class CommaSeparatedText - { - public: - CommaSeparatedText(); - CommaSeparatedText( const StringType& value ); - CommaSeparatedText( const XsTokenSet& values ); - const XsTokenSet& getValues() const; - XsTokenSetIter getValuesBegin(); - XsTokenSetIter getValuesEnd(); - XsTokenSetIterConst getValuesBeginConst() const; - XsTokenSetIterConst getValuesEndConst() const; - void addValue( const XsToken& value ); - void setValues( const XsTokenSet& values ); - void parse( const StringType& commaSeparatedText ); - - private: - XsTokenSet myValues; - - }; - - StringType toString( const CommaSeparatedText& value ); - std::ostream& toStream( std::ostream& os, const CommaSeparatedText& value ); - std::ostream& operator<<( std::ostream& os, const CommaSeparatedText& value ); - } -} diff --git a/Sourcecode/private/mx/core/Date.cpp b/Sourcecode/private/mx/core/Date.cpp deleted file mode 100644 index 2f7b27073..000000000 --- a/Sourcecode/private/mx/core/Date.cpp +++ /dev/null @@ -1,822 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/Date.h" -#include -#include - -namespace -{ - std::ostream& zeroPad( int value, int width, std::ostream& os ) - { - char prev_fillch = os.fill ('0'); - std::streamsize prev_width = os.width( width ); - os << value; - os.fill( prev_fillch ); - os.width( prev_width ); - return os; - } -} - -namespace mx -{ - namespace core - { - class Date::impl - { - public: - impl( int year_in, int month_in, int day_in ) - :myYear( 1900 ) - ,myMonth( 1 ) - ,myDay( 1 ) - { - setYear( year_in ); - setMonth( month_in ); - setDay( day_in ); - } - - impl() - :myYear( 1900 ) - ,myMonth( 1 ) - ,myDay( 1 ) - {} - - impl( const std::string& yyyy_mm_dd ) - :myYear( 1900 ) - ,myMonth( 1 ) - ,myDay( 1 ) - { parseString( yyyy_mm_dd ); } - - ~impl() {} - - public: - void setYear( int value ) - { - myYear = constrainToRange( value, 1, 9999 ); - setDay( getDay() ); - } - - - void setMonth( int value ) - { - myMonth = constrainToRange( value, 1, 12 ); - setDay( getDay() ); - } - - - void setDay( int value ) - { - myDay = constrainToRange( value, 1, daysInMonth( getMonth(), getYear() ) ); - } - - - bool setValue( int year_in, int month_in, int day_in ) - { - if ( isDateValid( year_in, month_in, day_in ) ) - { - setYear( year_in ); - setMonth( month_in ); - setDay( day_in ); - return true; - } - return false; - } - - - bool isLeapYear( int year_in ) const - { - /* per Wikipedia - - Pseudocode to determine whether a year is a leap year - or not in either the Gregorian calendar since 1582 or - in the proleptic Gregorian calendar between 1 and 1582: - - if year is divisible by 400 then - is_leap_year - else if year is divisible by 100 then - not_leap_year - else if year is divisible by 4 then - is_leap_year - else - not_leap_year - - */ - if( year_in < 1 || year_in > 9999 ) // error, unacceptable year - return false; - else if ( year_in % 400 == 0 ) // is leapyear per wikipedia - return true; - else if ( year_in % 100 == 0 ) // is NOT a leapyear per wikipedia - return false; - else if ( year_in % 4 == 0 ) // is leapyear per wikipedia - return true; - else - return false; // is not leapyear per wikipedia - } - - - bool parse( const std::string value_in ) - { - return parseString( value_in ); - } - - - bool parseString( const std::string& value_in ) - { - if ( isStringFormatValid( value_in ) ) - { - int year = -1; - int month = -1; - int day = -1; - if ( parseStringYear( value_in, year ) - && parseStringMonth( value_in, month ) - && parseStringDay( value_in, day ) ) - { - if ( day <= daysInMonth( month, year ) ) - { - setValue( year, month, day ); - return true; - } - } - } - return false; - } // parseString - - - bool parseStringYear( const std::string& value_in, int& year_out ) - { - year_out = -1; - std::stringstream( value_in.substr( 0, 4 ) ) >> year_out; - bool success = false; - if ( year_out >= 1 && year_out <= 9999 ) - { - success = true; - } - return success; - } //parseStringYear - - - bool parseStringMonth( const std::string& value_in, int& month_out ) - { - month_out = -1; - std::stringstream( value_in.substr( 5, 2 ) ) >> month_out; - bool success = false; - if ( month_out >= 1 && month_out <= 12 ) - { - success = true; - } - return success; - } //parseStringMonth - - - bool parseStringDay( const std::string& value_in, int& day_out ) - { - day_out = -1; - std::stringstream( value_in.substr( 8, 2 ) ) >> day_out; - bool success = false; - if ( day_out >= 1 && day_out <= 31 ) - { - success = true; - } - return success; - } //parseStringDay - - - bool isStringFormatValid( const std::string& value_in ) const - { - int length = (int)value_in.size(); - if ( length != 10 ) - { - return false; - } - else - { - for ( size_t i = 0; i < static_cast( length ); ++i ) - { - if ( ( i <= 3 ) && ! isdigit( value_in[i] ) ) - { - return false; - } - else if ( ( i >= 5 && i <= 6 ) && ! isdigit( value_in[i] ) ) - { - return false; - } - else if ( ( i >= 8 && i <= 9 ) && ! isdigit( value_in[i] ) ) - { - return false; - } - else if ( ( i == 4 || i == 7 ) && ! ( value_in[i] == '-' ) ) - { - return false; - } - } - } - return true; - } - - - int daysInMonth( int month_in, int year_in ) const - { - if ( isLeapYear( year_in ) ) - { - return MONTHDAYS[1][constrainToRange( month_in, 1, 12 )]; - } - else - { - return MONTHDAYS[0][constrainToRange( month_in, 1, 12 )]; - } - } - - - int constrainToRange( int value_in, int minimumValue, int maximumValue ) const - { - if ( value_in < minimumValue ) - { - return minimumValue; - } - if ( value_in > maximumValue ) - { - return maximumValue; - } - return value_in; - } - - - int getYear() const - { - return myYear; - } - - - int getDay() const - { - return myDay; - - } - - - int getMonth() const - { - return myMonth; - } - - - int getWeekday() const - { - // returns sequential day of the week 1 for Sunday, 2 for Monday ... 7 for Saturday - // this implements Zeller's Congruence - // algorithm: http://en.wikipedia.org/wiki/Zeller%27s_congruence - // implementation: http://ideone.com/CkDGvY - int h,q,m,k,j,day,month,year; - day = getDay(); - month = getMonth(); - year = getYear(); - if(month==1) - { - month = 13; - year--; - } - if(month==2) - { - month = 14; - year--; - } - q = day; - m = month; - k = year % 100; - j = year / 100; - h = q + 13*(m+1)/5 + k + k/4 + j/4 + 5*j; - h = h % 7; - - // Zeller's Congruence returns 0 for Saturday - // Convert this to 7 so that... - // 1 = Sunday - // 2 = Monday - // 3 = Tuesday - // 4 = Wednesday - // 5 = Thursday - // 6 = Friday - // 7 = Saturday - if (h==0) - { - h=7; - } - return h; - } - - - bool isDateValid( int year_in, int month_in, int day_in ) const - { - if ( year_in < 1 ) - { - return false; - } - else if ( year_in > 9999 ) - { - return false; - } - else if ( month_in < 1 ) - { - return false; - } - else if ( month_in > 12 ) - { - return false; - } - else if ( day_in < 1 ) - { - return false; - } - else if ( day_in > daysInMonth( month_in, year_in ) ) - { - return false; - } - else - { - return true; - } - } - - - bool equal( const Date& other_in ) const - { - return compare( other_in ) == 0; - } - - - bool notEqual( const Date& other_in ) const - { - return compare( other_in ) != 0; - } - - - bool greaterThan( const Date& other_in ) const - { - int temp = 999; - temp = compare( other_in ); - return temp > 0; - } - - - bool greaterThanOrEqual( const Date& other_in ) const - { - return compare( other_in ) >= 0; - } - - - bool lessThan( const Date& other_in ) const - { - return compare( other_in ) < 0; - } - - - bool lessThanOrEqual( const Date& other_in ) const - { - return compare( other_in ) <= 0; - } - - - void addDays( int days ) - { - if (days == 0) - { - return; - } - else if ( days > 0 ) - { - for ( int i = 0; i < days; i++) - { - if ( equal( Date( 9999, 12, 31 ) ) ) - { - return; - } - else if ( getMonth() == 12 && getDay() == 31 ) - { - setYear( getYear() + 1 ); - setMonth( 1 ); - setDay( 1 ); - } - else if ( getDay() == daysInMonth( getMonth(), getYear() ) ) - { - setMonth( getMonth() + 1 ); - setDay( 1 ); - } - else - { - setDay( getDay() + 1 ); - } - } - } - else if ( days < 0 ) - { - for ( int i = 0; i > days; i-- ) - { - if ( equal( Date( 1, 1, 1 ) ) ) - { - return; - } - else if ( getMonth() == 1 && getDay() == 1 ) - { - setYear( getYear() - 1 ); - setMonth( 12 ); - setDay( 31 ); - } - else if ( getDay() == 1 ) - { - setMonth( getMonth() - 1 ); - setDay( daysInMonth( getMonth(), getYear() ) ); - } - else - { - setDay( getDay() - 1 ); - } - } - } - } - - - void addMonths( int months ) - { - - // modulus math is hard to understand when negative numbers are involved - // store the sign of 'months' as an int and make months positive - int direction = 1; - if (months < 0) - { - direction = -1; - months *= -1; - } - - // remember what day value we had to start with - int day_was = getDay(); - - // figure out how many years to add - // note: int/int truncates - int new_year = getYear() + ( direction * ( months / 12 ) ); - // if the year goes out of bounds, return min/max date - - // figure out how many months to add - int new_month = getMonth() + ( direction * ( months % 12 ) ); - - // if new_month equals 0 then direction must be -1 - // the actual month should be December of the previous year. - if ( new_month == 0 ) - { - --new_year; - setMonth( 12 ); - } - // if new_month < 0 then direction must be -1 - // and, we know we didn't subtract more than -11 - // so we can figure out the correct month by - // adding 12 and moving to the previous year - else if ( new_month < 0 ) - { - --new_year; - setMonth( new_month + 12); - } - // if new_month > 12, we know we did not add more than 11 - // so we can add a year and take the mod of new_month; - else if ( new_month > 12 ) - { - ++new_year; - setMonth( new_month % 12 ); - } - else - { - setMonth( new_month ); - } - - // does the day fit within the month? - int daysover = day_was - daysInMonth( getMonth(), new_year ); - - // If the day is out of bounds we need to correct it. - // This implements the rules followed by Microsoft Excel 2010 - // and also by Google Docs (as of 2013) and Sql Server 2012 - // if the target date has a day value to high for the target - // month, then adjust the day value to the maximum day value - // available in the target month - if ( daysover > 0 ) - { - // jump to the last day of the month - setYear( new_year ); - setDay( daysInMonth( getMonth(), getYear() ) ); - } - else - { - setYear( new_year ); - setDay( day_was ); // restore the correct day value - } - - // check for out-of-bounds year value - if ( new_year < 1 ) - { - setYear( 1 ); - setMonth( 1 ); - setDay( 1 ); - } - else if ( new_year > 9999 ) - { - setYear( 9999 ); - setMonth( 12 ); - setDay( 31 ); - } - else - { - setYear( new_year ); - } - } - - - void addYears( int years ) - { - int new_year = getYear() + years; - //year( ( year() + years ) ); - - // if day was a leap day and the new year is not a leap year - // month/day need to be moved to March 1 instead of Feb 29 - if ( getMonth() == 2 && getDay() == 29 && !isLeapYear( new_year ) ) - { - setDay( 1 ); - setMonth( 3 ); - } - setYear( new_year ); - } - - private: - int myYear; - int myMonth; - int myDay; - - void setInitialValue( int year_in, int month_in, int day_in ) - { - if ( isDateValid( year_in, month_in, day_in ) ) - { - setValue( year_in, month_in, day_in ); - } - else - { - setValue( 1900, 1, 1 ); - } - } - - - int compare( const Date& other ) const - { - if ( this->getYear() > other.getYear() ) - { - return 1; - } - else if ( this->getYear() < other.getYear() ) - { - return -1; - } - else - { - if ( this->getMonth() > other.getMonth() ) - { - return 1; - } - else if ( this->getMonth() < other.getMonth() ) - { - return -1; - } - else - { - if ( this->getDay() > other.getDay() ) - { - return 1; - } - else if ( this->getDay() < other.getDay() ) - { - return -1; - } - } - } - return 0; - } - - public: - const static std::string myXmlTypeName; - const static std::string myClassName; - const static std::string myDocumentation; - const static int myXsdID; - const static int MONTHDAYS [2][13]; - - - }; // struct Date::impl - - - const int Date::impl::MONTHDAYS [2][13] = - { - {0,31,28,31,30,31,30,31,31,30,31,30,31} // 0 = Not a leap year - , - {0,31,29,31,30,31,30,31,31,30,31,30,31} // 1 = Leap year - }; - - /* Date ---------------------------------------------------------------- */ - - /* Constructor, Destructor, Copy, Assignment ------------------------------------------ */ - - Date::Date( int year_in, int month_in, int day_in ) - :myImpl( new impl( year_in, month_in, day_in ) ) - {} - - Date::Date() - :myImpl( new impl() ) - {} - - Date::Date( const std::string& yyyy_mm_dd ) - :myImpl( new impl( yyyy_mm_dd ) ) - {} - - Date::~Date() {} - - Date::Date( const Date& other ) - :myImpl( new impl( other.myImpl->getYear(), - other.myImpl->getMonth(), - other.myImpl->getDay() ) ) - {} - - - Date::Date( Date&& other ) - :myImpl( std::move( other.myImpl ) ) - {} - - Date& Date::operator=( const Date& other ) - { - this->myImpl = std::unique_ptr( new impl( other.myImpl->getYear(), - other.myImpl->getMonth(), - other.myImpl->getDay() ) ); - return *this; - } - Date& Date::operator=( Date&& other ) - { - myImpl = std::move( other.myImpl ); - return *this; - } - - Date Date::today() - { - std::time_t t = std::time( 0 ); - struct tm* now = std::localtime( &t ); - const int y = static_cast( now->tm_year + 1900 ); - const int m = static_cast( now->tm_mon + 1 ); - const int d = static_cast( now->tm_mday ); - return Date{ y, m, d }; - } - - /* Getters ---------------------------------------------------------------------------- */ - - /** Returns the year as an int. **/ - int Date::getYear() const - { - return myImpl->getYear(); - } - - /** Returns the month as an int. **/ - int Date::getMonth() const - { - return myImpl->getMonth(); - } - - /** Returns the day as an int. **/ - int Date::getDay() const - { - return myImpl->getDay(); - } - - /** Returns true if the contained year is a leap year **/ - bool Date::isLeapYear() const - { - return myImpl->isLeapYear( getYear() ); - } - - /** Returns true if the passed year is a leap year **/ - bool Date::isLeapYear( int year_in ) const - { - return myImpl->isLeapYear( year_in ); - } - - /** Returns the number of days in the current month **/ - int Date::daysInMonth() const - { - return myImpl->daysInMonth( getMonth(), getYear() ); - } - - /** Returns the number of days in the passed month/year **/ - int Date::daysIntMonth( int month_in, int year_in ) const - { - return myImpl->daysInMonth( month_in, year_in ); - } - int Date::getWeekday() const - { - return myImpl->getWeekday(); - } - bool Date::setValue( int year_in, int month_in, int day_in ) - { - return myImpl->setValue( year_in, month_in, day_in ); - } - void Date::setYear( int year_in ) - { - myImpl->setYear( year_in ); - } - void Date::setMonth( int month_in ) - { - myImpl->setMonth( month_in ); - } - void Date::setDay( int day_in ) - { - myImpl->setDay( day_in ); - } - bool Date::parse( const std::string& value_in ) - { - return myImpl->parse( value_in ); - } - bool Date::operator==( const Date& other_in ) const - { - return myImpl->equal( other_in ); - } - bool Date::operator!=( const Date& other_in ) const - { - return myImpl->notEqual( other_in ); - } - bool Date::operator>( const Date& other_in ) const - { - return myImpl->greaterThan( other_in ); - } - bool Date::operator<( const Date& other_in ) const - { - return myImpl->lessThan( other_in ); - } - bool Date::operator>=( const Date& other_in ) const - { - return myImpl->greaterThanOrEqual( other_in ); - } - bool Date::operator<=( const Date& other_in ) const - { - return myImpl->lessThanOrEqual( other_in ); - } - Date& Date::operator++() - { - myImpl->addDays( 1 ); - return *this; - } - Date Date::operator++( int ) - { - Date temp( *this ); - myImpl->addDays( 1 ); - return temp; - } - Date& Date::operator--() - { - myImpl->addDays( -1 ); - return *this; - } - Date Date::operator--( int ) - { - Date temp( *this ); - myImpl->addDays( -1 ); - return temp; - } - Date& Date::addDays( int days_in ) - { - myImpl->addDays( days_in ); - return *this; - } - Date& Date::addMonths( int months_in ) - { - myImpl->addMonths( months_in ); - return *this; - } - Date& Date::addYears( int years_in ) - { - myImpl->addYears( years_in ); - return *this; - } - - - std::string toString( const Date& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - - std::ostream& toStream( std::ostream& os, const Date& value ) - { - zeroPad( value.getYear(), 4, os ); - os << "-"; - zeroPad( value.getMonth(), 2, os ); - os << "-"; - zeroPad( value.getDay(), 2, os ); - return os; - } - - - std::ostream& operator<<( std::ostream& os, const Date& value ) - { - return toStream( os, value ); - } - } -} diff --git a/Sourcecode/private/mx/core/Date.h b/Sourcecode/private/mx/core/Date.h deleted file mode 100644 index 2f44af252..000000000 --- a/Sourcecode/private/mx/core/Date.h +++ /dev/null @@ -1,88 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include - -namespace mx -{ - namespace core - { - class Date - { - public: - Date( int year_in, int month_in, int day_in ); - Date(); // defaults to 1900-01-01 - Date( const std::string& yyyy_mm_dd ); // e.g. "2014-07-01" - virtual ~Date(); - Date( const Date& other ); - Date( Date&& other ); - Date& operator=( const Date& other ); - Date& operator=( Date&& other ); - - static Date today(); - - /** Returns the year as an int. **/ - int getYear() const; - - /** Returns the month as an int. **/ - int getMonth() const; - - /** Returns the day as an int. **/ - int getDay() const; - - /** Returns true if the contained year is a leap year **/ - bool isLeapYear() const; - - /** Returns true if the passed year is a leap year **/ - bool isLeapYear( int year_in ) const; - - /** Returns the number of days in the current month **/ - int daysInMonth() const; - - /** Returns the number of days in the given month/year **/ - int daysIntMonth( int month_in, int year_in ) const; - - /* gets the day of the week where 1 = Sunday, 2 = Monday, - 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, - 7 = Saturday */ - int getWeekday() const; - - bool setValue( int year_in, int month_in, int day_in ); - void setYear( int year_in ); - void setMonth( int month_in ); - void setDay( int day_in ); - bool parse( const std::string& value_in ); - - - bool operator==( const Date& other_in ) const; - bool operator!=( const Date& other_in ) const; - bool operator>( const Date& other_in ) const; - bool operator<( const Date& other_in ) const; - bool operator>=( const Date& other_in ) const; - bool operator<=( const Date& other_in ) const; - - - Date& operator++(); - Date operator++( int ); - Date& operator--(); - Date operator--( int ); - - Date& addDays( int days_in ); - Date& addMonths( int months_in ); - Date& addYears( int years_in ); - - private: - class impl; - std::unique_ptr myImpl; - - }; - - std::string toString( const Date& value ); - std::ostream& toStream( std::ostream& os, const Date& value ); - std::ostream& operator<<( std::ostream& os, const Date& value ); - } -} diff --git a/Sourcecode/private/mx/core/Decimals.cpp b/Sourcecode/private/mx/core/Decimals.cpp deleted file mode 100644 index eb11eb81d..000000000 --- a/Sourcecode/private/mx/core/Decimals.cpp +++ /dev/null @@ -1,551 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -// self -#include "mx/core/Decimals.h" - -// lib -#include "mx/core/UnusedParameter.h" - -// std -#include -#include - -namespace mx -{ - namespace core - { - PreciseDecimal::PreciseDecimal( short inMaxIntegerDigits, short inMaxDecimalDigits, DecimalType inValue ) - : myIsNegative{ inValue < 0.0 } - , myInteger{ 0 } - , myDecimal{ 0 } - , myMaxIntegerDigits{ DEFAULT_MAX_INTEGER_DIGITS } - , myMaxDecimalDigits{ DEFAULT_MAX_DECIMAL_DIGITS } - { - setMaxIntegerDigits( inMaxIntegerDigits ); - setMaxDecimalDigits( inMaxDecimalDigits ); - setMaxExpressibleNumber(); - setValue( inValue ); - } - - PreciseDecimal::PreciseDecimal( short inMaxIntegerDigits, short inMaxDecimalDigits ) - : PreciseDecimal{ inMaxIntegerDigits, inMaxDecimalDigits, 0.0 } - { - - } - - PreciseDecimal::PreciseDecimal( DecimalType inValue ) - : PreciseDecimal{ DEFAULT_MAX_INTEGER_DIGITS, DEFAULT_MAX_DECIMAL_DIGITS, inValue } - { - - } - - PreciseDecimal::PreciseDecimal() - : PreciseDecimal{ DEFAULT_MAX_INTEGER_DIGITS, DEFAULT_MAX_DECIMAL_DIGITS, 0.0 } - { - - } - - DecimalType PreciseDecimal::getValue() const - { - return express( myInteger, myDecimal, myMaxDecimalDigits, myIsNegative ); - } - - static constexpr const long double POINT_FIVE = 0.4999999; - - void PreciseDecimal::setValue( DecimalType inValue ) - { - if ( inValue < 0 ) - { - myIsNegative = true; - inValue *= -1; - } - else - { - myIsNegative = false; - } - - const auto integer = static_cast( inValue ); - const bool isTooBig = integer > myMaxExpressibleInteger; - - if( isTooBig ) - { - myInteger = myMaxExpressibleInteger; - myDecimal = myMaxExpressibleDecimal; - return; - } - - const DecimalType decimalPartAsFloat = inValue - static_cast( integer ); - const auto powerMultiplierAsFloat = std::pow( static_cast( 10 ), static_cast( getMaxDecimalDigits() ) ); - const auto powerMultiplier = static_cast( std::ceil( powerMultiplierAsFloat - POINT_FIVE ) ); - const auto decimalDigitsShifted = decimalPartAsFloat * static_cast( powerMultiplier ); - const auto decimalDigits = static_cast( std::ceil( decimalDigitsShifted - POINT_FIVE ) ); - - if( decimalDigits > myMaxExpressibleDecimal ) - { - myInteger = integer + 1; - myDecimal = 0; - return; - } - - myInteger = integer; - myDecimal = decimalDigits; - } - - short PreciseDecimal::getMaxIntegerDigits() const - { - return myMaxIntegerDigits; - } - - short PreciseDecimal::getMaxDecimalDigits() const - { - return myMaxDecimalDigits; - } - - DecimalType PreciseDecimal::getMaxExpressibleNumber() const - { - return express( myMaxExpressibleInteger, myMaxExpressibleDecimal, myMaxDecimalDigits, myIsNegative ); - } - - DecimalType PreciseDecimal::getMinExpressibleNumber() const - { - return -1 * getMaxExpressibleNumber(); - } - - std::ostream& PreciseDecimal::toStream( std::ostream& os ) const - { - if( myInteger == 0 && myDecimal == 0 ) - { - os << "0"; - return os; - } - - if( myIsNegative ) - { - os << "-"; - } - - os << myInteger; - - if( myDecimal == 0 ) - { - return os; - } - - os << "."; - - auto decIntStr = std::to_string( myDecimal ); - std::stringstream ss; - - bool isNonZeroReached = false; - - for ( auto c = decIntStr.crbegin(); - c != decIntStr.crend(); - ++c ) - { - if( *c == '0' && !isNonZeroReached ) - { - continue; - } - - isNonZeroReached = true; - ss << *c; - } - - const auto backwards = ss.str(); - - short digits = 0; - decltype( myDecimal ) tens = 1; - - for( int i = 0; i <= myMaxDecimalDigits; ++i ) - { - ++digits; - tens *= 10; - const auto r = myDecimal / tens; - - if( r < 1 ) - { - break; - } - } - - short leadingZeros = myMaxDecimalDigits - digits; - - for ( short i = 0; i < leadingZeros; ++i ) - { - os << "0"; - } - - for ( auto c = backwards.crbegin(); - c != backwards.crend(); - ++c ) - { - os << *c; - } - - return os; - } - - std::string PreciseDecimal::toString() const - { - std::stringstream ss; - toStream( ss ); - return ss.str(); - } - - void PreciseDecimal::setMaxIntegerDigits( short inNumDigits ) - { - if( inNumDigits < 1 ) - { - myMaxIntegerDigits = 1; - return; - } - - if( inNumDigits > MAX_STORAGE_TYPE_DIGITS ) - { - myMaxIntegerDigits = MAX_STORAGE_TYPE_DIGITS; - return; - } - - myMaxIntegerDigits = inNumDigits; - } - - void PreciseDecimal::setMaxDecimalDigits( short inNumDigits ) - { - if( inNumDigits < 1 ) - { - myMaxDecimalDigits = 1; - return; - } - - if( inNumDigits > MAX_STORAGE_TYPE_DIGITS ) - { - myMaxDecimalDigits = MAX_STORAGE_TYPE_DIGITS; - return; - } - - myMaxDecimalDigits = inNumDigits; - } - - decltype( PreciseDecimal::myInteger ) PreciseDecimal::findMax( short inNumDigits ) - { - decltype( myInteger ) mult = 0; - decltype( myInteger ) result = 0; - - for( short i = 0; i < inNumDigits; ++i ) - { - mult = static_cast( std::ceil( std::pow( 10, i ) - 0.5) ); - const auto add = mult * 9; - result += add; - } - - return result; - } - - void PreciseDecimal::setMaxExpressibleInteger() - { - myMaxExpressibleInteger = findMax( getMaxIntegerDigits() ); - } - - void PreciseDecimal::setMaxExpressibleDecimal() - { - myMaxExpressibleDecimal = findMax( getMaxDecimalDigits() ); - } - - void PreciseDecimal::setMaxExpressibleNumber() - { - setMaxExpressibleInteger(); - setMaxExpressibleDecimal(); - } - - DecimalType PreciseDecimal::express( uint64_t inInteger, uint64_t inDecimal, short inMaxDecimalDigits, bool inIsNegative ) - { - const auto integer = static_cast( inInteger ); - const auto decimalPartAsFloat = static_cast( inDecimal ); - const auto powerMultiplierAsFloat = std::pow( static_cast( 10 ), static_cast( inMaxDecimalDigits ) ); - const auto powerMultiplier = static_cast( std::ceil( powerMultiplierAsFloat - 0.5 ) ); - const auto decimal = decimalPartAsFloat / powerMultiplier; - auto result = integer + decimal; - - if( inIsNegative ) - { - result *= -1; - } - - return result; - } - - Decimal::Decimal( DecimalType value ) - : myValue{ 19, DEFAULT_PRECISION, value } - { - - } - - Decimal::Decimal() - : Decimal{ 0.0 } - { - - } - - DecimalType Decimal::getValue() const - { - return myValue.getValue(); - } - - void Decimal::setValue( DecimalType value ) - { - myValue.setValue( value ); - } - - bool Decimal::parse( const std::string& value ) - { - std::stringstream ss( value ); - DecimalType temp = 0; - if ( ( ss >> temp ).fail() || !( ss >> std::ws ).eof()) - { - return false; - } - setValue( temp ); - return true; - } - - std::string Decimal::toString() const - { - return myValue.toString(); - } - - - std::ostream& Decimal::toStream( std::ostream& os ) const - { - return myValue.toStream( os ); - } - - - std::string toString( const Decimal& value, unsigned int precision ) - { - MX_UNUSED( precision ); - return value.toString(); - } - - - std::ostream& toStream( std::ostream& os, const Decimal& value, unsigned int precision ) - { - MX_UNUSED( precision ); - return value.toStream( os ); - } - - std::string toString( const Decimal& value, unsigned short precision ) - { - MX_UNUSED( precision ); - return value.toString(); - } - - std::ostream& toStream( std::ostream& os, const Decimal& value, unsigned short precision ) - { - MX_UNUSED( precision ); - return value.toStream( os ); - } - - std::ostream& operator<<( std::ostream& os, const Decimal& value ) - { - return value.toStream( os ); - } - - DecimalType minExclusive( DecimalType min, DecimalType val ) - { - if( val <= min ) - { - return min + NON_ZERO_AMOUNT; - } - - return val; - } - - DecimalType minInclusive( DecimalType min, DecimalType val ) - { - if( val < min ) - { - return min; - } - - return val; - } - - DecimalType maxExclusive( DecimalType max, DecimalType val ) - { - if( val >= max ) - { - return max - NON_ZERO_AMOUNT; - } - - return val; - } - - DecimalType maxInclusive( DecimalType max, DecimalType val ) - { - if( val > max ) - { - return max; - } - - return val; - } - - DecimalType noOp( DecimalType value ) - { - return value; - } - - DecimalRange::DecimalRange( DecimalClamp min, DecimalClamp max, DecimalType value ) - : Decimal{ min( max( value ) ) } - , myMinClamp{ min } - , myMaxClamp{ max } - { - - } - - void DecimalRange::setValue( DecimalType value ) - { - Decimal::setValue( myMinClamp( myMaxClamp( value ) ) ); - } - -#define MXMINEX( minbound ) DecimalClamp( []( DecimalType value ){ return minExclusive( minbound, value ); } ) -#define MXMAXEX( maxbound ) DecimalClamp( []( DecimalType value ){ return maxExclusive( maxbound, value ); } ) -#define MXMININ( minbound ) DecimalClamp( []( DecimalType value ){ return minInclusive( minbound, value ); } ) -#define MXMAXIN( maxbound ) DecimalClamp( []( DecimalType value ){ return maxInclusive( maxbound, value ); } ) -#define MX_NOOP DecimalClamp( noOp ) - - DivisionsValue::DivisionsValue( DecimalType value ) - : DecimalRange{ MX_NOOP, MX_NOOP, value } - { - - } - - DivisionsValue::DivisionsValue() - : DivisionsValue{ 0.0 } - { - - } - - MillimetersValue::MillimetersValue( DecimalType value ) - : DecimalRange{ MX_NOOP, MX_NOOP, value } - { - - } - - MillimetersValue::MillimetersValue() - : MillimetersValue{ 0.0 } - { - - } - - NonNegativeDecimal::NonNegativeDecimal( DecimalType value ) - : DecimalRange{ MXMININ( 0 ), MX_NOOP, value } - { - - } - - NonNegativeDecimal::NonNegativeDecimal() - : NonNegativeDecimal{ 0.0 } - { - - } - - Percent::Percent( DecimalType value ) - : DecimalRange{ MXMININ( 0 ), MXMAXIN( 100 ), value } - { - - } - - Percent::Percent() - : Percent{ 0.0 } - { - - } - - PositiveDecimal::PositiveDecimal( DecimalType value ) - : DecimalRange{ MXMINEX( 0 ), MX_NOOP, value } - { - - } - - PositiveDecimal::PositiveDecimal() - : PositiveDecimal{ 1 } - { - - } - - PositiveDivisions::PositiveDivisions( DecimalType value ) - : DecimalRange{ MXMINEX( 0 ), MX_NOOP, value } - { - - } - - PositiveDivisions::PositiveDivisions() - : PositiveDivisions{ 1 } - { - - } - - PositiveDivisionsValue::PositiveDivisionsValue( DecimalType value ) - : DecimalRange{ MXMINEX( 0 ), MX_NOOP, value } - { - - } - - PositiveDivisionsValue::PositiveDivisionsValue() - : PositiveDivisionsValue{ 1 } - { - - } - - RotationDegrees::RotationDegrees( DecimalType value ) - : DecimalRange{ MXMININ( -180 ), MXMAXIN( 180 ), value } - { - - } - - RotationDegrees::RotationDegrees() - : RotationDegrees{ 0.0 } - { - - } - - Semitones::Semitones( DecimalType value ) - : DecimalRange{ MX_NOOP, MX_NOOP, value } - { - - } - - Semitones::Semitones() - : Semitones{ 0.0 } - { - - } - - TenthsValue::TenthsValue( DecimalType value ) - : DecimalRange{ MX_NOOP, MX_NOOP, value } - { - - } - - TenthsValue::TenthsValue() - : TenthsValue{ 0.0 } - { - - } - - TrillBeats::TrillBeats( DecimalType value ) - : DecimalRange{ MXMININ( 2 ), MX_NOOP, value } - { - - } - - TrillBeats::TrillBeats() - : TrillBeats{ 2 } - { - - } - } -} diff --git a/Sourcecode/private/mx/core/Decimals.h b/Sourcecode/private/mx/core/Decimals.h deleted file mode 100644 index edde5e489..000000000 --- a/Sourcecode/private/mx/core/Decimals.h +++ /dev/null @@ -1,249 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include -#include -#include - -namespace mx -{ - namespace core - { - /// The type we use for non-integral numbers in this library. - using DecimalType = long double; - constexpr const DecimalType DecimalMin = std::numeric_limits::min(); - constexpr const DecimalType DecimalMax = std::numeric_limits::max(); - - /// Decimals will be rounded to this number of places. - constexpr const unsigned short DEFAULT_PRECISION = 6; - - /// When a Decimal's range is Exclusive and you try to assign a number - /// that is out-of-range, this amount will be added to the exclusive - /// minimum. For example if a Decimal is constrained to be a positive - /// number, and you try to assign the value 0, the value will be set to - /// NON_ZERO_AMOUNT instead. - constexpr const DecimalType NON_ZERO_AMOUNT = 0.000001; - - using DecimalType = long double; - - /// @brief A precision representation of a decimal number - /// - /// @detailed Represents a decimal number with precision. Clamps - /// if an attempt is made to assign an unrepresentable number. - /// Rounds input values to the given MaxDecimalDigits or if a - /// change in precision would lead to data loss. Precision can - /// be changed at runtime. A number such as 123.4567 would require - /// a minimum precision setting of MaxIntegerDigits = 3, - /// MaxDecimalDigits = 4. - /// - class PreciseDecimal - { - public: - PreciseDecimal( short inMaxIntegerDigits, short inMaxDecimalDigits, DecimalType inValue ); - PreciseDecimal( short inMaxIntegerDigits, short inMaxDecimalDigits ); - PreciseDecimal( DecimalType inValue); - PreciseDecimal(); - DecimalType getValue() const; - void setValue( DecimalType inValue ); - short getMaxIntegerDigits() const; - short getMaxDecimalDigits() const; - DecimalType getMaxExpressibleNumber() const; - DecimalType getMinExpressibleNumber() const; - std::ostream& toStream( std::ostream& os ) const; - std::string toString() const; - - private: - bool myIsNegative; - uint64_t myInteger; - uint64_t myDecimal; - short myMaxIntegerDigits; - short myMaxDecimalDigits; - uint64_t myMaxExpressibleInteger; - uint64_t myMaxExpressibleDecimal; - - private: - void setMaxIntegerDigits( short inNumDigits ); - void setMaxDecimalDigits( short inNumDigits ); - static decltype( myInteger ) findMax( short inNumDigits ); - void setMaxExpressibleInteger(); - void setMaxExpressibleDecimal(); - void setMaxExpressibleNumber(); - static DecimalType express( uint64_t inInteger, uint64_t inDecimal, short inMaxDecimalDigits, bool inIsNegative ); - - private: - static constexpr const short DEFAULT_MAX_INTEGER_DIGITS = 10; - static constexpr const short DEFAULT_MAX_DECIMAL_DIGITS = 6; - static constexpr const short MAX_STORAGE_TYPE_DIGITS = 19; - static constexpr const uint64_t MAX_STORAGE_TYPE_VALUE = 9999999999999999999ULL; - }; - - class Decimal - { - public: - Decimal(); - explicit Decimal( DecimalType value ); - virtual ~Decimal() = default; - Decimal( const Decimal& ) = default; - Decimal( Decimal&& ) = default; - Decimal& operator=( const Decimal& ) = default; - Decimal& operator=( Decimal&& ) = default; - DecimalType getValue() const; - virtual void setValue( DecimalType value ); - bool parse( const std::string& value ); - std::string toString() const; - std::ostream& toStream( std::ostream& os ) const; - private: - PreciseDecimal myValue; - }; - - std::string toString( const Decimal& value, unsigned short precision = DEFAULT_PRECISION ); - std::ostream& toStream( std::ostream& os, const Decimal& value, unsigned short precision = DEFAULT_PRECISION ); - std::ostream& operator<<( std::ostream& os, const Decimal& value ); - - /// This type is an implementation detail. It represent a function that - /// clamps a DecimalType to a range. - using DecimalClamp = std::function; - - /// A 'clamped', or 'ranged' Decimal where the value of min and max are - /// governed by the DecimalClamp functions. - class DecimalRange : public Decimal - { - public: - explicit DecimalRange( DecimalClamp min, DecimalClamp max, DecimalType value ); - virtual void setValue( DecimalType value ); - private: - DecimalClamp myMinClamp; - DecimalClamp myMaxClamp; - }; - - /// The divisions type is used to express values in terms of the musical divisions defined - /// by the divisions element. It is preferred that these be integer values both for MIDI - /// interoperability and to avoid roundoff errors. - /// - /// Range: min=None, max=None - class DivisionsValue : public DecimalRange - { - public: - explicit DivisionsValue( DecimalType value ); - DivisionsValue(); - }; - - /// The millimeters type is a number representing millimeters. This is used in the scaling - /// element to provide a default scaling from tenths to physical units. - /// - /// Range: min=None, max=None - class MillimetersValue : public DecimalRange - { - public: - explicit MillimetersValue( DecimalType value ); - MillimetersValue(); - }; - - /// The non-negative-decimal type specifies a non-negative decimal value. - /// - /// Range: min=Inclusive(0), max=None - class NonNegativeDecimal : public DecimalRange - { - public: - explicit NonNegativeDecimal( DecimalType value ); - NonNegativeDecimal(); - }; - - /// The percent type specifies a percentage from 0 to 100. - /// - /// Range: min=Inclusive(0), max=Inclusive(100) - class Percent : public DecimalRange - { - public: - explicit Percent( DecimalType value ); - Percent(); - }; - - /// The positive-decimal type specifies a positive decimal value. - /// - /// Range: min=Exclusive(0), max=None - class PositiveDecimal : public DecimalRange - { - public: - explicit PositiveDecimal( DecimalType value ); - PositiveDecimal(); - }; - - /// The positive-divisions type restricts divisions values to positive numbers. - /// - /// Range: min=Exclusive(0), max=None - class PositiveDivisions : public DecimalRange - { - public: - explicit PositiveDivisions( DecimalType value ); - PositiveDivisions(); - }; - - /// TODO - this needs to be properly generated - /// - /// Range: min=Exclusive(0), max=None - class PositiveDivisionsValue : public DecimalRange - { - public: - explicit PositiveDivisionsValue( DecimalType value ); - PositiveDivisionsValue(); - }; - - /// The rotation-degrees type specifies rotation, pan, and elevation values in degrees. - /// Values range from -180 to 180. - /// - /// Range: min=Inclusive(-180), max=Inclusive(180) - class RotationDegrees : public DecimalRange - { - public: - explicit RotationDegrees( DecimalType value ); - RotationDegrees(); - }; - - /// The semitones type is a number representing semitones, used for chromatic alteration. A - /// value of -1 corresponds to a flat and a value of 1 to a sharp. Decimal values like 0.5 - /// (quarter tone sharp) are used for microtones. - /// - /// Range: min=None, max=None - class Semitones : public DecimalRange - { - public: - explicit Semitones( DecimalType value ); - Semitones(); - }; - - /// The tenths type is a number representing tenths of interline staff space (positive or - /// negative). Both integer and decimal values are allowed, such as 5 for a half space and - /// 2.5 for a quarter space. Interline space is measured from the middle of a staff line. - /// - /// Distances in a MusicXML file are measured in tenths of staff space. Tenths are then - /// scaled to millimeters within the scaling element, used in the defaults element at the - /// start of a score. Individual staves can apply a scaling factor to adjust staff size. - /// When a MusicXML element or attribute refers to tenths, it means the global tenths - /// defined by the scaling element, not the local tenths as adjusted by the staff-size - /// element. - /// - /// Range: min=None, max=None - class TenthsValue : public DecimalRange - { - public: - explicit TenthsValue( DecimalType value ); - TenthsValue(); - }; - - /// The trill-beats type specifies the beats used in a trill-sound or bend-sound attribute - /// group. It is a decimal value with a minimum value of 2. - /// - /// Range: min=Inclusive(2), max=None - class TrillBeats : public DecimalRange - { - public: - explicit TrillBeats( DecimalType value ); - TrillBeats(); - }; - } -} diff --git a/Sourcecode/private/mx/core/Document.cpp b/Sourcecode/private/mx/core/Document.cpp deleted file mode 100644 index c369e54ca..000000000 --- a/Sourcecode/private/mx/core/Document.cpp +++ /dev/null @@ -1,184 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/Document.h" -#include "ezxml/XFactory.h" -#include "ezxml/XAttribute.h" -#include "ezxml/XElementIterator.h" -#include "ezxml/XAttributeIterator.h" -#include "mx/core/ScoreConversions.h" - -namespace mx -{ - namespace core - { - - DocumentPtr makeDocument() - { - return std::make_shared(); - } - - - DocumentPtr makeDocument( DocumentChoice choice ) - { - return std::make_shared( choice ); - } - - - Document::Document() - : myChoice( DEFAULT_DOCUMENT_CHOICE ) - , myScorePartwise( makeScorePartwise() ) - , myScoreTimewise( makeScoreTimewise() ) - { - - } - - - Document::Document( DocumentChoice choice ) - : myChoice( choice ) - , myScorePartwise( makeScorePartwise() ) - , myScoreTimewise( makeScoreTimewise() ) - { - - } - - - void Document::setChoice( DocumentChoice choice ) - { - myChoice = choice; - } - - - DocumentChoice Document::getChoice() const - { - return myChoice; - } - - - void Document::convertContents() - { - switch ( myChoice ) - { - case DocumentChoice::partwise: - { - myScoreTimewise = partwiseTimewise( myScorePartwise ); - myScorePartwise = makeScorePartwise(); - myChoice = DocumentChoice::timewise; - } - break; - case DocumentChoice::timewise: - { - myScorePartwise = timewisePartwise( myScoreTimewise ); - myScoreTimewise = makeScoreTimewise(); - myChoice = DocumentChoice::partwise; - } - break; - default: - break; - } - } - - - ScorePartwisePtr Document::getScorePartwise() const - { - return myScorePartwise; - } - - - void Document::setScorePartwise( const ScorePartwisePtr& value ) - { - if( value ) - { - myScorePartwise = value; - } - } - - - ScoreTimewisePtr Document::getScoreTimewise() const - { - return myScoreTimewise; - } - - - void Document::setScoreTimewise( const ScoreTimewisePtr& value ) - { - if( value ) - { - myScoreTimewise = value; - } - } - - - std::ostream& Document::toStream( std::ostream& os ) const - { - os << DEFAULT_XML_DECLARATION << std::endl; - switch ( myChoice ) - { - case DocumentChoice::partwise: - { - os << "" << std::endl; - myScorePartwise->toStream( os, 0 ); - } - break; - case DocumentChoice::timewise: - { - os << "" << std::endl; - myScoreTimewise->toStream( os, 0 ); - } - break; - default: - MX_THROW( "myChoice had a bad value" ) - } - return os; - } - - - void Document::toXDoc( ::ezxml::XDoc& outXDoc ) const - { - std::stringstream ss; - toStream( ss ); - std::istringstream is( ss.str() ); - - outXDoc.loadStream( is ); - switch ( myChoice ) - { - case DocumentChoice::partwise: - { - outXDoc.setDoctypeValue( DOCTYPE_VALUE_SCORE_PARTWISE ); - } - break; - case DocumentChoice::timewise: - { - outXDoc.setDoctypeValue( DOCTYPE_VALUE_SCORE_TIMEWISE ); - } - break; - default: - MX_THROW( "myChoice had a bad value" ) - } - } - - - bool Document::fromXDoc( std::ostream& messages, const ::ezxml::XDoc& inXDoc ) - { - auto root = inXDoc.getRoot(); - if( inXDoc.getRoot()->getName() == "score-partwise" ) - { - myChoice = DocumentChoice::partwise; - myScorePartwise = makeScorePartwise(); - return myScorePartwise->fromXElement( messages, *root ); - } - else if( inXDoc.getRoot()->getName() == "score-timewise" ) - { - myChoice = DocumentChoice::timewise; - myScoreTimewise = makeScoreTimewise(); - return myScoreTimewise->fromXElement( messages, *root ); - } - else - { - MX_THROW( "bad input - could not find the score-timewise or score-partwise node" ); - } - } - - } -} diff --git a/Sourcecode/private/mx/core/Document.h b/Sourcecode/private/mx/core/Document.h deleted file mode 100644 index 403e674b1..000000000 --- a/Sourcecode/private/mx/core/Document.h +++ /dev/null @@ -1,94 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include -#include "mx/core/Elements.h" - -// Forward Declarations ///////////////////////////////////////////////////// - -namespace ezxml -{ - class XDoc; - using XDocPtr = std::shared_ptr; -} - -namespace mx -{ - namespace core - { - class Document; - using DocumentPtr = std::shared_ptr; - - class ScorePartwise; - using ScorePartwisePtr = std::shared_ptr; - - class ScoreTimewise; - using ScoreTimewisePtr = std::shared_ptr; - } - -//////////////////////////////////////////////////////////////////////////// - - namespace core - { - constexpr const char* const DEFAULT_XML_DECLARATION = ""; - constexpr const char* const DOCTYPE_VALUE_SCORE_PARTWISE = "score-partwise PUBLIC \"-//Recordare//DTD MusicXML 3.0 Partwise//EN\" \"http://www.musicxml.org/dtds/partwise.dtd\""; - constexpr const char* const DOCTYPE_VALUE_SCORE_TIMEWISE = "score-timewise PUBLIC \"-//Recordare//DTD MusicXML 3.0 Timewise//EN\" \"http://www.musicxml.org/dtds/timewise.dtd\""; - - enum class DocumentChoice - { - partwise, - timewise - }; - - constexpr const DocumentChoice DEFAULT_DOCUMENT_CHOICE = DocumentChoice::partwise; - - DocumentPtr makeDocument(); - DocumentPtr makeDocument( DocumentChoice choice ); - - class Document - { - public: - Document(); - Document( DocumentChoice choice ); - - // indicates which type of musicxml document is held - // setting the choice does not alter the contents of - // ScorePartwise or ScoreTimewise object, is just - // indicates which object is being used and which - // object will be written during toStream/toXDoc - void setChoice( DocumentChoice choice ); - DocumentChoice getChoice() const; - - // switches the DocumentChoice from partwise to - // timewise or vice versa and converts the contents - // over to the new type. For example if choice is - // currently partwise and there is data in the - // ScorePartwise object, the choice will be changed - // to timewise, the ScoreTimewise object will be - // populated from the contents of ScorePartwise, - // and ScorePartwise will become empty - void convertContents(); - - // you should use these functions if choice == partwise - ScorePartwisePtr getScorePartwise() const; - void setScorePartwise( const ScorePartwisePtr& value ); - - // you should use these functions if choice == timewise - ScoreTimewisePtr getScoreTimewise() const; - void setScoreTimewise( const ScoreTimewisePtr& value ); - - std::ostream& toStream( std::ostream& os ) const; - void toXDoc( ::ezxml::XDoc& outXDoc ) const; - bool fromXDoc( std::ostream& messages, const ::ezxml::XDoc& inXDoc ); - - private: - DocumentChoice myChoice; - ScorePartwisePtr myScorePartwise; - ScoreTimewisePtr myScoreTimewise; - }; - } -} diff --git a/Sourcecode/private/mx/core/DocumentHeader.cpp b/Sourcecode/private/mx/core/DocumentHeader.cpp deleted file mode 100644 index 8a07c5e00..000000000 --- a/Sourcecode/private/mx/core/DocumentHeader.cpp +++ /dev/null @@ -1,156 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/DocumentHeader.h" - -namespace mx -{ - namespace core - { - std::ostream& stream( std::ostream& os, const DocumentType value ) - { - switch ( value ) - { - case DocumentType::partwise: - { - os << "score-partwise"; - } - break; - case DocumentType::timewise: - { - os << "score-timewise"; - } - break; - default: - break; - } - return os; - } - - std::ostream& stream( std::ostream& os, const XmlVersion value ) - { - switch ( value ) - { - case XmlVersion::onePointZero: - { - os << "1.0"; - } - break; - default: - break; - } - return os; - } - - std::ostream& stream( std::ostream& os, const DocumentEncoding value ) - { - switch ( value ) - { - case DocumentEncoding::utfEight: - { - os << "UTF-8"; - } - break; - default: - break; - } - return os; - } - - std::ostream& stream( std::ostream& os, const MusicXmlVersion value ) - { - switch ( value ) - { - case MusicXmlVersion::ThreePointZero: - { - os << "3.0"; - } - break; - default: - break; - } - return os; - } - -#ifndef _MSC_VER /* Visual Studio Doesn't implement contexpr */ - constexpr -#endif - DocumentSpecifications::DocumentSpecifications() - :xmlVersion( kDefaultXmlVersion ) - ,documentEncoding( kDefaultDocumentEncoding ) - ,documentType( kDefaultDocumentType ) - ,musicXmlVersion( kDefaultMusicXmlVersion ) - {} - - DocumentHeader::DocumentHeader() - :mySpecs( DocumentSpecifications{} ) - {} - - DocumentHeader::~DocumentHeader() {} - - DocumentHeader::DocumentHeader( const DocumentSpecifications& specs ) - :mySpecs( specs ) - {} - - DocumentType DocumentHeader::getDocumentType() const - { - return mySpecs.documentType; - } - - void DocumentHeader::setDocumentType( const DocumentType value ) - { - mySpecs.documentType = value; - } - - std::ostream& DocumentHeader::toStream( std::ostream& os ) const - { - os << R"()"; - os << std::endl; - - os << R"()"; - return os; - } - - DocumentHeaderPtr makeDocumentHeader() - { - return std::make_shared(); - } - DocumentHeaderPtr makeDocumentHeader( const DocumentSpecifications& specs ) - { - return std::make_shared( specs ); - } - } -} diff --git a/Sourcecode/private/mx/core/DocumentHeader.h b/Sourcecode/private/mx/core/DocumentHeader.h deleted file mode 100644 index c32b38b77..000000000 --- a/Sourcecode/private/mx/core/DocumentHeader.h +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include - -namespace mx -{ - namespace core - { - enum class DocumentType - { - partwise = 1, - timewise = 2 - }; -#ifndef _MSC_VER /* Visual Studio Doesn't implement contexpr */ - constexpr -#endif - const DocumentType kDefaultDocumentType = DocumentType::partwise; - std::ostream& stream( std::ostream& os, const DocumentType value ); - - enum class XmlVersion - { - onePointZero = 1 - }; -#ifndef _MSC_VER /* Visual Studio Doesn't implement contexpr */ - constexpr -#endif - const XmlVersion kDefaultXmlVersion = XmlVersion::onePointZero; - std::ostream& stream( std::ostream& os, const XmlVersion value ); - - enum class DocumentEncoding - { - utfEight = 1 - }; -#ifndef _MSC_VER /* Visual Studio Doesn't implement contexpr */ - constexpr -#endif - const DocumentEncoding kDefaultDocumentEncoding = DocumentEncoding::utfEight; - std::ostream& stream( std::ostream& os, const DocumentEncoding value ); - - enum class MusicXmlVersion - { - ThreePointZero = 1 - }; -#ifndef _MSC_VER /* Visual Studio Doesn't implement contexpr */ - constexpr -#endif - const MusicXmlVersion kDefaultMusicXmlVersion = MusicXmlVersion::ThreePointZero; - std::ostream& stream( std::ostream& os, const MusicXmlVersion value ); - - struct DocumentSpecifications - { -#ifndef _MSC_VER /* Visual Studio Doesn't implement contexpr */ - constexpr -#endif - DocumentSpecifications(); - XmlVersion xmlVersion; - DocumentEncoding documentEncoding; - DocumentType documentType; - MusicXmlVersion musicXmlVersion; - }; - - /* this class is basically a stub - it could come in handy for forward - compatibility later */ - class DocumentHeader; - using DocumentHeaderPtr = std::shared_ptr; - DocumentHeaderPtr makeDocumentHeader(); - DocumentHeaderPtr makeDocumentHeader( const DocumentSpecifications& specs ); - - class DocumentHeader - { - public: - DocumentHeader(); - DocumentHeader( const DocumentSpecifications& specs ); - virtual ~DocumentHeader(); - virtual std::ostream& toStream( std::ostream& os ) const; - // XmlVersion getXmlVersion() const; - // void setXmlVersion( const XmlVersion value ); - // DocumentEncoding getDocumentEncoding() const; - // void setDocumentEncoding( const DocumentEncoding value ); - DocumentType getDocumentType() const; - void setDocumentType( const DocumentType value ); - private: - DocumentSpecifications mySpecs; - }; - - } -} diff --git a/Sourcecode/private/mx/core/DocumentSpec.cpp b/Sourcecode/private/mx/core/DocumentSpec.cpp deleted file mode 100644 index f02c0cc69..000000000 --- a/Sourcecode/private/mx/core/DocumentSpec.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/DocumentSpec.h" -#include "mx/utility/Parse.h" -#include "mx/core/UnusedParameter.h" -#include - -namespace mx -{ - namespace core - { - std::ostream& toStream( std::ostream& os, const DocumentChoice value ) - { - switch ( value ) - { - case DocumentChoice::partwise: - os << "partwise"; - break; - case DocumentChoice::timewise: - os << "timewise"; - default: - os << "error"; - break; - } - return os; - } - - - std::string toString( const DocumentChoice value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - - DocumentChoice parseDocumentChoice( const std::string& str ) - { - if( utility::compareCaseInsensitive( str, "partwise" ) ) - { - return DocumentChoice::partwise; - } - else if ( utility::compareCaseInsensitive( str, "timewise" ) ) - { - return DocumentChoice::timewise; - } - return DEFAULT_DOCUMENT_CHOICE; - } - - - std::ostream& toStream( std::ostream& os, const MusicXmlVersion value ) - { - switch ( value ) - { - case MusicXmlVersion::unknown: - os << "unknown"; - break; - case MusicXmlVersion::threePointZero: - os << "3.0"; - default: - os << "error"; - break; - } - return os; - } - - - std::string toString( const MusicXmlVersion value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - - MusicXmlVersion parseMusicXmlVersion( const std::string& str ) - { - if( utility::compareCaseInsensitive( str, "3.0" ) ) - { - return MusicXmlVersion::threePointZero; - } - return DEFAULT_MUSIC_XML_VERSION; - } - - - std::ostream& toStream( std::ostream& os, const SpecificationType value ) - { - switch ( value ) - { - case SpecificationType::unknown: - os << "unknown"; - break; - case SpecificationType::dtd: - os << "dtd"; - case SpecificationType::xsd: - os << "xsd"; - default: - os << "error"; - break; - } - return os; - } - - - std::string toString( const SpecificationType value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - - SpecificationType parseSpecificationType( const std::string& str ) - { - if( utility::compareCaseInsensitive( str, "dtd" ) ) - { - return SpecificationType::dtd; - } - else if( utility::compareCaseInsensitive( str, "xsd" ) ) - { - return SpecificationType::dtd; - } - return DEFAULT_SPECIFICATION_TYPE; - } - - - DocumentSpec::DocumentSpec() - // : xmlVersion( DEFAULT_XML_VERSION ) - //, encoding( DEFAULT_ENCODING ) - //, documentChoice( DEFAULT_DOCUMENT_CHOICE ) - //, musicXmlVersion( DEFAULT_MUSIC_XML_VERSION ) - { - - } - - - DocumentSpec parseDocumentSpec( const ::ezxml::XDocCPtr& doc ) - { - MX_UNUSED( doc ); - throw std::runtime_error( "not implemented" ); - } - } -} diff --git a/Sourcecode/private/mx/core/DocumentSpec.h b/Sourcecode/private/mx/core/DocumentSpec.h deleted file mode 100644 index 99f689233..000000000 --- a/Sourcecode/private/mx/core/DocumentSpec.h +++ /dev/null @@ -1,70 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include -#include - -namespace ezxml -{ - class XDoc; - using XDocCPtr = std::shared_ptr; -} - -namespace mx -{ - namespace core - { - - enum DocumentChoice - { - partwise, - timewise - }; - - const DocumentChoice DEFAULT_DOCUMENT_CHOICE = DocumentChoice::partwise; - std::ostream& toStream( std::ostream& os, const DocumentChoice value ); - std::string toString( const DocumentChoice value ); - DocumentChoice parseDocumentChoice( const std::string& str ); - - - - enum class MusicXmlVersion - { - unknown, - threePointZero - }; - - const MusicXmlVersion DEFAULT_MUSIC_XML_VERSION = MusicXmlVersion::threePointZero; - std::ostream& toStream( std::ostream& os, const MusicXmlVersion value ); - std::string toString( const MusicXmlVersion value ); - MusicXmlVersion parseMusicXmlVersion( const std::string& str ); - - enum class SpecificationType - { - unknown, - dtd, - xsd - }; - - const SpecificationType DEFAULT_SPECIFICATION_TYPE = SpecificationType::xsd; - std::ostream& toStream( std::ostream& os, const SpecificationType value ); - std::string toString( const SpecificationType value ); - SpecificationType parseSpecificationType( const std::string& str ); - - struct DocumentSpec - { - DocumentSpec(); - //XmlVersion xmlVersion; - //Encoding encoding; - DocumentChoice documentChoice; - MusicXmlVersion musicXmlVersion; - }; - - DocumentSpec parseDocumentSpec( const ::ezxml::XDocCPtr& doc ); - - } -} diff --git a/Sourcecode/private/mx/core/ElementInterface.cpp b/Sourcecode/private/mx/core/ElementInterface.cpp deleted file mode 100644 index 6c11eec25..000000000 --- a/Sourcecode/private/mx/core/ElementInterface.cpp +++ /dev/null @@ -1,322 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/ElementInterface.h" -#include "ezxml/XElement.h" -#include "ezxml/XElementIterator.h" -#include "ezxml/XFactory.h" -#include - -namespace mx -{ - namespace core - { - const char* INDENT = " "; - - ElementInterface::ElementInterface() - { - - } - - ElementInterface::~ElementInterface() - { - - } - - - std::ostream& ElementInterface::streamOpenTag( std::ostream& os ) const - { - os << "<"; - this->streamName( os ); - if ( hasAttributes() ) - { - streamAttributes( os ); - } - os << ">"; - return os; - } - - - std::ostream& ElementInterface::streamCloseTag( std::ostream& os ) const - { - os << "streamName( os ); - os << ">"; - return os; - } - - - std::ostream& ElementInterface::streamSelfCloseTag( std::ostream& os ) const - { - os << "<"; - this->streamName( os ); - if ( hasAttributes() ) - { - streamAttributes( os ); - } - os << "/>"; - return os; - } - bool ElementInterface::hasContents() const - { - std::stringstream ss; - bool discard; - streamContents( ss, 0, discard ); - return ( ss.str() ).length() > 0; - } - - - std::ostream& ElementInterface::toStream( std::ostream& os, const int indentLevel ) const - { - indent( os, indentLevel ); - - if( myProcessingInstructions.empty() ) - { - return streamWithoutProcessingInstructions( os, indentLevel ); - } - else - { - std::stringstream ss; - streamWithoutProcessingInstructions( ss, 0 ); - const auto xml = ss.str(); - std::istringstream iss{ xml }; - const auto xdoc = ::ezxml::XFactory::makeXDoc(); - xdoc->loadStream( iss ); - const auto root = xdoc->getRoot(); - const bool hasChildren = root->getType() == ::ezxml::XElementType::element && root->begin() != root->end(); - streamWithProcessingInstructions( os, indentLevel, hasChildren ); - } - - return os; - } - - - const std::string ElementInterface::getElementName() const - { - std::stringstream ss; - this->streamName( ss ); - return ss.str(); - } - - - std::ostream& indent( std::ostream& os, const int indentLevel ) - { - for ( int i = 0; i < indentLevel; ++i ) - { - os << INDENT; - } - return os; - } - - - bool ElementInterface::hasAttributes() const - { - return false; - } - - - bool ElementInterface::fromXElement( std::ostream& message, ::ezxml::XElement& xelement ) - { - if( xelement.getIsProcessingInstruction() ) - { - const auto next = xelement.getNextSibling(); - - if( next ) - { - return this->fromXElement( message, *next ); - } - } - - const bool result = this->fromXElementImpl( message, xelement ); - - // check for processing instructions - - if( xelement.getType() == ezxml::XElementType::element ) - { - auto childIter = xelement.beginWithProcessingInstructions(); - const auto childEnd = xelement.end(); - - while( childIter != childEnd && childIter->getIsProcessingInstruction() ) - { - // inexplicably, the following line caused a bad address crash on msvc - // ProcessingInstruction pi{ childIter->getName(), childIter->getValue() }; - // surely this is an msvc compiler bug? prove me wrong. anyway, we store - // the getName() and getValue() results in short-lived variables to work - // around the windows issue. - auto name = childIter->getName(); - auto value = childIter->getValue(); - ProcessingInstruction pi{ name, value }; - pi.setIsChild( true ); - addProcessingInstruction( std::move( pi ) ); - ++childIter; - } - } - - auto lookahead = xelement.getNextSibling(); - - while( lookahead != nullptr && lookahead->getIsProcessingInstruction() ) - { - ProcessingInstruction pi{ lookahead->getName(), lookahead->getValue() }; - pi.setIsChild( false ); - addProcessingInstruction( std::move( pi ) ); - lookahead = lookahead->getNextSibling(); - } - - return result; - } - - - const ProcessingInstructions& ElementInterface::getProcessingInstructions() const - { - return myProcessingInstructions; - } - - - void ElementInterface::clearProcessingInstructions() - { - myProcessingInstructions.clear(); - } - - - void ElementInterface::addProcessingInstruction( ProcessingInstruction inProcessingInstruction ) - { - myProcessingInstructions.emplace_back( std::move( inProcessingInstruction ) ); - } - - - std::ostream& operator<<( std::ostream& os, const ElementInterface& value ) - { - return value.toStream( os, 0 ); - } - - - std::ostream& ElementInterface::writeChildProcessingInstructions( std::ostream& os, const int indentLevel ) const - { - bool isFirst = true; - - for( const auto& pi : myProcessingInstructions ) - { - if( pi.getIsChild() ) - { - if (!isFirst) - { - os << std::endl; - } - indent( os, indentLevel + 1 ); - pi.toStream( os ); - isFirst = false; - } - } - - return os; - } - - - std::ostream& ElementInterface::writeSiblingProcessingInstructions( std::ostream& os, const int indentLevel ) const - { - bool isFirst = true; - - for( const auto& pi : myProcessingInstructions ) - { - if( !pi.getIsChild() ) - { - if (!isFirst) - { - os << std::endl; - } - indent( os, indentLevel ); - pi.toStream( os ); - isFirst = false; - } - } - - return os; - } - - - std::ostream& ElementInterface::writeAllProcessingInstructions( std::ostream& os, const int indentLevel ) const - { - bool isFirst = true; - - for( const auto& pi : myProcessingInstructions ) - { - if (!isFirst) - { - os << std::endl; - } - indent( os, indentLevel ); - pi.toStream( os ); - isFirst = false; - } - - return os; - } - - - std::ostream& ElementInterface::streamWithoutProcessingInstructions( std::ostream& os, const int indentLevel ) const - { - const bool isSelfClosing = !hasContents(); - - if ( !isSelfClosing ) - { - streamOpenTag( os ); - bool isOneLineOnly = false; - streamContents( os, indentLevel, isOneLineOnly ); - if ( !isOneLineOnly ) - { - indent( os, indentLevel ); - } - streamCloseTag( os ); - } - else - { - streamSelfCloseTag( os ); - } - return os; - } - - - std::ostream& ElementInterface::streamWithProcessingInstructions( std::ostream& os, const int indentLevel, const bool inHasChildren ) const - { - const bool isSelfClosing = !hasContents(); - - if ( !isSelfClosing ) - { - streamOpenTag( os ); - bool isOneLineOnly = false; - - if( inHasChildren ) - { - writeChildProcessingInstructions( os, indentLevel ); - } - - streamContents( os, indentLevel, isOneLineOnly ); - - if ( !isOneLineOnly ) - { - indent( os, indentLevel ); - } - streamCloseTag( os ); - - if( inHasChildren ) - { - os << std::endl; - writeSiblingProcessingInstructions( os, indentLevel ); - } - else - { - os << std::endl; - writeAllProcessingInstructions( os, indentLevel ); - } - } - else - { - streamSelfCloseTag( os ); - os << std::endl; - writeAllProcessingInstructions( os, indentLevel ); - } - return os; - } - } -} diff --git a/Sourcecode/private/mx/core/ElementInterface.h b/Sourcecode/private/mx/core/ElementInterface.h deleted file mode 100644 index 3c25364c5..000000000 --- a/Sourcecode/private/mx/core/ElementInterface.h +++ /dev/null @@ -1,64 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include -#include "mx/core/UnusedParameter.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/ProcessingInstruction.h" - -namespace ezxml -{ - class XElement; -} - -namespace mx -{ - namespace core - { - // This will be used by toStream to indent the XML tree - extern const char* INDENT; - - class ElementInterface; - using ElementPtr = std::shared_ptr; - using ElementUPtr = std::unique_ptr; - - class ElementInterface - { - public: - ElementInterface(); - virtual ~ElementInterface(); - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const = 0; - virtual std::ostream& streamName( std::ostream& os ) const = 0; - virtual bool hasContents() const = 0; // if this returns false then self-closing tag will be created - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const = 0; - virtual std::ostream& streamOpenTag( std::ostream& os ) const; - virtual std::ostream& streamCloseTag( std::ostream& os ) const; - virtual std::ostream& streamSelfCloseTag( std::ostream& os ) const; - virtual std::ostream& toStream( std::ostream& os, const int indentLevel ) const; - virtual const std::string getElementName() const; - virtual bool fromXElement( std::ostream& message, ezxml::XElement& xelement ) final; - virtual const ProcessingInstructions& getProcessingInstructions() const final; - virtual void clearProcessingInstructions() final; - virtual void addProcessingInstruction( ProcessingInstruction inProcessingInstruction ) final; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) = 0; - - private: - ProcessingInstructions myProcessingInstructions; - std::ostream& writeChildProcessingInstructions( std::ostream& os, const int indentLevel ) const; - std::ostream& writeSiblingProcessingInstructions( std::ostream& os, const int indentLevel ) const; - std::ostream& writeAllProcessingInstructions( std::ostream& os, const int indentLevel ) const; - std::ostream& streamWithoutProcessingInstructions( std::ostream& os, const int indentLevel ) const; - std::ostream& streamWithProcessingInstructions( std::ostream& os, const int indentLevel, const bool inHasChildren ) const; - }; - - std::ostream& indent( std::ostream& os, const int indentLevel ); - std::ostream& operator<<( std::ostream& os, const ElementInterface& value ); - } -} diff --git a/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.cpp b/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.cpp deleted file mode 100644 index 6521a894a..000000000 --- a/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" -#include "mx/core/FromXElement.h" - -namespace mx -{ - namespace core - { - EmptyPrintObjectStyleAlignAttributes::EmptyPrintObjectStyleAlignAttributes() - :printObject( YesNo::yes ) - ,defaultX( 0.0 ) - ,defaultY( 0.0 ) - ,relativeX( 0.0 ) - ,relativeY( 0.0 ) - ,fontFamily( "" ) - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::bold ) - ,color( 255, 255, 255 ) - ,halign( LeftCenterRight::center ) - ,valign( Valign::top ) - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - {} - - - bool EmptyPrintObjectStyleAlignAttributes::hasValues() const - { - return hasPrintObject - || hasDefaultX - || hasDefaultY - || hasRelativeX - || hasRelativeY - || hasFontFamily - || hasFontStyle - || hasFontSize - || hasFontWeight - || hasColor - || hasHalign - || hasValign; - } - - - std::ostream& EmptyPrintObjectStyleAlignAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - } - return os; - } - - - bool EmptyPrintObjectStyleAlignAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "EmptyPrintObjectStyleAlignAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - - } - - - MX_RETURN_IS_SUCCESS; - } - } -} diff --git a/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.h b/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.h deleted file mode 100644 index 1001e67b2..000000000 --- a/Sourcecode/private/mx/core/EmptyPrintObjectStyleAlignAttributes.h +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Color.h" - -namespace mx -{ - namespace core - { - struct EmptyPrintObjectStyleAlignAttributes; - using EmptyPrintObjectStyleAlignAttributesPtr = std::shared_ptr; - - struct EmptyPrintObjectStyleAlignAttributes : public AttributesInterface - { - public: - EmptyPrintObjectStyleAlignAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; - - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/EndingNumber.h b/Sourcecode/private/mx/core/EndingNumber.h deleted file mode 100644 index ca22aa1ea..000000000 --- a/Sourcecode/private/mx/core/EndingNumber.h +++ /dev/null @@ -1,15 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/CommaSeparatedPositiveIntegers.h" - -namespace mx -{ - namespace core - { - using EndingNumber = CommaSeparatedListOfPositiveIntegers; - } -} diff --git a/Sourcecode/private/mx/core/Enums.cpp b/Sourcecode/private/mx/core/Enums.cpp deleted file mode 100644 index cbc51eaa1..000000000 --- a/Sourcecode/private/mx/core/Enums.cpp +++ /dev/null @@ -1,4165 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -// self -#include "mx/core/Enums.h" - -// std -#include - -namespace mx -{ - namespace core - { - /// AboveBelow ///////////////////////////////////////////////////////////////////////////// - - AboveBelow parseAboveBelow( const std::string& value ) - { - const auto opt = tryParseAboveBelow( value ); - return opt.value_or( AboveBelow::above ); - } - - std::optional tryParseAboveBelow( const std::string& value ) - { - if( value == "above" ) { return AboveBelow::above; } - else if( value == "below" ) { return AboveBelow::below; } - return std::optional{}; - } - - std::string toString( const AboveBelow value ) - { - switch ( value ) - { - case AboveBelow::above: { return "above"; } - case AboveBelow::below: { return "below"; } - default: break; - } - return "above"; - } - - std::ostream& toStream( std::ostream& os, const AboveBelow value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const AboveBelow value ) - { - return toStream( os, value ); - } - - /// AccidentalValue //////////////////////////////////////////////////////////////////////// - - AccidentalValue parseAccidentalValue( const std::string& value ) - { - const auto opt = tryParseAccidentalValue( value ); - return opt.value_or( AccidentalValue::sharp ); - } - - std::optional tryParseAccidentalValue( const std::string& value ) - { - if( value == "sharp" ) { return AccidentalValue::sharp; } - else if( value == "natural" ) { return AccidentalValue::natural; } - else if( value == "flat" ) { return AccidentalValue::flat; } - else if( value == "double-sharp" ) { return AccidentalValue::doubleSharp; } - else if( value == "sharp-sharp" ) { return AccidentalValue::sharpSharp; } - else if( value == "flat-flat" ) { return AccidentalValue::flatFlat; } - else if( value == "natural-sharp" ) { return AccidentalValue::naturalSharp; } - else if( value == "natural-flat" ) { return AccidentalValue::naturalFlat; } - else if( value == "quarter-flat" ) { return AccidentalValue::quarterFlat; } - else if( value == "quarter-sharp" ) { return AccidentalValue::quarterSharp; } - else if( value == "three-quarters-flat" ) { return AccidentalValue::threeQuartersFlat; } - else if( value == "three-quarters-sharp" ) { return AccidentalValue::threeQuartersSharp; } - else if( value == "sharp-down" ) { return AccidentalValue::sharpDown; } - else if( value == "sharp-up" ) { return AccidentalValue::sharpUp; } - else if( value == "natural-down" ) { return AccidentalValue::naturalDown; } - else if( value == "natural-up" ) { return AccidentalValue::naturalUp; } - else if( value == "flat-down" ) { return AccidentalValue::flatDown; } - else if( value == "flat-up" ) { return AccidentalValue::flatUp; } - else if( value == "triple-sharp" ) { return AccidentalValue::tripleSharp; } - else if( value == "triple-flat" ) { return AccidentalValue::tripleFlat; } - else if( value == "slash-quarter-sharp" ) { return AccidentalValue::slashQuarterSharp; } - else if( value == "slash-sharp" ) { return AccidentalValue::slashSharp; } - else if( value == "slash-flat" ) { return AccidentalValue::slashFlat; } - else if( value == "double-slash-flat" ) { return AccidentalValue::doubleSlashFlat; } - else if( value == "sharp-1" ) { return AccidentalValue::sharp1; } - else if( value == "sharp-2" ) { return AccidentalValue::sharp2; } - else if( value == "sharp-3" ) { return AccidentalValue::sharp3; } - else if( value == "sharp-5" ) { return AccidentalValue::sharp5; } - else if( value == "flat-1" ) { return AccidentalValue::flat1; } - else if( value == "flat-2" ) { return AccidentalValue::flat2; } - else if( value == "flat-3" ) { return AccidentalValue::flat3; } - else if( value == "flat-4" ) { return AccidentalValue::flat4; } - else if( value == "sori" ) { return AccidentalValue::sori; } - else if( value == "koron" ) { return AccidentalValue::koron; } - return std::optional{}; - } - - std::string toString( const AccidentalValue value ) - { - switch ( value ) - { - case AccidentalValue::sharp: { return "sharp"; } - case AccidentalValue::natural: { return "natural"; } - case AccidentalValue::flat: { return "flat"; } - case AccidentalValue::doubleSharp: { return "double-sharp"; } - case AccidentalValue::sharpSharp: { return "sharp-sharp"; } - case AccidentalValue::flatFlat: { return "flat-flat"; } - case AccidentalValue::naturalSharp: { return "natural-sharp"; } - case AccidentalValue::naturalFlat: { return "natural-flat"; } - case AccidentalValue::quarterFlat: { return "quarter-flat"; } - case AccidentalValue::quarterSharp: { return "quarter-sharp"; } - case AccidentalValue::threeQuartersFlat: { return "three-quarters-flat"; } - case AccidentalValue::threeQuartersSharp: { return "three-quarters-sharp"; } - case AccidentalValue::sharpDown: { return "sharp-down"; } - case AccidentalValue::sharpUp: { return "sharp-up"; } - case AccidentalValue::naturalDown: { return "natural-down"; } - case AccidentalValue::naturalUp: { return "natural-up"; } - case AccidentalValue::flatDown: { return "flat-down"; } - case AccidentalValue::flatUp: { return "flat-up"; } - case AccidentalValue::tripleSharp: { return "triple-sharp"; } - case AccidentalValue::tripleFlat: { return "triple-flat"; } - case AccidentalValue::slashQuarterSharp: { return "slash-quarter-sharp"; } - case AccidentalValue::slashSharp: { return "slash-sharp"; } - case AccidentalValue::slashFlat: { return "slash-flat"; } - case AccidentalValue::doubleSlashFlat: { return "double-slash-flat"; } - case AccidentalValue::sharp1: { return "sharp-1"; } - case AccidentalValue::sharp2: { return "sharp-2"; } - case AccidentalValue::sharp3: { return "sharp-3"; } - case AccidentalValue::sharp5: { return "sharp-5"; } - case AccidentalValue::flat1: { return "flat-1"; } - case AccidentalValue::flat2: { return "flat-2"; } - case AccidentalValue::flat3: { return "flat-3"; } - case AccidentalValue::flat4: { return "flat-4"; } - case AccidentalValue::sori: { return "sori"; } - case AccidentalValue::koron: { return "koron"; } - default: break; - } - return "sharp"; - } - - std::ostream& toStream( std::ostream& os, const AccidentalValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const AccidentalValue value ) - { - return toStream( os, value ); - } - - /// ArrowDirectionEnum ///////////////////////////////////////////////////////////////////// - - ArrowDirectionEnum parseArrowDirectionEnum( const std::string& value ) - { - const auto opt = tryParseArrowDirectionEnum( value ); - return opt.value_or( ArrowDirectionEnum::left ); - } - - std::optional tryParseArrowDirectionEnum( const std::string& value ) - { - if( value == "left" ) { return ArrowDirectionEnum::left; } - else if( value == "up" ) { return ArrowDirectionEnum::up; } - else if( value == "right" ) { return ArrowDirectionEnum::right; } - else if( value == "down" ) { return ArrowDirectionEnum::down; } - else if( value == "northwest" ) { return ArrowDirectionEnum::northwest; } - else if( value == "northeast" ) { return ArrowDirectionEnum::northeast; } - else if( value == "southeast" ) { return ArrowDirectionEnum::southeast; } - else if( value == "southwest" ) { return ArrowDirectionEnum::southwest; } - else if( value == "left right" ) { return ArrowDirectionEnum::leftRight; } - else if( value == "up down" ) { return ArrowDirectionEnum::upDown; } - else if( value == "northwest southeast" ) { return ArrowDirectionEnum::northwestSoutheast; } - else if( value == "northeast southwest" ) { return ArrowDirectionEnum::northeastSouthwest; } - else if( value == "other" ) { return ArrowDirectionEnum::other; } - return std::optional{}; - } - - std::string toString( const ArrowDirectionEnum value ) - { - switch ( value ) - { - case ArrowDirectionEnum::left: { return "left"; } - case ArrowDirectionEnum::up: { return "up"; } - case ArrowDirectionEnum::right: { return "right"; } - case ArrowDirectionEnum::down: { return "down"; } - case ArrowDirectionEnum::northwest: { return "northwest"; } - case ArrowDirectionEnum::northeast: { return "northeast"; } - case ArrowDirectionEnum::southeast: { return "southeast"; } - case ArrowDirectionEnum::southwest: { return "southwest"; } - case ArrowDirectionEnum::leftRight: { return "left right"; } - case ArrowDirectionEnum::upDown: { return "up down"; } - case ArrowDirectionEnum::northwestSoutheast: { return "northwest southeast"; } - case ArrowDirectionEnum::northeastSouthwest: { return "northeast southwest"; } - case ArrowDirectionEnum::other: { return "other"; } - default: break; - } - return "left"; - } - - std::ostream& toStream( std::ostream& os, const ArrowDirectionEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ArrowDirectionEnum value ) - { - return toStream( os, value ); - } - - /// ArrowStyleEnum ///////////////////////////////////////////////////////////////////////// - - ArrowStyleEnum parseArrowStyleEnum( const std::string& value ) - { - const auto opt = tryParseArrowStyleEnum( value ); - return opt.value_or( ArrowStyleEnum::single ); - } - - std::optional tryParseArrowStyleEnum( const std::string& value ) - { - if( value == "single" ) { return ArrowStyleEnum::single; } - else if( value == "double" ) { return ArrowStyleEnum::double_; } - else if( value == "filled" ) { return ArrowStyleEnum::filled; } - else if( value == "hollow" ) { return ArrowStyleEnum::hollow; } - else if( value == "paired" ) { return ArrowStyleEnum::paired; } - else if( value == "combined" ) { return ArrowStyleEnum::combined; } - else if( value == "other" ) { return ArrowStyleEnum::other; } - return std::optional{}; - } - - std::string toString( const ArrowStyleEnum value ) - { - switch ( value ) - { - case ArrowStyleEnum::single: { return "single"; } - case ArrowStyleEnum::double_: { return "double"; } - case ArrowStyleEnum::filled: { return "filled"; } - case ArrowStyleEnum::hollow: { return "hollow"; } - case ArrowStyleEnum::paired: { return "paired"; } - case ArrowStyleEnum::combined: { return "combined"; } - case ArrowStyleEnum::other: { return "other"; } - default: break; - } - return "single"; - } - - std::ostream& toStream( std::ostream& os, const ArrowStyleEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ArrowStyleEnum value ) - { - return toStream( os, value ); - } - - /// BackwardForward //////////////////////////////////////////////////////////////////////// - - BackwardForward parseBackwardForward( const std::string& value ) - { - const auto opt = tryParseBackwardForward( value ); - return opt.value_or( BackwardForward::backward ); - } - - std::optional tryParseBackwardForward( const std::string& value ) - { - if( value == "backward" ) { return BackwardForward::backward; } - else if( value == "forward" ) { return BackwardForward::forward; } - return std::optional{}; - } - - std::string toString( const BackwardForward value ) - { - switch ( value ) - { - case BackwardForward::backward: { return "backward"; } - case BackwardForward::forward: { return "forward"; } - default: break; - } - return "backward"; - } - - std::ostream& toStream( std::ostream& os, const BackwardForward value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const BackwardForward value ) - { - return toStream( os, value ); - } - - /// BarStyleEnum /////////////////////////////////////////////////////////////////////////// - - BarStyleEnum parseBarStyleEnum( const std::string& value ) - { - const auto opt = tryParseBarStyleEnum( value ); - return opt.value_or( BarStyleEnum::regular ); - } - - std::optional tryParseBarStyleEnum( const std::string& value ) - { - if( value == "regular" ) { return BarStyleEnum::regular; } - else if( value == "dotted" ) { return BarStyleEnum::dotted; } - else if( value == "dashed" ) { return BarStyleEnum::dashed; } - else if( value == "heavy" ) { return BarStyleEnum::heavy; } - else if( value == "light-light" ) { return BarStyleEnum::lightLight; } - else if( value == "light-heavy" ) { return BarStyleEnum::lightHeavy; } - else if( value == "heavy-light" ) { return BarStyleEnum::heavyLight; } - else if( value == "heavy-heavy" ) { return BarStyleEnum::heavyHeavy; } - else if( value == "tick" ) { return BarStyleEnum::tick; } - else if( value == "short" ) { return BarStyleEnum::short_; } - else if( value == "none" ) { return BarStyleEnum::none; } - return std::optional{}; - } - - std::string toString( const BarStyleEnum value ) - { - switch ( value ) - { - case BarStyleEnum::regular: { return "regular"; } - case BarStyleEnum::dotted: { return "dotted"; } - case BarStyleEnum::dashed: { return "dashed"; } - case BarStyleEnum::heavy: { return "heavy"; } - case BarStyleEnum::lightLight: { return "light-light"; } - case BarStyleEnum::lightHeavy: { return "light-heavy"; } - case BarStyleEnum::heavyLight: { return "heavy-light"; } - case BarStyleEnum::heavyHeavy: { return "heavy-heavy"; } - case BarStyleEnum::tick: { return "tick"; } - case BarStyleEnum::short_: { return "short"; } - case BarStyleEnum::none: { return "none"; } - default: break; - } - return "regular"; - } - - std::ostream& toStream( std::ostream& os, const BarStyleEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const BarStyleEnum value ) - { - return toStream( os, value ); - } - - /// BeamValue ////////////////////////////////////////////////////////////////////////////// - - BeamValue parseBeamValue( const std::string& value ) - { - const auto opt = tryParseBeamValue( value ); - return opt.value_or( BeamValue::begin ); - } - - std::optional tryParseBeamValue( const std::string& value ) - { - if( value == "begin" ) { return BeamValue::begin; } - else if( value == "continue" ) { return BeamValue::continue_; } - else if( value == "end" ) { return BeamValue::end; } - else if( value == "forward hook" ) { return BeamValue::forwardHook; } - else if( value == "backward hook" ) { return BeamValue::backwardHook; } - return std::optional{}; - } - - std::string toString( const BeamValue value ) - { - switch ( value ) - { - case BeamValue::begin: { return "begin"; } - case BeamValue::continue_: { return "continue"; } - case BeamValue::end: { return "end"; } - case BeamValue::forwardHook: { return "forward hook"; } - case BeamValue::backwardHook: { return "backward hook"; } - default: break; - } - return "begin"; - } - - std::ostream& toStream( std::ostream& os, const BeamValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const BeamValue value ) - { - return toStream( os, value ); - } - - /// BeaterValue //////////////////////////////////////////////////////////////////////////// - - BeaterValue parseBeaterValue( const std::string& value ) - { - const auto opt = tryParseBeaterValue( value ); - return opt.value_or( BeaterValue::bow ); - } - - std::optional tryParseBeaterValue( const std::string& value ) - { - if( value == "bow" ) { return BeaterValue::bow; } - else if( value == "chime hammer" ) { return BeaterValue::chimeHammer; } - else if( value == "coin" ) { return BeaterValue::coin; } - else if( value == "finger" ) { return BeaterValue::finger; } - else if( value == "fingernail" ) { return BeaterValue::fingernail; } - else if( value == "fist" ) { return BeaterValue::fist; } - else if( value == "guiro scraper" ) { return BeaterValue::guiroScraper; } - else if( value == "hammer" ) { return BeaterValue::hammer; } - else if( value == "hand" ) { return BeaterValue::hand; } - else if( value == "jazz stick" ) { return BeaterValue::jazzStick; } - else if( value == "knitting needle" ) { return BeaterValue::knittingNeedle; } - else if( value == "metal hammer" ) { return BeaterValue::metalHammer; } - else if( value == "snare stick" ) { return BeaterValue::snareStick; } - else if( value == "spoon mallet" ) { return BeaterValue::spoonMallet; } - else if( value == "triangle beater" ) { return BeaterValue::triangleBeater; } - else if( value == "triangle beater plain" ) { return BeaterValue::triangleBeaterPlain; } - else if( value == "wire brush" ) { return BeaterValue::wireBrush; } - return std::optional{}; - } - - std::string toString( const BeaterValue value ) - { - switch ( value ) - { - case BeaterValue::bow: { return "bow"; } - case BeaterValue::chimeHammer: { return "chime hammer"; } - case BeaterValue::coin: { return "coin"; } - case BeaterValue::finger: { return "finger"; } - case BeaterValue::fingernail: { return "fingernail"; } - case BeaterValue::fist: { return "fist"; } - case BeaterValue::guiroScraper: { return "guiro scraper"; } - case BeaterValue::hammer: { return "hammer"; } - case BeaterValue::hand: { return "hand"; } - case BeaterValue::jazzStick: { return "jazz stick"; } - case BeaterValue::knittingNeedle: { return "knitting needle"; } - case BeaterValue::metalHammer: { return "metal hammer"; } - case BeaterValue::snareStick: { return "snare stick"; } - case BeaterValue::spoonMallet: { return "spoon mallet"; } - case BeaterValue::triangleBeater: { return "triangle beater"; } - case BeaterValue::triangleBeaterPlain: { return "triangle beater plain"; } - case BeaterValue::wireBrush: { return "wire brush"; } - default: break; - } - return "bow"; - } - - std::ostream& toStream( std::ostream& os, const BeaterValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const BeaterValue value ) - { - return toStream( os, value ); - } - - /// BreathMarkValue //////////////////////////////////////////////////////////////////////// - - BreathMarkValue parseBreathMarkValue( const std::string& value ) - { - const auto opt = tryParseBreathMarkValue( value ); - return opt.value_or( BreathMarkValue::emptystring ); - } - - std::optional tryParseBreathMarkValue( const std::string& value ) - { - if( value == "" ) { return BreathMarkValue::emptystring; } - else if( value == "comma" ) { return BreathMarkValue::comma; } - else if( value == "tick" ) { return BreathMarkValue::tick; } - return std::optional{}; - } - - std::string toString( const BreathMarkValue value ) - { - switch ( value ) - { - case BreathMarkValue::emptystring: { return ""; } - case BreathMarkValue::comma: { return "comma"; } - case BreathMarkValue::tick: { return "tick"; } - default: break; - } - return ""; - } - - std::ostream& toStream( std::ostream& os, const BreathMarkValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const BreathMarkValue value ) - { - return toStream( os, value ); - } - - /// CancelLocation ///////////////////////////////////////////////////////////////////////// - - CancelLocation parseCancelLocation( const std::string& value ) - { - const auto opt = tryParseCancelLocation( value ); - return opt.value_or( CancelLocation::left ); - } - - std::optional tryParseCancelLocation( const std::string& value ) - { - if( value == "left" ) { return CancelLocation::left; } - else if( value == "right" ) { return CancelLocation::right; } - else if( value == "before-barline" ) { return CancelLocation::beforeBarline; } - return std::optional{}; - } - - std::string toString( const CancelLocation value ) - { - switch ( value ) - { - case CancelLocation::left: { return "left"; } - case CancelLocation::right: { return "right"; } - case CancelLocation::beforeBarline: { return "before-barline"; } - default: break; - } - return "left"; - } - - std::ostream& toStream( std::ostream& os, const CancelLocation value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const CancelLocation value ) - { - return toStream( os, value ); - } - - /// CircularArrowEnum ////////////////////////////////////////////////////////////////////// - - CircularArrowEnum parseCircularArrowEnum( const std::string& value ) - { - const auto opt = tryParseCircularArrowEnum( value ); - return opt.value_or( CircularArrowEnum::clockwise ); - } - - std::optional tryParseCircularArrowEnum( const std::string& value ) - { - if( value == "clockwise" ) { return CircularArrowEnum::clockwise; } - else if( value == "anticlockwise" ) { return CircularArrowEnum::anticlockwise; } - return std::optional{}; - } - - std::string toString( const CircularArrowEnum value ) - { - switch ( value ) - { - case CircularArrowEnum::clockwise: { return "clockwise"; } - case CircularArrowEnum::anticlockwise: { return "anticlockwise"; } - default: break; - } - return "clockwise"; - } - - std::ostream& toStream( std::ostream& os, const CircularArrowEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const CircularArrowEnum value ) - { - return toStream( os, value ); - } - - /// ClefSign /////////////////////////////////////////////////////////////////////////////// - - ClefSign parseClefSign( const std::string& value ) - { - const auto opt = tryParseClefSign( value ); - return opt.value_or( ClefSign::g ); - } - - std::optional tryParseClefSign( const std::string& value ) - { - if( value == "G" ) { return ClefSign::g; } - else if( value == "F" ) { return ClefSign::f; } - else if( value == "C" ) { return ClefSign::c; } - else if( value == "percussion" ) { return ClefSign::percussion; } - else if( value == "TAB" ) { return ClefSign::tab; } - else if( value == "jianpu" ) { return ClefSign::jianpu; } - else if( value == "none" ) { return ClefSign::none; } - return std::optional{}; - } - - std::string toString( const ClefSign value ) - { - switch ( value ) - { - case ClefSign::g: { return "G"; } - case ClefSign::f: { return "F"; } - case ClefSign::c: { return "C"; } - case ClefSign::percussion: { return "percussion"; } - case ClefSign::tab: { return "TAB"; } - case ClefSign::jianpu: { return "jianpu"; } - case ClefSign::none: { return "none"; } - default: break; - } - return "G"; - } - - std::ostream& toStream( std::ostream& os, const ClefSign value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ClefSign value ) - { - return toStream( os, value ); - } - - /// CssFontSize //////////////////////////////////////////////////////////////////////////// - - CssFontSize parseCssFontSize( const std::string& value ) - { - const auto opt = tryParseCssFontSize( value ); - return opt.value_or( CssFontSize::xxSmall ); - } - - std::optional tryParseCssFontSize( const std::string& value ) - { - if( value == "xx-small" ) { return CssFontSize::xxSmall; } - else if( value == "x-small" ) { return CssFontSize::xSmall; } - else if( value == "small" ) { return CssFontSize::small; } - else if( value == "medium" ) { return CssFontSize::medium; } - else if( value == "large" ) { return CssFontSize::large; } - else if( value == "x-large" ) { return CssFontSize::xLarge; } - else if( value == "xx-large" ) { return CssFontSize::xxLarge; } - return std::optional{}; - } - - std::string toString( const CssFontSize value ) - { - switch ( value ) - { - case CssFontSize::xxSmall: { return "xx-small"; } - case CssFontSize::xSmall: { return "x-small"; } - case CssFontSize::small: { return "small"; } - case CssFontSize::medium: { return "medium"; } - case CssFontSize::large: { return "large"; } - case CssFontSize::xLarge: { return "x-large"; } - case CssFontSize::xxLarge: { return "xx-large"; } - default: break; - } - return "xx-small"; - } - - std::ostream& toStream( std::ostream& os, const CssFontSize value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const CssFontSize value ) - { - return toStream( os, value ); - } - - /// DegreeSymbolValue ////////////////////////////////////////////////////////////////////// - - DegreeSymbolValue parseDegreeSymbolValue( const std::string& value ) - { - const auto opt = tryParseDegreeSymbolValue( value ); - return opt.value_or( DegreeSymbolValue::major ); - } - - std::optional tryParseDegreeSymbolValue( const std::string& value ) - { - if( value == "major" ) { return DegreeSymbolValue::major; } - else if( value == "minor" ) { return DegreeSymbolValue::minor; } - else if( value == "augmented" ) { return DegreeSymbolValue::augmented; } - else if( value == "diminished" ) { return DegreeSymbolValue::diminished; } - else if( value == "half-diminished" ) { return DegreeSymbolValue::halfDiminished; } - return std::optional{}; - } - - std::string toString( const DegreeSymbolValue value ) - { - switch ( value ) - { - case DegreeSymbolValue::major: { return "major"; } - case DegreeSymbolValue::minor: { return "minor"; } - case DegreeSymbolValue::augmented: { return "augmented"; } - case DegreeSymbolValue::diminished: { return "diminished"; } - case DegreeSymbolValue::halfDiminished: { return "half-diminished"; } - default: break; - } - return "major"; - } - - std::ostream& toStream( std::ostream& os, const DegreeSymbolValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const DegreeSymbolValue value ) - { - return toStream( os, value ); - } - - /// DegreeTypeValue //////////////////////////////////////////////////////////////////////// - - DegreeTypeValue parseDegreeTypeValue( const std::string& value ) - { - const auto opt = tryParseDegreeTypeValue( value ); - return opt.value_or( DegreeTypeValue::add ); - } - - std::optional tryParseDegreeTypeValue( const std::string& value ) - { - if( value == "add" ) { return DegreeTypeValue::add; } - else if( value == "alter" ) { return DegreeTypeValue::alter; } - else if( value == "subtract" ) { return DegreeTypeValue::subtract; } - return std::optional{}; - } - - std::string toString( const DegreeTypeValue value ) - { - switch ( value ) - { - case DegreeTypeValue::add: { return "add"; } - case DegreeTypeValue::alter: { return "alter"; } - case DegreeTypeValue::subtract: { return "subtract"; } - default: break; - } - return "add"; - } - - std::ostream& toStream( std::ostream& os, const DegreeTypeValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const DegreeTypeValue value ) - { - return toStream( os, value ); - } - - /// DistanceTypeEnum /////////////////////////////////////////////////////////////////////// - - DistanceTypeEnum parseDistanceTypeEnum( const std::string& value ) - { - const auto opt = tryParseDistanceTypeEnum( value ); - return opt.value_or( DistanceTypeEnum::beam ); - } - - std::optional tryParseDistanceTypeEnum( const std::string& value ) - { - if( value == "beam" ) { return DistanceTypeEnum::beam; } - else if( value == "hyphen" ) { return DistanceTypeEnum::hyphen; } - else if( value == "other" ) { return DistanceTypeEnum::other; } - return std::optional{}; - } - - std::string toString( const DistanceTypeEnum value ) - { - switch ( value ) - { - case DistanceTypeEnum::beam: { return "beam"; } - case DistanceTypeEnum::hyphen: { return "hyphen"; } - default: break; - } - return "other"; - } - - std::ostream& toStream( std::ostream& os, const DistanceTypeEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const DistanceTypeEnum value ) - { - return toStream( os, value ); - } - - DistanceType::DistanceType( const DistanceTypeEnum value ) - : myEnum( value ) - , myCustomValue( "" ) - { - setValue( value ); - } - - DistanceType::DistanceType( const std::string& value ) - : myEnum( DistanceTypeEnum::other ) - , myCustomValue( value ) - { - setValue( value ); - } - - DistanceType::DistanceType() - : myEnum( DistanceTypeEnum::beam ) - , myCustomValue( "" ) - { - setValue( DistanceTypeEnum::beam ); - } - - DistanceTypeEnum DistanceType::getValue() const - { - return myEnum; - } - - std::string DistanceType::getValueString() const - { - if ( myEnum != DistanceTypeEnum::other ) - { - return toString( myEnum ); - } - - else - { - return myCustomValue; - } - } - - void DistanceType::setValue( const DistanceTypeEnum value ) - { - myEnum = value; - if( value != DistanceTypeEnum::other && !myCustomValue.empty() ) - { - myCustomValue = ""; - } - } - - void DistanceType::setValue( const std::string& value ) - { - const auto temp = tryParseDistanceTypeEnum( value ); - if ( temp ) - { - myEnum = temp.value(); - myCustomValue = ""; - } - else - { - setValue( DistanceTypeEnum::other ); - myCustomValue = value; - } - } - - DistanceType parseDistanceType( const std::string& value ) - { - return DistanceType( value ); - } - - std::string toString( const DistanceType& value ) - { - return value.getValueString(); - } - - std::ostream& toStream( std::ostream& os, const DistanceType& value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const DistanceType& value ) - { - return toStream( os, value ); - } - - /// DynamicsEnum /////////////////////////////////////////////////////////////////////////// - - DynamicsEnum parseDynamicsEnum( const std::string& value ) - { - const auto opt = tryParseDynamicsEnum( value ); - return opt.value_or( DynamicsEnum::mf ); - } - - std::optional tryParseDynamicsEnum( const std::string& value ) - { - if( value == "p" ) { return DynamicsEnum::p; } - else if( value == "pp" ) { return DynamicsEnum::pp; } - else if( value == "ppp" ) { return DynamicsEnum::ppp; } - else if( value == "pppp" ) { return DynamicsEnum::pppp; } - else if( value == "ppppp" ) { return DynamicsEnum::ppppp; } - else if( value == "pppppp" ) { return DynamicsEnum::pppppp; } - else if( value == "f" ) { return DynamicsEnum::f; } - else if( value == "ff" ) { return DynamicsEnum::ff; } - else if( value == "fff" ) { return DynamicsEnum::fff; } - else if( value == "ffff" ) { return DynamicsEnum::ffff; } - else if( value == "fffff" ) { return DynamicsEnum::fffff; } - else if( value == "ffffff" ) { return DynamicsEnum::ffffff; } - else if( value == "mp" ) { return DynamicsEnum::mp; } - else if( value == "mf" ) { return DynamicsEnum::mf; } - else if( value == "sf" ) { return DynamicsEnum::sf; } - else if( value == "sfp" ) { return DynamicsEnum::sfp; } - else if( value == "sfpp" ) { return DynamicsEnum::sfpp; } - else if( value == "fp" ) { return DynamicsEnum::fp; } - else if( value == "rf" ) { return DynamicsEnum::rf; } - else if( value == "rfz" ) { return DynamicsEnum::rfz; } - else if( value == "sfz" ) { return DynamicsEnum::sfz; } - else if( value == "sffz" ) { return DynamicsEnum::sffz; } - else if( value == "fz" ) { return DynamicsEnum::fz; } - else if( value == "other-dynamics" ) { return DynamicsEnum::otherDynamics; } - return std::optional{}; - } - - std::string toString( const DynamicsEnum value ) - { - switch ( value ) - { - case DynamicsEnum::p: { return "p"; } - case DynamicsEnum::pp: { return "pp"; } - case DynamicsEnum::ppp: { return "ppp"; } - case DynamicsEnum::pppp: { return "pppp"; } - case DynamicsEnum::ppppp: { return "ppppp"; } - case DynamicsEnum::pppppp: { return "pppppp"; } - case DynamicsEnum::f: { return "f"; } - case DynamicsEnum::ff: { return "ff"; } - case DynamicsEnum::fff: { return "fff"; } - case DynamicsEnum::ffff: { return "ffff"; } - case DynamicsEnum::fffff: { return "fffff"; } - case DynamicsEnum::ffffff: { return "ffffff"; } - case DynamicsEnum::mp: { return "mp"; } - case DynamicsEnum::mf: { return "mf"; } - case DynamicsEnum::sf: { return "sf"; } - case DynamicsEnum::sfp: { return "sfp"; } - case DynamicsEnum::sfpp: { return "sfpp"; } - case DynamicsEnum::fp: { return "fp"; } - case DynamicsEnum::rf: { return "rf"; } - case DynamicsEnum::rfz: { return "rfz"; } - case DynamicsEnum::sfz: { return "sfz"; } - case DynamicsEnum::sffz: { return "sffz"; } - case DynamicsEnum::fz: { return "fz"; } - default: break; - } - return "other-dynamics"; - } - - std::ostream& toStream( std::ostream& os, const DynamicsEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const DynamicsEnum value ) - { - return toStream( os, value ); - } - - DynamicsValue::DynamicsValue( const DynamicsEnum value ) - : myEnum( value ) - , myCustomValue( "" ) - { - setValue( value ); - } - - DynamicsValue::DynamicsValue( const std::string& value ) - : myEnum( DynamicsEnum::otherDynamics ) - , myCustomValue( value ) - { - setValue( value ); - } - - DynamicsValue::DynamicsValue() - : myEnum( DynamicsEnum::mf ) - , myCustomValue( "" ) - { - setValue( DynamicsEnum::mf ); - } - - DynamicsEnum DynamicsValue::getValue() const - { - return myEnum; - } - - std::string DynamicsValue::getValueString() const - { - if ( myEnum != DynamicsEnum::otherDynamics ) - { - return toString( myEnum ); - } - - else - { - return myCustomValue; - } - } - - void DynamicsValue::setValue( const DynamicsEnum value ) - { - myEnum = value; - if( value != DynamicsEnum::otherDynamics && !myCustomValue.empty() ) - { - myCustomValue = ""; - } - } - - void DynamicsValue::setValue( const std::string& value ) - { - const auto temp = tryParseDynamicsEnum( value ); - if ( temp ) - { - myEnum = temp.value(); - myCustomValue = ""; - } - else - { - setValue( DynamicsEnum::otherDynamics ); - myCustomValue = value; - } - } - - DynamicsValue parseDynamicsValue( const std::string& value ) - { - return DynamicsValue( value ); - } - - std::string toString( const DynamicsValue& value ) - { - return value.getValueString(); - } - - std::ostream& toStream( std::ostream& os, const DynamicsValue& value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const DynamicsValue& value ) - { - return toStream( os, value ); - } - - /// EffectEnum ///////////////////////////////////////////////////////////////////////////// - - EffectEnum parseEffectEnum( const std::string& value ) - { - const auto opt = tryParseEffectEnum( value ); - return opt.value_or( EffectEnum::anvil ); - } - - std::optional tryParseEffectEnum( const std::string& value ) - { - if( value == "anvil" ) { return EffectEnum::anvil; } - else if( value == "auto horn" ) { return EffectEnum::autoHorn; } - else if( value == "bird whistle" ) { return EffectEnum::birdWhistle; } - else if( value == "cannon" ) { return EffectEnum::cannon; } - else if( value == "duck call" ) { return EffectEnum::duckCall; } - else if( value == "gun shot" ) { return EffectEnum::gunShot; } - else if( value == "klaxon horn" ) { return EffectEnum::klaxonHorn; } - else if( value == "lions roar" ) { return EffectEnum::lionsRoar; } - else if( value == "police whistle" ) { return EffectEnum::policeWhistle; } - else if( value == "siren" ) { return EffectEnum::siren; } - else if( value == "slide whistle" ) { return EffectEnum::slideWhistle; } - else if( value == "thunder sheet" ) { return EffectEnum::thunderSheet; } - else if( value == "wind machine" ) { return EffectEnum::windMachine; } - else if( value == "wind whistle" ) { return EffectEnum::windWhistle; } - return std::optional{}; - } - - std::string toString( const EffectEnum value ) - { - switch ( value ) - { - case EffectEnum::anvil: { return "anvil"; } - case EffectEnum::autoHorn: { return "auto horn"; } - case EffectEnum::birdWhistle: { return "bird whistle"; } - case EffectEnum::cannon: { return "cannon"; } - case EffectEnum::duckCall: { return "duck call"; } - case EffectEnum::gunShot: { return "gun shot"; } - case EffectEnum::klaxonHorn: { return "klaxon horn"; } - case EffectEnum::lionsRoar: { return "lions roar"; } - case EffectEnum::policeWhistle: { return "police whistle"; } - case EffectEnum::siren: { return "siren"; } - case EffectEnum::slideWhistle: { return "slide whistle"; } - case EffectEnum::thunderSheet: { return "thunder sheet"; } - case EffectEnum::windMachine: { return "wind machine"; } - case EffectEnum::windWhistle: { return "wind whistle"; } - default: break; - } - return "anvil"; - } - - std::ostream& toStream( std::ostream& os, const EffectEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const EffectEnum value ) - { - return toStream( os, value ); - } - - /// EnclosureShape ///////////////////////////////////////////////////////////////////////// - - EnclosureShape parseEnclosureShape( const std::string& value ) - { - const auto opt = tryParseEnclosureShape( value ); - return opt.value_or( EnclosureShape::rectangle ); - } - - std::optional tryParseEnclosureShape( const std::string& value ) - { - if( value == "rectangle" ) { return EnclosureShape::rectangle; } - else if( value == "square" ) { return EnclosureShape::square; } - else if( value == "oval" ) { return EnclosureShape::oval; } - else if( value == "circle" ) { return EnclosureShape::circle; } - else if( value == "bracket" ) { return EnclosureShape::bracket; } - else if( value == "triangle" ) { return EnclosureShape::triangle; } - else if( value == "diamond" ) { return EnclosureShape::diamond; } - else if( value == "none" ) { return EnclosureShape::none; } - return std::optional{}; - } - - std::string toString( const EnclosureShape value ) - { - switch ( value ) - { - case EnclosureShape::rectangle: { return "rectangle"; } - case EnclosureShape::square: { return "square"; } - case EnclosureShape::oval: { return "oval"; } - case EnclosureShape::circle: { return "circle"; } - case EnclosureShape::bracket: { return "bracket"; } - case EnclosureShape::triangle: { return "triangle"; } - case EnclosureShape::diamond: { return "diamond"; } - case EnclosureShape::none: { return "none"; } - default: break; - } - return "rectangle"; - } - - std::ostream& toStream( std::ostream& os, const EnclosureShape value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const EnclosureShape value ) - { - return toStream( os, value ); - } - - /// Fan //////////////////////////////////////////////////////////////////////////////////// - - Fan parseFan( const std::string& value ) - { - const auto opt = tryParseFan( value ); - return opt.value_or( Fan::accel ); - } - - std::optional tryParseFan( const std::string& value ) - { - if( value == "accel" ) { return Fan::accel; } - else if( value == "rit" ) { return Fan::rit; } - else if( value == "none" ) { return Fan::none; } - return std::optional{}; - } - - std::string toString( const Fan value ) - { - switch ( value ) - { - case Fan::accel: { return "accel"; } - case Fan::rit: { return "rit"; } - case Fan::none: { return "none"; } - default: break; - } - return "accel"; - } - - std::ostream& toStream( std::ostream& os, const Fan value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const Fan value ) - { - return toStream( os, value ); - } - - /// FermataShape /////////////////////////////////////////////////////////////////////////// - - FermataShape parseFermataShape( const std::string& value ) - { - const auto opt = tryParseFermataShape( value ); - return opt.value_or( FermataShape::normal ); - } - - std::optional tryParseFermataShape( const std::string& value ) - { - if( value == "normal" ) { return FermataShape::normal; } - else if( value == "angled" ) { return FermataShape::angled; } - else if( value == "square" ) { return FermataShape::square; } - else if( value == "" ) { return FermataShape::emptystring; } - return std::optional{}; - } - - std::string toString( const FermataShape value ) - { - switch ( value ) - { - case FermataShape::normal: { return "normal"; } - case FermataShape::angled: { return "angled"; } - case FermataShape::square: { return "square"; } - case FermataShape::emptystring: { return ""; } - default: break; - } - return "normal"; - } - - std::ostream& toStream( std::ostream& os, const FermataShape value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const FermataShape value ) - { - return toStream( os, value ); - } - - /// FontStyle ////////////////////////////////////////////////////////////////////////////// - - FontStyle parseFontStyle( const std::string& value ) - { - const auto opt = tryParseFontStyle( value ); - return opt.value_or( FontStyle::normal ); - } - - std::optional tryParseFontStyle( const std::string& value ) - { - if( value == "normal" ) { return FontStyle::normal; } - else if( value == "italic" ) { return FontStyle::italic; } - return std::optional{}; - } - - std::string toString( const FontStyle value ) - { - switch ( value ) - { - case FontStyle::normal: { return "normal"; } - case FontStyle::italic: { return "italic"; } - default: break; - } - return "normal"; - } - - std::ostream& toStream( std::ostream& os, const FontStyle value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const FontStyle value ) - { - return toStream( os, value ); - } - - /// FontWeight ///////////////////////////////////////////////////////////////////////////// - - FontWeight parseFontWeight( const std::string& value ) - { - const auto opt = tryParseFontWeight( value ); - return opt.value_or( FontWeight::normal ); - } - - std::optional tryParseFontWeight( const std::string& value ) - { - if( value == "normal" ) { return FontWeight::normal; } - else if( value == "bold" ) { return FontWeight::bold; } - return std::optional{}; - } - - std::string toString( const FontWeight value ) - { - switch ( value ) - { - case FontWeight::normal: { return "normal"; } - case FontWeight::bold: { return "bold"; } - default: break; - } - return "normal"; - } - - std::ostream& toStream( std::ostream& os, const FontWeight value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const FontWeight value ) - { - return toStream( os, value ); - } - - /// GlassEnum ////////////////////////////////////////////////////////////////////////////// - - GlassEnum parseGlassEnum( const std::string& value ) - { - const auto opt = tryParseGlassEnum( value ); - return opt.value_or( GlassEnum::windChimes ); - } - - std::optional tryParseGlassEnum( const std::string& value ) - { - if( value == "wind chimes" ) { return GlassEnum::windChimes; } - return std::optional{}; - } - - std::string toString( const GlassEnum value ) - { - switch ( value ) - { - case GlassEnum::windChimes: { return "wind chimes"; } - default: break; - } - return "wind chimes"; - } - - std::ostream& toStream( std::ostream& os, const GlassEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const GlassEnum value ) - { - return toStream( os, value ); - } - - /// GroupBarlineValue ////////////////////////////////////////////////////////////////////// - - GroupBarlineValue parseGroupBarlineValue( const std::string& value ) - { - const auto opt = tryParseGroupBarlineValue( value ); - return opt.value_or( GroupBarlineValue::yes ); - } - - std::optional tryParseGroupBarlineValue( const std::string& value ) - { - if( value == "yes" ) { return GroupBarlineValue::yes; } - else if( value == "no" ) { return GroupBarlineValue::no; } - else if( value == "Mensurstrich" ) { return GroupBarlineValue::mensurstrich; } - return std::optional{}; - } - - std::string toString( const GroupBarlineValue value ) - { - switch ( value ) - { - case GroupBarlineValue::yes: { return "yes"; } - case GroupBarlineValue::no: { return "no"; } - case GroupBarlineValue::mensurstrich: { return "Mensurstrich"; } - default: break; - } - return "yes"; - } - - std::ostream& toStream( std::ostream& os, const GroupBarlineValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const GroupBarlineValue value ) - { - return toStream( os, value ); - } - - /// GroupSymbolValue /////////////////////////////////////////////////////////////////////// - - GroupSymbolValue parseGroupSymbolValue( const std::string& value ) - { - const auto opt = tryParseGroupSymbolValue( value ); - return opt.value_or( GroupSymbolValue::none ); - } - - std::optional tryParseGroupSymbolValue( const std::string& value ) - { - if( value == "none" ) { return GroupSymbolValue::none; } - else if( value == "brace" ) { return GroupSymbolValue::brace; } - else if( value == "line" ) { return GroupSymbolValue::line; } - else if( value == "bracket" ) { return GroupSymbolValue::bracket; } - else if( value == "square" ) { return GroupSymbolValue::square; } - return std::optional{}; - } - - std::string toString( const GroupSymbolValue value ) - { - switch ( value ) - { - case GroupSymbolValue::none: { return "none"; } - case GroupSymbolValue::brace: { return "brace"; } - case GroupSymbolValue::line: { return "line"; } - case GroupSymbolValue::bracket: { return "bracket"; } - case GroupSymbolValue::square: { return "square"; } - default: break; - } - return "none"; - } - - std::ostream& toStream( std::ostream& os, const GroupSymbolValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const GroupSymbolValue value ) - { - return toStream( os, value ); - } - - /// HandbellValue ////////////////////////////////////////////////////////////////////////// - - HandbellValue parseHandbellValue( const std::string& value ) - { - const auto opt = tryParseHandbellValue( value ); - return opt.value_or( HandbellValue::damp ); - } - - std::optional tryParseHandbellValue( const std::string& value ) - { - if( value == "damp" ) { return HandbellValue::damp; } - else if( value == "echo" ) { return HandbellValue::echo; } - else if( value == "gyro" ) { return HandbellValue::gyro; } - else if( value == "hand martellato" ) { return HandbellValue::handMartellato; } - else if( value == "mallet lift" ) { return HandbellValue::malletLift; } - else if( value == "mallet table" ) { return HandbellValue::malletTable; } - else if( value == "martellato" ) { return HandbellValue::martellato; } - else if( value == "martellato lift" ) { return HandbellValue::martellatoLift; } - else if( value == "muted martellato" ) { return HandbellValue::mutedMartellato; } - else if( value == "pluck lift" ) { return HandbellValue::pluckLift; } - else if( value == "swing" ) { return HandbellValue::swing; } - return std::optional{}; - } - - std::string toString( const HandbellValue value ) - { - switch ( value ) - { - case HandbellValue::damp: { return "damp"; } - case HandbellValue::echo: { return "echo"; } - case HandbellValue::gyro: { return "gyro"; } - case HandbellValue::handMartellato: { return "hand martellato"; } - case HandbellValue::malletLift: { return "mallet lift"; } - case HandbellValue::malletTable: { return "mallet table"; } - case HandbellValue::martellato: { return "martellato"; } - case HandbellValue::martellatoLift: { return "martellato lift"; } - case HandbellValue::mutedMartellato: { return "muted martellato"; } - case HandbellValue::pluckLift: { return "pluck lift"; } - case HandbellValue::swing: { return "swing"; } - default: break; - } - return "damp"; - } - - std::ostream& toStream( std::ostream& os, const HandbellValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const HandbellValue value ) - { - return toStream( os, value ); - } - - /// HarmonyType //////////////////////////////////////////////////////////////////////////// - - HarmonyType parseHarmonyType( const std::string& value ) - { - const auto opt = tryParseHarmonyType( value ); - return opt.value_or( HarmonyType::explicit_ ); - } - - std::optional tryParseHarmonyType( const std::string& value ) - { - if( value == "explicit" ) { return HarmonyType::explicit_; } - else if( value == "implied" ) { return HarmonyType::implied; } - else if( value == "alternate" ) { return HarmonyType::alternate; } - return std::optional{}; - } - - std::string toString( const HarmonyType value ) - { - switch ( value ) - { - case HarmonyType::explicit_: { return "explicit"; } - case HarmonyType::implied: { return "implied"; } - case HarmonyType::alternate: { return "alternate"; } - default: break; - } - return "explicit"; - } - - std::ostream& toStream( std::ostream& os, const HarmonyType value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const HarmonyType value ) - { - return toStream( os, value ); - } - - /// HoleClosedLocation ///////////////////////////////////////////////////////////////////// - - HoleClosedLocation parseHoleClosedLocation( const std::string& value ) - { - const auto opt = tryParseHoleClosedLocation( value ); - return opt.value_or( HoleClosedLocation::right ); - } - - std::optional tryParseHoleClosedLocation( const std::string& value ) - { - if( value == "right" ) { return HoleClosedLocation::right; } - else if( value == "bottom" ) { return HoleClosedLocation::bottom; } - else if( value == "left" ) { return HoleClosedLocation::left; } - else if( value == "top" ) { return HoleClosedLocation::top; } - return std::optional{}; - } - - std::string toString( const HoleClosedLocation value ) - { - switch ( value ) - { - case HoleClosedLocation::right: { return "right"; } - case HoleClosedLocation::bottom: { return "bottom"; } - case HoleClosedLocation::left: { return "left"; } - case HoleClosedLocation::top: { return "top"; } - default: break; - } - return "right"; - } - - std::ostream& toStream( std::ostream& os, const HoleClosedLocation value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const HoleClosedLocation value ) - { - return toStream( os, value ); - } - - /// HoleClosedValue //////////////////////////////////////////////////////////////////////// - - HoleClosedValue parseHoleClosedValue( const std::string& value ) - { - const auto opt = tryParseHoleClosedValue( value ); - return opt.value_or( HoleClosedValue::yes ); - } - - std::optional tryParseHoleClosedValue( const std::string& value ) - { - if( value == "yes" ) { return HoleClosedValue::yes; } - else if( value == "no" ) { return HoleClosedValue::no; } - else if( value == "half" ) { return HoleClosedValue::half; } - return std::optional{}; - } - - std::string toString( const HoleClosedValue value ) - { - switch ( value ) - { - case HoleClosedValue::yes: { return "yes"; } - case HoleClosedValue::no: { return "no"; } - case HoleClosedValue::half: { return "half"; } - default: break; - } - return "yes"; - } - - std::ostream& toStream( std::ostream& os, const HoleClosedValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const HoleClosedValue value ) - { - return toStream( os, value ); - } - - /// KindValue ////////////////////////////////////////////////////////////////////////////// - - KindValue parseKindValue( const std::string& value ) - { - const auto opt = tryParseKindValue( value ); - return opt.value_or( KindValue::major ); - } - - std::optional tryParseKindValue( const std::string& value ) - { - if( value == "major" ) { return KindValue::major; } - else if( value == "minor" ) { return KindValue::minor; } - else if( value == "augmented" ) { return KindValue::augmented; } - else if( value == "diminished" ) { return KindValue::diminished; } - else if( value == "dominant" ) { return KindValue::dominant; } - else if( value == "major-seventh" ) { return KindValue::majorSeventh; } - else if( value == "minor-seventh" ) { return KindValue::minorSeventh; } - else if( value == "diminished-seventh" ) { return KindValue::diminishedSeventh; } - else if( value == "augmented-seventh" ) { return KindValue::augmentedSeventh; } - else if( value == "half-diminished" ) { return KindValue::halfDiminished; } - else if( value == "major-minor" ) { return KindValue::majorMinor; } - else if( value == "major-sixth" ) { return KindValue::majorSixth; } - else if( value == "minor-sixth" ) { return KindValue::minorSixth; } - else if( value == "dominant-ninth" ) { return KindValue::dominantNinth; } - else if( value == "major-ninth" ) { return KindValue::majorNinth; } - else if( value == "minor-ninth" ) { return KindValue::minorNinth; } - else if( value == "dominant-11th" ) { return KindValue::dominant11th; } - else if( value == "major-11th" ) { return KindValue::major11th; } - else if( value == "minor-11th" ) { return KindValue::minor11th; } - else if( value == "dominant-13th" ) { return KindValue::dominant13th; } - else if( value == "major-13th" ) { return KindValue::major13th; } - else if( value == "minor-13th" ) { return KindValue::minor13th; } - else if( value == "suspended-second" ) { return KindValue::suspendedSecond; } - else if( value == "suspended-fourth" ) { return KindValue::suspendedFourth; } - else if( value == "Neapolitan" ) { return KindValue::neapolitan; } - else if( value == "Italian" ) { return KindValue::italian; } - else if( value == "French" ) { return KindValue::french; } - else if( value == "German" ) { return KindValue::german; } - else if( value == "pedal" ) { return KindValue::pedal; } - else if( value == "power" ) { return KindValue::power; } - else if( value == "Tristan" ) { return KindValue::tristan; } - else if( value == "other" ) { return KindValue::other; } - else if( value == "none" ) { return KindValue::none; } - return std::optional{}; - } - - std::string toString( const KindValue value ) - { - switch ( value ) - { - case KindValue::major: { return "major"; } - case KindValue::minor: { return "minor"; } - case KindValue::augmented: { return "augmented"; } - case KindValue::diminished: { return "diminished"; } - case KindValue::dominant: { return "dominant"; } - case KindValue::majorSeventh: { return "major-seventh"; } - case KindValue::minorSeventh: { return "minor-seventh"; } - case KindValue::diminishedSeventh: { return "diminished-seventh"; } - case KindValue::augmentedSeventh: { return "augmented-seventh"; } - case KindValue::halfDiminished: { return "half-diminished"; } - case KindValue::majorMinor: { return "major-minor"; } - case KindValue::majorSixth: { return "major-sixth"; } - case KindValue::minorSixth: { return "minor-sixth"; } - case KindValue::dominantNinth: { return "dominant-ninth"; } - case KindValue::majorNinth: { return "major-ninth"; } - case KindValue::minorNinth: { return "minor-ninth"; } - case KindValue::dominant11th: { return "dominant-11th"; } - case KindValue::major11th: { return "major-11th"; } - case KindValue::minor11th: { return "minor-11th"; } - case KindValue::dominant13th: { return "dominant-13th"; } - case KindValue::major13th: { return "major-13th"; } - case KindValue::minor13th: { return "minor-13th"; } - case KindValue::suspendedSecond: { return "suspended-second"; } - case KindValue::suspendedFourth: { return "suspended-fourth"; } - case KindValue::neapolitan: { return "Neapolitan"; } - case KindValue::italian: { return "Italian"; } - case KindValue::french: { return "French"; } - case KindValue::german: { return "German"; } - case KindValue::pedal: { return "pedal"; } - case KindValue::power: { return "power"; } - case KindValue::tristan: { return "Tristan"; } - case KindValue::other: { return "other"; } - case KindValue::none: { return "none"; } - default: break; - } - return "major"; - } - - std::ostream& toStream( std::ostream& os, const KindValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const KindValue value ) - { - return toStream( os, value ); - } - - /// LeftCenterRight //////////////////////////////////////////////////////////////////////// - - LeftCenterRight parseLeftCenterRight( const std::string& value ) - { - const auto opt = tryParseLeftCenterRight( value ); - return opt.value_or( LeftCenterRight::left ); - } - - std::optional tryParseLeftCenterRight( const std::string& value ) - { - if( value == "left" ) { return LeftCenterRight::left; } - else if( value == "center" ) { return LeftCenterRight::center; } - else if( value == "right" ) { return LeftCenterRight::right; } - return std::optional{}; - } - - std::string toString( const LeftCenterRight value ) - { - switch ( value ) - { - case LeftCenterRight::left: { return "left"; } - case LeftCenterRight::center: { return "center"; } - case LeftCenterRight::right: { return "right"; } - default: break; - } - return "left"; - } - - std::ostream& toStream( std::ostream& os, const LeftCenterRight value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LeftCenterRight value ) - { - return toStream( os, value ); - } - - /// LeftRight ////////////////////////////////////////////////////////////////////////////// - - LeftRight parseLeftRight( const std::string& value ) - { - const auto opt = tryParseLeftRight( value ); - return opt.value_or( LeftRight::left ); - } - - std::optional tryParseLeftRight( const std::string& value ) - { - if( value == "left" ) { return LeftRight::left; } - else if( value == "right" ) { return LeftRight::right; } - return std::optional{}; - } - - std::string toString( const LeftRight value ) - { - switch ( value ) - { - case LeftRight::left: { return "left"; } - case LeftRight::right: { return "right"; } - default: break; - } - return "left"; - } - - std::ostream& toStream( std::ostream& os, const LeftRight value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LeftRight value ) - { - return toStream( os, value ); - } - - /// LineEnd //////////////////////////////////////////////////////////////////////////////// - - LineEnd parseLineEnd( const std::string& value ) - { - const auto opt = tryParseLineEnd( value ); - return opt.value_or( LineEnd::up ); - } - - std::optional tryParseLineEnd( const std::string& value ) - { - if( value == "up" ) { return LineEnd::up; } - else if( value == "down" ) { return LineEnd::down; } - else if( value == "both" ) { return LineEnd::both; } - else if( value == "arrow" ) { return LineEnd::arrow; } - else if( value == "none" ) { return LineEnd::none; } - return std::optional{}; - } - - std::string toString( const LineEnd value ) - { - switch ( value ) - { - case LineEnd::up: { return "up"; } - case LineEnd::down: { return "down"; } - case LineEnd::both: { return "both"; } - case LineEnd::arrow: { return "arrow"; } - case LineEnd::none: { return "none"; } - default: break; - } - return "up"; - } - - std::ostream& toStream( std::ostream& os, const LineEnd value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LineEnd value ) - { - return toStream( os, value ); - } - - /// LineShape ////////////////////////////////////////////////////////////////////////////// - - LineShape parseLineShape( const std::string& value ) - { - const auto opt = tryParseLineShape( value ); - return opt.value_or( LineShape::straight ); - } - - std::optional tryParseLineShape( const std::string& value ) - { - if( value == "straight" ) { return LineShape::straight; } - else if( value == "curved" ) { return LineShape::curved; } - return std::optional{}; - } - - std::string toString( const LineShape value ) - { - switch ( value ) - { - case LineShape::straight: { return "straight"; } - case LineShape::curved: { return "curved"; } - default: break; - } - return "straight"; - } - - std::ostream& toStream( std::ostream& os, const LineShape value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LineShape value ) - { - return toStream( os, value ); - } - - /// LineType /////////////////////////////////////////////////////////////////////////////// - - LineType parseLineType( const std::string& value ) - { - const auto opt = tryParseLineType( value ); - return opt.value_or( LineType::solid ); - } - - std::optional tryParseLineType( const std::string& value ) - { - if( value == "solid" ) { return LineType::solid; } - else if( value == "dashed" ) { return LineType::dashed; } - else if( value == "dotted" ) { return LineType::dotted; } - else if( value == "wavy" ) { return LineType::wavy; } - return std::optional{}; - } - - std::string toString( const LineType value ) - { - switch ( value ) - { - case LineType::solid: { return "solid"; } - case LineType::dashed: { return "dashed"; } - case LineType::dotted: { return "dotted"; } - case LineType::wavy: { return "wavy"; } - default: break; - } - return "solid"; - } - - std::ostream& toStream( std::ostream& os, const LineType value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LineType value ) - { - return toStream( os, value ); - } - - /// LineWidthTypeEnum ////////////////////////////////////////////////////////////////////// - - LineWidthTypeEnum parseLineWidthTypeEnum( const std::string& value ) - { - const auto opt = tryParseLineWidthTypeEnum( value ); - return opt.value_or( LineWidthTypeEnum::beam ); - } - - std::optional tryParseLineWidthTypeEnum( const std::string& value ) - { - if( value == "beam" ) { return LineWidthTypeEnum::beam; } - else if( value == "bracket" ) { return LineWidthTypeEnum::bracket; } - else if( value == "dashes" ) { return LineWidthTypeEnum::dashes; } - else if( value == "enclosure" ) { return LineWidthTypeEnum::enclosure; } - else if( value == "ending" ) { return LineWidthTypeEnum::ending; } - else if( value == "extend" ) { return LineWidthTypeEnum::extend; } - else if( value == "heavy barline" ) { return LineWidthTypeEnum::heavyBarline; } - else if( value == "leger" ) { return LineWidthTypeEnum::leger; } - else if( value == "light barline" ) { return LineWidthTypeEnum::lightBarline; } - else if( value == "octave shift" ) { return LineWidthTypeEnum::octaveShift; } - else if( value == "pedal" ) { return LineWidthTypeEnum::pedal; } - else if( value == "slur middle" ) { return LineWidthTypeEnum::slurMiddle; } - else if( value == "slur tip" ) { return LineWidthTypeEnum::slurTip; } - else if( value == "staff" ) { return LineWidthTypeEnum::staff; } - else if( value == "stem" ) { return LineWidthTypeEnum::stem; } - else if( value == "tie middle" ) { return LineWidthTypeEnum::tieMiddle; } - else if( value == "tie tip" ) { return LineWidthTypeEnum::tieTip; } - else if( value == "tuplet bracket" ) { return LineWidthTypeEnum::tupletBracket; } - else if( value == "wedge" ) { return LineWidthTypeEnum::wedge; } - else if( value == "other" ) { return LineWidthTypeEnum::other; } - return std::optional{}; - } - - std::string toString( const LineWidthTypeEnum value ) - { - switch ( value ) - { - case LineWidthTypeEnum::beam: { return "beam"; } - case LineWidthTypeEnum::bracket: { return "bracket"; } - case LineWidthTypeEnum::dashes: { return "dashes"; } - case LineWidthTypeEnum::enclosure: { return "enclosure"; } - case LineWidthTypeEnum::ending: { return "ending"; } - case LineWidthTypeEnum::extend: { return "extend"; } - case LineWidthTypeEnum::heavyBarline: { return "heavy barline"; } - case LineWidthTypeEnum::leger: { return "leger"; } - case LineWidthTypeEnum::lightBarline: { return "light barline"; } - case LineWidthTypeEnum::octaveShift: { return "octave shift"; } - case LineWidthTypeEnum::pedal: { return "pedal"; } - case LineWidthTypeEnum::slurMiddle: { return "slur middle"; } - case LineWidthTypeEnum::slurTip: { return "slur tip"; } - case LineWidthTypeEnum::staff: { return "staff"; } - case LineWidthTypeEnum::stem: { return "stem"; } - case LineWidthTypeEnum::tieMiddle: { return "tie middle"; } - case LineWidthTypeEnum::tieTip: { return "tie tip"; } - case LineWidthTypeEnum::tupletBracket: { return "tuplet bracket"; } - case LineWidthTypeEnum::wedge: { return "wedge"; } - default: break; - } - return "other"; - } - - std::ostream& toStream( std::ostream& os, const LineWidthTypeEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LineWidthTypeEnum value ) - { - return toStream( os, value ); - } - - LineWidthType::LineWidthType( const LineWidthTypeEnum value ) - : myEnum( value ) - , myCustomValue( "" ) - { - setValue( value ); - } - - LineWidthType::LineWidthType( const std::string& value ) - : myEnum( LineWidthTypeEnum::other ) - , myCustomValue( value ) - { - setValue( value ); - } - - LineWidthType::LineWidthType() - : myEnum( LineWidthTypeEnum::beam ) - , myCustomValue( "" ) - { - setValue( LineWidthTypeEnum::beam ); - } - - LineWidthTypeEnum LineWidthType::getValue() const - { - return myEnum; - } - - std::string LineWidthType::getValueString() const - { - if ( myEnum != LineWidthTypeEnum::other ) - { - return toString( myEnum ); - } - - else - { - return myCustomValue; - } - } - - void LineWidthType::setValue( const LineWidthTypeEnum value ) - { - myEnum = value; - if( value != LineWidthTypeEnum::other && !myCustomValue.empty() ) - { - myCustomValue = ""; - } - } - - void LineWidthType::setValue( const std::string& value ) - { - const auto temp = tryParseLineWidthTypeEnum( value ); - if ( temp ) - { - myEnum = temp.value(); - myCustomValue = ""; - } - else - { - setValue( LineWidthTypeEnum::other ); - myCustomValue = value; - } - } - - LineWidthType parseLineWidthType( const std::string& value ) - { - return LineWidthType( value ); - } - - std::string toString( const LineWidthType& value ) - { - return value.getValueString(); - } - - std::ostream& toStream( std::ostream& os, const LineWidthType& value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const LineWidthType& value ) - { - return toStream( os, value ); - } - - /// MarginType ///////////////////////////////////////////////////////////////////////////// - - MarginType parseMarginType( const std::string& value ) - { - const auto opt = tryParseMarginType( value ); - return opt.value_or( MarginType::odd ); - } - - std::optional tryParseMarginType( const std::string& value ) - { - if( value == "odd" ) { return MarginType::odd; } - else if( value == "even" ) { return MarginType::even; } - else if( value == "both" ) { return MarginType::both; } - return std::optional{}; - } - - std::string toString( const MarginType value ) - { - switch ( value ) - { - case MarginType::odd: { return "odd"; } - case MarginType::even: { return "even"; } - case MarginType::both: { return "both"; } - default: break; - } - return "odd"; - } - - std::ostream& toStream( std::ostream& os, const MarginType value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const MarginType value ) - { - return toStream( os, value ); - } - - /// MeasureNumberingValue ////////////////////////////////////////////////////////////////// - - MeasureNumberingValue parseMeasureNumberingValue( const std::string& value ) - { - const auto opt = tryParseMeasureNumberingValue( value ); - return opt.value_or( MeasureNumberingValue::none ); - } - - std::optional tryParseMeasureNumberingValue( const std::string& value ) - { - if( value == "none" ) { return MeasureNumberingValue::none; } - else if( value == "measure" ) { return MeasureNumberingValue::measure; } - else if( value == "system" ) { return MeasureNumberingValue::system; } - return std::optional{}; - } - - std::string toString( const MeasureNumberingValue value ) - { - switch ( value ) - { - case MeasureNumberingValue::none: { return "none"; } - case MeasureNumberingValue::measure: { return "measure"; } - case MeasureNumberingValue::system: { return "system"; } - default: break; - } - return "none"; - } - - std::ostream& toStream( std::ostream& os, const MeasureNumberingValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const MeasureNumberingValue value ) - { - return toStream( os, value ); - } - - /// MembraneEnum /////////////////////////////////////////////////////////////////////////// - - MembraneEnum parseMembraneEnum( const std::string& value ) - { - const auto opt = tryParseMembraneEnum( value ); - return opt.value_or( MembraneEnum::bassDrum ); - } - - std::optional tryParseMembraneEnum( const std::string& value ) - { - if( value == "bass drum" ) { return MembraneEnum::bassDrum; } - else if( value == "bass drum on side" ) { return MembraneEnum::bassDrumOnSide; } - else if( value == "bongos" ) { return MembraneEnum::bongos; } - else if( value == "conga drum" ) { return MembraneEnum::congaDrum; } - else if( value == "goblet drum" ) { return MembraneEnum::gobletDrum; } - else if( value == "military drum" ) { return MembraneEnum::militaryDrum; } - else if( value == "snare drum" ) { return MembraneEnum::snareDrum; } - else if( value == "snare drum snares off" ) { return MembraneEnum::snareDrumSnaresOff; } - else if( value == "tambourine" ) { return MembraneEnum::tambourine; } - else if( value == "tenor drum" ) { return MembraneEnum::tenorDrum; } - else if( value == "timbales" ) { return MembraneEnum::timbales; } - else if( value == "tomtom" ) { return MembraneEnum::tomtom; } - return std::optional{}; - } - - std::string toString( const MembraneEnum value ) - { - switch ( value ) - { - case MembraneEnum::bassDrum: { return "bass drum"; } - case MembraneEnum::bassDrumOnSide: { return "bass drum on side"; } - case MembraneEnum::bongos: { return "bongos"; } - case MembraneEnum::congaDrum: { return "conga drum"; } - case MembraneEnum::gobletDrum: { return "goblet drum"; } - case MembraneEnum::militaryDrum: { return "military drum"; } - case MembraneEnum::snareDrum: { return "snare drum"; } - case MembraneEnum::snareDrumSnaresOff: { return "snare drum snares off"; } - case MembraneEnum::tambourine: { return "tambourine"; } - case MembraneEnum::tenorDrum: { return "tenor drum"; } - case MembraneEnum::timbales: { return "timbales"; } - case MembraneEnum::tomtom: { return "tomtom"; } - default: break; - } - return "bass drum"; - } - - std::ostream& toStream( std::ostream& os, const MembraneEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const MembraneEnum value ) - { - return toStream( os, value ); - } - - /// MetalEnum ////////////////////////////////////////////////////////////////////////////// - - MetalEnum parseMetalEnum( const std::string& value ) - { - const auto opt = tryParseMetalEnum( value ); - return opt.value_or( MetalEnum::almglocken ); - } - - std::optional tryParseMetalEnum( const std::string& value ) - { - if( value == "almglocken" ) { return MetalEnum::almglocken; } - else if( value == "bell" ) { return MetalEnum::bell; } - else if( value == "bell plate" ) { return MetalEnum::bellPlate; } - else if( value == "brake drum" ) { return MetalEnum::brakeDrum; } - else if( value == "Chinese cymbal" ) { return MetalEnum::chineseCymbal; } - else if( value == "cowbell" ) { return MetalEnum::cowbell; } - else if( value == "crash cymbals" ) { return MetalEnum::crashCymbals; } - else if( value == "crotale" ) { return MetalEnum::crotale; } - else if( value == "cymbal tongs" ) { return MetalEnum::cymbalTongs; } - else if( value == "domed gong" ) { return MetalEnum::domedGong; } - else if( value == "finger cymbals" ) { return MetalEnum::fingerCymbals; } - else if( value == "flexatone" ) { return MetalEnum::flexatone; } - else if( value == "gong" ) { return MetalEnum::gong; } - else if( value == "hi-hat" ) { return MetalEnum::hiHat; } - else if( value == "high-hat cymbals" ) { return MetalEnum::highHatCymbals; } - else if( value == "handbell" ) { return MetalEnum::handbell; } - else if( value == "sistrum" ) { return MetalEnum::sistrum; } - else if( value == "sizzle cymbal" ) { return MetalEnum::sizzleCymbal; } - else if( value == "sleigh bells" ) { return MetalEnum::sleighBells; } - else if( value == "suspended cymbal" ) { return MetalEnum::suspendedCymbal; } - else if( value == "tam tam" ) { return MetalEnum::tamTam; } - else if( value == "triangle" ) { return MetalEnum::triangle; } - else if( value == "Vietnamese hat" ) { return MetalEnum::vietnameseHat; } - return std::optional{}; - } - - std::string toString( const MetalEnum value ) - { - switch ( value ) - { - case MetalEnum::almglocken: { return "almglocken"; } - case MetalEnum::bell: { return "bell"; } - case MetalEnum::bellPlate: { return "bell plate"; } - case MetalEnum::brakeDrum: { return "brake drum"; } - case MetalEnum::chineseCymbal: { return "Chinese cymbal"; } - case MetalEnum::cowbell: { return "cowbell"; } - case MetalEnum::crashCymbals: { return "crash cymbals"; } - case MetalEnum::crotale: { return "crotale"; } - case MetalEnum::cymbalTongs: { return "cymbal tongs"; } - case MetalEnum::domedGong: { return "domed gong"; } - case MetalEnum::fingerCymbals: { return "finger cymbals"; } - case MetalEnum::flexatone: { return "flexatone"; } - case MetalEnum::gong: { return "gong"; } - case MetalEnum::hiHat: { return "hi-hat"; } - case MetalEnum::highHatCymbals: { return "high-hat cymbals"; } - case MetalEnum::handbell: { return "handbell"; } - case MetalEnum::sistrum: { return "sistrum"; } - case MetalEnum::sizzleCymbal: { return "sizzle cymbal"; } - case MetalEnum::sleighBells: { return "sleigh bells"; } - case MetalEnum::suspendedCymbal: { return "suspended cymbal"; } - case MetalEnum::tamTam: { return "tam tam"; } - case MetalEnum::triangle: { return "triangle"; } - case MetalEnum::vietnameseHat: { return "Vietnamese hat"; } - default: break; - } - return "almglocken"; - } - - std::ostream& toStream( std::ostream& os, const MetalEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const MetalEnum value ) - { - return toStream( os, value ); - } - - /// ModeEnum /////////////////////////////////////////////////////////////////////////////// - - ModeEnum parseModeEnum( const std::string& value ) - { - const auto opt = tryParseModeEnum( value ); - return opt.value_or( ModeEnum::major ); - } - - std::optional tryParseModeEnum( const std::string& value ) - { - if( value == "major" ) { return ModeEnum::major; } - else if( value == "minor" ) { return ModeEnum::minor; } - else if( value == "dorian" ) { return ModeEnum::dorian; } - else if( value == "phrygian" ) { return ModeEnum::phrygian; } - else if( value == "lydian" ) { return ModeEnum::lydian; } - else if( value == "mixolydian" ) { return ModeEnum::mixolydian; } - else if( value == "aeolian" ) { return ModeEnum::aeolian; } - else if( value == "ionian" ) { return ModeEnum::ionian; } - else if( value == "locrian" ) { return ModeEnum::locrian; } - else if( value == "none" ) { return ModeEnum::none; } - else if( value == "other" ) { return ModeEnum::other; } - return std::optional{}; - } - - std::string toString( const ModeEnum value ) - { - switch ( value ) - { - case ModeEnum::major: { return "major"; } - case ModeEnum::minor: { return "minor"; } - case ModeEnum::dorian: { return "dorian"; } - case ModeEnum::phrygian: { return "phrygian"; } - case ModeEnum::lydian: { return "lydian"; } - case ModeEnum::mixolydian: { return "mixolydian"; } - case ModeEnum::aeolian: { return "aeolian"; } - case ModeEnum::ionian: { return "ionian"; } - case ModeEnum::locrian: { return "locrian"; } - case ModeEnum::none: { return "none"; } - default: break; - } - return "other"; - } - - std::ostream& toStream( std::ostream& os, const ModeEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ModeEnum value ) - { - return toStream( os, value ); - } - - ModeValue::ModeValue( const ModeEnum value ) - : myEnum( value ) - , myCustomValue( "" ) - { - setValue( value ); - } - - ModeValue::ModeValue( const std::string& value ) - : myEnum( ModeEnum::other ) - , myCustomValue( value ) - { - setValue( value ); - } - - ModeValue::ModeValue() - : myEnum( ModeEnum::major ) - , myCustomValue( "" ) - { - setValue( ModeEnum::major ); - } - - ModeEnum ModeValue::getValue() const - { - return myEnum; - } - - std::string ModeValue::getValueString() const - { - if ( myEnum != ModeEnum::other ) - { - return toString( myEnum ); - } - - else - { - return myCustomValue; - } - } - - void ModeValue::setValue( const ModeEnum value ) - { - myEnum = value; - if( value != ModeEnum::other && !myCustomValue.empty() ) - { - myCustomValue = ""; - } - } - - void ModeValue::setValue( const std::string& value ) - { - const auto temp = tryParseModeEnum( value ); - if ( temp ) - { - myEnum = temp.value(); - myCustomValue = ""; - } - else - { - setValue( ModeEnum::other ); - myCustomValue = value; - } - } - - ModeValue parseModeValue( const std::string& value ) - { - return ModeValue( value ); - } - - std::string toString( const ModeValue& value ) - { - return value.getValueString(); - } - - std::ostream& toStream( std::ostream& os, const ModeValue& value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ModeValue& value ) - { - return toStream( os, value ); - } - - /// MuteEnum /////////////////////////////////////////////////////////////////////////////// - - MuteEnum parseMuteEnum( const std::string& value ) - { - const auto opt = tryParseMuteEnum( value ); - return opt.value_or( MuteEnum::on ); - } - - std::optional tryParseMuteEnum( const std::string& value ) - { - if( value == "on" ) { return MuteEnum::on; } - else if( value == "off" ) { return MuteEnum::off; } - else if( value == "straight" ) { return MuteEnum::straight; } - else if( value == "cup" ) { return MuteEnum::cup; } - else if( value == "harmon-no-stem" ) { return MuteEnum::harmonNoStem; } - else if( value == "harmon-stem" ) { return MuteEnum::harmonStem; } - else if( value == "bucket" ) { return MuteEnum::bucket; } - else if( value == "plunger" ) { return MuteEnum::plunger; } - else if( value == "hat" ) { return MuteEnum::hat; } - else if( value == "solotone" ) { return MuteEnum::solotone; } - else if( value == "practice" ) { return MuteEnum::practice; } - else if( value == "stop-mute" ) { return MuteEnum::stopMute; } - else if( value == "stop-hand" ) { return MuteEnum::stopHand; } - else if( value == "echo" ) { return MuteEnum::echo; } - else if( value == "palm" ) { return MuteEnum::palm; } - return std::optional{}; - } - - std::string toString( const MuteEnum value ) - { - switch ( value ) - { - case MuteEnum::on: { return "on"; } - case MuteEnum::off: { return "off"; } - case MuteEnum::straight: { return "straight"; } - case MuteEnum::cup: { return "cup"; } - case MuteEnum::harmonNoStem: { return "harmon-no-stem"; } - case MuteEnum::harmonStem: { return "harmon-stem"; } - case MuteEnum::bucket: { return "bucket"; } - case MuteEnum::plunger: { return "plunger"; } - case MuteEnum::hat: { return "hat"; } - case MuteEnum::solotone: { return "solotone"; } - case MuteEnum::practice: { return "practice"; } - case MuteEnum::stopMute: { return "stop-mute"; } - case MuteEnum::stopHand: { return "stop-hand"; } - case MuteEnum::echo: { return "echo"; } - case MuteEnum::palm: { return "palm"; } - default: break; - } - return "on"; - } - - std::ostream& toStream( std::ostream& os, const MuteEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const MuteEnum value ) - { - return toStream( os, value ); - } - - /// NoteSizeType /////////////////////////////////////////////////////////////////////////// - - NoteSizeType parseNoteSizeType( const std::string& value ) - { - const auto opt = tryParseNoteSizeType( value ); - return opt.value_or( NoteSizeType::cue ); - } - - std::optional tryParseNoteSizeType( const std::string& value ) - { - if( value == "cue" ) { return NoteSizeType::cue; } - else if( value == "grace" ) { return NoteSizeType::grace; } - else if( value == "large" ) { return NoteSizeType::large; } - return std::optional{}; - } - - std::string toString( const NoteSizeType value ) - { - switch ( value ) - { - case NoteSizeType::cue: { return "cue"; } - case NoteSizeType::grace: { return "grace"; } - case NoteSizeType::large: { return "large"; } - default: break; - } - return "cue"; - } - - std::ostream& toStream( std::ostream& os, const NoteSizeType value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const NoteSizeType value ) - { - return toStream( os, value ); - } - - /// NoteTypeValue ////////////////////////////////////////////////////////////////////////// - - NoteTypeValue parseNoteTypeValue( const std::string& value ) - { - const auto opt = tryParseNoteTypeValue( value ); - return opt.value_or( NoteTypeValue::oneThousandTwentyFourth ); - } - - std::optional tryParseNoteTypeValue( const std::string& value ) - { - if( value == "1024th" ) { return NoteTypeValue::oneThousandTwentyFourth; } - else if( value == "512th" ) { return NoteTypeValue::fiveHundredTwelfth; } - else if( value == "256th" ) { return NoteTypeValue::twoHundredFifthySixth; } - else if( value == "128th" ) { return NoteTypeValue::oneHundredTwentyEighth; } - else if( value == "64th" ) { return NoteTypeValue::sixtyFourth; } - else if( value == "32nd" ) { return NoteTypeValue::thirtySecond; } - else if( value == "16th" ) { return NoteTypeValue::sixteenth; } - else if( value == "eighth" ) { return NoteTypeValue::eighth; } - else if( value == "quarter" ) { return NoteTypeValue::quarter; } - else if( value == "half" ) { return NoteTypeValue::half; } - else if( value == "whole" ) { return NoteTypeValue::whole; } - else if( value == "breve" ) { return NoteTypeValue::breve; } - else if( value == "long" ) { return NoteTypeValue::long_; } - else if( value == "maxima" ) { return NoteTypeValue::maxima; } - return std::optional{}; - } - - std::string toString( const NoteTypeValue value ) - { - switch ( value ) - { - case NoteTypeValue::oneThousandTwentyFourth: { return "1024th"; } - case NoteTypeValue::fiveHundredTwelfth: { return "512th"; } - case NoteTypeValue::twoHundredFifthySixth: { return "256th"; } - case NoteTypeValue::oneHundredTwentyEighth: { return "128th"; } - case NoteTypeValue::sixtyFourth: { return "64th"; } - case NoteTypeValue::thirtySecond: { return "32nd"; } - case NoteTypeValue::sixteenth: { return "16th"; } - case NoteTypeValue::eighth: { return "eighth"; } - case NoteTypeValue::quarter: { return "quarter"; } - case NoteTypeValue::half: { return "half"; } - case NoteTypeValue::whole: { return "whole"; } - case NoteTypeValue::breve: { return "breve"; } - case NoteTypeValue::long_: { return "long"; } - case NoteTypeValue::maxima: { return "maxima"; } - default: break; - } - return "1024th"; - } - - std::ostream& toStream( std::ostream& os, const NoteTypeValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const NoteTypeValue value ) - { - return toStream( os, value ); - } - - /// NoteheadValue ////////////////////////////////////////////////////////////////////////// - - NoteheadValue parseNoteheadValue( const std::string& value ) - { - const auto opt = tryParseNoteheadValue( value ); - return opt.value_or( NoteheadValue::slash ); - } - - std::optional tryParseNoteheadValue( const std::string& value ) - { - if( value == "slash" ) { return NoteheadValue::slash; } - else if( value == "triangle" ) { return NoteheadValue::triangle; } - else if( value == "diamond" ) { return NoteheadValue::diamond; } - else if( value == "square" ) { return NoteheadValue::square; } - else if( value == "cross" ) { return NoteheadValue::cross; } - else if( value == "x" ) { return NoteheadValue::x; } - else if( value == "circle-x" ) { return NoteheadValue::circleX; } - else if( value == "inverted triangle" ) { return NoteheadValue::invertedTriangle; } - else if( value == "arrow down" ) { return NoteheadValue::arrowDown; } - else if( value == "arrow up" ) { return NoteheadValue::arrowUp; } - else if( value == "slashed" ) { return NoteheadValue::slashed; } - else if( value == "back slashed" ) { return NoteheadValue::backSlashed; } - else if( value == "normal" ) { return NoteheadValue::normal; } - else if( value == "cluster" ) { return NoteheadValue::cluster; } - else if( value == "circle dot" ) { return NoteheadValue::circleDot; } - else if( value == "left triangle" ) { return NoteheadValue::leftTriangle; } - else if( value == "rectangle" ) { return NoteheadValue::rectangle; } - else if( value == "none" ) { return NoteheadValue::none; } - else if( value == "do" ) { return NoteheadValue::do_; } - else if( value == "re" ) { return NoteheadValue::re; } - else if( value == "mi" ) { return NoteheadValue::mi; } - else if( value == "fa" ) { return NoteheadValue::fa; } - else if( value == "fa up" ) { return NoteheadValue::faUp; } - else if( value == "so" ) { return NoteheadValue::so; } - else if( value == "la" ) { return NoteheadValue::la; } - else if( value == "ti" ) { return NoteheadValue::ti; } - return std::optional{}; - } - - std::string toString( const NoteheadValue value ) - { - switch ( value ) - { - case NoteheadValue::slash: { return "slash"; } - case NoteheadValue::triangle: { return "triangle"; } - case NoteheadValue::diamond: { return "diamond"; } - case NoteheadValue::square: { return "square"; } - case NoteheadValue::cross: { return "cross"; } - case NoteheadValue::x: { return "x"; } - case NoteheadValue::circleX: { return "circle-x"; } - case NoteheadValue::invertedTriangle: { return "inverted triangle"; } - case NoteheadValue::arrowDown: { return "arrow down"; } - case NoteheadValue::arrowUp: { return "arrow up"; } - case NoteheadValue::slashed: { return "slashed"; } - case NoteheadValue::backSlashed: { return "back slashed"; } - case NoteheadValue::normal: { return "normal"; } - case NoteheadValue::cluster: { return "cluster"; } - case NoteheadValue::circleDot: { return "circle dot"; } - case NoteheadValue::leftTriangle: { return "left triangle"; } - case NoteheadValue::rectangle: { return "rectangle"; } - case NoteheadValue::none: { return "none"; } - case NoteheadValue::do_: { return "do"; } - case NoteheadValue::re: { return "re"; } - case NoteheadValue::mi: { return "mi"; } - case NoteheadValue::fa: { return "fa"; } - case NoteheadValue::faUp: { return "fa up"; } - case NoteheadValue::so: { return "so"; } - case NoteheadValue::la: { return "la"; } - case NoteheadValue::ti: { return "ti"; } - default: break; - } - return "slash"; - } - - std::ostream& toStream( std::ostream& os, const NoteheadValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const NoteheadValue value ) - { - return toStream( os, value ); - } - - /// OnOff ////////////////////////////////////////////////////////////////////////////////// - - OnOff parseOnOff( const std::string& value ) - { - const auto opt = tryParseOnOff( value ); - return opt.value_or( OnOff::on ); - } - - std::optional tryParseOnOff( const std::string& value ) - { - if( value == "on" ) { return OnOff::on; } - else if( value == "off" ) { return OnOff::off; } - return std::optional{}; - } - - std::string toString( const OnOff value ) - { - switch ( value ) - { - case OnOff::on: { return "on"; } - case OnOff::off: { return "off"; } - default: break; - } - return "on"; - } - - std::ostream& toStream( std::ostream& os, const OnOff value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const OnOff value ) - { - return toStream( os, value ); - } - - /// OverUnder ////////////////////////////////////////////////////////////////////////////// - - OverUnder parseOverUnder( const std::string& value ) - { - const auto opt = tryParseOverUnder( value ); - return opt.value_or( OverUnder::over ); - } - - std::optional tryParseOverUnder( const std::string& value ) - { - if( value == "over" ) { return OverUnder::over; } - else if( value == "under" ) { return OverUnder::under; } - return std::optional{}; - } - - std::string toString( const OverUnder value ) - { - switch ( value ) - { - case OverUnder::over: { return "over"; } - case OverUnder::under: { return "under"; } - default: break; - } - return "over"; - } - - std::ostream& toStream( std::ostream& os, const OverUnder value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const OverUnder value ) - { - return toStream( os, value ); - } - - /// PitchedEnum //////////////////////////////////////////////////////////////////////////// - - PitchedEnum parsePitchedEnum( const std::string& value ) - { - const auto opt = tryParsePitchedEnum( value ); - return opt.value_or( PitchedEnum::chimes ); - } - - std::optional tryParsePitchedEnum( const std::string& value ) - { - if( value == "chimes" ) { return PitchedEnum::chimes; } - else if( value == "glockenspiel" ) { return PitchedEnum::glockenspiel; } - else if( value == "mallet" ) { return PitchedEnum::mallet; } - else if( value == "marimba" ) { return PitchedEnum::marimba; } - else if( value == "tubular chimes" ) { return PitchedEnum::tubularChimes; } - else if( value == "vibraphone" ) { return PitchedEnum::vibraphone; } - else if( value == "xylophone" ) { return PitchedEnum::xylophone; } - return std::optional{}; - } - - std::string toString( const PitchedEnum value ) - { - switch ( value ) - { - case PitchedEnum::chimes: { return "chimes"; } - case PitchedEnum::glockenspiel: { return "glockenspiel"; } - case PitchedEnum::mallet: { return "mallet"; } - case PitchedEnum::marimba: { return "marimba"; } - case PitchedEnum::tubularChimes: { return "tubular chimes"; } - case PitchedEnum::vibraphone: { return "vibraphone"; } - case PitchedEnum::xylophone: { return "xylophone"; } - default: break; - } - return "chimes"; - } - - std::ostream& toStream( std::ostream& os, const PitchedEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const PitchedEnum value ) - { - return toStream( os, value ); - } - - /// PrincipalVoiceSymbol /////////////////////////////////////////////////////////////////// - - PrincipalVoiceSymbol parsePrincipalVoiceSymbol( const std::string& value ) - { - const auto opt = tryParsePrincipalVoiceSymbol( value ); - return opt.value_or( PrincipalVoiceSymbol::hauptstimme ); - } - - std::optional tryParsePrincipalVoiceSymbol( const std::string& value ) - { - if( value == "Hauptstimme" ) { return PrincipalVoiceSymbol::hauptstimme; } - else if( value == "Nebenstimme" ) { return PrincipalVoiceSymbol::nebenstimme; } - else if( value == "plain" ) { return PrincipalVoiceSymbol::plain; } - else if( value == "none" ) { return PrincipalVoiceSymbol::none; } - return std::optional{}; - } - - std::string toString( const PrincipalVoiceSymbol value ) - { - switch ( value ) - { - case PrincipalVoiceSymbol::hauptstimme: { return "Hauptstimme"; } - case PrincipalVoiceSymbol::nebenstimme: { return "Nebenstimme"; } - case PrincipalVoiceSymbol::plain: { return "plain"; } - case PrincipalVoiceSymbol::none: { return "none"; } - default: break; - } - return "Hauptstimme"; - } - - std::ostream& toStream( std::ostream& os, const PrincipalVoiceSymbol value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const PrincipalVoiceSymbol value ) - { - return toStream( os, value ); - } - - /// RightLeftMiddle //////////////////////////////////////////////////////////////////////// - - RightLeftMiddle parseRightLeftMiddle( const std::string& value ) - { - const auto opt = tryParseRightLeftMiddle( value ); - return opt.value_or( RightLeftMiddle::right ); - } - - std::optional tryParseRightLeftMiddle( const std::string& value ) - { - if( value == "right" ) { return RightLeftMiddle::right; } - else if( value == "left" ) { return RightLeftMiddle::left; } - else if( value == "middle" ) { return RightLeftMiddle::middle; } - return std::optional{}; - } - - std::string toString( const RightLeftMiddle value ) - { - switch ( value ) - { - case RightLeftMiddle::right: { return "right"; } - case RightLeftMiddle::left: { return "left"; } - case RightLeftMiddle::middle: { return "middle"; } - default: break; - } - return "right"; - } - - std::ostream& toStream( std::ostream& os, const RightLeftMiddle value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const RightLeftMiddle value ) - { - return toStream( os, value ); - } - - /// SemiPitchedEnum //////////////////////////////////////////////////////////////////////// - - SemiPitchedEnum parseSemiPitchedEnum( const std::string& value ) - { - const auto opt = tryParseSemiPitchedEnum( value ); - return opt.value_or( SemiPitchedEnum::high ); - } - - std::optional tryParseSemiPitchedEnum( const std::string& value ) - { - if( value == "high" ) { return SemiPitchedEnum::high; } - else if( value == "medium-high" ) { return SemiPitchedEnum::mediumHigh; } - else if( value == "medium" ) { return SemiPitchedEnum::medium; } - else if( value == "medium-low" ) { return SemiPitchedEnum::mediumLow; } - else if( value == "low" ) { return SemiPitchedEnum::low; } - else if( value == "very-low" ) { return SemiPitchedEnum::veryLow; } - return std::optional{}; - } - - std::string toString( const SemiPitchedEnum value ) - { - switch ( value ) - { - case SemiPitchedEnum::high: { return "high"; } - case SemiPitchedEnum::mediumHigh: { return "medium-high"; } - case SemiPitchedEnum::medium: { return "medium"; } - case SemiPitchedEnum::mediumLow: { return "medium-low"; } - case SemiPitchedEnum::low: { return "low"; } - case SemiPitchedEnum::veryLow: { return "very-low"; } - default: break; - } - return "high"; - } - - std::ostream& toStream( std::ostream& os, const SemiPitchedEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const SemiPitchedEnum value ) - { - return toStream( os, value ); - } - - /// ShowFrets ////////////////////////////////////////////////////////////////////////////// - - ShowFrets parseShowFrets( const std::string& value ) - { - const auto opt = tryParseShowFrets( value ); - return opt.value_or( ShowFrets::numbers ); - } - - std::optional tryParseShowFrets( const std::string& value ) - { - if( value == "numbers" ) { return ShowFrets::numbers; } - else if( value == "letters" ) { return ShowFrets::letters; } - return std::optional{}; - } - - std::string toString( const ShowFrets value ) - { - switch ( value ) - { - case ShowFrets::numbers: { return "numbers"; } - case ShowFrets::letters: { return "letters"; } - default: break; - } - return "numbers"; - } - - std::ostream& toStream( std::ostream& os, const ShowFrets value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ShowFrets value ) - { - return toStream( os, value ); - } - - /// ShowTuplet ///////////////////////////////////////////////////////////////////////////// - - ShowTuplet parseShowTuplet( const std::string& value ) - { - const auto opt = tryParseShowTuplet( value ); - return opt.value_or( ShowTuplet::actual ); - } - - std::optional tryParseShowTuplet( const std::string& value ) - { - if( value == "actual" ) { return ShowTuplet::actual; } - else if( value == "both" ) { return ShowTuplet::both; } - else if( value == "none" ) { return ShowTuplet::none; } - return std::optional{}; - } - - std::string toString( const ShowTuplet value ) - { - switch ( value ) - { - case ShowTuplet::actual: { return "actual"; } - case ShowTuplet::both: { return "both"; } - case ShowTuplet::none: { return "none"; } - default: break; - } - return "actual"; - } - - std::ostream& toStream( std::ostream& os, const ShowTuplet value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ShowTuplet value ) - { - return toStream( os, value ); - } - - /// StaffTypeEnum ////////////////////////////////////////////////////////////////////////// - - StaffTypeEnum parseStaffTypeEnum( const std::string& value ) - { - const auto opt = tryParseStaffTypeEnum( value ); - return opt.value_or( StaffTypeEnum::ossia ); - } - - std::optional tryParseStaffTypeEnum( const std::string& value ) - { - if( value == "ossia" ) { return StaffTypeEnum::ossia; } - else if( value == "cue" ) { return StaffTypeEnum::cue; } - else if( value == "editorial" ) { return StaffTypeEnum::editorial; } - else if( value == "regular" ) { return StaffTypeEnum::regular; } - else if( value == "alternate" ) { return StaffTypeEnum::alternate; } - return std::optional{}; - } - - std::string toString( const StaffTypeEnum value ) - { - switch ( value ) - { - case StaffTypeEnum::ossia: { return "ossia"; } - case StaffTypeEnum::cue: { return "cue"; } - case StaffTypeEnum::editorial: { return "editorial"; } - case StaffTypeEnum::regular: { return "regular"; } - case StaffTypeEnum::alternate: { return "alternate"; } - default: break; - } - return "ossia"; - } - - std::ostream& toStream( std::ostream& os, const StaffTypeEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StaffTypeEnum value ) - { - return toStream( os, value ); - } - - /// StartNote ////////////////////////////////////////////////////////////////////////////// - - StartNote parseStartNote( const std::string& value ) - { - const auto opt = tryParseStartNote( value ); - return opt.value_or( StartNote::upper ); - } - - std::optional tryParseStartNote( const std::string& value ) - { - if( value == "upper" ) { return StartNote::upper; } - else if( value == "main" ) { return StartNote::main; } - else if( value == "below" ) { return StartNote::below; } - return std::optional{}; - } - - std::string toString( const StartNote value ) - { - switch ( value ) - { - case StartNote::upper: { return "upper"; } - case StartNote::main: { return "main"; } - case StartNote::below: { return "below"; } - default: break; - } - return "upper"; - } - - std::ostream& toStream( std::ostream& os, const StartNote value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StartNote value ) - { - return toStream( os, value ); - } - - /// StartStop ////////////////////////////////////////////////////////////////////////////// - - StartStop parseStartStop( const std::string& value ) - { - const auto opt = tryParseStartStop( value ); - return opt.value_or( StartStop::start ); - } - - std::optional tryParseStartStop( const std::string& value ) - { - if( value == "start" ) { return StartStop::start; } - else if( value == "stop" ) { return StartStop::stop; } - return std::optional{}; - } - - std::string toString( const StartStop value ) - { - switch ( value ) - { - case StartStop::start: { return "start"; } - case StartStop::stop: { return "stop"; } - default: break; - } - return "start"; - } - - std::ostream& toStream( std::ostream& os, const StartStop value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StartStop value ) - { - return toStream( os, value ); - } - - /// StartStopChangeContinue //////////////////////////////////////////////////////////////// - - StartStopChangeContinue parseStartStopChangeContinue( const std::string& value ) - { - const auto opt = tryParseStartStopChangeContinue( value ); - return opt.value_or( StartStopChangeContinue::start ); - } - - std::optional tryParseStartStopChangeContinue( const std::string& value ) - { - if( value == "start" ) { return StartStopChangeContinue::start; } - else if( value == "stop" ) { return StartStopChangeContinue::stop; } - else if( value == "change" ) { return StartStopChangeContinue::change; } - else if( value == "continue" ) { return StartStopChangeContinue::continue_; } - return std::optional{}; - } - - std::string toString( const StartStopChangeContinue value ) - { - switch ( value ) - { - case StartStopChangeContinue::start: { return "start"; } - case StartStopChangeContinue::stop: { return "stop"; } - case StartStopChangeContinue::change: { return "change"; } - case StartStopChangeContinue::continue_: { return "continue"; } - default: break; - } - return "start"; - } - - std::ostream& toStream( std::ostream& os, const StartStopChangeContinue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StartStopChangeContinue value ) - { - return toStream( os, value ); - } - - /// StartStopContinue ////////////////////////////////////////////////////////////////////// - - StartStopContinue parseStartStopContinue( const std::string& value ) - { - const auto opt = tryParseStartStopContinue( value ); - return opt.value_or( StartStopContinue::start ); - } - - std::optional tryParseStartStopContinue( const std::string& value ) - { - if( value == "start" ) { return StartStopContinue::start; } - else if( value == "stop" ) { return StartStopContinue::stop; } - else if( value == "continue" ) { return StartStopContinue::continue_; } - return std::optional{}; - } - - std::string toString( const StartStopContinue value ) - { - switch ( value ) - { - case StartStopContinue::start: { return "start"; } - case StartStopContinue::stop: { return "stop"; } - case StartStopContinue::continue_: { return "continue"; } - default: break; - } - return "start"; - } - - std::ostream& toStream( std::ostream& os, const StartStopContinue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StartStopContinue value ) - { - return toStream( os, value ); - } - - /// StartStopDiscontinue /////////////////////////////////////////////////////////////////// - - StartStopDiscontinue parseStartStopDiscontinue( const std::string& value ) - { - const auto opt = tryParseStartStopDiscontinue( value ); - return opt.value_or( StartStopDiscontinue::start ); - } - - std::optional tryParseStartStopDiscontinue( const std::string& value ) - { - if( value == "start" ) { return StartStopDiscontinue::start; } - else if( value == "stop" ) { return StartStopDiscontinue::stop; } - else if( value == "discontinue" ) { return StartStopDiscontinue::discontinue; } - return std::optional{}; - } - - std::string toString( const StartStopDiscontinue value ) - { - switch ( value ) - { - case StartStopDiscontinue::start: { return "start"; } - case StartStopDiscontinue::stop: { return "stop"; } - case StartStopDiscontinue::discontinue: { return "discontinue"; } - default: break; - } - return "start"; - } - - std::ostream& toStream( std::ostream& os, const StartStopDiscontinue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StartStopDiscontinue value ) - { - return toStream( os, value ); - } - - /// StartStopSingle //////////////////////////////////////////////////////////////////////// - - StartStopSingle parseStartStopSingle( const std::string& value ) - { - const auto opt = tryParseStartStopSingle( value ); - return opt.value_or( StartStopSingle::start ); - } - - std::optional tryParseStartStopSingle( const std::string& value ) - { - if( value == "start" ) { return StartStopSingle::start; } - else if( value == "stop" ) { return StartStopSingle::stop; } - else if( value == "single" ) { return StartStopSingle::single; } - return std::optional{}; - } - - std::string toString( const StartStopSingle value ) - { - switch ( value ) - { - case StartStopSingle::start: { return "start"; } - case StartStopSingle::stop: { return "stop"; } - case StartStopSingle::single: { return "single"; } - default: break; - } - return "start"; - } - - std::ostream& toStream( std::ostream& os, const StartStopSingle value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StartStopSingle value ) - { - return toStream( os, value ); - } - - /// StemValue ////////////////////////////////////////////////////////////////////////////// - - StemValue parseStemValue( const std::string& value ) - { - const auto opt = tryParseStemValue( value ); - return opt.value_or( StemValue::down ); - } - - std::optional tryParseStemValue( const std::string& value ) - { - if( value == "down" ) { return StemValue::down; } - else if( value == "up" ) { return StemValue::up; } - else if( value == "double" ) { return StemValue::double_; } - else if( value == "none" ) { return StemValue::none; } - return std::optional{}; - } - - std::string toString( const StemValue value ) - { - switch ( value ) - { - case StemValue::down: { return "down"; } - case StemValue::up: { return "up"; } - case StemValue::double_: { return "double"; } - case StemValue::none: { return "none"; } - default: break; - } - return "down"; - } - - std::ostream& toStream( std::ostream& os, const StemValue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StemValue value ) - { - return toStream( os, value ); - } - - /// StepEnum /////////////////////////////////////////////////////////////////////////////// - - StepEnum parseStepEnum( const std::string& value ) - { - const auto opt = tryParseStepEnum( value ); - return opt.value_or( StepEnum::a ); - } - - std::optional tryParseStepEnum( const std::string& value ) - { - if( value == "A" ) { return StepEnum::a; } - else if( value == "B" ) { return StepEnum::b; } - else if( value == "C" ) { return StepEnum::c; } - else if( value == "D" ) { return StepEnum::d; } - else if( value == "E" ) { return StepEnum::e; } - else if( value == "F" ) { return StepEnum::f; } - else if( value == "G" ) { return StepEnum::g; } - return std::optional{}; - } - - std::string toString( const StepEnum value ) - { - switch ( value ) - { - case StepEnum::a: { return "A"; } - case StepEnum::b: { return "B"; } - case StepEnum::c: { return "C"; } - case StepEnum::d: { return "D"; } - case StepEnum::e: { return "E"; } - case StepEnum::f: { return "F"; } - case StepEnum::g: { return "G"; } - default: break; - } - return "A"; - } - - std::ostream& toStream( std::ostream& os, const StepEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StepEnum value ) - { - return toStream( os, value ); - } - - /// StickLocationEnum ////////////////////////////////////////////////////////////////////// - - StickLocationEnum parseStickLocationEnum( const std::string& value ) - { - const auto opt = tryParseStickLocationEnum( value ); - return opt.value_or( StickLocationEnum::center ); - } - - std::optional tryParseStickLocationEnum( const std::string& value ) - { - if( value == "center" ) { return StickLocationEnum::center; } - else if( value == "rim" ) { return StickLocationEnum::rim; } - else if( value == "cymbal bell" ) { return StickLocationEnum::cymbalBell; } - else if( value == "cymbal edge" ) { return StickLocationEnum::cymbalEdge; } - return std::optional{}; - } - - std::string toString( const StickLocationEnum value ) - { - switch ( value ) - { - case StickLocationEnum::center: { return "center"; } - case StickLocationEnum::rim: { return "rim"; } - case StickLocationEnum::cymbalBell: { return "cymbal bell"; } - case StickLocationEnum::cymbalEdge: { return "cymbal edge"; } - default: break; - } - return "center"; - } - - std::ostream& toStream( std::ostream& os, const StickLocationEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StickLocationEnum value ) - { - return toStream( os, value ); - } - - /// StickMaterialEnum ////////////////////////////////////////////////////////////////////// - - StickMaterialEnum parseStickMaterialEnum( const std::string& value ) - { - const auto opt = tryParseStickMaterialEnum( value ); - return opt.value_or( StickMaterialEnum::soft ); - } - - std::optional tryParseStickMaterialEnum( const std::string& value ) - { - if( value == "soft" ) { return StickMaterialEnum::soft; } - else if( value == "medium" ) { return StickMaterialEnum::medium; } - else if( value == "hard" ) { return StickMaterialEnum::hard; } - else if( value == "shaded" ) { return StickMaterialEnum::shaded; } - else if( value == "x" ) { return StickMaterialEnum::x; } - return std::optional{}; - } - - std::string toString( const StickMaterialEnum value ) - { - switch ( value ) - { - case StickMaterialEnum::soft: { return "soft"; } - case StickMaterialEnum::medium: { return "medium"; } - case StickMaterialEnum::hard: { return "hard"; } - case StickMaterialEnum::shaded: { return "shaded"; } - case StickMaterialEnum::x: { return "x"; } - default: break; - } - return "soft"; - } - - std::ostream& toStream( std::ostream& os, const StickMaterialEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StickMaterialEnum value ) - { - return toStream( os, value ); - } - - /// StickTypeEnum ////////////////////////////////////////////////////////////////////////// - - StickTypeEnum parseStickTypeEnum( const std::string& value ) - { - const auto opt = tryParseStickTypeEnum( value ); - return opt.value_or( StickTypeEnum::bassDrum ); - } - - std::optional tryParseStickTypeEnum( const std::string& value ) - { - if( value == "bass drum" ) { return StickTypeEnum::bassDrum; } - else if( value == "double bass drum" ) { return StickTypeEnum::doubleBassDrum; } - else if( value == "timpani" ) { return StickTypeEnum::timpani; } - else if( value == "xylophone" ) { return StickTypeEnum::xylophone; } - else if( value == "yarn" ) { return StickTypeEnum::yarn; } - return std::optional{}; - } - - std::string toString( const StickTypeEnum value ) - { - switch ( value ) - { - case StickTypeEnum::bassDrum: { return "bass drum"; } - case StickTypeEnum::doubleBassDrum: { return "double bass drum"; } - case StickTypeEnum::timpani: { return "timpani"; } - case StickTypeEnum::xylophone: { return "xylophone"; } - case StickTypeEnum::yarn: { return "yarn"; } - default: break; - } - return "bass drum"; - } - - std::ostream& toStream( std::ostream& os, const StickTypeEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const StickTypeEnum value ) - { - return toStream( os, value ); - } - - /// SyllabicEnum /////////////////////////////////////////////////////////////////////////// - - SyllabicEnum parseSyllabicEnum( const std::string& value ) - { - const auto opt = tryParseSyllabicEnum( value ); - return opt.value_or( SyllabicEnum::single ); - } - - std::optional tryParseSyllabicEnum( const std::string& value ) - { - if( value == "single" ) { return SyllabicEnum::single; } - else if( value == "begin" ) { return SyllabicEnum::begin; } - else if( value == "end" ) { return SyllabicEnum::end; } - else if( value == "middle" ) { return SyllabicEnum::middle; } - return std::optional{}; - } - - std::string toString( const SyllabicEnum value ) - { - switch ( value ) - { - case SyllabicEnum::single: { return "single"; } - case SyllabicEnum::begin: { return "begin"; } - case SyllabicEnum::end: { return "end"; } - case SyllabicEnum::middle: { return "middle"; } - default: break; - } - return "single"; - } - - std::ostream& toStream( std::ostream& os, const SyllabicEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const SyllabicEnum value ) - { - return toStream( os, value ); - } - - /// SymbolSize ///////////////////////////////////////////////////////////////////////////// - - SymbolSize parseSymbolSize( const std::string& value ) - { - const auto opt = tryParseSymbolSize( value ); - return opt.value_or( SymbolSize::full ); - } - - std::optional tryParseSymbolSize( const std::string& value ) - { - if( value == "full" ) { return SymbolSize::full; } - else if( value == "cue" ) { return SymbolSize::cue; } - else if( value == "large" ) { return SymbolSize::large; } - return std::optional{}; - } - - std::string toString( const SymbolSize value ) - { - switch ( value ) - { - case SymbolSize::full: { return "full"; } - case SymbolSize::cue: { return "cue"; } - case SymbolSize::large: { return "large"; } - default: break; - } - return "full"; - } - - std::ostream& toStream( std::ostream& os, const SymbolSize value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const SymbolSize value ) - { - return toStream( os, value ); - } - - /// TextDirection ////////////////////////////////////////////////////////////////////////// - - TextDirection parseTextDirection( const std::string& value ) - { - const auto opt = tryParseTextDirection( value ); - return opt.value_or( TextDirection::ltr ); - } - - std::optional tryParseTextDirection( const std::string& value ) - { - if( value == "ltr" ) { return TextDirection::ltr; } - else if( value == "rtl" ) { return TextDirection::rtl; } - else if( value == "lro" ) { return TextDirection::lro; } - else if( value == "rlo" ) { return TextDirection::rlo; } - return std::optional{}; - } - - std::string toString( const TextDirection value ) - { - switch ( value ) - { - case TextDirection::ltr: { return "ltr"; } - case TextDirection::rtl: { return "rtl"; } - case TextDirection::lro: { return "lro"; } - case TextDirection::rlo: { return "rlo"; } - default: break; - } - return "ltr"; - } - - std::ostream& toStream( std::ostream& os, const TextDirection value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TextDirection value ) - { - return toStream( os, value ); - } - - /// TimeRelationEnum /////////////////////////////////////////////////////////////////////// - - TimeRelationEnum parseTimeRelationEnum( const std::string& value ) - { - const auto opt = tryParseTimeRelationEnum( value ); - return opt.value_or( TimeRelationEnum::parentheses ); - } - - std::optional tryParseTimeRelationEnum( const std::string& value ) - { - if( value == "parentheses" ) { return TimeRelationEnum::parentheses; } - else if( value == "bracket" ) { return TimeRelationEnum::bracket; } - else if( value == "equals" ) { return TimeRelationEnum::equals; } - else if( value == "slash" ) { return TimeRelationEnum::slash; } - else if( value == "space" ) { return TimeRelationEnum::space; } - else if( value == "hyphen" ) { return TimeRelationEnum::hyphen; } - return std::optional{}; - } - - std::string toString( const TimeRelationEnum value ) - { - switch ( value ) - { - case TimeRelationEnum::parentheses: { return "parentheses"; } - case TimeRelationEnum::bracket: { return "bracket"; } - case TimeRelationEnum::equals: { return "equals"; } - case TimeRelationEnum::slash: { return "slash"; } - case TimeRelationEnum::space: { return "space"; } - case TimeRelationEnum::hyphen: { return "hyphen"; } - default: break; - } - return "parentheses"; - } - - std::ostream& toStream( std::ostream& os, const TimeRelationEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TimeRelationEnum value ) - { - return toStream( os, value ); - } - - /// TimeSeparator ////////////////////////////////////////////////////////////////////////// - - TimeSeparator parseTimeSeparator( const std::string& value ) - { - const auto opt = tryParseTimeSeparator( value ); - return opt.value_or( TimeSeparator::none ); - } - - std::optional tryParseTimeSeparator( const std::string& value ) - { - if( value == "none" ) { return TimeSeparator::none; } - else if( value == "horizontal" ) { return TimeSeparator::horizontal; } - else if( value == "diagonal" ) { return TimeSeparator::diagonal; } - else if( value == "vertical" ) { return TimeSeparator::vertical; } - else if( value == "adjacent" ) { return TimeSeparator::adjacent; } - return std::optional{}; - } - - std::string toString( const TimeSeparator value ) - { - switch ( value ) - { - case TimeSeparator::none: { return "none"; } - case TimeSeparator::horizontal: { return "horizontal"; } - case TimeSeparator::diagonal: { return "diagonal"; } - case TimeSeparator::vertical: { return "vertical"; } - case TimeSeparator::adjacent: { return "adjacent"; } - default: break; - } - return "none"; - } - - std::ostream& toStream( std::ostream& os, const TimeSeparator value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TimeSeparator value ) - { - return toStream( os, value ); - } - - /// TimeSymbol ///////////////////////////////////////////////////////////////////////////// - - TimeSymbol parseTimeSymbol( const std::string& value ) - { - const auto opt = tryParseTimeSymbol( value ); - return opt.value_or( TimeSymbol::common ); - } - - std::optional tryParseTimeSymbol( const std::string& value ) - { - if( value == "common" ) { return TimeSymbol::common; } - else if( value == "cut" ) { return TimeSymbol::cut; } - else if( value == "single-number" ) { return TimeSymbol::singleNumber; } - else if( value == "note" ) { return TimeSymbol::note; } - else if( value == "dotted-note" ) { return TimeSymbol::dottedNote; } - else if( value == "normal" ) { return TimeSymbol::normal; } - return std::optional{}; - } - - std::string toString( const TimeSymbol value ) - { - switch ( value ) - { - case TimeSymbol::common: { return "common"; } - case TimeSymbol::cut: { return "cut"; } - case TimeSymbol::singleNumber: { return "single-number"; } - case TimeSymbol::note: { return "note"; } - case TimeSymbol::dottedNote: { return "dotted-note"; } - case TimeSymbol::normal: { return "normal"; } - default: break; - } - return "common"; - } - - std::ostream& toStream( std::ostream& os, const TimeSymbol value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TimeSymbol value ) - { - return toStream( os, value ); - } - - /// TipDirection /////////////////////////////////////////////////////////////////////////// - - TipDirection parseTipDirection( const std::string& value ) - { - const auto opt = tryParseTipDirection( value ); - return opt.value_or( TipDirection::up ); - } - - std::optional tryParseTipDirection( const std::string& value ) - { - if( value == "up" ) { return TipDirection::up; } - else if( value == "down" ) { return TipDirection::down; } - else if( value == "left" ) { return TipDirection::left; } - else if( value == "right" ) { return TipDirection::right; } - else if( value == "northwest" ) { return TipDirection::northwest; } - else if( value == "northeast" ) { return TipDirection::northeast; } - else if( value == "southeast" ) { return TipDirection::southeast; } - else if( value == "southwest" ) { return TipDirection::southwest; } - return std::optional{}; - } - - std::string toString( const TipDirection value ) - { - switch ( value ) - { - case TipDirection::up: { return "up"; } - case TipDirection::down: { return "down"; } - case TipDirection::left: { return "left"; } - case TipDirection::right: { return "right"; } - case TipDirection::northwest: { return "northwest"; } - case TipDirection::northeast: { return "northeast"; } - case TipDirection::southeast: { return "southeast"; } - case TipDirection::southwest: { return "southwest"; } - default: break; - } - return "up"; - } - - std::ostream& toStream( std::ostream& os, const TipDirection value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TipDirection value ) - { - return toStream( os, value ); - } - - /// TopBottom ////////////////////////////////////////////////////////////////////////////// - - TopBottom parseTopBottom( const std::string& value ) - { - const auto opt = tryParseTopBottom( value ); - return opt.value_or( TopBottom::top ); - } - - std::optional tryParseTopBottom( const std::string& value ) - { - if( value == "top" ) { return TopBottom::top; } - else if( value == "bottom" ) { return TopBottom::bottom; } - return std::optional{}; - } - - std::string toString( const TopBottom value ) - { - switch ( value ) - { - case TopBottom::top: { return "top"; } - case TopBottom::bottom: { return "bottom"; } - default: break; - } - return "top"; - } - - std::ostream& toStream( std::ostream& os, const TopBottom value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TopBottom value ) - { - return toStream( os, value ); - } - - /// TrillStep ////////////////////////////////////////////////////////////////////////////// - - TrillStep parseTrillStep( const std::string& value ) - { - const auto opt = tryParseTrillStep( value ); - return opt.value_or( TrillStep::whole ); - } - - std::optional tryParseTrillStep( const std::string& value ) - { - if( value == "whole" ) { return TrillStep::whole; } - else if( value == "half" ) { return TrillStep::half; } - else if( value == "unison" ) { return TrillStep::unison; } - return std::optional{}; - } - - std::string toString( const TrillStep value ) - { - switch ( value ) - { - case TrillStep::whole: { return "whole"; } - case TrillStep::half: { return "half"; } - case TrillStep::unison: { return "unison"; } - default: break; - } - return "whole"; - } - - std::ostream& toStream( std::ostream& os, const TrillStep value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TrillStep value ) - { - return toStream( os, value ); - } - - /// TwoNoteTurn //////////////////////////////////////////////////////////////////////////// - - TwoNoteTurn parseTwoNoteTurn( const std::string& value ) - { - const auto opt = tryParseTwoNoteTurn( value ); - return opt.value_or( TwoNoteTurn::whole ); - } - - std::optional tryParseTwoNoteTurn( const std::string& value ) - { - if( value == "whole" ) { return TwoNoteTurn::whole; } - else if( value == "half" ) { return TwoNoteTurn::half; } - else if( value == "none" ) { return TwoNoteTurn::none; } - return std::optional{}; - } - - std::string toString( const TwoNoteTurn value ) - { - switch ( value ) - { - case TwoNoteTurn::whole: { return "whole"; } - case TwoNoteTurn::half: { return "half"; } - case TwoNoteTurn::none: { return "none"; } - default: break; - } - return "whole"; - } - - std::ostream& toStream( std::ostream& os, const TwoNoteTurn value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const TwoNoteTurn value ) - { - return toStream( os, value ); - } - - /// UpDown ///////////////////////////////////////////////////////////////////////////////// - - UpDown parseUpDown( const std::string& value ) - { - const auto opt = tryParseUpDown( value ); - return opt.value_or( UpDown::up ); - } - - std::optional tryParseUpDown( const std::string& value ) - { - if( value == "up" ) { return UpDown::up; } - else if( value == "down" ) { return UpDown::down; } - return std::optional{}; - } - - std::string toString( const UpDown value ) - { - switch ( value ) - { - case UpDown::up: { return "up"; } - case UpDown::down: { return "down"; } - default: break; - } - return "up"; - } - - std::ostream& toStream( std::ostream& os, const UpDown value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const UpDown value ) - { - return toStream( os, value ); - } - - /// UpDownStopContinue ///////////////////////////////////////////////////////////////////// - - UpDownStopContinue parseUpDownStopContinue( const std::string& value ) - { - const auto opt = tryParseUpDownStopContinue( value ); - return opt.value_or( UpDownStopContinue::up ); - } - - std::optional tryParseUpDownStopContinue( const std::string& value ) - { - if( value == "up" ) { return UpDownStopContinue::up; } - else if( value == "down" ) { return UpDownStopContinue::down; } - else if( value == "stop" ) { return UpDownStopContinue::stop; } - else if( value == "continue" ) { return UpDownStopContinue::continue_; } - return std::optional{}; - } - - std::string toString( const UpDownStopContinue value ) - { - switch ( value ) - { - case UpDownStopContinue::up: { return "up"; } - case UpDownStopContinue::down: { return "down"; } - case UpDownStopContinue::stop: { return "stop"; } - case UpDownStopContinue::continue_: { return "continue"; } - default: break; - } - return "up"; - } - - std::ostream& toStream( std::ostream& os, const UpDownStopContinue value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const UpDownStopContinue value ) - { - return toStream( os, value ); - } - - /// UprightInverted //////////////////////////////////////////////////////////////////////// - - UprightInverted parseUprightInverted( const std::string& value ) - { - const auto opt = tryParseUprightInverted( value ); - return opt.value_or( UprightInverted::upright ); - } - - std::optional tryParseUprightInverted( const std::string& value ) - { - if( value == "upright" ) { return UprightInverted::upright; } - else if( value == "inverted" ) { return UprightInverted::inverted; } - return std::optional{}; - } - - std::string toString( const UprightInverted value ) - { - switch ( value ) - { - case UprightInverted::upright: { return "upright"; } - case UprightInverted::inverted: { return "inverted"; } - default: break; - } - return "upright"; - } - - std::ostream& toStream( std::ostream& os, const UprightInverted value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const UprightInverted value ) - { - return toStream( os, value ); - } - - /// Valign ///////////////////////////////////////////////////////////////////////////////// - - Valign parseValign( const std::string& value ) - { - const auto opt = tryParseValign( value ); - return opt.value_or( Valign::top ); - } - - std::optional tryParseValign( const std::string& value ) - { - if( value == "top" ) { return Valign::top; } - else if( value == "middle" ) { return Valign::middle; } - else if( value == "bottom" ) { return Valign::bottom; } - else if( value == "baseline" ) { return Valign::baseline; } - return std::optional{}; - } - - std::string toString( const Valign value ) - { - switch ( value ) - { - case Valign::top: { return "top"; } - case Valign::middle: { return "middle"; } - case Valign::bottom: { return "bottom"; } - case Valign::baseline: { return "baseline"; } - default: break; - } - return "top"; - } - - std::ostream& toStream( std::ostream& os, const Valign value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const Valign value ) - { - return toStream( os, value ); - } - - /// ValignImage //////////////////////////////////////////////////////////////////////////// - - ValignImage parseValignImage( const std::string& value ) - { - const auto opt = tryParseValignImage( value ); - return opt.value_or( ValignImage::top ); - } - - std::optional tryParseValignImage( const std::string& value ) - { - if( value == "top" ) { return ValignImage::top; } - else if( value == "middle" ) { return ValignImage::middle; } - else if( value == "bottom" ) { return ValignImage::bottom; } - return std::optional{}; - } - - std::string toString( const ValignImage value ) - { - switch ( value ) - { - case ValignImage::top: { return "top"; } - case ValignImage::middle: { return "middle"; } - case ValignImage::bottom: { return "bottom"; } - default: break; - } - return "top"; - } - - std::ostream& toStream( std::ostream& os, const ValignImage value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const ValignImage value ) - { - return toStream( os, value ); - } - - /// WedgeType ////////////////////////////////////////////////////////////////////////////// - - WedgeType parseWedgeType( const std::string& value ) - { - const auto opt = tryParseWedgeType( value ); - return opt.value_or( WedgeType::crescendo ); - } - - std::optional tryParseWedgeType( const std::string& value ) - { - if( value == "crescendo" ) { return WedgeType::crescendo; } - else if( value == "diminuendo" ) { return WedgeType::diminuendo; } - else if( value == "stop" ) { return WedgeType::stop; } - else if( value == "continue" ) { return WedgeType::continue_; } - return std::optional{}; - } - - std::string toString( const WedgeType value ) - { - switch ( value ) - { - case WedgeType::crescendo: { return "crescendo"; } - case WedgeType::diminuendo: { return "diminuendo"; } - case WedgeType::stop: { return "stop"; } - case WedgeType::continue_: { return "continue"; } - default: break; - } - return "crescendo"; - } - - std::ostream& toStream( std::ostream& os, const WedgeType value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const WedgeType value ) - { - return toStream( os, value ); - } - - /// Winged ///////////////////////////////////////////////////////////////////////////////// - - Winged parseWinged( const std::string& value ) - { - const auto opt = tryParseWinged( value ); - return opt.value_or( Winged::none ); - } - - std::optional tryParseWinged( const std::string& value ) - { - if( value == "none" ) { return Winged::none; } - else if( value == "straight" ) { return Winged::straight; } - else if( value == "curved" ) { return Winged::curved; } - else if( value == "double-straight" ) { return Winged::doubleStraight; } - else if( value == "double-curved" ) { return Winged::doubleCurved; } - return std::optional{}; - } - - std::string toString( const Winged value ) - { - switch ( value ) - { - case Winged::none: { return "none"; } - case Winged::straight: { return "straight"; } - case Winged::curved: { return "curved"; } - case Winged::doubleStraight: { return "double-straight"; } - case Winged::doubleCurved: { return "double-curved"; } - default: break; - } - return "none"; - } - - std::ostream& toStream( std::ostream& os, const Winged value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const Winged value ) - { - return toStream( os, value ); - } - - /// WoodEnum /////////////////////////////////////////////////////////////////////////////// - - WoodEnum parseWoodEnum( const std::string& value ) - { - const auto opt = tryParseWoodEnum( value ); - return opt.value_or( WoodEnum::boardClapper ); - } - - std::optional tryParseWoodEnum( const std::string& value ) - { - if( value == "board clapper" ) { return WoodEnum::boardClapper; } - else if( value == "cabasa" ) { return WoodEnum::cabasa; } - else if( value == "castanets" ) { return WoodEnum::castanets; } - else if( value == "claves" ) { return WoodEnum::claves; } - else if( value == "guiro" ) { return WoodEnum::guiro; } - else if( value == "log drum" ) { return WoodEnum::logDrum; } - else if( value == "maraca" ) { return WoodEnum::maraca; } - else if( value == "maracas" ) { return WoodEnum::maracas; } - else if( value == "ratchet" ) { return WoodEnum::ratchet; } - else if( value == "sandpaper blocks" ) { return WoodEnum::sandpaperBlocks; } - else if( value == "slit drum" ) { return WoodEnum::slitDrum; } - else if( value == "temple block" ) { return WoodEnum::templeBlock; } - else if( value == "vibraslap" ) { return WoodEnum::vibraslap; } - else if( value == "wood block" ) { return WoodEnum::woodBlock; } - return std::optional{}; - } - - std::string toString( const WoodEnum value ) - { - switch ( value ) - { - case WoodEnum::boardClapper: { return "board clapper"; } - case WoodEnum::cabasa: { return "cabasa"; } - case WoodEnum::castanets: { return "castanets"; } - case WoodEnum::claves: { return "claves"; } - case WoodEnum::guiro: { return "guiro"; } - case WoodEnum::logDrum: { return "log drum"; } - case WoodEnum::maraca: { return "maraca"; } - case WoodEnum::maracas: { return "maracas"; } - case WoodEnum::ratchet: { return "ratchet"; } - case WoodEnum::sandpaperBlocks: { return "sandpaper blocks"; } - case WoodEnum::slitDrum: { return "slit drum"; } - case WoodEnum::templeBlock: { return "temple block"; } - case WoodEnum::vibraslap: { return "vibraslap"; } - case WoodEnum::woodBlock: { return "wood block"; } - default: break; - } - return "board clapper"; - } - - std::ostream& toStream( std::ostream& os, const WoodEnum value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const WoodEnum value ) - { - return toStream( os, value ); - } - - /// YesNo ////////////////////////////////////////////////////////////////////////////////// - - YesNo parseYesNo( const std::string& value ) - { - const auto opt = tryParseYesNo( value ); - return opt.value_or( YesNo::yes ); - } - - std::optional tryParseYesNo( const std::string& value ) - { - if( value == "yes" ) { return YesNo::yes; } - else if( value == "no" ) { return YesNo::no; } - return std::optional{}; - } - - std::string toString( const YesNo value ) - { - switch ( value ) - { - case YesNo::yes: { return "yes"; } - case YesNo::no: { return "no"; } - default: break; - } - return "yes"; - } - - std::ostream& toStream( std::ostream& os, const YesNo value ) - { - return os << toString( value ); - } - - std::ostream& operator<<( std::ostream& os, const YesNo value ) - { - return toStream( os, value ); - } - } -} diff --git a/Sourcecode/private/mx/core/Enums.h b/Sourcecode/private/mx/core/Enums.h deleted file mode 100644 index c60b29d53..000000000 --- a/Sourcecode/private/mx/core/Enums.h +++ /dev/null @@ -1,2046 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/EnumsBuiltin.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - /// AboveBelow ///////////////////////////////////////////////////////////////////////////// - /// - /// The above-below type is used to indicate whether one element appears above or below - /// another element. - /// - enum class AboveBelow - { - above = 0, - below = 1 - }; - - AboveBelow parseAboveBelow( const std::string& value ); - std::optional tryParseAboveBelow( const std::string& value ); - std::string toString( const AboveBelow value ); - std::ostream& toStream( std::ostream& os, const AboveBelow value ); - std::ostream& operator<<( std::ostream& os, const AboveBelow value ); - - /// AccidentalValue //////////////////////////////////////////////////////////////////////// - /// - /// The accidental-value type represents notated accidentals supported by MusicXML. In the - /// MusicXML 2.0 DTD this was a string with values that could be included. The XSD - /// strengthens the data typing to an enumerated list. The quarter- and three-quarters- - /// accidentals are Tartini-style quarter-tone accidentals. The -down and -up accidentals - /// are quarter-tone accidentals that include arrows pointing down or up. The slash- - /// accidentals are used in Turkish classical music. The numbered sharp and flat accidentals - /// are superscripted versions of the accidental signs, used in Turkish folk music. The sori - /// and koron accidentals are microtonal sharp and flat accidentals used in Iranian and - /// Persian music. - /// - enum class AccidentalValue - { - sharp = 0, - natural = 1, - flat = 2, - doubleSharp = 3, - sharpSharp = 4, - flatFlat = 5, - naturalSharp = 6, - naturalFlat = 7, - quarterFlat = 8, - quarterSharp = 9, - threeQuartersFlat = 10, - threeQuartersSharp = 11, - sharpDown = 12, - sharpUp = 13, - naturalDown = 14, - naturalUp = 15, - flatDown = 16, - flatUp = 17, - tripleSharp = 18, - tripleFlat = 19, - slashQuarterSharp = 20, - slashSharp = 21, - slashFlat = 22, - doubleSlashFlat = 23, - sharp1 = 24, - sharp2 = 25, - sharp3 = 26, - sharp5 = 27, - flat1 = 28, - flat2 = 29, - flat3 = 30, - flat4 = 31, - sori = 32, - koron = 33 - }; - - AccidentalValue parseAccidentalValue( const std::string& value ); - std::optional tryParseAccidentalValue( const std::string& value ); - std::string toString( const AccidentalValue value ); - std::ostream& toStream( std::ostream& os, const AccidentalValue value ); - std::ostream& operator<<( std::ostream& os, const AccidentalValue value ); - - /// ArrowDirectionEnum ///////////////////////////////////////////////////////////////////// - /// - /// The arrow-direction type represents the direction in which an arrow points, using - /// Unicode arrow terminology. - /// - enum class ArrowDirectionEnum - { - left = 0, - up = 1, - right = 2, - down = 3, - northwest = 4, - northeast = 5, - southeast = 6, - southwest = 7, - leftRight = 8, - upDown = 9, - northwestSoutheast = 10, - northeastSouthwest = 11, - other = 12 - }; - - ArrowDirectionEnum parseArrowDirectionEnum( const std::string& value ); - std::optional tryParseArrowDirectionEnum( const std::string& value ); - std::string toString( const ArrowDirectionEnum value ); - std::ostream& toStream( std::ostream& os, const ArrowDirectionEnum value ); - std::ostream& operator<<( std::ostream& os, const ArrowDirectionEnum value ); - - /// ArrowStyleEnum ///////////////////////////////////////////////////////////////////////// - /// - /// The arrow-style type represents the style of an arrow, using Unicode arrow terminology. - /// Filled and hollow arrows indicate polygonal single arrows. Paired arrows are duplicate - /// single arrows in the same direction. Combined arrows apply to double direction arrows - /// like left right, indicating that an arrow in one direction should be combined with an - /// arrow in the other direction. - /// - enum class ArrowStyleEnum - { - single = 0, - double_ = 1, - filled = 2, - hollow = 3, - paired = 4, - combined = 5, - other = 6 - }; - - ArrowStyleEnum parseArrowStyleEnum( const std::string& value ); - std::optional tryParseArrowStyleEnum( const std::string& value ); - std::string toString( const ArrowStyleEnum value ); - std::ostream& toStream( std::ostream& os, const ArrowStyleEnum value ); - std::ostream& operator<<( std::ostream& os, const ArrowStyleEnum value ); - - /// BackwardForward //////////////////////////////////////////////////////////////////////// - /// - /// The backward-forward type is used to specify repeat directions. The start of the repeat - /// has a forward direction while the end of the repeat has a backward direction. - /// - enum class BackwardForward - { - backward = 0, - forward = 1 - }; - - BackwardForward parseBackwardForward( const std::string& value ); - std::optional tryParseBackwardForward( const std::string& value ); - std::string toString( const BackwardForward value ); - std::ostream& toStream( std::ostream& os, const BackwardForward value ); - std::ostream& operator<<( std::ostream& os, const BackwardForward value ); - - /// BarStyleEnum /////////////////////////////////////////////////////////////////////////// - /// - /// The bar-style type represents barline style information. Choices are regular, dotted, - /// dashed, heavy, light-light, light-heavy, heavy-light, heavy-heavy, tick (a short stroke - /// through the top line), short (a partial barline between the 2nd and 4th lines), and - /// none. - /// - enum class BarStyleEnum - { - regular = 0, - dotted = 1, - dashed = 2, - heavy = 3, - lightLight = 4, - lightHeavy = 5, - heavyLight = 6, - heavyHeavy = 7, - tick = 8, - short_ = 9, - none = 10 - }; - - BarStyleEnum parseBarStyleEnum( const std::string& value ); - std::optional tryParseBarStyleEnum( const std::string& value ); - std::string toString( const BarStyleEnum value ); - std::ostream& toStream( std::ostream& os, const BarStyleEnum value ); - std::ostream& operator<<( std::ostream& os, const BarStyleEnum value ); - - /// BeamValue ////////////////////////////////////////////////////////////////////////////// - /// - /// The beam-value type represents the type of beam associated with each of 8 beam levels - /// (up to 1024th notes) available for each note. - /// - enum class BeamValue - { - begin = 0, - continue_ = 1, - end = 2, - forwardHook = 3, - backwardHook = 4 - }; - - BeamValue parseBeamValue( const std::string& value ); - std::optional tryParseBeamValue( const std::string& value ); - std::string toString( const BeamValue value ); - std::ostream& toStream( std::ostream& os, const BeamValue value ); - std::ostream& operator<<( std::ostream& os, const BeamValue value ); - - /// BeaterValue //////////////////////////////////////////////////////////////////////////// - /// - /// The beater-value type represents pictograms for beaters, mallets, and sticks that do not - /// have different materials represented in the pictogram. The finger and hammer values are - /// in addition to Stone's list. - /// - enum class BeaterValue - { - bow = 0, - chimeHammer = 1, - coin = 2, - finger = 3, - fingernail = 4, - fist = 5, - guiroScraper = 6, - hammer = 7, - hand = 8, - jazzStick = 9, - knittingNeedle = 10, - metalHammer = 11, - snareStick = 12, - spoonMallet = 13, - triangleBeater = 14, - triangleBeaterPlain = 15, - wireBrush = 16 - }; - - BeaterValue parseBeaterValue( const std::string& value ); - std::optional tryParseBeaterValue( const std::string& value ); - std::string toString( const BeaterValue value ); - std::ostream& toStream( std::ostream& os, const BeaterValue value ); - std::ostream& operator<<( std::ostream& os, const BeaterValue value ); - - /// BreathMarkValue //////////////////////////////////////////////////////////////////////// - /// - /// The breath-mark-value type represents the symbol used for a breath mark. - /// - enum class BreathMarkValue - { - emptystring = 0, - comma = 1, - tick = 2 - }; - - BreathMarkValue parseBreathMarkValue( const std::string& value ); - std::optional tryParseBreathMarkValue( const std::string& value ); - std::string toString( const BreathMarkValue value ); - std::ostream& toStream( std::ostream& os, const BreathMarkValue value ); - std::ostream& operator<<( std::ostream& os, const BreathMarkValue value ); - - /// CancelLocation ///////////////////////////////////////////////////////////////////////// - /// - /// The cancel-location type is used to indicate where a key signature cancellation appears - /// relative to a new key signature: to the left, to the right, or before the barline and to - /// the left. It is left by default. For mid-measure key elements, a cancel-location of - /// before-barline should be treated like a cancel-location of left. - /// - enum class CancelLocation - { - left = 0, - right = 1, - beforeBarline = 2 - }; - - CancelLocation parseCancelLocation( const std::string& value ); - std::optional tryParseCancelLocation( const std::string& value ); - std::string toString( const CancelLocation value ); - std::ostream& toStream( std::ostream& os, const CancelLocation value ); - std::ostream& operator<<( std::ostream& os, const CancelLocation value ); - - /// CircularArrowEnum ////////////////////////////////////////////////////////////////////// - /// - /// The circular-arrow type represents the direction in which a circular arrow points, using - /// Unicode arrow terminology. - /// - enum class CircularArrowEnum - { - clockwise = 0, - anticlockwise = 1 - }; - - CircularArrowEnum parseCircularArrowEnum( const std::string& value ); - std::optional tryParseCircularArrowEnum( const std::string& value ); - std::string toString( const CircularArrowEnum value ); - std::ostream& toStream( std::ostream& os, const CircularArrowEnum value ); - std::ostream& operator<<( std::ostream& os, const CircularArrowEnum value ); - - /// ClefSign /////////////////////////////////////////////////////////////////////////////// - /// - /// The clef-sign element represents the different clef symbols. The jianpu sign indicates - /// that the music that follows should be in jianpu numbered notation, just as the TAB sign - /// indicates that the music that follows should be in tablature notation. Unlike TAB, a - /// jianpu sign does not correspond to a visual clef notation. - /// - enum class ClefSign - { - g = 0, - f = 1, - c = 2, - percussion = 3, - tab = 4, - jianpu = 5, - none = 6 - }; - - ClefSign parseClefSign( const std::string& value ); - std::optional tryParseClefSign( const std::string& value ); - std::string toString( const ClefSign value ); - std::ostream& toStream( std::ostream& os, const ClefSign value ); - std::ostream& operator<<( std::ostream& os, const ClefSign value ); - - /// CssFontSize //////////////////////////////////////////////////////////////////////////// - /// - /// The css-font-size type includes the CSS font sizes used as an alternative to a numeric - /// point size. - /// - enum class CssFontSize - { - xxSmall = 0, - xSmall = 1, - small = 2, - medium = 3, - large = 4, - xLarge = 5, - xxLarge = 6 - }; - - CssFontSize parseCssFontSize( const std::string& value ); - std::optional tryParseCssFontSize( const std::string& value ); - std::string toString( const CssFontSize value ); - std::ostream& toStream( std::ostream& os, const CssFontSize value ); - std::ostream& operator<<( std::ostream& os, const CssFontSize value ); - - /// DegreeSymbolValue ////////////////////////////////////////////////////////////////////// - /// - /// The degree-symbol-value type indicates indicates that a symbol should be used in - /// specifying the degree. - /// - enum class DegreeSymbolValue - { - major = 0, - minor = 1, - augmented = 2, - diminished = 3, - halfDiminished = 4 - }; - - DegreeSymbolValue parseDegreeSymbolValue( const std::string& value ); - std::optional tryParseDegreeSymbolValue( const std::string& value ); - std::string toString( const DegreeSymbolValue value ); - std::ostream& toStream( std::ostream& os, const DegreeSymbolValue value ); - std::ostream& operator<<( std::ostream& os, const DegreeSymbolValue value ); - - /// DegreeTypeValue //////////////////////////////////////////////////////////////////////// - /// - /// The degree-type-value type indicates whether the current degree element is an addition, - /// alteration, or subtraction to the kind of the current chord in the harmony element. - /// - enum class DegreeTypeValue - { - add = 0, - alter = 1, - subtract = 2 - }; - - DegreeTypeValue parseDegreeTypeValue( const std::string& value ); - std::optional tryParseDegreeTypeValue( const std::string& value ); - std::string toString( const DegreeTypeValue value ); - std::ostream& toStream( std::ostream& os, const DegreeTypeValue value ); - std::ostream& operator<<( std::ostream& os, const DegreeTypeValue value ); - - /// DistanceTypeEnum /////////////////////////////////////////////////////////////////////// - /// - /// The distance-type defines what type of distance is being defined in a distance element. - /// Values include beam and hyphen. This is left as a string so that other application- - /// specific types can be defined, but it is made a separate type so that it can be - /// redefined more strictly. - /// - enum class DistanceTypeEnum - { - beam = 0, - hyphen = 1, - other = 2 - }; - - DistanceTypeEnum parseDistanceTypeEnum( const std::string& value ); - std::optional tryParseDistanceTypeEnum( const std::string& value ); - std::string toString( const DistanceTypeEnum value ); - std::ostream& toStream( std::ostream& os, const DistanceTypeEnum value ); - std::ostream& operator<<( std::ostream& os, const DistanceTypeEnum value ); - - class DistanceType - { - public: - explicit DistanceType( const DistanceTypeEnum value ); - explicit DistanceType( const std::string& value ); - DistanceType(); - DistanceTypeEnum getValue() const; - std::string getValueString() const; - void setValue( const DistanceTypeEnum value ); - void setValue( const std::string& value ); - private: - DistanceTypeEnum myEnum; - std::string myCustomValue; - }; - - DistanceType parseDistanceType( const std::string& value ); - std::string toString( const DistanceType& value ); - std::ostream& toStream( std::ostream& os, const DistanceType& value ); - std::ostream& operator<<( std::ostream& os, const DistanceType& value ); - - /// DynamicsEnum /////////////////////////////////////////////////////////////////////////// - /// - /// Dynamics can be associated either with a note or a general musical direction. To avoid - /// inconsistencies between and amongst the letter abbreviations for dynamics (what is sf - /// vs. sfz, standing alone or with a trailing dynamic that is not always piano), we use the - /// actual letters as the names of these dynamic elements. The other-dynamics element allows - /// other dynamic marks that are not covered here, but many of those should perhaps be - /// included in a more general musical direction element. Dynamics elements may also be - /// combined to create marks not covered by a single element, such as sfmp. - /// - /// These letter dynamic symbols are separated from crescendo, decrescendo, and wedge - /// indications. Dynamic representation is inconsistent in scores. Many things are assumed - /// by the composer and left out, such as returns to original dynamics. Systematic - /// representations are quite complex: for example, Humdrum has at least 3 representation - /// formats related to dynamics. The MusicXML format captures what is in the score, but does - /// not try to be optimal for analysis or synthesis of dynamics. - /// - enum class DynamicsEnum - { - p = 0, - pp = 1, - ppp = 2, - pppp = 3, - ppppp = 4, - pppppp = 5, - f = 6, - ff = 7, - fff = 8, - ffff = 9, - fffff = 10, - ffffff = 11, - mp = 12, - mf = 13, - sf = 14, - sfp = 15, - sfpp = 16, - fp = 17, - rf = 18, - rfz = 19, - sfz = 20, - sffz = 21, - fz = 22, - otherDynamics = 23 - }; - - DynamicsEnum parseDynamicsEnum( const std::string& value ); - std::optional tryParseDynamicsEnum( const std::string& value ); - std::string toString( const DynamicsEnum value ); - std::ostream& toStream( std::ostream& os, const DynamicsEnum value ); - std::ostream& operator<<( std::ostream& os, const DynamicsEnum value ); - - class DynamicsValue - { - public: - explicit DynamicsValue( const DynamicsEnum value ); - explicit DynamicsValue( const std::string& value ); - DynamicsValue(); - DynamicsEnum getValue() const; - std::string getValueString() const; - void setValue( const DynamicsEnum value ); - void setValue( const std::string& value ); - private: - DynamicsEnum myEnum; - std::string myCustomValue; - }; - - DynamicsValue parseDynamicsValue( const std::string& value ); - std::string toString( const DynamicsValue& value ); - std::ostream& toStream( std::ostream& os, const DynamicsValue& value ); - std::ostream& operator<<( std::ostream& os, const DynamicsValue& value ); - - /// EffectEnum ///////////////////////////////////////////////////////////////////////////// - /// - /// The effect type represents pictograms for sound effect percussion instruments. The - /// cannon value is in addition to Stone's list. - /// - enum class EffectEnum - { - anvil = 0, - autoHorn = 1, - birdWhistle = 2, - cannon = 3, - duckCall = 4, - gunShot = 5, - klaxonHorn = 6, - lionsRoar = 7, - policeWhistle = 8, - siren = 9, - slideWhistle = 10, - thunderSheet = 11, - windMachine = 12, - windWhistle = 13 - }; - - EffectEnum parseEffectEnum( const std::string& value ); - std::optional tryParseEffectEnum( const std::string& value ); - std::string toString( const EffectEnum value ); - std::ostream& toStream( std::ostream& os, const EffectEnum value ); - std::ostream& operator<<( std::ostream& os, const EffectEnum value ); - - /// EnclosureShape ///////////////////////////////////////////////////////////////////////// - /// - /// The enclosure-shape type describes the shape and presence / absence of an enclosure - /// around text or symbols. A bracket enclosure is similar to a rectangle with the bottom - /// line missing, as is common in jazz notation. - /// - enum class EnclosureShape - { - rectangle = 0, - square = 1, - oval = 2, - circle = 3, - bracket = 4, - triangle = 5, - diamond = 6, - none = 7 - }; - - EnclosureShape parseEnclosureShape( const std::string& value ); - std::optional tryParseEnclosureShape( const std::string& value ); - std::string toString( const EnclosureShape value ); - std::ostream& toStream( std::ostream& os, const EnclosureShape value ); - std::ostream& operator<<( std::ostream& os, const EnclosureShape value ); - - /// Fan //////////////////////////////////////////////////////////////////////////////////// - /// - /// The fan type represents the type of beam fanning present on a note, used to represent - /// accelerandos and ritardandos. - /// - enum class Fan - { - accel = 0, - rit = 1, - none = 2 - }; - - Fan parseFan( const std::string& value ); - std::optional tryParseFan( const std::string& value ); - std::string toString( const Fan value ); - std::ostream& toStream( std::ostream& os, const Fan value ); - std::ostream& operator<<( std::ostream& os, const Fan value ); - - /// FermataShape /////////////////////////////////////////////////////////////////////////// - /// - /// The fermata-shape type represents the shape of the fermata sign. The empty value is - /// equivalent to the normal value. - /// - enum class FermataShape - { - normal = 0, - angled = 1, - square = 2, - emptystring = 3 - }; - - FermataShape parseFermataShape( const std::string& value ); - std::optional tryParseFermataShape( const std::string& value ); - std::string toString( const FermataShape value ); - std::ostream& toStream( std::ostream& os, const FermataShape value ); - std::ostream& operator<<( std::ostream& os, const FermataShape value ); - - /// FontStyle ////////////////////////////////////////////////////////////////////////////// - /// - /// The font-style type represents a simplified version of the CSS font-style property. - /// - enum class FontStyle - { - normal = 0, - italic = 1 - }; - - FontStyle parseFontStyle( const std::string& value ); - std::optional tryParseFontStyle( const std::string& value ); - std::string toString( const FontStyle value ); - std::ostream& toStream( std::ostream& os, const FontStyle value ); - std::ostream& operator<<( std::ostream& os, const FontStyle value ); - - /// FontWeight ///////////////////////////////////////////////////////////////////////////// - /// - /// The font-weight type represents a simplified version of the CSS font-weight property. - /// - enum class FontWeight - { - normal = 0, - bold = 1 - }; - - FontWeight parseFontWeight( const std::string& value ); - std::optional tryParseFontWeight( const std::string& value ); - std::string toString( const FontWeight value ); - std::ostream& toStream( std::ostream& os, const FontWeight value ); - std::ostream& operator<<( std::ostream& os, const FontWeight value ); - - /// GlassEnum ////////////////////////////////////////////////////////////////////////////// - /// - /// The glass type represents pictograms for glass percussion instruments. - /// - enum class GlassEnum - { - windChimes = 0 - }; - - GlassEnum parseGlassEnum( const std::string& value ); - std::optional tryParseGlassEnum( const std::string& value ); - std::string toString( const GlassEnum value ); - std::ostream& toStream( std::ostream& os, const GlassEnum value ); - std::ostream& operator<<( std::ostream& os, const GlassEnum value ); - - /// GroupBarlineValue ////////////////////////////////////////////////////////////////////// - /// - /// The group-barline-value type indicates if the group should have common barlines. - /// - enum class GroupBarlineValue - { - yes = 0, - no = 1, - mensurstrich = 2 - }; - - GroupBarlineValue parseGroupBarlineValue( const std::string& value ); - std::optional tryParseGroupBarlineValue( const std::string& value ); - std::string toString( const GroupBarlineValue value ); - std::ostream& toStream( std::ostream& os, const GroupBarlineValue value ); - std::ostream& operator<<( std::ostream& os, const GroupBarlineValue value ); - - /// GroupSymbolValue /////////////////////////////////////////////////////////////////////// - /// - /// The group-symbol-value type indicates how the symbol for a group is indicated in the - /// score. The default value is none. - /// - enum class GroupSymbolValue - { - none = 0, - brace = 1, - line = 2, - bracket = 3, - square = 4 - }; - - GroupSymbolValue parseGroupSymbolValue( const std::string& value ); - std::optional tryParseGroupSymbolValue( const std::string& value ); - std::string toString( const GroupSymbolValue value ); - std::ostream& toStream( std::ostream& os, const GroupSymbolValue value ); - std::ostream& operator<<( std::ostream& os, const GroupSymbolValue value ); - - /// HandbellValue ////////////////////////////////////////////////////////////////////////// - /// - /// The handbell-value type represents the type of handbell technique being notated. - /// - enum class HandbellValue - { - damp = 0, - echo = 1, - gyro = 2, - handMartellato = 3, - malletLift = 4, - malletTable = 5, - martellato = 6, - martellatoLift = 7, - mutedMartellato = 8, - pluckLift = 9, - swing = 10 - }; - - HandbellValue parseHandbellValue( const std::string& value ); - std::optional tryParseHandbellValue( const std::string& value ); - std::string toString( const HandbellValue value ); - std::ostream& toStream( std::ostream& os, const HandbellValue value ); - std::ostream& operator<<( std::ostream& os, const HandbellValue value ); - - /// HarmonyType //////////////////////////////////////////////////////////////////////////// - /// - /// The harmony-type type differentiates different types of harmonies when alternate - /// harmonies are possible. Explicit harmonies have all note present in the music; implied - /// have some notes missing but implied; alternate represents alternate analyses. - /// - enum class HarmonyType - { - explicit_ = 0, - implied = 1, - alternate = 2 - }; - - HarmonyType parseHarmonyType( const std::string& value ); - std::optional tryParseHarmonyType( const std::string& value ); - std::string toString( const HarmonyType value ); - std::ostream& toStream( std::ostream& os, const HarmonyType value ); - std::ostream& operator<<( std::ostream& os, const HarmonyType value ); - - /// HoleClosedLocation ///////////////////////////////////////////////////////////////////// - /// - /// The hole-closed-location type indicates which portion of the hole is filled in when the - /// corresponding hole-closed-value is half. - /// - enum class HoleClosedLocation - { - right = 0, - bottom = 1, - left = 2, - top = 3 - }; - - HoleClosedLocation parseHoleClosedLocation( const std::string& value ); - std::optional tryParseHoleClosedLocation( const std::string& value ); - std::string toString( const HoleClosedLocation value ); - std::ostream& toStream( std::ostream& os, const HoleClosedLocation value ); - std::ostream& operator<<( std::ostream& os, const HoleClosedLocation value ); - - /// HoleClosedValue //////////////////////////////////////////////////////////////////////// - /// - /// The hole-closed-value type represents whether the hole is closed, open, or half-open. - /// - enum class HoleClosedValue - { - yes = 0, - no = 1, - half = 2 - }; - - HoleClosedValue parseHoleClosedValue( const std::string& value ); - std::optional tryParseHoleClosedValue( const std::string& value ); - std::string toString( const HoleClosedValue value ); - std::ostream& toStream( std::ostream& os, const HoleClosedValue value ); - std::ostream& operator<<( std::ostream& os, const HoleClosedValue value ); - - /// KindValue ////////////////////////////////////////////////////////////////////////////// - /// - /// A kind-value indicates the type of chord. Degree elements can then add, subtract, or - /// alter from these starting points. Values include: - /// - /// Triads: - /// major (major third, perfect fifth) - /// minor (minor third, perfect fifth) - /// augmented (major third, augmented fifth) - /// diminished (minor third, diminished fifth) - /// Sevenths: - /// dominant (major triad, minor seventh) - /// major-seventh (major triad, major seventh) - /// minor-seventh (minor triad, minor seventh) - /// diminished-seventh (diminished triad, diminished seventh) - /// augmented-seventh (augmented triad, minor seventh) - /// half-diminished (diminished triad, minor seventh) - /// major-minor (minor triad, major seventh) - /// Sixths: - /// major-sixth (major triad, added sixth) - /// minor-sixth (minor triad, added sixth) - /// Ninths: - /// dominant-ninth (dominant-seventh, major ninth) - /// major-ninth (major-seventh, major ninth) - /// minor-ninth (minor-seventh, major ninth) - /// 11ths (usually as the basis for alteration): - /// dominant-11th (dominant-ninth, perfect 11th) - /// major-11th (major-ninth, perfect 11th) - /// minor-11th (minor-ninth, perfect 11th) - /// 13ths (usually as the basis for alteration): - /// dominant-13th (dominant-11th, major 13th) - /// major-13th (major-11th, major 13th) - /// minor-13th (minor-11th, major 13th) - /// Suspended: - /// suspended-second (major second, perfect fifth) - /// suspended-fourth (perfect fourth, perfect fifth) - /// Functional sixths: - /// Neapolitan - /// Italian - /// French - /// German - /// Other: - /// pedal (pedal-point bass) - /// power (perfect fifth) - /// Tristan - /// - /// The "other" kind is used when the harmony is entirely composed of add elements. The - /// "none" kind is used to explicitly encode absence of chords or functional harmony. - /// - enum class KindValue - { - major = 0, - minor = 1, - augmented = 2, - diminished = 3, - dominant = 4, - majorSeventh = 5, - minorSeventh = 6, - diminishedSeventh = 7, - augmentedSeventh = 8, - halfDiminished = 9, - majorMinor = 10, - majorSixth = 11, - minorSixth = 12, - dominantNinth = 13, - majorNinth = 14, - minorNinth = 15, - dominant11th = 16, - major11th = 17, - minor11th = 18, - dominant13th = 19, - major13th = 20, - minor13th = 21, - suspendedSecond = 22, - suspendedFourth = 23, - neapolitan = 24, - italian = 25, - french = 26, - german = 27, - pedal = 28, - power = 29, - tristan = 30, - other = 31, - none = 32 - }; - - KindValue parseKindValue( const std::string& value ); - std::optional tryParseKindValue( const std::string& value ); - std::string toString( const KindValue value ); - std::ostream& toStream( std::ostream& os, const KindValue value ); - std::ostream& operator<<( std::ostream& os, const KindValue value ); - - /// LeftCenterRight //////////////////////////////////////////////////////////////////////// - /// - /// The left-center-right type is used to define horizontal alignment and text - /// justification. - /// - enum class LeftCenterRight - { - left = 0, - center = 1, - right = 2 - }; - - LeftCenterRight parseLeftCenterRight( const std::string& value ); - std::optional tryParseLeftCenterRight( const std::string& value ); - std::string toString( const LeftCenterRight value ); - std::ostream& toStream( std::ostream& os, const LeftCenterRight value ); - std::ostream& operator<<( std::ostream& os, const LeftCenterRight value ); - - /// LeftRight ////////////////////////////////////////////////////////////////////////////// - /// - /// The left-right type is used to indicate whether one element appears to the left or the - /// right of another element. - /// - enum class LeftRight - { - left = 0, - right = 1 - }; - - LeftRight parseLeftRight( const std::string& value ); - std::optional tryParseLeftRight( const std::string& value ); - std::string toString( const LeftRight value ); - std::ostream& toStream( std::ostream& os, const LeftRight value ); - std::ostream& operator<<( std::ostream& os, const LeftRight value ); - - /// LineEnd //////////////////////////////////////////////////////////////////////////////// - /// - /// The line-end type specifies if there is a jog up or down (or both), an arrow, or nothing - /// at the start or end of a bracket. - /// - enum class LineEnd - { - up = 0, - down = 1, - both = 2, - arrow = 3, - none = 4 - }; - - LineEnd parseLineEnd( const std::string& value ); - std::optional tryParseLineEnd( const std::string& value ); - std::string toString( const LineEnd value ); - std::ostream& toStream( std::ostream& os, const LineEnd value ); - std::ostream& operator<<( std::ostream& os, const LineEnd value ); - - /// LineShape ////////////////////////////////////////////////////////////////////////////// - /// - /// The line-shape type distinguishes between straight and curved lines. - /// - enum class LineShape - { - straight = 0, - curved = 1 - }; - - LineShape parseLineShape( const std::string& value ); - std::optional tryParseLineShape( const std::string& value ); - std::string toString( const LineShape value ); - std::ostream& toStream( std::ostream& os, const LineShape value ); - std::ostream& operator<<( std::ostream& os, const LineShape value ); - - /// LineType /////////////////////////////////////////////////////////////////////////////// - /// - /// The line-type type distinguishes between solid, dashed, dotted, and wavy lines. - /// - enum class LineType - { - solid = 0, - dashed = 1, - dotted = 2, - wavy = 3 - }; - - LineType parseLineType( const std::string& value ); - std::optional tryParseLineType( const std::string& value ); - std::string toString( const LineType value ); - std::ostream& toStream( std::ostream& os, const LineType value ); - std::ostream& operator<<( std::ostream& os, const LineType value ); - - /// LineWidthTypeEnum ////////////////////////////////////////////////////////////////////// - /// - /// The line-width-type defines what type of line is being defined in a line-width element. - /// Values include beam, bracket, dashes, enclosure, ending, extend, heavy barline, leger, - /// light barline, octave shift, pedal, slur middle, slur tip, staff, stem, tie middle, tie - /// tip, tuplet bracket, and wedge. This is left as a string so that other application- - /// specific types can be defined, but it is made a separate type so that it can be - /// redefined more strictly. - /// - enum class LineWidthTypeEnum - { - beam = 0, - bracket = 1, - dashes = 2, - enclosure = 3, - ending = 4, - extend = 5, - heavyBarline = 6, - leger = 7, - lightBarline = 8, - octaveShift = 9, - pedal = 10, - slurMiddle = 11, - slurTip = 12, - staff = 13, - stem = 14, - tieMiddle = 15, - tieTip = 16, - tupletBracket = 17, - wedge = 18, - other = 19 - }; - - LineWidthTypeEnum parseLineWidthTypeEnum( const std::string& value ); - std::optional tryParseLineWidthTypeEnum( const std::string& value ); - std::string toString( const LineWidthTypeEnum value ); - std::ostream& toStream( std::ostream& os, const LineWidthTypeEnum value ); - std::ostream& operator<<( std::ostream& os, const LineWidthTypeEnum value ); - - class LineWidthType - { - public: - explicit LineWidthType( const LineWidthTypeEnum value ); - explicit LineWidthType( const std::string& value ); - LineWidthType(); - LineWidthTypeEnum getValue() const; - std::string getValueString() const; - void setValue( const LineWidthTypeEnum value ); - void setValue( const std::string& value ); - private: - LineWidthTypeEnum myEnum; - std::string myCustomValue; - }; - - LineWidthType parseLineWidthType( const std::string& value ); - std::string toString( const LineWidthType& value ); - std::ostream& toStream( std::ostream& os, const LineWidthType& value ); - std::ostream& operator<<( std::ostream& os, const LineWidthType& value ); - - /// MarginType ///////////////////////////////////////////////////////////////////////////// - /// - /// The margin-type type specifies whether margins apply to even page, odd pages, or both. - /// - enum class MarginType - { - odd = 0, - even = 1, - both = 2 - }; - - MarginType parseMarginType( const std::string& value ); - std::optional tryParseMarginType( const std::string& value ); - std::string toString( const MarginType value ); - std::ostream& toStream( std::ostream& os, const MarginType value ); - std::ostream& operator<<( std::ostream& os, const MarginType value ); - - /// MeasureNumberingValue ////////////////////////////////////////////////////////////////// - /// - /// The measure-numbering-value type describes how measure numbers are displayed on this - /// part: no numbers, numbers every measure, or numbers every system. - /// - enum class MeasureNumberingValue - { - none = 0, - measure = 1, - system = 2 - }; - - MeasureNumberingValue parseMeasureNumberingValue( const std::string& value ); - std::optional tryParseMeasureNumberingValue( const std::string& value ); - std::string toString( const MeasureNumberingValue value ); - std::ostream& toStream( std::ostream& os, const MeasureNumberingValue value ); - std::ostream& operator<<( std::ostream& os, const MeasureNumberingValue value ); - - /// MembraneEnum /////////////////////////////////////////////////////////////////////////// - /// - /// The membrane type represents pictograms for membrane percussion instruments. The goblet - /// drum value is in addition to Stone's list. - /// - enum class MembraneEnum - { - bassDrum = 0, - bassDrumOnSide = 1, - bongos = 2, - congaDrum = 3, - gobletDrum = 4, - militaryDrum = 5, - snareDrum = 6, - snareDrumSnaresOff = 7, - tambourine = 8, - tenorDrum = 9, - timbales = 10, - tomtom = 11 - }; - - MembraneEnum parseMembraneEnum( const std::string& value ); - std::optional tryParseMembraneEnum( const std::string& value ); - std::string toString( const MembraneEnum value ); - std::ostream& toStream( std::ostream& os, const MembraneEnum value ); - std::ostream& operator<<( std::ostream& os, const MembraneEnum value ); - - /// MetalEnum ////////////////////////////////////////////////////////////////////////////// - /// - /// The metal type represents pictograms for metal percussion instruments. The hi-hat value - /// refers to a pictogram like Stone's high-hat cymbals but without the long vertical line - /// at the bottom. - /// - enum class MetalEnum - { - almglocken = 0, - bell = 1, - bellPlate = 2, - brakeDrum = 3, - chineseCymbal = 4, - cowbell = 5, - crashCymbals = 6, - crotale = 7, - cymbalTongs = 8, - domedGong = 9, - fingerCymbals = 10, - flexatone = 11, - gong = 12, - hiHat = 13, - highHatCymbals = 14, - handbell = 15, - sistrum = 16, - sizzleCymbal = 17, - sleighBells = 18, - suspendedCymbal = 19, - tamTam = 20, - triangle = 21, - vietnameseHat = 22 - }; - - MetalEnum parseMetalEnum( const std::string& value ); - std::optional tryParseMetalEnum( const std::string& value ); - std::string toString( const MetalEnum value ); - std::ostream& toStream( std::ostream& os, const MetalEnum value ); - std::ostream& operator<<( std::ostream& os, const MetalEnum value ); - - /// ModeEnum /////////////////////////////////////////////////////////////////////////////// - /// - /// The mode type is used to specify major/minor and other mode distinctions. Valid mode - /// values include major, minor, dorian, phrygian, lydian, mixolydian, aeolian, ionian, - /// locrian, and none. - /// - enum class ModeEnum - { - major = 0, - minor = 1, - dorian = 2, - phrygian = 3, - lydian = 4, - mixolydian = 5, - aeolian = 6, - ionian = 7, - locrian = 8, - none = 9, - other = 10 - }; - - ModeEnum parseModeEnum( const std::string& value ); - std::optional tryParseModeEnum( const std::string& value ); - std::string toString( const ModeEnum value ); - std::ostream& toStream( std::ostream& os, const ModeEnum value ); - std::ostream& operator<<( std::ostream& os, const ModeEnum value ); - - class ModeValue - { - public: - explicit ModeValue( const ModeEnum value ); - explicit ModeValue( const std::string& value ); - ModeValue(); - ModeEnum getValue() const; - std::string getValueString() const; - void setValue( const ModeEnum value ); - void setValue( const std::string& value ); - private: - ModeEnum myEnum; - std::string myCustomValue; - }; - - ModeValue parseModeValue( const std::string& value ); - std::string toString( const ModeValue& value ); - std::ostream& toStream( std::ostream& os, const ModeValue& value ); - std::ostream& operator<<( std::ostream& os, const ModeValue& value ); - - /// MuteEnum /////////////////////////////////////////////////////////////////////////////// - /// - /// The mute type represents muting for different instruments, including brass, winds, and - /// strings. The on and off values are used for undifferentiated mutes. The remaining values - /// represent specific mutes. - /// - enum class MuteEnum - { - on = 0, - off = 1, - straight = 2, - cup = 3, - harmonNoStem = 4, - harmonStem = 5, - bucket = 6, - plunger = 7, - hat = 8, - solotone = 9, - practice = 10, - stopMute = 11, - stopHand = 12, - echo = 13, - palm = 14 - }; - - MuteEnum parseMuteEnum( const std::string& value ); - std::optional tryParseMuteEnum( const std::string& value ); - std::string toString( const MuteEnum value ); - std::ostream& toStream( std::ostream& os, const MuteEnum value ); - std::ostream& operator<<( std::ostream& os, const MuteEnum value ); - - /// NoteSizeType /////////////////////////////////////////////////////////////////////////// - /// - /// The note-size-type type indicates the type of note being defined by a note-size element. - /// The grace type is used for notes of cue size that that include a grace element. The cue - /// type is used for all other notes with cue size, whether defined explicitly or implicitly - /// via a cue element. The large type is used for notes of large size. - /// - enum class NoteSizeType - { - cue = 0, - grace = 1, - large = 2 - }; - - NoteSizeType parseNoteSizeType( const std::string& value ); - std::optional tryParseNoteSizeType( const std::string& value ); - std::string toString( const NoteSizeType value ); - std::ostream& toStream( std::ostream& os, const NoteSizeType value ); - std::ostream& operator<<( std::ostream& os, const NoteSizeType value ); - - /// NoteTypeValue ////////////////////////////////////////////////////////////////////////// - /// - /// The note-type type is used for the MusicXML type element and represents the graphic note - /// type, from 1024th (shortest) to maxima (longest). - /// - enum class NoteTypeValue - { - oneThousandTwentyFourth = 0, - fiveHundredTwelfth = 1, - twoHundredFifthySixth = 2, - oneHundredTwentyEighth = 3, - sixtyFourth = 4, - thirtySecond = 5, - sixteenth = 6, - eighth = 7, - quarter = 8, - half = 9, - whole = 10, - breve = 11, - long_ = 12, - maxima = 13 - }; - - NoteTypeValue parseNoteTypeValue( const std::string& value ); - std::optional tryParseNoteTypeValue( const std::string& value ); - std::string toString( const NoteTypeValue value ); - std::ostream& toStream( std::ostream& os, const NoteTypeValue value ); - std::ostream& operator<<( std::ostream& os, const NoteTypeValue value ); - - /// NoteheadValue ////////////////////////////////////////////////////////////////////////// - /// - /// The notehead type indicates shapes other than the open and closed ovals associated with - /// note durations. The values do, re, mi, fa, fa up, so, la, and ti correspond to Aikin's - /// 7-shape system. The fa up shape is typically used with upstems; the fa shape is - /// typically used with downstems or no stems. - /// - /// The arrow shapes differ from triangle and inverted triangle by being centered on the - /// stem. Slashed and back slashed notes include both the normal notehead and a slash. The - /// triangle shape has the tip of the triangle pointing up; the inverted triangle shape has - /// the tip of the triangle pointing down. The left triangle shape is a right triangle with - /// the hypotenuse facing up and to the left. - /// - enum class NoteheadValue - { - slash = 0, - triangle = 1, - diamond = 2, - square = 3, - cross = 4, - x = 5, - circleX = 6, - invertedTriangle = 7, - arrowDown = 8, - arrowUp = 9, - slashed = 10, - backSlashed = 11, - normal = 12, - cluster = 13, - circleDot = 14, - leftTriangle = 15, - rectangle = 16, - none = 17, - do_ = 18, - re = 19, - mi = 20, - fa = 21, - faUp = 22, - so = 23, - la = 24, - ti = 25 - }; - - NoteheadValue parseNoteheadValue( const std::string& value ); - std::optional tryParseNoteheadValue( const std::string& value ); - std::string toString( const NoteheadValue value ); - std::ostream& toStream( std::ostream& os, const NoteheadValue value ); - std::ostream& operator<<( std::ostream& os, const NoteheadValue value ); - - /// OnOff ////////////////////////////////////////////////////////////////////////////////// - /// - /// The on-off type is used for notation elements such as string mutes. - /// - enum class OnOff - { - on = 0, - off = 1 - }; - - OnOff parseOnOff( const std::string& value ); - std::optional tryParseOnOff( const std::string& value ); - std::string toString( const OnOff value ); - std::ostream& toStream( std::ostream& os, const OnOff value ); - std::ostream& operator<<( std::ostream& os, const OnOff value ); - - /// OverUnder ////////////////////////////////////////////////////////////////////////////// - /// - /// The over-under type is used to indicate whether the tips of curved lines such as slurs - /// and ties are overhand (tips down) or underhand (tips up). - /// - enum class OverUnder - { - over = 0, - under = 1 - }; - - OverUnder parseOverUnder( const std::string& value ); - std::optional tryParseOverUnder( const std::string& value ); - std::string toString( const OverUnder value ); - std::ostream& toStream( std::ostream& os, const OverUnder value ); - std::ostream& operator<<( std::ostream& os, const OverUnder value ); - - /// PitchedEnum //////////////////////////////////////////////////////////////////////////// - /// - /// The pitched type represents pictograms for pitched percussion instruments. The chimes - /// and tubular chimes values distinguish the single-line and double-line versions of the - /// pictogram. The mallet value is in addition to Stone's list. - /// - enum class PitchedEnum - { - chimes = 0, - glockenspiel = 1, - mallet = 2, - marimba = 3, - tubularChimes = 4, - vibraphone = 5, - xylophone = 6 - }; - - PitchedEnum parsePitchedEnum( const std::string& value ); - std::optional tryParsePitchedEnum( const std::string& value ); - std::string toString( const PitchedEnum value ); - std::ostream& toStream( std::ostream& os, const PitchedEnum value ); - std::ostream& operator<<( std::ostream& os, const PitchedEnum value ); - - /// PrincipalVoiceSymbol /////////////////////////////////////////////////////////////////// - /// - /// The principal-voice-symbol type represents the type of symbol used to indicate the start - /// of a principal or secondary voice. The "plain" value represents a plain square bracket. - /// The value of "none" is used for analysis markup when the principal-voice element does - /// not have a corresponding appearance in the score. - /// - enum class PrincipalVoiceSymbol - { - hauptstimme = 0, - nebenstimme = 1, - plain = 2, - none = 3 - }; - - PrincipalVoiceSymbol parsePrincipalVoiceSymbol( const std::string& value ); - std::optional tryParsePrincipalVoiceSymbol( const std::string& value ); - std::string toString( const PrincipalVoiceSymbol value ); - std::ostream& toStream( std::ostream& os, const PrincipalVoiceSymbol value ); - std::ostream& operator<<( std::ostream& os, const PrincipalVoiceSymbol value ); - - /// RightLeftMiddle //////////////////////////////////////////////////////////////////////// - /// - /// The right-left-middle type is used to specify barline location. - /// - enum class RightLeftMiddle - { - right = 0, - left = 1, - middle = 2 - }; - - RightLeftMiddle parseRightLeftMiddle( const std::string& value ); - std::optional tryParseRightLeftMiddle( const std::string& value ); - std::string toString( const RightLeftMiddle value ); - std::ostream& toStream( std::ostream& os, const RightLeftMiddle value ); - std::ostream& operator<<( std::ostream& os, const RightLeftMiddle value ); - - /// SemiPitchedEnum //////////////////////////////////////////////////////////////////////// - /// - /// The semi-pitched type represents categories of indefinite pitch for percussion - /// instruments. - /// - enum class SemiPitchedEnum - { - high = 0, - mediumHigh = 1, - medium = 2, - mediumLow = 3, - low = 4, - veryLow = 5 - }; - - SemiPitchedEnum parseSemiPitchedEnum( const std::string& value ); - std::optional tryParseSemiPitchedEnum( const std::string& value ); - std::string toString( const SemiPitchedEnum value ); - std::ostream& toStream( std::ostream& os, const SemiPitchedEnum value ); - std::ostream& operator<<( std::ostream& os, const SemiPitchedEnum value ); - - /// ShowFrets ////////////////////////////////////////////////////////////////////////////// - /// - /// The show-frets type indicates whether to show tablature frets as numbers (0, 1, 2) or - /// letters (a, b, c). The default choice is numbers. - /// - enum class ShowFrets - { - numbers = 0, - letters = 1 - }; - - ShowFrets parseShowFrets( const std::string& value ); - std::optional tryParseShowFrets( const std::string& value ); - std::string toString( const ShowFrets value ); - std::ostream& toStream( std::ostream& os, const ShowFrets value ); - std::ostream& operator<<( std::ostream& os, const ShowFrets value ); - - /// ShowTuplet ///////////////////////////////////////////////////////////////////////////// - /// - /// The show-tuplet type indicates whether to show a part of a tuplet relating to the - /// tuplet-actual element, both the tuplet-actual and tuplet-normal elements, or neither. - /// - enum class ShowTuplet - { - actual = 0, - both = 1, - none = 2 - }; - - ShowTuplet parseShowTuplet( const std::string& value ); - std::optional tryParseShowTuplet( const std::string& value ); - std::string toString( const ShowTuplet value ); - std::ostream& toStream( std::ostream& os, const ShowTuplet value ); - std::ostream& operator<<( std::ostream& os, const ShowTuplet value ); - - /// StaffTypeEnum ////////////////////////////////////////////////////////////////////////// - /// - /// The staff-type value can be ossia, cue, editorial, regular, or alternate. An alternate - /// staff indicates one that shares the same musical data as the prior staff, but displayed - /// differently (e.g., treble and bass clef, standard notation and tab). - /// - enum class StaffTypeEnum - { - ossia = 0, - cue = 1, - editorial = 2, - regular = 3, - alternate = 4 - }; - - StaffTypeEnum parseStaffTypeEnum( const std::string& value ); - std::optional tryParseStaffTypeEnum( const std::string& value ); - std::string toString( const StaffTypeEnum value ); - std::ostream& toStream( std::ostream& os, const StaffTypeEnum value ); - std::ostream& operator<<( std::ostream& os, const StaffTypeEnum value ); - - /// StartNote ////////////////////////////////////////////////////////////////////////////// - /// - /// The start-note type describes the starting note of trills and mordents for playback, - /// relative to the current note. - /// - enum class StartNote - { - upper = 0, - main = 1, - below = 2 - }; - - StartNote parseStartNote( const std::string& value ); - std::optional tryParseStartNote( const std::string& value ); - std::string toString( const StartNote value ); - std::ostream& toStream( std::ostream& os, const StartNote value ); - std::ostream& operator<<( std::ostream& os, const StartNote value ); - - /// StartStop ////////////////////////////////////////////////////////////////////////////// - /// - /// The start-stop type is used for an attribute of musical elements that can either start - /// or stop, such as tuplets. - /// - /// The values of start and stop refer to how an element appears in musical score order, not - /// in MusicXML document order. An element with a stop attribute may precede the - /// corresponding element with a start attribute within a MusicXML document. This is - /// particularly common in multi-staff music. For example, the stopping point for a tuplet - /// may appear in staff 1 before the starting point for the tuplet appears in staff 2 later - /// in the document. - /// - enum class StartStop - { - start = 0, - stop = 1 - }; - - StartStop parseStartStop( const std::string& value ); - std::optional tryParseStartStop( const std::string& value ); - std::string toString( const StartStop value ); - std::ostream& toStream( std::ostream& os, const StartStop value ); - std::ostream& operator<<( std::ostream& os, const StartStop value ); - - /// StartStopChangeContinue //////////////////////////////////////////////////////////////// - /// - /// The start-stop-change-continue type is used to distinguish types of pedal directions. - /// - enum class StartStopChangeContinue - { - start = 0, - stop = 1, - change = 2, - continue_ = 3 - }; - - StartStopChangeContinue parseStartStopChangeContinue( const std::string& value ); - std::optional tryParseStartStopChangeContinue( const std::string& value ); - std::string toString( const StartStopChangeContinue value ); - std::ostream& toStream( std::ostream& os, const StartStopChangeContinue value ); - std::ostream& operator<<( std::ostream& os, const StartStopChangeContinue value ); - - /// StartStopContinue ////////////////////////////////////////////////////////////////////// - /// - /// The start-stop-continue type is used for an attribute of musical elements that can - /// either start or stop, but also need to refer to an intermediate point in the symbol, as - /// for complex slurs or for formatting of symbols across system breaks. - /// - /// The values of start, stop, and continue refer to how an element appears in musical score - /// order, not in MusicXML document order. An element with a stop attribute may precede the - /// corresponding element with a start attribute within a MusicXML document. This is - /// particularly common in multi-staff music. For example, the stopping point for a slur may - /// appear in staff 1 before the starting point for the slur appears in staff 2 later in the - /// document. - /// - enum class StartStopContinue - { - start = 0, - stop = 1, - continue_ = 2 - }; - - StartStopContinue parseStartStopContinue( const std::string& value ); - std::optional tryParseStartStopContinue( const std::string& value ); - std::string toString( const StartStopContinue value ); - std::ostream& toStream( std::ostream& os, const StartStopContinue value ); - std::ostream& operator<<( std::ostream& os, const StartStopContinue value ); - - /// StartStopDiscontinue /////////////////////////////////////////////////////////////////// - /// - /// The start-stop-discontinue type is used to specify ending types. Typically, the start - /// type is associated with the left barline of the first measure in an ending. The stop and - /// discontinue types are associated with the right barline of the last measure in an - /// ending. Stop is used when the ending mark concludes with a downward jog, as is typical - /// for first endings. Discontinue is used when there is no downward jog, as is typical for - /// second endings that do not conclude a piece. - /// - enum class StartStopDiscontinue - { - start = 0, - stop = 1, - discontinue = 2 - }; - - StartStopDiscontinue parseStartStopDiscontinue( const std::string& value ); - std::optional tryParseStartStopDiscontinue( const std::string& value ); - std::string toString( const StartStopDiscontinue value ); - std::ostream& toStream( std::ostream& os, const StartStopDiscontinue value ); - std::ostream& operator<<( std::ostream& os, const StartStopDiscontinue value ); - - /// StartStopSingle //////////////////////////////////////////////////////////////////////// - /// - /// The start-stop-single type is used for an attribute of musical elements that can be used - /// for either multi-note or single-note musical elements, as for tremolos. - /// - enum class StartStopSingle - { - start = 0, - stop = 1, - single = 2 - }; - - StartStopSingle parseStartStopSingle( const std::string& value ); - std::optional tryParseStartStopSingle( const std::string& value ); - std::string toString( const StartStopSingle value ); - std::ostream& toStream( std::ostream& os, const StartStopSingle value ); - std::ostream& operator<<( std::ostream& os, const StartStopSingle value ); - - /// StemValue ////////////////////////////////////////////////////////////////////////////// - /// - /// The stem type represents the notated stem direction. - /// - enum class StemValue - { - down = 0, - up = 1, - double_ = 2, - none = 3 - }; - - StemValue parseStemValue( const std::string& value ); - std::optional tryParseStemValue( const std::string& value ); - std::string toString( const StemValue value ); - std::ostream& toStream( std::ostream& os, const StemValue value ); - std::ostream& operator<<( std::ostream& os, const StemValue value ); - - /// StepEnum /////////////////////////////////////////////////////////////////////////////// - /// - /// The step type represents a step of the diatonic scale, represented using the English - /// letters A through G. - /// - enum class StepEnum - { - a = 0, - b = 1, - c = 2, - d = 3, - e = 4, - f = 5, - g = 6 - }; - - StepEnum parseStepEnum( const std::string& value ); - std::optional tryParseStepEnum( const std::string& value ); - std::string toString( const StepEnum value ); - std::ostream& toStream( std::ostream& os, const StepEnum value ); - std::ostream& operator<<( std::ostream& os, const StepEnum value ); - - /// StickLocationEnum ////////////////////////////////////////////////////////////////////// - /// - /// The stick-location type represents pictograms for the location of sticks, beaters, or - /// mallets on cymbals, gongs, drums, and other instruments. - /// - enum class StickLocationEnum - { - center = 0, - rim = 1, - cymbalBell = 2, - cymbalEdge = 3 - }; - - StickLocationEnum parseStickLocationEnum( const std::string& value ); - std::optional tryParseStickLocationEnum( const std::string& value ); - std::string toString( const StickLocationEnum value ); - std::ostream& toStream( std::ostream& os, const StickLocationEnum value ); - std::ostream& operator<<( std::ostream& os, const StickLocationEnum value ); - - /// StickMaterialEnum ////////////////////////////////////////////////////////////////////// - /// - /// The stick-material type represents the material being displayed in a stick pictogram. - /// - enum class StickMaterialEnum - { - soft = 0, - medium = 1, - hard = 2, - shaded = 3, - x = 4 - }; - - StickMaterialEnum parseStickMaterialEnum( const std::string& value ); - std::optional tryParseStickMaterialEnum( const std::string& value ); - std::string toString( const StickMaterialEnum value ); - std::ostream& toStream( std::ostream& os, const StickMaterialEnum value ); - std::ostream& operator<<( std::ostream& os, const StickMaterialEnum value ); - - /// StickTypeEnum ////////////////////////////////////////////////////////////////////////// - /// - /// The stick-type type represents the shape of pictograms where the material - /// in the stick, mallet, or beater is represented in the pictogram. - /// - enum class StickTypeEnum - { - bassDrum = 0, - doubleBassDrum = 1, - timpani = 2, - xylophone = 3, - yarn = 4 - }; - - StickTypeEnum parseStickTypeEnum( const std::string& value ); - std::optional tryParseStickTypeEnum( const std::string& value ); - std::string toString( const StickTypeEnum value ); - std::ostream& toStream( std::ostream& os, const StickTypeEnum value ); - std::ostream& operator<<( std::ostream& os, const StickTypeEnum value ); - - /// SyllabicEnum /////////////////////////////////////////////////////////////////////////// - /// - /// Lyric hyphenation is indicated by the syllabic type. The single, begin, end, and middle - /// values represent single-syllable words, word-beginning syllables, word-ending syllables, - /// and mid-word syllables, respectively. - /// - enum class SyllabicEnum - { - single = 0, - begin = 1, - end = 2, - middle = 3 - }; - - SyllabicEnum parseSyllabicEnum( const std::string& value ); - std::optional tryParseSyllabicEnum( const std::string& value ); - std::string toString( const SyllabicEnum value ); - std::ostream& toStream( std::ostream& os, const SyllabicEnum value ); - std::ostream& operator<<( std::ostream& os, const SyllabicEnum value ); - - /// SymbolSize ///////////////////////////////////////////////////////////////////////////// - /// - /// The symbol-size type is used to indicate full vs. cue-sized vs. oversized symbols. The - /// large value for oversized symbols was added in version 1.1. - /// - enum class SymbolSize - { - full = 0, - cue = 1, - large = 2 - }; - - SymbolSize parseSymbolSize( const std::string& value ); - std::optional tryParseSymbolSize( const std::string& value ); - std::string toString( const SymbolSize value ); - std::ostream& toStream( std::ostream& os, const SymbolSize value ); - std::ostream& operator<<( std::ostream& os, const SymbolSize value ); - - /// TextDirection ////////////////////////////////////////////////////////////////////////// - /// - /// The text-direction type is used to adjust and override the Unicode bidirectional text - /// algorithm, similar to the W3C Internationalization Tag Set recommendation. Values are - /// ltr (left-to-right embed), rtl (right-to-left embed), lro (left-to-right bidi-override), - /// and rlo (right-to-left bidi-override). The default value is ltr. This type is typically - /// used by applications that store text in left-to-right visual order rather than logical - /// order. Such applications can use the lro value to better communicate with other - /// applications that more fully support bidirectional text. - /// - enum class TextDirection - { - ltr = 0, - rtl = 1, - lro = 2, - rlo = 3 - }; - - TextDirection parseTextDirection( const std::string& value ); - std::optional tryParseTextDirection( const std::string& value ); - std::string toString( const TextDirection value ); - std::ostream& toStream( std::ostream& os, const TextDirection value ); - std::ostream& operator<<( std::ostream& os, const TextDirection value ); - - /// TimeRelationEnum /////////////////////////////////////////////////////////////////////// - /// - /// The time-relation type indicates the symbol used to represent the interchangeable aspect - /// of dual time signatures. - /// - enum class TimeRelationEnum - { - parentheses = 0, - bracket = 1, - equals = 2, - slash = 3, - space = 4, - hyphen = 5 - }; - - TimeRelationEnum parseTimeRelationEnum( const std::string& value ); - std::optional tryParseTimeRelationEnum( const std::string& value ); - std::string toString( const TimeRelationEnum value ); - std::ostream& toStream( std::ostream& os, const TimeRelationEnum value ); - std::ostream& operator<<( std::ostream& os, const TimeRelationEnum value ); - - /// TimeSeparator ////////////////////////////////////////////////////////////////////////// - /// - /// The time-separator type indicates how to display the arrangement between the beats and - /// beat-type values in a time signature. The default value is none. The horizontal, - /// diagonal, and vertical values represent horizontal, diagonal lower-left to upper-right, - /// and vertical lines respectively. For these values, the beats and beat-type values are - /// arranged on either side of the separator line. The none value represents no separator - /// with the beats and beat-type arranged vertically. The adjacent value represents no - /// separator with the beats and beat-type arranged horizontally. - /// - enum class TimeSeparator - { - none = 0, - horizontal = 1, - diagonal = 2, - vertical = 3, - adjacent = 4 - }; - - TimeSeparator parseTimeSeparator( const std::string& value ); - std::optional tryParseTimeSeparator( const std::string& value ); - std::string toString( const TimeSeparator value ); - std::ostream& toStream( std::ostream& os, const TimeSeparator value ); - std::ostream& operator<<( std::ostream& os, const TimeSeparator value ); - - /// TimeSymbol ///////////////////////////////////////////////////////////////////////////// - /// - /// The time-symbol type indicates how to display a time signature. The normal value is the - /// usual fractional display, and is the implied symbol type if none is specified. Other - /// options are the common and cut time symbols, as well as a single number with an implied - /// denominator. The note symbol indicates that the beat-type should be represented with the - /// corresponding downstem note rather than a number. The dotted-note symbol indicates that - /// the beat-type should be represented with a dotted downstem note that corresponds to - /// three times the beat-type value, and a numerator that is one third the beats value. - /// - enum class TimeSymbol - { - common = 0, - cut = 1, - singleNumber = 2, - note = 3, - dottedNote = 4, - normal = 5 - }; - - TimeSymbol parseTimeSymbol( const std::string& value ); - std::optional tryParseTimeSymbol( const std::string& value ); - std::string toString( const TimeSymbol value ); - std::ostream& toStream( std::ostream& os, const TimeSymbol value ); - std::ostream& operator<<( std::ostream& os, const TimeSymbol value ); - - /// TipDirection /////////////////////////////////////////////////////////////////////////// - /// - /// The tip-direction type represents the direction in which the tip of a stick or beater - /// points, using Unicode arrow terminology. - /// - enum class TipDirection - { - up = 0, - down = 1, - left = 2, - right = 3, - northwest = 4, - northeast = 5, - southeast = 6, - southwest = 7 - }; - - TipDirection parseTipDirection( const std::string& value ); - std::optional tryParseTipDirection( const std::string& value ); - std::string toString( const TipDirection value ); - std::ostream& toStream( std::ostream& os, const TipDirection value ); - std::ostream& operator<<( std::ostream& os, const TipDirection value ); - - /// TopBottom ////////////////////////////////////////////////////////////////////////////// - /// - /// The top-bottom type is used to indicate the top or bottom part of a vertical shape like - /// non-arpeggiate. - /// - enum class TopBottom - { - top = 0, - bottom = 1 - }; - - TopBottom parseTopBottom( const std::string& value ); - std::optional tryParseTopBottom( const std::string& value ); - std::string toString( const TopBottom value ); - std::ostream& toStream( std::ostream& os, const TopBottom value ); - std::ostream& operator<<( std::ostream& os, const TopBottom value ); - - /// TrillStep ////////////////////////////////////////////////////////////////////////////// - /// - /// The trill-step type describes the alternating note of trills and mordents for playback, - /// relative to the current note. - /// - enum class TrillStep - { - whole = 0, - half = 1, - unison = 2 - }; - - TrillStep parseTrillStep( const std::string& value ); - std::optional tryParseTrillStep( const std::string& value ); - std::string toString( const TrillStep value ); - std::ostream& toStream( std::ostream& os, const TrillStep value ); - std::ostream& operator<<( std::ostream& os, const TrillStep value ); - - /// TwoNoteTurn //////////////////////////////////////////////////////////////////////////// - /// - /// The two-note-turn type describes the ending notes of trills and mordents for playback, - /// relative to the current note. - /// - enum class TwoNoteTurn - { - whole = 0, - half = 1, - none = 2 - }; - - TwoNoteTurn parseTwoNoteTurn( const std::string& value ); - std::optional tryParseTwoNoteTurn( const std::string& value ); - std::string toString( const TwoNoteTurn value ); - std::ostream& toStream( std::ostream& os, const TwoNoteTurn value ); - std::ostream& operator<<( std::ostream& os, const TwoNoteTurn value ); - - /// UpDown ///////////////////////////////////////////////////////////////////////////////// - /// - /// The up-down type is used for the direction of arrows and other pointed symbols like - /// vertical accents, indicating which way the tip is pointing. - /// - enum class UpDown - { - up = 0, - down = 1 - }; - - UpDown parseUpDown( const std::string& value ); - std::optional tryParseUpDown( const std::string& value ); - std::string toString( const UpDown value ); - std::ostream& toStream( std::ostream& os, const UpDown value ); - std::ostream& operator<<( std::ostream& os, const UpDown value ); - - /// UpDownStopContinue ///////////////////////////////////////////////////////////////////// - /// - /// The up-down-stop-continue type is used for octave-shift elements, indicating the - /// direction of the shift from their true pitched values because of printing difficulty. - /// - enum class UpDownStopContinue - { - up = 0, - down = 1, - stop = 2, - continue_ = 3 - }; - - UpDownStopContinue parseUpDownStopContinue( const std::string& value ); - std::optional tryParseUpDownStopContinue( const std::string& value ); - std::string toString( const UpDownStopContinue value ); - std::ostream& toStream( std::ostream& os, const UpDownStopContinue value ); - std::ostream& operator<<( std::ostream& os, const UpDownStopContinue value ); - - /// UprightInverted //////////////////////////////////////////////////////////////////////// - /// - /// The upright-inverted type describes the appearance of a fermata element. The value is - /// upright if not specified. - /// - enum class UprightInverted - { - upright = 0, - inverted = 1 - }; - - UprightInverted parseUprightInverted( const std::string& value ); - std::optional tryParseUprightInverted( const std::string& value ); - std::string toString( const UprightInverted value ); - std::ostream& toStream( std::ostream& os, const UprightInverted value ); - std::ostream& operator<<( std::ostream& os, const UprightInverted value ); - - /// Valign ///////////////////////////////////////////////////////////////////////////////// - /// - /// The valign type is used to indicate vertical alignment to the top, middle, bottom, or - /// baseline of the text. Defaults are implementation-dependent. - /// - enum class Valign - { - top = 0, - middle = 1, - bottom = 2, - baseline = 3 - }; - - Valign parseValign( const std::string& value ); - std::optional tryParseValign( const std::string& value ); - std::string toString( const Valign value ); - std::ostream& toStream( std::ostream& os, const Valign value ); - std::ostream& operator<<( std::ostream& os, const Valign value ); - - /// ValignImage //////////////////////////////////////////////////////////////////////////// - /// - /// The valign-image type is used to indicate vertical alignment for images and graphics, so - /// it does not include a baseline value. Defaults are implementation-dependent. - /// - enum class ValignImage - { - top = 0, - middle = 1, - bottom = 2 - }; - - ValignImage parseValignImage( const std::string& value ); - std::optional tryParseValignImage( const std::string& value ); - std::string toString( const ValignImage value ); - std::ostream& toStream( std::ostream& os, const ValignImage value ); - std::ostream& operator<<( std::ostream& os, const ValignImage value ); - - /// WedgeType ////////////////////////////////////////////////////////////////////////////// - /// - /// The wedge type is crescendo for the start of a wedge that is closed at the left side, - /// diminuendo for the start of a wedge that is closed on the right side, and stop for the - /// end of a wedge. The continue type is used for formatting wedges over a system break, or - /// for other situations where a single wedge is divided into multiple segments. - /// - enum class WedgeType - { - crescendo = 0, - diminuendo = 1, - stop = 2, - continue_ = 3 - }; - - WedgeType parseWedgeType( const std::string& value ); - std::optional tryParseWedgeType( const std::string& value ); - std::string toString( const WedgeType value ); - std::ostream& toStream( std::ostream& os, const WedgeType value ); - std::ostream& operator<<( std::ostream& os, const WedgeType value ); - - /// Winged ///////////////////////////////////////////////////////////////////////////////// - /// - /// The winged attribute indicates whether the repeat has winged extensions that appear - /// above and below the barline. The straight and curved values represent single wings, - /// while the double-straight and double-curved values represent double wings. The none - /// value indicates no wings and is the default. - /// - enum class Winged - { - none = 0, - straight = 1, - curved = 2, - doubleStraight = 3, - doubleCurved = 4 - }; - - Winged parseWinged( const std::string& value ); - std::optional tryParseWinged( const std::string& value ); - std::string toString( const Winged value ); - std::ostream& toStream( std::ostream& os, const Winged value ); - std::ostream& operator<<( std::ostream& os, const Winged value ); - - /// WoodEnum /////////////////////////////////////////////////////////////////////////////// - /// - /// The wood type represents pictograms for wood percussion instruments. The maraca and - /// maracas values distinguish the one- and two-maraca versions of the pictogram. The - /// vibraslap and castanets values are in addition to Stone's list. - /// - enum class WoodEnum - { - boardClapper = 0, - cabasa = 1, - castanets = 2, - claves = 3, - guiro = 4, - logDrum = 5, - maraca = 6, - maracas = 7, - ratchet = 8, - sandpaperBlocks = 9, - slitDrum = 10, - templeBlock = 11, - vibraslap = 12, - woodBlock = 13 - }; - - WoodEnum parseWoodEnum( const std::string& value ); - std::optional tryParseWoodEnum( const std::string& value ); - std::string toString( const WoodEnum value ); - std::ostream& toStream( std::ostream& os, const WoodEnum value ); - std::ostream& operator<<( std::ostream& os, const WoodEnum value ); - - /// YesNo ////////////////////////////////////////////////////////////////////////////////// - /// - /// The yes-no type is used for boolean-like attributes. We cannot use W3C XML Schema - /// booleans due to their restrictions on expression of boolean values. - /// - enum class YesNo - { - yes = 0, - no = 1 - }; - - YesNo parseYesNo( const std::string& value ); - std::optional tryParseYesNo( const std::string& value ); - std::string toString( const YesNo value ); - std::ostream& toStream( std::ostream& os, const YesNo value ); - std::ostream& operator<<( std::ostream& os, const YesNo value ); - } -} diff --git a/Sourcecode/private/mx/core/EnumsBuiltin.cpp b/Sourcecode/private/mx/core/EnumsBuiltin.cpp deleted file mode 100644 index a0fed85dc..000000000 --- a/Sourcecode/private/mx/core/EnumsBuiltin.cpp +++ /dev/null @@ -1,153 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/EnumsBuiltin.h" - -namespace mx -{ - namespace core - { - XlinkActuate parseXlinkActuate( const std::string& value ) - { - if ( value == "onLoad" ) { return XlinkActuate::onLoad; } - else if ( value == "onRequest" ) { return XlinkActuate::onRequest; } - else if ( value == "other" ) { return XlinkActuate::other; } - else if ( value == "none" ) { return XlinkActuate::none; } - return XlinkActuate::onLoad; - } - - - std::string toString( const XlinkActuate value ) - { - switch ( value ) - { - case XlinkActuate::onLoad: return "onLoad"; - case XlinkActuate::onRequest: return "onRequest"; - case XlinkActuate::other: return "other"; - case XlinkActuate::none: return "none"; - default: break; - } - return "none"; - } - - - std::ostream& toStream( std::ostream& os, const XlinkActuate value ) - { - return os << toString( value ); - } - - - std::ostream& operator<<( std::ostream& os, const XlinkActuate value ) - { - return toStream( os, value ); - } - - XlinkShow parseXlinkShow( const std::string& value ) - { - if ( value == "new" ) { return XlinkShow::new_; } - else if ( value == "replace" ) { return XlinkShow::replace; } - else if ( value == "embed" ) { return XlinkShow::embed; } - else if ( value == "other" ) { return XlinkShow::other; } - else if ( value == "none" ) { return XlinkShow::none; } - return XlinkShow::new_; - } - - - std::string toString( const XlinkShow value ) - { - switch ( value ) - { - case XlinkShow::new_: return "new"; - case XlinkShow::replace: return "replace"; - case XlinkShow::embed: return "embed"; - case XlinkShow::other: return "other"; - case XlinkShow::none: return "none"; - default: break; - } - return "none"; - } - - - std::ostream& toStream( std::ostream& os, const XlinkShow value ) - { - return os << toString( value ); - } - - - std::ostream& operator<<( std::ostream& os, const XlinkShow value ) - { - return toStream( os, value ); - } - - XlinkType parseXlinkType( const std::string& value ) - { - if ( value == "simple" ) { return XlinkType::simple; } - else if ( value == "extended" ) { return XlinkType::extended; } - else if ( value == "title" ) { return XlinkType::title; } - else if ( value == "resource" ) { return XlinkType::resource; } - else if ( value == "locator" ) { return XlinkType::locator; } - else if ( value == "arc" ) { return XlinkType::arc; } - return XlinkType::simple; - } - - - std::string toString( const XlinkType value ) - { - switch ( value ) - { - case XlinkType::simple: return "simple"; - case XlinkType::extended: return "extended"; - case XlinkType::title: return "title"; - case XlinkType::resource: return "resource"; - case XlinkType::locator: return "locator"; - case XlinkType::arc: return "arc"; - default: break; - } - return "simple"; - } - - - std::ostream& toStream( std::ostream& os, const XlinkType value ) - { - return os << toString( value ); - } - - - std::ostream& operator<<( std::ostream& os, const XlinkType value ) - { - return toStream( os, value ); - } - - XmlSpace parseXmlSpace( const std::string& value ) - { - if ( value == "default" ) { return XmlSpace::default_; } - else if ( value == "preserve" ) { return XmlSpace::preserve; } - return XmlSpace::default_; - } - - - std::string toString( const XmlSpace value ) - { - switch ( value ) - { - case XmlSpace::default_: return "default"; - case XmlSpace::preserve: return "preserve"; - default: break; - } - return "default"; - } - - - std::ostream& toStream( std::ostream& os, const XmlSpace value ) - { - return os << toString( value ); - } - - - std::ostream& operator<<( std::ostream& os, const XmlSpace value ) - { - return toStream( os, value ); - } - } -} diff --git a/Sourcecode/private/mx/core/EnumsBuiltin.h b/Sourcecode/private/mx/core/EnumsBuiltin.h deleted file mode 100644 index 78fd00d3d..000000000 --- a/Sourcecode/private/mx/core/EnumsBuiltin.h +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include - -namespace mx -{ - namespace core - { - enum class XlinkType - { - simple = 0, - extended = 1, - title = 2, - resource = 3, - locator = 4, - arc = 5 - }; - XlinkType parseXlinkType( const std::string& value ); - std::string toString( const XlinkType value ); - std::ostream& toStream( std::ostream& os, const XlinkType value ); - std::ostream& operator<<( std::ostream& os, const XlinkType value ); - - - enum class XmlSpace - { - default_ = 0, - preserve = 1 - }; - XmlSpace parseXmlSpace( const std::string& value ); - std::string toString( const XmlSpace value ); - std::ostream& toStream( std::ostream& os, const XmlSpace value ); - std::ostream& operator<<( std::ostream& os, const XmlSpace value ); - - - enum class XlinkActuate - { - onLoad = 0, - onRequest = 1, - other = 2, - none = 3 - }; - XlinkActuate parseXlinkActuate( const std::string& value ); - std::string toString( const XlinkActuate value ); - std::ostream& toStream( std::ostream& os, const XlinkActuate value ); - std::ostream& operator<<( std::ostream& os, const XlinkActuate value ); - - enum class XlinkShow - { - new_ = 0, - replace = 1, - embed = 2, - other = 3, - none = 4 - }; - XlinkShow parseXlinkShow( const std::string& value ); - std::string toString( const XlinkShow value ); - std::ostream& toStream( std::ostream& os, const XlinkShow value ); - std::ostream& operator<<( std::ostream& os, const XlinkShow value ); - } -} - diff --git a/Sourcecode/private/mx/core/FontSize.cpp b/Sourcecode/private/mx/core/FontSize.cpp deleted file mode 100644 index ca39b1f51..000000000 --- a/Sourcecode/private/mx/core/FontSize.cpp +++ /dev/null @@ -1,136 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -// self -#include "mx/core/FontSize.h" - -// std -#include -#include - -namespace mx -{ - namespace core - { - template inline constexpr bool always_false_v = false; - - FontSize::FontSize() - : myValue{ Decimal{} } - { - - } - - FontSize::FontSize( Decimal value ) - : myValue{ std::move( value ) } - { - - } - - FontSize::FontSize( CssFontSize value ) - : myValue{ value } - { - - } - - FontSize::FontSize( const std::string& value ) - : FontSize{} - { - parse( value ); - } - - bool FontSize::getIsDecimal() const - { - return myValue.index() == 0; - } - - bool FontSize::getIsCssFontSize() const - { - return myValue.index() == 1; - } - - void FontSize::setDecimal( Decimal value ) - { - myValue.emplace( value ); - } - - void FontSize::setCssFontSize( CssFontSize value ) - { - myValue.emplace( value ); - } - - Decimal FontSize::getValueDecimal() const - { - auto result = Decimal{}; - std::visit([&](auto&& arg) - { - using T = std::decay_t; - if constexpr( std::is_same_v ) - result = arg; - else if constexpr( std::is_same_v ) - result = Decimal{}; - else - static_assert(always_false_v, "non-exhaustive visitor!"); - }, myValue); - return result; - } - - CssFontSize FontSize::getValueCssFontSize() const - { - auto result = CssFontSize::xxSmall; - std::visit([&](auto&& arg) - { - using T = std::decay_t; - if constexpr( std::is_same_v ) - result = CssFontSize::xxSmall; - else if constexpr( std::is_same_v ) - result = arg; - else - static_assert(always_false_v, "non-exhaustive visitor!"); - }, myValue); - return result; - } - - bool FontSize::parse( const std::string& value ) - { - auto decimal = Decimal{}; - if( decimal.parse( value ) ) - { - setDecimal( decimal ); - return true; - } - const auto cssFontSize = tryParseCssFontSize( value ); - if( cssFontSize ) - { - setCssFontSize( *cssFontSize ); - return true; - } - return false; - } - - std::string toString( const FontSize& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - std::ostream& toStream( std::ostream& os, const FontSize& value ) - { - if( value.getIsDecimal() ) - { - toStream( os, value.getValueDecimal() ); - } - if( value.getIsCssFontSize() ) - { - toStream( os, value.getValueCssFontSize() ); - } - return os; - } - - std::ostream& operator<<( std::ostream& os, const FontSize& value ) - { - return toStream( os, value ); - } - } -} diff --git a/Sourcecode/private/mx/core/FontSize.h b/Sourcecode/private/mx/core/FontSize.h deleted file mode 100644 index d55312f61..000000000 --- a/Sourcecode/private/mx/core/FontSize.h +++ /dev/null @@ -1,42 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - /// The font-size can be one of the CSS font sizes or a numeric point size. - class FontSize - { - public: - explicit FontSize(); - explicit FontSize( Decimal value ); - explicit FontSize( CssFontSize value ); - explicit FontSize( const std::string& value ); - bool getIsDecimal() const; - bool getIsCssFontSize() const; - void setDecimal( Decimal value ); - void setCssFontSize( CssFontSize value ); - Decimal getValueDecimal() const; - CssFontSize getValueCssFontSize() const; - bool parse( const std::string& value ); - - private: - std::variant myValue; - }; - - std::string toString( const FontSize& value ); - std::ostream& toStream( std::ostream& os, const FontSize& value ); - std::ostream& operator<<( std::ostream& os, const FontSize& value ); - } -} diff --git a/Sourcecode/private/mx/core/ForwardDeclare.h b/Sourcecode/private/mx/core/ForwardDeclare.h deleted file mode 100644 index bb201a726..000000000 --- a/Sourcecode/private/mx/core/ForwardDeclare.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include -#include -#include "mx/utility/Throw.h" -#include "mx/utility/Lock.h" -#include "mx/utility/JitAllocate.h" - -#ifndef MX_FORWARD_DECLARE_ELEMENT -#define MX_FORWARD_DECLARE_ELEMENT( class_name ) \ -class class_name ; \ -using class_name ## Ptr = std::shared_ptr< class_name >; \ -using class_name ## UPtr = std::unique_ptr< class_name >; \ -using class_name ## Set = std::vector< class_name ## Ptr >; \ -using class_name ## SetIter = class_name ## Set::iterator; \ -using class_name ## SetIterConst = class_name ## Set::const_iterator; \ - -#endif - - -#ifndef MX_FORWARD_DECLARE_ATTRIBUTES -#define MX_FORWARD_DECLARE_ATTRIBUTES( struct_name ) \ -struct struct_name ; \ -using struct_name ## Ptr = std::shared_ptr< struct_name >; \ - -#endif - -// uncomment the next line to throw on parse issues -// #define MX_DO_THROW_ON_PARSE_ISSUE - - #ifdef MX_DO_THROW_ON_PARSE_ISSUE - - #define MX_DEBUG_THROW_ON_PARSE_ISSUE if( !isSuccess ) { MX_THROW( "isSuccess is false" ); } - - #else - - #define MX_DEBUG_THROW_ON_PARSE_ISSUE - - #endif - - -#ifndef MX_RETURN_IS_SUCCESS - #define MX_RETURN_IS_SUCCESS MX_DEBUG_THROW_ON_PARSE_ISSUE; return isSuccess; -#endif diff --git a/Sourcecode/private/mx/core/FromXElement.cpp b/Sourcecode/private/mx/core/FromXElement.cpp deleted file mode 100644 index bf3c2c420..000000000 --- a/Sourcecode/private/mx/core/FromXElement.cpp +++ /dev/null @@ -1,907 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/FromXElement.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedPositiveIntegers.h" -#include "mx/core/Date.h" -#include "mx/core/PositiveIntegerOrEmpty.h" -#include "mx/core/YesNoNumber.h" -#include "mx/core/elements/BeatType.h" -#include "mx/core/elements/BeatUnit.h" -#include "mx/core/elements/BeatUnitDot.h" -#include "mx/core/elements/BeatUnitGroup.h" -#include "mx/core/elements/Beats.h" -#include "mx/core/elements/DisplayOctave.h" -#include "mx/core/elements/DisplayStep.h" -#include "mx/core/elements/DisplayStepOctaveGroup.h" -#include "mx/core/elements/EditorialGroup.h" -#include "mx/core/elements/EditorialVoiceDirectionGroup.h" -#include "mx/core/elements/EditorialVoiceGroup.h" -#include "mx/core/elements/Elevation.h" -#include "mx/core/elements/Elision.h" -#include "mx/core/elements/ElisionSyllabicGroup.h" -#include "mx/core/elements/ElisionSyllabicTextGroup.h" -#include "mx/core/elements/Extend.h" -#include "mx/core/elements/Footnote.h" -#include "mx/core/elements/Interchangeable.h" -#include "mx/core/elements/LayoutGroup.h" -#include "mx/core/elements/Level.h" -#include "mx/core/elements/MetronomeNote.h" -#include "mx/core/elements/MetronomeRelation.h" -#include "mx/core/elements/MetronomeRelationGroup.h" -#include "mx/core/elements/MidiBank.h" -#include "mx/core/elements/MidiChannel.h" -#include "mx/core/elements/MidiInstrument.h" -#include "mx/core/elements/MidiName.h" -#include "mx/core/elements/MidiProgram.h" -#include "mx/core/elements/MidiUnpitched.h" -#include "mx/core/elements/PageLayout.h" -#include "mx/core/elements/Pan.h" -#include "mx/core/elements/PerMinuteOrBeatUnitChoice.h" -#include "mx/core/elements/StaffLayout.h" -#include "mx/core/elements/Syllabic.h" -#include "mx/core/elements/SyllabicTextGroup.h" -#include "mx/core/elements/SystemLayout.h" -#include "mx/core/elements/Text.h" -#include "mx/core/elements/TimeSignatureGroup.h" -#include "mx/core/elements/Voice.h" -#include "mx/core/elements/Volume.h" - -namespace mx -{ - namespace core - { - bool importElement( - std::ostream& message, - ::ezxml::XElement& xelement, - bool& isSuccess, - ElementInterface& element, - bool& isMatch ) - { - if( xelement.getName() != element.getElementName() ) - { - return false; - } - isMatch = true; - isSuccess &= element.fromXElement( message, xelement ); - return true; - } - - bool isEndWithDecrementIfNeeded( - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool isDecrementNeeded ) - { - if( iter == endIter ) - { - if( isDecrementNeeded ) - { - --iter; - } - return true; - } - return false; - } - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - EditorialGroupPtr& group ) - { - bool doDecrementIter = false; - if( iter == endIter ) - { - return; - } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialGroup::getFootnote, &EditorialGroup::setHasFootnote ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialGroup::getLevel, &EditorialGroup::setHasLevel ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } - } - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - EditorialVoiceGroupPtr& group ) - { - bool doDecrementIter = false; - if( iter == endIter ) - { - return; - } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialVoiceGroup::getFootnote, &EditorialVoiceGroup::setHasFootnote ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialVoiceGroup::getLevel, &EditorialVoiceGroup::setHasLevel ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialVoiceGroup::getVoice, &EditorialVoiceGroup::setHasVoice ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } - } - - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - EditorialVoiceDirectionGroupPtr& group ) - { - bool doDecrementIter = false; - if( iter == endIter ) - { - return; - } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialVoiceDirectionGroup::getFootnote, &EditorialVoiceDirectionGroup::setHasFootnote ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialVoiceDirectionGroup::getLevel, &EditorialVoiceDirectionGroup::setHasLevel ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, doDecrementIter, group, &EditorialVoiceDirectionGroup::getVoice, &EditorialVoiceDirectionGroup::setHasVoice ); - if( isEndWithDecrementIfNeeded( iter, endIter, doDecrementIter ) ) { return ; } - } - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - LayoutGroupPtr& group ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - return; - } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &LayoutGroup::getPageLayout, &LayoutGroup::setHasPageLayout ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &LayoutGroup::getSystemLayout, &LayoutGroup::setHasSystemLayout ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - checkSetGroupMemberSetAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, "staff-layout", group, &LayoutGroup::getStaffLayoutSet, &LayoutGroup::addStaffLayout, &LayoutGroup::removeStaffLayout ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - if( isIterIncremented ) - { - --iter; - return; - } - } - - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - BeatUnitGroupPtr& group ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - return; - } - - bool dummy = false; - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &BeatUnitGroup::getBeatUnit, dummy ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - checkSetGroupMemberSetAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, "beat-unit-dot", group, &BeatUnitGroup::getBeatUnitDotSet, &BeatUnitGroup::addBeatUnitDot, &BeatUnitGroup::removeBeatUnitDot ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - if( isIterIncremented ) - { - --iter; - return; - } - } - - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - MetronomeRelationGroupPtr& group, - bool& hasGroup ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - return; - } - - bool isFound; - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &MetronomeRelationGroup::getMetronomeRelation, isFound ); - hasGroup |= isFound; - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &MetronomeRelationGroup::getMetronomeNote, isFound ); - hasGroup |= isFound; - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - if( isIterIncremented ) - { - --iter; - return; - } - } - - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - DisplayStepOctaveGroupPtr& group, - bool& hasGroup ) - { - hasGroup = false; - bool isIterIncremented = false; - if( iter == endIter ) - { - return; - } - - if( iter->getName() == group->getDisplayStep()->getElementName() ) - { - isSuccess &= group->getDisplayStep()->fromXElement( message, *iter ); - isIterIncremented = true; - hasGroup = true; - ++iter; - } - - if( ( iter != endIter ) && ( iter->getName() == group->getDisplayOctave()->getElementName() ) ) - { - isSuccess &= group->getDisplayOctave()->fromXElement( message, *iter ); - isIterIncremented = true; - hasGroup = true; - ++iter; - } - - if( isIterIncremented ) - { - --iter; - return; - } - } - - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - SyllabicTextGroupPtr& group ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - return; - } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &SyllabicTextGroup::getSyllabic, &SyllabicTextGroup::setHasSyllabic ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - bool hasText = false; - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &SyllabicTextGroup::getText, hasText ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - // Something seems slightly off about this 'if' statement. originally I expected to always - // find a 'text' element here, but it turns out that 'end-line' and 'end-paragraph' - // are valid to find here as well. It seems to be working. - if( iter->getName() != "end-line" && iter->getName() != "end-paragraph" && !hasText ) - { - isSuccess = false; - message << "SyllabicTextGroup: 'text' was not found where expected, '" << iter->getName() << "' was found instead" << std::endl; - } - - while( iter != endIter && ( iter->getName() == "elision" || iter->getName() == "syllabic" || iter->getName() == "text" ) ) - { - auto elisionSyllabicTextGroup = makeElisionSyllabicTextGroup(); - group->addElisionSyllabicTextGroup( elisionSyllabicTextGroup ); - - if( iter->getName() == "elision" ) - { - - isSuccess &= elisionSyllabicTextGroup->getElisionSyllabicGroup()->getElision()->fromXElement( message, *iter ); - elisionSyllabicTextGroup->setHasElisionSyllabicGroup( true ); - ++iter; - isIterIncremented = true; - } - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - if( iter->getName() == "syllabic" ) - { - - isSuccess &= elisionSyllabicTextGroup->getElisionSyllabicGroup()->getSyllabic()->fromXElement( message, *iter ); - elisionSyllabicTextGroup->setHasElisionSyllabicGroup( true ); - ++iter; - isIterIncremented = true; - } - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - if( iter->getName() == "text" ) - { - - isSuccess &= elisionSyllabicTextGroup->getText()->fromXElement( message, *iter ); - ++iter; - isIterIncremented = true; - } - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - } - - checkSetGroupMemberAndIncrementIter( message, iter, endIter, isSuccess, isIterIncremented, group, &SyllabicTextGroup::getExtend, &SyllabicTextGroup::setHasExtend ); - if( isEndWithDecrementIfNeeded( iter, endIter, isIterIncremented ) ) { return ; } - - - if( isIterIncremented ) - { - --iter; - return; - } - } - - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - TimeSignatureGroupPtr& group ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - isSuccess = false; - return; - } - - bool isBeatsFound = false; - bool isBeatTypeFound = false; - - if( iter->getName() == group->getBeats()->getElementName() ) - { - isSuccess &= group->getBeats()->fromXElement( message, *iter ); - isIterIncremented = true; - isBeatsFound = true; - ++iter; - } - - if( ( iter != endIter ) && ( iter->getName() == group->getBeatType()->getElementName() ) ) - { - isSuccess &= group->getBeatType()->fromXElement( message, *iter ); - isIterIncremented = true; - isBeatTypeFound = true; - ++iter; - } - - if( ( iter != endIter ) && ( iter->getName() == group->getInterchangeable()->getElementName() ) ) - { - group->setHasInterchangeable( true ); - isSuccess &= group->getInterchangeable()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( !isBeatsFound ) - { - message << "importGroup: the time-signature group requires a 'beats' element but it was not found" << std::endl; - isSuccess = false; - } - - if( !isBeatTypeFound ) - { - message << "importGroup: the time-signature group requires a 'beat-type' element but it was not found" << std::endl; - isSuccess = false; - } - - if( isIterIncremented ) - { - --iter; - return; - } - } - - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - MidiInstrumentPtr& group ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - isSuccess = false; - return; - } - - if( iter->getName() == group->getMidiChannel()->getElementName() ) - { - isSuccess &= group->getMidiChannel()->fromXElement( message, *iter ); - group->setHasMidiChannel( true ); - isIterIncremented = true; - ++iter; - } - - if( iter->getName() == group->getMidiName()->getElementName() ) - { - isSuccess &= group->getMidiName()->fromXElement( message, *iter ); - group->setHasMidiName( true ); - isIterIncremented = true; - ++iter; - } - - if( iter->getName() == group->getMidiBank()->getElementName() ) - { - isSuccess &= group->getMidiBank()->fromXElement( message, *iter ); - group->setHasMidiBank( true ); - isIterIncremented = true; - ++iter; - } - - if( iter->getName() == group->getMidiProgram()->getElementName() ) - { - isSuccess &= group->getMidiProgram()->fromXElement( message, *iter ); - group->setHasMidiProgram( true ); - isIterIncremented = true; - ++iter; - } - - if( iter->getName() == group->getMidiUnpitched()->getElementName() ) - { - isSuccess &= group->getMidiUnpitched()->fromXElement( message, *iter ); - group->setHasMidiUnpitched( true ); - isIterIncremented = true; - ++iter; - } - - if( iter->getName() == group->getVolume()->getElementName() ) - { - isSuccess &= group->getVolume()->fromXElement( message, *iter ); - group->setHasVolume( true ); - isIterIncremented = true; - ++iter; - } - - if( iter->getName() == group->getPan()->getElementName() ) - { - isSuccess &= group->getPan()->fromXElement( message, *iter ); - group->setHasPan( true ); - isIterIncremented = true; - ++iter; - } - - if( iter->getName() == group->getElevation()->getElementName() ) - { - isSuccess &= group->getElevation()->fromXElement( message, *iter ); - group->setHasElevation( true ); - isIterIncremented = true; - ++iter; - } - - if( isIterIncremented ) - { - --iter; - return; - } - } - -/* - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - CreditWordsGroupPtr& group ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - isSuccess = false; - return; - } - - bool isCreditWordsFound = false; - - if( iter->getName() == group->getCreditWords()->getElementName() ) - { - isSuccess &= group->getCreditWords()->fromXElement( message, *iter ); - isCreditWordsFound = true; - isIterIncremented = true; - ++iter; - } - }*/ - -/* - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - BeatUnitPerPtr& group ) - { - bool isIterIncremented = false; - if( iter == endIter ) - { - isSuccess = false; - return; - } - - if( iter->getName() == group->getMidiChannel()->getElementName() ) - { - isSuccess &= group->getMidiChannel()->fromXElement( message, *iter ); - group->setHasMidiChannel( true ); - isIterIncremented = true; - ++iter; - } - - if( isIterIncremented ) - { - --iter; - return; - } - } -*/ - - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - XsString& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.setValue( iter->getValue() ); - return true; - } - - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - Decimal& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - return true; - } - - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - Integer& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } - - - class Color; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - Color& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } - - - class Date; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - Date& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } - - - class FontSize; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - FontSize& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } - - - class NumberOrNormal; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - NumberOrNormal& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } - - - class PositiveIntegerOrEmpty; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - PositiveIntegerOrEmpty& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } - - - class YesNoNumber; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - YesNoNumber& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSuccess = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - setting value to '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } - - - class CommaSeparatedText; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - CommaSeparatedText& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - return true; - } - - - class DistanceType; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - DistanceType& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.setValue( iter->getValue() ); - return true; - } - - - class LineWidthType; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - LineWidthType& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.setValue( iter->getValue() ); - return true; - } - - - class CommaSeparatedListOfPositiveIntegers; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSuccess, - CommaSeparatedListOfPositiveIntegers& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ) - { - MX_UNUSED( message ); - MX_UNUSED( className ); - MX_UNUSED( isSuccess ); - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget.parse( iter->getValue() ); - return true; - } - } -} diff --git a/Sourcecode/private/mx/core/FromXElement.h b/Sourcecode/private/mx/core/FromXElement.h deleted file mode 100644 index 0e67e6d0e..000000000 --- a/Sourcecode/private/mx/core/FromXElement.h +++ /dev/null @@ -1,522 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "ezxml/XElement.h" -#include "ezxml/XAttribute.h" -#include "ezxml/XElementIterator.h" -#include "ezxml/XAttributeIterator.h" -#include - -#ifndef MX_FROM_XELEMENT_UNUSED -#define MX_FROM_XELEMENT_UNUSED( class_name ) \ -\ - bool class_name::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) \ - { \ - MX_UNUSED( xelement ); \ - message << #class_name ": fromXElement function is not expected to be called on this class" << std::endl; \ - return false; \ - } \ -\ - -#endif - -#ifndef MX_CHOICE_IF -#define MX_CHOICE_IF( enum_symbol, element_name, function_name_part ) \ -\ - if( xelement.getName() == element_name ) \ - { \ - myChoice = Choice::enum_symbol; \ - return get##function_name_part()->fromXElement( message, xelement ); \ - } \ -\ - -#endif - -#ifndef MX_BAD_ELEMENT_FAILURE -#define MX_BAD_ELEMENT_FAILURE( class_name ) \ -\ - message << #class_name << ": '" << xelement.getName() << "' is unrecognized" << std::endl; \ - return false; \ - -#endif - -namespace mx -{ - namespace core - { - - bool importElement( - std::ostream& message, - ::ezxml::XElement& xelement, - bool& isSuccess, - ElementInterface& element, - bool& isMatch ); - - - template - bool importElementSet( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - const std::string& elementName, - std::vector>& elementSet ) - { - bool isFirstItemAdded = false; - bool doDecrementIter = false; - while( iter != endIter && iter->getName() == elementName ) - { - auto item = std::make_shared(); - isSuccess &= item->fromXElement( message, *iter ); - if( !isFirstItemAdded && elementSet.size() == 1 ) - { - *elementSet.begin() = item; - isFirstItemAdded = true; - } - else - { - elementSet.push_back( item ); - isFirstItemAdded = true; - } - doDecrementIter = true; - ++iter; - } - if( doDecrementIter ) - { - --iter; - } - return isFirstItemAdded; - } - - - template - void checkSetGroupMemberAndIncrementIter( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - bool& hasIterBeenIncremented, - std::shared_ptr& elementPtr, - std::shared_ptr( PARENT_TYPE:: *getChildFunction ) () const, - void ( PARENT_TYPE:: *setHasFunction ) ( bool ) ) - { - if( iter == endIter ) - { - return; - } - auto& parent = *elementPtr; - auto childPtr = ( ( parent ).*( getChildFunction ) )(); - - if( iter->getName() == childPtr->getElementName() ) - { - isSuccess &= childPtr->fromXElement( message, *iter ); - ( ( parent ).*( setHasFunction ) )( true ); - ++iter; - hasIterBeenIncremented = true; - } - } - - - template - void checkSetGroupMemberAndIncrementIter( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - bool& hasIterBeenIncremented, - std::shared_ptr& elementPtr, - std::shared_ptr( PARENT_TYPE:: *getChildFunction ) () const, - bool& isFound ) - { - isFound = false; - if( iter == endIter ) - { - return; - } - auto& parent = *elementPtr; - auto childPtr = ( ( parent ).*( getChildFunction ) )(); - - if( iter->getName() == childPtr->getElementName() ) - { - isFound = true; - isSuccess &= childPtr->fromXElement( message, *iter ); - ++iter; - hasIterBeenIncremented = true; - } - } - - - template - void checkSetGroupMemberSetAndIncrementIter( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - bool& hasIterBeenIncremented, - std::string elementName, - std::shared_ptr& parentPtr, - const std::vector>& ( PARENT_TYPE:: *getConstSet ) () const, - void ( PARENT_TYPE:: *addItem ) ( const std::shared_ptr& ), - void ( PARENT_TYPE:: *removeItem ) ( const typename std::vector>::const_iterator& ) ) - { - if( iter == endIter ) - { - return; - } - - bool isFirstItemAdded = false; - - auto& parent = *parentPtr; - const auto& set = ( ( parent ).*( getConstSet ) )(); - - while( iter != endIter && iter->getName() == elementName ) - { - auto item = std::make_shared(); - isSuccess &= item->fromXElement( message, *iter ); - ++iter; - hasIterBeenIncremented = true; - - if( !isFirstItemAdded && set.size() == 1 ) - { - ( ( parent ).*( addItem ) )( item ); - ( ( parent ).*( removeItem ) )( set.cbegin() ); - isFirstItemAdded = true; - } - else - { - ( ( parent ).*( addItem ) )( item ); - isFirstItemAdded = true; - } - } - } - - - bool isEndWithDecrementIfNeeded( - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool isDecrementNeeded ); - - - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - EditorialGroupPtr& group ); - - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - EditorialVoiceGroupPtr& group ); - - MX_FORWARD_DECLARE_ELEMENT( LayoutGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - LayoutGroupPtr& group ); - - MX_FORWARD_DECLARE_ELEMENT( DisplayStepOctaveGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - DisplayStepOctaveGroupPtr& group, - bool& hasGroup ); - - MX_FORWARD_DECLARE_ELEMENT( SyllabicTextGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - SyllabicTextGroupPtr& group ); - - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceDirectionGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - EditorialVoiceDirectionGroupPtr& group ); - - MX_FORWARD_DECLARE_ELEMENT( BeatUnitGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - BeatUnitGroupPtr& group ); - - MX_FORWARD_DECLARE_ELEMENT( MetronomeRelationGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - MetronomeRelationGroupPtr& group, - bool& hasGroup ); - - MX_FORWARD_DECLARE_ELEMENT( TimeSignatureGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - TimeSignatureGroupPtr& group ); - - MX_FORWARD_DECLARE_ELEMENT( MidiInstrument ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - MidiInstrumentPtr& group ); - - MX_FORWARD_DECLARE_ELEMENT( CreditWordsGroup ); - - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - CreditWordsGroupPtr& group ); - -/* - void importGroup( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess, - BeatUnitPerPtr& group ); -*/ - - template - bool checkSetChoiceMember( - std::ostream& message, - ::ezxml::XElement& xelement, - bool& isSuccess, - std::shared_ptr& elementPtr, - std::string choiceElementName, - std::shared_ptr ( CHOICE_CLASS_TYPE:: *getFunction ) () const, - int choiceValue ) - { - if( xelement.getName() != choiceElementName ) - { - return false; - } - using enumType = typename CHOICE_CLASS_TYPE::Choice; - auto enumValue = static_cast( choiceValue ); - auto& parent = *elementPtr; - auto childPtr = ( ( parent ).*( getFunction ) )(); - isSuccess &= childPtr->fromXElement( message, xelement ); - parent.setChoice( enumValue ); - return true; - } - - - template - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - T& assignmentTarget, - bool& hasAttribute, - const char* const attributeName, - T (*parseFunction)( const std::string& ) ) - { - if( iter->getName() != attributeName ) - { - return false; - } - hasAttribute = true; - assignmentTarget = parseFunction( iter->getValue() ); - if( iter->getValue() != toString( assignmentTarget ) ) - { - isSucces = false; - message << className << ": attribute '" << attributeName << "' parsing failed - the value '"; - message << iter->getValue() << "' was unrecognized - defaulting to value '"; - message << toString( assignmentTarget ) << "'"; - } - return true; - } - - - class XsString; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - XsString& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - - - class Decimal; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - Decimal& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - - - class Integer; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - Integer& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - - - class Color; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - Color& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - - - class Date; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - Date& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - - - class FontSize; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - FontSize& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - - - class NumberOrNormal; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - NumberOrNormal& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - - - class PositiveIntegerOrEmpty; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - PositiveIntegerOrEmpty& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - - - class YesNoNumber; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - YesNoNumber& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - - - class CommaSeparatedText; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - CommaSeparatedText& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - - - class DistanceType; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - DistanceType& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - - - class LineWidthType; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - LineWidthType& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - - - class CommaSeparatedListOfPositiveIntegers; - - bool parseAttribute( - std::ostream& message, - ::ezxml::XAttributeIterator& iter, - const std::string& className, - bool& isSucces, - CommaSeparatedListOfPositiveIntegers& assignmentTarget, - bool& hasAttribute, - const char* const attributeName ); - } -} diff --git a/Sourcecode/private/mx/core/Integers.cpp b/Sourcecode/private/mx/core/Integers.cpp deleted file mode 100644 index c13b3277f..000000000 --- a/Sourcecode/private/mx/core/Integers.cpp +++ /dev/null @@ -1,288 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -// self -#include "mx/core/Integers.h" - -// std -#include - -namespace mx -{ - namespace core - { - Integer::Integer() - : Integer{ 0 } - { - - } - - Integer::Integer( IntType value ) - : myValue{ value } - { - - } - - IntType Integer::getValue() const - { - return myValue; - } - - void Integer::setValue( IntType value ) - { - myValue = value; - } - - bool Integer::parse( const std::string& value ) - { - std::stringstream ss( value ); - IntType temp = 0; - if ( ( ss >> temp ).fail() || !( ss >> std::ws ).eof()) - { - return false; - } - setValue( temp ); - return true; - } - - std::string toString( const Integer& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - std::ostream& toStream( std::ostream& os, const Integer& value ) - { - return os << value.getValue(); - } - - - std::ostream& operator<<( std::ostream& os, const Integer& value ) - { - return toStream( os, value ); - } - - inline IntType clamp( IntType min, IntType max, IntType value ) - { - if( value < min ) - { - return min; - } - else if( value > max ) - { - return max; - } - else - { - return value; - } - } - - IntRange::IntRange( IntType min, IntType max, IntType value ) - : Integer{ clamp( min, max, value ) } - , myMin{ min } - , myMax{ max } - { - - } - - void IntRange::setValue( IntType value ) - { - Integer::setValue( clamp( myMin, myMax, value ) ); - } - - AccordionMiddleValue::AccordionMiddleValue() - :AccordionMiddleValue{ 0 } - { - - } - - AccordionMiddleValue::AccordionMiddleValue( IntType value ) - :IntRange( 0, 3, value ) - { - - } - - BeamLevel::BeamLevel() - :BeamLevel{ 0 } - { - - } - - BeamLevel::BeamLevel( IntType value ) - :IntRange( 1, 8, value ) - { - - } - - Byte::Byte() - :Byte{ 0 } - { - - } - - Byte::Byte( IntType value ) - :IntRange( 0, 255, value ) - { - - } - - FifthsValue::FifthsValue() - :FifthsValue{ 0 } - { - - } - - FifthsValue::FifthsValue( IntType value ) - :IntRange( IntMin, IntMax, value ) - { - - } - - Midi128::Midi128() - :Midi128{ 0 } - { - - } - - Midi128::Midi128( IntType value ) - :IntRange( 1, 128, value ) - { - - } - - Midi16::Midi16() - :Midi16{ 0 } - { - - } - - Midi16::Midi16( IntType value ) - :IntRange( 1, 16, value ) - { - - } - - Midi16384::Midi16384() - :Midi16384{ 0 } - { - - } - - Midi16384::Midi16384( IntType value ) - :IntRange( 1, 16384, value ) - { - - } - - NonNegativeInteger::NonNegativeInteger() - :NonNegativeInteger{ 0 } - { - - } - - NonNegativeInteger::NonNegativeInteger( IntType value ) - :IntRange( 0, IntMax, value ) - { - - } - - NumberLevel::NumberLevel() - :NumberLevel{ 0 } - { - - } - - NumberLevel::NumberLevel( IntType value ) - :IntRange( 1, 6, value ) - { - - } - - NumberOfLines::NumberOfLines() - :NumberOfLines{ 0 } - { - - } - - NumberOfLines::NumberOfLines( IntType value ) - :IntRange( 0, 3, value ) - { - - } - - OctaveValue::OctaveValue() - :OctaveValue{ 0 } - { - - } - - OctaveValue::OctaveValue( IntType value ) - :IntRange( 0, 9, value ) - { - - } - - PositiveInteger::PositiveInteger() - :PositiveInteger{ 0 } - { - - } - - PositiveInteger::PositiveInteger( IntType value ) - :IntRange( 1, IntMax, value ) - { - - } - - StaffLine::StaffLine() - :StaffLine{ 0 } - { - - } - - StaffLine::StaffLine( IntType value ) - :IntRange( IntMin, IntMax, value ) - { - - } - - StaffNumber::StaffNumber() - :StaffNumber{ 0 } - { - - } - - StaffNumber::StaffNumber( IntType value ) - :IntRange( 1, IntMax, value ) - { - - } - - StringNumber::StringNumber() - :StringNumber{ 0 } - { - - } - - StringNumber::StringNumber( IntType value ) - :IntRange( 1, IntMax, value ) - { - - } - - TremoloMarks::TremoloMarks() - :TremoloMarks{ 0 } - { - - } - - TremoloMarks::TremoloMarks( IntType value ) - :IntRange( 0, 8, value ) - { - - } - } -} diff --git a/Sourcecode/private/mx/core/Integers.h b/Sourcecode/private/mx/core/Integers.h deleted file mode 100644 index baa73a7a1..000000000 --- a/Sourcecode/private/mx/core/Integers.h +++ /dev/null @@ -1,240 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include -#include - -namespace mx -{ - namespace core - { - /// Alias for the int type used by this library. - using IntType = int; - constexpr const IntType IntMin = std::numeric_limits::min(); - constexpr const IntType IntMax = std::numeric_limits::max(); - - /// A base class for all integer types. - class Integer - { - public: - Integer(); - explicit Integer( IntType value ); - virtual ~Integer() = default; - Integer( const Integer& ) = default; - Integer( Integer&& ) = default; - Integer& operator=( const Integer& ) = default; - Integer& operator=( Integer&& ) = default; - [[nodiscard]] IntType getValue() const; - virtual void setValue( IntType value ); - bool parse( const std::string& value ); - private: - IntType myValue; - }; - - - std::string toString( const Integer& value ); - std::ostream& toStream( std::ostream& os, const Integer& value ); - std::ostream& operator<<( std::ostream& os, const Integer& value ); - - /// A 'clamped', or 'ranged' Integer where the value can never be set - /// less than min or greater than max. - class IntRange : public Integer - { - public: - explicit IntRange( IntType min, IntType max, IntType value ); - void setValue( IntType value ) override; - private: - IntType myMin; - IntType myMax; - }; - - /// The accordion-middle type may have values of 1, 2, or 3, corresponding to having 1 to 3 - /// dots in the middle section of the accordion registration symbol. - /// - /// Note: MusicXML specifies the minimum allowable value as 1, however test documents exist - /// that have a value of 0. This library supports a minimum value of 0. Per - /// https://github.com/w3c/musicxml/issues/134, the correct representation for 0 dots is to - /// omit the element, so it is possible to create invalid MusicXML by setting the value to 0 - /// here. - /// - /// Range: min=0, max=3 - class AccordionMiddleValue : public IntRange - { - public: - explicit AccordionMiddleValue( IntType value ); - AccordionMiddleValue(); - }; - - /// The MusicXML format supports six levels of beaming, up to 1024th notes. Unlike the - /// number-level type, the beam-level type identifies concurrent beams in a beam group. It - /// does not distinguish overlapping beams such as grace notes within regular notes, or - /// beams used in different voices. - /// - /// Range: min=1, max=8 - class BeamLevel : public IntRange - { - public: - explicit BeamLevel( IntType value ); - BeamLevel(); - }; - - /// This is not part of MusicXML. It represents a clamped byte. - /// - /// Range: min=0, max=255 - class Byte : public IntRange - { - public: - explicit Byte( IntType value ); - Byte(); - }; - - /// The fifths type represents the number of flats or sharps in a traditional key signature. - /// Negative numbers are used for flats and positive numbers for sharps, reflecting the - /// key's placement within the circle of fifths (hence the type name). - /// - /// Range: min=None, max=None - class FifthsValue : public IntRange - { - public: - explicit FifthsValue( IntType value ); - FifthsValue(); - }; - - /// The midi-16 type is used to express MIDI 1.0 values that range from 1 to 128. - /// - /// Range: min=1, max=128 - class Midi128 : public IntRange - { - public: - explicit Midi128( IntType value ); - Midi128(); - }; - - /// The midi-16 type is used to express MIDI 1.0 values that range from 1 to 16. - /// - /// Range: min=1, max=16 - class Midi16 : public IntRange - { - public: - explicit Midi16( IntType value ); - Midi16(); - }; - - /// The midi-16 type is used to express MIDI 1.0 values that range from 1 to 16,384. - /// - /// Range: min=1, max=16384 - class Midi16384 : public IntRange - { - public: - explicit Midi16384( IntType value ); - Midi16384(); - }; - - /// The built-in primitive xs:nonNegativeInteger - /// - /// Range: min=0, max=None - class NonNegativeInteger : public IntRange - { - public: - explicit NonNegativeInteger( IntType value ); - NonNegativeInteger(); - }; - - /// Slurs, tuplets, and many other features can be concurrent and overlapping within a - /// single musical part. The number-level type distinguishes up to six concurrent objects of - /// the same type. A reading program should be prepared to handle cases where the number- - /// levels stop in an arbitrary order. Different numbers are needed when the features - /// overlap in MusicXML document order. When a number-level value is implied, the value is 1 - /// by default. - /// - /// Range: min=1, max=6 - class NumberLevel : public IntRange - { - public: - explicit NumberLevel( IntType value ); - NumberLevel(); - }; - - /// The number-of-lines type is used to specify the number of lines in text decoration - /// attributes. - /// - /// Range: min=0, max=3 - class NumberOfLines : public IntRange - { - public: - explicit NumberOfLines( IntType value ); - NumberOfLines(); - }; - - /// Octaves are represented by the numbers 0 to 9, where 4 indicates the octave started by - /// middle C. - /// - /// Range: min=0, max=9 - class OctaveValue : public IntRange - { - public: - explicit OctaveValue( IntType value ); - OctaveValue(); - }; - - /// The built-in primitive xs:positiveInteger - /// - /// Range: min=1, max=None - class PositiveInteger : public IntRange - { - public: - explicit PositiveInteger( IntType value ); - PositiveInteger(); - }; - - /// The staff-line type indicates the line on a given staff. Staff lines are numbered from - /// bottom to top, with 1 being the bottom line on a staff. Staff line values can be used to - /// specify positions outside the staff, such as a C clef positioned in the middle of a - /// grand staff. - /// - /// Range: min=None, max=None - class StaffLine : public IntRange - { - public: - explicit StaffLine( IntType value ); - StaffLine(); - }; - - /// The staff-number type indicates staff numbers within a multi-staff part. Staves are - /// numbered from top to bottom, with 1 being the top staff on a part. - /// - /// Range: min=1, max=None - class StaffNumber : public IntRange - { - public: - explicit StaffNumber( IntType value ); - StaffNumber(); - }; - - /// The string-number type indicates a string number. Strings are numbered from high to low, - /// with 1 being the highest pitched string. - /// - /// Range: min=1, max=None - class StringNumber : public IntRange - { - public: - explicit StringNumber( IntType value ); - StringNumber(); - }; - - /// The number of tremolo marks is represented by a number from 0 to 8: the same as beam- - /// level with 0 added. - /// - /// Range: min=0, max=8 - class TremoloMarks : public IntRange - { - public: - explicit TremoloMarks( IntType value ); - TremoloMarks(); - }; - } -} diff --git a/Sourcecode/private/mx/core/NumberOrNormal.cpp b/Sourcecode/private/mx/core/NumberOrNormal.cpp deleted file mode 100644 index db52fb232..000000000 --- a/Sourcecode/private/mx/core/NumberOrNormal.cpp +++ /dev/null @@ -1,160 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -// self -#include "mx/core/NumberOrNormal.h" - -// std -#include - -namespace mx -{ - namespace core - { - class NumberOrNormal::impl - { - public: - explicit impl() - :myDecimal( 0 ) - ,myIsNormal( true ) - {} - - explicit impl( const Decimal& value ) - :myDecimal( value ) - ,myIsNormal( false ) - {} - - explicit impl( const std::string& value ) - :myDecimal( 0 ) - ,myIsNormal( false ) - { - parse( value ); - } - - bool getIsNormal() const - { - return myIsNormal; - } - bool getIsNumber() const - { - return ! myIsNormal; - } - void setValueNormal() - { - myDecimal = Decimal( 0 ); - myIsNormal = true;; - } - void setValue( const Decimal& value ) - { - myDecimal = Decimal( value ); - myIsNormal = false; - } - Decimal getValueNumber() const - { - return myDecimal; - } - void parse( const std::string& value ) - { - if ( value == "normal" ) - { - myDecimal = Decimal( 0 ); - myIsNormal = true; - } - else - { - /* if it contains only numeric - characters it must be a number */ - myDecimal.parse( value ); - myIsNormal = false; - } - } - private: - Decimal myDecimal; - bool myIsNormal; - }; - - - NumberOrNormal::NumberOrNormal() - :myImpl( new impl() ) - {} - - NumberOrNormal::NumberOrNormal( const Decimal& value ) - :myImpl( new impl( value ) ) - {} - - NumberOrNormal::NumberOrNormal( const std::string& value ) - :myImpl( new impl( value ) ) - {} - - NumberOrNormal::~NumberOrNormal() {} - - NumberOrNormal::NumberOrNormal( const NumberOrNormal& other ) - :myImpl( new NumberOrNormal::impl( *other.myImpl ) ) - {} - - NumberOrNormal::NumberOrNormal( NumberOrNormal&& other ) - :myImpl( std::move( other.myImpl ) ) - {} - - NumberOrNormal& NumberOrNormal::operator=( NumberOrNormal&& other ) - { - myImpl = std::move( other.myImpl ); - return *this; - } - - NumberOrNormal& NumberOrNormal::operator=( const NumberOrNormal& other ) - { - this->myImpl = std::unique_ptr( new NumberOrNormal::impl( *other.myImpl ) ); - return *this; - } - bool NumberOrNormal::getIsNormal() const - { - return myImpl->getIsNormal(); - } - bool NumberOrNormal::getIsNumber() const - { - return myImpl->getIsNumber(); - } - void NumberOrNormal::setValueNormal() - { - myImpl->setValueNormal(); - } - void NumberOrNormal::setValue( const Decimal& value ) - { - myImpl->setValue( value ); - } - Decimal NumberOrNormal::getValueNumber() const - { - return myImpl->getValueNumber(); - } - - void NumberOrNormal::parse( const std::string& value ) - { - myImpl->parse( value ); - } - - std::string toString( const NumberOrNormal& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - std::ostream& toStream( std::ostream& os, const NumberOrNormal& value ) - { - if ( value.getIsNumber() ) - { - toStream( os, value.getValueNumber() ); - } - else - { - os << "normal"; - } - return os; - } - std::ostream& operator<<( std::ostream& os, const NumberOrNormal& value ) - { - return toStream( os, value ); - } - } -} diff --git a/Sourcecode/private/mx/core/NumberOrNormal.h b/Sourcecode/private/mx/core/NumberOrNormal.h deleted file mode 100644 index e95ca0f5d..000000000 --- a/Sourcecode/private/mx/core/NumberOrNormal.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - /// The number-or-normal values can be either a decimal number or the string "normal". This - /// is used by the line-height and letter-spacing attributes. - class NumberOrNormal - { - public: - explicit NumberOrNormal(); - explicit NumberOrNormal( const Decimal& value ); - explicit NumberOrNormal( const std::string& value ); - virtual ~NumberOrNormal(); - NumberOrNormal( const NumberOrNormal& other ); - NumberOrNormal( NumberOrNormal&& other ); - NumberOrNormal& operator=( const NumberOrNormal& other ); - NumberOrNormal& operator=( NumberOrNormal&& other ); - - bool getIsNormal() const; - bool getIsNumber() const; - void setValueNormal(); - void setValue( const Decimal& value ); - Decimal getValueNumber() const; - void parse( const std::string& value ); - - private: - class impl; - std::unique_ptr myImpl; - }; - - std::string toString( const NumberOrNormal& value ); - std::ostream& toStream( std::ostream& os, const NumberOrNormal& value ); - std::ostream& operator<<( std::ostream& os, const NumberOrNormal& value ); - } -} diff --git a/Sourcecode/private/mx/core/PlaybackSound.h b/Sourcecode/private/mx/core/PlaybackSound.h deleted file mode 100644 index 2e4f0258c..000000000 --- a/Sourcecode/private/mx/core/PlaybackSound.h +++ /dev/null @@ -1,909 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include - -namespace mx -{ - namespace core - { - #define MX_ENUM_CLASS_NAME PlaybackSound - - #define MX_ENUM_MEMBERS( MX_ENUM_VALUE ) \ - MX_ENUM_VALUE( brassAlphorn, "brass.alphorn" ) \ - MX_ENUM_VALUE( brassAltoHorn, "brass.alto-horn" ) \ - MX_ENUM_VALUE( brassBaritoneHorn, "brass.baritone-horn" ) \ - MX_ENUM_VALUE( brassBugle, "brass.bugle" ) \ - MX_ENUM_VALUE( brassBugleAlto, "brass.bugle.alto" ) \ - MX_ENUM_VALUE( brassBugleBaritone, "brass.bugle.baritone" ) \ - MX_ENUM_VALUE( brassBugleContrabass, "brass.bugle.contrabass" ) \ - MX_ENUM_VALUE( brassBugleEuphoniumBugle, "brass.bugle.euphonium-bugle" ) \ - MX_ENUM_VALUE( brassBugleMellophoneBugle, "brass.bugle.mellophone-bugle" ) \ - MX_ENUM_VALUE( brassBugleSoprano, "brass.bugle.soprano" ) \ - MX_ENUM_VALUE( brassCimbasso, "brass.cimbasso" ) \ - MX_ENUM_VALUE( brassConchShell, "brass.conch-shell" ) \ - MX_ENUM_VALUE( brassCornet, "brass.cornet" ) \ - MX_ENUM_VALUE( brassCornetSoprano, "brass.cornet.soprano" ) \ - MX_ENUM_VALUE( brassCornett, "brass.cornett" ) \ - MX_ENUM_VALUE( brassCornettTenor, "brass.cornett.tenor" ) \ - MX_ENUM_VALUE( brassCornettino, "brass.cornettino" ) \ - MX_ENUM_VALUE( brassDidgeridoo, "brass.didgeridoo" ) \ - MX_ENUM_VALUE( brassEuphonium, "brass.euphonium" ) \ - MX_ENUM_VALUE( brassFiscorn, "brass.fiscorn" ) \ - MX_ENUM_VALUE( brassFlugelhorn, "brass.flugelhorn" ) \ - MX_ENUM_VALUE( brassFrenchHorn, "brass.french-horn" ) \ - MX_ENUM_VALUE( brassGroup, "brass.group" ) \ - MX_ENUM_VALUE( brassGroupSynth, "brass.group.synth" ) \ - MX_ENUM_VALUE( brassHelicon, "brass.helicon" ) \ - MX_ENUM_VALUE( brassHoragai, "brass.horagai" ) \ - MX_ENUM_VALUE( brassKuhlohorn, "brass.kuhlohorn" ) \ - MX_ENUM_VALUE( brassMellophone, "brass.mellophone" ) \ - MX_ENUM_VALUE( brassNaturalHorn, "brass.natural-horn" ) \ - MX_ENUM_VALUE( brassOphicleide, "brass.ophicleide" ) \ - MX_ENUM_VALUE( brassPosthorn, "brass.posthorn" ) \ - MX_ENUM_VALUE( brassRagDung, "brass.rag-dung" ) \ - MX_ENUM_VALUE( brassSackbutt, "brass.sackbutt" ) \ - MX_ENUM_VALUE( brassSackbuttAlto, "brass.sackbutt.alto" ) \ - MX_ENUM_VALUE( brassSackbuttBass, "brass.sackbutt.bass" ) \ - MX_ENUM_VALUE( brassSackbuttTenor, "brass.sackbutt.tenor" ) \ - MX_ENUM_VALUE( brassSaxhorn, "brass.saxhorn" ) \ - MX_ENUM_VALUE( brassSerpent, "brass.serpent" ) \ - MX_ENUM_VALUE( brassShofar, "brass.shofar" ) \ - MX_ENUM_VALUE( brassSousaphone, "brass.sousaphone" ) \ - MX_ENUM_VALUE( brassTrombone, "brass.trombone" ) \ - MX_ENUM_VALUE( brassTromboneAlto, "brass.trombone.alto" ) \ - MX_ENUM_VALUE( brassTromboneBass, "brass.trombone.bass" ) \ - MX_ENUM_VALUE( brassTromboneContrabass, "brass.trombone.contrabass" ) \ - MX_ENUM_VALUE( brassTromboneTenor, "brass.trombone.tenor" ) \ - MX_ENUM_VALUE( brassTrumpet, "brass.trumpet" ) \ - MX_ENUM_VALUE( brassTrumpetBaroque, "brass.trumpet.baroque" ) \ - MX_ENUM_VALUE( brassTrumpetBass, "brass.trumpet.bass" ) \ - MX_ENUM_VALUE( brassTrumpetBflat, "brass.trumpet.bflat" ) \ - MX_ENUM_VALUE( brassTrumpetC, "brass.trumpet.c" ) \ - MX_ENUM_VALUE( brassTrumpetD, "brass.trumpet.d" ) \ - MX_ENUM_VALUE( brassTrumpetPiccolo, "brass.trumpet.piccolo" ) \ - MX_ENUM_VALUE( brassTrumpetPocket, "brass.trumpet.pocket" ) \ - MX_ENUM_VALUE( brassTrumpetSlide, "brass.trumpet.slide" ) \ - MX_ENUM_VALUE( brassTrumpetTenor, "brass.trumpet.tenor" ) \ - MX_ENUM_VALUE( brassTuba, "brass.tuba" ) \ - MX_ENUM_VALUE( brassTubaBass, "brass.tuba.bass" ) \ - MX_ENUM_VALUE( brassTubaSubcontrabass, "brass.tuba.subcontrabass" ) \ - MX_ENUM_VALUE( brassViennaHorn, "brass.vienna-horn" ) \ - MX_ENUM_VALUE( brassVuvuzela, "brass.vuvuzela" ) \ - MX_ENUM_VALUE( brassWagnerTuba, "brass.wagner-tuba" ) \ - MX_ENUM_VALUE( drumApentemma, "drum.apentemma" ) \ - MX_ENUM_VALUE( drumAshiko, "drum.ashiko" ) \ - MX_ENUM_VALUE( drumAtabaque, "drum.atabaque" ) \ - MX_ENUM_VALUE( drumAtoke, "drum.atoke" ) \ - MX_ENUM_VALUE( drumAtsimevu, "drum.atsimevu" ) \ - MX_ENUM_VALUE( drumAxatse, "drum.axatse" ) \ - MX_ENUM_VALUE( drumBassDrum, "drum.bass-drum" ) \ - MX_ENUM_VALUE( drumBata, "drum.bata" ) \ - MX_ENUM_VALUE( drumBataItotele, "drum.bata.itotele" ) \ - MX_ENUM_VALUE( drumBataIya, "drum.bata.iya" ) \ - MX_ENUM_VALUE( drumBataOkonkolo, "drum.bata.okonkolo" ) \ - MX_ENUM_VALUE( drumBendir, "drum.bendir" ) \ - MX_ENUM_VALUE( drumBodhran, "drum.bodhran" ) \ - MX_ENUM_VALUE( drumBombo, "drum.bombo" ) \ - MX_ENUM_VALUE( drumBongo, "drum.bongo" ) \ - MX_ENUM_VALUE( drumBougarabou, "drum.bougarabou" ) \ - MX_ENUM_VALUE( drumBuffaloDrum, "drum.buffalo-drum" ) \ - MX_ENUM_VALUE( drumCajon, "drum.cajon" ) \ - MX_ENUM_VALUE( drumChenda, "drum.chenda" ) \ - MX_ENUM_VALUE( drumChuDaiko, "drum.chu-daiko" ) \ - MX_ENUM_VALUE( drumConga, "drum.conga" ) \ - MX_ENUM_VALUE( drumCuica, "drum.cuica" ) \ - MX_ENUM_VALUE( drumDabakan, "drum.dabakan" ) \ - MX_ENUM_VALUE( drumDaff, "drum.daff" ) \ - MX_ENUM_VALUE( drumDafli, "drum.dafli" ) \ - MX_ENUM_VALUE( drumDaibyosi, "drum.daibyosi" ) \ - MX_ENUM_VALUE( drumDamroo, "drum.damroo" ) \ - MX_ENUM_VALUE( drumDarabuka, "drum.darabuka" ) \ - MX_ENUM_VALUE( drumDef, "drum.def" ) \ - MX_ENUM_VALUE( drumDhol, "drum.dhol" ) \ - MX_ENUM_VALUE( drumDholak, "drum.dholak" ) \ - MX_ENUM_VALUE( drumDjembe, "drum.djembe" ) \ - MX_ENUM_VALUE( drumDoira, "drum.doira" ) \ - MX_ENUM_VALUE( drumDondo, "drum.dondo" ) \ - MX_ENUM_VALUE( drumDounDounBa, "drum.doun-doun-ba" ) \ - MX_ENUM_VALUE( drumDuff, "drum.duff" ) \ - MX_ENUM_VALUE( drumDumbek, "drum.dumbek" ) \ - MX_ENUM_VALUE( drumFontomfrom, "drum.fontomfrom" ) \ - MX_ENUM_VALUE( drumFrameDrum, "drum.frame-drum" ) \ - MX_ENUM_VALUE( drumFrameDrumArabian, "drum.frame-drum.arabian" ) \ - MX_ENUM_VALUE( drumGeduk, "drum.geduk" ) \ - MX_ENUM_VALUE( drumGhatam, "drum.ghatam" ) \ - MX_ENUM_VALUE( drumGome, "drum.gome" ) \ - MX_ENUM_VALUE( drumGroup, "drum.group" ) \ - MX_ENUM_VALUE( drumGroupChinese, "drum.group.chinese" ) \ - MX_ENUM_VALUE( drumGroupEwe, "drum.group.ewe" ) \ - MX_ENUM_VALUE( drumGroupIndian, "drum.group.indian" ) \ - MX_ENUM_VALUE( drumGroupSet, "drum.group.set" ) \ - MX_ENUM_VALUE( drumHandDrum, "drum.hand-drum" ) \ - MX_ENUM_VALUE( drumHiraDaiko, "drum.hira-daiko" ) \ - MX_ENUM_VALUE( drumIbo, "drum.ibo" ) \ - MX_ENUM_VALUE( drumIgihumurizo, "drum.igihumurizo" ) \ - MX_ENUM_VALUE( drumInyahura, "drum.inyahura" ) \ - MX_ENUM_VALUE( drumIshakwe, "drum.ishakwe" ) \ - MX_ENUM_VALUE( drumJangGu, "drum.jang-gu" ) \ - MX_ENUM_VALUE( drumKagan, "drum.kagan" ) \ - MX_ENUM_VALUE( drumKakko, "drum.kakko" ) \ - MX_ENUM_VALUE( drumKanjira, "drum.kanjira" ) \ - MX_ENUM_VALUE( drumKendhang, "drum.kendhang" ) \ - MX_ENUM_VALUE( drumKendhangAgeng, "drum.kendhang.ageng" ) \ - MX_ENUM_VALUE( drumKendhangCiblon, "drum.kendhang.ciblon" ) \ - MX_ENUM_VALUE( drumKenkeni, "drum.kenkeni" ) \ - MX_ENUM_VALUE( drumKhol, "drum.khol" ) \ - MX_ENUM_VALUE( drumKickDrum, "drum.kick-drum" ) \ - MX_ENUM_VALUE( drumKidi, "drum.kidi" ) \ - MX_ENUM_VALUE( drumKoDaiko, "drum.ko-daiko" ) \ - MX_ENUM_VALUE( drumKpanlogo, "drum.kpanlogo" ) \ - MX_ENUM_VALUE( drumKudum, "drum.kudum" ) \ - MX_ENUM_VALUE( drumLambeg, "drum.lambeg" ) \ - MX_ENUM_VALUE( drumLionDrum, "drum.lion-drum" ) \ - MX_ENUM_VALUE( drumLogDrum, "drum.log-drum" ) \ - MX_ENUM_VALUE( drumLogDrumAfrican, "drum.log-drum.african" ) \ - MX_ENUM_VALUE( drumLogDrumNative, "drum.log-drum.native" ) \ - MX_ENUM_VALUE( drumLogDrumNigerian, "drum.log-drum.nigerian" ) \ - MX_ENUM_VALUE( drumMadal, "drum.madal" ) \ - MX_ENUM_VALUE( drumMaddale, "drum.maddale" ) \ - MX_ENUM_VALUE( drumMridangam, "drum.mridangam" ) \ - MX_ENUM_VALUE( drumNaal, "drum.naal" ) \ - MX_ENUM_VALUE( drumNagadoDaiko, "drum.nagado-daiko" ) \ - MX_ENUM_VALUE( drumNagara, "drum.nagara" ) \ - MX_ENUM_VALUE( drumNaqara, "drum.naqara" ) \ - MX_ENUM_VALUE( drumODaiko, "drum.o-daiko" ) \ - MX_ENUM_VALUE( drumOkawa, "drum.okawa" ) \ - MX_ENUM_VALUE( drumOkedoDaiko, "drum.okedo-daiko" ) \ - MX_ENUM_VALUE( drumPahuHula, "drum.pahu-hula" ) \ - MX_ENUM_VALUE( drumPakhawaj, "drum.pakhawaj" ) \ - MX_ENUM_VALUE( drumPandeiro, "drum.pandeiro" ) \ - MX_ENUM_VALUE( drumPandero, "drum.pandero" ) \ - MX_ENUM_VALUE( drumPowwow, "drum.powwow" ) \ - MX_ENUM_VALUE( drumPueblo, "drum.pueblo" ) \ - MX_ENUM_VALUE( drumRepinique, "drum.repinique" ) \ - MX_ENUM_VALUE( drumRiq, "drum.riq" ) \ - MX_ENUM_VALUE( drumRototom, "drum.rototom" ) \ - MX_ENUM_VALUE( drumSabar, "drum.sabar" ) \ - MX_ENUM_VALUE( drumSakara, "drum.sakara" ) \ - MX_ENUM_VALUE( drumSampho, "drum.sampho" ) \ - MX_ENUM_VALUE( drumSangban, "drum.sangban" ) \ - MX_ENUM_VALUE( drumShimeDaiko, "drum.shime-daiko" ) \ - MX_ENUM_VALUE( drumSlitDrum, "drum.slit-drum" ) \ - MX_ENUM_VALUE( drumSlitDrumKrin, "drum.slit-drum.krin" ) \ - MX_ENUM_VALUE( drumSnareDrum, "drum.snare-drum" ) \ - MX_ENUM_VALUE( drumSnareDrumElectric, "drum.snare-drum.electric" ) \ - MX_ENUM_VALUE( drumSogo, "drum.sogo" ) \ - MX_ENUM_VALUE( drumSurdo, "drum.surdo" ) \ - MX_ENUM_VALUE( drumTabla, "drum.tabla" ) \ - MX_ENUM_VALUE( drumTablaBayan, "drum.tabla.bayan" ) \ - MX_ENUM_VALUE( drumTablaDayan, "drum.tabla.dayan" ) \ - MX_ENUM_VALUE( drumTaiko, "drum.taiko" ) \ - MX_ENUM_VALUE( drumTalking, "drum.talking" ) \ - MX_ENUM_VALUE( drumTama, "drum.tama" ) \ - MX_ENUM_VALUE( drumTamborita, "drum.tamborita" ) \ - MX_ENUM_VALUE( drumTambourine, "drum.tambourine" ) \ - MX_ENUM_VALUE( drumTamte, "drum.tamte" ) \ - MX_ENUM_VALUE( drumTangku, "drum.tangku" ) \ - MX_ENUM_VALUE( drumTanTan, "drum.tan-tan" ) \ - MX_ENUM_VALUE( drumTaphon, "drum.taphon" ) \ - MX_ENUM_VALUE( drumTar, "drum.tar" ) \ - MX_ENUM_VALUE( drumTasha, "drum.tasha" ) \ - MX_ENUM_VALUE( drumTenorDrum, "drum.tenor-drum" ) \ - MX_ENUM_VALUE( drumTeponaxtli, "drum.teponaxtli" ) \ - MX_ENUM_VALUE( drumThavil, "drum.thavil" ) \ - MX_ENUM_VALUE( drumTheBox, "drum.the-box" ) \ - MX_ENUM_VALUE( drumTimbale, "drum.timbale" ) \ - MX_ENUM_VALUE( drumTimpani, "drum.timpani" ) \ - MX_ENUM_VALUE( drumTinaja, "drum.tinaja" ) \ - MX_ENUM_VALUE( drumToere, "drum.toere" ) \ - MX_ENUM_VALUE( drumTombak, "drum.tombak" ) \ - MX_ENUM_VALUE( drumTomTom, "drum.tom-tom" ) \ - MX_ENUM_VALUE( drumTomTomSynth, "drum.tom-tom.synth" ) \ - MX_ENUM_VALUE( drumTsuzumi, "drum.tsuzumi" ) \ - MX_ENUM_VALUE( drumTumbak, "drum.tumbak" ) \ - MX_ENUM_VALUE( drumUchiwaDaiko, "drum.uchiwa-daiko" ) \ - MX_ENUM_VALUE( drumUdaku, "drum.udaku" ) \ - MX_ENUM_VALUE( drumUdu, "drum.udu" ) \ - MX_ENUM_VALUE( drumZarb, "drum.zarb" ) \ - MX_ENUM_VALUE( effectAeolianHarp, "effect.aeolian-harp" ) \ - MX_ENUM_VALUE( effectAirHorn, "effect.air-horn" ) \ - MX_ENUM_VALUE( effectApplause, "effect.applause" ) \ - MX_ENUM_VALUE( effectBassStringSlap, "effect.bass-string-slap" ) \ - MX_ENUM_VALUE( effectBird, "effect.bird" ) \ - MX_ENUM_VALUE( effectBirdNightingale, "effect.bird.nightingale" ) \ - MX_ENUM_VALUE( effectBirdTweet, "effect.bird.tweet" ) \ - MX_ENUM_VALUE( effectBreath, "effect.breath" ) \ - MX_ENUM_VALUE( effectBubble, "effect.bubble" ) \ - MX_ENUM_VALUE( effectBullroarer, "effect.bullroarer" ) \ - MX_ENUM_VALUE( effectBurst, "effect.burst" ) \ - MX_ENUM_VALUE( effectCar, "effect.car" ) \ - MX_ENUM_VALUE( effectCarCrash, "effect.car.crash" ) \ - MX_ENUM_VALUE( effectCarEngine, "effect.car.engine" ) \ - MX_ENUM_VALUE( effectCarPass, "effect.car.pass" ) \ - MX_ENUM_VALUE( effectCarStop, "effect.car.stop" ) \ - MX_ENUM_VALUE( effectCrickets, "effect.crickets" ) \ - MX_ENUM_VALUE( effectDog, "effect.dog" ) \ - MX_ENUM_VALUE( effectDoorCreak, "effect.door.creak" ) \ - MX_ENUM_VALUE( effectDoorSlam, "effect.door.slam" ) \ - MX_ENUM_VALUE( effectExplosion, "effect.explosion" ) \ - MX_ENUM_VALUE( effectFluteKeyClick, "effect.flute-key-click" ) \ - MX_ENUM_VALUE( effectFootsteps, "effect.footsteps" ) \ - MX_ENUM_VALUE( effectFrogs, "effect.frogs" ) \ - MX_ENUM_VALUE( effectGuitarCutting, "effect.guitar-cutting" ) \ - MX_ENUM_VALUE( effectGuitarFret, "effect.guitar-fret" ) \ - MX_ENUM_VALUE( effectGunshot, "effect.gunshot" ) \ - MX_ENUM_VALUE( effectHandClap, "effect.hand-clap" ) \ - MX_ENUM_VALUE( effectHeartbeat, "effect.heartbeat" ) \ - MX_ENUM_VALUE( effectHelicopter, "effect.helicopter" ) \ - MX_ENUM_VALUE( effectHighQ, "effect.high-q" ) \ - MX_ENUM_VALUE( effectHorseGallop, "effect.horse-gallop" ) \ - MX_ENUM_VALUE( effectJetPlane, "effect.jet-plane" ) \ - MX_ENUM_VALUE( effectLaserGun, "effect.laser-gun" ) \ - MX_ENUM_VALUE( effectLaugh, "effect.laugh" ) \ - MX_ENUM_VALUE( effectLionsRoar, "effect.lions-roar" ) \ - MX_ENUM_VALUE( effectMachineGun, "effect.machine-gun" ) \ - MX_ENUM_VALUE( effectMarchingMachine, "effect.marching-machine" ) \ - MX_ENUM_VALUE( effectMetronomeBell, "effect.metronome-bell" ) \ - MX_ENUM_VALUE( effectMetronomeClick, "effect.metronome-click" ) \ - MX_ENUM_VALUE( effectPat, "effect.pat" ) \ - MX_ENUM_VALUE( effectPunch, "effect.punch" ) \ - MX_ENUM_VALUE( effectRain, "effect.rain" ) \ - MX_ENUM_VALUE( effectScratch, "effect.scratch" ) \ - MX_ENUM_VALUE( effectScream, "effect.scream" ) \ - MX_ENUM_VALUE( effectSeashore, "effect.seashore" ) \ - MX_ENUM_VALUE( effectSiren, "effect.siren" ) \ - MX_ENUM_VALUE( effectSlap, "effect.slap" ) \ - MX_ENUM_VALUE( effectSnap, "effect.snap" ) \ - MX_ENUM_VALUE( effectStamp, "effect.stamp" ) \ - MX_ENUM_VALUE( effectStarship, "effect.starship" ) \ - MX_ENUM_VALUE( effectStream, "effect.stream" ) \ - MX_ENUM_VALUE( effectTelephoneRing, "effect.telephone-ring" ) \ - MX_ENUM_VALUE( effectThunder, "effect.thunder" ) \ - MX_ENUM_VALUE( effectTrain, "effect.train" ) \ - MX_ENUM_VALUE( effectTrashCan, "effect.trash-can" ) \ - MX_ENUM_VALUE( effectWhip, "effect.whip" ) \ - MX_ENUM_VALUE( effectWhistle, "effect.whistle" ) \ - MX_ENUM_VALUE( effectWhistleMouthSiren, "effect.whistle.mouth-siren" ) \ - MX_ENUM_VALUE( effectWhistlePolice, "effect.whistle.police" ) \ - MX_ENUM_VALUE( effectWhistleSlide, "effect.whistle.slide" ) \ - MX_ENUM_VALUE( effectWhistleTrain, "effect.whistle.train" ) \ - MX_ENUM_VALUE( effectWind, "effect.wind" ) \ - MX_ENUM_VALUE( keyboardAccordion, "keyboard.accordion" ) \ - MX_ENUM_VALUE( keyboardBandoneon, "keyboard.bandoneon" ) \ - MX_ENUM_VALUE( keyboardCelesta, "keyboard.celesta" ) \ - MX_ENUM_VALUE( keyboardClavichord, "keyboard.clavichord" ) \ - MX_ENUM_VALUE( keyboardClavichordSynth, "keyboard.clavichord.synth" ) \ - MX_ENUM_VALUE( keyboardConcertina, "keyboard.concertina" ) \ - MX_ENUM_VALUE( keyboardFortepiano, "keyboard.fortepiano" ) \ - MX_ENUM_VALUE( keyboardHarmonium, "keyboard.harmonium" ) \ - MX_ENUM_VALUE( keyboardHarpsichord, "keyboard.harpsichord" ) \ - MX_ENUM_VALUE( keyboardOndesMartenot, "keyboard.ondes-martenot" ) \ - MX_ENUM_VALUE( keyboardOrgan, "keyboard.organ" ) \ - MX_ENUM_VALUE( keyboardOrganDrawbar, "keyboard.organ.drawbar" ) \ - MX_ENUM_VALUE( keyboardOrganPercussive, "keyboard.organ.percussive" ) \ - MX_ENUM_VALUE( keyboardOrganPipe, "keyboard.organ.pipe" ) \ - MX_ENUM_VALUE( keyboardOrganReed, "keyboard.organ.reed" ) \ - MX_ENUM_VALUE( keyboardOrganRotary, "keyboard.organ.rotary" ) \ - MX_ENUM_VALUE( keyboardPiano, "keyboard.piano" ) \ - MX_ENUM_VALUE( keyboardPianoElectric, "keyboard.piano.electric" ) \ - MX_ENUM_VALUE( keyboardPianoGrand, "keyboard.piano.grand" ) \ - MX_ENUM_VALUE( keyboardPianoHonkyTonk, "keyboard.piano.honky-tonk" ) \ - MX_ENUM_VALUE( keyboardPianoPrepared, "keyboard.piano.prepared" ) \ - MX_ENUM_VALUE( keyboardPianoToy, "keyboard.piano.toy" ) \ - MX_ENUM_VALUE( keyboardPianoUpright, "keyboard.piano.upright" ) \ - MX_ENUM_VALUE( keyboardVirginal, "keyboard.virginal" ) \ - MX_ENUM_VALUE( metalAdodo, "metal.adodo" ) \ - MX_ENUM_VALUE( metalAnvil, "metal.anvil" ) \ - MX_ENUM_VALUE( metalBabendil, "metal.babendil" ) \ - MX_ENUM_VALUE( metalBellsAgogo, "metal.bells.agogo" ) \ - MX_ENUM_VALUE( metalBellsAlmglocken, "metal.bells.almglocken" ) \ - MX_ENUM_VALUE( metalBellsBellPlate, "metal.bells.bell-plate" ) \ - MX_ENUM_VALUE( metalBellsBellTree, "metal.bells.bell-tree" ) \ - MX_ENUM_VALUE( metalBellsCarillon, "metal.bells.carillon" ) \ - MX_ENUM_VALUE( metalBellsChimes, "metal.bells.chimes" ) \ - MX_ENUM_VALUE( metalBellsChimta, "metal.bells.chimta" ) \ - MX_ENUM_VALUE( metalBellsChippli, "metal.bells.chippli" ) \ - MX_ENUM_VALUE( metalBellsChurch, "metal.bells.church" ) \ - MX_ENUM_VALUE( metalBellsCowbell, "metal.bells.cowbell" ) \ - MX_ENUM_VALUE( metalBellsDawuro, "metal.bells.dawuro" ) \ - MX_ENUM_VALUE( metalBellsGankokwe, "metal.bells.gankokwe" ) \ - MX_ENUM_VALUE( metalBellsGhungroo, "metal.bells.ghungroo" ) \ - MX_ENUM_VALUE( metalBellsHatheli, "metal.bells.hatheli" ) \ - MX_ENUM_VALUE( metalBellsJingleBell, "metal.bells.jingle-bell" ) \ - MX_ENUM_VALUE( metalBellsKhartal, "metal.bells.khartal" ) \ - MX_ENUM_VALUE( metalBellsMarkTree, "metal.bells.mark-tree" ) \ - MX_ENUM_VALUE( metalBellsSistrum, "metal.bells.sistrum" ) \ - MX_ENUM_VALUE( metalBellsSleighBells, "metal.bells.sleigh-bells" ) \ - MX_ENUM_VALUE( metalBellsTemple, "metal.bells.temple" ) \ - MX_ENUM_VALUE( metalBellsTibetan, "metal.bells.tibetan" ) \ - MX_ENUM_VALUE( metalBellsTinklebell, "metal.bells.tinklebell" ) \ - MX_ENUM_VALUE( metalBellsTrychel, "metal.bells.trychel" ) \ - MX_ENUM_VALUE( metalBellsWindChimes, "metal.bells.wind-chimes" ) \ - MX_ENUM_VALUE( metalBellsZills, "metal.bells.zills" ) \ - MX_ENUM_VALUE( metalBerimbau, "metal.berimbau" ) \ - MX_ENUM_VALUE( metalBrakeDrums, "metal.brake-drums" ) \ - MX_ENUM_VALUE( metalCrotales, "metal.crotales" ) \ - MX_ENUM_VALUE( metalCymbalBo, "metal.cymbal.bo" ) \ - MX_ENUM_VALUE( metalCymbalCengCeng, "metal.cymbal.ceng-ceng" ) \ - MX_ENUM_VALUE( metalCymbalChabara, "metal.cymbal.chabara" ) \ - MX_ENUM_VALUE( metalCymbalChinese, "metal.cymbal.chinese" ) \ - MX_ENUM_VALUE( metalCymbalChing, "metal.cymbal.ching" ) \ - MX_ENUM_VALUE( metalCymbalClash, "metal.cymbal.clash" ) \ - MX_ENUM_VALUE( metalCymbalCrash, "metal.cymbal.crash" ) \ - MX_ENUM_VALUE( metalCymbalFinger, "metal.cymbal.finger" ) \ - MX_ENUM_VALUE( metalCymbalHand, "metal.cymbal.hand" ) \ - MX_ENUM_VALUE( metalCymbalKesi, "metal.cymbal.kesi" ) \ - MX_ENUM_VALUE( metalCymbalManjeera, "metal.cymbal.manjeera" ) \ - MX_ENUM_VALUE( metalCymbalReverse, "metal.cymbal.reverse" ) \ - MX_ENUM_VALUE( metalCymbalRide, "metal.cymbal.ride" ) \ - MX_ENUM_VALUE( metalCymbalSizzle, "metal.cymbal.sizzle" ) \ - MX_ENUM_VALUE( metalCymbalSplash, "metal.cymbal.splash" ) \ - MX_ENUM_VALUE( metalCymbalSuspended, "metal.cymbal.suspended" ) \ - MX_ENUM_VALUE( metalCymbalTebyoshi, "metal.cymbal.tebyoshi" ) \ - MX_ENUM_VALUE( metalCymbalTibetan, "metal.cymbal.tibetan" ) \ - MX_ENUM_VALUE( metalCymbalTingsha, "metal.cymbal.tingsha" ) \ - MX_ENUM_VALUE( metalFlexatone, "metal.flexatone" ) \ - MX_ENUM_VALUE( metalGong, "metal.gong" ) \ - MX_ENUM_VALUE( metalGongAgeng, "metal.gong.ageng" ) \ - MX_ENUM_VALUE( metalGongAgung, "metal.gong.agung" ) \ - MX_ENUM_VALUE( metalGongChanchiki, "metal.gong.chanchiki" ) \ - MX_ENUM_VALUE( metalGongChinese, "metal.gong.chinese" ) \ - MX_ENUM_VALUE( metalGongGandingan, "metal.gong.gandingan" ) \ - MX_ENUM_VALUE( metalGongKempul, "metal.gong.kempul" ) \ - MX_ENUM_VALUE( metalGongKempyang, "metal.gong.kempyang" ) \ - MX_ENUM_VALUE( metalGongKetuk, "metal.gong.ketuk" ) \ - MX_ENUM_VALUE( metalGongKkwenggwari, "metal.gong.kkwenggwari" ) \ - MX_ENUM_VALUE( metalGongLuo, "metal.gong.luo" ) \ - MX_ENUM_VALUE( metalGongSinging, "metal.gong.singing" ) \ - MX_ENUM_VALUE( metalGongThai, "metal.gong.thai" ) \ - MX_ENUM_VALUE( metalGuira, "metal.guira" ) \ - MX_ENUM_VALUE( metalHang, "metal.hang" ) \ - MX_ENUM_VALUE( metalHiHat, "metal.hi-hat" ) \ - MX_ENUM_VALUE( metalJawHarp, "metal.jaw-harp" ) \ - MX_ENUM_VALUE( metalKengong, "metal.kengong" ) \ - MX_ENUM_VALUE( metalMurchang, "metal.murchang" ) \ - MX_ENUM_VALUE( metalMusicalSaw, "metal.musical-saw" ) \ - MX_ENUM_VALUE( metalSingingBowl, "metal.singing-bowl" ) \ - MX_ENUM_VALUE( metalSpoons, "metal.spoons" ) \ - MX_ENUM_VALUE( metalSteelDrums, "metal.steel-drums" ) \ - MX_ENUM_VALUE( metalTamtam, "metal.tamtam" ) \ - MX_ENUM_VALUE( metalThundersheet, "metal.thundersheet" ) \ - MX_ENUM_VALUE( metalTriangle, "metal.triangle" ) \ - MX_ENUM_VALUE( metalWashboard, "metal.washboard" ) \ - MX_ENUM_VALUE( pitchedPercussionAngklung, "pitched-percussion.angklung" ) \ - MX_ENUM_VALUE( pitchedPercussionBalafon, "pitched-percussion.balafon" ) \ - MX_ENUM_VALUE( pitchedPercussionBellLyre, "pitched-percussion.bell-lyre" ) \ - MX_ENUM_VALUE( pitchedPercussionBells, "pitched-percussion.bells" ) \ - MX_ENUM_VALUE( pitchedPercussionBianqing, "pitched-percussion.bianqing" ) \ - MX_ENUM_VALUE( pitchedPercussionBianzhong, "pitched-percussion.bianzhong" ) \ - MX_ENUM_VALUE( pitchedPercussionBonang, "pitched-percussion.bonang" ) \ - MX_ENUM_VALUE( pitchedPercussionCimbalom, "pitched-percussion.cimbalom" ) \ - MX_ENUM_VALUE( pitchedPercussionCrystalGlasses, "pitched-percussion.crystal-glasses" ) \ - MX_ENUM_VALUE( pitchedPercussionDanTamThapLuc, "pitched-percussion.dan-tam-thap-luc" ) \ - MX_ENUM_VALUE( pitchedPercussionFangxiang, "pitched-percussion.fangxiang" ) \ - MX_ENUM_VALUE( pitchedPercussionGandinganAKayo, "pitched-percussion.gandingan-a-kayo" ) \ - MX_ENUM_VALUE( pitchedPercussionGangsa, "pitched-percussion.gangsa" ) \ - MX_ENUM_VALUE( pitchedPercussionGender, "pitched-percussion.gender" ) \ - MX_ENUM_VALUE( pitchedPercussionGiying, "pitched-percussion.giying" ) \ - MX_ENUM_VALUE( pitchedPercussionGlassHarmonica, "pitched-percussion.glass-harmonica" ) \ - MX_ENUM_VALUE( pitchedPercussionGlockenspiel, "pitched-percussion.glockenspiel" ) \ - MX_ENUM_VALUE( pitchedPercussionGlockenspielAlto, "pitched-percussion.glockenspiel.alto" ) \ - MX_ENUM_VALUE( pitchedPercussionGlockenspielSoprano, "pitched-percussion.glockenspiel.soprano" ) \ - MX_ENUM_VALUE( pitchedPercussionGyil, "pitched-percussion.gyil" ) \ - MX_ENUM_VALUE( pitchedPercussionHammerDulcimer, "pitched-percussion.hammer-dulcimer" ) \ - MX_ENUM_VALUE( pitchedPercussionHandbells, "pitched-percussion.handbells" ) \ - MX_ENUM_VALUE( pitchedPercussionKalimba, "pitched-percussion.kalimba" ) \ - MX_ENUM_VALUE( pitchedPercussionKantil, "pitched-percussion.kantil" ) \ - MX_ENUM_VALUE( pitchedPercussionKhim, "pitched-percussion.khim" ) \ - MX_ENUM_VALUE( pitchedPercussionKulintang, "pitched-percussion.kulintang" ) \ - MX_ENUM_VALUE( pitchedPercussionKulintangAKayo, "pitched-percussion.kulintang-a-kayo" ) \ - MX_ENUM_VALUE( pitchedPercussionKulintangATiniok, "pitched-percussion.kulintang-a-tiniok" ) \ - MX_ENUM_VALUE( pitchedPercussionLikembe, "pitched-percussion.likembe" ) \ - MX_ENUM_VALUE( pitchedPercussionLuntang, "pitched-percussion.luntang" ) \ - MX_ENUM_VALUE( pitchedPercussionMarimba, "pitched-percussion.marimba" ) \ - MX_ENUM_VALUE( pitchedPercussionMarimbaBass, "pitched-percussion.marimba.bass" ) \ - MX_ENUM_VALUE( pitchedPercussionMbira, "pitched-percussion.mbira" ) \ - MX_ENUM_VALUE( pitchedPercussionMbiraArray, "pitched-percussion.mbira.array" ) \ - MX_ENUM_VALUE( pitchedPercussionMetallophone, "pitched-percussion.metallophone" ) \ - MX_ENUM_VALUE( pitchedPercussionMetallophoneAlto, "pitched-percussion.metallophone.alto" ) \ - MX_ENUM_VALUE( pitchedPercussionMetallophoneBass, "pitched-percussion.metallophone.bass" ) \ - MX_ENUM_VALUE( pitchedPercussionMetallophoneSoprano, "pitched-percussion.metallophone.soprano" ) \ - MX_ENUM_VALUE( pitchedPercussionMusicBox, "pitched-percussion.music-box" ) \ - MX_ENUM_VALUE( pitchedPercussionPelogPanerus, "pitched-percussion.pelog-panerus" ) \ - MX_ENUM_VALUE( pitchedPercussionPemade, "pitched-percussion.pemade" ) \ - MX_ENUM_VALUE( pitchedPercussionPenyacah, "pitched-percussion.penyacah" ) \ - MX_ENUM_VALUE( pitchedPercussionRanatEk, "pitched-percussion.ranat.ek" ) \ - MX_ENUM_VALUE( pitchedPercussionRanatEkLek, "pitched-percussion.ranat.ek-lek" ) \ - MX_ENUM_VALUE( pitchedPercussionRanatThum, "pitched-percussion.ranat.thum" ) \ - MX_ENUM_VALUE( pitchedPercussionRanatThumLek, "pitched-percussion.ranat.thum-lek" ) \ - MX_ENUM_VALUE( pitchedPercussionReyong, "pitched-percussion.reyong" ) \ - MX_ENUM_VALUE( pitchedPercussionSanza, "pitched-percussion.sanza" ) \ - MX_ENUM_VALUE( pitchedPercussionSaronBarung, "pitched-percussion.saron-barung" ) \ - MX_ENUM_VALUE( pitchedPercussionSaronDemong, "pitched-percussion.saron-demong" ) \ - MX_ENUM_VALUE( pitchedPercussionSaronPanerus, "pitched-percussion.saron-panerus" ) \ - MX_ENUM_VALUE( pitchedPercussionSlendroPanerus, "pitched-percussion.slendro-panerus" ) \ - MX_ENUM_VALUE( pitchedPercussionSlentem, "pitched-percussion.slentem" ) \ - MX_ENUM_VALUE( pitchedPercussionTsymbaly, "pitched-percussion.tsymbaly" ) \ - MX_ENUM_VALUE( pitchedPercussionTubes, "pitched-percussion.tubes" ) \ - MX_ENUM_VALUE( pitchedPercussionTubularBells, "pitched-percussion.tubular-bells" ) \ - MX_ENUM_VALUE( pitchedPercussionVibraphone, "pitched-percussion.vibraphone" ) \ - MX_ENUM_VALUE( pitchedPercussionXylophone, "pitched-percussion.xylophone" ) \ - MX_ENUM_VALUE( pitchedPercussionXylophoneAlto, "pitched-percussion.xylophone.alto" ) \ - MX_ENUM_VALUE( pitchedPercussionXylophoneBass, "pitched-percussion.xylophone.bass" ) \ - MX_ENUM_VALUE( pitchedPercussionXylophoneSoprano, "pitched-percussion.xylophone.soprano" ) \ - MX_ENUM_VALUE( pitchedPercussionXylorimba, "pitched-percussion.xylorimba" ) \ - MX_ENUM_VALUE( pitchedPercussionYangqin, "pitched-percussion.yangqin" ) \ - MX_ENUM_VALUE( pluckArchlute, "pluck.archlute" ) \ - MX_ENUM_VALUE( pluckAutoharp, "pluck.autoharp" ) \ - MX_ENUM_VALUE( pluckBaglama, "pluck.baglama" ) \ - MX_ENUM_VALUE( pluckBajo, "pluck.bajo" ) \ - MX_ENUM_VALUE( pluckBalalaika, "pluck.balalaika" ) \ - MX_ENUM_VALUE( pluckBalalaikaAlto, "pluck.balalaika.alto" ) \ - MX_ENUM_VALUE( pluckBalalaikaBass, "pluck.balalaika.bass" ) \ - MX_ENUM_VALUE( pluckBalalaikaContrabass, "pluck.balalaika.contrabass" ) \ - MX_ENUM_VALUE( pluckBalalaikaPiccolo, "pluck.balalaika.piccolo" ) \ - MX_ENUM_VALUE( pluckBalalaikaPrima, "pluck.balalaika.prima" ) \ - MX_ENUM_VALUE( pluckBalalaikaSecunda, "pluck.balalaika.secunda" ) \ - MX_ENUM_VALUE( pluckBandola, "pluck.bandola" ) \ - MX_ENUM_VALUE( pluckBandura, "pluck.bandura" ) \ - MX_ENUM_VALUE( pluckBandurria, "pluck.bandurria" ) \ - MX_ENUM_VALUE( pluckBanjo, "pluck.banjo" ) \ - MX_ENUM_VALUE( pluckBanjoTenor, "pluck.banjo.tenor" ) \ - MX_ENUM_VALUE( pluckBanjolele, "pluck.banjolele" ) \ - MX_ENUM_VALUE( pluckBarbat, "pluck.barbat" ) \ - MX_ENUM_VALUE( pluckBass, "pluck.bass" ) \ - MX_ENUM_VALUE( pluckBassAcoustic, "pluck.bass.acoustic" ) \ - MX_ENUM_VALUE( pluckBassBolon, "pluck.bass.bolon" ) \ - MX_ENUM_VALUE( pluckBassElectric, "pluck.bass.electric" ) \ - MX_ENUM_VALUE( pluckBassFretless, "pluck.bass.fretless" ) \ - MX_ENUM_VALUE( pluckBassGuitarron, "pluck.bass.guitarron" ) \ - MX_ENUM_VALUE( pluckBassSynth, "pluck.bass.synth" ) \ - MX_ENUM_VALUE( pluckBassSynthLead, "pluck.bass.synth.lead" ) \ - MX_ENUM_VALUE( pluckBassWashtub, "pluck.bass.washtub" ) \ - MX_ENUM_VALUE( pluckBassWhamola, "pluck.bass.whamola" ) \ - MX_ENUM_VALUE( pluckBegena, "pluck.begena" ) \ - MX_ENUM_VALUE( pluckBiwa, "pluck.biwa" ) \ - MX_ENUM_VALUE( pluckBordonua, "pluck.bordonua" ) \ - MX_ENUM_VALUE( pluckBouzouki, "pluck.bouzouki" ) \ - MX_ENUM_VALUE( pluckBouzoukiIrish, "pluck.bouzouki.irish" ) \ - MX_ENUM_VALUE( pluckCelticHarp, "pluck.celtic-harp" ) \ - MX_ENUM_VALUE( pluckCharango, "pluck.charango" ) \ - MX_ENUM_VALUE( pluckChitarraBattente, "pluck.chitarra-battente" ) \ - MX_ENUM_VALUE( pluckCithara, "pluck.cithara" ) \ - MX_ENUM_VALUE( pluckCittern, "pluck.cittern" ) \ - MX_ENUM_VALUE( pluckCuatro, "pluck.cuatro" ) \ - MX_ENUM_VALUE( pluckDanBau, "pluck.dan-bau" ) \ - MX_ENUM_VALUE( pluckDanNguyet, "pluck.dan-nguyet" ) \ - MX_ENUM_VALUE( pluckDanTranh, "pluck.dan-tranh" ) \ - MX_ENUM_VALUE( pluckDanTyBa, "pluck.dan-ty-ba" ) \ - MX_ENUM_VALUE( pluckDiddleyBow, "pluck.diddley-bow" ) \ - MX_ENUM_VALUE( pluckDomra, "pluck.domra" ) \ - MX_ENUM_VALUE( pluckDomu, "pluck.domu" ) \ - MX_ENUM_VALUE( pluckDulcimer, "pluck.dulcimer" ) \ - MX_ENUM_VALUE( pluckDutar, "pluck.dutar" ) \ - MX_ENUM_VALUE( pluckDuxianqin, "pluck.duxianqin" ) \ - MX_ENUM_VALUE( pluckEktara, "pluck.ektara" ) \ - MX_ENUM_VALUE( pluckGeomungo, "pluck.geomungo" ) \ - MX_ENUM_VALUE( pluckGottuvadhyam, "pluck.gottuvadhyam" ) \ - MX_ENUM_VALUE( pluckGuitar, "pluck.guitar" ) \ - MX_ENUM_VALUE( pluckGuitarAcoustic, "pluck.guitar.acoustic" ) \ - MX_ENUM_VALUE( pluckGuitarElectric, "pluck.guitar.electric" ) \ - MX_ENUM_VALUE( pluckGuitarNylonString, "pluck.guitar.nylon-string" ) \ - MX_ENUM_VALUE( pluckGuitarPedalSteel, "pluck.guitar.pedal-steel" ) \ - MX_ENUM_VALUE( pluckGuitarPortuguese, "pluck.guitar.portuguese" ) \ - MX_ENUM_VALUE( pluckGuitarRequinto, "pluck.guitar.requinto" ) \ - MX_ENUM_VALUE( pluckGuitarResonator, "pluck.guitar.resonator" ) \ - MX_ENUM_VALUE( pluckGuitarSteelString, "pluck.guitar.steel-string" ) \ - MX_ENUM_VALUE( pluckGuitjo, "pluck.guitjo" ) \ - MX_ENUM_VALUE( pluckGuitjoDoubleNeck, "pluck.guitjo.double-neck" ) \ - MX_ENUM_VALUE( pluckGuqin, "pluck.guqin" ) \ - MX_ENUM_VALUE( pluckGuzheng, "pluck.guzheng" ) \ - MX_ENUM_VALUE( pluckGuzhengChoazhou, "pluck.guzheng.choazhou" ) \ - MX_ENUM_VALUE( pluckHarp, "pluck.harp" ) \ - MX_ENUM_VALUE( pluckHarpGuitar, "pluck.harp-guitar" ) \ - MX_ENUM_VALUE( pluckHuapanguera, "pluck.huapanguera" ) \ - MX_ENUM_VALUE( pluckJaranaHuasteca, "pluck.jarana-huasteca" ) \ - MX_ENUM_VALUE( pluckJaranaJarocha, "pluck.jarana-jarocha" ) \ - MX_ENUM_VALUE( pluckJaranaJarochaMosquito, "pluck.jarana-jarocha.mosquito" ) \ - MX_ENUM_VALUE( pluckJaranaJarochaPrimera, "pluck.jarana-jarocha.primera" ) \ - MX_ENUM_VALUE( pluckJaranaJarochaSegunda, "pluck.jarana-jarocha.segunda" ) \ - MX_ENUM_VALUE( pluckJaranaJarochaTercera, "pluck.jarana-jarocha.tercera" ) \ - MX_ENUM_VALUE( pluckKabosy, "pluck.kabosy" ) \ - MX_ENUM_VALUE( pluckKantele, "pluck.kantele" ) \ - MX_ENUM_VALUE( pluckKanun, "pluck.kanun" ) \ - MX_ENUM_VALUE( pluckKayagum, "pluck.kayagum" ) \ - MX_ENUM_VALUE( pluckKobza, "pluck.kobza" ) \ - MX_ENUM_VALUE( pluckKomuz, "pluck.komuz" ) \ - MX_ENUM_VALUE( pluckKora, "pluck.kora" ) \ - MX_ENUM_VALUE( pluckKoto, "pluck.koto" ) \ - MX_ENUM_VALUE( pluckKutiyapi, "pluck.kutiyapi" ) \ - MX_ENUM_VALUE( pluckLangeleik, "pluck.langeleik" ) \ - MX_ENUM_VALUE( pluckLaud, "pluck.laud" ) \ - MX_ENUM_VALUE( pluckLute, "pluck.lute" ) \ - MX_ENUM_VALUE( pluckLyre, "pluck.lyre" ) \ - MX_ENUM_VALUE( pluckMandobass, "pluck.mandobass" ) \ - MX_ENUM_VALUE( pluckMandocello, "pluck.mandocello" ) \ - MX_ENUM_VALUE( pluckMandola, "pluck.mandola" ) \ - MX_ENUM_VALUE( pluckMandolin, "pluck.mandolin" ) \ - MX_ENUM_VALUE( pluckMandolinOctave, "pluck.mandolin.octave" ) \ - MX_ENUM_VALUE( pluckMandora, "pluck.mandora" ) \ - MX_ENUM_VALUE( pluckMandore, "pluck.mandore" ) \ - MX_ENUM_VALUE( pluckMarovany, "pluck.marovany" ) \ - MX_ENUM_VALUE( pluckMusicalBow, "pluck.musical-bow" ) \ - MX_ENUM_VALUE( pluckNgoni, "pluck.ngoni" ) \ - MX_ENUM_VALUE( pluckOud, "pluck.oud" ) \ - MX_ENUM_VALUE( pluckPipa, "pluck.pipa" ) \ - MX_ENUM_VALUE( pluckPsaltery, "pluck.psaltery" ) \ - MX_ENUM_VALUE( pluckRuan, "pluck.ruan" ) \ - MX_ENUM_VALUE( pluckSallaneh, "pluck.sallaneh" ) \ - MX_ENUM_VALUE( pluckSanshin, "pluck.sanshin" ) \ - MX_ENUM_VALUE( pluckSantoor, "pluck.santoor" ) \ - MX_ENUM_VALUE( pluckSanxian, "pluck.sanxian" ) \ - MX_ENUM_VALUE( pluckSarod, "pluck.sarod" ) \ - MX_ENUM_VALUE( pluckSaung, "pluck.saung" ) \ - MX_ENUM_VALUE( pluckSaz, "pluck.saz" ) \ - MX_ENUM_VALUE( pluckSe, "pluck.se" ) \ - MX_ENUM_VALUE( pluckSetar, "pluck.setar" ) \ - MX_ENUM_VALUE( pluckShamisen, "pluck.shamisen" ) \ - MX_ENUM_VALUE( pluckSitar, "pluck.sitar" ) \ - MX_ENUM_VALUE( pluckSynth, "pluck.synth" ) \ - MX_ENUM_VALUE( pluckSynthCharang, "pluck.synth.charang" ) \ - MX_ENUM_VALUE( pluckSynthChiff, "pluck.synth.chiff" ) \ - MX_ENUM_VALUE( pluckSynthStick, "pluck.synth.stick" ) \ - MX_ENUM_VALUE( pluckTambura, "pluck.tambura" ) \ - MX_ENUM_VALUE( pluckTamburaBulgarian, "pluck.tambura.bulgarian" ) \ - MX_ENUM_VALUE( pluckTamburaFemale, "pluck.tambura.female" ) \ - MX_ENUM_VALUE( pluckTamburaMale, "pluck.tambura.male" ) \ - MX_ENUM_VALUE( pluckTar, "pluck.tar" ) \ - MX_ENUM_VALUE( pluckTheorbo, "pluck.theorbo" ) \ - MX_ENUM_VALUE( pluckTimple, "pluck.timple" ) \ - MX_ENUM_VALUE( pluckTiple, "pluck.tiple" ) \ - MX_ENUM_VALUE( pluckTres, "pluck.tres" ) \ - MX_ENUM_VALUE( pluckUkulele, "pluck.ukulele" ) \ - MX_ENUM_VALUE( pluckUkuleleTenor, "pluck.ukulele.tenor" ) \ - MX_ENUM_VALUE( pluckValiha, "pluck.valiha" ) \ - MX_ENUM_VALUE( pluckVeena, "pluck.veena" ) \ - MX_ENUM_VALUE( pluckVeenaMohan, "pluck.veena.mohan" ) \ - MX_ENUM_VALUE( pluckVeenaRudra, "pluck.veena.rudra" ) \ - MX_ENUM_VALUE( pluckVeenaVichitra, "pluck.veena.vichitra" ) \ - MX_ENUM_VALUE( pluckVihuela, "pluck.vihuela" ) \ - MX_ENUM_VALUE( pluckVihuelaMexican, "pluck.vihuela.mexican" ) \ - MX_ENUM_VALUE( pluckXalam, "pluck.xalam" ) \ - MX_ENUM_VALUE( pluckYueqin, "pluck.yueqin" ) \ - MX_ENUM_VALUE( pluckZither, "pluck.zither" ) \ - MX_ENUM_VALUE( pluckZitherOvertone, "pluck.zither.overtone" ) \ - MX_ENUM_VALUE( rattleAfoxe, "rattle.afoxe" ) \ - MX_ENUM_VALUE( rattleBirds, "rattle.birds" ) \ - MX_ENUM_VALUE( rattleCabasa, "rattle.cabasa" ) \ - MX_ENUM_VALUE( rattleCaxixi, "rattle.caxixi" ) \ - MX_ENUM_VALUE( rattleCog, "rattle.cog" ) \ - MX_ENUM_VALUE( rattleGanza, "rattle.ganza" ) \ - MX_ENUM_VALUE( rattleHosho, "rattle.hosho" ) \ - MX_ENUM_VALUE( rattleJawbone, "rattle.jawbone" ) \ - MX_ENUM_VALUE( rattleKayamba, "rattle.kayamba" ) \ - MX_ENUM_VALUE( rattleKpokoKpoko, "rattle.kpoko-kpoko" ) \ - MX_ENUM_VALUE( rattleLavaStones, "rattle.lava-stones" ) \ - MX_ENUM_VALUE( rattleMaraca, "rattle.maraca" ) \ - MX_ENUM_VALUE( rattleRainStick, "rattle.rain-stick" ) \ - MX_ENUM_VALUE( rattleRatchet, "rattle.ratchet" ) \ - MX_ENUM_VALUE( rattleRattle, "rattle.rattle" ) \ - MX_ENUM_VALUE( rattleShaker, "rattle.shaker" ) \ - MX_ENUM_VALUE( rattleShakerEgg, "rattle.shaker.egg" ) \ - MX_ENUM_VALUE( rattleShekere, "rattle.shekere" ) \ - MX_ENUM_VALUE( rattleSistre, "rattle.sistre" ) \ - MX_ENUM_VALUE( rattleTelevi, "rattle.televi" ) \ - MX_ENUM_VALUE( rattleVibraslap, "rattle.vibraslap" ) \ - MX_ENUM_VALUE( rattleWasembe, "rattle.wasembe" ) \ - MX_ENUM_VALUE( stringsAjaeng, "strings.ajaeng" ) \ - MX_ENUM_VALUE( stringsArpeggione, "strings.arpeggione" ) \ - MX_ENUM_VALUE( stringsBaryton, "strings.baryton" ) \ - MX_ENUM_VALUE( stringsCello, "strings.cello" ) \ - MX_ENUM_VALUE( stringsCelloPiccolo, "strings.cello.piccolo" ) \ - MX_ENUM_VALUE( stringsContrabass, "strings.contrabass" ) \ - MX_ENUM_VALUE( stringsCrwth, "strings.crwth" ) \ - MX_ENUM_VALUE( stringsDanGao, "strings.dan-gao" ) \ - MX_ENUM_VALUE( stringsDihu, "strings.dihu" ) \ - MX_ENUM_VALUE( stringsErhu, "strings.erhu" ) \ - MX_ENUM_VALUE( stringsErxian, "strings.erxian" ) \ - MX_ENUM_VALUE( stringsEsraj, "strings.esraj" ) \ - MX_ENUM_VALUE( stringsFiddle, "strings.fiddle" ) \ - MX_ENUM_VALUE( stringsFiddleHardanger, "strings.fiddle.hardanger" ) \ - MX_ENUM_VALUE( stringsGadulka, "strings.gadulka" ) \ - MX_ENUM_VALUE( stringsGaohu, "strings.gaohu" ) \ - MX_ENUM_VALUE( stringsGehu, "strings.gehu" ) \ - MX_ENUM_VALUE( stringsGroup, "strings.group" ) \ - MX_ENUM_VALUE( stringsGroupSynth, "strings.group.synth" ) \ - MX_ENUM_VALUE( stringsHaegeum, "strings.haegeum" ) \ - MX_ENUM_VALUE( stringsHurdyGurdy, "strings.hurdy-gurdy" ) \ - MX_ENUM_VALUE( stringsIgil, "strings.igil" ) \ - MX_ENUM_VALUE( stringsKamancha, "strings.kamancha" ) \ - MX_ENUM_VALUE( stringsKokyu, "strings.kokyu" ) \ - MX_ENUM_VALUE( stringsLaruan, "strings.laruan" ) \ - MX_ENUM_VALUE( stringsLeiqin, "strings.leiqin" ) \ - MX_ENUM_VALUE( stringsLirone, "strings.lirone" ) \ - MX_ENUM_VALUE( stringsLyraByzantine, "strings.lyra.byzantine" ) \ - MX_ENUM_VALUE( stringsLyraCretan, "strings.lyra.cretan" ) \ - MX_ENUM_VALUE( stringsMorinKhuur, "strings.morin-khuur" ) \ - MX_ENUM_VALUE( stringsNyckelharpa, "strings.nyckelharpa" ) \ - MX_ENUM_VALUE( stringsOctobass, "strings.octobass" ) \ - MX_ENUM_VALUE( stringsRebab, "strings.rebab" ) \ - MX_ENUM_VALUE( stringsRebec, "strings.rebec" ) \ - MX_ENUM_VALUE( stringsSarangi, "strings.sarangi" ) \ - MX_ENUM_VALUE( stringsStrohViolin, "strings.stroh-violin" ) \ - MX_ENUM_VALUE( stringsTrombaMarina, "strings.tromba-marina" ) \ - MX_ENUM_VALUE( stringsVielle, "strings.vielle" ) \ - MX_ENUM_VALUE( stringsViol, "strings.viol" ) \ - MX_ENUM_VALUE( stringsViolAlto, "strings.viol.alto" ) \ - MX_ENUM_VALUE( stringsViolBass, "strings.viol.bass" ) \ - MX_ENUM_VALUE( stringsViolTenor, "strings.viol.tenor" ) \ - MX_ENUM_VALUE( stringsViolTreble, "strings.viol.treble" ) \ - MX_ENUM_VALUE( stringsViolViolone, "strings.viol.violone" ) \ - MX_ENUM_VALUE( stringsViola, "strings.viola" ) \ - MX_ENUM_VALUE( stringsViolaDamore, "strings.viola-damore" ) \ - MX_ENUM_VALUE( stringsViolin, "strings.violin" ) \ - MX_ENUM_VALUE( stringsViolonoPiccolo, "strings.violono.piccolo" ) \ - MX_ENUM_VALUE( stringsViolotta, "strings.violotta" ) \ - MX_ENUM_VALUE( stringsYayliTanbur, "strings.yayli-tanbur" ) \ - MX_ENUM_VALUE( stringsYazheng, "strings.yazheng" ) \ - MX_ENUM_VALUE( stringsZhonghu, "strings.zhonghu" ) \ - MX_ENUM_VALUE( synthEffects, "synth.effects" ) \ - MX_ENUM_VALUE( synthEffectsAtmosphere, "synth.effects.atmosphere" ) \ - MX_ENUM_VALUE( synthEffectsBrightness, "synth.effects.brightness" ) \ - MX_ENUM_VALUE( synthEffectsCrystal, "synth.effects.crystal" ) \ - MX_ENUM_VALUE( synthEffectsEchoes, "synth.effects.echoes" ) \ - MX_ENUM_VALUE( synthEffectsGoblins, "synth.effects.goblins" ) \ - MX_ENUM_VALUE( synthEffectsRain, "synth.effects.rain" ) \ - MX_ENUM_VALUE( synthEffectsSciFi, "synth.effects.sci-fi" ) \ - MX_ENUM_VALUE( synthEffectsSoundtrack, "synth.effects.soundtrack" ) \ - MX_ENUM_VALUE( synthGroup, "synth.group" ) \ - MX_ENUM_VALUE( synthGroupFifths, "synth.group.fifths" ) \ - MX_ENUM_VALUE( synthGroupOrchestra, "synth.group.orchestra" ) \ - MX_ENUM_VALUE( synthPad, "synth.pad" ) \ - MX_ENUM_VALUE( synthPadBowed, "synth.pad.bowed" ) \ - MX_ENUM_VALUE( synthPadChoir, "synth.pad.choir" ) \ - MX_ENUM_VALUE( synthPadHalo, "synth.pad.halo" ) \ - MX_ENUM_VALUE( synthPadMetallic, "synth.pad.metallic" ) \ - MX_ENUM_VALUE( synthPadPolysynth, "synth.pad.polysynth" ) \ - MX_ENUM_VALUE( synthPadSweep, "synth.pad.sweep" ) \ - MX_ENUM_VALUE( synthPadWarm, "synth.pad.warm" ) \ - MX_ENUM_VALUE( synthTheremin, "synth.theremin" ) \ - MX_ENUM_VALUE( synthToneSawtooth, "synth.tone.sawtooth" ) \ - MX_ENUM_VALUE( synthToneSine, "synth.tone.sine" ) \ - MX_ENUM_VALUE( synthToneSquare, "synth.tone.square" ) \ - MX_ENUM_VALUE( voiceAa, "voice.aa" ) \ - MX_ENUM_VALUE( voiceAlto, "voice.alto" ) \ - MX_ENUM_VALUE( voiceAw, "voice.aw" ) \ - MX_ENUM_VALUE( voiceBaritone, "voice.baritone" ) \ - MX_ENUM_VALUE( voiceBass, "voice.bass" ) \ - MX_ENUM_VALUE( voiceChild, "voice.child" ) \ - MX_ENUM_VALUE( voiceCountertenor, "voice.countertenor" ) \ - MX_ENUM_VALUE( voiceDoo, "voice.doo" ) \ - MX_ENUM_VALUE( voiceEe, "voice.ee" ) \ - MX_ENUM_VALUE( voiceFemale, "voice.female" ) \ - MX_ENUM_VALUE( voiceKazoo, "voice.kazoo" ) \ - MX_ENUM_VALUE( voiceMale, "voice.male" ) \ - MX_ENUM_VALUE( voiceMezzoSoprano, "voice.mezzo-soprano" ) \ - MX_ENUM_VALUE( voiceMm, "voice.mm" ) \ - MX_ENUM_VALUE( voiceOo, "voice.oo" ) \ - MX_ENUM_VALUE( voicePercussion, "voice.percussion" ) \ - MX_ENUM_VALUE( voicePercussionBeatbox, "voice.percussion.beatbox" ) \ - MX_ENUM_VALUE( voiceSoprano, "voice.soprano" ) \ - MX_ENUM_VALUE( voiceSynth, "voice.synth" ) \ - MX_ENUM_VALUE( voiceTalkBox, "voice.talk-box" ) \ - MX_ENUM_VALUE( voiceTenor, "voice.tenor" ) \ - MX_ENUM_VALUE( voiceVocals, "voice.vocals" ) \ - MX_ENUM_VALUE( windFlutesBansuri, "wind.flutes.bansuri" ) \ - MX_ENUM_VALUE( windFlutesBlownBottle, "wind.flutes.blown-bottle" ) \ - MX_ENUM_VALUE( windFlutesCalliope, "wind.flutes.calliope" ) \ - MX_ENUM_VALUE( windFlutesDanso, "wind.flutes.danso" ) \ - MX_ENUM_VALUE( windFlutesDiZi, "wind.flutes.di-zi" ) \ - MX_ENUM_VALUE( windFlutesDvojnice, "wind.flutes.dvojnice" ) \ - MX_ENUM_VALUE( windFlutesFife, "wind.flutes.fife" ) \ - MX_ENUM_VALUE( windFlutesFlageolet, "wind.flutes.flageolet" ) \ - MX_ENUM_VALUE( windFlutesFlute, "wind.flutes.flute" ) \ - MX_ENUM_VALUE( windFlutesFluteAlto, "wind.flutes.flute.alto" ) \ - MX_ENUM_VALUE( windFlutesFluteBass, "wind.flutes.flute.bass" ) \ - MX_ENUM_VALUE( windFlutesFluteContraAlto, "wind.flutes.flute.contra-alto" ) \ - MX_ENUM_VALUE( windFlutesFluteContrabass, "wind.flutes.flute.contrabass" ) \ - MX_ENUM_VALUE( windFlutesFluteDoubleContrabass, "wind.flutes.flute.double-contrabass" ) \ - MX_ENUM_VALUE( windFlutesFluteIrish, "wind.flutes.flute.irish" ) \ - MX_ENUM_VALUE( windFlutesFlutePiccolo, "wind.flutes.flute.piccolo" ) \ - MX_ENUM_VALUE( windFlutesFluteSubcontrabass, "wind.flutes.flute.subcontrabass" ) \ - MX_ENUM_VALUE( windFlutesFujara, "wind.flutes.fujara" ) \ - MX_ENUM_VALUE( windFlutesGemshorn, "wind.flutes.gemshorn" ) \ - MX_ENUM_VALUE( windFlutesHocchiku, "wind.flutes.hocchiku" ) \ - MX_ENUM_VALUE( windFlutesHun, "wind.flutes.hun" ) \ - MX_ENUM_VALUE( windFlutesKaval, "wind.flutes.kaval" ) \ - MX_ENUM_VALUE( windFlutesKawala, "wind.flutes.kawala" ) \ - MX_ENUM_VALUE( windFlutesKhlui, "wind.flutes.khlui" ) \ - MX_ENUM_VALUE( windFlutesKnotweed, "wind.flutes.knotweed" ) \ - MX_ENUM_VALUE( windFlutesKoncovkaAlto, "wind.flutes.koncovka.alto" ) \ - MX_ENUM_VALUE( windFlutesKoudi, "wind.flutes.koudi" ) \ - MX_ENUM_VALUE( windFlutesNey, "wind.flutes.ney" ) \ - MX_ENUM_VALUE( windFlutesNohkan, "wind.flutes.nohkan" ) \ - MX_ENUM_VALUE( windFlutesNose, "wind.flutes.nose" ) \ - MX_ENUM_VALUE( windFlutesOcarina, "wind.flutes.ocarina" ) \ - MX_ENUM_VALUE( windFlutesOvertoneTenor, "wind.flutes.overtone.tenor" ) \ - MX_ENUM_VALUE( windFlutesPalendag, "wind.flutes.palendag" ) \ - MX_ENUM_VALUE( windFlutesPanpipes, "wind.flutes.panpipes" ) \ - MX_ENUM_VALUE( windFlutesQuena, "wind.flutes.quena" ) \ - MX_ENUM_VALUE( windFlutesRecorder, "wind.flutes.recorder" ) \ - MX_ENUM_VALUE( windFlutesRecorderAlto, "wind.flutes.recorder.alto" ) \ - MX_ENUM_VALUE( windFlutesRecorderBass, "wind.flutes.recorder.bass" ) \ - MX_ENUM_VALUE( windFlutesRecorderContrabass, "wind.flutes.recorder.contrabass" ) \ - MX_ENUM_VALUE( windFlutesRecorderDescant, "wind.flutes.recorder.descant" ) \ - MX_ENUM_VALUE( windFlutesRecorderGarklein, "wind.flutes.recorder.garklein" ) \ - MX_ENUM_VALUE( windFlutesRecorderGreatBass, "wind.flutes.recorder.great-bass" ) \ - MX_ENUM_VALUE( windFlutesRecorderSopranino, "wind.flutes.recorder.sopranino" ) \ - MX_ENUM_VALUE( windFlutesRecorderSoprano, "wind.flutes.recorder.soprano" ) \ - MX_ENUM_VALUE( windFlutesRecorderTenor, "wind.flutes.recorder.tenor" ) \ - MX_ENUM_VALUE( windFlutesRyuteki, "wind.flutes.ryuteki" ) \ - MX_ENUM_VALUE( windFlutesShakuhachi, "wind.flutes.shakuhachi" ) \ - MX_ENUM_VALUE( windFlutesShepherdsPipe, "wind.flutes.shepherds-pipe" ) \ - MX_ENUM_VALUE( windFlutesShinobue, "wind.flutes.shinobue" ) \ - MX_ENUM_VALUE( windFlutesShvi, "wind.flutes.shvi" ) \ - MX_ENUM_VALUE( windFlutesSuling, "wind.flutes.suling" ) \ - MX_ENUM_VALUE( windFlutesTarka, "wind.flutes.tarka" ) \ - MX_ENUM_VALUE( windFlutesTumpong, "wind.flutes.tumpong" ) \ - MX_ENUM_VALUE( windFlutesVenu, "wind.flutes.venu" ) \ - MX_ENUM_VALUE( windFlutesWhistle, "wind.flutes.whistle" ) \ - MX_ENUM_VALUE( windFlutesWhistleAlto, "wind.flutes.whistle.alto" ) \ - MX_ENUM_VALUE( windFlutesWhistleLowIrish, "wind.flutes.whistle.low-irish" ) \ - MX_ENUM_VALUE( windFlutesWhistleShiva, "wind.flutes.whistle.shiva" ) \ - MX_ENUM_VALUE( windFlutesWhistleSlide, "wind.flutes.whistle.slide" ) \ - MX_ENUM_VALUE( windFlutesWhistleTin, "wind.flutes.whistle.tin" ) \ - MX_ENUM_VALUE( windFlutesWhistleTinBflat, "wind.flutes.whistle.tin.bflat" ) \ - MX_ENUM_VALUE( windFlutesWhistleTinD, "wind.flutes.whistle.tin.d" ) \ - MX_ENUM_VALUE( windFlutesXiao, "wind.flutes.xiao" ) \ - MX_ENUM_VALUE( windFlutesXun, "wind.flutes.xun" ) \ - MX_ENUM_VALUE( windGroup, "wind.group" ) \ - MX_ENUM_VALUE( windJug, "wind.jug" ) \ - MX_ENUM_VALUE( windPipesBagpipes, "wind.pipes.bagpipes" ) \ - MX_ENUM_VALUE( windPipesGaida, "wind.pipes.gaida" ) \ - MX_ENUM_VALUE( windPipesHighland, "wind.pipes.highland" ) \ - MX_ENUM_VALUE( windPipesUilleann, "wind.pipes.uilleann" ) \ - MX_ENUM_VALUE( windPungi, "wind.pungi" ) \ - MX_ENUM_VALUE( windReedAlbogue, "wind.reed.albogue" ) \ - MX_ENUM_VALUE( windReedAlboka, "wind.reed.alboka" ) \ - MX_ENUM_VALUE( windReedAlgaita, "wind.reed.algaita" ) \ - MX_ENUM_VALUE( windReedArghul, "wind.reed.arghul" ) \ - MX_ENUM_VALUE( windReedBassetHorn, "wind.reed.basset-horn" ) \ - MX_ENUM_VALUE( windReedBassoon, "wind.reed.bassoon" ) \ - MX_ENUM_VALUE( windReedBawu, "wind.reed.bawu" ) \ - MX_ENUM_VALUE( windReedBifora, "wind.reed.bifora" ) \ - MX_ENUM_VALUE( windReedBombarde, "wind.reed.bombarde" ) \ - MX_ENUM_VALUE( windReedChalumeau, "wind.reed.chalumeau" ) \ - MX_ENUM_VALUE( windReedClarinet, "wind.reed.clarinet" ) \ - MX_ENUM_VALUE( windReedClarinetA, "wind.reed.clarinet.a" ) \ - MX_ENUM_VALUE( windReedClarinetAlto, "wind.reed.clarinet.alto" ) \ - MX_ENUM_VALUE( windReedClarinetBass, "wind.reed.clarinet.bass" ) \ - MX_ENUM_VALUE( windReedClarinetBasset, "wind.reed.clarinet.basset" ) \ - MX_ENUM_VALUE( windReedClarinetBflat, "wind.reed.clarinet.bflat" ) \ - MX_ENUM_VALUE( windReedClarinetContraAlto, "wind.reed.clarinet.contra-alto" ) \ - MX_ENUM_VALUE( windReedClarinetContrabass, "wind.reed.clarinet.contrabass" ) \ - MX_ENUM_VALUE( windReedClarinetEflat, "wind.reed.clarinet.eflat" ) \ - MX_ENUM_VALUE( windReedClarinetPiccoloAflat, "wind.reed.clarinet.piccolo.aflat" ) \ - MX_ENUM_VALUE( windReedClarinetteDamour, "wind.reed.clarinette-damour" ) \ - MX_ENUM_VALUE( windReedContrabass, "wind.reed.contrabass" ) \ - MX_ENUM_VALUE( windReedContrabassoon, "wind.reed.contrabassoon" ) \ - MX_ENUM_VALUE( windReedCornamuse, "wind.reed.cornamuse" ) \ - MX_ENUM_VALUE( windReedCromorne, "wind.reed.cromorne" ) \ - MX_ENUM_VALUE( windReedCrumhorn, "wind.reed.crumhorn" ) \ - MX_ENUM_VALUE( windReedCrumhornAlto, "wind.reed.crumhorn.alto" ) \ - MX_ENUM_VALUE( windReedCrumhornBass, "wind.reed.crumhorn.bass" ) \ - MX_ENUM_VALUE( windReedCrumhornGreatBass, "wind.reed.crumhorn.great-bass" ) \ - MX_ENUM_VALUE( windReedCrumhornSoprano, "wind.reed.crumhorn.soprano" ) \ - MX_ENUM_VALUE( windReedCrumhornTenor, "wind.reed.crumhorn.tenor" ) \ - MX_ENUM_VALUE( windReedDiple, "wind.reed.diple" ) \ - MX_ENUM_VALUE( windReedDiplica, "wind.reed.diplica" ) \ - MX_ENUM_VALUE( windReedDuduk, "wind.reed.duduk" ) \ - MX_ENUM_VALUE( windReedDulcian, "wind.reed.dulcian" ) \ - MX_ENUM_VALUE( windReedDulzaina, "wind.reed.dulzaina" ) \ - MX_ENUM_VALUE( windReedEnglishHorn, "wind.reed.english-horn" ) \ - MX_ENUM_VALUE( windReedGuanzi, "wind.reed.guanzi" ) \ - MX_ENUM_VALUE( windReedHarmonica, "wind.reed.harmonica" ) \ - MX_ENUM_VALUE( windReedHarmonicaBass, "wind.reed.harmonica.bass" ) \ - MX_ENUM_VALUE( windReedHeckelClarina, "wind.reed.heckel-clarina" ) \ - MX_ENUM_VALUE( windReedHeckelphone, "wind.reed.heckelphone" ) \ - MX_ENUM_VALUE( windReedHeckelphonePiccolo, "wind.reed.heckelphone.piccolo" ) \ - MX_ENUM_VALUE( windReedHeckelphoneClarinet, "wind.reed.heckelphone-clarinet" ) \ - MX_ENUM_VALUE( windReedHichiriki, "wind.reed.hichiriki" ) \ - MX_ENUM_VALUE( windReedHirtenschalmei, "wind.reed.hirtenschalmei" ) \ - MX_ENUM_VALUE( windReedHne, "wind.reed.hne" ) \ - MX_ENUM_VALUE( windReedHornpipe, "wind.reed.hornpipe" ) \ - MX_ENUM_VALUE( windReedHouguan, "wind.reed.houguan" ) \ - MX_ENUM_VALUE( windReedHulusi, "wind.reed.hulusi" ) \ - MX_ENUM_VALUE( windReedJogiBaja, "wind.reed.jogi-baja" ) \ - MX_ENUM_VALUE( windReedKenBau, "wind.reed.ken-bau" ) \ - MX_ENUM_VALUE( windReedKhaenMouthOrgan, "wind.reed.khaen-mouth-organ" ) \ - MX_ENUM_VALUE( windReedLauneddas, "wind.reed.launeddas" ) \ - MX_ENUM_VALUE( windReedMaqrunah, "wind.reed.maqrunah" ) \ - MX_ENUM_VALUE( windReedMelodica, "wind.reed.melodica" ) \ - MX_ENUM_VALUE( windReedMijwiz, "wind.reed.mijwiz" ) \ - MX_ENUM_VALUE( windReedMizmar, "wind.reed.mizmar" ) \ - MX_ENUM_VALUE( windReedNadaswaram, "wind.reed.nadaswaram" ) \ - MX_ENUM_VALUE( windReedOboe, "wind.reed.oboe" ) \ - MX_ENUM_VALUE( windReedOboeBass, "wind.reed.oboe.bass" ) \ - MX_ENUM_VALUE( windReedOboePiccolo, "wind.reed.oboe.piccolo" ) \ - MX_ENUM_VALUE( windReedOboeDaCaccia, "wind.reed.oboe-da-caccia" ) \ - MX_ENUM_VALUE( windReedOboeDamore, "wind.reed.oboe-damore" ) \ - MX_ENUM_VALUE( windReedOctavin, "wind.reed.octavin" ) \ - MX_ENUM_VALUE( windReedPi, "wind.reed.pi" ) \ - MX_ENUM_VALUE( windReedPibgorn, "wind.reed.pibgorn" ) \ - MX_ENUM_VALUE( windReedPiri, "wind.reed.piri" ) \ - MX_ENUM_VALUE( windReedRackett, "wind.reed.rackett" ) \ - MX_ENUM_VALUE( windReedRauschpfeife, "wind.reed.rauschpfeife" ) \ - MX_ENUM_VALUE( windReedRhaita, "wind.reed.rhaita" ) \ - MX_ENUM_VALUE( windReedRothphone, "wind.reed.rothphone" ) \ - MX_ENUM_VALUE( windReedSarrusaphone, "wind.reed.sarrusaphone" ) \ - MX_ENUM_VALUE( windReedSaxonette, "wind.reed.saxonette" ) \ - MX_ENUM_VALUE( windReedSaxophone, "wind.reed.saxophone" ) \ - MX_ENUM_VALUE( windReedSaxophoneAlto, "wind.reed.saxophone.alto" ) \ - MX_ENUM_VALUE( windReedSaxophoneAulochrome, "wind.reed.saxophone.aulochrome" ) \ - MX_ENUM_VALUE( windReedSaxophoneBaritone, "wind.reed.saxophone.baritone" ) \ - MX_ENUM_VALUE( windReedSaxophoneBass, "wind.reed.saxophone.bass" ) \ - MX_ENUM_VALUE( windReedSaxophoneContrabass, "wind.reed.saxophone.contrabass" ) \ - MX_ENUM_VALUE( windReedSaxophoneMelody, "wind.reed.saxophone.melody" ) \ - MX_ENUM_VALUE( windReedSaxophoneMezzoSoprano, "wind.reed.saxophone.mezzo-soprano" ) \ - MX_ENUM_VALUE( windReedSaxophoneSopranino, "wind.reed.saxophone.sopranino" ) \ - MX_ENUM_VALUE( windReedSaxophoneSopranissimo, "wind.reed.saxophone.sopranissimo" ) \ - MX_ENUM_VALUE( windReedSaxophoneSoprano, "wind.reed.saxophone.soprano" ) \ - MX_ENUM_VALUE( windReedSaxophoneSubcontrabass, "wind.reed.saxophone.subcontrabass" ) \ - MX_ENUM_VALUE( windReedSaxophoneTenor, "wind.reed.saxophone.tenor" ) \ - MX_ENUM_VALUE( windReedShawm, "wind.reed.shawm" ) \ - MX_ENUM_VALUE( windReedShenai, "wind.reed.shenai" ) \ - MX_ENUM_VALUE( windReedSheng, "wind.reed.sheng" ) \ - MX_ENUM_VALUE( windReedSipsi, "wind.reed.sipsi" ) \ - MX_ENUM_VALUE( windReedSopila, "wind.reed.sopila" ) \ - MX_ENUM_VALUE( windReedSorna, "wind.reed.sorna" ) \ - MX_ENUM_VALUE( windReedSralai, "wind.reed.sralai" ) \ - MX_ENUM_VALUE( windReedSuona, "wind.reed.suona" ) \ - MX_ENUM_VALUE( windReedSurnai, "wind.reed.surnai" ) \ - MX_ENUM_VALUE( windReedTaepyeongso, "wind.reed.taepyeongso" ) \ - MX_ENUM_VALUE( windReedTarogato, "wind.reed.tarogato" ) \ - MX_ENUM_VALUE( windReedTarogatoAncient, "wind.reed.tarogato.ancient" ) \ - MX_ENUM_VALUE( windReedTrompetaChina, "wind.reed.trompeta-china" ) \ - MX_ENUM_VALUE( windReedTubax, "wind.reed.tubax" ) \ - MX_ENUM_VALUE( windReedXaphoon, "wind.reed.xaphoon" ) \ - MX_ENUM_VALUE( windReedZhaleika, "wind.reed.zhaleika" ) \ - MX_ENUM_VALUE( windReedZurla, "wind.reed.zurla" ) \ - MX_ENUM_VALUE( windReedZurna, "wind.reed.zurna" ) \ - MX_ENUM_VALUE( woodAgogoBlock, "wood.agogo-block" ) \ - MX_ENUM_VALUE( woodAgungATamlang, "wood.agung-a-tamlang" ) \ - MX_ENUM_VALUE( woodAhoko, "wood.ahoko" ) \ - MX_ENUM_VALUE( woodBones, "wood.bones" ) \ - MX_ENUM_VALUE( woodCastanets, "wood.castanets" ) \ - MX_ENUM_VALUE( woodClaves, "wood.claves" ) \ - MX_ENUM_VALUE( woodDrumSticks, "wood.drum-sticks" ) \ - MX_ENUM_VALUE( woodGourd, "wood.gourd" ) \ - MX_ENUM_VALUE( woodGraniteBlock, "wood.granite-block" ) \ - MX_ENUM_VALUE( woodGuban, "wood.guban" ) \ - MX_ENUM_VALUE( woodGuiro, "wood.guiro" ) \ - MX_ENUM_VALUE( woodHyoushigi, "wood.hyoushigi" ) \ - MX_ENUM_VALUE( woodIpu, "wood.ipu" ) \ - MX_ENUM_VALUE( woodJamBlock, "wood.jam-block" ) \ - MX_ENUM_VALUE( woodKaekeeke, "wood.kaekeeke" ) \ - MX_ENUM_VALUE( woodKagul, "wood.kagul" ) \ - MX_ENUM_VALUE( woodKalaau, "wood.kalaau" ) \ - MX_ENUM_VALUE( woodKashiklar, "wood.kashiklar" ) \ - MX_ENUM_VALUE( woodKubing, "wood.kubing" ) \ - MX_ENUM_VALUE( woodPanClappers, "wood.pan-clappers" ) \ - MX_ENUM_VALUE( woodSandBlock, "wood.sand-block" ) \ - MX_ENUM_VALUE( woodSlapstick, "wood.slapstick" ) \ - MX_ENUM_VALUE( woodStirDrum, "wood.stir-drum" ) \ - MX_ENUM_VALUE( woodTempleBlock, "wood.temple-block" ) \ - MX_ENUM_VALUE( woodTicTocBlock, "wood.tic-toc-block" ) \ - MX_ENUM_VALUE( woodTonetang, "wood.tonetang" ) \ - MX_ENUM_VALUE( woodWoodBlock, "wood.wood-block" ) \ - - #include "mx/utility/EnumWithString.h" - #undef MX_ENUM_CLASS_NAME - #undef MX_ENUM_VALUE - #undef MX_ENUM_MEMBERS - } -} diff --git a/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.cpp b/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.cpp deleted file mode 100644 index 1f7290287..000000000 --- a/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -// self -#include "mx/core/PositiveIntegerOrEmpty.h" - -// std -#include - -namespace mx -{ - namespace core - { - class PositiveIntegerOrEmpty::impl - { - public: - explicit impl() - :myPositiveInteger( 1 ) - ,myIsEmpty( true ) - {} - - explicit impl( const PositiveInteger& value ) - :myPositiveInteger( value ) - ,myIsEmpty( false ) - {} - - explicit impl( const std::string& value ) - :myPositiveInteger( 1 ) - ,myIsEmpty( false ) - { - parse( value ); - } - - bool getIsEmpty() const - { - return myIsEmpty; - } - bool getIsNumber() const - { - return ! myIsEmpty; - } - void setValueEmpty() - { - myPositiveInteger = PositiveInteger( 1 ); - myIsEmpty = true;; - } - void setValue( const PositiveInteger& value ) - { - myPositiveInteger = PositiveInteger( value ); - myIsEmpty = false; - } - PositiveInteger getValueNumber() const - { - return myPositiveInteger; - } - void parse( const std::string& value ) - { - if ( value == "" ) - { - myPositiveInteger = PositiveInteger( 1 ); - myIsEmpty = true; - } - else - { - /* if it contains only numeric - characters it must be a number */ - myPositiveInteger.parse( value ); - myIsEmpty = false; - } - } - private: - PositiveInteger myPositiveInteger; - bool myIsEmpty; - }; - - - PositiveIntegerOrEmpty::PositiveIntegerOrEmpty() - :myImpl( new impl() ) - {} - - PositiveIntegerOrEmpty::PositiveIntegerOrEmpty( const PositiveInteger& value ) - :myImpl( new impl( value ) ) - {} - - PositiveIntegerOrEmpty::PositiveIntegerOrEmpty( const std::string& value ) - :myImpl( new impl( value ) ) - {} - - PositiveIntegerOrEmpty::~PositiveIntegerOrEmpty() {} - - PositiveIntegerOrEmpty::PositiveIntegerOrEmpty( const PositiveIntegerOrEmpty& other ) - :myImpl( new PositiveIntegerOrEmpty::impl( *other.myImpl ) ) - {} - - PositiveIntegerOrEmpty::PositiveIntegerOrEmpty( PositiveIntegerOrEmpty&& other ) - :myImpl( std::move( other.myImpl ) ) - {} - - PositiveIntegerOrEmpty& PositiveIntegerOrEmpty::operator=( PositiveIntegerOrEmpty&& other ) - { - myImpl = std::move( other.myImpl ); - return *this; - } - - PositiveIntegerOrEmpty& PositiveIntegerOrEmpty::operator=( const PositiveIntegerOrEmpty& other ) - { - this->myImpl = std::unique_ptr( new PositiveIntegerOrEmpty::impl( *other.myImpl ) ); - return *this; - } - - bool PositiveIntegerOrEmpty::getIsEmpty() const - { - return myImpl->getIsEmpty(); - } - bool PositiveIntegerOrEmpty::getIsNumber() const - { - return myImpl->getIsNumber(); - } - void PositiveIntegerOrEmpty::setValueEmpty() - { - myImpl->setValueEmpty(); - } - void PositiveIntegerOrEmpty::setValue( const PositiveInteger& value ) - { - myImpl->setValue( value ); - } - PositiveInteger PositiveIntegerOrEmpty::getValueNumber() const - { - return myImpl->getValueNumber(); - } - - void PositiveIntegerOrEmpty::parse( const std::string& value ) - { - myImpl->parse( value ); - } - - std::string toString( const PositiveIntegerOrEmpty& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - std::ostream& toStream( std::ostream& os, const PositiveIntegerOrEmpty& value ) - { - if ( value.getIsNumber() ) - { - toStream( os, value.getValueNumber() ); - } - else - { - ; // os << ""; - } - return os; - } - - std::ostream& operator<<( std::ostream& os, const PositiveIntegerOrEmpty& value ) - { - return toStream( os, value ); - } - } -} diff --git a/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.h b/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.h deleted file mode 100644 index 8f24d78f5..000000000 --- a/Sourcecode/private/mx/core/PositiveIntegerOrEmpty.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - /// The positive-integer-or-empty values can be either a positive integer or an empty - /// string. - class PositiveIntegerOrEmpty - { - public: - explicit PositiveIntegerOrEmpty(); - explicit PositiveIntegerOrEmpty( const PositiveInteger& value ); - explicit PositiveIntegerOrEmpty( const std::string& value ); - virtual ~PositiveIntegerOrEmpty(); - PositiveIntegerOrEmpty( const PositiveIntegerOrEmpty& other ); - PositiveIntegerOrEmpty( PositiveIntegerOrEmpty&& other ); - PositiveIntegerOrEmpty& operator=( const PositiveIntegerOrEmpty& other ); - PositiveIntegerOrEmpty& operator=( PositiveIntegerOrEmpty&& other ); - - bool getIsEmpty() const; - bool getIsNumber() const; - void setValueEmpty(); - void setValue( const PositiveInteger& value ); - PositiveInteger getValueNumber() const; - void parse( const std::string& value ); - - private: - class impl; - std::unique_ptr myImpl; - }; - - std::string toString( const PositiveIntegerOrEmpty& value ); - std::ostream& toStream( std::ostream& os, const PositiveIntegerOrEmpty& value ); - std::ostream& operator<<( std::ostream& os, const PositiveIntegerOrEmpty& value ); - } -} diff --git a/Sourcecode/private/mx/core/ProcessingInstruction.cpp b/Sourcecode/private/mx/core/ProcessingInstruction.cpp deleted file mode 100644 index 6ff144dda..000000000 --- a/Sourcecode/private/mx/core/ProcessingInstruction.cpp +++ /dev/null @@ -1,102 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/ProcessingInstruction.h" -#include "mx/utility/Throw.h" - -#include - -namespace mx -{ - namespace core - { - -//////////////////////////////////////////////////////////////////////////////// -// CTOR AND COPY /////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - - ProcessingInstruction::ProcessingInstruction() - : myName{ "default-name" } - , myData{} - , mIsChild{true} - { - - } - - - ProcessingInstruction::ProcessingInstruction( StringType inName, StringType inData ) - : ProcessingInstruction{} - { - this->setName( std::move( inName ) ); - this->setData( std::move( inData ) ); - } - -//////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS //////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - - const StringType& ProcessingInstruction::getName() const - { - return myName; - } - - - void ProcessingInstruction::setName( StringType inName ) - { - if( !inName.empty() ) - { - myName = std::move( inName ); - } - } - - - const StringType& ProcessingInstruction::getData() const - { - return myData; - } - - - void ProcessingInstruction::setData( StringType inData ) - { - myData = std::move( inData ); - } - - - std::ostream& ProcessingInstruction::toStream( std::ostream& os ) const - { - os << ""; - return os; - } - - - StringType ProcessingInstruction::toString() const - { - std::stringstream ss; - this->toStream( ss ); - return ss.str(); - } - - - bool ProcessingInstruction::getIsChild() const - { - return mIsChild; - } - - - void ProcessingInstruction::setIsChild( bool inValue ) - { - mIsChild = inValue; - } - -//////////////////////////////////////////////////////////////////////////////// -// PRIVATE FUNCTIONS /////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - - - } -} diff --git a/Sourcecode/private/mx/core/ProcessingInstruction.h b/Sourcecode/private/mx/core/ProcessingInstruction.h deleted file mode 100644 index e24ec9ac6..000000000 --- a/Sourcecode/private/mx/core/ProcessingInstruction.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - /// @brief An XML Processing Instruction - /// - /// @detailed Will be written/read to/from the XML - /// document as Processing Instructions - /// - class ProcessingInstruction - { - public: - ProcessingInstruction(); - ProcessingInstruction( StringType inName, StringType inData ); - - public: - const StringType& getName() const; - void setName( StringType inName ); - const StringType& getData() const; - void setData( StringType inData ); - std::ostream& toStream( std::ostream& os ) const; - StringType toString() const; - - /// place the instruction as the first child if possible. this may - /// not be possible if the element has no other child elements. - bool getIsChild() const; - - /// place the instruction as the first child if possible. this may - /// not be possible if the element has no other child elements. - void setIsChild( bool inValue ); - - private: - StringType myName; - StringType myData; - bool mIsChild; - }; - - using ProcessingInstructions = std::vector; - } -} diff --git a/Sourcecode/private/mx/core/ScoreConversions.cpp b/Sourcecode/private/mx/core/ScoreConversions.cpp deleted file mode 100644 index 9ffa559d5..000000000 --- a/Sourcecode/private/mx/core/ScoreConversions.cpp +++ /dev/null @@ -1,170 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/ScoreConversions.h" -#include "mx/core/elements/TimewiseMeasure.h" -#include "mx/core/elements/PartwiseMeasure.h" -#include "mx/core/elements/PartwisePart.h" -#include "mx/core/elements/TimewisePart.h" -#include "mx/core/elements/ScorePart.h" -#include "mx/core/elements/PartList.h" -#include "mx/core/elements/PartGroup.h" -#include "mx/core/elements/PartGroupOrScorePart.h" - -#include - -namespace mx -{ - namespace core - { - ScoreTimewisePtr partwiseTimewise( const ScorePartwisePtr& inScore ) - { - auto score_new = makeScoreTimewise(); - score_new->setScoreHeaderGroup( inScore->getScoreHeaderGroup() ); - auto attr_old = inScore->getAttributes(); - auto attr_new = score_new->getAttributes(); - attr_new->hasVersion = attr_old->hasVersion; - attr_new->version = attr_old->version; - TimewiseMeasureSet twMeasures; - using Intz = PartwiseMeasureSet::size_type; - - /* find max number of measures */ - Intz measureCount = 0; - for ( auto p : inScore->getPartwisePartSet() ) - { - if ( p->getPartwiseMeasureSet().size() > measureCount ) - { - measureCount = p->getPartwiseMeasureSet().size(); - } - } - - /* Outer Loop, Once for each Measure */ - for ( Intz currentMeasureIndex = 0; - currentMeasureIndex < measureCount; - ++currentMeasureIndex ) - { - TimewiseMeasurePtr newMeasure; - if ( currentMeasureIndex == 0 ) - { - newMeasure = *( score_new->getTimewiseMeasureSet().cbegin() ); - } - else - { - newMeasure = makeTimewiseMeasure(); - score_new->addTimewiseMeasure( newMeasure ); - } - - /* Create a simple list of parts from the score header */ - std::vector partlist; - partlist.push_back( inScore->getScoreHeaderGroup()->getPartList()->getScorePart() ); - for ( auto pgosp : inScore->getScoreHeaderGroup()->getPartList()->getPartGroupOrScorePartSet() ) - { - if ( pgosp->getChoice() == PartGroupOrScorePart::Choice::scorePart ) - { - partlist.push_back( pgosp->getScorePart() ); - } - } - - /* First Nested Loop, for each Part */ - bool isFirst = true; - for ( auto sp : partlist ) - { - /* Find the Correct Part */ - auto partIter = std::find_if( inScore->getPartwisePartSet().cbegin(), - inScore->getPartwisePartSet().cend(), - [&]( const PartwisePartPtr& searchingForThis ) - { - return searchingForThis->getAttributes()->id.getValue() == sp->getAttributes()->id.getValue(); - }); - if ( partIter != inScore->getPartwisePartSet().cend() ) - { - auto measureIter = (*partIter)->getPartwiseMeasureSet().cbegin(); - /* Find the Correct Measure Within The Part */ - for( Intz x = 0; - x < currentMeasureIndex; - ++measureIter, ++x ) {} - - /* Create and add the Part Music to the outer loop's Measure */ - TimewisePartPtr newPart; - if ( isFirst ) - { - newPart = *( newMeasure->getTimewisePartSet().cbegin() ); - isFirst = false; - } - else - { - newPart = makeTimewisePart(); - newMeasure->addTimewisePart( newPart ); - } - newPart->getAttributes()->id = (*partIter)->getAttributes()->id; - newPart->setMusicDataGroup( (*measureIter)->getMusicDataGroup() ); - newMeasure->setAttributes( (*measureIter)->getAttributes() ); - } - } - } - return score_new; - } - - - ScorePartwisePtr timewisePartwise( const ScoreTimewisePtr& inScore ) - { - auto score_new = makeScorePartwise(); - score_new->setScoreHeaderGroup( inScore->getScoreHeaderGroup() ); - auto attr_old = inScore->getAttributes(); - auto attr_new = score_new->getAttributes(); - attr_new->hasVersion = attr_old->hasVersion; - attr_new->version = attr_old->version; - PartwisePartSet pwParts; - - /* Create and add a ScorePartwisePart for each part in the main list */ - auto firstPart = makePartwisePart(); - firstPart->getAttributes()->id = inScore->getScoreHeaderGroup()->getPartList()->getScorePart()->getAttributes()->id; - score_new->addPartwisePart( firstPart ); - score_new->removePartwisePart( score_new->getPartwisePartSet().cbegin() ); - for ( auto pgosp : inScore->getScoreHeaderGroup()->getPartList()->getPartGroupOrScorePartSet() ) - { - if ( pgosp->getChoice() == PartGroupOrScorePart::Choice::scorePart ) - { - auto additionalPart = makePartwisePart(); - additionalPart->getAttributes()->id = pgosp->getScorePart()->getAttributes()->id; - score_new->addPartwisePart( additionalPart ); - } - } - /* outter loop: for each scorepart in score_new */ - for ( auto p : score_new->getPartwisePartSet() ) - { - /* inner loop: for each measure in inScore */ - bool isFirst = true; - for ( auto m : inScore->getTimewiseMeasureSet() ) - { - PartwiseMeasurePtr newMeasure; - if ( isFirst ) - { - newMeasure = *( p->getPartwiseMeasureSet().cbegin() ); - isFirst = false; - } - else - { - newMeasure = makePartwiseMeasure(); - p->addPartwiseMeasure( newMeasure ); - } - newMeasure->setAttributes( m->getAttributes() ); - - /* find the correct music data */ - auto partIter = std::find_if( m->getTimewisePartSet().cbegin(), - m->getTimewisePartSet().cend(), - [&]( const TimewisePartPtr& searchingForThis ) - { - return searchingForThis->getAttributes()->id.getValue() == p->getAttributes()->id.getValue(); - }); - if ( partIter != m->getTimewisePartSet().cend() ) - { - newMeasure->setMusicDataGroup( (*partIter)->getMusicDataGroup() ); - } - } - } - return score_new; - } - } -} diff --git a/Sourcecode/private/mx/core/ScoreConversions.h b/Sourcecode/private/mx/core/ScoreConversions.h deleted file mode 100644 index 26ef3df75..000000000 --- a/Sourcecode/private/mx/core/ScoreConversions.h +++ /dev/null @@ -1,25 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include "mx/core/elements/ScorePartwise.h" -#include "mx/core/elements/ScoreTimewise.h" -#include "mx/core/elements/ScoreHeaderGroup.h" -#include - -namespace mx -{ - namespace core - { - // Converts a 'score-timewise' to 'score-partwise' - // caution - uses shallow copies, does not clone - ScorePartwisePtr timewisePartwise( const ScoreTimewisePtr& inScore ); - - // Converts a 'score-timewise' to 'score-partwise' - // caution - uses shallow copies, does not clone - ScoreTimewisePtr partwiseTimewise( const ScorePartwisePtr& inScore ); - } -} diff --git a/Sourcecode/private/mx/core/StringUtils.h b/Sourcecode/private/mx/core/StringUtils.h deleted file mode 100644 index 239dfab7b..000000000 --- a/Sourcecode/private/mx/core/StringUtils.h +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/XsString.h" -#include -#include -#include -#include - -namespace mx::core -{ - static constexpr const char* const kWhitespace = " \t\n\v\f\r"; - static constexpr const char* const kNCNameAllowed = "-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"; - - - inline StringType trim(const StringType& str, const StringType& whitespace = kWhitespace ) - { - const auto strBegin = str.find_first_not_of(whitespace); - if (strBegin == StringType::npos) - return ""; // no content - - const auto strEnd = str.find_last_not_of(whitespace); - const auto strRange = strEnd - strBegin + 1; - - return str.substr(strBegin, strRange); - } - - - inline StringType reduce( - const StringType& str, - const StringType& fill = " ", - const StringType& whitespace = kWhitespace) - { - // trim first - auto result = trim(str, whitespace); - - // replace sub ranges - auto beginSpace = result.find_first_of(whitespace); - while (beginSpace != mx::core::StringType::npos) - { - const auto endSpace = result.find_first_not_of(whitespace, beginSpace); - const auto range = endSpace - beginSpace; - - result.replace(beginSpace, range, fill); - - const auto newStart = beginSpace + fill.length(); - beginSpace = result.find_first_of(whitespace, newStart); - } - - return result; - } - - - inline StringType onlyAllow( - const StringType& input, - const StringType& fill = "_", - const StringType& onlyAllow = kNCNameAllowed) - { - std::string str = input; - auto firstBadChar = str.find_first_not_of( onlyAllow ); - while ( firstBadChar != StringType::npos ) - { - str = str.replace( firstBadChar, 1, fill ); - firstBadChar = str.find_first_not_of( onlyAllow ); - } - return str; - } - - - // inline std::set copyPositives( const std::set& input ) - // { - // std::set output; - // std::copy_if( input.cbegin(), input.cend(), std::inserter( output, output.begin() ), - // [](const int i){ return i > 0; } ); - // return output; - // } -} diff --git a/Sourcecode/private/mx/core/TimeOnly.h b/Sourcecode/private/mx/core/TimeOnly.h deleted file mode 100644 index a0d11ec3b..000000000 --- a/Sourcecode/private/mx/core/TimeOnly.h +++ /dev/null @@ -1,15 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/CommaSeparatedPositiveIntegers.h" - -namespace mx -{ - namespace core - { - using TimeOnly = CommaSeparatedListOfPositiveIntegers; - } -} diff --git a/Sourcecode/private/mx/core/UnusedParameter.h b/Sourcecode/private/mx/core/UnusedParameter.h deleted file mode 100644 index d06fdb88f..000000000 --- a/Sourcecode/private/mx/core/UnusedParameter.h +++ /dev/null @@ -1,9 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#ifndef MX_UNUSED -#define MX_UNUSED(expr) do { (void)(expr); } while (0) -#endif diff --git a/Sourcecode/private/mx/core/XlinkHref.h b/Sourcecode/private/mx/core/XlinkHref.h deleted file mode 100644 index fa86b05b7..000000000 --- a/Sourcecode/private/mx/core/XlinkHref.h +++ /dev/null @@ -1,15 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/XsAnyUri.h" - -namespace mx -{ - namespace core - { - using XlinkHref = XsAnyUri; - } -} diff --git a/Sourcecode/private/mx/core/XlinkRole.h b/Sourcecode/private/mx/core/XlinkRole.h deleted file mode 100644 index 10ce984b6..000000000 --- a/Sourcecode/private/mx/core/XlinkRole.h +++ /dev/null @@ -1,15 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/XsToken.h" - -namespace mx -{ - namespace core - { - using XlinkRole = XsToken; - } -} diff --git a/Sourcecode/private/mx/core/XlinkTitle.h b/Sourcecode/private/mx/core/XlinkTitle.h deleted file mode 100644 index 812a2ea05..000000000 --- a/Sourcecode/private/mx/core/XlinkTitle.h +++ /dev/null @@ -1,15 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/XsToken.h" - -namespace mx -{ - namespace core - { - using XlinkTitle = XsToken; - } -} diff --git a/Sourcecode/private/mx/core/XmlLang.h b/Sourcecode/private/mx/core/XmlLang.h deleted file mode 100644 index 0294065f6..000000000 --- a/Sourcecode/private/mx/core/XmlLang.h +++ /dev/null @@ -1,15 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/XsString.h" - -namespace mx -{ - namespace core - { - using XmlLang = XsString; - } -} diff --git a/Sourcecode/private/mx/core/XsAnyUri.h b/Sourcecode/private/mx/core/XsAnyUri.h deleted file mode 100644 index 98274c2df..000000000 --- a/Sourcecode/private/mx/core/XsAnyUri.h +++ /dev/null @@ -1,15 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/XsString.h" - -namespace mx -{ - namespace core - { - using XsAnyUri = XsString; - } -} diff --git a/Sourcecode/private/mx/core/XsID.cpp b/Sourcecode/private/mx/core/XsID.cpp deleted file mode 100644 index 745041df2..000000000 --- a/Sourcecode/private/mx/core/XsID.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/XsID.h" -#include "mx/core/StringUtils.h" - -namespace mx -{ - namespace core - { - XsID::XsID() - :XsString( "ID" ) - { - - } - - - XsID::XsID( const StringType& value ) - :XsString( value ) - { - XsID::setValue( value ); - } - - - void XsID::setValue( const StringType& value ) - { - std::string scrubbed = onlyAllow( value ); - if ( scrubbed.length() == 0 ) - { - scrubbed = "ID"; - } - else if ( isdigit( scrubbed[0] ) ) - { - scrubbed = "ID" + scrubbed; - } - XsString::setValue( scrubbed ); - } - } -} diff --git a/Sourcecode/private/mx/core/XsID.h b/Sourcecode/private/mx/core/XsID.h deleted file mode 100644 index e66906e13..000000000 --- a/Sourcecode/private/mx/core/XsID.h +++ /dev/null @@ -1,21 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/XsString.h" - -namespace mx -{ - namespace core - { - class XsID : public XsString - { - public: - XsID(); - XsID( const StringType& value ); - virtual void setValue( const StringType& value ); - }; - } -} diff --git a/Sourcecode/private/mx/core/XsIDREF.h b/Sourcecode/private/mx/core/XsIDREF.h deleted file mode 100644 index fe62d40ee..000000000 --- a/Sourcecode/private/mx/core/XsIDREF.h +++ /dev/null @@ -1,15 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/XsID.h" - -namespace mx -{ - namespace core - { - using XsIDREF = XsID; - } -} diff --git a/Sourcecode/private/mx/core/XsNMToken.h b/Sourcecode/private/mx/core/XsNMToken.h deleted file mode 100644 index 24938ab05..000000000 --- a/Sourcecode/private/mx/core/XsNMToken.h +++ /dev/null @@ -1,15 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/XsToken.h" - -namespace mx -{ - namespace core - { - using XsNMToken = XsToken; - } -} diff --git a/Sourcecode/private/mx/core/XsString.cpp b/Sourcecode/private/mx/core/XsString.cpp deleted file mode 100644 index bf29c5aeb..000000000 --- a/Sourcecode/private/mx/core/XsString.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/XsString.h" - -namespace mx -{ - namespace core - { - XsString::XsString() - :myValue( "" ) - { - - } - - - XsString::XsString( const StringType& value ) - :myValue( value ) - { - - } - - - XsString::~XsString() - { - - } - - - StringType XsString::getValue() const - { - return myValue; - } - - - void XsString::setValue( const StringType& value ) - { - myValue = value; - } - - - StringType toString( const XsString& xsstring ) - { - return xsstring.getValue(); - } - - - std::ostream& toStream( - std::ostream& os, - const XsString& xsstring, - bool useXmlEscapeCharacters ) - { - if( !useXmlEscapeCharacters ) - { - return os << xsstring.getValue(); - } - for( auto c : xsstring.getValue() ) - { - switch ( c ) - { - case '<': - os << "<"; - break; - - case '>': - os << ">"; - break; - - case '&': - os << "&"; - break; - - default: - os << c; - break; - } - } - return os; - } - - - std::ostream& operator<<( std::ostream& os, const XsString& xsstring ) - { - return toStream( os, xsstring ); - } - } -} diff --git a/Sourcecode/private/mx/core/XsString.h b/Sourcecode/private/mx/core/XsString.h deleted file mode 100644 index 6f188ef80..000000000 --- a/Sourcecode/private/mx/core/XsString.h +++ /dev/null @@ -1,32 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include -#include - -namespace mx -{ - namespace core - { - using StringType = std::string; - - class XsString - { - public: - XsString(); - XsString( const StringType& value ); - virtual ~XsString(); - StringType getValue() const; - virtual void setValue( const StringType& value ); - private: - StringType myValue; - }; - - StringType toString( const XsString& xsstring ); - std::ostream& toStream( std::ostream& os, const XsString& xsstring, bool useXmlEscapeCharacters = true ); - std::ostream& operator<<( std::ostream& os, const XsString& xsstring ); - } -} diff --git a/Sourcecode/private/mx/core/XsToken.cpp b/Sourcecode/private/mx/core/XsToken.cpp deleted file mode 100644 index f47401ddc..000000000 --- a/Sourcecode/private/mx/core/XsToken.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/XsToken.h" -#include "mx/core/StringUtils.h" - -namespace mx -{ - namespace core - { - XsToken::XsToken() - :XsString() - { - - } - - XsToken::XsToken( const StringType& value ) - :XsString( value ) - { - XsToken::setValue( value ); - } - - - void XsToken::setValue( const StringType& value ) - { - XsString::setValue( reduce( value ) ); - } - } -} diff --git a/Sourcecode/private/mx/core/XsToken.h b/Sourcecode/private/mx/core/XsToken.h deleted file mode 100644 index cb997fb3a..000000000 --- a/Sourcecode/private/mx/core/XsToken.h +++ /dev/null @@ -1,21 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/XsString.h" - -namespace mx -{ - namespace core - { - class XsToken : public XsString - { - public: - XsToken(); - XsToken( const StringType& value ); - virtual void setValue( const StringType& value ); - }; - } -} diff --git a/Sourcecode/private/mx/core/YesNoNumber.cpp b/Sourcecode/private/mx/core/YesNoNumber.cpp deleted file mode 100644 index 1826f405a..000000000 --- a/Sourcecode/private/mx/core/YesNoNumber.cpp +++ /dev/null @@ -1,136 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -// self -#include "mx/core/YesNoNumber.h" - -// std -#include -#include - -namespace mx -{ - namespace core - { - template inline constexpr bool always_false_v = false; - - YesNoNumber::YesNoNumber() - : myValue{ YesNo::yes } - { - - } - - YesNoNumber::YesNoNumber( YesNo value ) - : myValue{ value } - { - - } - - YesNoNumber::YesNoNumber( Decimal value ) - : myValue{ std::move( value ) } - { - - } - - YesNoNumber::YesNoNumber( const std::string& value ) - : YesNoNumber{} - { - parse( value ); - } - - bool YesNoNumber::getIsYesNo() const - { - return myValue.index() == 0; - } - - bool YesNoNumber::getIsDecimal() const - { - return myValue.index() == 1; - } - - void YesNoNumber::setYesNo( YesNo value ) - { - myValue.emplace( value ); - } - - void YesNoNumber::setDecimal( Decimal value ) - { - myValue.emplace( value ); - } - - YesNo YesNoNumber::getValueYesNo() const - { - auto result = YesNo::yes; - std::visit([&](auto&& arg) - { - using T = std::decay_t; - if constexpr( std::is_same_v ) - result = arg; - else if constexpr( std::is_same_v ) - result = YesNo::yes; - else - static_assert(always_false_v, "non-exhaustive visitor!"); - }, myValue); - return result; - } - - Decimal YesNoNumber::getValueDecimal() const - { - auto result = Decimal{}; - std::visit([&](auto&& arg) - { - using T = std::decay_t; - if constexpr( std::is_same_v ) - result = Decimal{}; - else if constexpr( std::is_same_v ) - result = arg; - else - static_assert(always_false_v, "non-exhaustive visitor!"); - }, myValue); - return result; - } - - bool YesNoNumber::parse( const std::string& value ) - { - const auto yesNo = tryParseYesNo( value ); - if( yesNo ) - { - setYesNo( *yesNo ); - return true; - } - auto decimal = Decimal{}; - if( decimal.parse( value ) ) - { - setDecimal( decimal ); - return true; - } - return false; - } - - std::string toString( const YesNoNumber& value ) - { - std::stringstream ss; - toStream( ss, value ); - return ss.str(); - } - - std::ostream& toStream( std::ostream& os, const YesNoNumber& value ) - { - if( value.getIsYesNo() ) - { - toStream( os, value.getValueYesNo() ); - } - if( value.getIsDecimal() ) - { - toStream( os, value.getValueDecimal() ); - } - return os; - } - - std::ostream& operator<<( std::ostream& os, const YesNoNumber& value ) - { - return toStream( os, value ); - } - } -} diff --git a/Sourcecode/private/mx/core/YesNoNumber.h b/Sourcecode/private/mx/core/YesNoNumber.h deleted file mode 100644 index 36638ba62..000000000 --- a/Sourcecode/private/mx/core/YesNoNumber.h +++ /dev/null @@ -1,43 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - /// The yes-no-number type is used for attributes that can be either boolean or numeric - /// values. - class YesNoNumber - { - public: - explicit YesNoNumber(); - explicit YesNoNumber( YesNo value ); - explicit YesNoNumber( Decimal value ); - explicit YesNoNumber( const std::string& value ); - bool getIsYesNo() const; - bool getIsDecimal() const; - void setYesNo( YesNo value ); - void setDecimal( Decimal value ); - YesNo getValueYesNo() const; - Decimal getValueDecimal() const; - bool parse( const std::string& value ); - - private: - std::variant myValue; - }; - - std::string toString( const YesNoNumber& value ); - std::ostream& toStream( std::ostream& os, const YesNoNumber& value ); - std::ostream& operator<<( std::ostream& os, const YesNoNumber& value ); - } -} diff --git a/Sourcecode/private/mx/core/elements/Accent.cpp b/Sourcecode/private/mx/core/elements/Accent.cpp deleted file mode 100644 index e46680854..000000000 --- a/Sourcecode/private/mx/core/elements/Accent.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Accent.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Accent::Accent() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Accent::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Accent::hasContents() const { return false; } - std::ostream& Accent::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Accent::streamName( std::ostream& os ) const { os << "accent"; return os; } - std::ostream& Accent::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr Accent::getAttributes() const - { - return myAttributes; - } - - - void Accent::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Accent::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Accent.h b/Sourcecode/private/mx/core/elements/Accent.h deleted file mode 100644 index ecbfea266..000000000 --- a/Sourcecode/private/mx/core/elements/Accent.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Accent ) - - inline AccentPtr makeAccent() { return std::make_shared(); } - - class Accent : public ElementInterface - { - public: - Accent(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Accidental.cpp b/Sourcecode/private/mx/core/elements/Accidental.cpp deleted file mode 100644 index a95160e94..000000000 --- a/Sourcecode/private/mx/core/elements/Accidental.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Accidental.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Accidental::Accidental() - :myValue( AccidentalValue::natural ) - ,myAttributes( std::make_shared() ) - {} - - - Accidental::Accidental( const AccidentalValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Accidental::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Accidental::hasContents() const - { - return true; - } - - - std::ostream& Accidental::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Accidental::streamName( std::ostream& os ) const - { - os << "accidental"; - return os; - } - - - std::ostream& Accidental::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - AccidentalAttributesPtr Accidental::getAttributes() const - { - return myAttributes; - } - - - void Accidental::setAttributes( const AccidentalAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - AccidentalValue Accidental::getValue() const - { - return myValue; - } - - - void Accidental::setValue( const AccidentalValue& value ) - { - myValue = value; - } - - - bool Accidental::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - if( xelement.getValue() == "double-flat" ) - { - message << "Accidental: 'double-flat' is not a valid MusicXML 'accidental' value - converting it to 'flat-flat'" << std::endl; - myValue = parseAccidentalValue( "flat-flat" ); - } - else - { - myValue = parseAccidentalValue( xelement.getValue() ); - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Accidental.h b/Sourcecode/private/mx/core/elements/Accidental.h deleted file mode 100644 index 10fa83f95..000000000 --- a/Sourcecode/private/mx/core/elements/Accidental.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/AccidentalAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccidentalAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Accidental ) - - inline AccidentalPtr makeAccidental() { return std::make_shared(); } - inline AccidentalPtr makeAccidental( const AccidentalValue& value ) { return std::make_shared( value ); } - inline AccidentalPtr makeAccidental( AccidentalValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Accidental : public ElementInterface - { - public: - Accidental(); - Accidental( const AccidentalValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccidentalAttributesPtr getAttributes() const; - void setAttributes( const AccidentalAttributesPtr& attributes ); - AccidentalValue getValue() const; - void setValue( const AccidentalValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccidentalValue myValue; - AccidentalAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/AccidentalAttributes.cpp b/Sourcecode/private/mx/core/elements/AccidentalAttributes.cpp deleted file mode 100644 index 4aaead2a1..000000000 --- a/Sourcecode/private/mx/core/elements/AccidentalAttributes.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/AccidentalAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - AccidentalAttributes::AccidentalAttributes() - :cautionary( YesNo::no ) - ,editorial( YesNo::no ) - ,parentheses( YesNo::no ) - ,bracket() - ,size() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasCautionary( false ) - ,hasEditorial( false ) - ,hasParentheses( false ) - ,hasBracket( false ) - ,hasSize( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool AccidentalAttributes::hasValues() const - { - return hasCautionary || - hasEditorial || - hasParentheses || - hasBracket || - hasSize || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& AccidentalAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, cautionary, "cautionary", hasCautionary ); - streamAttribute( os, editorial, "editorial", hasEditorial ); - streamAttribute( os, parentheses, "parentheses", hasParentheses ); - streamAttribute( os, bracket, "bracket", hasBracket ); - streamAttribute( os, size, "size", hasSize ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool AccidentalAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "AccidentalAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, cautionary, hasCautionary, "cautionary", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, editorial, hasEditorial, "editorial", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bracket, hasBracket, "bracket", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, size, hasSize, "size", &parseSymbolSize ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/AccidentalAttributes.h b/Sourcecode/private/mx/core/elements/AccidentalAttributes.h deleted file mode 100644 index 03a3d8fed..000000000 --- a/Sourcecode/private/mx/core/elements/AccidentalAttributes.h +++ /dev/null @@ -1,62 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccidentalAttributes ) - - struct AccidentalAttributes : public AttributesInterface - { - public: - AccidentalAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo cautionary; - YesNo editorial; - YesNo parentheses; - YesNo bracket; - SymbolSize size; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasCautionary; - bool hasEditorial; - bool hasParentheses; - bool hasBracket; - bool hasSize; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/AccidentalMark.cpp b/Sourcecode/private/mx/core/elements/AccidentalMark.cpp deleted file mode 100644 index f3dba5a7d..000000000 --- a/Sourcecode/private/mx/core/elements/AccidentalMark.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/AccidentalMark.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - AccidentalMark::AccidentalMark() - :myValue( AccidentalValue::natural ) - ,myAttributes( std::make_shared() ) - {} - - - AccidentalMark::AccidentalMark( const AccidentalValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool AccidentalMark::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool AccidentalMark::hasContents() const - { - return true; - } - - - std::ostream& AccidentalMark::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& AccidentalMark::streamName( std::ostream& os ) const - { - os << "accidental-mark"; - return os; - } - - - std::ostream& AccidentalMark::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - AccidentalMarkAttributesPtr AccidentalMark::getAttributes() const - { - return myAttributes; - } - - - void AccidentalMark::setAttributes( const AccidentalMarkAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - AccidentalValue AccidentalMark::getValue() const - { - return myValue; - } - - - void AccidentalMark::setValue( const AccidentalValue& value ) - { - myValue = value; - } - - - bool AccidentalMark::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseAccidentalValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/AccidentalMark.h b/Sourcecode/private/mx/core/elements/AccidentalMark.h deleted file mode 100644 index 3ab55ba07..000000000 --- a/Sourcecode/private/mx/core/elements/AccidentalMark.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/AccidentalMarkAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccidentalMarkAttributes ) - MX_FORWARD_DECLARE_ELEMENT( AccidentalMark ) - - inline AccidentalMarkPtr makeAccidentalMark() { return std::make_shared(); } - inline AccidentalMarkPtr makeAccidentalMark( const AccidentalValue& value ) { return std::make_shared( value ); } - inline AccidentalMarkPtr makeAccidentalMark( AccidentalValue&& value ) { return std::make_shared( std::move( value ) ); } - - class AccidentalMark : public ElementInterface - { - public: - AccidentalMark(); - AccidentalMark( const AccidentalValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccidentalMarkAttributesPtr getAttributes() const; - void setAttributes( const AccidentalMarkAttributesPtr& attributes ); - AccidentalValue getValue() const; - void setValue( const AccidentalValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccidentalValue myValue; - AccidentalMarkAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.cpp b/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.cpp deleted file mode 100644 index 0798ca65f..000000000 --- a/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/AccidentalMarkAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - AccidentalMarkAttributes::AccidentalMarkAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool AccidentalMarkAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& AccidentalMarkAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool AccidentalMarkAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "AccidentalMarkAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.h b/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.h deleted file mode 100644 index 37d8b941f..000000000 --- a/Sourcecode/private/mx/core/elements/AccidentalMarkAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccidentalMarkAttributes ) - - struct AccidentalMarkAttributes : public AttributesInterface - { - public: - AccidentalMarkAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/AccidentalText.cpp b/Sourcecode/private/mx/core/elements/AccidentalText.cpp deleted file mode 100644 index acbb46bbe..000000000 --- a/Sourcecode/private/mx/core/elements/AccidentalText.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/AccidentalText.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - AccidentalText::AccidentalText() - :myValue( AccidentalValue::natural ) - ,myAttributes( std::make_shared() ) - {} - - - AccidentalText::AccidentalText( const AccidentalValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool AccidentalText::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool AccidentalText::hasContents() const - { - return true; - } - - - std::ostream& AccidentalText::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& AccidentalText::streamName( std::ostream& os ) const - { - os << "accidental-text"; - return os; - } - - - std::ostream& AccidentalText::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - AccidentalTextAttributesPtr AccidentalText::getAttributes() const - { - return myAttributes; - } - - - void AccidentalText::setAttributes( const AccidentalTextAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - AccidentalValue AccidentalText::getValue() const - { - return myValue; - } - - - void AccidentalText::setValue( const AccidentalValue& value ) - { - myValue = value; - } - - - bool AccidentalText::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseAccidentalValue( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/AccidentalText.h b/Sourcecode/private/mx/core/elements/AccidentalText.h deleted file mode 100644 index f46748c68..000000000 --- a/Sourcecode/private/mx/core/elements/AccidentalText.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/AccidentalTextAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccidentalTextAttributes ) - MX_FORWARD_DECLARE_ELEMENT( AccidentalText ) - - inline AccidentalTextPtr makeAccidentalText() { return std::make_shared(); } - inline AccidentalTextPtr makeAccidentalText( const AccidentalValue& value ) { return std::make_shared( value ); } - inline AccidentalTextPtr makeAccidentalText( AccidentalValue&& value ) { return std::make_shared( std::move( value ) ); } - - class AccidentalText : public ElementInterface - { - public: - AccidentalText(); - AccidentalText( const AccidentalValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccidentalTextAttributesPtr getAttributes() const; - void setAttributes( const AccidentalTextAttributesPtr& attributes ); - AccidentalValue getValue() const; - void setValue( const AccidentalValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccidentalValue myValue; - AccidentalTextAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.cpp b/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.cpp deleted file mode 100644 index a5d79fa34..000000000 --- a/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/AccidentalTextAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - AccidentalTextAttributes::AccidentalTextAttributes() - :justify( LeftCenterRight::center ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lineHeight() - ,lang( "it" ) - ,space( XmlSpace::default_ ) - ,enclosure( EnclosureShape::rectangle ) - ,hasJustify( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLineHeight( false ) - ,hasLang( false ) - ,hasSpace( false ) - ,hasEnclosure( false ) - {} - - - bool AccidentalTextAttributes::hasValues() const - { - return hasJustify || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLineHeight || - hasLang || - hasSpace || - hasEnclosure; - } - - - std::ostream& AccidentalTextAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lineHeight, "line-height", hasLineHeight ); - streamAttribute( os, lang, "xml:lang", hasLang ); - streamAttribute( os, space, "xml:space", hasSpace ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } - - - bool AccidentalTextAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "AccidentalTextAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.h b/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.h deleted file mode 100644 index eb8dd5c92..000000000 --- a/Sourcecode/private/mx/core/elements/AccidentalTextAttributes.h +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" -#include "mx/core/NumberOrNormal.h" -#include "mx/core/XmlLang.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccidentalTextAttributes ) - - struct AccidentalTextAttributes : public AttributesInterface - { - public: - AccidentalTextAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LeftCenterRight justify; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - NumberOrNormal lineHeight; - XmlLang lang; - XmlSpace space; - EnclosureShape enclosure; - bool hasJustify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLineHeight; - bool hasLang; - bool hasSpace; - bool hasEnclosure; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Accord.cpp b/Sourcecode/private/mx/core/elements/Accord.cpp deleted file mode 100644 index ceb0adbe7..000000000 --- a/Sourcecode/private/mx/core/elements/Accord.cpp +++ /dev/null @@ -1,166 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Accord.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/TuningAlter.h" -#include "mx/core/elements/TuningOctave.h" -#include "mx/core/elements/TuningStep.h" -#include - -namespace mx -{ - namespace core - { - Accord::Accord() - :myAttributes( std::make_shared() ) - ,myTuningStep( makeTuningStep() ) - ,myTuningAlter( makeTuningAlter() ) - ,myHasTuningAlter( false ) - ,myTuningOctave( makeTuningOctave() ) - {} - - - bool Accord::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Accord::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Accord::streamName( std::ostream& os ) const - { - os << "accord"; - return os; - } - - - bool Accord::hasContents() const - { - return true; - } - - - std::ostream& Accord::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myTuningStep->toStream( os, indentLevel+1 ); - if ( myHasTuningAlter ) - { - os << std::endl; - myTuningAlter->toStream( os, indentLevel+1 ); - } - os << std::endl; - myTuningOctave->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } - - - AccordAttributesPtr Accord::getAttributes() const - { - return myAttributes; - } - - - void Accord::setAttributes( const AccordAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - TuningStepPtr Accord::getTuningStep() const - { - return myTuningStep; - } - - - void Accord::setTuningStep( const TuningStepPtr& value ) - { - if( value ) - { - myTuningStep = value; - } - } - - - TuningAlterPtr Accord::getTuningAlter() const - { - return myTuningAlter; - } - - - void Accord::setTuningAlter( const TuningAlterPtr& value ) - { - if( value ) - { - myTuningAlter = value; - } - } - - - bool Accord::getHasTuningAlter() const - { - return myHasTuningAlter; - } - - - void Accord::setHasTuningAlter( const bool value ) - { - myHasTuningAlter = value; - } - - - TuningOctavePtr Accord::getTuningOctave() const - { - return myTuningOctave; - } - - - void Accord::setTuningOctave( const TuningOctavePtr& value ) - { - if( value ) - { - myTuningOctave = value; - } - } - - - bool Accord::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isTuningStepFound = false; - bool isTuningOctaveFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myTuningStep, isTuningStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTuningAlter, myHasTuningAlter ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTuningOctave, isTuningOctaveFound ) ) { continue; } - } - - if( !isTuningStepFound ) - { - message << "Accord: '" << myTuningStep->getElementName() << "' is required but was not found" << std::endl; - } - if( !isTuningOctaveFound ) - { - message << "Accord: '" << myTuningOctave->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Accord.h b/Sourcecode/private/mx/core/elements/Accord.h deleted file mode 100644 index fe5fdb4f3..000000000 --- a/Sourcecode/private/mx/core/elements/Accord.h +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/AccordAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccordAttributes ) - MX_FORWARD_DECLARE_ELEMENT( TuningAlter ) - MX_FORWARD_DECLARE_ELEMENT( TuningOctave ) - MX_FORWARD_DECLARE_ELEMENT( TuningStep ) - MX_FORWARD_DECLARE_ELEMENT( Accord ) - - inline AccordPtr makeAccord() { return std::make_shared(); } - - class Accord : public ElementInterface - { - public: - Accord(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccordAttributesPtr getAttributes() const; - void setAttributes( const AccordAttributesPtr& value ); - - /* _________ TuningStep minOccurs = 1, maxOccurs = 1 _________ */ - TuningStepPtr getTuningStep() const; - void setTuningStep( const TuningStepPtr& value ); - - /* _________ TuningAlter minOccurs = 0, maxOccurs = 1 _________ */ - TuningAlterPtr getTuningAlter() const; - void setTuningAlter( const TuningAlterPtr& value ); - bool getHasTuningAlter() const; - void setHasTuningAlter( const bool value ); - - /* _________ TuningOctave minOccurs = 1, maxOccurs = 1 _________ */ - TuningOctavePtr getTuningOctave() const; - void setTuningOctave( const TuningOctavePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccordAttributesPtr myAttributes; - TuningStepPtr myTuningStep; - TuningAlterPtr myTuningAlter; - bool myHasTuningAlter; - TuningOctavePtr myTuningOctave; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/AccordAttributes.cpp b/Sourcecode/private/mx/core/elements/AccordAttributes.cpp deleted file mode 100644 index 21b7be2c0..000000000 --- a/Sourcecode/private/mx/core/elements/AccordAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/AccordAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - AccordAttributes::AccordAttributes() - :string() - ,hasString( false ) - {} - - - bool AccordAttributes::hasValues() const - { - return hasString; - } - - - std::ostream& AccordAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, string, "string", hasString ); - } - return os; - } - - - bool AccordAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "AccordAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, string, hasString, "string" ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/AccordAttributes.h b/Sourcecode/private/mx/core/elements/AccordAttributes.h deleted file mode 100644 index 0049be3d9..000000000 --- a/Sourcecode/private/mx/core/elements/AccordAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccordAttributes ) - - struct AccordAttributes : public AttributesInterface - { - public: - AccordAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StringNumber string; - bool hasString; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/AccordionHigh.cpp b/Sourcecode/private/mx/core/elements/AccordionHigh.cpp deleted file mode 100644 index b7ce2f02b..000000000 --- a/Sourcecode/private/mx/core/elements/AccordionHigh.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/AccordionHigh.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - AccordionHigh::AccordionHigh() : ElementInterface() {} - - - bool AccordionHigh::hasAttributes() const { return false; } - - - bool AccordionHigh::hasContents() const { return false; } - std::ostream& AccordionHigh::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& AccordionHigh::streamName( std::ostream& os ) const { os << "accordion-high"; return os; } - std::ostream& AccordionHigh::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool AccordionHigh::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/AccordionHigh.h b/Sourcecode/private/mx/core/elements/AccordionHigh.h deleted file mode 100644 index 13c0dc220..000000000 --- a/Sourcecode/private/mx/core/elements/AccordionHigh.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccordionHigh ) - - inline AccordionHighPtr makeAccordionHigh() { return std::make_shared(); } - - class AccordionHigh : public ElementInterface - { - public: - AccordionHigh(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/AccordionLow.cpp b/Sourcecode/private/mx/core/elements/AccordionLow.cpp deleted file mode 100644 index 51b307f2c..000000000 --- a/Sourcecode/private/mx/core/elements/AccordionLow.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/AccordionLow.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - AccordionLow::AccordionLow() : ElementInterface() {} - - - bool AccordionLow::hasAttributes() const { return false; } - - - bool AccordionLow::hasContents() const { return false; } - std::ostream& AccordionLow::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& AccordionLow::streamName( std::ostream& os ) const { os << "accordion-low"; return os; } - std::ostream& AccordionLow::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool AccordionLow::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/AccordionLow.h b/Sourcecode/private/mx/core/elements/AccordionLow.h deleted file mode 100644 index d5a2330aa..000000000 --- a/Sourcecode/private/mx/core/elements/AccordionLow.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccordionLow ) - - inline AccordionLowPtr makeAccordionLow() { return std::make_shared(); } - - class AccordionLow : public ElementInterface - { - public: - AccordionLow(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/AccordionMiddle.cpp b/Sourcecode/private/mx/core/elements/AccordionMiddle.cpp deleted file mode 100644 index 60823af36..000000000 --- a/Sourcecode/private/mx/core/elements/AccordionMiddle.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/AccordionMiddle.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - AccordionMiddle::AccordionMiddle() - :myValue() - {} - - - AccordionMiddle::AccordionMiddle( const AccordionMiddleValue& value ) - :myValue( value ) - {} - - - bool AccordionMiddle::hasAttributes() const - { - return false; - } - - - bool AccordionMiddle::hasContents() const - { - return true; - } - - - std::ostream& AccordionMiddle::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& AccordionMiddle::streamName( std::ostream& os ) const - { - os << "accordion-middle"; - return os; - } - - - std::ostream& AccordionMiddle::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - AccordionMiddleValue AccordionMiddle::getValue() const - { - return myValue; - } - - - void AccordionMiddle::setValue( const AccordionMiddleValue& value ) - { - myValue = value; - } - - - bool AccordionMiddle::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/AccordionMiddle.h b/Sourcecode/private/mx/core/elements/AccordionMiddle.h deleted file mode 100644 index 194ef3b0d..000000000 --- a/Sourcecode/private/mx/core/elements/AccordionMiddle.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccordionMiddle ) - - inline AccordionMiddlePtr makeAccordionMiddle() { return std::make_shared(); } - inline AccordionMiddlePtr makeAccordionMiddle( const AccordionMiddleValue& value ) { return std::make_shared( value ); } - inline AccordionMiddlePtr makeAccordionMiddle( AccordionMiddleValue&& value ) { return std::make_shared( std::move( value ) ); } - - class AccordionMiddle : public ElementInterface - { - public: - AccordionMiddle(); - AccordionMiddle( const AccordionMiddleValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccordionMiddleValue getValue() const; - void setValue( const AccordionMiddleValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccordionMiddleValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/AccordionRegistration.cpp b/Sourcecode/private/mx/core/elements/AccordionRegistration.cpp deleted file mode 100644 index bea612c69..000000000 --- a/Sourcecode/private/mx/core/elements/AccordionRegistration.cpp +++ /dev/null @@ -1,191 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/AccordionRegistration.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/AccordionHigh.h" -#include "mx/core/elements/AccordionLow.h" -#include "mx/core/elements/AccordionMiddle.h" -#include - -namespace mx -{ - namespace core - { - AccordionRegistration::AccordionRegistration() - :myAttributes( std::make_shared() ) - ,myAccordionHigh( makeAccordionHigh() ) - ,myHasAccordionHigh( false ) - ,myAccordionMiddle( makeAccordionMiddle() ) - ,myHasAccordionMiddle( false ) - ,myAccordionLow( makeAccordionLow() ) - ,myHasAccordionLow( false ) - {} - - - bool AccordionRegistration::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& AccordionRegistration::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& AccordionRegistration::streamName( std::ostream& os ) const - { - os << "accordion-registration"; - return os; - } - - - bool AccordionRegistration::hasContents() const - { - return myHasAccordionHigh || myHasAccordionMiddle || myHasAccordionLow; - } - - - std::ostream& AccordionRegistration::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = !hasContents(); - if ( myHasAccordionHigh ) - { - os << std::endl; - myAccordionHigh->toStream( os, indentLevel+1 ); - } - if ( myHasAccordionMiddle ) - { - os << std::endl; - myAccordionMiddle->toStream( os, indentLevel+1 ); - } - if ( myHasAccordionLow ) - { - os << std::endl; - myAccordionLow->toStream( os, indentLevel+1 ); - } - if ( hasContents() ) - { - os << std::endl; - } - return os; - } - - - AccordionRegistrationAttributesPtr AccordionRegistration::getAttributes() const - { - return myAttributes; - } - - - void AccordionRegistration::setAttributes( const AccordionRegistrationAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - AccordionHighPtr AccordionRegistration::getAccordionHigh() const - { - return myAccordionHigh; - } - - - void AccordionRegistration::setAccordionHigh( const AccordionHighPtr& value ) - { - if( value ) - { - myAccordionHigh = value; - } - } - - - bool AccordionRegistration::getHasAccordionHigh() const - { - return myHasAccordionHigh; - } - - - void AccordionRegistration::setHasAccordionHigh( const bool value ) - { - myHasAccordionHigh = value; - } - - - AccordionMiddlePtr AccordionRegistration::getAccordionMiddle() const - { - return myAccordionMiddle; - } - - - void AccordionRegistration::setAccordionMiddle( const AccordionMiddlePtr& value ) - { - if( value ) - { - myAccordionMiddle = value; - } - } - - - bool AccordionRegistration::getHasAccordionMiddle() const - { - return myHasAccordionMiddle; - } - - - void AccordionRegistration::setHasAccordionMiddle( const bool value ) - { - myHasAccordionMiddle = value; - } - - - AccordionLowPtr AccordionRegistration::getAccordionLow() const - { - return myAccordionLow; - } - - - void AccordionRegistration::setAccordionLow( const AccordionLowPtr& value ) - { - if( value ) - { - myAccordionLow = value; - } - } - - - bool AccordionRegistration::getHasAccordionLow() const - { - return myHasAccordionLow; - } - - - void AccordionRegistration::setHasAccordionLow( const bool value ) - { - myHasAccordionLow = value; - } - - - bool AccordionRegistration::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myAccordionHigh, myHasAccordionHigh ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myAccordionMiddle, myHasAccordionMiddle ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myAccordionLow, myHasAccordionLow ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/AccordionRegistration.h b/Sourcecode/private/mx/core/elements/AccordionRegistration.h deleted file mode 100644 index a0d81d436..000000000 --- a/Sourcecode/private/mx/core/elements/AccordionRegistration.h +++ /dev/null @@ -1,72 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/AccordionRegistrationAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccordionRegistrationAttributes ) - MX_FORWARD_DECLARE_ELEMENT( AccordionHigh ) - MX_FORWARD_DECLARE_ELEMENT( AccordionLow ) - MX_FORWARD_DECLARE_ELEMENT( AccordionMiddle ) - MX_FORWARD_DECLARE_ELEMENT( AccordionRegistration ) - - inline AccordionRegistrationPtr makeAccordionRegistration() { return std::make_shared(); } - - class AccordionRegistration : public ElementInterface - { - public: - AccordionRegistration(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccordionRegistrationAttributesPtr getAttributes() const; - void setAttributes( const AccordionRegistrationAttributesPtr& value ); - - /* _________ AccordionHigh minOccurs = 0, maxOccurs = 1 _________ */ - AccordionHighPtr getAccordionHigh() const; - void setAccordionHigh( const AccordionHighPtr& value ); - bool getHasAccordionHigh() const; - void setHasAccordionHigh( const bool value ); - - /* _________ AccordionMiddle minOccurs = 0, maxOccurs = 1 _________ */ - AccordionMiddlePtr getAccordionMiddle() const; - void setAccordionMiddle( const AccordionMiddlePtr& value ); - bool getHasAccordionMiddle() const; - void setHasAccordionMiddle( const bool value ); - - /* _________ AccordionLow minOccurs = 0, maxOccurs = 1 _________ */ - AccordionLowPtr getAccordionLow() const; - void setAccordionLow( const AccordionLowPtr& value ); - bool getHasAccordionLow() const; - void setHasAccordionLow( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccordionRegistrationAttributesPtr myAttributes; - AccordionHighPtr myAccordionHigh; - bool myHasAccordionHigh; - AccordionMiddlePtr myAccordionMiddle; - bool myHasAccordionMiddle; - AccordionLowPtr myAccordionLow; - bool myHasAccordionLow; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.cpp b/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.cpp deleted file mode 100644 index 5e6235fdb..000000000 --- a/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/AccordionRegistrationAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - AccordionRegistrationAttributes::AccordionRegistrationAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,halign( LeftCenterRight::center ) - ,valign( Valign::baseline ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - {} - - - bool AccordionRegistrationAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasHalign || - hasValign; - } - - - std::ostream& AccordionRegistrationAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - } - return os; - } - - - bool AccordionRegistrationAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "AccordionRegistrationAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.h b/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.h deleted file mode 100644 index 0bd189644..000000000 --- a/Sourcecode/private/mx/core/elements/AccordionRegistrationAttributes.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AccordionRegistrationAttributes ) - - struct AccordionRegistrationAttributes : public AttributesInterface - { - public: - AccordionRegistrationAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ActualNotes.cpp b/Sourcecode/private/mx/core/elements/ActualNotes.cpp deleted file mode 100644 index a6ee4e4c5..000000000 --- a/Sourcecode/private/mx/core/elements/ActualNotes.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ActualNotes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ActualNotes::ActualNotes() - :myValue() - {} - - - ActualNotes::ActualNotes( const NonNegativeInteger& value ) - :myValue( value ) - {} - - - bool ActualNotes::hasAttributes() const - { - return false; - } - - - bool ActualNotes::hasContents() const - { - return true; - } - - - std::ostream& ActualNotes::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ActualNotes::streamName( std::ostream& os ) const - { - os << "actual-notes"; - return os; - } - - - std::ostream& ActualNotes::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NonNegativeInteger ActualNotes::getValue() const - { - return myValue; - } - - - void ActualNotes::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } - - - bool ActualNotes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ActualNotes.h b/Sourcecode/private/mx/core/elements/ActualNotes.h deleted file mode 100644 index c8e53cb2d..000000000 --- a/Sourcecode/private/mx/core/elements/ActualNotes.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ActualNotes ) - - inline ActualNotesPtr makeActualNotes() { return std::make_shared(); } - inline ActualNotesPtr makeActualNotes( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline ActualNotesPtr makeActualNotes( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class ActualNotes : public ElementInterface - { - public: - ActualNotes(); - ActualNotes( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Alter.cpp b/Sourcecode/private/mx/core/elements/Alter.cpp deleted file mode 100644 index 2dcf56540..000000000 --- a/Sourcecode/private/mx/core/elements/Alter.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Alter.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Alter::Alter() - :myValue() - {} - - - Alter::Alter( const Semitones& value ) - :myValue( value ) - {} - - - bool Alter::hasAttributes() const - { - return false; - } - - - bool Alter::hasContents() const - { - return true; - } - - - std::ostream& Alter::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Alter::streamName( std::ostream& os ) const - { - os << "alter"; - return os; - } - - - std::ostream& Alter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Semitones Alter::getValue() const - { - return myValue; - } - - - void Alter::setValue( const Semitones& value ) - { - myValue = value; - } - - - bool Alter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Alter.h b/Sourcecode/private/mx/core/elements/Alter.h deleted file mode 100644 index 7d171f0ca..000000000 --- a/Sourcecode/private/mx/core/elements/Alter.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Alter ) - - inline AlterPtr makeAlter() { return std::make_shared(); } - inline AlterPtr makeAlter( const Semitones& value ) { return std::make_shared( value ); } - inline AlterPtr makeAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class Alter : public ElementInterface - { - public: - Alter(); - Alter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Appearance.cpp b/Sourcecode/private/mx/core/elements/Appearance.cpp deleted file mode 100644 index 1cfebcc41..000000000 --- a/Sourcecode/private/mx/core/elements/Appearance.cpp +++ /dev/null @@ -1,261 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Appearance.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Distance.h" -#include "mx/core/elements/LineWidth.h" -#include "mx/core/elements/NoteSize.h" -#include "mx/core/elements/OtherAppearance.h" -#include - -namespace mx -{ - namespace core - { - Appearance::Appearance() - :myLineWidthSet() - ,myNoteSizeSet() - ,myDistanceSet() - ,myOtherAppearanceSet() - {} - - - bool Appearance::hasAttributes() const - { - return false; - } - - - std::ostream& Appearance::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Appearance::streamName( std::ostream& os ) const - { - os << "appearance"; - return os; - } - - - bool Appearance::hasContents() const - { - return myLineWidthSet.size() > 0 - || myNoteSizeSet.size() > 0 - || myDistanceSet.size() > 0 - || myOtherAppearanceSet.size() > 0; - } - - - std::ostream& Appearance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto x : myLineWidthSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myNoteSizeSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myDistanceSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myOtherAppearanceSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - isOneLineOnly = ! hasContents(); - if ( ! isOneLineOnly ) - { - os << std::endl; - } - return os; - } - - - const LineWidthSet& Appearance::getLineWidthSet() const - { - return myLineWidthSet; - } - - - void Appearance::removeLineWidth( const LineWidthSetIterConst& value ) - { - if ( value != myLineWidthSet.cend() ) - { - myLineWidthSet.erase( value ); - } - } - - - void Appearance::addLineWidth( const LineWidthPtr& value ) - { - if ( value ) - { - myLineWidthSet.push_back( value ); - } - } - - - void Appearance::clearLineWidthSet() - { - myLineWidthSet.clear(); - } - - - LineWidthPtr Appearance::getLineWidth( const LineWidthSetIterConst& setIterator ) const - { - if( setIterator != myLineWidthSet.cend() ) - { - return *setIterator; - } - return LineWidthPtr(); - } - - - const NoteSizeSet& Appearance::getNoteSizeSet() const - { - return myNoteSizeSet; - } - - - void Appearance::removeNoteSize( const NoteSizeSetIterConst& value ) - { - if ( value != myNoteSizeSet.cend() ) - { - myNoteSizeSet.erase( value ); - } - } - - - void Appearance::addNoteSize( const NoteSizePtr& value ) - { - if ( value ) - { - myNoteSizeSet.push_back( value ); - } - } - - - void Appearance::clearNoteSizeSet() - { - myNoteSizeSet.clear(); - } - - - NoteSizePtr Appearance::getNoteSize( const NoteSizeSetIterConst& setIterator ) const - { - if( setIterator != myNoteSizeSet.cend() ) - { - return *setIterator; - } - return NoteSizePtr(); - } - - - const DistanceSet& Appearance::getDistanceSet() const - { - return myDistanceSet; - } - - - void Appearance::removeDistance( const DistanceSetIterConst& value ) - { - if ( value != myDistanceSet.cend() ) - { - myDistanceSet.erase( value ); - } - } - - - void Appearance::addDistance( const DistancePtr& value ) - { - if ( value ) - { - myDistanceSet.push_back( value ); - } - } - - - void Appearance::clearDistanceSet() - { - myDistanceSet.clear(); - } - - - DistancePtr Appearance::getDistance( const DistanceSetIterConst& setIterator ) const - { - if( setIterator != myDistanceSet.cend() ) - { - return *setIterator; - } - return DistancePtr(); - } - - - const OtherAppearanceSet& Appearance::getOtherAppearanceSet() const - { - return myOtherAppearanceSet; - } - - - void Appearance::removeOtherAppearance( const OtherAppearanceSetIterConst& value ) - { - if ( value != myOtherAppearanceSet.cend() ) - { - myOtherAppearanceSet.erase( value ); - } - } - - - void Appearance::addOtherAppearance( const OtherAppearancePtr& value ) - { - if ( value ) - { - myOtherAppearanceSet.push_back( value ); - } - } - - - void Appearance::clearOtherAppearanceSet() - { - myOtherAppearanceSet.clear(); - } - - - OtherAppearancePtr Appearance::getOtherAppearance( const OtherAppearanceSetIterConst& setIterator ) const - { - if( setIterator != myOtherAppearanceSet.cend() ) - { - return *setIterator; - } - return OtherAppearancePtr(); - } - - - bool Appearance::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "line-width", myLineWidthSet ); - importElementSet( message, it, endIter, isSuccess, "note-size", myNoteSizeSet ); - importElementSet( message, it, endIter, isSuccess, "distance", myDistanceSet ); - importElementSet( message, it, endIter, isSuccess, "other-appearance", myOtherAppearanceSet ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Appearance.h b/Sourcecode/private/mx/core/elements/Appearance.h deleted file mode 100644 index 24193ae04..000000000 --- a/Sourcecode/private/mx/core/elements/Appearance.h +++ /dev/null @@ -1,76 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Distance ) - MX_FORWARD_DECLARE_ELEMENT( LineWidth ) - MX_FORWARD_DECLARE_ELEMENT( NoteSize ) - MX_FORWARD_DECLARE_ELEMENT( OtherAppearance ) - MX_FORWARD_DECLARE_ELEMENT( Appearance ) - - inline AppearancePtr makeAppearance() { return std::make_shared(); } - - class Appearance : public ElementInterface - { - public: - Appearance(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ LineWidth minOccurs = 0, maxOccurs = unbounded _________ */ - const LineWidthSet& getLineWidthSet() const; - void addLineWidth( const LineWidthPtr& value ); - void removeLineWidth( const LineWidthSetIterConst& value ); - void clearLineWidthSet(); - LineWidthPtr getLineWidth( const LineWidthSetIterConst& setIterator ) const; - - /* _________ NoteSize minOccurs = 0, maxOccurs = unbounded _________ */ - const NoteSizeSet& getNoteSizeSet() const; - void addNoteSize( const NoteSizePtr& value ); - void removeNoteSize( const NoteSizeSetIterConst& value ); - void clearNoteSizeSet(); - NoteSizePtr getNoteSize( const NoteSizeSetIterConst& setIterator ) const; - - /* _________ Distance minOccurs = 0, maxOccurs = unbounded _________ */ - const DistanceSet& getDistanceSet() const; - void addDistance( const DistancePtr& value ); - void removeDistance( const DistanceSetIterConst& value ); - void clearDistanceSet(); - DistancePtr getDistance( const DistanceSetIterConst& setIterator ) const; - - /* _________ OtherAppearance minOccurs = 0, maxOccurs = unbounded _________ */ - const OtherAppearanceSet& getOtherAppearanceSet() const; - void addOtherAppearance( const OtherAppearancePtr& value ); - void removeOtherAppearance( const OtherAppearanceSetIterConst& value ); - void clearOtherAppearanceSet(); - OtherAppearancePtr getOtherAppearance( const OtherAppearanceSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LineWidthSet myLineWidthSet; - NoteSizeSet myNoteSizeSet; - DistanceSet myDistanceSet; - OtherAppearanceSet myOtherAppearanceSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Arpeggiate.cpp b/Sourcecode/private/mx/core/elements/Arpeggiate.cpp deleted file mode 100644 index f027fe034..000000000 --- a/Sourcecode/private/mx/core/elements/Arpeggiate.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Arpeggiate.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Arpeggiate::Arpeggiate() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Arpeggiate::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Arpeggiate::hasContents() const { return false; } - std::ostream& Arpeggiate::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Arpeggiate::streamName( std::ostream& os ) const { os << "arpeggiate"; return os; } - std::ostream& Arpeggiate::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - ArpeggiateAttributesPtr Arpeggiate::getAttributes() const - { - return myAttributes; - } - - - void Arpeggiate::setAttributes( const ArpeggiateAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Arpeggiate::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Arpeggiate.h b/Sourcecode/private/mx/core/elements/Arpeggiate.h deleted file mode 100644 index 1f470c613..000000000 --- a/Sourcecode/private/mx/core/elements/Arpeggiate.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/ArpeggiateAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ArpeggiateAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Arpeggiate ) - - inline ArpeggiatePtr makeArpeggiate() { return std::make_shared(); } - - class Arpeggiate : public ElementInterface - { - public: - Arpeggiate(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ArpeggiateAttributesPtr getAttributes() const; - void setAttributes( const ArpeggiateAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ArpeggiateAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.cpp b/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.cpp deleted file mode 100644 index 13cac6391..000000000 --- a/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ArpeggiateAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ArpeggiateAttributes::ArpeggiateAttributes() - :number() - ,direction() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,placement( AboveBelow::below ) - ,hasNumber( false ) - ,hasDirection( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasPlacement( false ) - {} - - - bool ArpeggiateAttributes::hasValues() const - { - return hasNumber || - hasDirection || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasPlacement; - } - - - std::ostream& ArpeggiateAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, direction, "direction", hasDirection ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool ArpeggiateAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "ArpeggiateAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, direction, hasDirection, "direction", &parseUpDown ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.h b/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.h deleted file mode 100644 index a83f77fd2..000000000 --- a/Sourcecode/private/mx/core/elements/ArpeggiateAttributes.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ArpeggiateAttributes ) - - struct ArpeggiateAttributes : public AttributesInterface - { - public: - ArpeggiateAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - NumberLevel number; - UpDown direction; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - AboveBelow placement; - bool hasNumber; - bool hasDirection; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Arrow.cpp b/Sourcecode/private/mx/core/elements/Arrow.cpp deleted file mode 100644 index e0a9d9958..000000000 --- a/Sourcecode/private/mx/core/elements/Arrow.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Arrow.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/ArrowGroup.h" -#include "mx/core/elements/CircularArrow.h" -#include - -namespace mx -{ - namespace core - { - Arrow::Arrow() - :myChoice( Choice::arrowGroup ) - ,myAttributes( std::make_shared() ) - ,myArrowGroup( makeArrowGroup() ) - ,myCircularArrow( makeCircularArrow() ) - {} - - - bool Arrow::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Arrow::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Arrow::streamName( std::ostream& os ) const - { - os << "arrow"; - return os; - } - - - bool Arrow::hasContents() const - { - return true; - } - - - std::ostream& Arrow::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::arrowGroup: - { - os << std::endl; - myArrowGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - os << std::endl; - isOneLineOnly = false; - } - break; - case Choice::circularArrow: - { - os << std::endl; - myCircularArrow->toStream( os, indentLevel+1 ); - os << std::endl; - isOneLineOnly = false; - } - break; - default: - break; - } - return os; - } - - - ArrowAttributesPtr Arrow::getAttributes() const - { - return myAttributes; - } - - - void Arrow::setAttributes( const ArrowAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - Arrow::Choice Arrow::getChoice() const - { - return myChoice; - } - - - void Arrow::setChoice( const Arrow::Choice value ) - { - myChoice = value; - } - - - ArrowGroupPtr Arrow::getArrowGroup() const - { - return myArrowGroup; - } - - - void Arrow::setArrowGroup( const ArrowGroupPtr& value ) - { - if( value ) - { - myArrowGroup = value; - } - } - - - CircularArrowPtr Arrow::getCircularArrow() const - { - return myCircularArrow; - } - - - void Arrow::setCircularArrow( const CircularArrowPtr& value ) - { - if( value ) - { - myCircularArrow = value; - } - } - - - bool Arrow::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if( it->getName() == "circular-arrow" ) - { - myChoice = Choice::circularArrow; - isSuccess &= myCircularArrow->fromXElement( message, *it ); - // this is a mistake I think MX_RETURN_IS_SUCCESS; - } - myChoice = Choice::arrowGroup; - isSuccess = myArrowGroup->fromXElement( message, xelement ); - // this is a mistake I think MX_RETURN_IS_SUCCESS; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Arrow.h b/Sourcecode/private/mx/core/elements/Arrow.h deleted file mode 100644 index 14618709c..000000000 --- a/Sourcecode/private/mx/core/elements/Arrow.h +++ /dev/null @@ -1,67 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/ArrowAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ArrowAttributes ) - MX_FORWARD_DECLARE_ELEMENT( ArrowGroup ) - MX_FORWARD_DECLARE_ELEMENT( CircularArrow ) - MX_FORWARD_DECLARE_ELEMENT( Arrow ) - - inline ArrowPtr makeArrow() { return std::make_shared(); } - - class Arrow : public ElementInterface - { - public: - enum class Choice - { - arrowGroup = 1, - circularArrow = 2 - }; - Arrow(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ArrowAttributesPtr getAttributes() const; - void setAttributes( const ArrowAttributesPtr& value ); - - /* _________ Choice _________ */ - Arrow::Choice getChoice() const; - void setChoice( const Arrow::Choice value ); - - /* _________ ArrowGroup minOccurs = 1, maxOccurs = 1 _________ */ - ArrowGroupPtr getArrowGroup() const; - void setArrowGroup( const ArrowGroupPtr& value ); - - /* _________ CircularArrow minOccurs = 1, maxOccurs = 1 _________ */ - CircularArrowPtr getCircularArrow() const; - void setCircularArrow( const CircularArrowPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - ArrowAttributesPtr myAttributes; - ArrowGroupPtr myArrowGroup; - CircularArrowPtr myCircularArrow; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ArrowAttributes.cpp b/Sourcecode/private/mx/core/elements/ArrowAttributes.cpp deleted file mode 100644 index eec9383a4..000000000 --- a/Sourcecode/private/mx/core/elements/ArrowAttributes.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ArrowAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ArrowAttributes::ArrowAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - {} - - - bool ArrowAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement; - } - - - std::ostream& ArrowAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool ArrowAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "ArrowAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ArrowAttributes.h b/Sourcecode/private/mx/core/elements/ArrowAttributes.h deleted file mode 100644 index a862ede65..000000000 --- a/Sourcecode/private/mx/core/elements/ArrowAttributes.h +++ /dev/null @@ -1,57 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ArrowAttributes ) - - struct ArrowAttributes : public AttributesInterface - { - public: - ArrowAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ArrowDirection.cpp b/Sourcecode/private/mx/core/elements/ArrowDirection.cpp deleted file mode 100644 index 2ce6009c6..000000000 --- a/Sourcecode/private/mx/core/elements/ArrowDirection.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ArrowDirection.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ArrowDirection::ArrowDirection() - :myValue( ArrowDirectionEnum::up ) - {} - - - ArrowDirection::ArrowDirection( const ArrowDirectionEnum& value ) - :myValue( value ) - {} - - - bool ArrowDirection::hasAttributes() const - { - return false; - } - - - bool ArrowDirection::hasContents() const - { - return true; - } - - - std::ostream& ArrowDirection::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ArrowDirection::streamName( std::ostream& os ) const - { - os << "arrow-direction"; - return os; - } - - - std::ostream& ArrowDirection::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - ArrowDirectionEnum ArrowDirection::getValue() const - { - return myValue; - } - - - void ArrowDirection::setValue( const ArrowDirectionEnum& value ) - { - myValue = value; - } - - - bool ArrowDirection::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseArrowDirectionEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ArrowDirection.h b/Sourcecode/private/mx/core/elements/ArrowDirection.h deleted file mode 100644 index 257d2cec2..000000000 --- a/Sourcecode/private/mx/core/elements/ArrowDirection.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ArrowDirection ) - - inline ArrowDirectionPtr makeArrowDirection() { return std::make_shared(); } - inline ArrowDirectionPtr makeArrowDirection( const ArrowDirectionEnum& value ) { return std::make_shared( value ); } - inline ArrowDirectionPtr makeArrowDirection( ArrowDirectionEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class ArrowDirection : public ElementInterface - { - public: - ArrowDirection(); - ArrowDirection( const ArrowDirectionEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ArrowDirectionEnum getValue() const; - void setValue( const ArrowDirectionEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ArrowDirectionEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ArrowGroup.cpp b/Sourcecode/private/mx/core/elements/ArrowGroup.cpp deleted file mode 100644 index 8ea3d0429..000000000 --- a/Sourcecode/private/mx/core/elements/ArrowGroup.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ArrowGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/ArrowDirection.h" -#include "mx/core/elements/ArrowStyle.h" -#include - -namespace mx -{ - namespace core - { - ArrowGroup::ArrowGroup() - :myArrowDirection( makeArrowDirection() ) - ,myArrowStyle( makeArrowStyle() ) - ,myHasArrowStyle( false ) - {} - - - bool ArrowGroup::hasAttributes() const - { - return false; - } - - - std::ostream& ArrowGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ArrowGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool ArrowGroup::hasContents() const - { - return true; - } - - - std::ostream& ArrowGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - myArrowDirection->toStream( os, indentLevel ); - if ( myHasArrowStyle ) - { - os << std::endl; - myArrowStyle->toStream( os, indentLevel ); - } - isOneLineOnly = false; - return os; - } - - - ArrowDirectionPtr ArrowGroup::getArrowDirection() const - { - return myArrowDirection; - } - - - void ArrowGroup::setArrowDirection( const ArrowDirectionPtr& value ) - { - if ( value ) - { - myArrowDirection = value; - } - } - - - ArrowStylePtr ArrowGroup::getArrowStyle() const - { - return myArrowStyle; - } - - - void ArrowGroup::setArrowStyle( const ArrowStylePtr& value ) - { - if ( value ) - { - myArrowStyle = value; - } - } - - - bool ArrowGroup::getHasArrowStyle() const - { - return myHasArrowStyle; - } - - - void ArrowGroup::setHasArrowStyle( const bool value ) - { - myHasArrowStyle = value; - } - - - bool ArrowGroup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isArrowDirectionFound = false; - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - const std::string elementName = it->getName(); - - if( elementName == "arrow-direction" ) - { - isArrowDirectionFound = true; - isSuccess &= myArrowDirection->fromXElement( message, *it ); - } - else if( elementName == "arrow-style" ) - { - myHasArrowStyle = true; - isSuccess &= myArrowStyle->fromXElement( message, *it ); - } - else - { - if( !isArrowDirectionFound ) - { - isSuccess = false; - message << "ArrowGroup: 'arrow-direction' element is required but was not found" << std::endl; - } - break; - } - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ArrowGroup.h b/Sourcecode/private/mx/core/elements/ArrowGroup.h deleted file mode 100644 index 6be9b580c..000000000 --- a/Sourcecode/private/mx/core/elements/ArrowGroup.h +++ /dev/null @@ -1,55 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ArrowDirection ) - MX_FORWARD_DECLARE_ELEMENT( ArrowStyle ) - MX_FORWARD_DECLARE_ELEMENT( ArrowGroup ) - - inline ArrowGroupPtr makeArrowGroup() { return std::make_shared(); } - - class ArrowGroup : public ElementInterface - { - public: - ArrowGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ ArrowDirection minOccurs = 1, maxOccurs = 1 _________ */ - ArrowDirectionPtr getArrowDirection() const; - void setArrowDirection( const ArrowDirectionPtr& value ); - - /* _________ ArrowStyle minOccurs = 0, maxOccurs = 1 _________ */ - ArrowStylePtr getArrowStyle() const; - void setArrowStyle( const ArrowStylePtr& value ); - bool getHasArrowStyle() const; - void setHasArrowStyle( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ArrowDirectionPtr myArrowDirection; - ArrowStylePtr myArrowStyle; - bool myHasArrowStyle; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ArrowStyle.cpp b/Sourcecode/private/mx/core/elements/ArrowStyle.cpp deleted file mode 100644 index f2eacf6b0..000000000 --- a/Sourcecode/private/mx/core/elements/ArrowStyle.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ArrowStyle.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ArrowStyle::ArrowStyle() - :myValue( ArrowStyleEnum::single ) - {} - - - ArrowStyle::ArrowStyle( const ArrowStyleEnum& value ) - :myValue( value ) - {} - - - bool ArrowStyle::hasAttributes() const - { - return false; - } - - - bool ArrowStyle::hasContents() const - { - return true; - } - - - std::ostream& ArrowStyle::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ArrowStyle::streamName( std::ostream& os ) const - { - os << "arrow-style"; - return os; - } - - - std::ostream& ArrowStyle::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - ArrowStyleEnum ArrowStyle::getValue() const - { - return myValue; - } - - - void ArrowStyle::setValue( const ArrowStyleEnum& value ) - { - myValue = value; - } - - - bool ArrowStyle::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseArrowStyleEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ArrowStyle.h b/Sourcecode/private/mx/core/elements/ArrowStyle.h deleted file mode 100644 index 58fb2772f..000000000 --- a/Sourcecode/private/mx/core/elements/ArrowStyle.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ArrowStyle ) - - inline ArrowStylePtr makeArrowStyle() { return std::make_shared(); } - inline ArrowStylePtr makeArrowStyle( const ArrowStyleEnum& value ) { return std::make_shared( value ); } - inline ArrowStylePtr makeArrowStyle( ArrowStyleEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class ArrowStyle : public ElementInterface - { - public: - ArrowStyle(); - ArrowStyle( const ArrowStyleEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ArrowStyleEnum getValue() const; - void setValue( const ArrowStyleEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ArrowStyleEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Articulations.cpp b/Sourcecode/private/mx/core/elements/Articulations.cpp deleted file mode 100644 index 7477af83c..000000000 --- a/Sourcecode/private/mx/core/elements/Articulations.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Articulations.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/ArticulationsChoice.h" -#include - -namespace mx -{ - namespace core - { - Articulations::Articulations() - :myArticulationsChoiceSet() - {} - - - bool Articulations::hasAttributes() const - { - return false; - } - - - std::ostream& Articulations::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Articulations::streamName( std::ostream& os ) const - { - return os << "articulations"; - } - - - bool Articulations::hasContents() const - { - return myArticulationsChoiceSet.size() > 0; - } - - - std::ostream& Articulations::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myArticulationsChoiceSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - const ArticulationsChoiceSet& Articulations::getArticulationsChoiceSet() const - { - return myArticulationsChoiceSet; - } - - - void Articulations::addArticulationsChoice( const ArticulationsChoicePtr& value ) - { - if ( value ) - { - myArticulationsChoiceSet.push_back( value ); - } - } - - - void Articulations::removeArticulationsChoice( const ArticulationsChoiceSetIterConst& value ) - { - if ( value != myArticulationsChoiceSet.cend() ) - { - myArticulationsChoiceSet.erase( value ); - } - } - - - void Articulations::clearArticulationsChoiceSet() - { - myArticulationsChoiceSet.clear(); - } - - - ArticulationsChoicePtr Articulations::getArticulationsChoice( const ArticulationsChoiceSetIterConst& setIterator ) const - { - if( setIterator != myArticulationsChoiceSet.cend() ) - { - return *setIterator; - } - return ArticulationsChoicePtr(); - } - - - bool Articulations::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - auto item = makeArticulationsChoice(); - isSuccess &= item->fromXElement( message, *it ); - myArticulationsChoiceSet.push_back( item ); - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Articulations.h b/Sourcecode/private/mx/core/elements/Articulations.h deleted file mode 100644 index 9e8f46109..000000000 --- a/Sourcecode/private/mx/core/elements/Articulations.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ArticulationsChoice ) - MX_FORWARD_DECLARE_ELEMENT( Articulations ) - - inline ArticulationsPtr makeArticulations() { return std::make_shared(); } - - class Articulations : public ElementInterface - { - public: - Articulations(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ ArticulationsChoice minOccurs = 0, maxOccurs = unbounded _________ */ - const ArticulationsChoiceSet& getArticulationsChoiceSet() const; - void addArticulationsChoice( const ArticulationsChoicePtr& value ); - void removeArticulationsChoice( const ArticulationsChoiceSetIterConst& value ); - void clearArticulationsChoiceSet(); - ArticulationsChoicePtr getArticulationsChoice( const ArticulationsChoiceSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ArticulationsChoiceSet myArticulationsChoiceSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ArticulationsChoice.cpp b/Sourcecode/private/mx/core/elements/ArticulationsChoice.cpp deleted file mode 100644 index 66140a4ba..000000000 --- a/Sourcecode/private/mx/core/elements/ArticulationsChoice.cpp +++ /dev/null @@ -1,523 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ArticulationsChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Accent.h" -#include "mx/core/elements/BreathMark.h" -#include "mx/core/elements/Caesura.h" -#include "mx/core/elements/DetachedLegato.h" -#include "mx/core/elements/Doit.h" -#include "mx/core/elements/Falloff.h" -#include "mx/core/elements/OtherArticulation.h" -#include "mx/core/elements/Plop.h" -#include "mx/core/elements/Scoop.h" -#include "mx/core/elements/Spiccato.h" -#include "mx/core/elements/Staccatissimo.h" -#include "mx/core/elements/Staccato.h" -#include "mx/core/elements/Stress.h" -#include "mx/core/elements/StrongAccent.h" -#include "mx/core/elements/Tenuto.h" -#include "mx/core/elements/Unstress.h" -#include - -namespace mx -{ - namespace core - { - ArticulationsChoice::ArticulationsChoice() - :myChoice( Choice::accent ) - ,myAccent( makeAccent() ) - ,myStrongAccent( makeStrongAccent() ) - ,myStaccato( makeStaccato() ) - ,myTenuto( makeTenuto() ) - ,myDetachedLegato( makeDetachedLegato() ) - ,myStaccatissimo( makeStaccatissimo() ) - ,mySpiccato( makeSpiccato() ) - ,myScoop( makeScoop() ) - ,myPlop( makePlop() ) - ,myDoit( makeDoit() ) - ,myFalloff( makeFalloff() ) - ,myBreathMark( makeBreathMark() ) - ,myCaesura( makeCaesura() ) - ,myStress( makeStress() ) - ,myUnstress( makeUnstress() ) - ,myOtherArticulation( makeOtherArticulation() ) - {} - - - bool ArticulationsChoice::hasAttributes() const - { - return false; - } - - - std::ostream& ArticulationsChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ArticulationsChoice::streamName( std::ostream& os ) const - { - os << "articulations"; - return os; - } - - - bool ArticulationsChoice::hasContents() const - { - return true; - } - - - std::ostream& ArticulationsChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( isOneLineOnly ); - - switch ( myChoice ) - { - case Choice::accent: - { - myAccent->toStream( os, indentLevel ); - } - break; - case Choice::strongAccent: - { - myStrongAccent->toStream( os, indentLevel ); - } - break; - case Choice::staccato: - { - myStaccato->toStream( os, indentLevel ); - } - break; - case Choice::tenuto: - { - myTenuto->toStream( os, indentLevel ); - } - break; - case Choice::detachedLegato: - { - myDetachedLegato->toStream( os, indentLevel ); - } - break; - case Choice::staccatissimo: - { - myStaccatissimo->toStream( os, indentLevel ); - } - break; - case Choice::spiccato: - { - mySpiccato->toStream( os, indentLevel ); - } - break; - case Choice::scoop: - { - myScoop->toStream( os, indentLevel ); - } - break; - case Choice::plop: - { - myPlop->toStream( os, indentLevel ); - } - break; - case Choice::doit: - { - myDoit->toStream( os, indentLevel ); - } - break; - case Choice::falloff: - { - myFalloff->toStream( os, indentLevel ); - } - break; - case Choice::breathMark: - { - myBreathMark->toStream( os, indentLevel ); - } - break; - case Choice::caesura: - { - myCaesura->toStream( os, indentLevel ); - } - break; - case Choice::stress: - { - myStress->toStream( os, indentLevel ); - } - break; - case Choice::unstress: - { - myUnstress->toStream( os, indentLevel ); - } - break; - case Choice::otherArticulation: - { - myOtherArticulation->toStream( os, indentLevel ); - } - break; - default: - break; - } - return os; - } - - - ArticulationsChoice::Choice ArticulationsChoice::getChoice() const - { - return myChoice; - } - - - void ArticulationsChoice::setChoice( const ArticulationsChoice::Choice value ) - { - myChoice = value; - } - - - AccentPtr ArticulationsChoice::getAccent() const - { - return myAccent; - } - - - void ArticulationsChoice::setAccent( const AccentPtr& value ) - { - if( value ) - { - myAccent = value; - } - } - - - StrongAccentPtr ArticulationsChoice::getStrongAccent() const - { - return myStrongAccent; - } - - - void ArticulationsChoice::setStrongAccent( const StrongAccentPtr& value ) - { - if( value ) - { - myStrongAccent = value; - } - } - - - StaccatoPtr ArticulationsChoice::getStaccato() const - { - return myStaccato; - } - - - void ArticulationsChoice::setStaccato( const StaccatoPtr& value ) - { - if( value ) - { - myStaccato = value; - } - } - - - TenutoPtr ArticulationsChoice::getTenuto() const - { - return myTenuto; - } - - - void ArticulationsChoice::setTenuto( const TenutoPtr& value ) - { - if( value ) - { - myTenuto = value; - } - } - - - DetachedLegatoPtr ArticulationsChoice::getDetachedLegato() const - { - return myDetachedLegato; - } - - - void ArticulationsChoice::setDetachedLegato( const DetachedLegatoPtr& value ) - { - if( value ) - { - myDetachedLegato = value; - } - } - - - StaccatissimoPtr ArticulationsChoice::getStaccatissimo() const - { - return myStaccatissimo; - } - - - void ArticulationsChoice::setStaccatissimo( const StaccatissimoPtr& value ) - { - if( value ) - { - myStaccatissimo = value; - } - } - - - SpiccatoPtr ArticulationsChoice::getSpiccato() const - { - return mySpiccato; - } - - - void ArticulationsChoice::setSpiccato( const SpiccatoPtr& value ) - { - if( value ) - { - mySpiccato = value; - } - } - - - ScoopPtr ArticulationsChoice::getScoop() const - { - return myScoop; - } - - - void ArticulationsChoice::setScoop( const ScoopPtr& value ) - { - if( value ) - { - myScoop = value; - } - } - - - PlopPtr ArticulationsChoice::getPlop() const - { - return myPlop; - } - - - void ArticulationsChoice::setPlop( const PlopPtr& value ) - { - if( value ) - { - myPlop = value; - } - } - - - DoitPtr ArticulationsChoice::getDoit() const - { - return myDoit; - } - - - void ArticulationsChoice::setDoit( const DoitPtr& value ) - { - if( value ) - { - myDoit = value; - } - } - - - FalloffPtr ArticulationsChoice::getFalloff() const - { - return myFalloff; - } - - - void ArticulationsChoice::setFalloff( const FalloffPtr& value ) - { - if( value ) - { - myFalloff = value; - } - } - - - BreathMarkPtr ArticulationsChoice::getBreathMark() const - { - return myBreathMark; - } - - - void ArticulationsChoice::setBreathMark( const BreathMarkPtr& value ) - { - if( value ) - { - myBreathMark = value; - } - } - - - CaesuraPtr ArticulationsChoice::getCaesura() const - { - return myCaesura; - } - - - void ArticulationsChoice::setCaesura( const CaesuraPtr& value ) - { - if( value ) - { - myCaesura = value; - } - } - - - StressPtr ArticulationsChoice::getStress() const - { - return myStress; - } - - - void ArticulationsChoice::setStress( const StressPtr& value ) - { - if( value ) - { - myStress = value; - } - } - - - UnstressPtr ArticulationsChoice::getUnstress() const - { - return myUnstress; - } - - - void ArticulationsChoice::setUnstress( const UnstressPtr& value ) - { - if( value ) - { - myUnstress = value; - } - } - - - OtherArticulationPtr ArticulationsChoice::getOtherArticulation() const - { - return myOtherArticulation; - } - - - void ArticulationsChoice::setOtherArticulation( const OtherArticulationPtr& value ) - { - if( value ) - { - myOtherArticulation = value; - } - } - - - bool ArticulationsChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - if( xelement.getName() == "accent" ) - { - myChoice = Choice::accent; - return getAccent()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "strong-accent" ) - { - myChoice = Choice::strongAccent; - return getStrongAccent()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "staccato" ) - { - myChoice = Choice::staccato; - return getStaccato()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "tenuto" ) - { - myChoice = Choice::tenuto; - return getTenuto()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "detached-legato" ) - { - myChoice = Choice::detachedLegato; - return getDetachedLegato()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "staccatissimo" ) - { - myChoice = Choice::staccatissimo; - return getStaccatissimo()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "spiccato" ) - { - myChoice = Choice::spiccato; - return getSpiccato()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "scoop" ) - { - myChoice = Choice::scoop; - return getScoop()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "plop" ) - { - myChoice = Choice::plop; - return getPlop()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "doit" ) - { - myChoice = Choice::doit; - return getDoit()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "falloff" ) - { - myChoice = Choice::falloff; - return getFalloff()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "breath-mark" ) - { - myChoice = Choice::breathMark; - return getBreathMark()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "caesura" ) - { - myChoice = Choice::caesura; - return getCaesura()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "stress" ) - { - myChoice = Choice::stress; - return getStress()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "unstress" ) - { - myChoice = Choice::unstress; - return getUnstress()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "other-articulation" ) - { - myChoice = Choice::otherArticulation; - return getOtherArticulation()->fromXElement( message, xelement ); - } - - message << "ArticulationsChoice: '" << xelement.getName() << "' is not allowed" << std::endl; - return false; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ArticulationsChoice.h b/Sourcecode/private/mx/core/elements/ArticulationsChoice.h deleted file mode 100644 index 4d82061cd..000000000 --- a/Sourcecode/private/mx/core/elements/ArticulationsChoice.h +++ /dev/null @@ -1,160 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Accent ) - MX_FORWARD_DECLARE_ELEMENT( BreathMark ) - MX_FORWARD_DECLARE_ELEMENT( Caesura ) - MX_FORWARD_DECLARE_ELEMENT( DetachedLegato ) - MX_FORWARD_DECLARE_ELEMENT( Doit ) - MX_FORWARD_DECLARE_ELEMENT( Falloff ) - MX_FORWARD_DECLARE_ELEMENT( OtherArticulation ) - MX_FORWARD_DECLARE_ELEMENT( Plop ) - MX_FORWARD_DECLARE_ELEMENT( Scoop ) - MX_FORWARD_DECLARE_ELEMENT( Spiccato ) - MX_FORWARD_DECLARE_ELEMENT( Staccatissimo ) - MX_FORWARD_DECLARE_ELEMENT( Staccato ) - MX_FORWARD_DECLARE_ELEMENT( Stress ) - MX_FORWARD_DECLARE_ELEMENT( StrongAccent ) - MX_FORWARD_DECLARE_ELEMENT( Tenuto ) - MX_FORWARD_DECLARE_ELEMENT( Unstress ) - MX_FORWARD_DECLARE_ELEMENT( ArticulationsChoice ) - - inline ArticulationsChoicePtr makeArticulationsChoice() { return std::make_shared(); } - - class ArticulationsChoice : public ElementInterface - { - public: - enum class Choice - { - accent = 1, - strongAccent = 2, - staccato = 3, - tenuto = 4, - detachedLegato = 5, - staccatissimo = 6, - spiccato = 7, - scoop = 8, - plop = 9, - doit = 10, - falloff = 11, - breathMark = 12, - caesura = 13, - stress = 14, - unstress = 15, - otherArticulation = 16 - }; - ArticulationsChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - ArticulationsChoice::Choice getChoice() const; - void setChoice( const ArticulationsChoice::Choice value ); - - /* _________ Accent minOccurs = 1, maxOccurs = 1 _________ */ - AccentPtr getAccent() const; - void setAccent( const AccentPtr& value ); - - /* _________ StrongAccent minOccurs = 1, maxOccurs = 1 _________ */ - StrongAccentPtr getStrongAccent() const; - void setStrongAccent( const StrongAccentPtr& value ); - - /* _________ Staccato minOccurs = 1, maxOccurs = 1 _________ */ - StaccatoPtr getStaccato() const; - void setStaccato( const StaccatoPtr& value ); - - /* _________ Tenuto minOccurs = 1, maxOccurs = 1 _________ */ - TenutoPtr getTenuto() const; - void setTenuto( const TenutoPtr& value ); - - /* _________ DetachedLegato minOccurs = 1, maxOccurs = 1 _________ */ - DetachedLegatoPtr getDetachedLegato() const; - void setDetachedLegato( const DetachedLegatoPtr& value ); - - /* _________ Staccatissimo minOccurs = 1, maxOccurs = 1 _________ */ - StaccatissimoPtr getStaccatissimo() const; - void setStaccatissimo( const StaccatissimoPtr& value ); - - /* _________ Spiccato minOccurs = 1, maxOccurs = 1 _________ */ - SpiccatoPtr getSpiccato() const; - void setSpiccato( const SpiccatoPtr& value ); - - /* _________ Scoop minOccurs = 1, maxOccurs = 1 _________ */ - ScoopPtr getScoop() const; - void setScoop( const ScoopPtr& value ); - - /* _________ Plop minOccurs = 1, maxOccurs = 1 _________ */ - PlopPtr getPlop() const; - void setPlop( const PlopPtr& value ); - - /* _________ Doit minOccurs = 1, maxOccurs = 1 _________ */ - DoitPtr getDoit() const; - void setDoit( const DoitPtr& value ); - - /* _________ Falloff minOccurs = 1, maxOccurs = 1 _________ */ - FalloffPtr getFalloff() const; - void setFalloff( const FalloffPtr& value ); - - /* _________ BreathMark minOccurs = 1, maxOccurs = 1 _________ */ - BreathMarkPtr getBreathMark() const; - void setBreathMark( const BreathMarkPtr& value ); - - /* _________ Caesura minOccurs = 1, maxOccurs = 1 _________ */ - CaesuraPtr getCaesura() const; - void setCaesura( const CaesuraPtr& value ); - - /* _________ Stress minOccurs = 1, maxOccurs = 1 _________ */ - StressPtr getStress() const; - void setStress( const StressPtr& value ); - - /* _________ Unstress minOccurs = 1, maxOccurs = 1 _________ */ - UnstressPtr getUnstress() const; - void setUnstress( const UnstressPtr& value ); - - /* _________ OtherArticulation minOccurs = 1, maxOccurs = 1 _________ */ - OtherArticulationPtr getOtherArticulation() const; - void setOtherArticulation( const OtherArticulationPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - AccentPtr myAccent; - StrongAccentPtr myStrongAccent; - StaccatoPtr myStaccato; - TenutoPtr myTenuto; - DetachedLegatoPtr myDetachedLegato; - StaccatissimoPtr myStaccatissimo; - SpiccatoPtr mySpiccato; - ScoopPtr myScoop; - PlopPtr myPlop; - DoitPtr myDoit; - FalloffPtr myFalloff; - BreathMarkPtr myBreathMark; - CaesuraPtr myCaesura; - StressPtr myStress; - UnstressPtr myUnstress; - OtherArticulationPtr myOtherArticulation; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Artificial.cpp b/Sourcecode/private/mx/core/elements/Artificial.cpp deleted file mode 100644 index 809ce27c1..000000000 --- a/Sourcecode/private/mx/core/elements/Artificial.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Artificial.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Artificial::Artificial() : ElementInterface() {} - - - bool Artificial::hasAttributes() const { return false; } - - - bool Artificial::hasContents() const { return false; } - std::ostream& Artificial::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Artificial::streamName( std::ostream& os ) const { os << "artificial"; return os; } - std::ostream& Artificial::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool Artificial::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Artificial.h b/Sourcecode/private/mx/core/elements/Artificial.h deleted file mode 100644 index 9f260b515..000000000 --- a/Sourcecode/private/mx/core/elements/Artificial.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Artificial ) - - inline ArtificialPtr makeArtificial() { return std::make_shared(); } - - class Artificial : public ElementInterface - { - public: - Artificial(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/AttributesIterface.h b/Sourcecode/private/mx/core/elements/AttributesIterface.h deleted file mode 100644 index e372e24e4..000000000 --- a/Sourcecode/private/mx/core/elements/AttributesIterface.h +++ /dev/null @@ -1,29 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( AttributesIterface ) - - struct AttributesIterface : public AttributesInterface - { - public: - AttributesIterface(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Backup.cpp b/Sourcecode/private/mx/core/elements/Backup.cpp deleted file mode 100644 index 2af48365b..000000000 --- a/Sourcecode/private/mx/core/elements/Backup.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Backup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Duration.h" -#include "mx/core/elements/EditorialGroup.h" -#include - -namespace mx -{ - namespace core - { - Backup::Backup() - :myDuration( makeDuration() ) - ,myEditorialGroup( makeEditorialGroup() ) - {} - - - bool Backup::hasAttributes() const - { - return false; - } - - - std::ostream& Backup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Backup::streamName( std::ostream& os ) const - { - os << "backup"; - return os; - } - - - bool Backup::hasContents() const - { - return true; - } - - - std::ostream& Backup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myDuration->toStream( os, indentLevel+1 ); - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - } - isOneLineOnly = false; - return os; - } - - - DurationPtr Backup::getDuration() const - { - return myDuration; - } - - - void Backup::setDuration( const DurationPtr& value ) - { - if( value ) - { - myDuration = value; - } - } - - - EditorialGroupPtr Backup::getEditorialGroup() const - { - return myEditorialGroup; - } - - - void Backup::setEditorialGroup( const EditorialGroupPtr& value ) - { - if ( value ) - { - myEditorialGroup = value; - } - } - - - bool Backup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isDurationFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myDuration, isDurationFound ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialGroup ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Backup.h b/Sourcecode/private/mx/core/elements/Backup.h deleted file mode 100644 index 9485a2b41..000000000 --- a/Sourcecode/private/mx/core/elements/Backup.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Duration ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( Backup ) - - inline BackupPtr makeBackup() { return std::make_shared(); } - - class Backup : public ElementInterface - { - public: - Backup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Duration minOccurs = 1, maxOccurs = 1 _________ */ - DurationPtr getDuration() const; - void setDuration( const DurationPtr& value ); - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DurationPtr myDuration; - EditorialGroupPtr myEditorialGroup; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BarStyle.cpp b/Sourcecode/private/mx/core/elements/BarStyle.cpp deleted file mode 100644 index 82ab7be09..000000000 --- a/Sourcecode/private/mx/core/elements/BarStyle.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BarStyle.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BarStyle::BarStyle() - :myValue( BarStyleEnum::regular ) - ,myAttributes( std::make_shared() ) - {} - - - BarStyle::BarStyle( const BarStyleEnum& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool BarStyle::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool BarStyle::hasContents() const - { - return true; - } - - - std::ostream& BarStyle::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& BarStyle::streamName( std::ostream& os ) const - { - os << "bar-style"; - return os; - } - - - std::ostream& BarStyle::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - BarStyleAttributesPtr BarStyle::getAttributes() const - { - return myAttributes; - } - - - void BarStyle::setAttributes( const BarStyleAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - BarStyleEnum BarStyle::getValue() const - { - return myValue; - } - - - void BarStyle::setValue( const BarStyleEnum& value ) - { - myValue = value; - } - - - bool BarStyle::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseBarStyleEnum( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BarStyle.h b/Sourcecode/private/mx/core/elements/BarStyle.h deleted file mode 100644 index 9488d453c..000000000 --- a/Sourcecode/private/mx/core/elements/BarStyle.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/BarStyleAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BarStyleAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BarStyle ) - - inline BarStylePtr makeBarStyle() { return std::make_shared(); } - inline BarStylePtr makeBarStyle( const BarStyleEnum& value ) { return std::make_shared( value ); } - inline BarStylePtr makeBarStyle( BarStyleEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class BarStyle : public ElementInterface - { - public: - BarStyle(); - BarStyle( const BarStyleEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BarStyleAttributesPtr getAttributes() const; - void setAttributes( const BarStyleAttributesPtr& attributes ); - BarStyleEnum getValue() const; - void setValue( const BarStyleEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BarStyleEnum myValue; - BarStyleAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BarStyleAttributes.cpp b/Sourcecode/private/mx/core/elements/BarStyleAttributes.cpp deleted file mode 100644 index a3557b014..000000000 --- a/Sourcecode/private/mx/core/elements/BarStyleAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BarStyleAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BarStyleAttributes::BarStyleAttributes() - :color() - ,hasColor( false ) - {} - - - bool BarStyleAttributes::hasValues() const - { - return hasColor; - } - - - std::ostream& BarStyleAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, color, "color", hasColor ); - } - return os; - } - - - bool BarStyleAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "BarStyleAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BarStyleAttributes.h b/Sourcecode/private/mx/core/elements/BarStyleAttributes.h deleted file mode 100644 index 6ee38c5a1..000000000 --- a/Sourcecode/private/mx/core/elements/BarStyleAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BarStyleAttributes ) - - struct BarStyleAttributes : public AttributesInterface - { - public: - BarStyleAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - Color color; - bool hasColor; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Barline.cpp b/Sourcecode/private/mx/core/elements/Barline.cpp deleted file mode 100644 index 63f36efd0..000000000 --- a/Sourcecode/private/mx/core/elements/Barline.cpp +++ /dev/null @@ -1,383 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Barline.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/BarStyle.h" -#include "mx/core/elements/Coda.h" -#include "mx/core/elements/EditorialGroup.h" -#include "mx/core/elements/Ending.h" -#include "mx/core/elements/Fermata.h" -#include "mx/core/elements/Repeat.h" -#include "mx/core/elements/Segno.h" -#include "mx/core/elements/WavyLine.h" -#include - -namespace mx -{ - namespace core - { - Barline::Barline() - :myAttributes( std::make_shared() ) - ,myBarStyle( makeBarStyle() ) - ,myHasBarStyle( false ) - ,myEditorialGroup( makeEditorialGroup() ) - ,myWavyLine( makeWavyLine() ) - ,myHasWavyLine( false ) - ,mySegno( makeSegno() ) - ,myHasSegno( false ) - ,myCoda( makeCoda() ) - ,myHasCoda( false ) - ,myFermataSet() - ,myEnding( makeEnding() ) - ,myHasEnding( false ) - ,myRepeat( makeRepeat() ) - ,myHasRepeat( false ) - {} - - - bool Barline::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Barline::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Barline::streamName( std::ostream& os ) const - { - os << "barline"; - return os; - } - - - bool Barline::hasContents() const - { - return myHasBarStyle - || myEditorialGroup->hasContents() - || myHasWavyLine - || myHasSegno - || myHasCoda - || myFermataSet.size() > 0 - || myHasEnding - || myHasRepeat; - } - - - std::ostream& Barline::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasBarStyle ) - { - os << std::endl; - myBarStyle->toStream( os, indentLevel+1 ); - } - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasWavyLine ) - { - os << std::endl; - myWavyLine->toStream( os, indentLevel+1 ); - } - if ( myHasSegno ) - { - os << std::endl; - mySegno->toStream( os, indentLevel+1 ); - } - if ( myHasCoda ) - { - os << std::endl; - myCoda->toStream( os, indentLevel+1 ); - } - for ( auto x : myFermataSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasEnding ) - { - os << std::endl; - myEnding->toStream( os, indentLevel+1 ); - } - if ( myHasRepeat ) - { - os << std::endl; - myRepeat->toStream( os, indentLevel+1 ); - } - isOneLineOnly = ! hasContents(); - if ( ! isOneLineOnly ) - { - os << std::endl; - } - return os; - } - - - BarlineAttributesPtr Barline::getAttributes() const - { - return myAttributes; - } - - - void Barline::setAttributes( const BarlineAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - BarStylePtr Barline::getBarStyle() const - { - return myBarStyle; - } - - - void Barline::setBarStyle( const BarStylePtr& value ) - { - if( value ) - { - myBarStyle = value; - } - } - - - bool Barline::getHasBarStyle() const - { - return myHasBarStyle; - } - - - void Barline::setHasBarStyle( const bool value ) - { - myHasBarStyle = value; - } - - - EditorialGroupPtr Barline::getEditorialGroup() const - { - return myEditorialGroup; - } - - - void Barline::setEditorialGroup( const EditorialGroupPtr& value ) - { - if ( value ) - { - myEditorialGroup = value; - } - } - - - WavyLinePtr Barline::getWavyLine() const - { - return myWavyLine; - } - - - void Barline::setWavyLine( const WavyLinePtr& value ) - { - if( value ) - { - myWavyLine = value; - } - } - - - bool Barline::getHasWavyLine() const - { - return myHasWavyLine; - } - - - void Barline::setHasWavyLine( const bool value ) - { - myHasWavyLine = value; - } - - - SegnoPtr Barline::getSegno() const - { - return mySegno; - } - - - void Barline::setSegno( const SegnoPtr& value ) - { - if( value ) - { - mySegno = value; - } - } - - - bool Barline::getHasSegno() const - { - return myHasSegno; - } - - - void Barline::setHasSegno( const bool value ) - { - myHasSegno = value; - } - - - CodaPtr Barline::getCoda() const - { - return myCoda; - } - - - void Barline::setCoda( const CodaPtr& value ) - { - if( value ) - { - myCoda = value; - } - } - - - bool Barline::getHasCoda() const - { - return myHasCoda; - } - - - void Barline::setHasCoda( const bool value ) - { - myHasCoda = value; - } - - - const FermataSet& Barline::getFermataSet() const - { - return myFermataSet; - } - - - void Barline::removeFermata( const FermataSetIterConst& value ) - { - if ( value != myFermataSet.cend() ) - { - if ( myFermataSet.size() > 0 ) - { - myFermataSet.erase( value ); - } - } - } - - - void Barline::addFermata( const FermataPtr& value ) - { - if ( value ) - { - if ( myFermataSet.size() < 2 ) - { - myFermataSet.push_back( value ); - } - } - } - - - void Barline::clearFermataSet() - { - myFermataSet.clear(); - } - - - FermataPtr Barline::getFermata( const FermataSetIterConst& setIterator ) const - { - if( setIterator != myFermataSet.cend() ) - { - return *setIterator; - } - return FermataPtr(); - } - - - EndingPtr Barline::getEnding() const - { - return myEnding; - } - - - void Barline::setEnding( const EndingPtr& value ) - { - if( value ) - { - myEnding = value; - } - } - - - bool Barline::getHasEnding() const - { - return myHasEnding; - } - - - void Barline::setHasEnding( const bool value ) - { - myHasEnding = value; - } - - - RepeatPtr Barline::getRepeat() const - { - return myRepeat; - } - - - void Barline::setRepeat( const RepeatPtr& value ) - { - if( value ) - { - myRepeat = value; - } - } - - - bool Barline::getHasRepeat() const - { - return myHasRepeat; - } - - - void Barline::setHasRepeat( const bool value ) - { - myHasRepeat = value; - } - - - bool Barline::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myBarStyle, myHasBarStyle ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialGroup ); - if ( importElement( message, *it, isSuccess, *myWavyLine, myHasWavyLine ) ) { continue; } - if ( importElement( message, *it, isSuccess, *mySegno, myHasSegno ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myCoda, myHasCoda ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "fermata", myFermataSet ); - if ( importElement( message, *it, isSuccess, *myEnding, myHasEnding ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myRepeat, myHasRepeat ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Barline.h b/Sourcecode/private/mx/core/elements/Barline.h deleted file mode 100644 index bb6b247be..000000000 --- a/Sourcecode/private/mx/core/elements/Barline.h +++ /dev/null @@ -1,114 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/BarlineAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BarlineAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BarStyle ) - MX_FORWARD_DECLARE_ELEMENT( Coda ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( Ending ) - MX_FORWARD_DECLARE_ELEMENT( Fermata ) - MX_FORWARD_DECLARE_ELEMENT( Repeat ) - MX_FORWARD_DECLARE_ELEMENT( Segno ) - MX_FORWARD_DECLARE_ELEMENT( WavyLine ) - MX_FORWARD_DECLARE_ELEMENT( Barline ) - - inline BarlinePtr makeBarline() { return std::make_shared(); } - - class Barline : public ElementInterface - { - public: - Barline(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BarlineAttributesPtr getAttributes() const; - void setAttributes( const BarlineAttributesPtr& value ); - - /* _________ BarStyle minOccurs = 0, maxOccurs = 1 _________ */ - BarStylePtr getBarStyle() const; - void setBarStyle( const BarStylePtr& value ); - bool getHasBarStyle() const; - void setHasBarStyle( const bool value ); - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - /* _________ WavyLine minOccurs = 0, maxOccurs = 1 _________ */ - WavyLinePtr getWavyLine() const; - void setWavyLine( const WavyLinePtr& value ); - bool getHasWavyLine() const; - void setHasWavyLine( const bool value ); - - /* _________ Segno minOccurs = 0, maxOccurs = 1 _________ */ - SegnoPtr getSegno() const; - void setSegno( const SegnoPtr& value ); - bool getHasSegno() const; - void setHasSegno( const bool value ); - - /* _________ Coda minOccurs = 0, maxOccurs = 1 _________ */ - CodaPtr getCoda() const; - void setCoda( const CodaPtr& value ); - bool getHasCoda() const; - void setHasCoda( const bool value ); - - /* _________ Fermata minOccurs = 0, maxOccurs = 2 _________ */ - const FermataSet& getFermataSet() const; - void addFermata( const FermataPtr& value ); - void removeFermata( const FermataSetIterConst& value ); - void clearFermataSet(); - FermataPtr getFermata( const FermataSetIterConst& setIterator ) const; - - /* _________ Ending minOccurs = 0, maxOccurs = 1 _________ */ - EndingPtr getEnding() const; - void setEnding( const EndingPtr& value ); - bool getHasEnding() const; - void setHasEnding( const bool value ); - - /* _________ Repeat minOccurs = 0, maxOccurs = 1 _________ */ - RepeatPtr getRepeat() const; - void setRepeat( const RepeatPtr& value ); - bool getHasRepeat() const; - void setHasRepeat( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BarlineAttributesPtr myAttributes; - BarStylePtr myBarStyle; - bool myHasBarStyle; - EditorialGroupPtr myEditorialGroup; - WavyLinePtr myWavyLine; - bool myHasWavyLine; - SegnoPtr mySegno; - bool myHasSegno; - CodaPtr myCoda; - bool myHasCoda; - FermataSet myFermataSet; - EndingPtr myEnding; - bool myHasEnding; - RepeatPtr myRepeat; - bool myHasRepeat; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BarlineAttributes.cpp b/Sourcecode/private/mx/core/elements/BarlineAttributes.cpp deleted file mode 100644 index 6a55db03c..000000000 --- a/Sourcecode/private/mx/core/elements/BarlineAttributes.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BarlineAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BarlineAttributes::BarlineAttributes() - :location( RightLeftMiddle::right ) - ,segno() - ,coda() - ,divisions() - ,hasLocation( false ) - ,hasSegno( false ) - ,hasCoda( false ) - ,hasDivisions( false ) - {} - - - bool BarlineAttributes::hasValues() const - { - return hasLocation || - hasSegno || - hasCoda || - hasDivisions; - } - - - std::ostream& BarlineAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, location, "location", hasLocation ); - streamAttribute( os, segno, "segno", hasSegno ); - streamAttribute( os, coda, "coda", hasCoda ); - streamAttribute( os, divisions, "divisions", hasDivisions ); - } - return os; - } - - - bool BarlineAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "BarlineAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, location, hasLocation, "location", &parseRightLeftMiddle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, segno, hasSegno, "segno" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, coda, hasCoda, "coda" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, divisions, hasDivisions, "divisions" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BarlineAttributes.h b/Sourcecode/private/mx/core/elements/BarlineAttributes.h deleted file mode 100644 index 360e8645f..000000000 --- a/Sourcecode/private/mx/core/elements/BarlineAttributes.h +++ /dev/null @@ -1,43 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BarlineAttributes ) - - struct BarlineAttributes : public AttributesInterface - { - public: - BarlineAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - RightLeftMiddle location; - XsToken segno; - XsToken coda; - DivisionsValue divisions; - bool hasLocation; - bool hasSegno; - bool hasCoda; - bool hasDivisions; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Barre.cpp b/Sourcecode/private/mx/core/elements/Barre.cpp deleted file mode 100644 index 494691071..000000000 --- a/Sourcecode/private/mx/core/elements/Barre.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Barre.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Barre::Barre() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Barre::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Barre::hasContents() const { return false; } - std::ostream& Barre::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Barre::streamName( std::ostream& os ) const { os << "barre"; return os; } - std::ostream& Barre::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - BarreAttributesPtr Barre::getAttributes() const - { - return myAttributes; - } - - - void Barre::setAttributes( const BarreAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Barre::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Barre.h b/Sourcecode/private/mx/core/elements/Barre.h deleted file mode 100644 index 8447be667..000000000 --- a/Sourcecode/private/mx/core/elements/Barre.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/BarreAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BarreAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Barre ) - - inline BarrePtr makeBarre() { return std::make_shared(); } - - class Barre : public ElementInterface - { - public: - Barre(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BarreAttributesPtr getAttributes() const; - void setAttributes( const BarreAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BarreAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BarreAttributes.cpp b/Sourcecode/private/mx/core/elements/BarreAttributes.cpp deleted file mode 100644 index 5052fc9ac..000000000 --- a/Sourcecode/private/mx/core/elements/BarreAttributes.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BarreAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BarreAttributes::BarreAttributes() - :type( StartStop::start ) - ,hasType( true ) - {} - - - bool BarreAttributes::hasValues() const - { - return hasType; - } - - - std::ostream& BarreAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool BarreAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "BarreAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BarreAttributes.h b/Sourcecode/private/mx/core/elements/BarreAttributes.h deleted file mode 100644 index 047a7c34a..000000000 --- a/Sourcecode/private/mx/core/elements/BarreAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BarreAttributes ) - - struct BarreAttributes : public AttributesInterface - { - public: - BarreAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - const bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BasePitch.cpp b/Sourcecode/private/mx/core/elements/BasePitch.cpp deleted file mode 100644 index 1d7bdb4bd..000000000 --- a/Sourcecode/private/mx/core/elements/BasePitch.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BasePitch.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BasePitch::BasePitch() : ElementInterface() {} - - - bool BasePitch::hasAttributes() const { return false; } - - - bool BasePitch::hasContents() const { return false; } - std::ostream& BasePitch::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& BasePitch::streamName( std::ostream& os ) const { os << "base-pitch"; return os; } - std::ostream& BasePitch::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool BasePitch::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BasePitch.h b/Sourcecode/private/mx/core/elements/BasePitch.h deleted file mode 100644 index d0d5f2ad0..000000000 --- a/Sourcecode/private/mx/core/elements/BasePitch.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BasePitch ) - - inline BasePitchPtr makeBasePitch() { return std::make_shared(); } - - class BasePitch : public ElementInterface - { - public: - BasePitch(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Bass.cpp b/Sourcecode/private/mx/core/elements/Bass.cpp deleted file mode 100644 index a1fa028ff..000000000 --- a/Sourcecode/private/mx/core/elements/Bass.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Bass.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/BassAlter.h" -#include "mx/core/elements/BassStep.h" -#include - -namespace mx -{ - namespace core - { - Bass::Bass() - :myBassStep( makeBassStep() ) - ,myBassAlter( makeBassAlter() ) - ,myHasBassAlter( false ) - {} - - - bool Bass::hasAttributes() const - { - return false; - } - - - std::ostream& Bass::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Bass::streamName( std::ostream& os ) const - { - os << "bass"; - return os; - } - - - bool Bass::hasContents() const - { - return true; - } - - - std::ostream& Bass::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myBassStep->toStream( os, indentLevel+1 ); - if ( myHasBassAlter ) - { - os << std::endl; - myBassAlter->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - BassStepPtr Bass::getBassStep() const - { - return myBassStep; - } - - - void Bass::setBassStep( const BassStepPtr& value ) - { - if( value ) - { - myBassStep = value; - } - } - - - BassAlterPtr Bass::getBassAlter() const - { - return myBassAlter; - } - - - void Bass::setBassAlter( const BassAlterPtr& value ) - { - if( value ) - { - myBassAlter = value; - } - } - - - bool Bass::getHasBassAlter() const - { - return myHasBassAlter; - } - - - void Bass::setHasBassAlter( const bool value ) - { - myHasBassAlter = value; - } - - - bool Bass::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isBassStepFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myBassStep, isBassStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myBassAlter, myHasBassAlter ) ) { continue; } - } - - if( !isBassStepFound ) - { - message << "Bass: '" << myBassStep->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Bass.h b/Sourcecode/private/mx/core/elements/Bass.h deleted file mode 100644 index 4ac3b7c7d..000000000 --- a/Sourcecode/private/mx/core/elements/Bass.h +++ /dev/null @@ -1,55 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BassAlter ) - MX_FORWARD_DECLARE_ELEMENT( BassStep ) - MX_FORWARD_DECLARE_ELEMENT( Bass ) - - inline BassPtr makeBass() { return std::make_shared(); } - - class Bass : public ElementInterface - { - public: - Bass(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ BassStep minOccurs = 1, maxOccurs = 1 _________ */ - BassStepPtr getBassStep() const; - void setBassStep( const BassStepPtr& value ); - - /* _________ BassAlter minOccurs = 0, maxOccurs = 1 _________ */ - BassAlterPtr getBassAlter() const; - void setBassAlter( const BassAlterPtr& value ); - bool getHasBassAlter() const; - void setHasBassAlter( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BassStepPtr myBassStep; - BassAlterPtr myBassAlter; - bool myHasBassAlter; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BassAlter.cpp b/Sourcecode/private/mx/core/elements/BassAlter.cpp deleted file mode 100644 index 5cc3c69d4..000000000 --- a/Sourcecode/private/mx/core/elements/BassAlter.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BassAlter.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BassAlter::BassAlter() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - BassAlter::BassAlter( const Semitones& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool BassAlter::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool BassAlter::hasContents() const - { - return true; - } - - - std::ostream& BassAlter::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& BassAlter::streamName( std::ostream& os ) const - { - os << "bass-alter"; - return os; - } - - - std::ostream& BassAlter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - BassAlterAttributesPtr BassAlter::getAttributes() const - { - return myAttributes; - } - - - void BassAlter::setAttributes( const BassAlterAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - Semitones BassAlter::getValue() const - { - return myValue; - } - - - void BassAlter::setValue( const Semitones& value ) - { - myValue = value; - } - - - bool BassAlter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BassAlter.h b/Sourcecode/private/mx/core/elements/BassAlter.h deleted file mode 100644 index d635df68c..000000000 --- a/Sourcecode/private/mx/core/elements/BassAlter.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/elements/BassAlterAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BassAlterAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BassAlter ) - - inline BassAlterPtr makeBassAlter() { return std::make_shared(); } - inline BassAlterPtr makeBassAlter( const Semitones& value ) { return std::make_shared( value ); } - inline BassAlterPtr makeBassAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class BassAlter : public ElementInterface - { - public: - BassAlter(); - BassAlter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BassAlterAttributesPtr getAttributes() const; - void setAttributes( const BassAlterAttributesPtr& attributes ); - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - BassAlterAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BassAlterAttributes.cpp b/Sourcecode/private/mx/core/elements/BassAlterAttributes.cpp deleted file mode 100644 index dfb30752c..000000000 --- a/Sourcecode/private/mx/core/elements/BassAlterAttributes.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BassAlterAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BassAlterAttributes::BassAlterAttributes() - :printObject() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,location() - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasLocation( false ) - {} - - - bool BassAlterAttributes::hasValues() const - { - return hasPrintObject || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasLocation; - } - - - std::ostream& BassAlterAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, location, "location", hasLocation ); - } - return os; - } - - - bool BassAlterAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "BassAlterAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, location, hasLocation, "location", &parseLeftRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BassAlterAttributes.h b/Sourcecode/private/mx/core/elements/BassAlterAttributes.h deleted file mode 100644 index 6cea358b1..000000000 --- a/Sourcecode/private/mx/core/elements/BassAlterAttributes.h +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BassAlterAttributes ) - - struct BassAlterAttributes : public AttributesInterface - { - public: - BassAlterAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftRight location; - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasLocation; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BassStep.cpp b/Sourcecode/private/mx/core/elements/BassStep.cpp deleted file mode 100644 index cc511beb6..000000000 --- a/Sourcecode/private/mx/core/elements/BassStep.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BassStep.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BassStep::BassStep() - :myValue( StepEnum::a ) - ,myAttributes( std::make_shared() ) - {} - - - BassStep::BassStep( const StepEnum& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool BassStep::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool BassStep::hasContents() const - { - return true; - } - - - std::ostream& BassStep::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& BassStep::streamName( std::ostream& os ) const - { - os << "bass-step"; - return os; - } - - - std::ostream& BassStep::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - BassStepAttributesPtr BassStep::getAttributes() const - { - return myAttributes; - } - - - void BassStep::setAttributes( const BassStepAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - StepEnum BassStep::getValue() const - { - return myValue; - } - - - void BassStep::setValue( const StepEnum& value ) - { - myValue = value; - } - - - bool BassStep::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseStepEnum( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BassStep.h b/Sourcecode/private/mx/core/elements/BassStep.h deleted file mode 100644 index 058c72ad6..000000000 --- a/Sourcecode/private/mx/core/elements/BassStep.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/BassStepAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BassStepAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BassStep ) - - inline BassStepPtr makeBassStep() { return std::make_shared(); } - inline BassStepPtr makeBassStep( const StepEnum& value ) { return std::make_shared( value ); } - inline BassStepPtr makeBassStep( StepEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class BassStep : public ElementInterface - { - public: - BassStep(); - BassStep( const StepEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BassStepAttributesPtr getAttributes() const; - void setAttributes( const BassStepAttributesPtr& attributes ); - StepEnum getValue() const; - void setValue( const StepEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepEnum myValue; - BassStepAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BassStepAttributes.cpp b/Sourcecode/private/mx/core/elements/BassStepAttributes.cpp deleted file mode 100644 index c55d53cbf..000000000 --- a/Sourcecode/private/mx/core/elements/BassStepAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BassStepAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BassStepAttributes::BassStepAttributes() - :text() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasText( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool BassStepAttributes::hasValues() const - { - return hasText || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& BassStepAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, text, "text", hasText ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool BassStepAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "BassStepAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, text, hasText, "text" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BassStepAttributes.h b/Sourcecode/private/mx/core/elements/BassStepAttributes.h deleted file mode 100644 index 19b77ce46..000000000 --- a/Sourcecode/private/mx/core/elements/BassStepAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BassStepAttributes ) - - struct BassStepAttributes : public AttributesInterface - { - public: - BassStepAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken text; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasText; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Beam.cpp b/Sourcecode/private/mx/core/elements/Beam.cpp deleted file mode 100644 index ecb8937fe..000000000 --- a/Sourcecode/private/mx/core/elements/Beam.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Beam.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Beam::Beam() - :myValue( BeamValue::begin ) - ,myAttributes( std::make_shared() ) - {} - - - Beam::Beam( const BeamValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Beam::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Beam::hasContents() const - { - return true; - } - - - std::ostream& Beam::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Beam::streamName( std::ostream& os ) const - { - os << "beam"; - return os; - } - - - std::ostream& Beam::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - BeamAttributesPtr Beam::getAttributes() const - { - return myAttributes; - } - - - void Beam::setAttributes( const BeamAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - BeamValue Beam::getValue() const - { - return myValue; - } - - - void Beam::setValue( const BeamValue& value ) - { - myValue = value; - } - - - bool Beam::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseBeamValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Beam.h b/Sourcecode/private/mx/core/elements/Beam.h deleted file mode 100644 index b0a8bf64d..000000000 --- a/Sourcecode/private/mx/core/elements/Beam.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/BeamAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BeamAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Beam ) - - inline BeamPtr makeBeam() { return std::make_shared(); } - inline BeamPtr makeBeam( const BeamValue& value ) { return std::make_shared( value ); } - inline BeamPtr makeBeam( BeamValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Beam : public ElementInterface - { - public: - Beam(); - Beam( const BeamValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BeamAttributesPtr getAttributes() const; - void setAttributes( const BeamAttributesPtr& attributes ); - BeamValue getValue() const; - void setValue( const BeamValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BeamValue myValue; - BeamAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BeamAttributes.cpp b/Sourcecode/private/mx/core/elements/BeamAttributes.cpp deleted file mode 100644 index 236b00c42..000000000 --- a/Sourcecode/private/mx/core/elements/BeamAttributes.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BeamAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BeamAttributes::BeamAttributes() - :number( 1 ) - ,repeater() - ,fan() - ,hasNumber( false ) - ,hasRepeater( false ) - ,hasFan( false ) - {} - - - bool BeamAttributes::hasValues() const - { - return hasNumber || - hasRepeater || - hasFan; - } - - - std::ostream& BeamAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, repeater, "repeater", hasRepeater ); - streamAttribute( os, fan, "fan", hasFan ); - } - return os; - } - - - bool BeamAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "BeamAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, repeater, hasRepeater, "repeater", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fan, hasFan, "fan", &parseFan ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BeamAttributes.h b/Sourcecode/private/mx/core/elements/BeamAttributes.h deleted file mode 100644 index ba0b12027..000000000 --- a/Sourcecode/private/mx/core/elements/BeamAttributes.h +++ /dev/null @@ -1,40 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BeamAttributes ) - - struct BeamAttributes : public AttributesInterface - { - public: - BeamAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - BeamLevel number; - YesNo repeater; - Fan fan; - bool hasNumber; - bool hasRepeater; - bool hasFan; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatRepeat.cpp b/Sourcecode/private/mx/core/elements/BeatRepeat.cpp deleted file mode 100644 index 841b6d94b..000000000 --- a/Sourcecode/private/mx/core/elements/BeatRepeat.cpp +++ /dev/null @@ -1,146 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BeatRepeat.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/SlashDot.h" -#include "mx/core/elements/SlashType.h" -#include - -namespace mx -{ - namespace core - { - BeatRepeat::BeatRepeat() - :myAttributes( std::make_shared() ) - ,mySlashType( makeSlashType() ) - ,mySlashDotSet() - {} - - - bool BeatRepeat::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& BeatRepeat::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& BeatRepeat::streamName( std::ostream& os ) const - { - os << "beat-repeat"; - return os; - } - - - bool BeatRepeat::hasContents() const - { - return true; - } - - - std::ostream& BeatRepeat::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - mySlashType->toStream( os, indentLevel+1 ); - for ( auto x : mySlashDotSet ) - { - if ( x ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - os << std::endl; - return os; - } - - - BeatRepeatAttributesPtr BeatRepeat::getAttributes() const - { - return myAttributes; - } - - - void BeatRepeat::setAttributes( const BeatRepeatAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - SlashTypePtr BeatRepeat::getSlashType() const - { - return mySlashType; - } - - - void BeatRepeat::setSlashType( const SlashTypePtr& value ) - { - if( value ) - { - mySlashType = value; - } - } - - - const SlashDotSet& BeatRepeat::getSlashDotSet() const - { - return mySlashDotSet; - } - - - void BeatRepeat::removeSlashDot( const SlashDotSetIterConst& value ) - { - if ( value != mySlashDotSet.cend() ) - { - mySlashDotSet.erase( value ); - } - } - - - void BeatRepeat::addSlashDot( const SlashDotPtr& value ) - { - if ( value ) - { - mySlashDotSet.push_back( value ); - } - } - - - void BeatRepeat::clearSlashDotSet() - { - mySlashDotSet.clear(); - } - - - bool BeatRepeat::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isSlashTypeFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *mySlashType, isSlashTypeFound ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "slash-dot", mySlashDotSet ); - } - - if( !isSlashTypeFound ) - { - message << "BeatRepeat: '" << mySlashType->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatRepeat.h b/Sourcecode/private/mx/core/elements/BeatRepeat.h deleted file mode 100644 index 9b74bd1b3..000000000 --- a/Sourcecode/private/mx/core/elements/BeatRepeat.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/BeatRepeatAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BeatRepeatAttributes ) - MX_FORWARD_DECLARE_ELEMENT( SlashDot ) - MX_FORWARD_DECLARE_ELEMENT( SlashType ) - MX_FORWARD_DECLARE_ELEMENT( BeatRepeat ) - - inline BeatRepeatPtr makeBeatRepeat() { return std::make_shared(); } - - class BeatRepeat : public ElementInterface - { - public: - BeatRepeat(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BeatRepeatAttributesPtr getAttributes() const; - void setAttributes( const BeatRepeatAttributesPtr& value ); - - /* _________ SlashType minOccurs = 1, maxOccurs = 1 _________ */ - SlashTypePtr getSlashType() const; - void setSlashType( const SlashTypePtr& value ); - - /* _________ SlashDot minOccurs = 0, maxOccurs = unbounded _________ */ - const SlashDotSet& getSlashDotSet() const; - void addSlashDot( const SlashDotPtr& value ); - void removeSlashDot( const SlashDotSetIterConst& value ); - void clearSlashDotSet(); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BeatRepeatAttributesPtr myAttributes; - SlashTypePtr mySlashType; - SlashDotSet mySlashDotSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.cpp b/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.cpp deleted file mode 100644 index 19697ef6b..000000000 --- a/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BeatRepeatAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BeatRepeatAttributes::BeatRepeatAttributes() - :type( StartStop::start ) - ,slashes( 1 ) - ,useDots( YesNo::no ) - ,hasType( true ) - ,hasSlashes( false ) - ,hasUseDots( false ) - {} - - - bool BeatRepeatAttributes::hasValues() const - { - return hasType || - hasSlashes || - hasUseDots; - } - - - std::ostream& BeatRepeatAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, slashes, "slashes", hasSlashes ); - streamAttribute( os, useDots, "use-dots", hasUseDots ); - } - return os; - } - - - bool BeatRepeatAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "BeatRepeatAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, slashes, hasSlashes, "slashes" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, useDots, hasUseDots, "use-dots", &parseYesNo ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.h b/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.h deleted file mode 100644 index e10335668..000000000 --- a/Sourcecode/private/mx/core/elements/BeatRepeatAttributes.h +++ /dev/null @@ -1,40 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BeatRepeatAttributes ) - - struct BeatRepeatAttributes : public AttributesInterface - { - public: - BeatRepeatAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - PositiveInteger slashes; - YesNo useDots; - const bool hasType; - bool hasSlashes; - bool hasUseDots; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatType.cpp b/Sourcecode/private/mx/core/elements/BeatType.cpp deleted file mode 100644 index 1a0117d9f..000000000 --- a/Sourcecode/private/mx/core/elements/BeatType.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BeatType.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BeatType::BeatType() - :myValue() - {} - - - BeatType::BeatType( const XsString& value ) - :myValue( value ) - {} - - - bool BeatType::hasAttributes() const - { - return false; - } - - - bool BeatType::hasContents() const - { - return true; - } - - - std::ostream& BeatType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BeatType::streamName( std::ostream& os ) const - { - os << "beat-type"; - return os; - } - - - std::ostream& BeatType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString BeatType::getValue() const - { - return myValue; - } - - - void BeatType::setValue( const XsString& value ) - { - myValue = value; - } - - - bool BeatType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatType.h b/Sourcecode/private/mx/core/elements/BeatType.h deleted file mode 100644 index f539026a5..000000000 --- a/Sourcecode/private/mx/core/elements/BeatType.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatType ) - - inline BeatTypePtr makeBeatType() { return std::make_shared(); } - inline BeatTypePtr makeBeatType( const XsString& value ) { return std::make_shared( value ); } - inline BeatTypePtr makeBeatType( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class BeatType : public ElementInterface - { - public: - BeatType(); - BeatType( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatUnit.cpp b/Sourcecode/private/mx/core/elements/BeatUnit.cpp deleted file mode 100644 index 447b61414..000000000 --- a/Sourcecode/private/mx/core/elements/BeatUnit.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BeatUnit.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BeatUnit::BeatUnit() - :myValue( NoteTypeValue::eighth ) - {} - - - BeatUnit::BeatUnit( const NoteTypeValue& value ) - :myValue( value ) - {} - - - bool BeatUnit::hasAttributes() const - { - return false; - } - - - bool BeatUnit::hasContents() const - { - return true; - } - - - std::ostream& BeatUnit::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BeatUnit::streamName( std::ostream& os ) const - { - os << "beat-unit"; - return os; - } - - - std::ostream& BeatUnit::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NoteTypeValue BeatUnit::getValue() const - { - return myValue; - } - - - void BeatUnit::setValue( const NoteTypeValue& value ) - { - myValue = value; - } - - - bool BeatUnit::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseNoteTypeValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatUnit.h b/Sourcecode/private/mx/core/elements/BeatUnit.h deleted file mode 100644 index 303f7e086..000000000 --- a/Sourcecode/private/mx/core/elements/BeatUnit.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatUnit ) - - inline BeatUnitPtr makeBeatUnit() { return std::make_shared(); } - inline BeatUnitPtr makeBeatUnit( const NoteTypeValue& value ) { return std::make_shared( value ); } - inline BeatUnitPtr makeBeatUnit( NoteTypeValue&& value ) { return std::make_shared( std::move( value ) ); } - - class BeatUnit : public ElementInterface - { - public: - BeatUnit(); - BeatUnit( const NoteTypeValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteTypeValue getValue() const; - void setValue( const NoteTypeValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NoteTypeValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatUnitDot.cpp b/Sourcecode/private/mx/core/elements/BeatUnitDot.cpp deleted file mode 100644 index c1809da03..000000000 --- a/Sourcecode/private/mx/core/elements/BeatUnitDot.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BeatUnitDot.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BeatUnitDot::BeatUnitDot() : ElementInterface() {} - - - bool BeatUnitDot::hasAttributes() const { return false; } - - - bool BeatUnitDot::hasContents() const { return false; } - std::ostream& BeatUnitDot::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& BeatUnitDot::streamName( std::ostream& os ) const { os << "beat-unit-dot"; return os; } - std::ostream& BeatUnitDot::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool BeatUnitDot::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatUnitDot.h b/Sourcecode/private/mx/core/elements/BeatUnitDot.h deleted file mode 100644 index 413954739..000000000 --- a/Sourcecode/private/mx/core/elements/BeatUnitDot.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatUnitDot ) - - inline BeatUnitDotPtr makeBeatUnitDot() { return std::make_shared(); } - - class BeatUnitDot : public ElementInterface - { - public: - BeatUnitDot(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatUnitGroup.cpp b/Sourcecode/private/mx/core/elements/BeatUnitGroup.cpp deleted file mode 100644 index 233ed5d33..000000000 --- a/Sourcecode/private/mx/core/elements/BeatUnitGroup.cpp +++ /dev/null @@ -1,147 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BeatUnitGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/BeatUnit.h" -#include "mx/core/elements/BeatUnitDot.h" -#include - -namespace mx -{ - namespace core - { - BeatUnitGroup::BeatUnitGroup() - :myBeatUnit( makeBeatUnit() ) - ,myBeatUnitDotSet() - {} - - - bool BeatUnitGroup::hasAttributes() const - { - return false; - } - - - std::ostream& BeatUnitGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BeatUnitGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool BeatUnitGroup::hasContents() const - { - return true; - } - - - std::ostream& BeatUnitGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - myBeatUnit->toStream( os, indentLevel ); - for ( auto x : myBeatUnitDotSet ) - { - os << std::endl; - x->toStream( os, indentLevel ); - } - return os; - } - - - BeatUnitPtr BeatUnitGroup::getBeatUnit() const - { - return myBeatUnit; - } - - - void BeatUnitGroup::setBeatUnit( const BeatUnitPtr& value ) - { - if ( value ) - { - myBeatUnit = value; - } - } - - - const BeatUnitDotSet& BeatUnitGroup::getBeatUnitDotSet() const - { - return myBeatUnitDotSet; - } - - - void BeatUnitGroup::addBeatUnitDot( const BeatUnitDotPtr& value ) - { - if ( value ) - { - myBeatUnitDotSet.push_back( value ); - } - } - - - void BeatUnitGroup::removeBeatUnitDot( const BeatUnitDotSetIterConst& setIterator ) - { - if ( setIterator != myBeatUnitDotSet.cend() ) - { - myBeatUnitDotSet.erase( setIterator ); - } - } - - - void BeatUnitGroup::clearBeatUnitDotSet() - { - myBeatUnitDotSet.clear(); - } - - bool BeatUnitGroup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isBeatUnitFound = false; - bool isFirstBeatUnitDotAdded = false; - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - const std::string elementName = it->getName(); - - if( elementName == "beat-unit" ) - { - isBeatUnitFound = true; - isSuccess &= myBeatUnit->fromXElement( message, *it ); - } - else if( elementName == "beat-unit-dot" ) - { - auto beatUnitDot = makeBeatUnitDot(); - isSuccess &= beatUnitDot->fromXElement( message, *it ); - - if( !isFirstBeatUnitDotAdded && myBeatUnitDotSet.size() == 1 ) - { - *( myBeatUnitDotSet.begin() ) = beatUnitDot; - isFirstBeatUnitDotAdded = true; - } - else - { - myBeatUnitDotSet.push_back( beatUnitDot ); - isFirstBeatUnitDotAdded = true; - } - } - else - { - if( !isBeatUnitFound ) - { - isSuccess = false; - message << "BeatUnitGroup: 'beat-unit' element is required but was not found" << std::endl; - } - break; - } - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatUnitGroup.h b/Sourcecode/private/mx/core/elements/BeatUnitGroup.h deleted file mode 100644 index 7dfca15c2..000000000 --- a/Sourcecode/private/mx/core/elements/BeatUnitGroup.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatUnit ) - MX_FORWARD_DECLARE_ELEMENT( BeatUnitDot ) - MX_FORWARD_DECLARE_ELEMENT( BeatUnitGroup ) - - inline BeatUnitGroupPtr makeBeatUnitGroup() { return std::make_shared(); } - - class BeatUnitGroup : public ElementInterface - { - public: - BeatUnitGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ BeatUnit minOccurs = 1, maxOccurs = 1 _________ */ - BeatUnitPtr getBeatUnit() const; - void setBeatUnit( const BeatUnitPtr& value ); - - /* _________ BeatUnitDot minOccurs = 0, maxOccurs = unbounded _________ */ - const BeatUnitDotSet& getBeatUnitDotSet() const; - void addBeatUnitDot( const BeatUnitDotPtr& value ); - void removeBeatUnitDot( const BeatUnitDotSetIterConst& setIterator ); - void clearBeatUnitDotSet(); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BeatUnitPtr myBeatUnit; - BeatUnitDotSet myBeatUnitDotSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatUnitPer.cpp b/Sourcecode/private/mx/core/elements/BeatUnitPer.cpp deleted file mode 100644 index 6d6046a0c..000000000 --- a/Sourcecode/private/mx/core/elements/BeatUnitPer.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BeatUnitPer.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/BeatUnitGroup.h" -#include "mx/core/elements/PerMinuteOrBeatUnitChoice.h" -#include - -namespace mx -{ - namespace core - { - BeatUnitPer::BeatUnitPer() - :myBeatUnitGroup( makeBeatUnitGroup() ) - ,myPerMinuteOrBeatUnitChoice( makePerMinuteOrBeatUnitChoice() ) - {} - - - bool BeatUnitPer::hasAttributes() const - { - return false; - } - - - std::ostream& BeatUnitPer::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BeatUnitPer::streamName( std::ostream& os ) const - { - return os; - } - - - bool BeatUnitPer::hasContents() const - { - return true; - } - - - std::ostream& BeatUnitPer::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - myBeatUnitGroup->streamContents( os, indentLevel, isOneLineOnly ); - os << std::endl; - myPerMinuteOrBeatUnitChoice->streamContents( os, indentLevel, isOneLineOnly ); - isOneLineOnly = false; - return os; - } - - - BeatUnitGroupPtr BeatUnitPer::getBeatUnitGroup() const - { - return myBeatUnitGroup; - } - - - void BeatUnitPer::setBeatUnitGroup( const BeatUnitGroupPtr& value ) - { - if ( value ) - { - myBeatUnitGroup = value; - } - } - - - PerMinuteOrBeatUnitChoicePtr BeatUnitPer::getPerMinuteOrBeatUnitChoice() const - { - return myPerMinuteOrBeatUnitChoice; - } - - - void BeatUnitPer::setPerMinuteOtBeatUnitChoice( const PerMinuteOrBeatUnitChoicePtr& value ) - { - if ( value ) - { - myPerMinuteOrBeatUnitChoice = value; - } - } - - - bool BeatUnitPer::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importGroup( message, it, endIter, isSuccess, myBeatUnitGroup ); - if( it->getName() == "beat-unit-per" || it->getName() == "note-relation-note" ) - { - isSuccess &= myPerMinuteOrBeatUnitChoice->fromXElement( message, *it ); - } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatUnitPer.h b/Sourcecode/private/mx/core/elements/BeatUnitPer.h deleted file mode 100644 index e503aafcd..000000000 --- a/Sourcecode/private/mx/core/elements/BeatUnitPer.h +++ /dev/null @@ -1,48 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatUnitGroup ) - MX_FORWARD_DECLARE_ELEMENT( PerMinuteOrBeatUnitChoice ) - MX_FORWARD_DECLARE_ELEMENT( BeatUnitPer ) - - inline BeatUnitPerPtr makeBeatUnitPer() { return std::make_shared(); } - - class BeatUnitPer : public ElementInterface - { - public: - BeatUnitPer(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BeatUnitGroupPtr getBeatUnitGroup() const; - void setBeatUnitGroup( const BeatUnitGroupPtr& value ); - PerMinuteOrBeatUnitChoicePtr getPerMinuteOrBeatUnitChoice() const; - void setPerMinuteOtBeatUnitChoice( const PerMinuteOrBeatUnitChoicePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BeatUnitGroupPtr myBeatUnitGroup; - PerMinuteOrBeatUnitChoicePtr myPerMinuteOrBeatUnitChoice; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.cpp b/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.cpp deleted file mode 100644 index 6dee9d594..000000000 --- a/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/BeatUnitPer.h" -#include "mx/core/elements/NoteRelationNote.h" -#include - -namespace mx -{ - namespace core - { - BeatUnitPerOrNoteRelationNoteChoice::BeatUnitPerOrNoteRelationNoteChoice() - :myChoice( Choice::beatUnitPer ) - ,myBeatUnitPer( makeBeatUnitPer() ) - ,myNoteRelationNote( makeNoteRelationNote() ) - {} - - - bool BeatUnitPerOrNoteRelationNoteChoice::hasAttributes() const - { - return false; - } - - - std::ostream& BeatUnitPerOrNoteRelationNoteChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BeatUnitPerOrNoteRelationNoteChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool BeatUnitPerOrNoteRelationNoteChoice::hasContents() const - { - return true; - } - - - std::ostream& BeatUnitPerOrNoteRelationNoteChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::beatUnitPer: - { - myBeatUnitPer->streamContents( os, indentLevel, isOneLineOnly ); - } - break; - case Choice::noteRelationNote: - { - myNoteRelationNote->streamContents( os, indentLevel, isOneLineOnly ); - } - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - BeatUnitPerOrNoteRelationNoteChoice::Choice BeatUnitPerOrNoteRelationNoteChoice::getChoice() const - { - return myChoice; - } - - - void BeatUnitPerOrNoteRelationNoteChoice::setChoice( const BeatUnitPerOrNoteRelationNoteChoice::Choice value ) - { - myChoice = value; - } - - - BeatUnitPerPtr BeatUnitPerOrNoteRelationNoteChoice::getBeatUnitPer() const - { - return myBeatUnitPer; - } - - - void BeatUnitPerOrNoteRelationNoteChoice::setBeatUnitPer( const BeatUnitPerPtr& value ) - { - if ( value ) - { - myBeatUnitPer = value; - } - } - - - NoteRelationNotePtr BeatUnitPerOrNoteRelationNoteChoice::getNoteRelationNote() const - { - return myNoteRelationNote; - } - - - void BeatUnitPerOrNoteRelationNoteChoice::setNoteRelationNote( const NoteRelationNotePtr& value ) - { - myNoteRelationNote = value; - } - - - bool BeatUnitPerOrNoteRelationNoteChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_CHOICE_IF( beatUnitPer, "beat-unit-per", BeatUnitPer ); - MX_CHOICE_IF( noteRelationNote, "note-relation-note", NoteRelationNote ); - MX_BAD_ELEMENT_FAILURE( BeatUnitPerOrNoteRelationNoteChoice ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h b/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h deleted file mode 100644 index de6980b15..000000000 --- a/Sourcecode/private/mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatUnitPer ) - MX_FORWARD_DECLARE_ELEMENT( NoteRelationNote ) - MX_FORWARD_DECLARE_ELEMENT( BeatUnitPerOrNoteRelationNoteChoice ) - - inline BeatUnitPerOrNoteRelationNoteChoicePtr makeBeatUnitPerOrNoteRelationNoteChoice() { return std::make_shared(); } - - class BeatUnitPerOrNoteRelationNoteChoice : public ElementInterface - { - public: - enum class Choice - { - beatUnitPer = 0, - noteRelationNote = 1 - }; - BeatUnitPerOrNoteRelationNoteChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BeatUnitPerOrNoteRelationNoteChoice::Choice getChoice() const; - void setChoice( const BeatUnitPerOrNoteRelationNoteChoice::Choice value ); - BeatUnitPerPtr getBeatUnitPer() const; - void setBeatUnitPer( const BeatUnitPerPtr& value ); - NoteRelationNotePtr getNoteRelationNote() const; - void setNoteRelationNote( const NoteRelationNotePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - BeatUnitPerPtr myBeatUnitPer; - NoteRelationNotePtr myNoteRelationNote; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Beater.cpp b/Sourcecode/private/mx/core/elements/Beater.cpp deleted file mode 100644 index 7341a60d4..000000000 --- a/Sourcecode/private/mx/core/elements/Beater.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Beater.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Beater::Beater() - :myValue( BeaterValue::snareStick ) - ,myAttributes( std::make_shared() ) - {} - - - Beater::Beater( const BeaterValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Beater::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Beater::hasContents() const - { - return true; - } - - - std::ostream& Beater::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Beater::streamName( std::ostream& os ) const - { - os << "beater"; - return os; - } - - - std::ostream& Beater::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - BeaterAttributesPtr Beater::getAttributes() const - { - return myAttributes; - } - - - void Beater::setAttributes( const BeaterAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - BeaterValue Beater::getValue() const - { - return myValue; - } - - - void Beater::setValue( const BeaterValue& value ) - { - myValue = value; - } - - - bool Beater::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseBeaterValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Beater.h b/Sourcecode/private/mx/core/elements/Beater.h deleted file mode 100644 index 2340150cd..000000000 --- a/Sourcecode/private/mx/core/elements/Beater.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/BeaterAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BeaterAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Beater ) - - inline BeaterPtr makeBeater() { return std::make_shared(); } - inline BeaterPtr makeBeater( const BeaterValue& value ) { return std::make_shared( value ); } - inline BeaterPtr makeBeater( BeaterValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Beater : public ElementInterface - { - public: - Beater(); - Beater( const BeaterValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BeaterAttributesPtr getAttributes() const; - void setAttributes( const BeaterAttributesPtr& attributes ); - BeaterValue getValue() const; - void setValue( const BeaterValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BeaterValue myValue; - BeaterAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BeaterAttributes.cpp b/Sourcecode/private/mx/core/elements/BeaterAttributes.cpp deleted file mode 100644 index ca96c39d1..000000000 --- a/Sourcecode/private/mx/core/elements/BeaterAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BeaterAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BeaterAttributes::BeaterAttributes() - :tip() - ,hasTip( false ) - {} - - - bool BeaterAttributes::hasValues() const - { - return hasTip; - } - - - std::ostream& BeaterAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, tip, "tip", hasTip ); - } - return os; - } - - - bool BeaterAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "BeaterAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, tip, hasTip, "tip", &parseTipDirection ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BeaterAttributes.h b/Sourcecode/private/mx/core/elements/BeaterAttributes.h deleted file mode 100644 index 18d78a099..000000000 --- a/Sourcecode/private/mx/core/elements/BeaterAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BeaterAttributes ) - - struct BeaterAttributes : public AttributesInterface - { - public: - BeaterAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TipDirection tip; - bool hasTip; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Beats.cpp b/Sourcecode/private/mx/core/elements/Beats.cpp deleted file mode 100644 index 76f1db1b8..000000000 --- a/Sourcecode/private/mx/core/elements/Beats.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Beats.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Beats::Beats() - :myValue() - {} - - - Beats::Beats( const XsString& value ) - :myValue( value ) - {} - - - bool Beats::hasAttributes() const - { - return false; - } - - - bool Beats::hasContents() const - { - return true; - } - - - std::ostream& Beats::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Beats::streamName( std::ostream& os ) const - { - os << "beats"; - return os; - } - - - std::ostream& Beats::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString Beats::getValue() const - { - return myValue; - } - - - void Beats::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Beats::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Beats.h b/Sourcecode/private/mx/core/elements/Beats.h deleted file mode 100644 index 0305e4fe1..000000000 --- a/Sourcecode/private/mx/core/elements/Beats.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Beats ) - - inline BeatsPtr makeBeats() { return std::make_shared(); } - inline BeatsPtr makeBeats( const XsString& value ) { return std::make_shared( value ); } - inline BeatsPtr makeBeats( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Beats : public ElementInterface - { - public: - Beats(); - Beats( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Bend.cpp b/Sourcecode/private/mx/core/elements/Bend.cpp deleted file mode 100644 index 752e82e89..000000000 --- a/Sourcecode/private/mx/core/elements/Bend.cpp +++ /dev/null @@ -1,191 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Bend.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/BendAlter.h" -#include "mx/core/elements/BendChoice.h" -#include "mx/core/elements/PreBend.h" -#include "mx/core/elements/Release.h" -#include "mx/core/elements/WithBar.h" -#include - -namespace mx -{ - namespace core - { - Bend::Bend() - :myAttributes( std::make_shared() ) - ,myBendAlter( makeBendAlter() ) - ,myBendChoice( makeBendChoice() ) - ,myHasBendChoice( false ) - ,myWithBar( makeWithBar() ) - ,myHasWithBar( false ) - {} - - - bool Bend::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Bend::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Bend::streamName( std::ostream& os ) const - { - os << "bend"; - return os; - } - - - bool Bend::hasContents() const - { - return true; - } - - - std::ostream& Bend::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myBendAlter->toStream( os, indentLevel+1 ); - - if( myHasBendChoice ) - { - os << std::endl; - myBendChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - } - - if ( myHasWithBar ) - { - os << std::endl; - myWithBar->toStream( os, indentLevel+1 ); - } - - os << std::endl; - isOneLineOnly = false; - return os; - } - - - BendAttributesPtr Bend::getAttributes() const - { - return myAttributes; - } - - - void Bend::setAttributes( const BendAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - BendAlterPtr Bend::getBendAlter() const - { - return myBendAlter; - } - - - void Bend::setBendAlter( const BendAlterPtr& value ) - { - if( value ) - { - myBendAlter = value; - } - } - - - BendChoicePtr Bend::getBendChoice() const - { - return myBendChoice; - } - - - void Bend::setBendChoice( const BendChoicePtr& value ) - { - if ( value ) - { - myBendChoice = value; - } - } - - - bool Bend::getHasBendChoice() const - { - return myHasBendChoice; - } - - - void Bend::setHasBendChoice( const bool value ) - { - myHasBendChoice = value; - } - - - - WithBarPtr Bend::getWithBar() const - { - return myWithBar; - } - - - void Bend::setWithBar( const WithBarPtr& value ) - { - if( value ) - { - myWithBar = value; - } - } - - - bool Bend::getHasWithBar() const - { - return myHasWithBar; - } - - - void Bend::setHasWithBar( const bool value ) - { - myHasWithBar = value; - } - - - bool Bend::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isBendAlterFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myBendAlter, isBendAlterFound ) ) { continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, myBendChoice, - "pre-bend", &BendChoice::getPreBend, - static_cast( BendChoice::Choice::preBend ) ) ) - { myHasBendChoice = true; continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, myBendChoice, - "release", &BendChoice::getRelease, - static_cast( BendChoice::Choice::release ) ) ) - { myHasBendChoice = true; continue; } - - if ( importElement( message, *it, isSuccess, *myWithBar, myHasWithBar ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Bend.h b/Sourcecode/private/mx/core/elements/Bend.h deleted file mode 100644 index b65a792f9..000000000 --- a/Sourcecode/private/mx/core/elements/Bend.h +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/BendAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BendAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BendAlter ) - MX_FORWARD_DECLARE_ELEMENT( BendChoice ) - MX_FORWARD_DECLARE_ELEMENT( WithBar ) - MX_FORWARD_DECLARE_ELEMENT( Bend ) - - inline BendPtr makeBend() { return std::make_shared(); } - - class Bend : public ElementInterface - { - public: - Bend(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BendAttributesPtr getAttributes() const; - void setAttributes( const BendAttributesPtr& value ); - - /* _________ BendAlter minOccurs = 1, maxOccurs = 1 _________ */ - BendAlterPtr getBendAlter() const; - void setBendAlter( const BendAlterPtr& value ); - - /* _________ BendChoice minOccurs = 0, maxOccurs = 1 _________ */ - BendChoicePtr getBendChoice() const; - void setBendChoice( const BendChoicePtr& value ); - bool getHasBendChoice() const; - void setHasBendChoice( const bool value ); - - /* _________ WithBar minOccurs = 0, maxOccurs = 1 _________ */ - WithBarPtr getWithBar() const; - void setWithBar( const WithBarPtr& value ); - bool getHasWithBar() const; - void setHasWithBar( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BendAttributesPtr myAttributes; - BendAlterPtr myBendAlter; - BendChoicePtr myBendChoice; - bool myHasBendChoice; - WithBarPtr myWithBar; - bool myHasWithBar; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BendAlter.cpp b/Sourcecode/private/mx/core/elements/BendAlter.cpp deleted file mode 100644 index 415542d24..000000000 --- a/Sourcecode/private/mx/core/elements/BendAlter.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BendAlter.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BendAlter::BendAlter() - :myValue() - {} - - - BendAlter::BendAlter( const Semitones& value ) - :myValue( value ) - {} - - - bool BendAlter::hasAttributes() const - { - return false; - } - - - bool BendAlter::hasContents() const - { - return true; - } - - - std::ostream& BendAlter::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BendAlter::streamName( std::ostream& os ) const - { - os << "bend-alter"; - return os; - } - - - std::ostream& BendAlter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Semitones BendAlter::getValue() const - { - return myValue; - } - - - void BendAlter::setValue( const Semitones& value ) - { - myValue = value; - } - - - bool BendAlter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BendAlter.h b/Sourcecode/private/mx/core/elements/BendAlter.h deleted file mode 100644 index 7f6cdafe5..000000000 --- a/Sourcecode/private/mx/core/elements/BendAlter.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BendAlter ) - - inline BendAlterPtr makeBendAlter() { return std::make_shared(); } - inline BendAlterPtr makeBendAlter( const Semitones& value ) { return std::make_shared( value ); } - inline BendAlterPtr makeBendAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class BendAlter : public ElementInterface - { - public: - BendAlter(); - BendAlter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BendAttributes.cpp b/Sourcecode/private/mx/core/elements/BendAttributes.cpp deleted file mode 100644 index 7ae010823..000000000 --- a/Sourcecode/private/mx/core/elements/BendAttributes.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BendAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BendAttributes::BendAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,accelerate( YesNo::no ) - ,beats() - ,firstBeat() - ,lastBeat() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasFirstBeat( false ) - ,hasLastBeat( false ) - {} - - - bool BendAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasAccelerate || - hasBeats || - hasFirstBeat || - hasLastBeat; - } - - - std::ostream& BendAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, firstBeat, "first-beat", hasFirstBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - } - return os; - } - - - bool BendAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "BendAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, firstBeat, hasFirstBeat, "first-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BendAttributes.h b/Sourcecode/private/mx/core/elements/BendAttributes.h deleted file mode 100644 index 407602fcd..000000000 --- a/Sourcecode/private/mx/core/elements/BendAttributes.h +++ /dev/null @@ -1,63 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BendAttributes ) - - struct BendAttributes : public AttributesInterface - { - public: - BendAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - YesNo accelerate; - TrillBeats beats; - Percent firstBeat; - Percent lastBeat; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasAccelerate; - bool hasBeats; - bool hasFirstBeat; - bool hasLastBeat; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BendChoice.cpp b/Sourcecode/private/mx/core/elements/BendChoice.cpp deleted file mode 100644 index cdf43e71b..000000000 --- a/Sourcecode/private/mx/core/elements/BendChoice.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BendChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/PreBend.h" -#include "mx/core/elements/Release.h" -#include - -namespace mx -{ - namespace core - { - BendChoice::BendChoice() - :myChoice( Choice::preBend ) - ,myPreBend( makePreBend() ) - ,myRelease( makeRelease() ) - {} - - - bool BendChoice::hasAttributes() const - { - return false; - } - - - std::ostream& BendChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BendChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool BendChoice::hasContents() const - { - return true; - } - - - std::ostream& BendChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( isOneLineOnly ); - switch ( myChoice ) - { - case Choice::preBend: - { - myPreBend->toStream( os, indentLevel ); - } - break; - case Choice::release: - { - myRelease->toStream( os, indentLevel ); - } - break; - default: - break; - } - return os; - } - - - BendChoice::Choice BendChoice::getChoice() const - { - return myChoice; - } - - - void BendChoice::setChoice( BendChoice::Choice value ) - { - myChoice = value; - } - - - PreBendPtr BendChoice::getPreBend() const - { - return myPreBend; - } - - - void BendChoice::setPreBend( const PreBendPtr& value ) - { - if ( value ) - { - myPreBend = value; - } - } - - - ReleasePtr BendChoice::getRelease() const - { - return myRelease; - } - - - void BendChoice::setRelease( const ReleasePtr& value ) - { - if ( value ) - { - myRelease = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( BendChoice ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/BendChoice.h b/Sourcecode/private/mx/core/elements/BendChoice.h deleted file mode 100644 index 2efc63f3d..000000000 --- a/Sourcecode/private/mx/core/elements/BendChoice.h +++ /dev/null @@ -1,60 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PreBend ) - MX_FORWARD_DECLARE_ELEMENT( Release ) - MX_FORWARD_DECLARE_ELEMENT( BendChoice ) - - inline BendChoicePtr makeBendChoice() { return std::make_shared(); } - - class BendChoice : public ElementInterface - { - public: - enum class Choice - { - preBend = 1, - release = 2 - }; - BendChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BendChoice::Choice getChoice() const; - void setChoice( BendChoice::Choice value ); - - /* _________ PreBend minOccurs = 1, maxOccurs = 1 _________ */ - PreBendPtr getPreBend() const; - void setPreBend( const PreBendPtr& value ); - - /* _________ Release minOccurs = 1, maxOccurs = 1 _________ */ - ReleasePtr getRelease() const; - void setRelease( const ReleasePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - PreBendPtr myPreBend; - ReleasePtr myRelease; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Bookmark.cpp b/Sourcecode/private/mx/core/elements/Bookmark.cpp deleted file mode 100644 index 01d77ba79..000000000 --- a/Sourcecode/private/mx/core/elements/Bookmark.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Bookmark.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Bookmark::Bookmark() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Bookmark::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Bookmark::hasContents() const { return false; } - std::ostream& Bookmark::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Bookmark::streamName( std::ostream& os ) const { os << "bookmark"; return os; } - std::ostream& Bookmark::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - BookmarkAttributesPtr Bookmark::getAttributes() const - { - return myAttributes; - } - - - void Bookmark::setAttributes( const BookmarkAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Bookmark::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Bookmark.h b/Sourcecode/private/mx/core/elements/Bookmark.h deleted file mode 100644 index b99dbf27b..000000000 --- a/Sourcecode/private/mx/core/elements/Bookmark.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/BookmarkAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BookmarkAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Bookmark ) - - inline BookmarkPtr makeBookmark() { return std::make_shared(); } - - class Bookmark : public ElementInterface - { - public: - Bookmark(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BookmarkAttributesPtr getAttributes() const; - void setAttributes( const BookmarkAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BookmarkAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BookmarkAttributes.cpp b/Sourcecode/private/mx/core/elements/BookmarkAttributes.cpp deleted file mode 100644 index a3490808c..000000000 --- a/Sourcecode/private/mx/core/elements/BookmarkAttributes.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BookmarkAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BookmarkAttributes::BookmarkAttributes() - :id() - ,name() - ,element() - ,position() - ,hasId( true ) - ,hasName( false ) - ,hasElement( false ) - ,hasPosition( false ) - {} - - - bool BookmarkAttributes::hasValues() const - { - return hasId || - hasName || - hasElement || - hasPosition; - } - - - std::ostream& BookmarkAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - streamAttribute( os, name, "name", hasName ); - streamAttribute( os, element, "element", hasElement ); - streamAttribute( os, position, "position", hasPosition ); - } - return os; - } - - - bool BookmarkAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "BookmarkAttributes"; - bool isSuccess = true; - bool isIdFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, isIdFound, "id" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, name, hasName, "name" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, element, hasElement, "element" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, position, hasPosition, "position" ) ) { continue; } - } - - if( !isIdFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BookmarkAttributes.h b/Sourcecode/private/mx/core/elements/BookmarkAttributes.h deleted file mode 100644 index 3ff5eb037..000000000 --- a/Sourcecode/private/mx/core/elements/BookmarkAttributes.h +++ /dev/null @@ -1,43 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Integers.h" -#include "mx/core/XsID.h" -#include "mx/core/XsNMToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BookmarkAttributes ) - - struct BookmarkAttributes : public AttributesInterface - { - public: - BookmarkAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsID id; - XsToken name; - XsNMToken element; - PositiveInteger position; - const bool hasId; - bool hasName; - bool hasElement; - bool hasPosition; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BottomMargin.cpp b/Sourcecode/private/mx/core/elements/BottomMargin.cpp deleted file mode 100644 index 5abf2e5d8..000000000 --- a/Sourcecode/private/mx/core/elements/BottomMargin.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BottomMargin.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BottomMargin::BottomMargin() - :myValue() - {} - - - BottomMargin::BottomMargin( const TenthsValue& value ) - :myValue( value ) - {} - - - bool BottomMargin::hasAttributes() const - { - return false; - } - - - bool BottomMargin::hasContents() const - { - return true; - } - - - std::ostream& BottomMargin::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& BottomMargin::streamName( std::ostream& os ) const - { - os << "bottom-margin"; - return os; - } - - - std::ostream& BottomMargin::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - TenthsValue BottomMargin::getValue() const - { - return myValue; - } - - - void BottomMargin::setValue( const TenthsValue& value ) - { - myValue = value; - } - - - bool BottomMargin::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BottomMargin.h b/Sourcecode/private/mx/core/elements/BottomMargin.h deleted file mode 100644 index 1fc2eb0b6..000000000 --- a/Sourcecode/private/mx/core/elements/BottomMargin.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BottomMargin ) - - inline BottomMarginPtr makeBottomMargin() { return std::make_shared(); } - inline BottomMarginPtr makeBottomMargin( const TenthsValue& value ) { return std::make_shared( value ); } - inline BottomMarginPtr makeBottomMargin( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class BottomMargin : public ElementInterface - { - public: - BottomMargin(); - BottomMargin( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Bracket.cpp b/Sourcecode/private/mx/core/elements/Bracket.cpp deleted file mode 100644 index 40ccdc0b3..000000000 --- a/Sourcecode/private/mx/core/elements/Bracket.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Bracket.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Bracket::Bracket() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Bracket::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Bracket::hasContents() const { return false; } - std::ostream& Bracket::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Bracket::streamName( std::ostream& os ) const { os << "bracket"; return os; } - std::ostream& Bracket::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - BracketAttributesPtr Bracket::getAttributes() const - { - return myAttributes; - } - - - void Bracket::setAttributes( const BracketAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Bracket::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Bracket.h b/Sourcecode/private/mx/core/elements/Bracket.h deleted file mode 100644 index 8f2aff7f0..000000000 --- a/Sourcecode/private/mx/core/elements/Bracket.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/BracketAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BracketAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Bracket ) - - inline BracketPtr makeBracket() { return std::make_shared(); } - - class Bracket : public ElementInterface - { - public: - Bracket(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BracketAttributesPtr getAttributes() const; - void setAttributes( const BracketAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BracketAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BracketAttributes.cpp b/Sourcecode/private/mx/core/elements/BracketAttributes.cpp deleted file mode 100644 index 5bd4d456d..000000000 --- a/Sourcecode/private/mx/core/elements/BracketAttributes.cpp +++ /dev/null @@ -1,100 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BracketAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BracketAttributes::BracketAttributes() - :type() - ,number() - ,lineEnd( LineEnd::down ) - ,endLength() - ,lineType() - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,color() - ,hasType( true ) - ,hasNumber( false ) - ,hasLineEnd( true ) - ,hasEndLength( false ) - ,hasLineType( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasColor( false ) - {} - - - bool BracketAttributes::hasValues() const - { - return hasType || hasLineEnd; - } - - - std::ostream& BracketAttributes::toStream( std::ostream& os ) const - { - if( !hasValues() ) - { - return os; - } - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, lineEnd, "line-end", hasLineEnd ); - streamAttribute( os, endLength, "end-length", hasEndLength ); - streamAttribute( os, lineType, "line-type", hasLineType ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, color, "color", hasColor ); - return os; - } - - - bool BracketAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "BracketAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - bool isLineEndFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineEnd, isLineEndFound, "line-end", &parseLineEnd ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, endLength, hasEndLength, "end-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BracketAttributes.h b/Sourcecode/private/mx/core/elements/BracketAttributes.h deleted file mode 100644 index 2585fdc89..000000000 --- a/Sourcecode/private/mx/core/elements/BracketAttributes.h +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" -#include "mx/core/Decimals.h" -#include "mx/core/Color.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BracketAttributes ) -/* - - - - - - - - - */ - struct BracketAttributes : public AttributesInterface - { - public: - BracketAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopContinue type; - NumberLevel number; - LineEnd lineEnd; - TenthsValue endLength; - LineType lineType; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - Color color; - const bool hasType; - bool hasNumber; - const bool hasLineEnd; - bool hasEndLength; - bool hasLineType; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasColor; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BreathMark.cpp b/Sourcecode/private/mx/core/elements/BreathMark.cpp deleted file mode 100644 index faf3b042a..000000000 --- a/Sourcecode/private/mx/core/elements/BreathMark.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BreathMark.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BreathMark::BreathMark() - :myValue( BreathMarkValue::emptystring ) - ,myAttributes( std::make_shared() ) - {} - - - BreathMark::BreathMark( const BreathMarkValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool BreathMark::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool BreathMark::hasContents() const - { - return true; - } - - - std::ostream& BreathMark::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& BreathMark::streamName( std::ostream& os ) const - { - os << "breath-mark"; - return os; - } - - - std::ostream& BreathMark::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - BreathMarkAttributesPtr BreathMark::getAttributes() const - { - return myAttributes; - } - - - void BreathMark::setAttributes( const BreathMarkAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - BreathMarkValue BreathMark::getValue() const - { - return myValue; - } - - - void BreathMark::setValue( const BreathMarkValue& value ) - { - myValue = value; - } - - - bool BreathMark::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseBreathMarkValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BreathMark.h b/Sourcecode/private/mx/core/elements/BreathMark.h deleted file mode 100644 index 706e906c3..000000000 --- a/Sourcecode/private/mx/core/elements/BreathMark.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/BreathMarkAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BreathMarkAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BreathMark ) - - inline BreathMarkPtr makeBreathMark() { return std::make_shared(); } - inline BreathMarkPtr makeBreathMark( const BreathMarkValue& value ) { return std::make_shared( value ); } - inline BreathMarkPtr makeBreathMark( BreathMarkValue&& value ) { return std::make_shared( std::move( value ) ); } - - class BreathMark : public ElementInterface - { - public: - BreathMark(); - BreathMark( const BreathMarkValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - BreathMarkAttributesPtr getAttributes() const; - void setAttributes( const BreathMarkAttributesPtr& attributes ); - BreathMarkValue getValue() const; - void setValue( const BreathMarkValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BreathMarkValue myValue; - BreathMarkAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/BreathMarkAttributes.cpp b/Sourcecode/private/mx/core/elements/BreathMarkAttributes.cpp deleted file mode 100644 index ba819fdb1..000000000 --- a/Sourcecode/private/mx/core/elements/BreathMarkAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/BreathMarkAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - BreathMarkAttributes::BreathMarkAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool BreathMarkAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& BreathMarkAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool BreathMarkAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "BreathMarkAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/BreathMarkAttributes.h b/Sourcecode/private/mx/core/elements/BreathMarkAttributes.h deleted file mode 100644 index d023727cb..000000000 --- a/Sourcecode/private/mx/core/elements/BreathMarkAttributes.h +++ /dev/null @@ -1,55 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( BreathMarkAttributes ) - - struct BreathMarkAttributes : public AttributesInterface - { - public: - BreathMarkAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Caesura.cpp b/Sourcecode/private/mx/core/elements/Caesura.cpp deleted file mode 100644 index 2ce3319ce..000000000 --- a/Sourcecode/private/mx/core/elements/Caesura.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Caesura.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Caesura::Caesura() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Caesura::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Caesura::hasContents() const { return false; } - std::ostream& Caesura::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Caesura::streamName( std::ostream& os ) const { os << "caesura"; return os; } - std::ostream& Caesura::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr Caesura::getAttributes() const - { - return myAttributes; - } - - - void Caesura::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Caesura::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Caesura.h b/Sourcecode/private/mx/core/elements/Caesura.h deleted file mode 100644 index 08fa65606..000000000 --- a/Sourcecode/private/mx/core/elements/Caesura.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Caesura ) - - inline CaesuraPtr makeCaesura() { return std::make_shared(); } - - class Caesura : public ElementInterface - { - public: - Caesura(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Cancel.cpp b/Sourcecode/private/mx/core/elements/Cancel.cpp deleted file mode 100644 index e63b2a80d..000000000 --- a/Sourcecode/private/mx/core/elements/Cancel.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Cancel.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Cancel::Cancel() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Cancel::Cancel( const FifthsValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Cancel::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Cancel::hasContents() const - { - return true; - } - - - std::ostream& Cancel::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Cancel::streamName( std::ostream& os ) const - { - os << "cancel"; - return os; - } - - - std::ostream& Cancel::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - CancelAttributesPtr Cancel::getAttributes() const - { - return myAttributes; - } - - - void Cancel::setAttributes( const CancelAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - FifthsValue Cancel::getValue() const - { - return myValue; - } - - - void Cancel::setValue( const FifthsValue& value ) - { - myValue = value; - } - - - bool Cancel::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Cancel.h b/Sourcecode/private/mx/core/elements/Cancel.h deleted file mode 100644 index 62f582daf..000000000 --- a/Sourcecode/private/mx/core/elements/Cancel.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" -#include "mx/core/elements/CancelAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CancelAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Cancel ) - - inline CancelPtr makeCancel() { return std::make_shared(); } - inline CancelPtr makeCancel( const FifthsValue& value ) { return std::make_shared( value ); } - inline CancelPtr makeCancel( FifthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Cancel : public ElementInterface - { - public: - Cancel(); - Cancel( const FifthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - CancelAttributesPtr getAttributes() const; - void setAttributes( const CancelAttributesPtr& attributes ); - FifthsValue getValue() const; - void setValue( const FifthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FifthsValue myValue; - CancelAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/CancelAttributes.cpp b/Sourcecode/private/mx/core/elements/CancelAttributes.cpp deleted file mode 100644 index e00de9d50..000000000 --- a/Sourcecode/private/mx/core/elements/CancelAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/CancelAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - CancelAttributes::CancelAttributes() - :location() - ,hasLocation( false ) - {} - - - bool CancelAttributes::hasValues() const - { - return hasLocation; - } - - - std::ostream& CancelAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, location, "location", hasLocation ); - } - return os; - } - - - bool CancelAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "CancelAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, location, hasLocation, "location", &parseCancelLocation ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/CancelAttributes.h b/Sourcecode/private/mx/core/elements/CancelAttributes.h deleted file mode 100644 index 02a793e7e..000000000 --- a/Sourcecode/private/mx/core/elements/CancelAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CancelAttributes ) - - struct CancelAttributes : public AttributesInterface - { - public: - CancelAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - CancelLocation location; - bool hasLocation; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Capo.cpp b/Sourcecode/private/mx/core/elements/Capo.cpp deleted file mode 100644 index faecb59fc..000000000 --- a/Sourcecode/private/mx/core/elements/Capo.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Capo.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Capo::Capo() - :myValue() - {} - - - Capo::Capo( const NonNegativeInteger& value ) - :myValue( value ) - {} - - - bool Capo::hasAttributes() const - { - return false; - } - - - bool Capo::hasContents() const - { - return true; - } - - - std::ostream& Capo::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Capo::streamName( std::ostream& os ) const - { - os << "capo"; - return os; - } - - - std::ostream& Capo::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NonNegativeInteger Capo::getValue() const - { - return myValue; - } - - - void Capo::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } - - - bool Capo::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Capo.h b/Sourcecode/private/mx/core/elements/Capo.h deleted file mode 100644 index 82589bb5c..000000000 --- a/Sourcecode/private/mx/core/elements/Capo.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Capo ) - - inline CapoPtr makeCapo() { return std::make_shared(); } - inline CapoPtr makeCapo( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline CapoPtr makeCapo( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class Capo : public ElementInterface - { - public: - Capo(); - Capo( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Chord.cpp b/Sourcecode/private/mx/core/elements/Chord.cpp deleted file mode 100644 index 221b0f274..000000000 --- a/Sourcecode/private/mx/core/elements/Chord.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Chord.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Chord::Chord() : ElementInterface() {} - - - bool Chord::hasAttributes() const { return false; } - - - bool Chord::hasContents() const { return false; } - std::ostream& Chord::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Chord::streamName( std::ostream& os ) const { os << "chord"; return os; } - std::ostream& Chord::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool Chord::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Chord.h b/Sourcecode/private/mx/core/elements/Chord.h deleted file mode 100644 index 6142c9dcc..000000000 --- a/Sourcecode/private/mx/core/elements/Chord.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Chord ) - - inline ChordPtr makeChord() { return std::make_shared(); } - - class Chord : public ElementInterface - { - public: - Chord(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Chromatic.cpp b/Sourcecode/private/mx/core/elements/Chromatic.cpp deleted file mode 100644 index f6792a76b..000000000 --- a/Sourcecode/private/mx/core/elements/Chromatic.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Chromatic.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Chromatic::Chromatic() - :myValue() - {} - - - Chromatic::Chromatic( const Semitones& value ) - :myValue( value ) - {} - - - bool Chromatic::hasAttributes() const - { - return false; - } - - - bool Chromatic::hasContents() const - { - return true; - } - - - std::ostream& Chromatic::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Chromatic::streamName( std::ostream& os ) const - { - os << "chromatic"; - return os; - } - - - std::ostream& Chromatic::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Semitones Chromatic::getValue() const - { - return myValue; - } - - - void Chromatic::setValue( const Semitones& value ) - { - myValue = value; - } - - - bool Chromatic::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Chromatic.h b/Sourcecode/private/mx/core/elements/Chromatic.h deleted file mode 100644 index bef306800..000000000 --- a/Sourcecode/private/mx/core/elements/Chromatic.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Chromatic ) - - inline ChromaticPtr makeChromatic() { return std::make_shared(); } - inline ChromaticPtr makeChromatic( const Semitones& value ) { return std::make_shared( value ); } - inline ChromaticPtr makeChromatic( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class Chromatic : public ElementInterface - { - public: - Chromatic(); - Chromatic( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/CircularArrow.cpp b/Sourcecode/private/mx/core/elements/CircularArrow.cpp deleted file mode 100644 index 8d690236a..000000000 --- a/Sourcecode/private/mx/core/elements/CircularArrow.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/CircularArrow.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - CircularArrow::CircularArrow() - :myValue( CircularArrowEnum::clockwise ) - {} - - - CircularArrow::CircularArrow( const CircularArrowEnum& value ) - :myValue( value ) - {} - - - bool CircularArrow::hasAttributes() const - { - return false; - } - - - bool CircularArrow::hasContents() const - { - return true; - } - - - std::ostream& CircularArrow::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& CircularArrow::streamName( std::ostream& os ) const - { - os << "circular-arrow"; - return os; - } - - - std::ostream& CircularArrow::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - CircularArrowEnum CircularArrow::getValue() const - { - return myValue; - } - - - void CircularArrow::setValue( const CircularArrowEnum& value ) - { - myValue = value; - } - - - bool CircularArrow::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseCircularArrowEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/CircularArrow.h b/Sourcecode/private/mx/core/elements/CircularArrow.h deleted file mode 100644 index 20053634c..000000000 --- a/Sourcecode/private/mx/core/elements/CircularArrow.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( CircularArrow ) - - inline CircularArrowPtr makeCircularArrow() { return std::make_shared(); } - inline CircularArrowPtr makeCircularArrow( const CircularArrowEnum& value ) { return std::make_shared( value ); } - inline CircularArrowPtr makeCircularArrow( CircularArrowEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class CircularArrow : public ElementInterface - { - public: - CircularArrow(); - CircularArrow( const CircularArrowEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - CircularArrowEnum getValue() const; - void setValue( const CircularArrowEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - CircularArrowEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Clef.cpp b/Sourcecode/private/mx/core/elements/Clef.cpp deleted file mode 100644 index f234a191e..000000000 --- a/Sourcecode/private/mx/core/elements/Clef.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Clef.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/ClefOctaveChange.h" -#include "mx/core/elements/Line.h" -#include "mx/core/elements/Sign.h" -#include - -namespace mx -{ - namespace core - { - Clef::Clef() - :myAttributes( std::make_shared() ) - ,mySign( makeSign() ) - ,myLine( makeLine() ) - ,myHasLine( false ) - ,myClefOctaveChange( makeClefOctaveChange() ) - ,myHasClefOctaveChange( false ) - {} - - - bool Clef::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Clef::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Clef::streamName( std::ostream& os ) const - { - os << "clef"; - return os; - } - - - bool Clef::hasContents() const - { - return true; - } - - - std::ostream& Clef::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - mySign->toStream( os, indentLevel+1 ); - if ( myHasLine ) - { - os << std::endl; - myLine->toStream( os, indentLevel+1 ); - } - if ( myHasClefOctaveChange ) - { - os << std::endl; - myClefOctaveChange->toStream( os, indentLevel+1 ); - } - os << std::endl; - return os; - } - - - ClefAttributesPtr Clef::getAttributes() const - { - return myAttributes; - } - - - void Clef::setAttributes( const ClefAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - SignPtr Clef::getSign() const - { - return mySign; - } - - - void Clef::setSign( const SignPtr& value ) - { - if( value ) - { - mySign = value; - } - } - - - LinePtr Clef::getLine() const - { - return myLine; - } - - - void Clef::setLine( const LinePtr& value ) - { - if( value ) - { - myLine = value; - } - } - - - bool Clef::getHasLine() const - { - return myHasLine; - } - - - void Clef::setHasLine( const bool value ) - { - myHasLine = value; - } - - - ClefOctaveChangePtr Clef::getClefOctaveChange() const - { - return myClefOctaveChange; - } - - - void Clef::setClefOctaveChange( const ClefOctaveChangePtr& value ) - { - if( value ) - { - myClefOctaveChange = value; - } - } - - - bool Clef::getHasClefOctaveChange() const - { - return myHasClefOctaveChange; - } - - - void Clef::setHasClefOctaveChange( const bool value ) - { - myHasClefOctaveChange = value; - } - - - bool Clef::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isSignFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *mySign, isSignFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myLine, myHasLine ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myClefOctaveChange, myHasClefOctaveChange ) ) { continue; } - } - - if( !isSignFound ) - { - message << "Clef: '" << mySign->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Clef.h b/Sourcecode/private/mx/core/elements/Clef.h deleted file mode 100644 index 9181c5208..000000000 --- a/Sourcecode/private/mx/core/elements/Clef.h +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/ClefAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ClefAttributes ) - MX_FORWARD_DECLARE_ELEMENT( ClefOctaveChange ) - MX_FORWARD_DECLARE_ELEMENT( Line ) - MX_FORWARD_DECLARE_ELEMENT( Sign ) - MX_FORWARD_DECLARE_ELEMENT( Clef ) - - inline ClefPtr makeClef() { return std::make_shared(); } - - class Clef : public ElementInterface - { - public: - Clef(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ClefAttributesPtr getAttributes() const; - void setAttributes( const ClefAttributesPtr& value ); - - /* _________ Sign minOccurs = 1, maxOccurs = 1 _________ */ - SignPtr getSign() const; - void setSign( const SignPtr& value ); - - /* _________ Line minOccurs = 0, maxOccurs = 1 _________ */ - LinePtr getLine() const; - void setLine( const LinePtr& value ); - bool getHasLine() const; - void setHasLine( const bool value ); - - /* _________ ClefOctaveChange minOccurs = 0, maxOccurs = 1 _________ */ - ClefOctaveChangePtr getClefOctaveChange() const; - void setClefOctaveChange( const ClefOctaveChangePtr& value ); - bool getHasClefOctaveChange() const; - void setHasClefOctaveChange( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ClefAttributesPtr myAttributes; - SignPtr mySign; - LinePtr myLine; - bool myHasLine; - ClefOctaveChangePtr myClefOctaveChange; - bool myHasClefOctaveChange; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ClefAttributes.cpp b/Sourcecode/private/mx/core/elements/ClefAttributes.cpp deleted file mode 100644 index d24008352..000000000 --- a/Sourcecode/private/mx/core/elements/ClefAttributes.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ClefAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ClefAttributes::ClefAttributes() - :number() - ,additional( YesNo::no ) - ,size() - ,afterBarline( YesNo::no ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,printObject( YesNo::no ) - ,hasNumber( false ) - ,hasAdditional( false ) - ,hasSize( false ) - ,hasAfterBarline( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPrintObject( false ) - {} - - - bool ClefAttributes::hasValues() const - { - return hasNumber || - hasAdditional || - hasSize || - hasAfterBarline || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPrintObject; - } - - - std::ostream& ClefAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, additional, "additional", hasAdditional ); - streamAttribute( os, size, "size", hasSize ); - streamAttribute( os, afterBarline, "after-barline", hasAfterBarline ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } - - - bool ClefAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "ClefAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, additional, hasAdditional, "additional", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, size, hasSize, "size", &parseSymbolSize ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, afterBarline, hasAfterBarline, "after-barline", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ClefAttributes.h b/Sourcecode/private/mx/core/elements/ClefAttributes.h deleted file mode 100644 index 6f96f9e50..000000000 --- a/Sourcecode/private/mx/core/elements/ClefAttributes.h +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ClefAttributes ) - - struct ClefAttributes : public AttributesInterface - { - public: - ClefAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffNumber number; - YesNo additional; - SymbolSize size; - YesNo afterBarline; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - YesNo printObject; - bool hasNumber; - bool hasAdditional; - bool hasSize; - bool hasAfterBarline; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPrintObject; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ClefOctaveChange.cpp b/Sourcecode/private/mx/core/elements/ClefOctaveChange.cpp deleted file mode 100644 index 42cff2ed3..000000000 --- a/Sourcecode/private/mx/core/elements/ClefOctaveChange.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ClefOctaveChange.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ClefOctaveChange::ClefOctaveChange() - :myValue() - {} - - - ClefOctaveChange::ClefOctaveChange( const Integer& value ) - :myValue( value ) - {} - - - bool ClefOctaveChange::hasAttributes() const - { - return false; - } - - - bool ClefOctaveChange::hasContents() const - { - return true; - } - - - std::ostream& ClefOctaveChange::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ClefOctaveChange::streamName( std::ostream& os ) const - { - os << "clef-octave-change"; - return os; - } - - - std::ostream& ClefOctaveChange::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Integer ClefOctaveChange::getValue() const - { - return myValue; - } - - - void ClefOctaveChange::setValue( const Integer& value ) - { - myValue = value; - } - - - bool ClefOctaveChange::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ClefOctaveChange.h b/Sourcecode/private/mx/core/elements/ClefOctaveChange.h deleted file mode 100644 index 09066bca6..000000000 --- a/Sourcecode/private/mx/core/elements/ClefOctaveChange.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ClefOctaveChange ) - - inline ClefOctaveChangePtr makeClefOctaveChange() { return std::make_shared(); } - inline ClefOctaveChangePtr makeClefOctaveChange( const Integer& value ) { return std::make_shared( value ); } - inline ClefOctaveChangePtr makeClefOctaveChange( Integer&& value ) { return std::make_shared( std::move( value ) ); } - - class ClefOctaveChange : public ElementInterface - { - public: - ClefOctaveChange(); - ClefOctaveChange( const Integer& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Integer getValue() const; - void setValue( const Integer& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Integer myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Coda.cpp b/Sourcecode/private/mx/core/elements/Coda.cpp deleted file mode 100644 index d38f2bb7b..000000000 --- a/Sourcecode/private/mx/core/elements/Coda.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Coda.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Coda::Coda() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Coda::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Coda::hasContents() const { return false; } - std::ostream& Coda::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Coda::streamName( std::ostream& os ) const { os << "coda"; return os; } - std::ostream& Coda::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPrintObjectStyleAlignAttributesPtr Coda::getAttributes() const - { - return myAttributes; - } - - - void Coda::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Coda::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Coda.h b/Sourcecode/private/mx/core/elements/Coda.h deleted file mode 100644 index 06802c601..000000000 --- a/Sourcecode/private/mx/core/elements/Coda.h +++ /dev/null @@ -1,44 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Coda ) - - inline CodaPtr makeCoda() { return std::make_shared(); } - - class Coda : public ElementInterface - { - public: - Coda(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Creator.cpp b/Sourcecode/private/mx/core/elements/Creator.cpp deleted file mode 100644 index ab7b98bdf..000000000 --- a/Sourcecode/private/mx/core/elements/Creator.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Creator.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Creator::Creator() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Creator::Creator( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Creator::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Creator::hasContents() const - { - return true; - } - - - std::ostream& Creator::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Creator::streamName( std::ostream& os ) const - { - os << "creator"; - return os; - } - - - std::ostream& Creator::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - CreatorAttributesPtr Creator::getAttributes() const - { - return myAttributes; - } - - - void Creator::setAttributes( const CreatorAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Creator::getValue() const - { - return myValue; - } - - - void Creator::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Creator::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Creator.h b/Sourcecode/private/mx/core/elements/Creator.h deleted file mode 100644 index c316927f2..000000000 --- a/Sourcecode/private/mx/core/elements/Creator.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/CreatorAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CreatorAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Creator ) - - inline CreatorPtr makeCreator() { return std::make_shared(); } - inline CreatorPtr makeCreator( const XsString& value ) { return std::make_shared( value ); } - inline CreatorPtr makeCreator( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Creator : public ElementInterface - { - public: - Creator(); - Creator( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - CreatorAttributesPtr getAttributes() const; - void setAttributes( const CreatorAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - CreatorAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/CreatorAttributes.cpp b/Sourcecode/private/mx/core/elements/CreatorAttributes.cpp deleted file mode 100644 index 197a1fcff..000000000 --- a/Sourcecode/private/mx/core/elements/CreatorAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/CreatorAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - CreatorAttributes::CreatorAttributes() - :type() - ,hasType( false ) - {} - - - bool CreatorAttributes::hasValues() const - { - return hasType; - } - - - std::ostream& CreatorAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool CreatorAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "CreatorAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/CreatorAttributes.h b/Sourcecode/private/mx/core/elements/CreatorAttributes.h deleted file mode 100644 index 73c948dbe..000000000 --- a/Sourcecode/private/mx/core/elements/CreatorAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CreatorAttributes ) - - struct CreatorAttributes : public AttributesInterface - { - public: - CreatorAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Credit.cpp b/Sourcecode/private/mx/core/elements/Credit.cpp deleted file mode 100644 index aa3d20067..000000000 --- a/Sourcecode/private/mx/core/elements/Credit.cpp +++ /dev/null @@ -1,340 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Credit.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Bookmark.h" -#include "mx/core/elements/CreditChoice.h" -#include "mx/core/elements/CreditImage.h" -#include "mx/core/elements/CreditType.h" -#include "mx/core/elements/CreditWords.h" -#include "mx/core/elements/CreditWordsGroup.h" -#include "mx/core/elements/Link.h" -#include - -namespace mx -{ - namespace core - { - Credit::Credit() - :myAttributes( std::make_shared() ) - ,myCreditTypeSet() - ,myLinkSet() - ,myBookmarkSet() - ,myCreditChoice( makeCreditChoice() ) - {} - - - bool Credit::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Credit::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Credit::streamName( std::ostream& os ) const - { - os << "credit"; - return os; - } - - - bool Credit::hasContents() const - { - return true; - } - - - std::ostream& Credit::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for( auto x : myCreditTypeSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for( auto x : myLinkSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for( auto x : myBookmarkSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - myCreditChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - os << std::endl; - isOneLineOnly = false; - return os; - } - - - CreditAttributesPtr Credit::getAttributes() const - { - return myAttributes; - } - - - void Credit::setAttributes( const CreditAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const CreditTypeSet& Credit::getCreditTypeSet() const - { - return myCreditTypeSet; - } - - - void Credit::removeCreditType( const CreditTypeSetIterConst& value ) - { - if ( value != myCreditTypeSet.cend() ) - { - myCreditTypeSet.erase( value ); - } - } - - - void Credit::addCreditType( const CreditTypePtr& value ) - { - if ( value ) - { - myCreditTypeSet.push_back( value ); - } - } - - - void Credit::clearCreditTypeSet() - { - myCreditTypeSet.clear(); - } - - - CreditTypePtr Credit::getCreditType( const CreditTypeSetIterConst& setIterator ) const - { - if( setIterator != myCreditTypeSet.cend() ) - { - return *setIterator; - } - return CreditTypePtr(); - } - - - const LinkSet& Credit::getLinkSet() const - { - return myLinkSet; - } - - - void Credit::removeLink( const LinkSetIterConst& value ) - { - if ( value != myLinkSet.cend() ) - { - myLinkSet.erase( value ); - } - } - - - void Credit::addLink( const LinkPtr& value ) - { - if ( value ) - { - myLinkSet.push_back( value ); - } - } - - - void Credit::clearLinkSet() - { - myLinkSet.clear(); - } - - - LinkPtr Credit::getLink( const LinkSetIterConst& setIterator ) const - { - if( setIterator != myLinkSet.cend() ) - { - return *setIterator; - } - return LinkPtr(); - } - - - const BookmarkSet& Credit::getBookmarkSet() const - { - return myBookmarkSet; - } - - - void Credit::removeBookmark( const BookmarkSetIterConst& value ) - { - if ( value != myBookmarkSet.cend() ) - { - myBookmarkSet.erase( value ); - } - } - - - void Credit::addBookmark( const BookmarkPtr& value ) - { - if ( value ) - { - myBookmarkSet.push_back( value ); - } - } - - - void Credit::clearBookmarkSet() - { - myBookmarkSet.clear(); - } - - - BookmarkPtr Credit::getBookmark( const BookmarkSetIterConst& setIterator ) const - { - if( setIterator != myBookmarkSet.cend() ) - { - return *setIterator; - } - return BookmarkPtr(); - } - - - CreditChoicePtr Credit::getCreditChoice() const - { - return myCreditChoice; - } - - - void Credit::setCreditChoice( const CreditChoicePtr& value ) - { - if( value ) - { - myCreditChoice = value; - } - } - -#ifndef MX_CREDIT_RETURN_IF_END -#define MX_CREDIT_RETURN_IF_END \ - if( i == endIter ) \ - { \ - if( !isCreditImageOrCreditWordsFound ) \ - { \ - message << "Credit: neither 'credit-words' nor 'credit-image' was present - one of these is required" << std::endl; \ - isSuccess = false; \ - } \ - return isSuccess; \ - } -#endif - - bool Credit::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isCreditImageOrCreditWordsFound = false; - - ::ezxml::XElementIterator i = xelement.begin(); - ::ezxml::XElementIterator endIter = xelement.end(); - MX_CREDIT_RETURN_IF_END; - - if( i->getName() == "credit-type" ) - { - while( i != endIter && i->getName() == "credit-type" ) - { - auto item = makeCreditType(); - isSuccess &= item->fromXElement( message, *i ); - addCreditType( item ); - ++i; - } - } - MX_CREDIT_RETURN_IF_END; - - if( i->getName() == "link" ) - { - while( i != endIter && i->getName() == "link" ) - { - auto item = makeLink(); - isSuccess &= item->fromXElement( message, *i ); - addLink( item ); - ++i; - } - } - MX_CREDIT_RETURN_IF_END; - - if( i->getName() == "bookmark" ) - { - while( i != endIter && i->getName() == "bookmark" ) - { - auto item = makeBookmark(); - isSuccess &= item->fromXElement( message, *i ); - addBookmark( item ); - ++i; - } - } - MX_CREDIT_RETURN_IF_END; - - if( i->getName() == "credit-image" || i->getName() == "credit-words" ) - { - isCreditImageOrCreditWordsFound = true; - if( i->getName() == "credit-image" ) - { - myCreditChoice->setChoice( CreditChoice::Choice::creditImage ); - isSuccess &= myCreditChoice->getCreditImage()->fromXElement( message, *i ); - MX_RETURN_IS_SUCCESS; - } - - if( i->getName() == "credit-words" ) - { - myCreditChoice->setChoice( CreditChoice::Choice::creditWords ); - isSuccess &= myCreditChoice->getCreditWords()->fromXElement( message, *i ); - ++i; - MX_CREDIT_RETURN_IF_END; - - auto creditWordsGroup = makeCreditWordsGroup(); - while( i != endIter && ((i->getName() == "link")||(i->getName() == "bookmark")||(i->getName() == "credit-words" ))) - { - while( i != endIter && i->getName() == "link" ) - { - auto link = makeLink(); - isSuccess &= link->fromXElement( message, xelement ); - creditWordsGroup->addLink( link ); - ++i; - } - MX_CREDIT_RETURN_IF_END; - - while( i != endIter && i->getName() == "bookmark" ) - { - auto bookmark = makeBookmark(); - isSuccess &= bookmark->fromXElement( message, xelement ); - creditWordsGroup->addBookmark( bookmark ); - ++i; - } - MX_CREDIT_RETURN_IF_END; - - if( i->getName() == "credit-words" ) - { - isSuccess &= creditWordsGroup->getCreditWords()->fromXElement( message, *i ); - myCreditChoice->addCreditWordsGroup( creditWordsGroup ); - creditWordsGroup = makeCreditWordsGroup(); - ++i; - } - MX_CREDIT_RETURN_IF_END; - } - } - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Credit.h b/Sourcecode/private/mx/core/elements/Credit.h deleted file mode 100644 index 379b17a1d..000000000 --- a/Sourcecode/private/mx/core/elements/Credit.h +++ /dev/null @@ -1,84 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/CreditAttributes.h" - -#include -#include -#include - -namespace ezxml -{ - class XElementIterator; -} - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CreditAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Bookmark ) - MX_FORWARD_DECLARE_ELEMENT( CreditChoice ) - MX_FORWARD_DECLARE_ELEMENT( CreditType ) - MX_FORWARD_DECLARE_ELEMENT( Link ) - MX_FORWARD_DECLARE_ELEMENT( Credit ) - - inline CreditPtr makeCredit() { return std::make_shared(); } - - class Credit : public ElementInterface - { - public: - Credit(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - CreditAttributesPtr getAttributes() const; - void setAttributes( const CreditAttributesPtr& value ); - - /* _________ CreditType minOccurs = 0, maxOccurs = unbounded _________ */ - const CreditTypeSet& getCreditTypeSet() const; - void addCreditType( const CreditTypePtr& value ); - void removeCreditType( const CreditTypeSetIterConst& value ); - void clearCreditTypeSet(); - CreditTypePtr getCreditType( const CreditTypeSetIterConst& setIterator ) const; - - /* _________ Link minOccurs = 0, maxOccurs = unbounded _________ */ - const LinkSet& getLinkSet() const; - void addLink( const LinkPtr& value ); - void removeLink( const LinkSetIterConst& value ); - void clearLinkSet(); - LinkPtr getLink( const LinkSetIterConst& setIterator ) const; - - /* _________ Bookmark minOccurs = 0, maxOccurs = unbounded _________ */ - const BookmarkSet& getBookmarkSet() const; - void addBookmark( const BookmarkPtr& value ); - void removeBookmark( const BookmarkSetIterConst& value ); - void clearBookmarkSet(); - BookmarkPtr getBookmark( const BookmarkSetIterConst& setIterator ) const; - - /* _________ CreditChoice minOccurs = 1, maxOccurs = 1 _________ */ - CreditChoicePtr getCreditChoice() const; - void setCreditChoice( const CreditChoicePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - CreditAttributesPtr myAttributes; - CreditTypeSet myCreditTypeSet; - LinkSet myLinkSet; - BookmarkSet myBookmarkSet; - CreditChoicePtr myCreditChoice; - - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditAttributes.cpp b/Sourcecode/private/mx/core/elements/CreditAttributes.cpp deleted file mode 100644 index 71638829e..000000000 --- a/Sourcecode/private/mx/core/elements/CreditAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/CreditAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - CreditAttributes::CreditAttributes() - :page() - ,hasPage( false ) - {} - - - bool CreditAttributes::hasValues() const - { - return hasPage; - } - - - std::ostream& CreditAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, page, "page", hasPage ); - } - return os; - } - - - bool CreditAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "CreditAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, page, hasPage, "page" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditAttributes.h b/Sourcecode/private/mx/core/elements/CreditAttributes.h deleted file mode 100644 index ef4241e71..000000000 --- a/Sourcecode/private/mx/core/elements/CreditAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CreditAttributes ) - - struct CreditAttributes : public AttributesInterface - { - public: - CreditAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - PositiveInteger page; - bool hasPage; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditChoice.cpp b/Sourcecode/private/mx/core/elements/CreditChoice.cpp deleted file mode 100644 index f477a661e..000000000 --- a/Sourcecode/private/mx/core/elements/CreditChoice.cpp +++ /dev/null @@ -1,166 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/CreditChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/CreditImage.h" -#include "mx/core/elements/CreditWords.h" -#include "mx/core/elements/Bookmark.h" -#include "mx/core/elements/Link.h" -#include "mx/core/elements/CreditWordsGroup.h" -#include - -namespace mx -{ - namespace core - { - CreditChoice::CreditChoice() - :myChoice( Choice::creditWords ) - ,myCreditImage( makeCreditImage() ) - ,myCreditWords( makeCreditWords() ) - ,myCreditWordsGroupSet() - {} - - - bool CreditChoice::hasAttributes() const - { - return false; - } - - - std::ostream& CreditChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& CreditChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool CreditChoice::hasContents() const - { - return true; - } - - - std::ostream& CreditChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::creditImage: - myCreditImage->toStream( os, indentLevel ); - break; - case Choice::creditWords: - { - myCreditWords->toStream( os, indentLevel ); - - if ( myCreditWordsGroupSet.size() > 0 ) - { - os << std::endl; - } - - for( auto x : myCreditWordsGroupSet ) - { - x->streamContents( os, indentLevel, isOneLineOnly ); - } - - break; - } - default: - break; - } - isOneLineOnly = false; - return os; - } - - - CreditChoice::Choice CreditChoice::getChoice() const - { - return myChoice; - } - - - void CreditChoice::setChoice( const CreditChoice::Choice value ) - { - myChoice = value; - } - - - CreditImagePtr CreditChoice::getCreditImage() const - { - return myCreditImage; - } - - - void CreditChoice::setCreditImage( const CreditImagePtr& value ) - { - if ( value ) - { - myCreditImage = value; - } - } - - - CreditWordsPtr CreditChoice::getCreditWords() const - { - return myCreditWords; - } - - - void CreditChoice::setCreditWords( const CreditWordsPtr& value ) - { - if ( value ) - { - myCreditWords = value; - } - } - - - const CreditWordsGroupSet& CreditChoice::getCreditWordsGroupSet() const - { - return myCreditWordsGroupSet; - } - - - void CreditChoice::removeCreditWordsGroup( const CreditWordsGroupSetIterConst& value ) - { - if ( value != myCreditWordsGroupSet.cend() ) - { - myCreditWordsGroupSet.erase( value ); - } - } - - - void CreditChoice::addCreditWordsGroup( const CreditWordsGroupPtr& value ) - { - if ( value ) - { - myCreditWordsGroupSet.push_back( value ); - } - } - - - void CreditChoice::clearCreditWordsGroupSet() - { - myCreditWordsGroupSet.clear(); - } - - - CreditWordsGroupPtr CreditChoice::getCreditWordsGroup( const CreditWordsGroupSetIterConst& setIterator ) const - { - if( setIterator != myCreditWordsGroupSet.cend() ) - { - return *setIterator; - } - return CreditWordsGroupPtr(); - } - - - MX_FROM_XELEMENT_UNUSED( CreditChoice ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditChoice.h b/Sourcecode/private/mx/core/elements/CreditChoice.h deleted file mode 100644 index a49cebc27..000000000 --- a/Sourcecode/private/mx/core/elements/CreditChoice.h +++ /dev/null @@ -1,71 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( CreditImage ) - MX_FORWARD_DECLARE_ELEMENT( CreditWordsGroup ) - MX_FORWARD_DECLARE_ELEMENT( CreditWords ) - MX_FORWARD_DECLARE_ELEMENT( CreditChoice ) - - inline CreditChoicePtr makeCreditChoice() { return std::make_shared(); } - - class CreditChoice : public ElementInterface - { - public: - enum class Choice - { - creditImage = 1, - creditWords = 2 - }; - CreditChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - CreditChoice::Choice getChoice() const; - void setChoice( const CreditChoice::Choice value ); - - /* _________ CreditImage minOccurs = 1, maxOccurs = 1 _________ */ - CreditImagePtr getCreditImage() const; - void setCreditImage( const CreditImagePtr& value ); - - /* _________ CreditWords minOccurs = 1, maxOccurs = 1 _________ */ - CreditWordsPtr getCreditWords() const; - void setCreditWords( const CreditWordsPtr& value ); - - /* _________ CreditWordsGroup minOccurs = 0, maxOccurs = unbounded _________ */ - const CreditWordsGroupSet& getCreditWordsGroupSet() const; - void addCreditWordsGroup( const CreditWordsGroupPtr& value ); - void removeCreditWordsGroup( const CreditWordsGroupSetIterConst& value ); - void clearCreditWordsGroupSet(); - CreditWordsGroupPtr getCreditWordsGroup( const CreditWordsGroupSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - CreditImagePtr myCreditImage; - CreditWordsPtr myCreditWords; - CreditWordsGroupSet myCreditWordsGroupSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditImage.cpp b/Sourcecode/private/mx/core/elements/CreditImage.cpp deleted file mode 100644 index f494a6447..000000000 --- a/Sourcecode/private/mx/core/elements/CreditImage.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/CreditImage.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - CreditImage::CreditImage() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool CreditImage::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool CreditImage::hasContents() const { return false; } - std::ostream& CreditImage::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& CreditImage::streamName( std::ostream& os ) const { os << "credit-image"; return os; } - std::ostream& CreditImage::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - CreditImageAttributesPtr CreditImage::getAttributes() const - { - return myAttributes; - } - - - void CreditImage::setAttributes( const CreditImageAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool CreditImage::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditImage.h b/Sourcecode/private/mx/core/elements/CreditImage.h deleted file mode 100644 index 17550f71b..000000000 --- a/Sourcecode/private/mx/core/elements/CreditImage.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/CreditImageAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CreditImageAttributes ) - MX_FORWARD_DECLARE_ELEMENT( CreditImage ) - - inline CreditImagePtr makeCreditImage() { return std::make_shared(); } - - class CreditImage : public ElementInterface - { - public: - CreditImage(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - CreditImageAttributesPtr getAttributes() const; - void setAttributes( const CreditImageAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - CreditImageAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditImageAttributes.cpp b/Sourcecode/private/mx/core/elements/CreditImageAttributes.cpp deleted file mode 100644 index cc538bb16..000000000 --- a/Sourcecode/private/mx/core/elements/CreditImageAttributes.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/CreditImageAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - CreditImageAttributes::CreditImageAttributes() - :source() - ,type() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,halign( LeftCenterRight::center ) - ,hasSource( true ) - ,hasType( true ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasHalign( false ) - {} - - - bool CreditImageAttributes::hasValues() const - { - return hasSource || - hasType || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasHalign; - } - - - std::ostream& CreditImageAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, source, "source", hasSource ); - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; - } - - - bool CreditImageAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "CreditImageAttributes"; - bool isSuccess = true; - bool isSourceFound = false; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, source, isSourceFound, "source" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - if( !isSourceFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditImageAttributes.h b/Sourcecode/private/mx/core/elements/CreditImageAttributes.h deleted file mode 100644 index 86c76843c..000000000 --- a/Sourcecode/private/mx/core/elements/CreditImageAttributes.h +++ /dev/null @@ -1,50 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/XsAnyUri.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CreditImageAttributes ) - - struct CreditImageAttributes : public AttributesInterface - { - public: - CreditImageAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsAnyUri source; - XsToken type; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - LeftCenterRight halign; - const bool hasSource; - const bool hasType; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasHalign; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditType.cpp b/Sourcecode/private/mx/core/elements/CreditType.cpp deleted file mode 100644 index f71ec4e3d..000000000 --- a/Sourcecode/private/mx/core/elements/CreditType.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/CreditType.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - CreditType::CreditType() - :myValue() - {} - - - CreditType::CreditType( const XsString& value ) - :myValue( value ) - {} - - - bool CreditType::hasAttributes() const - { - return false; - } - - - bool CreditType::hasContents() const - { - return true; - } - - - std::ostream& CreditType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& CreditType::streamName( std::ostream& os ) const - { - os << "credit-type"; - return os; - } - - - std::ostream& CreditType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString CreditType::getValue() const - { - return myValue; - } - - - void CreditType::setValue( const XsString& value ) - { - myValue = value; - } - - - bool CreditType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditType.h b/Sourcecode/private/mx/core/elements/CreditType.h deleted file mode 100644 index 867c92459..000000000 --- a/Sourcecode/private/mx/core/elements/CreditType.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( CreditType ) - - inline CreditTypePtr makeCreditType() { return std::make_shared(); } - inline CreditTypePtr makeCreditType( const XsString& value ) { return std::make_shared( value ); } - inline CreditTypePtr makeCreditType( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class CreditType : public ElementInterface - { - public: - CreditType(); - CreditType( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditWords.cpp b/Sourcecode/private/mx/core/elements/CreditWords.cpp deleted file mode 100644 index b6ed1b1dd..000000000 --- a/Sourcecode/private/mx/core/elements/CreditWords.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/CreditWords.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - CreditWords::CreditWords() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - CreditWords::CreditWords( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool CreditWords::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool CreditWords::hasContents() const - { - return true; - } - - - std::ostream& CreditWords::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& CreditWords::streamName( std::ostream& os ) const - { - os << "credit-words"; - return os; - } - - - std::ostream& CreditWords::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - CreditWordsAttributesPtr CreditWords::getAttributes() const - { - return myAttributes; - } - - - void CreditWords::setAttributes( const CreditWordsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString CreditWords::getValue() const - { - return myValue; - } - - - void CreditWords::setValue( const XsString& value ) - { - myValue = value; - } - - - bool CreditWords::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditWords.h b/Sourcecode/private/mx/core/elements/CreditWords.h deleted file mode 100644 index a2dc7a5dd..000000000 --- a/Sourcecode/private/mx/core/elements/CreditWords.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/CreditWordsAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CreditWordsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( CreditWords ) - - inline CreditWordsPtr makeCreditWords() { return std::make_shared(); } - inline CreditWordsPtr makeCreditWords( const XsString& value ) { return std::make_shared( value ); } - inline CreditWordsPtr makeCreditWords( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class CreditWords : public ElementInterface - { - public: - CreditWords(); - CreditWords( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - CreditWordsAttributesPtr getAttributes() const; - void setAttributes( const CreditWordsAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - CreditWordsAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditWordsAttributes.cpp b/Sourcecode/private/mx/core/elements/CreditWordsAttributes.cpp deleted file mode 100644 index 817f2b903..000000000 --- a/Sourcecode/private/mx/core/elements/CreditWordsAttributes.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/CreditWordsAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - CreditWordsAttributes::CreditWordsAttributes() - :justify( LeftCenterRight::center ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,color() - ,halign() - ,valign() - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lineHeight() - ,lang( XmlLang{ "it" } ) - ,space( XmlSpace::default_ ) - ,enclosure( EnclosureShape::rectangle ) - ,hasJustify( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLineHeight( false ) - ,hasLang( false ) - ,hasSpace( false ) - ,hasEnclosure( false ) - {} - - - bool CreditWordsAttributes::hasValues() const - { - return hasJustify || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasHalign || - hasValign || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLineHeight || - hasLang || - hasSpace || - hasEnclosure; - } - - - std::ostream& CreditWordsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lineHeight, "line-height", hasLineHeight ); - streamAttribute( os, lang, "xml:lang", hasLang ); - streamAttribute( os, space, "xml:space", hasSpace ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } - - - bool CreditWordsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "CreditWordsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditWordsAttributes.h b/Sourcecode/private/mx/core/elements/CreditWordsAttributes.h deleted file mode 100644 index 1cdde9c0b..000000000 --- a/Sourcecode/private/mx/core/elements/CreditWordsAttributes.h +++ /dev/null @@ -1,82 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" -#include "mx/core/NumberOrNormal.h" -#include "mx/core/XmlLang.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( CreditWordsAttributes ) - - struct CreditWordsAttributes : public AttributesInterface - { - public: - CreditWordsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LeftCenterRight justify; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - NumberOrNormal lineHeight; - XmlLang lang; - XmlSpace space; - EnclosureShape enclosure; - bool hasJustify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLineHeight; - bool hasLang; - bool hasSpace; - bool hasEnclosure; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditWordsGroup.cpp b/Sourcecode/private/mx/core/elements/CreditWordsGroup.cpp deleted file mode 100644 index 43c3dc883..000000000 --- a/Sourcecode/private/mx/core/elements/CreditWordsGroup.cpp +++ /dev/null @@ -1,176 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/CreditWordsGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Bookmark.h" -#include "mx/core/elements/CreditWords.h" -#include "mx/core/elements/Link.h" -#include - -namespace mx -{ - namespace core - { - CreditWordsGroup::CreditWordsGroup() - :myLinkSet() - ,myBookmarkSet() - ,myCreditWords( makeCreditWords() ) - {} - - - bool CreditWordsGroup::hasAttributes() const - { - return false; - } - - - std::ostream& CreditWordsGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& CreditWordsGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool CreditWordsGroup::hasContents() const - { - return true; - } - - - std::ostream& CreditWordsGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - bool isFirst = true; - for ( auto x : myLinkSet ) - { - if ( !isFirst ) - { - os << std::endl; - } - x->toStream( os, indentLevel ); - isFirst = false; - } - for ( auto x : myBookmarkSet ) - { - if ( !isFirst ) - { - os << std::endl; - } - x->toStream( os, indentLevel ); - isFirst = false; - } - if ( !isFirst ) - { - os << std::endl; - } - myCreditWords->toStream( os, indentLevel ); - isOneLineOnly = false; - return os; - } - - - const LinkSet& CreditWordsGroup::getLinkSet() const - { - return myLinkSet; - } - - - void CreditWordsGroup::addLink( const LinkPtr& value ) - { - if ( value ) - { - myLinkSet.push_back( value ); - } - } - - - void CreditWordsGroup::removeLink( const LinkSetIterConst& value ) - { - if ( value != myLinkSet.cend() ) - { - myLinkSet.erase( value ); - } - } - - - void CreditWordsGroup::clearLinkSet() - { - myLinkSet.clear(); - } - - - LinkPtr CreditWordsGroup::getLink( const LinkSetIterConst& setIterator ) const - { - if( setIterator != myLinkSet.cend() ) - { - return *setIterator; - } - return LinkPtr(); - } - - - const BookmarkSet& CreditWordsGroup::getBookmarkSet() const - { - return myBookmarkSet; - } - - - void CreditWordsGroup::addBookmark( const BookmarkPtr& value ) - { - if ( value ) - { - myBookmarkSet.push_back( value ); - } - } - - - void CreditWordsGroup::removeBookmark( const BookmarkSetIterConst& value ) - { - if ( value != myBookmarkSet.cend() ) - { - myBookmarkSet.erase( value ); - } - } - - - void CreditWordsGroup::clearBookmarkSet() - { - myBookmarkSet.clear(); - } - - - BookmarkPtr CreditWordsGroup::getBookmark( const BookmarkSetIterConst& setIterator ) const - { - if( setIterator != myBookmarkSet.cend() ) - { - return *setIterator; - } - return BookmarkPtr(); - } - - - CreditWordsPtr CreditWordsGroup::getCreditWords() const - { - return myCreditWords; - } - - - void CreditWordsGroup::setCreditWords( const CreditWordsPtr& value ) - { - if ( value ) - { - myCreditWords = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( CreditWordsGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/CreditWordsGroup.h b/Sourcecode/private/mx/core/elements/CreditWordsGroup.h deleted file mode 100644 index 24393a8ab..000000000 --- a/Sourcecode/private/mx/core/elements/CreditWordsGroup.h +++ /dev/null @@ -1,64 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Bookmark ) - MX_FORWARD_DECLARE_ELEMENT( CreditWords ) - MX_FORWARD_DECLARE_ELEMENT( Link ) - MX_FORWARD_DECLARE_ELEMENT( CreditWordsGroup ) - - inline CreditWordsGroupPtr makeCreditWordsGroup() { return std::make_shared(); } - - class CreditWordsGroup : public ElementInterface - { - public: - CreditWordsGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ LinkSet minOccurs = 0, maxOccurs = unbounded _________ */ - const LinkSet& getLinkSet() const; - void addLink( const LinkPtr& value ); - void removeLink( const LinkSetIterConst& value ); - void clearLinkSet(); - LinkPtr getLink( const LinkSetIterConst& setIterator ) const; - - /* _________ Bookmark minOccurs = 0, maxOccurs = unbounded _________ */ - const BookmarkSet& getBookmarkSet() const; - void addBookmark( const BookmarkPtr& value ); - void removeBookmark( const BookmarkSetIterConst& value ); - void clearBookmarkSet(); - BookmarkPtr getBookmark( const BookmarkSetIterConst& setIterator ) const; - - /* _________ CreditWords minOccurs = 1, maxOccurs = 1 _________ */ - CreditWordsPtr getCreditWords() const; - void setCreditWords( const CreditWordsPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LinkSet myLinkSet; - BookmarkSet myBookmarkSet; - CreditWordsPtr myCreditWords; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Cue.cpp b/Sourcecode/private/mx/core/elements/Cue.cpp deleted file mode 100644 index d99543523..000000000 --- a/Sourcecode/private/mx/core/elements/Cue.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Cue.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Cue::Cue() : ElementInterface() {} - - - bool Cue::hasAttributes() const { return false; } - - - bool Cue::hasContents() const { return false; } - std::ostream& Cue::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Cue::streamName( std::ostream& os ) const { os << "cue"; return os; } - std::ostream& Cue::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool Cue::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Cue.h b/Sourcecode/private/mx/core/elements/Cue.h deleted file mode 100644 index 2a31fd358..000000000 --- a/Sourcecode/private/mx/core/elements/Cue.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Cue ) - - inline CuePtr makeCue() { return std::make_shared(); } - - class Cue : public ElementInterface - { - public: - Cue(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/CueNoteGroup.cpp b/Sourcecode/private/mx/core/elements/CueNoteGroup.cpp deleted file mode 100644 index c76089250..000000000 --- a/Sourcecode/private/mx/core/elements/CueNoteGroup.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/CueNoteGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Cue.h" -#include "mx/core/elements/Duration.h" -#include "mx/core/elements/FullNoteGroup.h" -#include - -namespace mx -{ - namespace core - { - CueNoteGroup::CueNoteGroup() - :myCue( makeCue() ) - ,myFullNoteGroup( makeFullNoteGroup() ) - ,myDuration( makeDuration() ) - {} - - - bool CueNoteGroup::hasAttributes() const - { - return false; - } - - - std::ostream& CueNoteGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& CueNoteGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool CueNoteGroup::hasContents() const - { - return true; - } - - - std::ostream& CueNoteGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - myCue->toStream( os, indentLevel ); - os << std::endl; - myFullNoteGroup->streamContents( os, indentLevel, isOneLineOnly ); - os << std::endl; - myDuration->toStream( os, indentLevel ); - isOneLineOnly = false; - return os; - } - - - CuePtr CueNoteGroup::getCue() const - { - return myCue; - } - - - void CueNoteGroup::setCue( const CuePtr& value ) - { - if ( value ) - { - myCue = value; - } - } - - - FullNoteGroupPtr CueNoteGroup::getFullNoteGroup() const - { - return myFullNoteGroup; - } - - - void CueNoteGroup::setFullNoteGroup( const FullNoteGroupPtr& value ) - { - if ( value ) - { - myFullNoteGroup = value; - } - } - - - DurationPtr CueNoteGroup::getDuration() const - { - return myDuration; - } - - - void CueNoteGroup::setDuration( const DurationPtr& value ) - { - if ( value ) - { - myDuration = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( CueNoteGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/CueNoteGroup.h b/Sourcecode/private/mx/core/elements/CueNoteGroup.h deleted file mode 100644 index fd8ce989c..000000000 --- a/Sourcecode/private/mx/core/elements/CueNoteGroup.h +++ /dev/null @@ -1,58 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Cue ) - MX_FORWARD_DECLARE_ELEMENT( Duration ) - MX_FORWARD_DECLARE_ELEMENT( FullNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( CueNoteGroup ) - - inline CueNoteGroupPtr makeCueNoteGroup() { return std::make_shared(); } - - class CueNoteGroup : public ElementInterface - { - public: - CueNoteGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Cue minOccurs = 1, maxOccurs = 1 _________ */ - CuePtr getCue() const; - void setCue( const CuePtr& value ); - - /* _________ FullNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ - FullNoteGroupPtr getFullNoteGroup() const; - void setFullNoteGroup( const FullNoteGroupPtr& value ); - - /* _________ Duration minOccurs = 1, maxOccurs = 1 _________ */ - DurationPtr getDuration() const; - void setDuration( const DurationPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - CuePtr myCue; - FullNoteGroupPtr myFullNoteGroup; - DurationPtr myDuration; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Damp.cpp b/Sourcecode/private/mx/core/elements/Damp.cpp deleted file mode 100644 index c8b204829..000000000 --- a/Sourcecode/private/mx/core/elements/Damp.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Damp.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Damp::Damp() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Damp::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Damp::hasContents() const { return false; } - std::ostream& Damp::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Damp::streamName( std::ostream& os ) const { os << "damp"; return os; } - std::ostream& Damp::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPrintObjectStyleAlignAttributesPtr Damp::getAttributes() const - { - return myAttributes; - } - - - void Damp::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Damp::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Damp.h b/Sourcecode/private/mx/core/elements/Damp.h deleted file mode 100644 index 1915764a7..000000000 --- a/Sourcecode/private/mx/core/elements/Damp.h +++ /dev/null @@ -1,44 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Damp ) - - inline DampPtr makeDamp() { return std::make_shared(); } - - class Damp : public ElementInterface - { - public: - Damp(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DampAll.cpp b/Sourcecode/private/mx/core/elements/DampAll.cpp deleted file mode 100644 index 00c84a953..000000000 --- a/Sourcecode/private/mx/core/elements/DampAll.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DampAll.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DampAll::DampAll() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool DampAll::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DampAll::hasContents() const { return false; } - std::ostream& DampAll::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DampAll::streamName( std::ostream& os ) const { os << "damp-all"; return os; } - std::ostream& DampAll::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPrintObjectStyleAlignAttributesPtr DampAll::getAttributes() const - { - return myAttributes; - } - - - void DampAll::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool DampAll::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DampAll.h b/Sourcecode/private/mx/core/elements/DampAll.h deleted file mode 100644 index 95f4dee34..000000000 --- a/Sourcecode/private/mx/core/elements/DampAll.h +++ /dev/null @@ -1,44 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( DampAll ) - - inline DampAllPtr makeDampAll() { return std::make_shared(); } - - class DampAll : public ElementInterface - { - public: - DampAll(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Dashes.cpp b/Sourcecode/private/mx/core/elements/Dashes.cpp deleted file mode 100644 index 78d64d8bd..000000000 --- a/Sourcecode/private/mx/core/elements/Dashes.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Dashes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Dashes::Dashes() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Dashes::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Dashes::hasContents() const { return false; } - std::ostream& Dashes::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Dashes::streamName( std::ostream& os ) const { os << "dashes"; return os; } - std::ostream& Dashes::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - DashesAttributesPtr Dashes::getAttributes() const - { - return myAttributes; - } - - - void Dashes::setAttributes( const DashesAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Dashes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Dashes.h b/Sourcecode/private/mx/core/elements/Dashes.h deleted file mode 100644 index d1ba504b3..000000000 --- a/Sourcecode/private/mx/core/elements/Dashes.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/DashesAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DashesAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Dashes ) - - inline DashesPtr makeDashes() { return std::make_shared(); } - - class Dashes : public ElementInterface - { - public: - Dashes(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DashesAttributesPtr getAttributes() const; - void setAttributes( const DashesAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DashesAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DashesAttributes.cpp b/Sourcecode/private/mx/core/elements/DashesAttributes.cpp deleted file mode 100644 index 31998060a..000000000 --- a/Sourcecode/private/mx/core/elements/DashesAttributes.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DashesAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DashesAttributes::DashesAttributes() - :type( StartStopContinue::start ) - ,number() - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,hasType( true ) - ,hasNumber( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - {} - - - bool DashesAttributes::hasValues() const - { - return hasType || - hasNumber || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY; - } - - - std::ostream& DashesAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - } - return os; - } - - - bool DashesAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DashesAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DashesAttributes.h b/Sourcecode/private/mx/core/elements/DashesAttributes.h deleted file mode 100644 index 05dcc9376..000000000 --- a/Sourcecode/private/mx/core/elements/DashesAttributes.h +++ /dev/null @@ -1,51 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DashesAttributes ) - - struct DashesAttributes : public AttributesInterface - { - public: - DashesAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopContinue type; - NumberLevel number; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - const bool hasType; - bool hasNumber; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Defaults.cpp b/Sourcecode/private/mx/core/elements/Defaults.cpp deleted file mode 100644 index 3f25dc772..000000000 --- a/Sourcecode/private/mx/core/elements/Defaults.cpp +++ /dev/null @@ -1,339 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Defaults.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Appearance.h" -#include "mx/core/elements/LayoutGroup.h" -#include "mx/core/elements/LyricFont.h" -#include "mx/core/elements/LyricLanguage.h" -#include "mx/core/elements/MusicFont.h" -#include "mx/core/elements/Scaling.h" -#include "mx/core/elements/WordFont.h" -#include - -namespace mx -{ - namespace core - { - Defaults::Defaults() - :myScaling( makeScaling() ) - ,myHasScaling( false ) - ,myLayoutGroup( makeLayoutGroup() ) - ,myAppearance( makeAppearance() ) - ,myHasAppearance( false ) - ,myMusicFont( makeMusicFont() ) - ,myHasMusicFont( false ) - ,myWordFont( makeWordFont() ) - ,myHasWordFont( false ) - ,myLyricFontSet() - ,myLyricLanguageSet() - {} - - - bool Defaults::hasAttributes() const - { - return false; - } - - - std::ostream& Defaults::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Defaults::streamName( std::ostream& os ) const - { - os << "defaults"; - return os; - } - - - bool Defaults::hasContents() const - { - return myHasScaling - || myLayoutGroup->hasContents() - || myHasAppearance - || myHasMusicFont - || myHasWordFont - || myLyricFontSet.size() > 0 - || myLyricLanguageSet.size() > 0; - } - - - std::ostream& Defaults::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - if ( myHasScaling ) - { - os << std::endl; - myScaling->toStream( os, indentLevel+1 ); - } - if ( myLayoutGroup->hasContents() ) - { - os << std::endl; - myLayoutGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasAppearance ) - { - os << std::endl; - myAppearance->toStream( os, indentLevel+1 ); - } - if ( myHasMusicFont ) - { - os << std::endl; - myMusicFont->toStream( os, indentLevel+1 ); - } - if ( myHasWordFont ) - { - os << std::endl; - myWordFont->toStream( os, indentLevel+1 ); - } - for ( auto x : myLyricFontSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myLyricLanguageSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - ScalingPtr Defaults::getScaling() const - { - return myScaling; - } - - - void Defaults::setScaling( const ScalingPtr& value ) - { - if( value ) - { - myScaling = value; - } - } - - - bool Defaults::getHasScaling() const - { - return myHasScaling; - } - - - void Defaults::setHasScaling( const bool value ) - { - myHasScaling = value; - } - - - LayoutGroupPtr Defaults::getLayoutGroup() const - { - return myLayoutGroup; - } - - - void Defaults::setLayoutGroup( const LayoutGroupPtr& value ) - { - if ( value ) - { - myLayoutGroup = value; - } - } - - - AppearancePtr Defaults::getAppearance() const - { - return myAppearance; - } - - - void Defaults::setAppearance( const AppearancePtr& value ) - { - if( value ) - { - myAppearance = value; - } - } - - - bool Defaults::getHasAppearance() const - { - return myHasAppearance; - } - - - void Defaults::setHasAppearance( const bool value ) - { - myHasAppearance = value; - } - - - MusicFontPtr Defaults::getMusicFont() const - { - return myMusicFont; - } - - - void Defaults::setMusicFont( const MusicFontPtr& value ) - { - if( value ) - { - myMusicFont = value; - } - } - - - bool Defaults::getHasMusicFont() const - { - return myHasMusicFont; - } - - - void Defaults::setHasMusicFont( const bool value ) - { - myHasMusicFont = value; - } - - - WordFontPtr Defaults::getWordFont() const - { - return myWordFont; - } - - - void Defaults::setWordFont( const WordFontPtr& value ) - { - if( value ) - { - myWordFont = value; - } - } - - - bool Defaults::getHasWordFont() const - { - return myHasWordFont; - } - - - void Defaults::setHasWordFont( const bool value ) - { - myHasWordFont = value; - } - - - const LyricFontSet& Defaults::getLyricFontSet() const - { - return myLyricFontSet; - } - - - void Defaults::removeLyricFont( const LyricFontSetIterConst& value ) - { - if ( value != myLyricFontSet.cend() ) - { - myLyricFontSet.erase( value ); - } - } - - - void Defaults::addLyricFont( const LyricFontPtr& value ) - { - if ( value ) - { - myLyricFontSet.push_back( value ); - } - } - - - void Defaults::clearLyricFontSet() - { - myLyricFontSet.clear(); - } - - - LyricFontPtr Defaults::getLyricFont( const LyricFontSetIterConst& setIterator ) const - { - if( setIterator != myLyricFontSet.cend() ) - { - return *setIterator; - } - return LyricFontPtr(); - } - - - const LyricLanguageSet& Defaults::getLyricLanguageSet() const - { - return myLyricLanguageSet; - } - - - void Defaults::removeLyricLanguage( const LyricLanguageSetIterConst& value ) - { - if ( value != myLyricLanguageSet.cend() ) - { - myLyricLanguageSet.erase( value ); - } - } - - - void Defaults::addLyricLanguage( const LyricLanguagePtr& value ) - { - if ( value ) - { - myLyricLanguageSet.push_back( value ); - } - } - - - void Defaults::clearLyricLanguageSet() - { - myLyricLanguageSet.clear(); - } - - - LyricLanguagePtr Defaults::getLyricLanguage( const LyricLanguageSetIterConst& setIterator ) const - { - if( setIterator != myLyricLanguageSet.cend() ) - { - return *setIterator; - } - return LyricLanguagePtr(); - } - - - bool Defaults::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myScaling, myHasScaling ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myLayoutGroup ); - if ( importElement( message, *it, isSuccess, *myAppearance, myHasAppearance ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMusicFont, myHasMusicFont ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myWordFont, myHasWordFont ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "lyric-font", myLyricFontSet ); - importElementSet( message, it, endIter, isSuccess, "lyric-language", myLyricLanguageSet ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Defaults.h b/Sourcecode/private/mx/core/elements/Defaults.h deleted file mode 100644 index ebe5e9f7c..000000000 --- a/Sourcecode/private/mx/core/elements/Defaults.h +++ /dev/null @@ -1,100 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Appearance ) - MX_FORWARD_DECLARE_ELEMENT( LayoutGroup ) - MX_FORWARD_DECLARE_ELEMENT( LyricFont ) - MX_FORWARD_DECLARE_ELEMENT( LyricLanguage ) - MX_FORWARD_DECLARE_ELEMENT( MusicFont ) - MX_FORWARD_DECLARE_ELEMENT( Scaling ) - MX_FORWARD_DECLARE_ELEMENT( WordFont ) - MX_FORWARD_DECLARE_ELEMENT( Defaults ) - - inline DefaultsPtr makeDefaults() { return std::make_shared(); } - - class Defaults : public ElementInterface - { - public: - Defaults(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Scaling minOccurs = 0, maxOccurs = 1 _________ */ - ScalingPtr getScaling() const; - void setScaling( const ScalingPtr& value ); - bool getHasScaling() const; - void setHasScaling( const bool value ); - - /* _________ LayoutGroup minOccurs = 1, maxOccurs = 1 _________ */ - LayoutGroupPtr getLayoutGroup() const; - void setLayoutGroup( const LayoutGroupPtr& value ); - - /* _________ Appearance minOccurs = 0, maxOccurs = 1 _________ */ - AppearancePtr getAppearance() const; - void setAppearance( const AppearancePtr& value ); - bool getHasAppearance() const; - void setHasAppearance( const bool value ); - - /* _________ MusicFont minOccurs = 0, maxOccurs = 1 _________ */ - MusicFontPtr getMusicFont() const; - void setMusicFont( const MusicFontPtr& value ); - bool getHasMusicFont() const; - void setHasMusicFont( const bool value ); - - /* _________ WordFont minOccurs = 0, maxOccurs = 1 _________ */ - WordFontPtr getWordFont() const; - void setWordFont( const WordFontPtr& value ); - bool getHasWordFont() const; - void setHasWordFont( const bool value ); - - /* _________ LyricFont minOccurs = 0, maxOccurs = unbounded _________ */ - const LyricFontSet& getLyricFontSet() const; - void addLyricFont( const LyricFontPtr& value ); - void removeLyricFont( const LyricFontSetIterConst& value ); - void clearLyricFontSet(); - LyricFontPtr getLyricFont( const LyricFontSetIterConst& setIterator ) const; - - /* _________ LyricLanguage minOccurs = 0, maxOccurs = unbounded _________ */ - const LyricLanguageSet& getLyricLanguageSet() const; - void addLyricLanguage( const LyricLanguagePtr& value ); - void removeLyricLanguage( const LyricLanguageSetIterConst& value ); - void clearLyricLanguageSet(); - LyricLanguagePtr getLyricLanguage( const LyricLanguageSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ScalingPtr myScaling; - bool myHasScaling; - LayoutGroupPtr myLayoutGroup; - AppearancePtr myAppearance; - bool myHasAppearance; - MusicFontPtr myMusicFont; - bool myHasMusicFont; - WordFontPtr myWordFont; - bool myHasWordFont; - LyricFontSet myLyricFontSet; - LyricLanguageSet myLyricLanguageSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Degree.cpp b/Sourcecode/private/mx/core/elements/Degree.cpp deleted file mode 100644 index 1acd0d7c4..000000000 --- a/Sourcecode/private/mx/core/elements/Degree.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Degree.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/DegreeAlter.h" -#include "mx/core/elements/DegreeType.h" -#include "mx/core/elements/DegreeValue.h" -#include - -namespace mx -{ - namespace core - { - Degree::Degree() - :myAttributes( std::make_shared() ) - ,myDegreeValue( makeDegreeValue() ) - ,myDegreeAlter( makeDegreeAlter() ) - ,myDegreeType( makeDegreeType( DegreeTypeValue::add ) ) - {} - - - bool Degree::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Degree::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Degree::streamName( std::ostream& os ) const - { - os << "degree"; - return os; - } - - - bool Degree::hasContents() const - { - return true; - } - - - std::ostream& Degree::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myDegreeValue->toStream( os, indentLevel+1 ); - os << std::endl; - myDegreeAlter->toStream( os, indentLevel+1 ); - os << std::endl; - myDegreeType->toStream( os, indentLevel+1 ); - os << std::endl; - isOneLineOnly = false; - return os; - } - - - DegreeAttributesPtr Degree::getAttributes() const - { - return myAttributes; - } - - - void Degree::setAttributes( const DegreeAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - DegreeValuePtr Degree::getDegreeValue() const - { - return myDegreeValue; - } - - - void Degree::setDegreeValue( const DegreeValuePtr& value ) - { - if( value ) - { - myDegreeValue = value; - } - } - - - DegreeAlterPtr Degree::getDegreeAlter() const - { - return myDegreeAlter; - } - - - void Degree::setDegreeAlter( const DegreeAlterPtr& value ) - { - if( value ) - { - myDegreeAlter = value; - } - } - - - DegreeTypePtr Degree::getDegreeType() const - { - return myDegreeType; - } - - - void Degree::setDegreeType( const DegreeTypePtr& value ) - { - if( value ) - { - myDegreeType = value; - } - } - - - bool Degree::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isDegreeValueFound = false; - bool isDegreeAlterFound = false; - bool isDegreeTypeFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myDegreeValue, isDegreeValueFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myDegreeAlter, isDegreeAlterFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myDegreeType, isDegreeTypeFound ) ) { continue; } - } - - if( !isDegreeValueFound ) - { - message << "Degree: '" << myDegreeValue->getElementName() << "' is required but was not found" << std::endl; - } - if( !isDegreeAlterFound ) - { - message << "Degree: '" << myDegreeAlter->getElementName() << "' is required but was not found" << std::endl; - } - if( !isDegreeTypeFound ) - { - message << "Degree: '" << myDegreeType->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Degree.h b/Sourcecode/private/mx/core/elements/Degree.h deleted file mode 100644 index 47dd16194..000000000 --- a/Sourcecode/private/mx/core/elements/Degree.h +++ /dev/null @@ -1,63 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/DegreeAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DegreeAlter ) - MX_FORWARD_DECLARE_ELEMENT( DegreeType ) - MX_FORWARD_DECLARE_ELEMENT( DegreeValue ) - MX_FORWARD_DECLARE_ELEMENT( Degree ) - - inline DegreePtr makeDegree() { return std::make_shared(); } - - class Degree : public ElementInterface - { - public: - Degree(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DegreeAttributesPtr getAttributes() const; - void setAttributes( const DegreeAttributesPtr& value ); - - /* _________ DegreeValue minOccurs = 1, maxOccurs = 1 _________ */ - DegreeValuePtr getDegreeValue() const; - void setDegreeValue( const DegreeValuePtr& value ); - - /* _________ DegreeAlter minOccurs = 1, maxOccurs = 1 _________ */ - DegreeAlterPtr getDegreeAlter() const; - void setDegreeAlter( const DegreeAlterPtr& value ); - - /* _________ DegreeType minOccurs = 1, maxOccurs = 1 _________ */ - DegreeTypePtr getDegreeType() const; - void setDegreeType( const DegreeTypePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DegreeAttributesPtr myAttributes; - DegreeValuePtr myDegreeValue; - DegreeAlterPtr myDegreeAlter; - DegreeTypePtr myDegreeType; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeAlter.cpp b/Sourcecode/private/mx/core/elements/DegreeAlter.cpp deleted file mode 100644 index 577f9a1d3..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeAlter.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DegreeAlter.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DegreeAlter::DegreeAlter() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - DegreeAlter::DegreeAlter( const Semitones& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool DegreeAlter::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DegreeAlter::hasContents() const - { - return true; - } - - - std::ostream& DegreeAlter::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DegreeAlter::streamName( std::ostream& os ) const - { - os << "degree-alter"; - return os; - } - - - std::ostream& DegreeAlter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - DegreeAlterAttributesPtr DegreeAlter::getAttributes() const - { - return myAttributes; - } - - - void DegreeAlter::setAttributes( const DegreeAlterAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - Semitones DegreeAlter::getValue() const - { - return myValue; - } - - - void DegreeAlter::setValue( const Semitones& value ) - { - myValue = value; - } - - - bool DegreeAlter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeAlter.h b/Sourcecode/private/mx/core/elements/DegreeAlter.h deleted file mode 100644 index 8bc855ca1..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeAlter.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/elements/DegreeAlterAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeAlterAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DegreeAlter ) - - inline DegreeAlterPtr makeDegreeAlter() { return std::make_shared(); } - inline DegreeAlterPtr makeDegreeAlter( const Semitones& value ) { return std::make_shared( value ); } - inline DegreeAlterPtr makeDegreeAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class DegreeAlter : public ElementInterface - { - public: - DegreeAlter(); - DegreeAlter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DegreeAlterAttributesPtr getAttributes() const; - void setAttributes( const DegreeAlterAttributesPtr& attributes ); - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - DegreeAlterAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.cpp b/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.cpp deleted file mode 100644 index 976a1dc90..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DegreeAlterAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DegreeAlterAttributes::DegreeAlterAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,plusMinus( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlusMinus( false ) - {} - - - bool DegreeAlterAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlusMinus; - } - - - std::ostream& DegreeAlterAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, plusMinus, "plus-minus", hasPlusMinus ); - } - return os; - } - - - bool DegreeAlterAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DegreeAlterAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, plusMinus, hasPlusMinus, "plus-minus", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.h b/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.h deleted file mode 100644 index 796a9c81a..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeAlterAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeAlterAttributes ) - - struct DegreeAlterAttributes : public AttributesInterface - { - public: - DegreeAlterAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - YesNo plusMinus; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlusMinus; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeAttributes.cpp b/Sourcecode/private/mx/core/elements/DegreeAttributes.cpp deleted file mode 100644 index 4ba2969aa..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DegreeAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DegreeAttributes::DegreeAttributes() - :printObject( YesNo::no ) - ,hasPrintObject( false ) - {} - - - bool DegreeAttributes::hasValues() const - { - return hasPrintObject; - } - - - std::ostream& DegreeAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } - - - bool DegreeAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DegreeAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeAttributes.h b/Sourcecode/private/mx/core/elements/DegreeAttributes.h deleted file mode 100644 index c94899a05..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeAttributes ) - - struct DegreeAttributes : public AttributesInterface - { - public: - DegreeAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - bool hasPrintObject; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeType.cpp b/Sourcecode/private/mx/core/elements/DegreeType.cpp deleted file mode 100644 index 16d337a72..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeType.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DegreeType.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DegreeType::DegreeType() - :myValue( DegreeTypeValue::add ) - ,myAttributes( std::make_shared() ) - {} - - - DegreeType::DegreeType( const DegreeTypeValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool DegreeType::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DegreeType::hasContents() const - { - return true; - } - - - std::ostream& DegreeType::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DegreeType::streamName( std::ostream& os ) const - { - os << "degree-type"; - return os; - } - - - std::ostream& DegreeType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - DegreeTypeAttributesPtr DegreeType::getAttributes() const - { - return myAttributes; - } - - - void DegreeType::setAttributes( const DegreeTypeAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - DegreeTypeValue DegreeType::getValue() const - { - return myValue; - } - - - void DegreeType::setValue( const DegreeTypeValue& value ) - { - myValue = value; - } - - - bool DegreeType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseDegreeTypeValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeType.h b/Sourcecode/private/mx/core/elements/DegreeType.h deleted file mode 100644 index 537862b96..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeType.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/DegreeTypeAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeTypeAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DegreeType ) - - inline DegreeTypePtr makeDegreeType() { return std::make_shared(); } - inline DegreeTypePtr makeDegreeType( const DegreeTypeValue& value ) { return std::make_shared( value ); } - inline DegreeTypePtr makeDegreeType( DegreeTypeValue&& value ) { return std::make_shared( std::move( value ) ); } - - class DegreeType : public ElementInterface - { - public: - DegreeType(); - DegreeType( const DegreeTypeValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DegreeTypeAttributesPtr getAttributes() const; - void setAttributes( const DegreeTypeAttributesPtr& attributes ); - DegreeTypeValue getValue() const; - void setValue( const DegreeTypeValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DegreeTypeValue myValue; - DegreeTypeAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.cpp b/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.cpp deleted file mode 100644 index 7e9c1cc88..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DegreeTypeAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DegreeTypeAttributes::DegreeTypeAttributes() - :text() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasText( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool DegreeTypeAttributes::hasValues() const - { - return hasText || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& DegreeTypeAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, text, "text", hasText ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool DegreeTypeAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DegreeTypeAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, text, hasText, "text" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.h b/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.h deleted file mode 100644 index 52a7b3284..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeTypeAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeTypeAttributes ) - - struct DegreeTypeAttributes : public AttributesInterface - { - public: - DegreeTypeAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken text; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasText; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeValue.cpp b/Sourcecode/private/mx/core/elements/DegreeValue.cpp deleted file mode 100644 index 415f907dd..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeValue.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DegreeValue.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DegreeValue::DegreeValue() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - DegreeValue::DegreeValue( const PositiveInteger& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool DegreeValue::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DegreeValue::hasContents() const - { - return true; - } - - - std::ostream& DegreeValue::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DegreeValue::streamName( std::ostream& os ) const - { - os << "degree-value"; - return os; - } - - - std::ostream& DegreeValue::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - DegreeValueAttributesPtr DegreeValue::getAttributes() const - { - return myAttributes; - } - - - void DegreeValue::setAttributes( const DegreeValueAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - PositiveInteger DegreeValue::getValue() const - { - return myValue; - } - - - void DegreeValue::setValue( const PositiveInteger& value ) - { - myValue = value; - } - - - bool DegreeValue::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeValue.h b/Sourcecode/private/mx/core/elements/DegreeValue.h deleted file mode 100644 index 45df3fbce..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeValue.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" -#include "mx/core/elements/DegreeValueAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeValueAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DegreeValue ) - - inline DegreeValuePtr makeDegreeValue() { return std::make_shared(); } - inline DegreeValuePtr makeDegreeValue( const PositiveInteger& value ) { return std::make_shared( value ); } - inline DegreeValuePtr makeDegreeValue( PositiveInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class DegreeValue : public ElementInterface - { - public: - DegreeValue(); - DegreeValue( const PositiveInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DegreeValueAttributesPtr getAttributes() const; - void setAttributes( const DegreeValueAttributesPtr& attributes ); - PositiveInteger getValue() const; - void setValue( const PositiveInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveInteger myValue; - DegreeValueAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeValueAttributes.cpp b/Sourcecode/private/mx/core/elements/DegreeValueAttributes.cpp deleted file mode 100644 index c7165edc8..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeValueAttributes.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DegreeValueAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DegreeValueAttributes::DegreeValueAttributes() - :symbol() - ,text() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasSymbol( false ) - ,hasText( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool DegreeValueAttributes::hasValues() const - { - return hasSymbol || - hasText || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& DegreeValueAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, symbol, "symbol", hasSymbol ); - streamAttribute( os, text, "text", hasText ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool DegreeValueAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DegreeValueAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, symbol, hasSymbol, "symbol", &parseDegreeSymbolValue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, text, hasText, "text" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DegreeValueAttributes.h b/Sourcecode/private/mx/core/elements/DegreeValueAttributes.h deleted file mode 100644 index b82046808..000000000 --- a/Sourcecode/private/mx/core/elements/DegreeValueAttributes.h +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DegreeValueAttributes ) - - struct DegreeValueAttributes : public AttributesInterface - { - public: - DegreeValueAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - DegreeSymbolValue symbol; - XsToken text; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasSymbol; - bool hasText; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.cpp b/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.cpp deleted file mode 100644 index b1dbd429d..000000000 --- a/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DelayedInvertedTurn.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DelayedInvertedTurn::DelayedInvertedTurn() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool DelayedInvertedTurn::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DelayedInvertedTurn::hasContents() const { return false; } - std::ostream& DelayedInvertedTurn::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DelayedInvertedTurn::streamName( std::ostream& os ) const { os << "delayed-inverted-turn"; return os; } - std::ostream& DelayedInvertedTurn::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - DelayedInvertedTurnAttributesPtr DelayedInvertedTurn::getAttributes() const - { - return myAttributes; - } - - - void DelayedInvertedTurn::setAttributes( const DelayedInvertedTurnAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool DelayedInvertedTurn::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.h b/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.h deleted file mode 100644 index eda170488..000000000 --- a/Sourcecode/private/mx/core/elements/DelayedInvertedTurn.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/DelayedInvertedTurnAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DelayedInvertedTurnAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DelayedInvertedTurn ) - - inline DelayedInvertedTurnPtr makeDelayedInvertedTurn() { return std::make_shared(); } - - class DelayedInvertedTurn : public ElementInterface - { - public: - DelayedInvertedTurn(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DelayedInvertedTurnAttributesPtr getAttributes() const; - void setAttributes( const DelayedInvertedTurnAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DelayedInvertedTurnAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.cpp b/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.cpp deleted file mode 100644 index cb53ade94..000000000 --- a/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DelayedInvertedTurnAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DelayedInvertedTurnAttributes::DelayedInvertedTurnAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,placement( AboveBelow::below ) - ,startNote( StartNote::main ) - ,trillStep() - ,twoNoteTurn( TwoNoteTurn::none ) - ,accelerate( YesNo::no ) - ,beats() - ,secondBeat() - ,lastBeat() - ,slash( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - ,hasStartNote( false ) - ,hasTrillStep( false ) - ,hasTwoNoteTurn( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasSecondBeat( false ) - ,hasLastBeat( false ) - ,hasSlash( false ) - {} - - - bool DelayedInvertedTurnAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement || - hasStartNote || - hasTrillStep || - hasTwoNoteTurn || - hasAccelerate || - hasBeats || - hasSecondBeat || - hasLastBeat || - hasSlash; - } - - - std::ostream& DelayedInvertedTurnAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, startNote, "start-note", hasStartNote ); - streamAttribute( os, trillStep, "trill-step", hasTrillStep ); - streamAttribute( os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, secondBeat, "second-beat", hasSecondBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - streamAttribute( os, slash, "slash", hasSlash ); - } - return os; - } - - - bool DelayedInvertedTurnAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DelayedInvertedTurnAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", &parseTwoNoteTurn ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, slash, hasSlash, "slash", &parseYesNo ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.h b/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.h deleted file mode 100644 index f5fbbf9b6..000000000 --- a/Sourcecode/private/mx/core/elements/DelayedInvertedTurnAttributes.h +++ /dev/null @@ -1,70 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DelayedInvertedTurnAttributes ) - - struct DelayedInvertedTurnAttributes : public AttributesInterface - { - public: - DelayedInvertedTurnAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - StartNote startNote; - TrillStep trillStep; - TwoNoteTurn twoNoteTurn; - YesNo accelerate; - TrillBeats beats; - Percent secondBeat; - Percent lastBeat; - YesNo slash; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - bool hasStartNote; - bool hasTrillStep; - bool hasTwoNoteTurn; - bool hasAccelerate; - bool hasBeats; - bool hasSecondBeat; - bool hasLastBeat; - bool hasSlash; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DelayedTurn.cpp b/Sourcecode/private/mx/core/elements/DelayedTurn.cpp deleted file mode 100644 index 7cab64b7c..000000000 --- a/Sourcecode/private/mx/core/elements/DelayedTurn.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DelayedTurn.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DelayedTurn::DelayedTurn() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool DelayedTurn::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DelayedTurn::hasContents() const { return false; } - std::ostream& DelayedTurn::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DelayedTurn::streamName( std::ostream& os ) const { os << "delayed-turn"; return os; } - std::ostream& DelayedTurn::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - DelayedTurnAttributesPtr DelayedTurn::getAttributes() const - { - return myAttributes; - } - - - void DelayedTurn::setAttributes( const DelayedTurnAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool DelayedTurn::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DelayedTurn.h b/Sourcecode/private/mx/core/elements/DelayedTurn.h deleted file mode 100644 index f14ecf259..000000000 --- a/Sourcecode/private/mx/core/elements/DelayedTurn.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/DelayedTurnAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DelayedTurnAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DelayedTurn ) - - inline DelayedTurnPtr makeDelayedTurn() { return std::make_shared(); } - - class DelayedTurn : public ElementInterface - { - public: - DelayedTurn(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DelayedTurnAttributesPtr getAttributes() const; - void setAttributes( const DelayedTurnAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DelayedTurnAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.cpp b/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.cpp deleted file mode 100644 index e38b8d826..000000000 --- a/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DelayedTurnAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DelayedTurnAttributes::DelayedTurnAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,placement( AboveBelow::below ) - ,startNote( StartNote::main ) - ,trillStep() - ,twoNoteTurn( TwoNoteTurn::none ) - ,accelerate( YesNo::no ) - ,beats() - ,secondBeat() - ,lastBeat() - ,slash( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - ,hasStartNote( false ) - ,hasTrillStep( false ) - ,hasTwoNoteTurn( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasSecondBeat( false ) - ,hasLastBeat( false ) - ,hasSlash( false ) - {} - - - bool DelayedTurnAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement || - hasStartNote || - hasTrillStep || - hasTwoNoteTurn || - hasAccelerate || - hasBeats || - hasSecondBeat || - hasLastBeat || - hasSlash; - } - - - std::ostream& DelayedTurnAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, startNote, "start-note", hasStartNote ); - streamAttribute( os, trillStep, "trill-step", hasTrillStep ); - streamAttribute( os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, secondBeat, "second-beat", hasSecondBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - streamAttribute( os, slash, "slash", hasSlash ); - } - return os; - } - - - bool DelayedTurnAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DelayedTurnAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", &parseTwoNoteTurn ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, slash, hasSlash, "slash", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.h b/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.h deleted file mode 100644 index 83dfcbaf7..000000000 --- a/Sourcecode/private/mx/core/elements/DelayedTurnAttributes.h +++ /dev/null @@ -1,70 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DelayedTurnAttributes ) - - struct DelayedTurnAttributes : public AttributesInterface - { - public: - DelayedTurnAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - StartNote startNote; - TrillStep trillStep; - TwoNoteTurn twoNoteTurn; - YesNo accelerate; - TrillBeats beats; - Percent secondBeat; - Percent lastBeat; - YesNo slash; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - bool hasStartNote; - bool hasTrillStep; - bool hasTwoNoteTurn; - bool hasAccelerate; - bool hasBeats; - bool hasSecondBeat; - bool hasLastBeat; - bool hasSlash; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DetachedLegato.cpp b/Sourcecode/private/mx/core/elements/DetachedLegato.cpp deleted file mode 100644 index 5cfba02a5..000000000 --- a/Sourcecode/private/mx/core/elements/DetachedLegato.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DetachedLegato.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DetachedLegato::DetachedLegato() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool DetachedLegato::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DetachedLegato::hasContents() const { return false; } - std::ostream& DetachedLegato::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DetachedLegato::streamName( std::ostream& os ) const { os << "detached-legato"; return os; } - std::ostream& DetachedLegato::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr DetachedLegato::getAttributes() const - { - return myAttributes; - } - - - void DetachedLegato::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool DetachedLegato::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DetachedLegato.h b/Sourcecode/private/mx/core/elements/DetachedLegato.h deleted file mode 100644 index feef90c79..000000000 --- a/Sourcecode/private/mx/core/elements/DetachedLegato.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DetachedLegato ) - - inline DetachedLegatoPtr makeDetachedLegato() { return std::make_shared(); } - - class DetachedLegato : public ElementInterface - { - public: - DetachedLegato(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Diatonic.cpp b/Sourcecode/private/mx/core/elements/Diatonic.cpp deleted file mode 100644 index 6e9e6ef8f..000000000 --- a/Sourcecode/private/mx/core/elements/Diatonic.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Diatonic.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Diatonic::Diatonic() - :myValue() - {} - - - Diatonic::Diatonic( const Integer& value ) - :myValue( value ) - {} - - - bool Diatonic::hasAttributes() const - { - return false; - } - - - bool Diatonic::hasContents() const - { - return true; - } - - - std::ostream& Diatonic::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Diatonic::streamName( std::ostream& os ) const - { - os << "diatonic"; - return os; - } - - - std::ostream& Diatonic::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Integer Diatonic::getValue() const - { - return myValue; - } - - - void Diatonic::setValue( const Integer& value ) - { - myValue = value; - } - - - bool Diatonic::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Diatonic.h b/Sourcecode/private/mx/core/elements/Diatonic.h deleted file mode 100644 index c7014a3b8..000000000 --- a/Sourcecode/private/mx/core/elements/Diatonic.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Diatonic ) - - inline DiatonicPtr makeDiatonic() { return std::make_shared(); } - inline DiatonicPtr makeDiatonic( const Integer& value ) { return std::make_shared( value ); } - inline DiatonicPtr makeDiatonic( Integer&& value ) { return std::make_shared( std::move( value ) ); } - - class Diatonic : public ElementInterface - { - public: - Diatonic(); - Diatonic( const Integer& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Integer getValue() const; - void setValue( const Integer& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Integer myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Direction.cpp b/Sourcecode/private/mx/core/elements/Direction.cpp deleted file mode 100644 index 210142971..000000000 --- a/Sourcecode/private/mx/core/elements/Direction.cpp +++ /dev/null @@ -1,731 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Direction.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/DirectionType.h" -#include "mx/core/elements/EditorialVoiceDirectionGroup.h" -#include "mx/core/elements/Footnote.h" -#include "mx/core/elements/Level.h" -#include "mx/core/elements/Offset.h" -#include "mx/core/elements/Sound.h" -#include "mx/core/elements/Staff.h" -#include "mx/core/elements/Voice.h" - - -#include "mx/core/elements/AccordionRegistration.h" -#include "mx/core/elements/Bracket.h" -#include "mx/core/elements/Coda.h" -#include "mx/core/elements/Damp.h" -#include "mx/core/elements/DampAll.h" -#include "mx/core/elements/Dashes.h" -#include "mx/core/elements/Dynamics.h" -#include "mx/core/elements/Eyeglasses.h" -#include "mx/core/elements/HarpPedals.h" -#include "mx/core/elements/Image.h" -#include "mx/core/elements/Metronome.h" -#include "mx/core/elements/OctaveShift.h" -#include "mx/core/elements/OtherDirection.h" -#include "mx/core/elements/Pedal.h" -#include "mx/core/elements/Percussion.h" -#include "mx/core/elements/PrincipalVoice.h" -#include "mx/core/elements/Rehearsal.h" -#include "mx/core/elements/Scordatura.h" -#include "mx/core/elements/Segno.h" -#include "mx/core/elements/StringMute.h" -#include "mx/core/elements/Wedge.h" -#include "mx/core/elements/Words.h" - -#include -#include -#include - -namespace -{ - - constexpr const size_t directionsSize = 22; - constexpr const char* const directions[] = - { - "rehearsal", - "segno", - "words", - "coda", - "wedge", - "dynamics", - "dashes", - "bracket", - "pedal", - "metronome", - "octave-shift", - "harp-pedals", - "damp", - "damp-all", - "eyeglasses", - "string-mute", - "scordatura", - "image", - "principal-voice", - "accordion-registration", - "percussion", - "other-direction" - }; - - - constexpr const size_t multiDirectionsSize = 6; - constexpr const char* const multiDirections[] = - { - "rehearsal", - "segno", - "words", - "coda", - "dynamics", - "percussion" - }; -} - -namespace mx -{ - namespace core - { - Direction::Direction() - :myAttributes( std::make_shared() ) - ,myDirectionTypeSet() - ,myOffset( makeOffset() ) - ,myHasOffset( false ) - ,myEditorialVoiceDirectionGroup( makeEditorialVoiceDirectionGroup() ) - ,myStaff( makeStaff() ) - ,myHasStaff( false ) - ,mySound( makeSound() ) - ,myHasSound( false ) - { - myDirectionTypeSet.push_back( makeDirectionType() ); - } - - - bool Direction::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Direction::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Direction::streamName( std::ostream& os ) const - { - os << "direction"; - return os; - } - - - bool Direction::hasContents() const - { - return true; - } - - - std::ostream& Direction::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto x : myDirectionTypeSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasOffset ) - { - os << std::endl; - myOffset->toStream( os, indentLevel+1 ); - } - if ( myEditorialVoiceDirectionGroup->hasContents() ) - { - os << std::endl; - myEditorialVoiceDirectionGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasStaff ) - { - os << std::endl; - myStaff->toStream( os, indentLevel+1 ); - } - if ( myHasSound ) - { - os << std::endl; - mySound->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - DirectionAttributesPtr Direction::getAttributes() const - { - return myAttributes; - } - - - void Direction::setAttributes( const DirectionAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const DirectionTypeSet& Direction::getDirectionTypeSet() const - { - return myDirectionTypeSet; - } - - - void Direction::addDirectionType( const DirectionTypePtr& value ) - { - if ( value ) - { - myDirectionTypeSet.push_back( value ); - } - } - - - void Direction::removeDirectionType( const DirectionTypeSetIterConst& value ) - { - if ( value != myDirectionTypeSet.cend() ) - { - if( myDirectionTypeSet.size() > 1 ) - { - myDirectionTypeSet.erase( value ); - } - } - } - - - void Direction::clearDirectionTypeSet() - { - myDirectionTypeSet.clear(); - myDirectionTypeSet.push_back( makeDirectionType() ); - } - - - DirectionTypePtr Direction::getDirectionType( const DirectionTypeSetIterConst& setIterator ) const - { - if( setIterator != myDirectionTypeSet.cend() ) - { - return *setIterator; - } - return DirectionTypePtr(); - } - - - OffsetPtr Direction::getOffset() const - { - return myOffset; - } - - - void Direction::setOffset( const OffsetPtr& value ) - { - if ( value ) - { - myOffset = value; - } - } - - - bool Direction::getHasOffset() const - { - return myHasOffset; - } - - - void Direction::setHasOffset( const bool value ) - { - myHasOffset = value; - } - - - EditorialVoiceDirectionGroupPtr Direction::getEditorialVoiceDirectionGroup() const - { - return myEditorialVoiceDirectionGroup; - } - - - void Direction::setEditorialVoiceDirectionGroup( const EditorialVoiceDirectionGroupPtr& value ) - { - if ( value ) - { - myEditorialVoiceDirectionGroup = value; - } - } - - - StaffPtr Direction::getStaff() const - { - return myStaff; - } - - - void Direction::setStaff( const StaffPtr& value ) - { - if ( value ) - { - myStaff = value; - } - } - - - bool Direction::getHasStaff() const - { - return myHasStaff; - } - - - void Direction::setHasStaff( const bool value ) - { - myHasStaff = value; - } - - - SoundPtr Direction::getSound() const - { - return mySound; - } - - - void Direction::setSound( const SoundPtr& value ) - { - if ( value ) - { - mySound = value; - } - } - - - bool Direction::getHasSound() const - { - return myHasSound; - } - - - void Direction::setHasSound( const bool value ) - { - myHasSound = value; - } - - - bool Direction::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isDirectionTypeFound = false; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importDirectionTypeSet( message, it, endIter, isSuccess, isDirectionTypeFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myOffset, myHasOffset ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialVoiceDirectionGroup ); - if ( importElement( message, *it, isSuccess, *myStaff, myHasStaff ) ) { continue; } - if ( importElement( message, *it, isSuccess, *mySound, myHasSound ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - - bool Direction::importDirectionTypeSet( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess, bool& isFound ) - { - if( iter == endIter ) - { - isFound = false; - return false; - } - - if( iter->getName() != "direction-type" ) - { - isFound = false; - return false; - } - - isFound = true; - bool isIterIncremented = false; - bool isFirstDirectionTypeAdded = false; - - while( ( iter != endIter ) && ( iter->getName() == "direction-type" ) ) - { - auto subiter = iter->begin(); - auto subiterEnd = iter->end(); - - auto directionType = createDirectionType( message, subiter, subiterEnd, isSuccess ); - - if( !isFirstDirectionTypeAdded && myDirectionTypeSet.size() == 1 ) - { - *myDirectionTypeSet.begin() = directionType; - isFirstDirectionTypeAdded = true; - } - else - { - myDirectionTypeSet.push_back( directionType ); - isFirstDirectionTypeAdded = true; - } - - isIterIncremented = true; - ++iter; - } - - if( isIterIncremented ) - { - --iter; - } - return isFirstDirectionTypeAdded; - } - - - bool Direction::isDirectionType( const std::string& elementName ) const - { - for( size_t i = 0; i < directionsSize; ++i ) - { - if( strcmp( directions[i], elementName.c_str() ) == 0 ) - { - return true; - } - } - return false; - } - - - bool Direction::isMultiDirectionType( const std::string& elementName ) const - { - for( size_t i = 0; i < multiDirectionsSize; ++i ) - { - if( strcmp( multiDirections[i], elementName.c_str() ) == 0 ) - { - return true; - } - } - return false; - } - - - DirectionTypePtr Direction::createDirectionType( std::ostream& message, ::ezxml::XElementIterator& subIter, ::ezxml::XElementIterator& subIterEnd, bool& isSuccess ) - { - auto directionType = makeDirectionType(); - - if( subIter == subIterEnd ) - { - message << "Direction: well thats weird - should not get here" << std::endl; - isSuccess = false; - return directionType; - } - - if( subIter->getName() == "wedge" ) - { - directionType->setChoice( DirectionType::Choice::wedge ); - isSuccess &= directionType->getWedge()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "dashes" ) - { - directionType->setChoice( DirectionType::Choice::dashes ); - isSuccess &= directionType->getDashes()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "bracket" ) - { - directionType->setChoice( DirectionType::Choice::bracket ); - isSuccess &= directionType->getBracket()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "pedal" ) - { - directionType->setChoice( DirectionType::Choice::pedal ); - isSuccess &= directionType->getPedal()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "metronome" ) - { - directionType->setChoice( DirectionType::Choice::metronome ); - isSuccess &= directionType->getMetronome()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "octave-shift" ) - { - directionType->setChoice( DirectionType::Choice::octaveShift ); - isSuccess &= directionType->getOctaveShift()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "harp-pedals" ) - { - directionType->setChoice( DirectionType::Choice::harpPedals ); - isSuccess &= directionType->getHarpPedals()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "damp" ) - { - directionType->setChoice( DirectionType::Choice::damp ); - isSuccess &= directionType->getDamp()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "damp-all" ) - { - directionType->setChoice( DirectionType::Choice::dampAll ); - isSuccess &= directionType->getDampAll()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "eyeglasses" ) - { - directionType->setChoice( DirectionType::Choice::eyeglasses ); - isSuccess &= directionType->getEyeglasses()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "string-mute" ) - { - directionType->setChoice( DirectionType::Choice::stringMute ); - isSuccess &= directionType->getStringMute()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "scordatura" ) - { - directionType->setChoice( DirectionType::Choice::scordatura ); - isSuccess &= directionType->getScordatura()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "image" ) - { - directionType->setChoice( DirectionType::Choice::image ); - isSuccess &= directionType->getImage()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "principal-voice" ) - { - directionType->setChoice( DirectionType::Choice::principalVoice ); - isSuccess &= directionType->getPrincipalVoice()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "accordion-registration" ) - { - directionType->setChoice( DirectionType::Choice::accordionRegistration ); - isSuccess &= directionType->getAccordionRegistration()->fromXElement( message, *subIter ); - return directionType; - } - - if( subIter->getName() == "other-direction" ) - { - directionType->setChoice( DirectionType::Choice::otherDirection ); - isSuccess &= directionType->getOtherDirection()->fromXElement( message, *subIter ); - return directionType; - } - - std::string name = "rehearsal"; - if( subIter->getName() == name ) - { - directionType->setChoice( DirectionType::Choice::rehearsal ); - bool isFirstSubItemAdded = false; - - while( subIter != subIterEnd ) - { - if( subIter->getName() != name ) - { - message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() << "' while parsing a collection of '" << name << "' elements" << std::endl; - isSuccess = false; - return directionType; - } - auto itemToAdd = makeRehearsal(); - isSuccess &= itemToAdd->fromXElement( message, *subIter ); - if( !isFirstSubItemAdded && directionType->getRehearsalSet().size() == 1 ) - { - directionType->addRehearsal( itemToAdd ); - directionType->removeRehearsal( directionType->getRehearsalSet().cbegin() ); - } - else - { - directionType->addRehearsal( itemToAdd ); - } - isFirstSubItemAdded = true; - ++subIter; - } // end loop - return directionType; - } // end rehearsal - - - name = "segno"; - if( subIter->getName() == name ) - { - directionType->setChoice( DirectionType::Choice::segno ); - bool isFirstSubItemAdded = false; - - while( subIter != subIterEnd ) - { - if( subIter->getName() != name ) - { - message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() << "' while parsing a collection of '" << name << "' elements" << std::endl; - isSuccess = false; - return directionType; - } - auto itemToAdd = makeSegno(); - isSuccess &= itemToAdd->fromXElement( message, *subIter ); - if( !isFirstSubItemAdded && directionType->getSegnoSet().size() == 1 ) - { - directionType->addSegno( itemToAdd ); - directionType->removeSegno( directionType->getSegnoSet().cbegin() ); - } - else - { - directionType->addSegno( itemToAdd ); - } - isFirstSubItemAdded = true; - ++subIter; - } // end loop - return directionType; - } // end segno - - - name = "words"; - if( subIter->getName() == name ) - { - directionType->setChoice( DirectionType::Choice::words ); - bool isFirstSubItemAdded = false; - - while( subIter != subIterEnd ) - { - if( subIter->getName() != name ) - { - message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() << "' while parsing a collection of '" << name << "' elements" << std::endl; - isSuccess = false; - return directionType; - } - auto itemToAdd = makeWords(); - isSuccess &= itemToAdd->fromXElement( message, *subIter ); - if( !isFirstSubItemAdded && directionType->getWordsSet().size() == 1 ) - { - directionType->addWords( itemToAdd ); - directionType->removeWords( directionType->getWordsSet().cbegin() ); - } - else - { - directionType->addWords( itemToAdd ); - } - isFirstSubItemAdded = true; - ++subIter; - } // end loop - return directionType; - } // end words - - - name = "coda"; - if( subIter->getName() == name ) - { - directionType->setChoice( DirectionType::Choice::coda ); - bool isFirstSubItemAdded = false; - - while( subIter != subIterEnd ) - { - if( subIter->getName() != name ) - { - message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() << "' while parsing a collection of '" << name << "' elements" << std::endl; - isSuccess = false; - return directionType; - } - auto itemToAdd = makeCoda(); - isSuccess &= itemToAdd->fromXElement( message, *subIter ); - if( !isFirstSubItemAdded && directionType->getCodaSet().size() == 1 ) - { - directionType->addCoda( itemToAdd ); - directionType->removeCoda( directionType->getCodaSet().cbegin() ); - } - else - { - directionType->addCoda( itemToAdd ); - } - isFirstSubItemAdded = true; - ++subIter; - } // end loop - return directionType; - } // end coda - - - name = "dynamics"; - if( subIter->getName() == name ) - { - directionType->setChoice( DirectionType::Choice::dynamics ); - bool isFirstSubItemAdded = false; - - while( subIter != subIterEnd ) - { - if( subIter->getName() != name ) - { - message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() << "' while parsing a collection of '" << name << "' elements" << std::endl; - isSuccess = false; - return directionType; - } - auto itemToAdd = makeDynamics(); - isSuccess &= itemToAdd->fromXElement( message, *subIter ); - if( !isFirstSubItemAdded && directionType->getDynamicsSet().size() == 1 ) - { - directionType->addDynamics( itemToAdd ); - directionType->removeDynamics( directionType->getDynamicsSet().cbegin() ); - } - else - { - directionType->addDynamics( itemToAdd ); - } - isFirstSubItemAdded = true; - ++subIter; - } // end loop - return directionType; - } // end dynamics - - - name = "percussion"; - if( subIter->getName() == name ) - { - directionType->setChoice( DirectionType::Choice::percussion ); - bool isFirstSubItemAdded = false; - - while( subIter != subIterEnd ) - { - if( subIter->getName() != name ) - { - message << "Direction: createDirectionType encountered an unexpected element '" << subIter->getName() << "' while parsing a collection of '" << name << "' elements" << std::endl; - isSuccess = false; - return directionType; - } - auto itemToAdd = makePercussion(); - isSuccess &= itemToAdd->fromXElement( message, *subIter ); - if( !isFirstSubItemAdded && directionType->getPercussionSet().size() == 1 ) - { - directionType->addPercussion( itemToAdd ); - directionType->removePercussion( directionType->getPercussionSet().cbegin() ); - } - else - { - directionType->addPercussion( itemToAdd ); - } - isFirstSubItemAdded = true; - ++subIter; - } // end loop - return directionType; - } // end percussion - - return directionType; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Direction.h b/Sourcecode/private/mx/core/elements/Direction.h deleted file mode 100644 index 9e56128f3..000000000 --- a/Sourcecode/private/mx/core/elements/Direction.h +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/DirectionAttributes.h" - -#include -#include -#include - -namespace ezxml -{ - class XElementIterator; -} - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DirectionAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DirectionType ) - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceDirectionGroup ) - MX_FORWARD_DECLARE_ELEMENT( Offset ) - MX_FORWARD_DECLARE_ELEMENT( Sound ) - MX_FORWARD_DECLARE_ELEMENT( Staff ) - MX_FORWARD_DECLARE_ELEMENT( Direction ) - - inline DirectionPtr makeDirection() { return std::make_shared(); } - - class Direction : public ElementInterface - { - public: - Direction(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DirectionAttributesPtr getAttributes() const; - void setAttributes( const DirectionAttributesPtr& value ); - - /* _________ DirectionType minOccurs = 1, maxOccurs = unbounded _________ */ - const DirectionTypeSet& getDirectionTypeSet() const; - void addDirectionType( const DirectionTypePtr& value ); - void removeDirectionType( const DirectionTypeSetIterConst& value ); - void clearDirectionTypeSet(); - DirectionTypePtr getDirectionType( const DirectionTypeSetIterConst& setIterator ) const; - - /* _________ Offset minOccurs = 0, maxOccurs = 1 _________ */ - OffsetPtr getOffset() const; - void setOffset( const OffsetPtr& value ); - bool getHasOffset() const; - void setHasOffset( const bool value ); - - /* _________ EditorialVoiceDirectionGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialVoiceDirectionGroupPtr getEditorialVoiceDirectionGroup() const; - void setEditorialVoiceDirectionGroup( const EditorialVoiceDirectionGroupPtr& value ); - - /* _________ Staff minOccurs = 0, maxOccurs = 1 _________ */ - StaffPtr getStaff() const; - void setStaff( const StaffPtr& value ); - bool getHasStaff() const; - void setHasStaff( const bool value ); - - /* _________ Sound minOccurs = 0, maxOccurs = 1 _________ */ - SoundPtr getSound() const; - void setSound( const SoundPtr& value ); - bool getHasSound() const; - void setHasSound( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DirectionAttributesPtr myAttributes; - DirectionTypeSet myDirectionTypeSet; - OffsetPtr myOffset; - bool myHasOffset; - EditorialVoiceDirectionGroupPtr myEditorialVoiceDirectionGroup; - StaffPtr myStaff; - bool myHasStaff; - SoundPtr mySound; - bool myHasSound; - - bool importDirectionTypeSet( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess, bool& isFound ); - DirectionTypePtr createDirectionType( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess ); - - bool isDirectionType( const std::string& elementName ) const; - bool isMultiDirectionType( const std::string& elementName ) const; - - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DirectionAttributes.cpp b/Sourcecode/private/mx/core/elements/DirectionAttributes.cpp deleted file mode 100644 index 91189d6dd..000000000 --- a/Sourcecode/private/mx/core/elements/DirectionAttributes.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DirectionAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DirectionAttributes::DirectionAttributes() - :placement( AboveBelow::below ) - ,directive( YesNo::no ) - ,hasPlacement( false ) - ,hasDirective( false ) - {} - - - bool DirectionAttributes::hasValues() const - { - return hasPlacement || - hasDirective; - } - - - std::ostream& DirectionAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, directive, "directive", hasDirective ); - } - return os; - } - - - bool DirectionAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DirectionAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, directive, hasDirective, "directive", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DirectionAttributes.h b/Sourcecode/private/mx/core/elements/DirectionAttributes.h deleted file mode 100644 index 80a611eb2..000000000 --- a/Sourcecode/private/mx/core/elements/DirectionAttributes.h +++ /dev/null @@ -1,37 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DirectionAttributes ) - - struct DirectionAttributes : public AttributesInterface - { - public: - DirectionAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - AboveBelow placement; - YesNo directive; - bool hasPlacement; - bool hasDirective; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DirectionType.cpp b/Sourcecode/private/mx/core/elements/DirectionType.cpp deleted file mode 100644 index b6a664d9f..000000000 --- a/Sourcecode/private/mx/core/elements/DirectionType.cpp +++ /dev/null @@ -1,799 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DirectionType.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/AccordionRegistration.h" -#include "mx/core/elements/Bracket.h" -#include "mx/core/elements/Coda.h" -#include "mx/core/elements/Damp.h" -#include "mx/core/elements/DampAll.h" -#include "mx/core/elements/Dashes.h" -#include "mx/core/elements/Dynamics.h" -#include "mx/core/elements/Eyeglasses.h" -#include "mx/core/elements/HarpPedals.h" -#include "mx/core/elements/Image.h" -#include "mx/core/elements/Metronome.h" -#include "mx/core/elements/OctaveShift.h" -#include "mx/core/elements/OtherDirection.h" -#include "mx/core/elements/Pedal.h" -#include "mx/core/elements/Percussion.h" -#include "mx/core/elements/PrincipalVoice.h" -#include "mx/core/elements/Rehearsal.h" -#include "mx/core/elements/Scordatura.h" -#include "mx/core/elements/Segno.h" -#include "mx/core/elements/StringMute.h" -#include "mx/core/elements/Wedge.h" -#include "mx/core/elements/Words.h" -#include - -namespace mx -{ - namespace core - { - DirectionType::DirectionType() - :myChoice( Choice::rehearsal ) - ,myRehearsalSet() - ,mySegnoSet() - ,myWordsSet() - ,myCodaSet() - ,myWedge( makeWedge() ) - ,myDynamicsSet() - ,myDashes( makeDashes() ) - ,myBracket( makeBracket() ) - ,myPedal( makePedal() ) - ,myMetronome( makeMetronome() ) - ,myOctaveShift( makeOctaveShift() ) - ,myHarpPedals( makeHarpPedals() ) - ,myDamp( makeDamp() ) - ,myDampAll( makeDampAll() ) - ,myEyeglasses( makeEyeglasses() ) - ,myStringMute( makeStringMute() ) - ,myScordatura( makeScordatura() ) - ,myImage( makeImage() ) - ,myPrincipalVoice( makePrincipalVoice() ) - ,myAccordionRegistration( makeAccordionRegistration() ) - ,myPercussionSet() - ,myOtherDirection( makeOtherDirection() ) - { - myRehearsalSet.push_back( makeRehearsal() ); - mySegnoSet.push_back( makeSegno() ); - myWordsSet.push_back( makeWords() ); - myCodaSet.push_back( makeCoda() ); - myDynamicsSet.push_back( makeDynamics() ); - myPercussionSet.push_back( makePercussion() ); - } - - - bool DirectionType::hasAttributes() const - { - return false; - } - - - std::ostream& DirectionType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& DirectionType::streamName( std::ostream& os ) const - { - os << "direction-type"; - return os; - } - - - bool DirectionType::hasContents() const - { - return true; - } - - - std::ostream& DirectionType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - //streamOpenTag( os ); - //os << std::endl; - switch ( myChoice ) - { - case Choice::rehearsal: - { - for( auto x : myRehearsalSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - break; - case Choice::segno: - { - for( auto x : mySegnoSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - break; - case Choice::words: - { - for( auto x : myWordsSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - break; - case Choice::coda: - { - for( auto x : myCodaSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - break; - case Choice::wedge: - { - os << std::endl; - myWedge->toStream( os, indentLevel+1 ); - } - break; - case Choice::dynamics: - { - for( auto x : myDynamicsSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - break; - case Choice::dashes: - { - os << std::endl; - myDashes->toStream( os, indentLevel+1 ); - } - break; - case Choice::bracket: - { - os << std::endl; - myBracket->toStream( os, indentLevel+1 ); - } - break; - case Choice::pedal: - { - os << std::endl; - myPedal->toStream( os, indentLevel+1 ); - } - break; - case Choice::metronome: - { - os << std::endl; - myMetronome->toStream( os, indentLevel+1 ); - } - break; - case Choice::octaveShift: - { - os << std::endl; - myOctaveShift->toStream( os, indentLevel+1 ); - } - break; - case Choice::harpPedals: - { - os << std::endl; - myHarpPedals->toStream( os, indentLevel+1 ); - } - break; - case Choice::damp: - { - os << std::endl; - myDamp->toStream( os, indentLevel+1 ); - } - break; - case Choice::dampAll: - { - os << std::endl; - myDampAll->toStream( os, indentLevel+1 ); - } - break; - case Choice::eyeglasses: - { - os << std::endl; - myEyeglasses->toStream( os, indentLevel+1 ); - } - break; - case Choice::stringMute: - { - os << std::endl; - myStringMute->toStream( os, indentLevel+1 ); - } - break; - case Choice::scordatura: - { - os << std::endl; - myScordatura->toStream( os, indentLevel+1 ); - } - break; - case Choice::image: - { - os << std::endl; - myImage->toStream( os, indentLevel+1 ); - } - break; - case Choice::principalVoice: - { - os << std::endl; - myPrincipalVoice->toStream( os, indentLevel+1 ); - } - break; - case Choice::accordionRegistration: - { - os << std::endl; - myAccordionRegistration->toStream( os, indentLevel+1 ); - } - break; - case Choice::percussion: - { - for( auto x : myPercussionSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - break; - case Choice::otherDirection: - { - os << std::endl; - myOtherDirection->toStream( os, indentLevel+1 ); - } - break; - default: - break; - } - //os << std::endl; - //streamCloseTag( os ); - os << std::endl; - isOneLineOnly = false; - return os; - } - - - DirectionType::Choice DirectionType::getChoice() const - { - return myChoice; - } - - - void DirectionType::setChoice( const DirectionType::Choice value ) - { - myChoice = value; - } - - - const RehearsalSet& DirectionType::getRehearsalSet() const - { - return myRehearsalSet; - } - - - void DirectionType::removeRehearsal( const RehearsalSetIterConst& value ) - { - if ( value != myRehearsalSet.cend() ) - { - if ( myRehearsalSet.size() > 1 ) - { - myRehearsalSet.erase( value ); - } - } - } - - - void DirectionType::addRehearsal( const RehearsalPtr& value ) - { - if ( value ) - { - myRehearsalSet.push_back( value ); - } - } - - - void DirectionType::clearRehearsalSet() - { - myRehearsalSet.clear(); - while( myRehearsalSet.size() < 1 ) - { - myRehearsalSet.push_back( makeRehearsal() ); - } - } - - - RehearsalPtr DirectionType::getRehearsal( const RehearsalSetIterConst& setIterator ) const - { - if( setIterator != myRehearsalSet.cend() ) - { - return *setIterator; - } - return RehearsalPtr(); - } - - - const SegnoSet& DirectionType::getSegnoSet() const - { - return mySegnoSet; - } - - - void DirectionType::removeSegno( const SegnoSetIterConst& value ) - { - if ( value != mySegnoSet.cend() ) - { - if ( mySegnoSet.size() > 1 ) - { - mySegnoSet.erase( value ); - } - } - } - - - void DirectionType::addSegno( const SegnoPtr& value ) - { - if ( value ) - { - mySegnoSet.push_back( value ); - } - } - - - void DirectionType::clearSegnoSet() - { - mySegnoSet.clear(); - while( mySegnoSet.size() < 1 ) - { - mySegnoSet.push_back( makeSegno() ); - } - } - - - SegnoPtr DirectionType::getSegno( const SegnoSetIterConst& setIterator ) const - { - if( setIterator != mySegnoSet.cend() ) - { - return *setIterator; - } - return SegnoPtr(); - } - - - const WordsSet& DirectionType::getWordsSet() const - { - return myWordsSet; - } - - - void DirectionType::removeWords( const WordsSetIterConst& value ) - { - if ( value != myWordsSet.cend() ) - { - if ( myWordsSet.size() > 1 ) - { - myWordsSet.erase( value ); - } - } - } - - - void DirectionType::addWords( const WordsPtr& value ) - { - if ( value ) - { - myWordsSet.push_back( value ); - } - } - - - void DirectionType::clearWordsSet() - { - myWordsSet.clear(); - while( myWordsSet.size() < 1 ) - { - myWordsSet.push_back( makeWords() ); - } - } - - - WordsPtr DirectionType::getWords( const WordsSetIterConst& setIterator ) const - { - if( setIterator != myWordsSet.cend() ) - { - return *setIterator; - } - return WordsPtr(); - } - - - const CodaSet& DirectionType::getCodaSet() const - { - return myCodaSet; - } - - - void DirectionType::removeCoda( const CodaSetIterConst& value ) - { - if ( value != myCodaSet.cend() ) - { - if ( myCodaSet.size() > 1 ) - { - myCodaSet.erase( value ); - } - } - } - - - void DirectionType::addCoda( const CodaPtr& value ) - { - if ( value ) - { - myCodaSet.push_back( value ); - } - } - - - void DirectionType::clearCodaSet() - { - myCodaSet.clear(); - while( myCodaSet.size() < 1 ) - { - myCodaSet.push_back( makeCoda() ); - } - } - - - CodaPtr DirectionType::getCoda( const CodaSetIterConst& setIterator ) const - { - if( setIterator != myCodaSet.cend() ) - { - return *setIterator; - } - return CodaPtr(); - } - - - WedgePtr DirectionType::getWedge() const - { - return myWedge; - } - - - void DirectionType::setWedge( const WedgePtr& value ) - { - if( value ) - { - myWedge = value; - } - } - - - const DynamicsSet& DirectionType::getDynamicsSet() const - { - return myDynamicsSet; - } - - - void DirectionType::removeDynamics( const DynamicsSetIterConst& value ) - { - if ( value != myDynamicsSet.cend() ) - { - if ( myDynamicsSet.size() > 1 ) - { - myDynamicsSet.erase( value ); - } - } - } - - - void DirectionType::addDynamics( const DynamicsPtr& value ) - { - if ( value ) - { - myDynamicsSet.push_back( value ); - } - } - - - void DirectionType::clearDynamicsSet() - { - myDynamicsSet.clear(); - while( myDynamicsSet.size() < 1 ) - { - myDynamicsSet.push_back( makeDynamics() ); - } - } - - - DynamicsPtr DirectionType::getDynamics( const DynamicsSetIterConst& setIterator ) const - { - if( setIterator != myDynamicsSet.cend() ) - { - return *setIterator; - } - return DynamicsPtr(); - } - - - DashesPtr DirectionType::getDashes() const - { - return myDashes; - } - - - void DirectionType::setDashes( const DashesPtr& value ) - { - if( value ) - { - myDashes = value; - } - } - - - BracketPtr DirectionType::getBracket() const - { - return myBracket; - } - - - void DirectionType::setBracket( const BracketPtr& value ) - { - if( value ) - { - myBracket = value; - } - } - - - PedalPtr DirectionType::getPedal() const - { - return myPedal; - } - - - void DirectionType::setPedal( const PedalPtr& value ) - { - if( value ) - { - myPedal = value; - } - } - - - MetronomePtr DirectionType::getMetronome() const - { - return myMetronome; - } - - - void DirectionType::setMetronome( const MetronomePtr& value ) - { - if( value ) - { - myMetronome = value; - } - } - - - OctaveShiftPtr DirectionType::getOctaveShift() const - { - return myOctaveShift; - } - - - void DirectionType::setOctaveShift( const OctaveShiftPtr& value ) - { - if( value ) - { - myOctaveShift = value; - } - } - - - HarpPedalsPtr DirectionType::getHarpPedals() const - { - return myHarpPedals; - } - - - void DirectionType::setHarpPedals( const HarpPedalsPtr& value ) - { - if( value ) - { - myHarpPedals = value; - } - } - - - DampPtr DirectionType::getDamp() const - { - return myDamp; - } - - - void DirectionType::setDamp( const DampPtr& value ) - { - if( value ) - { - myDamp = value; - } - } - - - DampAllPtr DirectionType::getDampAll() const - { - return myDampAll; - } - - - void DirectionType::setDampAll( const DampAllPtr& value ) - { - if( value ) - { - myDampAll = value; - } - } - - - EyeglassesPtr DirectionType::getEyeglasses() const - { - return myEyeglasses; - } - - - void DirectionType::setEyeglasses( const EyeglassesPtr& value ) - { - if( value ) - { - myEyeglasses = value; - } - } - - - StringMutePtr DirectionType::getStringMute() const - { - return myStringMute; - } - - - void DirectionType::setStringMute( const StringMutePtr& value ) - { - if( value ) - { - myStringMute = value; - } - } - - - ScordaturaPtr DirectionType::getScordatura() const - { - return myScordatura; - } - - - void DirectionType::setScordatura( const ScordaturaPtr& value ) - { - if( value ) - { - myScordatura = value; - } - } - - - ImagePtr DirectionType::getImage() const - { - return myImage; - } - - - void DirectionType::setImage( const ImagePtr& value ) - { - if( value ) - { - myImage = value; - } - } - - - PrincipalVoicePtr DirectionType::getPrincipalVoice() const - { - return myPrincipalVoice; - } - - - void DirectionType::setPrincipalVoice( const PrincipalVoicePtr& value ) - { - if( value ) - { - myPrincipalVoice = value; - } - } - - - AccordionRegistrationPtr DirectionType::getAccordionRegistration() const - { - return myAccordionRegistration; - } - - - void DirectionType::setAccordionRegistration( const AccordionRegistrationPtr& value ) - { - if( value ) - { - myAccordionRegistration = value; - } - } - - - const PercussionSet& DirectionType::getPercussionSet() const - { - return myPercussionSet; - } - - - void DirectionType::removePercussion( const PercussionSetIterConst& value ) - { - if ( value != myPercussionSet.cend() ) - { - if ( myPercussionSet.size() > 1 ) - { - myPercussionSet.erase( value ); - } - } - } - - - void DirectionType::addPercussion( const PercussionPtr& value ) - { - if ( value ) - { - myPercussionSet.push_back( value ); - } - } - - - void DirectionType::clearPercussionSet() - { - myPercussionSet.clear(); - while( myPercussionSet.size() < 1 ) - { - myPercussionSet.push_back( makePercussion() ); - } - } - - - PercussionPtr DirectionType::getPercussion( const PercussionSetIterConst& setIterator ) const - { - if( setIterator != myPercussionSet.cend() ) - { - return *setIterator; - } - return PercussionPtr(); - } - - - OtherDirectionPtr DirectionType::getOtherDirection() const - { - return myOtherDirection; - } - - - void DirectionType::setOtherDirection( const OtherDirectionPtr& value ) - { - if( value ) - { - myOtherDirection = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( DirectionType ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/DirectionType.h b/Sourcecode/private/mx/core/elements/DirectionType.h deleted file mode 100644 index 7a59aeb56..000000000 --- a/Sourcecode/private/mx/core/elements/DirectionType.h +++ /dev/null @@ -1,218 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccordionRegistration ) - MX_FORWARD_DECLARE_ELEMENT( Bracket ) - MX_FORWARD_DECLARE_ELEMENT( Coda ) - MX_FORWARD_DECLARE_ELEMENT( Damp ) - MX_FORWARD_DECLARE_ELEMENT( DampAll ) - MX_FORWARD_DECLARE_ELEMENT( Dashes ) - MX_FORWARD_DECLARE_ELEMENT( Dynamics ) - MX_FORWARD_DECLARE_ELEMENT( Eyeglasses ) - MX_FORWARD_DECLARE_ELEMENT( HarpPedals ) - MX_FORWARD_DECLARE_ELEMENT( Image ) - MX_FORWARD_DECLARE_ELEMENT( Metronome ) - MX_FORWARD_DECLARE_ELEMENT( OctaveShift ) - MX_FORWARD_DECLARE_ELEMENT( OtherDirection ) - MX_FORWARD_DECLARE_ELEMENT( Pedal ) - MX_FORWARD_DECLARE_ELEMENT( Percussion ) - MX_FORWARD_DECLARE_ELEMENT( PrincipalVoice ) - MX_FORWARD_DECLARE_ELEMENT( Rehearsal ) - MX_FORWARD_DECLARE_ELEMENT( Scordatura ) - MX_FORWARD_DECLARE_ELEMENT( Segno ) - MX_FORWARD_DECLARE_ELEMENT( StringMute ) - MX_FORWARD_DECLARE_ELEMENT( Wedge ) - MX_FORWARD_DECLARE_ELEMENT( Words ) - MX_FORWARD_DECLARE_ELEMENT( DirectionType ) - - inline DirectionTypePtr makeDirectionType() { return std::make_shared(); } - - class DirectionType : public ElementInterface - { - public: - enum class Choice - { - rehearsal = 1, - segno = 2, - words = 3, - coda = 4, - wedge = 5, - dynamics = 6, - dashes = 7, - bracket = 8, - pedal = 9, - metronome = 10, - octaveShift = 11, - harpPedals = 12, - damp = 13, - dampAll = 14, - eyeglasses = 15, - stringMute = 16, - scordatura = 17, - image = 18, - principalVoice = 19, - accordionRegistration = 20, - percussion = 21, - otherDirection = 22 - }; - DirectionType(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DirectionType::Choice getChoice() const; - void setChoice( const DirectionType::Choice value ); - - /* _________ Rehearsal minOccurs = 1, maxOccurs = unbounded _________ */ - const RehearsalSet& getRehearsalSet() const; - void addRehearsal( const RehearsalPtr& value ); - void removeRehearsal( const RehearsalSetIterConst& value ); - void clearRehearsalSet(); - RehearsalPtr getRehearsal( const RehearsalSetIterConst& setIterator ) const; - - /* _________ Segno minOccurs = 1, maxOccurs = unbounded _________ */ - const SegnoSet& getSegnoSet() const; - void addSegno( const SegnoPtr& value ); - void removeSegno( const SegnoSetIterConst& value ); - void clearSegnoSet(); - SegnoPtr getSegno( const SegnoSetIterConst& setIterator ) const; - - /* _________ Words minOccurs = 1, maxOccurs = unbounded _________ */ - const WordsSet& getWordsSet() const; - void addWords( const WordsPtr& value ); - void removeWords( const WordsSetIterConst& value ); - void clearWordsSet(); - WordsPtr getWords( const WordsSetIterConst& setIterator ) const; - - /* _________ Coda minOccurs = 1, maxOccurs = unbounded _________ */ - const CodaSet& getCodaSet() const; - void addCoda( const CodaPtr& value ); - void removeCoda( const CodaSetIterConst& value ); - void clearCodaSet(); - CodaPtr getCoda( const CodaSetIterConst& setIterator ) const; - - /* _________ Wedge minOccurs = 1, maxOccurs = 1 _________ */ - WedgePtr getWedge() const; - void setWedge( const WedgePtr& value ); - - /* _________ Dynamics minOccurs = 1, maxOccurs = unbounded _________ */ - const DynamicsSet& getDynamicsSet() const; - void addDynamics( const DynamicsPtr& value ); - void removeDynamics( const DynamicsSetIterConst& value ); - void clearDynamicsSet(); - DynamicsPtr getDynamics( const DynamicsSetIterConst& setIterator ) const; - - /* _________ Dashes minOccurs = 1, maxOccurs = 1 _________ */ - DashesPtr getDashes() const; - void setDashes( const DashesPtr& value ); - - /* _________ Bracket minOccurs = 1, maxOccurs = 1 _________ */ - BracketPtr getBracket() const; - void setBracket( const BracketPtr& value ); - - /* _________ Pedal minOccurs = 1, maxOccurs = 1 _________ */ - PedalPtr getPedal() const; - void setPedal( const PedalPtr& value ); - - /* _________ Metronome minOccurs = 1, maxOccurs = 1 _________ */ - MetronomePtr getMetronome() const; - void setMetronome( const MetronomePtr& value ); - - /* _________ OctaveShift minOccurs = 1, maxOccurs = 1 _________ */ - OctaveShiftPtr getOctaveShift() const; - void setOctaveShift( const OctaveShiftPtr& value ); - - /* _________ HarpPedals minOccurs = 1, maxOccurs = 1 _________ */ - HarpPedalsPtr getHarpPedals() const; - void setHarpPedals( const HarpPedalsPtr& value ); - - /* _________ Damp minOccurs = 1, maxOccurs = 1 _________ */ - DampPtr getDamp() const; - void setDamp( const DampPtr& value ); - - /* _________ DampAll minOccurs = 1, maxOccurs = 1 _________ */ - DampAllPtr getDampAll() const; - void setDampAll( const DampAllPtr& value ); - - /* _________ Eyeglasses minOccurs = 1, maxOccurs = 1 _________ */ - EyeglassesPtr getEyeglasses() const; - void setEyeglasses( const EyeglassesPtr& value ); - - /* _________ StringMute minOccurs = 1, maxOccurs = 1 _________ */ - StringMutePtr getStringMute() const; - void setStringMute( const StringMutePtr& value ); - - /* _________ Scordatura minOccurs = 1, maxOccurs = 1 _________ */ - ScordaturaPtr getScordatura() const; - void setScordatura( const ScordaturaPtr& value ); - - /* _________ Image minOccurs = 1, maxOccurs = 1 _________ */ - ImagePtr getImage() const; - void setImage( const ImagePtr& value ); - - /* _________ PrincipalVoice minOccurs = 1, maxOccurs = 1 _________ */ - PrincipalVoicePtr getPrincipalVoice() const; - void setPrincipalVoice( const PrincipalVoicePtr& value ); - - /* _________ AccordionRegistration minOccurs = 1, maxOccurs = 1 _________ */ - AccordionRegistrationPtr getAccordionRegistration() const; - void setAccordionRegistration( const AccordionRegistrationPtr& value ); - - /* _________ Percussion minOccurs = 1, maxOccurs = unbounded _________ */ - const PercussionSet& getPercussionSet() const; - void addPercussion( const PercussionPtr& value ); - void removePercussion( const PercussionSetIterConst& value ); - void clearPercussionSet(); - PercussionPtr getPercussion( const PercussionSetIterConst& setIterator ) const; - - /* _________ OtherDirection minOccurs = 1, maxOccurs = 1 _________ */ - OtherDirectionPtr getOtherDirection() const; - void setOtherDirection( const OtherDirectionPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - RehearsalSet myRehearsalSet; - SegnoSet mySegnoSet; - WordsSet myWordsSet; - CodaSet myCodaSet; - WedgePtr myWedge; - DynamicsSet myDynamicsSet; - DashesPtr myDashes; - BracketPtr myBracket; - PedalPtr myPedal; - MetronomePtr myMetronome; - OctaveShiftPtr myOctaveShift; - HarpPedalsPtr myHarpPedals; - DampPtr myDamp; - DampAllPtr myDampAll; - EyeglassesPtr myEyeglasses; - StringMutePtr myStringMute; - ScordaturaPtr myScordatura; - ImagePtr myImage; - PrincipalVoicePtr myPrincipalVoice; - AccordionRegistrationPtr myAccordionRegistration; - PercussionSet myPercussionSet; - OtherDirectionPtr myOtherDirection; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Directive.cpp b/Sourcecode/private/mx/core/elements/Directive.cpp deleted file mode 100644 index 54d72f123..000000000 --- a/Sourcecode/private/mx/core/elements/Directive.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Directive.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Directive::Directive() - :myAttributes( std::make_shared() ) - ,myValue() - {} - - - Directive::Directive( const XsString& value ) - :myAttributes( std::make_shared() ) - ,myValue( value ) - {} - - - bool Directive::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Directive::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Directive::streamName( std::ostream& os ) const - { - os << "directive"; - return os; - } - - - bool Directive::hasContents() const - { - return true; - } - - - std::ostream& Directive::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - MX_UNUSED( isOneLineOnly ); - isOneLineOnly = true; - core::toStream( os, myValue ); - return os; - } - - - DirectiveAttributesPtr Directive::getAttributes() const - { - return myAttributes; - } - - - void Directive::setAttributes( const DirectiveAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Directive::getValue() const - { - return myValue; - } - - - void Directive::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Directive::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Directive.h b/Sourcecode/private/mx/core/elements/Directive.h deleted file mode 100644 index 22f324cec..000000000 --- a/Sourcecode/private/mx/core/elements/Directive.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/DirectiveAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DirectiveAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Directive ) - - inline DirectivePtr makeDirective() { return std::make_shared(); } - inline DirectivePtr makeDirective( const XsString& value ) { return std::make_shared( value ); } - inline DirectivePtr makeDirective( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Directive : public ElementInterface - { - public: - Directive(); - Directive( const XsString& value ); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DirectiveAttributesPtr getAttributes() const; - void setAttributes( const DirectiveAttributesPtr& value ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DirectiveAttributesPtr myAttributes; - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DirectiveAttributes.cpp b/Sourcecode/private/mx/core/elements/DirectiveAttributes.cpp deleted file mode 100644 index 10b53bc2e..000000000 --- a/Sourcecode/private/mx/core/elements/DirectiveAttributes.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DirectiveAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DirectiveAttributes::DirectiveAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,lang( "it" ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasLang( false ) - {} - - - bool DirectiveAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasLang; - } - - - std::ostream& DirectiveAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, lang, "xml:lang", hasLang ); - } - return os; - } - - - bool DirectiveAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DirectiveAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DirectiveAttributes.h b/Sourcecode/private/mx/core/elements/DirectiveAttributes.h deleted file mode 100644 index b698e8b26..000000000 --- a/Sourcecode/private/mx/core/elements/DirectiveAttributes.h +++ /dev/null @@ -1,55 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/XmlLang.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DirectiveAttributes ) - - struct DirectiveAttributes : public AttributesInterface - { - public: - DirectiveAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - XmlLang lang; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasLang; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DisplayOctave.cpp b/Sourcecode/private/mx/core/elements/DisplayOctave.cpp deleted file mode 100644 index e8c27e88d..000000000 --- a/Sourcecode/private/mx/core/elements/DisplayOctave.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DisplayOctave.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DisplayOctave::DisplayOctave() - :myValue() - {} - - - DisplayOctave::DisplayOctave( const OctaveValue& value ) - :myValue( value ) - {} - - - bool DisplayOctave::hasAttributes() const - { - return false; - } - - - bool DisplayOctave::hasContents() const - { - return true; - } - - - std::ostream& DisplayOctave::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& DisplayOctave::streamName( std::ostream& os ) const - { - os << "display-octave"; - return os; - } - - - std::ostream& DisplayOctave::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - OctaveValue DisplayOctave::getValue() const - { - return myValue; - } - - - void DisplayOctave::setValue( const OctaveValue& value ) - { - myValue = value; - } - - - bool DisplayOctave::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DisplayOctave.h b/Sourcecode/private/mx/core/elements/DisplayOctave.h deleted file mode 100644 index 4e1e1ab98..000000000 --- a/Sourcecode/private/mx/core/elements/DisplayOctave.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( DisplayOctave ) - - inline DisplayOctavePtr makeDisplayOctave() { return std::make_shared(); } - inline DisplayOctavePtr makeDisplayOctave( const OctaveValue& value ) { return std::make_shared( value ); } - inline DisplayOctavePtr makeDisplayOctave( OctaveValue&& value ) { return std::make_shared( std::move( value ) ); } - - class DisplayOctave : public ElementInterface - { - public: - DisplayOctave(); - DisplayOctave( const OctaveValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OctaveValue getValue() const; - void setValue( const OctaveValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - OctaveValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DisplayStep.cpp b/Sourcecode/private/mx/core/elements/DisplayStep.cpp deleted file mode 100644 index 972fb3373..000000000 --- a/Sourcecode/private/mx/core/elements/DisplayStep.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DisplayStep.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DisplayStep::DisplayStep() - :myValue( StepEnum::a ) - {} - - - DisplayStep::DisplayStep( const StepEnum& value ) - :myValue( value ) - {} - - - bool DisplayStep::hasAttributes() const - { - return false; - } - - - bool DisplayStep::hasContents() const - { - return true; - } - - - std::ostream& DisplayStep::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& DisplayStep::streamName( std::ostream& os ) const - { - os << "display-step"; - return os; - } - - - std::ostream& DisplayStep::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - StepEnum DisplayStep::getValue() const - { - return myValue; - } - - - void DisplayStep::setValue( const StepEnum& value ) - { - myValue = value; - } - - - bool DisplayStep::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseStepEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DisplayStep.h b/Sourcecode/private/mx/core/elements/DisplayStep.h deleted file mode 100644 index 2ff77b0eb..000000000 --- a/Sourcecode/private/mx/core/elements/DisplayStep.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( DisplayStep ) - - inline DisplayStepPtr makeDisplayStep() { return std::make_shared(); } - inline DisplayStepPtr makeDisplayStep( const StepEnum& value ) { return std::make_shared( value ); } - inline DisplayStepPtr makeDisplayStep( StepEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class DisplayStep : public ElementInterface - { - public: - DisplayStep(); - DisplayStep( const StepEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StepEnum getValue() const; - void setValue( const StepEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.cpp b/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.cpp deleted file mode 100644 index 9fb74402b..000000000 --- a/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DisplayStepOctaveGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/DisplayOctave.h" -#include "mx/core/elements/DisplayStep.h" -#include - -namespace mx -{ - namespace core - { - DisplayStepOctaveGroup::DisplayStepOctaveGroup() - :myDisplayStep( makeDisplayStep() ) - ,myDisplayOctave( makeDisplayOctave() ) - {} - - - bool DisplayStepOctaveGroup::hasAttributes() const - { - return false; - } - - - std::ostream& DisplayStepOctaveGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& DisplayStepOctaveGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool DisplayStepOctaveGroup::hasContents() const - { - return true; - } - - - std::ostream& DisplayStepOctaveGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( isOneLineOnly ); - myDisplayStep->toStream( os, indentLevel ); - os << std::endl; - myDisplayOctave->toStream( os, indentLevel ); - return os; - } - - - DisplayStepPtr DisplayStepOctaveGroup::getDisplayStep() const - { - return myDisplayStep; - } - - - void DisplayStepOctaveGroup::setDisplayStep( const DisplayStepPtr& value ) - { - if ( value ) - { - myDisplayStep = value; - } - } - - - DisplayOctavePtr DisplayStepOctaveGroup::getDisplayOctave() const - { - return myDisplayOctave; - } - - - void DisplayStepOctaveGroup::setDisplayOctave( const DisplayOctavePtr& value ) - { - if ( value ) - { - myDisplayOctave = value; - } - } - - - bool DisplayStepOctaveGroup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isDisplayStepFound = false; - bool isDisplayOctaveFound = false; - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - const std::string elementName = it->getName(); - - if( elementName == "display-step" ) - { - isDisplayStepFound = true; - isSuccess &= myDisplayStep->fromXElement( message, *it ); - } - else if( elementName == "display-octave" ) - { - isDisplayOctaveFound = true; - isSuccess &= myDisplayOctave->fromXElement( message, *it ); - } - else - { - if( !isDisplayStepFound ) - { - isSuccess = false; - message << "DisplayStepOctaveGroup: 'display-step' element is required but was not found" << std::endl; - } - if( !isDisplayOctaveFound ) - { - isSuccess = false; - message << "DisplayStepOctaveGroup: 'display-octave' element is required but was not found" << std::endl; - } - break; - } - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.h b/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.h deleted file mode 100644 index e81722348..000000000 --- a/Sourcecode/private/mx/core/elements/DisplayStepOctaveGroup.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( DisplayOctave ) - MX_FORWARD_DECLARE_ELEMENT( DisplayStep ) - MX_FORWARD_DECLARE_ELEMENT( DisplayStepOctaveGroup ) - - inline DisplayStepOctaveGroupPtr makeDisplayStepOctaveGroup() { return std::make_shared(); } - - class DisplayStepOctaveGroup : public ElementInterface - { - public: - DisplayStepOctaveGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ DisplayStep minOccurs = 1, maxOccurs = 1 _________ */ - DisplayStepPtr getDisplayStep() const; - void setDisplayStep( const DisplayStepPtr& value ); - - /* _________ DisplayOctave minOccurs = 1, maxOccurs = 1 _________ */ - DisplayOctavePtr getDisplayOctave() const; - void setDisplayOctave( const DisplayOctavePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DisplayStepPtr myDisplayStep; - DisplayOctavePtr myDisplayOctave; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DisplayText.cpp b/Sourcecode/private/mx/core/elements/DisplayText.cpp deleted file mode 100644 index 2ebfdc10e..000000000 --- a/Sourcecode/private/mx/core/elements/DisplayText.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DisplayText.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DisplayText::DisplayText() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - DisplayText::DisplayText( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool DisplayText::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DisplayText::hasContents() const - { - return true; - } - - - std::ostream& DisplayText::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DisplayText::streamName( std::ostream& os ) const - { - os << "display-text"; - return os; - } - - - std::ostream& DisplayText::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - DisplayTextAttributesPtr DisplayText::getAttributes() const - { - return myAttributes; - } - - - void DisplayText::setAttributes( const DisplayTextAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString DisplayText::getValue() const - { - return myValue; - } - - - void DisplayText::setValue( const XsString& value ) - { - myValue = value; - } - - - bool DisplayText::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DisplayText.h b/Sourcecode/private/mx/core/elements/DisplayText.h deleted file mode 100644 index b39dc3cc3..000000000 --- a/Sourcecode/private/mx/core/elements/DisplayText.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/DisplayTextAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DisplayTextAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DisplayText ) - - inline DisplayTextPtr makeDisplayText() { return std::make_shared(); } - inline DisplayTextPtr makeDisplayText( const XsString& value ) { return std::make_shared( value ); } - inline DisplayTextPtr makeDisplayText( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class DisplayText : public ElementInterface - { - public: - DisplayText(); - DisplayText( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DisplayTextAttributesPtr getAttributes() const; - void setAttributes( const DisplayTextAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - DisplayTextAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DisplayTextAttributes.cpp b/Sourcecode/private/mx/core/elements/DisplayTextAttributes.cpp deleted file mode 100644 index 1bf700804..000000000 --- a/Sourcecode/private/mx/core/elements/DisplayTextAttributes.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DisplayTextAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DisplayTextAttributes::DisplayTextAttributes() - :justify( LeftCenterRight::center ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lineHeight() - ,lang( XmlLang{ "it" } ) - ,space( XmlSpace::default_ ) - ,enclosure( EnclosureShape::rectangle ) - ,hasJustify( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLineHeight( false ) - ,hasLang( false ) - ,hasSpace( false ) - ,hasEnclosure( false ) - {} - - - bool DisplayTextAttributes::hasValues() const - { - return hasJustify || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLineHeight || - hasLang || - hasSpace || - hasEnclosure; - } - - - std::ostream& DisplayTextAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lineHeight, "line-height", hasLineHeight ); - streamAttribute( os, lang, "xml:lang", hasLang ); - streamAttribute( os, space, "xml:space", hasSpace ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } - - - bool DisplayTextAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DisplayTextAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DisplayTextAttributes.h b/Sourcecode/private/mx/core/elements/DisplayTextAttributes.h deleted file mode 100644 index 96cf5ffd8..000000000 --- a/Sourcecode/private/mx/core/elements/DisplayTextAttributes.h +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" -#include "mx/core/NumberOrNormal.h" -#include "mx/core/XmlLang.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DisplayTextAttributes ) - - struct DisplayTextAttributes : public AttributesInterface - { - public: - DisplayTextAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LeftCenterRight justify; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - NumberOrNormal lineHeight; - XmlLang lang; - XmlSpace space; - EnclosureShape enclosure; - bool hasJustify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLineHeight; - bool hasLang; - bool hasSpace; - bool hasEnclosure; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.cpp b/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.cpp deleted file mode 100644 index 248f686f4..000000000 --- a/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DisplayTextOrAccidentalText.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/AccidentalText.h" -#include "mx/core/elements/DisplayText.h" -#include - -namespace mx -{ - namespace core - { - DisplayTextOrAccidentalText::DisplayTextOrAccidentalText() - :myChoice( Choice::displayText ) - ,myDisplayText( makeDisplayText() ) - ,myAccidentalText( makeAccidentalText() ) - {} - - - bool DisplayTextOrAccidentalText::hasAttributes() const - { - return false; - } - - - std::ostream& DisplayTextOrAccidentalText::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& DisplayTextOrAccidentalText::streamName( std::ostream& os ) const - { - return os; - } - - - bool DisplayTextOrAccidentalText::hasContents() const - { - if ( myChoice == Choice::accidentalText ) - { - return myAccidentalText->hasContents(); - } - if ( myChoice == Choice::displayText ) - { - return myDisplayText->hasContents(); - } - return false; - } - - - std::ostream& DisplayTextOrAccidentalText::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( isOneLineOnly ); - if ( hasContents() ) - { - switch ( myChoice ) - { - case Choice::accidentalText: - { - myAccidentalText->toStream( os, indentLevel ); - } - break; - case Choice::displayText: - { - myDisplayText->toStream( os, indentLevel ); - } - break; - default: - break; - } - } - return os; - } - - - DisplayTextOrAccidentalText::Choice DisplayTextOrAccidentalText::getChoice() const - { - return myChoice; - } - - - void DisplayTextOrAccidentalText::setChoice( const DisplayTextOrAccidentalText::Choice value ) - { - myChoice = value; - } - - - DisplayTextPtr DisplayTextOrAccidentalText::getDisplayText() const - { - return myDisplayText; - } - - - void DisplayTextOrAccidentalText::setDisplayText( const DisplayTextPtr& value ) - { - if ( value ) - { - myDisplayText = value; - } - } - - - AccidentalTextPtr DisplayTextOrAccidentalText::getAccidentalText() const - { - return myAccidentalText; - } - - - void DisplayTextOrAccidentalText::setAccidentalText( const AccidentalTextPtr& value ) - { - if ( value ) - { - myAccidentalText = value; - } - } - - - bool DisplayTextOrAccidentalText::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_CHOICE_IF( displayText, "display-text", DisplayText ); - MX_CHOICE_IF( accidentalText, "accidental-text", AccidentalText ); - MX_BAD_ELEMENT_FAILURE( DisplayTextOrAccidentalText ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.h b/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.h deleted file mode 100644 index dca28ab2f..000000000 --- a/Sourcecode/private/mx/core/elements/DisplayTextOrAccidentalText.h +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( DisplayText ) - MX_FORWARD_DECLARE_ELEMENT( DisplayTextOrAccidentalText ) - - inline DisplayTextOrAccidentalTextPtr makeDisplayTextOrAccidentalText() { return std::make_shared(); } - - class DisplayTextOrAccidentalText : public ElementInterface - { - public: - enum class Choice - { - displayText = 1, - accidentalText = 2 - }; - DisplayTextOrAccidentalText(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DisplayTextOrAccidentalText::Choice getChoice() const; - void setChoice( const DisplayTextOrAccidentalText::Choice value ); - DisplayTextPtr getDisplayText() const; - void setDisplayText( const DisplayTextPtr& value ); - AccidentalTextPtr getAccidentalText() const; - void setAccidentalText( const AccidentalTextPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - DisplayTextPtr myDisplayText; - AccidentalTextPtr myAccidentalText; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Distance.cpp b/Sourcecode/private/mx/core/elements/Distance.cpp deleted file mode 100644 index 0b613e230..000000000 --- a/Sourcecode/private/mx/core/elements/Distance.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Distance.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Distance::Distance() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Distance::Distance( const TenthsValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Distance::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Distance::hasContents() const - { - return true; - } - - - std::ostream& Distance::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Distance::streamName( std::ostream& os ) const - { - os << "distance"; - return os; - } - - - std::ostream& Distance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - DistanceAttributesPtr Distance::getAttributes() const - { - return myAttributes; - } - - - void Distance::setAttributes( const DistanceAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - TenthsValue Distance::getValue() const - { - return myValue; - } - - - void Distance::setValue( const TenthsValue& value ) - { - myValue = value; - } - - - bool Distance::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Distance.h b/Sourcecode/private/mx/core/elements/Distance.h deleted file mode 100644 index ba745e1e3..000000000 --- a/Sourcecode/private/mx/core/elements/Distance.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/elements/DistanceAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DistanceAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Distance ) - - inline DistancePtr makeDistance() { return std::make_shared(); } - inline DistancePtr makeDistance( const TenthsValue& value ) { return std::make_shared( value ); } - inline DistancePtr makeDistance( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Distance : public ElementInterface - { - public: - Distance(); - Distance( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DistanceAttributesPtr getAttributes() const; - void setAttributes( const DistanceAttributesPtr& attributes ); - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - DistanceAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DistanceAttributes.cpp b/Sourcecode/private/mx/core/elements/DistanceAttributes.cpp deleted file mode 100644 index 42bdbba9c..000000000 --- a/Sourcecode/private/mx/core/elements/DistanceAttributes.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DistanceAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DistanceAttributes::DistanceAttributes() - :type() - ,hasType( true ) - {} - - - bool DistanceAttributes::hasValues() const - { - return hasType; - } - - - std::ostream& DistanceAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool DistanceAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DistanceAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DistanceAttributes.h b/Sourcecode/private/mx/core/elements/DistanceAttributes.h deleted file mode 100644 index d69bf7af3..000000000 --- a/Sourcecode/private/mx/core/elements/DistanceAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DistanceAttributes ) - - struct DistanceAttributes : public AttributesInterface - { - public: - DistanceAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - DistanceType type; - const bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Divisions.cpp b/Sourcecode/private/mx/core/elements/Divisions.cpp deleted file mode 100644 index dc865f84f..000000000 --- a/Sourcecode/private/mx/core/elements/Divisions.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Divisions.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Divisions::Divisions() - :myValue() - {} - - - Divisions::Divisions( const PositiveDivisionsValue& value ) - :myValue( value ) - {} - - - bool Divisions::hasAttributes() const - { - return false; - } - - - bool Divisions::hasContents() const - { - return true; - } - - - std::ostream& Divisions::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Divisions::streamName( std::ostream& os ) const - { - os << "divisions"; - return os; - } - - - std::ostream& Divisions::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PositiveDivisionsValue Divisions::getValue() const - { - return myValue; - } - - - void Divisions::setValue( const PositiveDivisionsValue& value ) - { - myValue = value; - } - - - bool Divisions::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Divisions.h b/Sourcecode/private/mx/core/elements/Divisions.h deleted file mode 100644 index b5a53a9d3..000000000 --- a/Sourcecode/private/mx/core/elements/Divisions.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Divisions ) - - inline DivisionsPtr makeDivisions() { return std::make_shared(); } - inline DivisionsPtr makeDivisions( const PositiveDivisionsValue& value ) { return std::make_shared( value ); } - inline DivisionsPtr makeDivisions( PositiveDivisionsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Divisions : public ElementInterface - { - public: - Divisions(); - Divisions( const PositiveDivisionsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PositiveDivisionsValue getValue() const; - void setValue( const PositiveDivisionsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveDivisionsValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Doit.cpp b/Sourcecode/private/mx/core/elements/Doit.cpp deleted file mode 100644 index 33c4c85b0..000000000 --- a/Sourcecode/private/mx/core/elements/Doit.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Doit.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Doit::Doit() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Doit::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Doit::hasContents() const { return false; } - std::ostream& Doit::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Doit::streamName( std::ostream& os ) const { os << "doit"; return os; } - std::ostream& Doit::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyLineAttributesPtr Doit::getAttributes() const - { - return myAttributes; - } - - - void Doit::setAttributes( const EmptyLineAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Doit::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Doit.h b/Sourcecode/private/mx/core/elements/Doit.h deleted file mode 100644 index 65e21ef5a..000000000 --- a/Sourcecode/private/mx/core/elements/Doit.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyLineAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyLineAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Doit ) - - inline DoitPtr makeDoit() { return std::make_shared(); } - - class Doit : public ElementInterface - { - public: - Doit(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyLineAttributesPtr getAttributes() const; - void setAttributes( const EmptyLineAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyLineAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Dot.cpp b/Sourcecode/private/mx/core/elements/Dot.cpp deleted file mode 100644 index d2270265c..000000000 --- a/Sourcecode/private/mx/core/elements/Dot.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Dot.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Dot::Dot() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Dot::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Dot::hasContents() const { return false; } - std::ostream& Dot::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Dot::streamName( std::ostream& os ) const { os << "dot"; return os; } - std::ostream& Dot::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr Dot::getAttributes() const - { - return myAttributes; - } - - - void Dot::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Dot::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Dot.h b/Sourcecode/private/mx/core/elements/Dot.h deleted file mode 100644 index 09b956b90..000000000 --- a/Sourcecode/private/mx/core/elements/Dot.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Dot ) - - inline DotPtr makeDot() { return std::make_shared(); } - - class Dot : public ElementInterface - { - public: - Dot(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Double.cpp b/Sourcecode/private/mx/core/elements/Double.cpp deleted file mode 100644 index 36f429309..000000000 --- a/Sourcecode/private/mx/core/elements/Double.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Double.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Double::Double() : ElementInterface() {} - - - bool Double::hasAttributes() const { return false; } - - - bool Double::hasContents() const { return false; } - std::ostream& Double::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Double::streamName( std::ostream& os ) const { os << "double"; return os; } - std::ostream& Double::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool Double::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Double.h b/Sourcecode/private/mx/core/elements/Double.h deleted file mode 100644 index 22866f740..000000000 --- a/Sourcecode/private/mx/core/elements/Double.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Double ) - - inline DoublePtr makeDouble() { return std::make_shared(); } - - class Double : public ElementInterface - { - public: - Double(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DoubleTongue.cpp b/Sourcecode/private/mx/core/elements/DoubleTongue.cpp deleted file mode 100644 index b2a949d65..000000000 --- a/Sourcecode/private/mx/core/elements/DoubleTongue.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DoubleTongue.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DoubleTongue::DoubleTongue() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool DoubleTongue::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DoubleTongue::hasContents() const { return false; } - std::ostream& DoubleTongue::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DoubleTongue::streamName( std::ostream& os ) const { os << "double-tongue"; return os; } - std::ostream& DoubleTongue::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr DoubleTongue::getAttributes() const - { - return myAttributes; - } - - - void DoubleTongue::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool DoubleTongue::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DoubleTongue.h b/Sourcecode/private/mx/core/elements/DoubleTongue.h deleted file mode 100644 index b643fcdda..000000000 --- a/Sourcecode/private/mx/core/elements/DoubleTongue.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DoubleTongue ) - - inline DoubleTonguePtr makeDoubleTongue() { return std::make_shared(); } - - class DoubleTongue : public ElementInterface - { - public: - DoubleTongue(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DownBow.cpp b/Sourcecode/private/mx/core/elements/DownBow.cpp deleted file mode 100644 index 4da6954cf..000000000 --- a/Sourcecode/private/mx/core/elements/DownBow.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DownBow.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DownBow::DownBow() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool DownBow::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool DownBow::hasContents() const { return false; } - std::ostream& DownBow::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& DownBow::streamName( std::ostream& os ) const { os << "down-bow"; return os; } - std::ostream& DownBow::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr DownBow::getAttributes() const - { - return myAttributes; - } - - - void DownBow::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool DownBow::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DownBow.h b/Sourcecode/private/mx/core/elements/DownBow.h deleted file mode 100644 index 76c6188f1..000000000 --- a/Sourcecode/private/mx/core/elements/DownBow.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DownBow ) - - inline DownBowPtr makeDownBow() { return std::make_shared(); } - - class DownBow : public ElementInterface - { - public: - DownBow(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Duration.cpp b/Sourcecode/private/mx/core/elements/Duration.cpp deleted file mode 100644 index 2c1819691..000000000 --- a/Sourcecode/private/mx/core/elements/Duration.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Duration.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Duration::Duration() - :myValue(1.0) - {} - - - Duration::Duration( const PositiveDivisionsValue& value ) - :myValue( value ) - {} - - - bool Duration::hasAttributes() const - { - return false; - } - - - bool Duration::hasContents() const - { - return true; - } - - - std::ostream& Duration::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Duration::streamName( std::ostream& os ) const - { - os << "duration"; - return os; - } - - - std::ostream& Duration::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PositiveDivisionsValue Duration::getValue() const - { - return myValue; - } - - - void Duration::setValue( const PositiveDivisionsValue& value ) - { - myValue = value; - } - - - bool Duration::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Duration.h b/Sourcecode/private/mx/core/elements/Duration.h deleted file mode 100644 index c75a3f3d9..000000000 --- a/Sourcecode/private/mx/core/elements/Duration.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Duration ) - - inline DurationPtr makeDuration() { return std::make_shared(); } - inline DurationPtr makeDuration( const PositiveDivisionsValue& value ) { return std::make_shared( value ); } - inline DurationPtr makeDuration( PositiveDivisionsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Duration : public ElementInterface - { - public: - Duration(); - Duration( const PositiveDivisionsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PositiveDivisionsValue getValue() const; - void setValue( const PositiveDivisionsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveDivisionsValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Dynamics.cpp b/Sourcecode/private/mx/core/elements/Dynamics.cpp deleted file mode 100644 index 56752ac72..000000000 --- a/Sourcecode/private/mx/core/elements/Dynamics.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Dynamics.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Dynamics::Dynamics( const DynamicsValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - Dynamics::Dynamics() - :myValue() - ,myAttributes( std::make_shared() ) - {} - std::ostream& Dynamics::streamName( std::ostream& os ) const - { - return os << "dynamics"; - } - - - std::ostream& Dynamics::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - if ( myValue.getValue() == DynamicsEnum::otherDynamics ) - { - indent( os, indentLevel + 1 ); - os << "<"; - core::toStream( os, myValue.getValue() ); - os << ">"; - os << myValue; - os << ""; - } - else - { - indent( os, indentLevel + 1 ); - os << "<"; - core::toStream( os, myValue.getValue() ); - os << "/>"; - } - os << std::endl; - return os; - } - - - DynamicsAttributesPtr Dynamics::getAttributes() const - { - return myAttributes; - } - - - bool Dynamics::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Dynamics::hasContents() const - { - return true; - } - - - std::ostream& Dynamics::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - DynamicsValue Dynamics::getValue() const - { - return myValue; - } - - - void Dynamics::setValue( const DynamicsValue& value ) - { - myValue = value; - } - - - bool Dynamics::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - - auto b = xelement.begin(); - auto e = xelement.end(); - - if( b != e ) - { - if( b->getName() == "other-dynamics" ) - { - myValue.setValue( b->getValue() ); - MX_RETURN_IS_SUCCESS; - } - else - { - myValue.setValue( b->getName() ); - MX_RETURN_IS_SUCCESS; - } - } - - message << "Dynamics: parsing failed" << std::endl; - return false; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Dynamics.h b/Sourcecode/private/mx/core/elements/Dynamics.h deleted file mode 100644 index 8efe2df89..000000000 --- a/Sourcecode/private/mx/core/elements/Dynamics.h +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/DynamicsAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DynamicsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Dynamics ) - - inline DynamicsPtr makeDynamics() { return std::make_shared(); } - inline DynamicsPtr makeDynamics( const DynamicsValue& value ) { return std::make_shared( value ); } - inline DynamicsPtr makeDynamics( DynamicsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Dynamics : public ElementInterface - { - public: - Dynamics( const DynamicsValue& value ); - Dynamics(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - DynamicsAttributesPtr getAttributes() const; - void setAttributes( const DynamicsAttributes& attributes ); - DynamicsValue getValue() const; - void setValue( const DynamicsValue& value ); - - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DynamicsValue myValue; - DynamicsAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/DynamicsAttributes.cpp b/Sourcecode/private/mx/core/elements/DynamicsAttributes.cpp deleted file mode 100644 index 43d8d3975..000000000 --- a/Sourcecode/private/mx/core/elements/DynamicsAttributes.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/DynamicsAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - DynamicsAttributes::DynamicsAttributes() - :hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - ,hasPlacement( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasEnclosure( false ) - {} - - - bool DynamicsAttributes::hasValues() const - { - return hasDefaultX - || hasDefaultY - || hasRelativeX - || hasRelativeY - || hasFontFamily - || hasFontStyle - || hasFontSize - || hasFontWeight - || hasColor - || hasHalign - || hasValign - || hasPlacement - || hasUnderline - || hasOverline - || hasLineThrough - || hasEnclosure; - } - - - std::ostream& DynamicsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } - - - bool DynamicsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "DynamicsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/DynamicsAttributes.h b/Sourcecode/private/mx/core/elements/DynamicsAttributes.h deleted file mode 100644 index 660b516ee..000000000 --- a/Sourcecode/private/mx/core/elements/DynamicsAttributes.h +++ /dev/null @@ -1,70 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( DynamicsAttributes ) - - struct DynamicsAttributes : public AttributesInterface - { - public: - DynamicsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - AboveBelow placement; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - EnclosureShape enclosure; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; - bool hasPlacement; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasEnclosure; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EditorialGroup.cpp b/Sourcecode/private/mx/core/elements/EditorialGroup.cpp deleted file mode 100644 index d4fc13115..000000000 --- a/Sourcecode/private/mx/core/elements/EditorialGroup.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EditorialGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Footnote.h" -#include "mx/core/elements/Level.h" -#include - -namespace mx -{ - namespace core - { - EditorialGroup::EditorialGroup() - :myFootnote( makeFootnote() ) - ,myHasFootnote( false ) - ,myLevel( makeLevel() ) - ,myHasLevel( false ) - {} - - - bool EditorialGroup::hasAttributes() const - { - return false; - } - - - std::ostream& EditorialGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& EditorialGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool EditorialGroup::hasContents() const - { - return myHasFootnote || myHasLevel; - } - - - std::ostream& EditorialGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = true; - if ( myHasFootnote ) - { - myFootnote->toStream( os, indentLevel ); - if ( myHasLevel ) - { - os << std::endl; - isOneLineOnly = false; - } - } - if ( myHasLevel ) - { - myLevel->toStream( os, indentLevel ); - } - return os; - } - - - FootnotePtr EditorialGroup::getFootnote() const - { - return myFootnote; - } - - - void EditorialGroup::setFootnote( const FootnotePtr& value ) - { - if ( value ) - { - myFootnote = value; - } - } - - - bool EditorialGroup::getHasFootnote() const - { - return myHasFootnote; - } - - - void EditorialGroup::setHasFootnote( const bool value ) - { - myHasFootnote = value; - } - - - LevelPtr EditorialGroup::getLevel() const - { - return myLevel; - } - - - void EditorialGroup::setLevel( const LevelPtr& value ) - { - if ( value ) - { - myLevel = value; - } - } - - - bool EditorialGroup::getHasLevel() const - { - return myHasLevel; - } - - - void EditorialGroup::setHasLevel( const bool value ) - { - myHasLevel = value; - } - - - MX_FROM_XELEMENT_UNUSED( EditorialGroup ); - } -} diff --git a/Sourcecode/private/mx/core/elements/EditorialGroup.h b/Sourcecode/private/mx/core/elements/EditorialGroup.h deleted file mode 100644 index eaeeb3818..000000000 --- a/Sourcecode/private/mx/core/elements/EditorialGroup.h +++ /dev/null @@ -1,58 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Footnote ) - MX_FORWARD_DECLARE_ELEMENT( Level ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - - inline EditorialGroupPtr makeEditorialGroup() { return std::make_shared(); } - - class EditorialGroup : public ElementInterface - { - public: - EditorialGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ - FootnotePtr getFootnote() const; - void setFootnote( const FootnotePtr& value ); - bool getHasFootnote() const; - void setHasFootnote( const bool value ); - - /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ - LevelPtr getLevel() const; - void setLevel( const LevelPtr& value ); - bool getHasLevel() const; - void setHasLevel( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FootnotePtr myFootnote; - bool myHasFootnote; - LevelPtr myLevel; - bool myHasLevel; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.cpp b/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.cpp deleted file mode 100644 index a4edc08e6..000000000 --- a/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.cpp +++ /dev/null @@ -1,160 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EditorialVoiceDirectionGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Footnote.h" -#include "mx/core/elements/Level.h" -#include "mx/core/elements/Voice.h" -#include - -namespace mx -{ - namespace core - { - EditorialVoiceDirectionGroup::EditorialVoiceDirectionGroup() - :myFootnote( makeFootnote() ) - ,myHasFootnote( false ) - ,myLevel( makeLevel() ) - ,myHasLevel( false ) - ,myVoice( makeVoice() ) - ,myHasVoice( false ) - {} - - - bool EditorialVoiceDirectionGroup::hasAttributes() const - { - return false; - } - - - std::ostream& EditorialVoiceDirectionGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& EditorialVoiceDirectionGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool EditorialVoiceDirectionGroup::hasContents() const - { - return myHasFootnote || myHasLevel || myHasVoice; - } - - - std::ostream& EditorialVoiceDirectionGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - bool firstItem = true; - isOneLineOnly = true; - if ( myHasFootnote ) - { - myFootnote->toStream( os, indentLevel ); - firstItem = false; - } - if ( myHasLevel ) - { - if( ! firstItem ) os << std::endl; - myLevel->toStream( os, indentLevel ); - firstItem = false; - } - if ( myHasVoice ) - { - if( ! firstItem ) os << std::endl; - myVoice->toStream( os, indentLevel ); - firstItem = false; - } - isOneLineOnly = ! hasContents(); - return os; - } - - - FootnotePtr EditorialVoiceDirectionGroup::getFootnote() const - { - return myFootnote; - } - - - void EditorialVoiceDirectionGroup::setFootnote( const FootnotePtr& value ) - { - if ( value ) - { - myFootnote = value; - } - } - - - bool EditorialVoiceDirectionGroup::getHasFootnote() const - { - return myHasFootnote; - } - - - void EditorialVoiceDirectionGroup::setHasFootnote( const bool value ) - { - myHasFootnote = value; - } - - - LevelPtr EditorialVoiceDirectionGroup::getLevel() const - { - return myLevel; - } - - - void EditorialVoiceDirectionGroup::setLevel( const LevelPtr& value ) - { - if ( value ) - { - myLevel = value; - } - } - - - bool EditorialVoiceDirectionGroup::getHasLevel() const - { - return myHasLevel; - } - - - void EditorialVoiceDirectionGroup::setHasLevel( const bool value ) - { - myHasLevel = value; - } - - - VoicePtr EditorialVoiceDirectionGroup::getVoice() const - { - return myVoice; - } - - - void EditorialVoiceDirectionGroup::setVoice( const VoicePtr& value ) - { - if ( value ) - { - myVoice = value; - } - } - - - bool EditorialVoiceDirectionGroup::getHasVoice() const - { - return myHasVoice; - } - - - void EditorialVoiceDirectionGroup::setHasVoice( const bool value ) - { - myHasVoice = value; - } - - - MX_FROM_XELEMENT_UNUSED( EditorialVoiceDirectionGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.h b/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.h deleted file mode 100644 index de43ded5e..000000000 --- a/Sourcecode/private/mx/core/elements/EditorialVoiceDirectionGroup.h +++ /dev/null @@ -1,68 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Footnote ) - MX_FORWARD_DECLARE_ELEMENT( Level ) - MX_FORWARD_DECLARE_ELEMENT( Voice ) - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceDirectionGroup ) - - inline EditorialVoiceDirectionGroupPtr makeEditorialVoiceDirectionGroup() { return std::make_shared(); } - - - class EditorialVoiceDirectionGroup : public ElementInterface - { - public: - EditorialVoiceDirectionGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ - FootnotePtr getFootnote() const; - void setFootnote( const FootnotePtr& value ); - bool getHasFootnote() const; - void setHasFootnote( const bool value ); - - /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ - LevelPtr getLevel() const; - void setLevel( const LevelPtr& value ); - bool getHasLevel() const; - void setHasLevel( const bool value ); - - /* _________ Voice minOccurs = 0, maxOccurs = 1 _________ */ - VoicePtr getVoice() const; - void setVoice( const VoicePtr& value ); - bool getHasVoice() const; - void setHasVoice( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FootnotePtr myFootnote; - bool myHasFootnote; - LevelPtr myLevel; - bool myHasLevel; - VoicePtr myVoice; - bool myHasVoice; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.cpp b/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.cpp deleted file mode 100644 index d66b0295d..000000000 --- a/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.cpp +++ /dev/null @@ -1,160 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EditorialVoiceGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Footnote.h" -#include "mx/core/elements/Level.h" -#include "mx/core/elements/Voice.h" -#include - -namespace mx -{ - namespace core - { - EditorialVoiceGroup::EditorialVoiceGroup() - :myFootnote( makeFootnote() ) - ,myHasFootnote( false ) - ,myLevel( makeLevel() ) - ,myHasLevel( false ) - ,myVoice( makeVoice() ) - ,myHasVoice( false ) - {} - - - bool EditorialVoiceGroup::hasAttributes() const - { - return false; - } - - - std::ostream& EditorialVoiceGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& EditorialVoiceGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool EditorialVoiceGroup::hasContents() const - { - return myHasFootnote || myHasLevel || myHasVoice; - } - - - std::ostream& EditorialVoiceGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - bool firstItem = true; - isOneLineOnly = true; - if ( myHasFootnote ) - { - myFootnote->toStream( os, indentLevel ); - firstItem = false; - } - if ( myHasLevel ) - { - if( ! firstItem ) os << std::endl; - myLevel->toStream( os, indentLevel ); - firstItem = false; - } - if ( myHasVoice ) - { - if( ! firstItem ) os << std::endl; - myVoice->toStream( os, indentLevel ); - firstItem = false; - } - isOneLineOnly = ! hasContents(); - return os; - } - - - FootnotePtr EditorialVoiceGroup::getFootnote() const - { - return myFootnote; - } - - - void EditorialVoiceGroup::setFootnote( const FootnotePtr& value ) - { - if ( value ) - { - myFootnote = value; - } - } - - - bool EditorialVoiceGroup::getHasFootnote() const - { - return myHasFootnote; - } - - - void EditorialVoiceGroup::setHasFootnote( const bool value ) - { - myHasFootnote = value; - } - - - LevelPtr EditorialVoiceGroup::getLevel() const - { - return myLevel; - } - - - void EditorialVoiceGroup::setLevel( const LevelPtr& value ) - { - if ( value ) - { - myLevel = value; - } - } - - - bool EditorialVoiceGroup::getHasLevel() const - { - return myHasLevel; - } - - - void EditorialVoiceGroup::setHasLevel( const bool value ) - { - myHasLevel = value; - } - - - VoicePtr EditorialVoiceGroup::getVoice() const - { - return myVoice; - } - - - void EditorialVoiceGroup::setVoice( const VoicePtr& value ) - { - if ( value ) - { - myVoice = value; - } - } - - - bool EditorialVoiceGroup::getHasVoice() const - { - return myHasVoice; - } - - - void EditorialVoiceGroup::setHasVoice( const bool value ) - { - myHasVoice = value; - } - - - MX_FROM_XELEMENT_UNUSED( EditorialVoiceGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.h b/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.h deleted file mode 100644 index 5072f9732..000000000 --- a/Sourcecode/private/mx/core/elements/EditorialVoiceGroup.h +++ /dev/null @@ -1,67 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Footnote ) - MX_FORWARD_DECLARE_ELEMENT( Level ) - MX_FORWARD_DECLARE_ELEMENT( Voice ) - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceGroup ) - - inline EditorialVoiceGroupPtr makeEditorialVoiceGroup() { return std::make_shared(); } - - class EditorialVoiceGroup : public ElementInterface - { - public: - EditorialVoiceGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Footnote minOccurs = 0, maxOccurs = 1 _________ */ - FootnotePtr getFootnote() const; - void setFootnote( const FootnotePtr& value ); - bool getHasFootnote() const; - void setHasFootnote( const bool value ); - - /* _________ Level minOccurs = 0, maxOccurs = 1 _________ */ - LevelPtr getLevel() const; - void setLevel( const LevelPtr& value ); - bool getHasLevel() const; - void setHasLevel( const bool value ); - - /* _________ Voice minOccurs = 0, maxOccurs = 1 _________ */ - VoicePtr getVoice() const; - void setVoice( const VoicePtr& value ); - bool getHasVoice() const; - void setHasVoice( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FootnotePtr myFootnote; - bool myHasFootnote; - LevelPtr myLevel; - bool myHasLevel; - VoicePtr myVoice; - bool myHasVoice; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Effect.cpp b/Sourcecode/private/mx/core/elements/Effect.cpp deleted file mode 100644 index af1e7cac4..000000000 --- a/Sourcecode/private/mx/core/elements/Effect.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Effect.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Effect::Effect() - :myValue( EffectEnum::anvil ) - {} - - - Effect::Effect( const EffectEnum& value ) - :myValue( value ) - {} - - - bool Effect::hasAttributes() const - { - return false; - } - - - bool Effect::hasContents() const - { - return true; - } - - - std::ostream& Effect::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Effect::streamName( std::ostream& os ) const - { - os << "effect"; - return os; - } - - - std::ostream& Effect::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - EffectEnum Effect::getValue() const - { - return myValue; - } - - - void Effect::setValue( const EffectEnum& value ) - { - myValue = value; - } - - - bool Effect::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseEffectEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Effect.h b/Sourcecode/private/mx/core/elements/Effect.h deleted file mode 100644 index 4ffaecc32..000000000 --- a/Sourcecode/private/mx/core/elements/Effect.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Effect ) - - inline EffectPtr makeEffect() { return std::make_shared(); } - inline EffectPtr makeEffect( const EffectEnum& value ) { return std::make_shared( value ); } - inline EffectPtr makeEffect( EffectEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Effect : public ElementInterface - { - public: - Effect(); - Effect( const EffectEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EffectEnum getValue() const; - void setValue( const EffectEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EffectEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Elevation.cpp b/Sourcecode/private/mx/core/elements/Elevation.cpp deleted file mode 100644 index 985b512ca..000000000 --- a/Sourcecode/private/mx/core/elements/Elevation.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Elevation.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Elevation::Elevation() - :myValue() - {} - - - Elevation::Elevation( const RotationDegrees& value ) - :myValue( value ) - {} - - - bool Elevation::hasAttributes() const - { - return false; - } - - - bool Elevation::hasContents() const - { - return true; - } - - - std::ostream& Elevation::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Elevation::streamName( std::ostream& os ) const - { - os << "elevation"; - return os; - } - - - std::ostream& Elevation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - RotationDegrees Elevation::getValue() const - { - return myValue; - } - - - void Elevation::setValue( const RotationDegrees& value ) - { - myValue = value; - } - - - bool Elevation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Elevation.h b/Sourcecode/private/mx/core/elements/Elevation.h deleted file mode 100644 index d1e4f926e..000000000 --- a/Sourcecode/private/mx/core/elements/Elevation.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Elevation ) - - inline ElevationPtr makeElevation() { return std::make_shared(); } - inline ElevationPtr makeElevation( const RotationDegrees& value ) { return std::make_shared( value ); } - inline ElevationPtr makeElevation( RotationDegrees&& value ) { return std::make_shared( std::move( value ) ); } - - class Elevation : public ElementInterface - { - public: - Elevation(); - Elevation( const RotationDegrees& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RotationDegrees getValue() const; - void setValue( const RotationDegrees& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - RotationDegrees myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Elision.cpp b/Sourcecode/private/mx/core/elements/Elision.cpp deleted file mode 100644 index cb5ed8e80..000000000 --- a/Sourcecode/private/mx/core/elements/Elision.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Elision.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Elision::Elision() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Elision::Elision( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Elision::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Elision::hasContents() const - { - return true; - } - - - std::ostream& Elision::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Elision::streamName( std::ostream& os ) const - { - os << "elision"; - return os; - } - - - std::ostream& Elision::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - ElisionAttributesPtr Elision::getAttributes() const - { - return myAttributes; - } - - - void Elision::setAttributes( const ElisionAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Elision::getValue() const - { - return myValue; - } - - - void Elision::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Elision::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Elision.h b/Sourcecode/private/mx/core/elements/Elision.h deleted file mode 100644 index 69a98d1d0..000000000 --- a/Sourcecode/private/mx/core/elements/Elision.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/ElisionAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ElisionAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Elision ) - - inline ElisionPtr makeElision() { return std::make_shared(); } - inline ElisionPtr makeElision( const XsString& value ) { return std::make_shared( value ); } - inline ElisionPtr makeElision( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Elision : public ElementInterface - { - public: - Elision(); - Elision( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ElisionAttributesPtr getAttributes() const; - void setAttributes( const ElisionAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - ElisionAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ElisionAttributes.cpp b/Sourcecode/private/mx/core/elements/ElisionAttributes.cpp deleted file mode 100644 index 428546a05..000000000 --- a/Sourcecode/private/mx/core/elements/ElisionAttributes.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ElisionAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ElisionAttributes::ElisionAttributes() - :fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lang( XmlLang{ "it" } ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLang( false ) - {} - - - bool ElisionAttributes::hasValues() const - { - return hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLang; - } - - - std::ostream& ElisionAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lang, "xml:lang", hasLang ); - } - return os; - } - - - bool ElisionAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "ElisionAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ElisionAttributes.h b/Sourcecode/private/mx/core/elements/ElisionAttributes.h deleted file mode 100644 index 4bf65a621..000000000 --- a/Sourcecode/private/mx/core/elements/ElisionAttributes.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" -#include "mx/core/NumberOrNormal.h" -#include "mx/core/XmlLang.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ElisionAttributes ) - - struct ElisionAttributes : public AttributesInterface - { - public: - ElisionAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - XmlLang lang; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLang; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.cpp b/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.cpp deleted file mode 100644 index c11b05197..000000000 --- a/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ElisionSyllabicGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Elision.h" -#include "mx/core/elements/Syllabic.h" -#include - -namespace mx -{ - namespace core - { - ElisionSyllabicGroup::ElisionSyllabicGroup() - :myElision( makeElision() ) - ,mySyllabic( makeSyllabic() ) - ,myHasSyllabic( false ) - {} - - - bool ElisionSyllabicGroup::hasAttributes() const - { - return false; - } - - - std::ostream& ElisionSyllabicGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ElisionSyllabicGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool ElisionSyllabicGroup::hasContents() const - { - return true; - } - - - std::ostream& ElisionSyllabicGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = true; - myElision->toStream( os, indentLevel ); - if ( myHasSyllabic ) - { - isOneLineOnly = false; - os << std::endl; - mySyllabic->toStream( os, indentLevel ); - } - return os; - } - - - ElisionPtr ElisionSyllabicGroup::getElision() const - { - return myElision; - } - - - void ElisionSyllabicGroup::setElision( const ElisionPtr& value ) - { - if ( value ) - { - myElision = value; - } - } - - - SyllabicPtr ElisionSyllabicGroup::getSyllabic() const - { - return mySyllabic; - } - - - void ElisionSyllabicGroup::setSyllabic( const SyllabicPtr& value ) - { - if ( value ) - { - mySyllabic = value; - } - } - - - bool ElisionSyllabicGroup::getHasSyllabic() const - { - return myHasSyllabic; - } - - - void ElisionSyllabicGroup::setHasSyllabic( const bool value ) - { - myHasSyllabic = value; - } - - - MX_FROM_XELEMENT_UNUSED( ElisionSyllabicGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.h b/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.h deleted file mode 100644 index 533be2b3a..000000000 --- a/Sourcecode/private/mx/core/elements/ElisionSyllabicGroup.h +++ /dev/null @@ -1,55 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Elision ) - MX_FORWARD_DECLARE_ELEMENT( Syllabic ) - MX_FORWARD_DECLARE_ELEMENT( ElisionSyllabicGroup ) - - inline ElisionSyllabicGroupPtr makeElisionSyllabicGroup() { return std::make_shared(); } - - class ElisionSyllabicGroup : public ElementInterface - { - public: - ElisionSyllabicGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Elision minOccurs = 1, maxOccurs = 1 _________ */ - ElisionPtr getElision() const; - void setElision( const ElisionPtr& value ); - - /* _________ Syllabic minOccurs = 0, maxOccurs = 1 _________ */ - SyllabicPtr getSyllabic() const; - void setSyllabic( const SyllabicPtr& value ); - bool getHasSyllabic() const; - void setHasSyllabic( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ElisionPtr myElision; - SyllabicPtr mySyllabic; - bool myHasSyllabic; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.cpp b/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.cpp deleted file mode 100644 index a44c113d9..000000000 --- a/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ElisionSyllabicTextGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/ElisionSyllabicGroup.h" -#include "mx/core/elements/Text.h" -#include - -namespace mx -{ - namespace core - { - ElisionSyllabicTextGroup::ElisionSyllabicTextGroup() - :myElisionSyllabicGroup( makeElisionSyllabicGroup() ) - ,myHasElisionSyllabicGroup( false ) - ,myText( makeText() ) - {} - - - bool ElisionSyllabicTextGroup::hasAttributes() const - { - return false; - } - - - std::ostream& ElisionSyllabicTextGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ElisionSyllabicTextGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool ElisionSyllabicTextGroup::hasContents() const - { - return true; - } - - - std::ostream& ElisionSyllabicTextGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = true; - if ( myHasElisionSyllabicGroup ) - { - myElisionSyllabicGroup->streamContents( os, indentLevel, isOneLineOnly ); - isOneLineOnly = false; - os << std::endl; - } - myText->toStream( os, indentLevel ); - return os; - } - - - ElisionSyllabicGroupPtr ElisionSyllabicTextGroup::getElisionSyllabicGroup() const - { - return myElisionSyllabicGroup; - } - - - void ElisionSyllabicTextGroup::setElisionSyllabicGroup( const ElisionSyllabicGroupPtr& value ) - { - if ( value ) - { - myElisionSyllabicGroup = value; - } - } - - - bool ElisionSyllabicTextGroup::getHasElisionSyllabicGroup() const - { - return myHasElisionSyllabicGroup; - } - - - void ElisionSyllabicTextGroup::setHasElisionSyllabicGroup( const bool value ) - { - myHasElisionSyllabicGroup = value; - } - - - TextPtr ElisionSyllabicTextGroup::getText() const - { - return myText; - } - - - void ElisionSyllabicTextGroup::setText( const TextPtr& value ) - { - if ( value ) - { - myText = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( ElisionSyllabicTextGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.h b/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.h deleted file mode 100644 index a9846804a..000000000 --- a/Sourcecode/private/mx/core/elements/ElisionSyllabicTextGroup.h +++ /dev/null @@ -1,55 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ElisionSyllabicGroup ) - MX_FORWARD_DECLARE_ELEMENT( Text ) - MX_FORWARD_DECLARE_ELEMENT( ElisionSyllabicTextGroup ) - - inline ElisionSyllabicTextGroupPtr makeElisionSyllabicTextGroup() { return std::make_shared(); } - - class ElisionSyllabicTextGroup : public ElementInterface - { - public: - ElisionSyllabicTextGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ ElisionSyllabicGroup minOccurs = 0, maxOccurs = 1 _________ */ - ElisionSyllabicGroupPtr getElisionSyllabicGroup() const; - void setElisionSyllabicGroup( const ElisionSyllabicGroupPtr& value ); - bool getHasElisionSyllabicGroup() const; - void setHasElisionSyllabicGroup( const bool value ); - - /* _________ Text minOccurs = 1, maxOccurs = 1 _________ */ - TextPtr getText() const; - void setText( const TextPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ElisionSyllabicGroupPtr myElisionSyllabicGroup; - bool myHasElisionSyllabicGroup; - TextPtr myText; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EmptyFontAttributes.cpp b/Sourcecode/private/mx/core/elements/EmptyFontAttributes.cpp deleted file mode 100644 index 03eb127a0..000000000 --- a/Sourcecode/private/mx/core/elements/EmptyFontAttributes.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EmptyFontAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - EmptyFontAttributes::EmptyFontAttributes() - :fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool EmptyFontAttributes::hasValues() const - { - return hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& EmptyFontAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool EmptyFontAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "EmptyFontAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/EmptyFontAttributes.h b/Sourcecode/private/mx/core/elements/EmptyFontAttributes.h deleted file mode 100644 index 6c4e2ecdd..000000000 --- a/Sourcecode/private/mx/core/elements/EmptyFontAttributes.h +++ /dev/null @@ -1,43 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyFontAttributes ) - - struct EmptyFontAttributes : public AttributesInterface - { - public: - EmptyFontAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EmptyLineAttributes.cpp b/Sourcecode/private/mx/core/elements/EmptyLineAttributes.cpp deleted file mode 100644 index 9ebc90918..000000000 --- a/Sourcecode/private/mx/core/elements/EmptyLineAttributes.cpp +++ /dev/null @@ -1,116 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EmptyLineAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - EmptyLineAttributes::EmptyLineAttributes() - :lineShape() - ,lineType() - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,placement( AboveBelow::below ) - ,hasLineShape( false ) - ,hasLineType( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool EmptyLineAttributes::hasValues() const - { - return - hasLineShape || - hasLineType || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& EmptyLineAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, lineShape, "line-shape", hasLineShape ); - streamAttribute( os, lineType, "line-type", hasLineType ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool EmptyLineAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "EmptyLineAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - - if( parseAttribute( message, it, className, isSuccess, lineShape, hasLineShape, "line-shape", &parseLineShape ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/EmptyLineAttributes.h b/Sourcecode/private/mx/core/elements/EmptyLineAttributes.h deleted file mode 100644 index ef4a6ddf2..000000000 --- a/Sourcecode/private/mx/core/elements/EmptyLineAttributes.h +++ /dev/null @@ -1,62 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyLineAttributes ) - - struct EmptyLineAttributes : public AttributesInterface - { - public: - EmptyLineAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LineShape lineShape; - LineType lineType; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasLineShape; - bool hasLineType; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.cpp b/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.cpp deleted file mode 100644 index 499b5da06..000000000 --- a/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EmptyPlacementAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - EmptyPlacementAttributes::EmptyPlacementAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,placement( AboveBelow::below ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool EmptyPlacementAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& EmptyPlacementAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool EmptyPlacementAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "EmptyPlacementAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.h b/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.h deleted file mode 100644 index e555b6395..000000000 --- a/Sourcecode/private/mx/core/elements/EmptyPlacementAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/ForwardDeclare.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - - struct EmptyPlacementAttributes : public AttributesInterface - { - public: - EmptyPlacementAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.cpp b/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.cpp deleted file mode 100644 index e922211ca..000000000 --- a/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EmptyTrillSoundAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - EmptyTrillSoundAttributes::EmptyTrillSoundAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,placement( AboveBelow::below ) - ,startNote( StartNote::main ) - ,trillStep() - ,twoNoteTurn( TwoNoteTurn::none ) - ,accelerate( YesNo::no ) - ,beats() - ,secondBeat() - ,lastBeat() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - ,hasStartNote( false ) - ,hasTrillStep( false ) - ,hasTwoNoteTurn( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasSecondBeat( false ) - ,hasLastBeat( false ) - {} - - - bool EmptyTrillSoundAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement || - hasStartNote || - hasTrillStep || - hasTwoNoteTurn || - hasAccelerate || - hasBeats || - hasSecondBeat || - hasLastBeat; - } - - - std::ostream& EmptyTrillSoundAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, startNote, "start-note", hasStartNote ); - streamAttribute( os, trillStep, "trill-step", hasTrillStep ); - streamAttribute( os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, secondBeat, "second-beat", hasSecondBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - } - return os; - } - - - bool EmptyTrillSoundAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "EmptyTrillSoundAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", &parseTwoNoteTurn ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.h b/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.h deleted file mode 100644 index 9577596f3..000000000 --- a/Sourcecode/private/mx/core/elements/EmptyTrillSoundAttributes.h +++ /dev/null @@ -1,68 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyTrillSoundAttributes ) - - struct EmptyTrillSoundAttributes : public AttributesInterface - { - public: - EmptyTrillSoundAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - StartNote startNote; - TrillStep trillStep; - TwoNoteTurn twoNoteTurn; - YesNo accelerate; - TrillBeats beats; - Percent secondBeat; - Percent lastBeat; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - bool hasStartNote; - bool hasTrillStep; - bool hasTwoNoteTurn; - bool hasAccelerate; - bool hasBeats; - bool hasSecondBeat; - bool hasLastBeat; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Encoder.cpp b/Sourcecode/private/mx/core/elements/Encoder.cpp deleted file mode 100644 index e5ad36db5..000000000 --- a/Sourcecode/private/mx/core/elements/Encoder.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Encoder.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Encoder::Encoder() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Encoder::Encoder( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Encoder::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Encoder::hasContents() const - { - return true; - } - - - std::ostream& Encoder::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Encoder::streamName( std::ostream& os ) const - { - os << "encoder"; - return os; - } - - - std::ostream& Encoder::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - EncoderAttributesPtr Encoder::getAttributes() const - { - return myAttributes; - } - - - void Encoder::setAttributes( const EncoderAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Encoder::getValue() const - { - return myValue; - } - - - void Encoder::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Encoder::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Encoder.h b/Sourcecode/private/mx/core/elements/Encoder.h deleted file mode 100644 index a834efbef..000000000 --- a/Sourcecode/private/mx/core/elements/Encoder.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/EncoderAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EncoderAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Encoder ) - - inline EncoderPtr makeEncoder() { return std::make_shared(); } - inline EncoderPtr makeEncoder( const XsString& value ) { return std::make_shared( value ); } - inline EncoderPtr makeEncoder( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Encoder : public ElementInterface - { - public: - Encoder(); - Encoder( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EncoderAttributesPtr getAttributes() const; - void setAttributes( const EncoderAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - EncoderAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EncoderAttributes.cpp b/Sourcecode/private/mx/core/elements/EncoderAttributes.cpp deleted file mode 100644 index a55fe4588..000000000 --- a/Sourcecode/private/mx/core/elements/EncoderAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EncoderAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - EncoderAttributes::EncoderAttributes() - :type() - ,hasType( false ) - {} - - - bool EncoderAttributes::hasValues() const - { - return hasType; - } - - - std::ostream& EncoderAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool EncoderAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "EncoderAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type" ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/EncoderAttributes.h b/Sourcecode/private/mx/core/elements/EncoderAttributes.h deleted file mode 100644 index 7e8341b5c..000000000 --- a/Sourcecode/private/mx/core/elements/EncoderAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EncoderAttributes ) - - struct EncoderAttributes : public AttributesInterface - { - public: - EncoderAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Encoding.cpp b/Sourcecode/private/mx/core/elements/Encoding.cpp deleted file mode 100644 index 3da8ccdc7..000000000 --- a/Sourcecode/private/mx/core/elements/Encoding.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Encoding.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/EncodingChoice.h" -#include - -namespace mx -{ - namespace core - { - Encoding::Encoding() - :myEncodingChoiceSet() - {} - - - bool Encoding::hasAttributes() const - { - return false; - } - - - std::ostream& Encoding::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Encoding::streamName( std::ostream& os ) const - { - os << "encoding"; - return os; - } - - - bool Encoding::hasContents() const - { - return myEncodingChoiceSet.size() > 0; - } - - - std::ostream& Encoding::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - bool isFirst = true; - for ( auto x : myEncodingChoiceSet ) - { - if( !isFirst ) - { - os << std::endl; - isFirst = false; - } - x->streamContents( os, indentLevel, isOneLineOnly ); - } - if ( hasContents() ) - { - os << std::endl; - } - isOneLineOnly = !hasContents(); - return os; - } - - - const EncodingChoiceSet& Encoding::getEncodingChoiceSet() const - { - return myEncodingChoiceSet; - } - - - void Encoding::removeEncodingChoice( const EncodingChoiceSetIterConst& value ) - { - if ( value != myEncodingChoiceSet.cend() ) - { - myEncodingChoiceSet.erase( value ); - } - } - - - void Encoding::addEncodingChoice( const EncodingChoicePtr& value ) - { - if ( value ) - { - myEncodingChoiceSet.push_back( value ); - } - } - - - void Encoding::clearEncodingChoiceSet() - { - myEncodingChoiceSet.clear(); - } - - - bool Encoding::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - auto item = makeEncodingChoice(); - isSuccess &= item->fromXElement( message, *it ); - myEncodingChoiceSet.push_back( item ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Encoding.h b/Sourcecode/private/mx/core/elements/Encoding.h deleted file mode 100644 index 64dcf2dab..000000000 --- a/Sourcecode/private/mx/core/elements/Encoding.h +++ /dev/null @@ -1,48 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( EncodingChoice ) - MX_FORWARD_DECLARE_ELEMENT( Encoding ) - - inline EncodingPtr makeEncoding() { return std::make_shared(); } - - class Encoding : public ElementInterface - { - public: - Encoding(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ EncodingChoice minOccurs = 0, maxOccurs = unbounded _________ */ - const EncodingChoiceSet& getEncodingChoiceSet() const; - void addEncodingChoice( const EncodingChoicePtr& value ); - void removeEncodingChoice( const EncodingChoiceSetIterConst& value ); - void clearEncodingChoiceSet(); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EncodingChoiceSet myEncodingChoiceSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EncodingChoice.cpp b/Sourcecode/private/mx/core/elements/EncodingChoice.cpp deleted file mode 100644 index 7fcbc5284..000000000 --- a/Sourcecode/private/mx/core/elements/EncodingChoice.cpp +++ /dev/null @@ -1,189 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EncodingChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Encoder.h" -#include "mx/core/elements/EncodingDate.h" -#include "mx/core/elements/EncodingDescription.h" -#include "mx/core/elements/Software.h" -#include "mx/core/elements/Supports.h" -#include - -namespace mx -{ - namespace core - { - EncodingChoice::EncodingChoice() - :myChoice( Choice::encodingDate ) - ,myEncodingDate( makeEncodingDate() ) - ,myEncoder( makeEncoder() ) - ,mySoftware( makeSoftware() ) - ,myEncodingDescription( makeEncodingDescription() ) - ,mySupports( makeSupports() ) - {} - - - bool EncodingChoice::hasAttributes() const - { - return false; - } - - - std::ostream& EncodingChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& EncodingChoice::streamName( std::ostream& os ) const - { - os << "encoding"; - return os; - } - - - bool EncodingChoice::hasContents() const - { - return true; - } - - - std::ostream& EncodingChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - switch ( myChoice ) - { - case Choice::encodingDate: - { - myEncodingDate->toStream( os, indentLevel+1 ); - } - break; - case Choice::encoder: - { - myEncoder->toStream( os, indentLevel+1 ); - } - break; - case Choice::software: - { - mySoftware->toStream( os, indentLevel+1 ); - } - break; - case Choice::encodingDescription: - { - myEncodingDescription->toStream( os, indentLevel+1 ); - } - break; - case Choice::supports: - { - mySupports->toStream( os, indentLevel+1 ); - } - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - EncodingChoice::Choice EncodingChoice::getChoice() const - { - return myChoice; - } - - - void EncodingChoice::setChoice( const EncodingChoice::Choice value ) - { - myChoice = value; - } - - - EncodingDatePtr EncodingChoice::getEncodingDate() const - { - return myEncodingDate; - } - - - void EncodingChoice::setEncodingDate( const EncodingDatePtr& value ) - { - if( value ) - { - myEncodingDate = value; - } - } - - - EncoderPtr EncodingChoice::getEncoder() const - { - return myEncoder; - } - - - void EncodingChoice::setEncoder( const EncoderPtr& value ) - { - if( value ) - { - myEncoder = value; - } - } - - - SoftwarePtr EncodingChoice::getSoftware() const - { - return mySoftware; - } - - - void EncodingChoice::setSoftware( const SoftwarePtr& value ) - { - if( value ) - { - mySoftware = value; - } - } - - - EncodingDescriptionPtr EncodingChoice::getEncodingDescription() const - { - return myEncodingDescription; - } - - - void EncodingChoice::setEncodingDescription( const EncodingDescriptionPtr& value ) - { - if( value ) - { - myEncodingDescription = value; - } - } - - - SupportsPtr EncodingChoice::getSupports() const - { - return mySupports; - } - - - void EncodingChoice::setSupports( const SupportsPtr& value ) - { - if( value ) - { - mySupports = value; - } - } - - - bool EncodingChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_CHOICE_IF( encodingDate, "encoding-date", EncodingDate ); - MX_CHOICE_IF( encoder, "encoder", Encoder ); - MX_CHOICE_IF( software, "software", Software ); - MX_CHOICE_IF( encodingDescription, "encoding-description", EncodingDescription ); - MX_CHOICE_IF( supports, "supports", Supports ); - MX_BAD_ELEMENT_FAILURE( EncodingChoice ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/EncodingChoice.h b/Sourcecode/private/mx/core/elements/EncodingChoice.h deleted file mode 100644 index a66ec9655..000000000 --- a/Sourcecode/private/mx/core/elements/EncodingChoice.h +++ /dev/null @@ -1,83 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Encoder ) - MX_FORWARD_DECLARE_ELEMENT( EncodingDate ) - MX_FORWARD_DECLARE_ELEMENT( EncodingDescription ) - MX_FORWARD_DECLARE_ELEMENT( Software ) - MX_FORWARD_DECLARE_ELEMENT( Supports ) - MX_FORWARD_DECLARE_ELEMENT( EncodingChoice ) - - inline EncodingChoicePtr makeEncodingChoice() { return std::make_shared(); } - - class EncodingChoice : public ElementInterface - { - public: - enum class Choice - { - encodingDate = 1, - encoder = 2, - software = 3, - encodingDescription = 4, - supports = 5 - }; - EncodingChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice _________ */ - EncodingChoice::Choice getChoice() const; - void setChoice( const EncodingChoice::Choice value ); - - /* _________ EncodingDate minOccurs = 1, maxOccurs = 1 _________ */ - EncodingDatePtr getEncodingDate() const; - void setEncodingDate( const EncodingDatePtr& value ); - - /* _________ Encoder minOccurs = 1, maxOccurs = 1 _________ */ - EncoderPtr getEncoder() const; - void setEncoder( const EncoderPtr& value ); - - /* _________ Software minOccurs = 1, maxOccurs = 1 _________ */ - SoftwarePtr getSoftware() const; - void setSoftware( const SoftwarePtr& value ); - - /* _________ EncodingDescription minOccurs = 1, maxOccurs = 1 _________ */ - EncodingDescriptionPtr getEncodingDescription() const; - void setEncodingDescription( const EncodingDescriptionPtr& value ); - - /* _________ Supports minOccurs = 1, maxOccurs = 1 _________ */ - SupportsPtr getSupports() const; - void setSupports( const SupportsPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - EncodingDatePtr myEncodingDate; - EncoderPtr myEncoder; - SoftwarePtr mySoftware; - EncodingDescriptionPtr myEncodingDescription; - SupportsPtr mySupports; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EncodingDate.cpp b/Sourcecode/private/mx/core/elements/EncodingDate.cpp deleted file mode 100644 index 55e370a62..000000000 --- a/Sourcecode/private/mx/core/elements/EncodingDate.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EncodingDate.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - EncodingDate::EncodingDate() - :myValue() - {} - - - EncodingDate::EncodingDate( const Date& value ) - :myValue( value ) - {} - - - bool EncodingDate::hasAttributes() const - { - return false; - } - - - bool EncodingDate::hasContents() const - { - return true; - } - - - std::ostream& EncodingDate::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& EncodingDate::streamName( std::ostream& os ) const - { - os << "encoding-date"; - return os; - } - - - std::ostream& EncodingDate::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Date EncodingDate::getValue() const - { - return myValue; - } - - - void EncodingDate::setValue( const Date& value ) - { - myValue = value; - } - - - bool EncodingDate::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/EncodingDate.h b/Sourcecode/private/mx/core/elements/EncodingDate.h deleted file mode 100644 index 17be5ed97..000000000 --- a/Sourcecode/private/mx/core/elements/EncodingDate.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Date.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( EncodingDate ) - - inline EncodingDatePtr makeEncodingDate() { return std::make_shared(); } - inline EncodingDatePtr makeEncodingDate( const Date& value ) { return std::make_shared( value ); } - inline EncodingDatePtr makeEncodingDate( Date&& value ) { return std::make_shared( std::move( value ) ); } - - class EncodingDate : public ElementInterface - { - public: - EncodingDate(); - EncodingDate( const Date& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Date getValue() const; - void setValue( const Date& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Date myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EncodingDescription.cpp b/Sourcecode/private/mx/core/elements/EncodingDescription.cpp deleted file mode 100644 index 3b7df02c9..000000000 --- a/Sourcecode/private/mx/core/elements/EncodingDescription.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EncodingDescription.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - EncodingDescription::EncodingDescription() - :myValue() - {} - - - EncodingDescription::EncodingDescription( const XsString& value ) - :myValue( value ) - {} - - - bool EncodingDescription::hasAttributes() const - { - return false; - } - - - bool EncodingDescription::hasContents() const - { - return true; - } - - - std::ostream& EncodingDescription::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& EncodingDescription::streamName( std::ostream& os ) const - { - os << "encoding-description"; - return os; - } - - - std::ostream& EncodingDescription::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString EncodingDescription::getValue() const - { - return myValue; - } - - - void EncodingDescription::setValue( const XsString& value ) - { - myValue = value; - } - - - bool EncodingDescription::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/EncodingDescription.h b/Sourcecode/private/mx/core/elements/EncodingDescription.h deleted file mode 100644 index 780f3c674..000000000 --- a/Sourcecode/private/mx/core/elements/EncodingDescription.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( EncodingDescription ) - - inline EncodingDescriptionPtr makeEncodingDescription() { return std::make_shared(); } - inline EncodingDescriptionPtr makeEncodingDescription( const XsString& value ) { return std::make_shared( value ); } - inline EncodingDescriptionPtr makeEncodingDescription( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class EncodingDescription : public ElementInterface - { - public: - EncodingDescription(); - EncodingDescription( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EndLine.cpp b/Sourcecode/private/mx/core/elements/EndLine.cpp deleted file mode 100644 index b5f9a93c8..000000000 --- a/Sourcecode/private/mx/core/elements/EndLine.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EndLine.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - EndLine::EndLine() : ElementInterface() {} - - - bool EndLine::hasAttributes() const { return false; } - - - bool EndLine::hasContents() const { return false; } - std::ostream& EndLine::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& EndLine::streamName( std::ostream& os ) const { os << "end-line"; return os; } - std::ostream& EndLine::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool EndLine::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/EndLine.h b/Sourcecode/private/mx/core/elements/EndLine.h deleted file mode 100644 index aba68ecc5..000000000 --- a/Sourcecode/private/mx/core/elements/EndLine.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( EndLine ) - - inline EndLinePtr makeEndLine() { return std::make_shared(); } - - class EndLine : public ElementInterface - { - public: - EndLine(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EndParagraph.cpp b/Sourcecode/private/mx/core/elements/EndParagraph.cpp deleted file mode 100644 index d2949f1f0..000000000 --- a/Sourcecode/private/mx/core/elements/EndParagraph.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EndParagraph.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - EndParagraph::EndParagraph() : ElementInterface() {} - - - bool EndParagraph::hasAttributes() const { return false; } - - - bool EndParagraph::hasContents() const { return false; } - std::ostream& EndParagraph::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& EndParagraph::streamName( std::ostream& os ) const { os << "end-paragraph"; return os; } - std::ostream& EndParagraph::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool EndParagraph::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/EndParagraph.h b/Sourcecode/private/mx/core/elements/EndParagraph.h deleted file mode 100644 index ad70cbac9..000000000 --- a/Sourcecode/private/mx/core/elements/EndParagraph.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( EndParagraph ) - - inline EndParagraphPtr makeEndParagraph() { return std::make_shared(); } - - class EndParagraph : public ElementInterface - { - public: - EndParagraph(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Ending.cpp b/Sourcecode/private/mx/core/elements/Ending.cpp deleted file mode 100644 index c3757fae1..000000000 --- a/Sourcecode/private/mx/core/elements/Ending.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Ending.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Ending::Ending() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Ending::Ending( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Ending::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Ending::hasContents() const - { - return true; - } - - - std::ostream& Ending::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Ending::streamName( std::ostream& os ) const - { - os << "ending"; - return os; - } - - - std::ostream& Ending::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - EndingAttributesPtr Ending::getAttributes() const - { - return myAttributes; - } - - - void Ending::setAttributes( const EndingAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Ending::getValue() const - { - return myValue; - } - - - void Ending::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Ending::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Ending.h b/Sourcecode/private/mx/core/elements/Ending.h deleted file mode 100644 index 9692c9192..000000000 --- a/Sourcecode/private/mx/core/elements/Ending.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/EndingAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EndingAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Ending ) - - inline EndingPtr makeEnding() { return std::make_shared(); } - inline EndingPtr makeEnding( const XsString& value ) { return std::make_shared( value ); } - inline EndingPtr makeEnding( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Ending : public ElementInterface - { - public: - Ending(); - Ending( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EndingAttributesPtr getAttributes() const; - void setAttributes( const EndingAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - EndingAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/EndingAttributes.cpp b/Sourcecode/private/mx/core/elements/EndingAttributes.cpp deleted file mode 100644 index c4b35430a..000000000 --- a/Sourcecode/private/mx/core/elements/EndingAttributes.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/EndingAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - EndingAttributes::EndingAttributes() - :number( "1" ) - ,type( StartStopDiscontinue::start ) - ,printObject() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,endLength() - ,textX() - ,textY() - ,hasNumber( true ) - ,hasType( true ) - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasEndLength( false ) - ,hasTextX( false ) - ,hasTextY( false ) - {} - - - bool EndingAttributes::hasValues() const - { - return hasNumber || - hasType || - hasPrintObject || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasEndLength || - hasTextX || - hasTextY; - } - - - std::ostream& EndingAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, endLength, "end-length", hasEndLength ); - streamAttribute( os, textX, "text-x", hasTextX ); - streamAttribute( os, textY, "text-y", hasTextY ); - } - return os; - } - - - bool EndingAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "EndingAttributes"; - bool isSuccess = true; - bool isNumberFound = false; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, isNumberFound, "number" ) ) - { - number.setUseSpaceBetweenItems( it->getValue().find( " " ) != std::string::npos ); - continue; - } - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopDiscontinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, endLength, hasEndLength, "end-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, textX, hasTextX, "text-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, textY, hasTextY, "text-y" ) ) { continue; } - } - - if( !isNumberFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/EndingAttributes.h b/Sourcecode/private/mx/core/elements/EndingAttributes.h deleted file mode 100644 index c9d391e8a..000000000 --- a/Sourcecode/private/mx/core/elements/EndingAttributes.h +++ /dev/null @@ -1,65 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/EndingNumber.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EndingAttributes ) - - struct EndingAttributes : public AttributesInterface - { - public: - EndingAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - EndingNumber number; - StartStopDiscontinue type; - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - TenthsValue endLength; - TenthsValue textX; - TenthsValue textY; - const bool hasNumber; - const bool hasType; - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasEndLength; - bool hasTextX; - bool hasTextY; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Ensemble.cpp b/Sourcecode/private/mx/core/elements/Ensemble.cpp deleted file mode 100644 index acf456a31..000000000 --- a/Sourcecode/private/mx/core/elements/Ensemble.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Ensemble.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Ensemble::Ensemble() - :myValue() - {} - - - Ensemble::Ensemble( const PositiveIntegerOrEmpty& value ) - :myValue( value ) - {} - - - bool Ensemble::hasAttributes() const - { - return false; - } - - - bool Ensemble::hasContents() const - { - return true; - } - - - std::ostream& Ensemble::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Ensemble::streamName( std::ostream& os ) const - { - os << "ensemble"; - return os; - } - - - std::ostream& Ensemble::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PositiveIntegerOrEmpty Ensemble::getValue() const - { - return myValue; - } - - - void Ensemble::setValue( const PositiveIntegerOrEmpty& value ) - { - myValue = value; - } - - - bool Ensemble::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Ensemble.h b/Sourcecode/private/mx/core/elements/Ensemble.h deleted file mode 100644 index 979d69341..000000000 --- a/Sourcecode/private/mx/core/elements/Ensemble.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/PositiveIntegerOrEmpty.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Ensemble ) - - inline EnsemblePtr makeEnsemble() { return std::make_shared(); } - inline EnsemblePtr makeEnsemble( const PositiveIntegerOrEmpty& value ) { return std::make_shared( value ); } - inline EnsemblePtr makeEnsemble( PositiveIntegerOrEmpty&& value ) { return std::make_shared( std::move( value ) ); } - - class Ensemble : public ElementInterface - { - public: - Ensemble(); - Ensemble( const PositiveIntegerOrEmpty& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PositiveIntegerOrEmpty getValue() const; - void setValue( const PositiveIntegerOrEmpty& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveIntegerOrEmpty myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Extend.cpp b/Sourcecode/private/mx/core/elements/Extend.cpp deleted file mode 100644 index 435283690..000000000 --- a/Sourcecode/private/mx/core/elements/Extend.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Extend.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Extend::Extend() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Extend::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Extend::hasContents() const { return false; } - std::ostream& Extend::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Extend::streamName( std::ostream& os ) const { os << "extend"; return os; } - std::ostream& Extend::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - ExtendAttributesPtr Extend::getAttributes() const - { - return myAttributes; - } - - - void Extend::setAttributes( const ExtendAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Extend::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Extend.h b/Sourcecode/private/mx/core/elements/Extend.h deleted file mode 100644 index e405aba7c..000000000 --- a/Sourcecode/private/mx/core/elements/Extend.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/ExtendAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ExtendAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Extend ) - - inline ExtendPtr makeExtend() { return std::make_shared(); } - - class Extend : public ElementInterface - { - public: - Extend(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ExtendAttributesPtr getAttributes() const; - void setAttributes( const ExtendAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ExtendAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ExtendAttributes.cpp b/Sourcecode/private/mx/core/elements/ExtendAttributes.cpp deleted file mode 100644 index cff2aed9e..000000000 --- a/Sourcecode/private/mx/core/elements/ExtendAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ExtendAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ExtendAttributes::ExtendAttributes() - :type() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,hasType( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool ExtendAttributes::hasValues() const - { - return hasType || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& ExtendAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool ExtendAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "ExtendAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type", &parseStartStopContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ExtendAttributes.h b/Sourcecode/private/mx/core/elements/ExtendAttributes.h deleted file mode 100644 index 2080e4f7c..000000000 --- a/Sourcecode/private/mx/core/elements/ExtendAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ExtendAttributes ) - - struct ExtendAttributes : public AttributesInterface - { - public: - ExtendAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopContinue type; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasType; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Eyeglasses.cpp b/Sourcecode/private/mx/core/elements/Eyeglasses.cpp deleted file mode 100644 index 0c7daa63b..000000000 --- a/Sourcecode/private/mx/core/elements/Eyeglasses.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Eyeglasses.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Eyeglasses::Eyeglasses() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Eyeglasses::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Eyeglasses::hasContents() const { return false; } - std::ostream& Eyeglasses::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Eyeglasses::streamName( std::ostream& os ) const { os << "eyeglasses"; return os; } - std::ostream& Eyeglasses::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPrintObjectStyleAlignAttributesPtr Eyeglasses::getAttributes() const - { - return myAttributes; - } - - - void Eyeglasses::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Eyeglasses::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Eyeglasses.h b/Sourcecode/private/mx/core/elements/Eyeglasses.h deleted file mode 100644 index 11f58a683..000000000 --- a/Sourcecode/private/mx/core/elements/Eyeglasses.h +++ /dev/null @@ -1,44 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Eyeglasses ) - - inline EyeglassesPtr makeEyeglasses() { return std::make_shared(); } - - class Eyeglasses : public ElementInterface - { - public: - Eyeglasses(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Falloff.cpp b/Sourcecode/private/mx/core/elements/Falloff.cpp deleted file mode 100644 index 28e543fcf..000000000 --- a/Sourcecode/private/mx/core/elements/Falloff.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Falloff.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Falloff::Falloff() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Falloff::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Falloff::hasContents() const { return false; } - std::ostream& Falloff::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Falloff::streamName( std::ostream& os ) const { os << "falloff"; return os; } - std::ostream& Falloff::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyLineAttributesPtr Falloff::getAttributes() const - { - return myAttributes; - } - - - void Falloff::setAttributes( const EmptyLineAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Falloff::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Falloff.h b/Sourcecode/private/mx/core/elements/Falloff.h deleted file mode 100644 index 2f19efaa3..000000000 --- a/Sourcecode/private/mx/core/elements/Falloff.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyLineAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyLineAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Falloff ) - - inline FalloffPtr makeFalloff() { return std::make_shared(); } - - class Falloff : public ElementInterface - { - public: - Falloff(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyLineAttributesPtr getAttributes() const; - void setAttributes( const EmptyLineAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyLineAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Feature.cpp b/Sourcecode/private/mx/core/elements/Feature.cpp deleted file mode 100644 index ce06dabe0..000000000 --- a/Sourcecode/private/mx/core/elements/Feature.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Feature.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Feature::Feature() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Feature::Feature( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Feature::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Feature::hasContents() const - { - return true; - } - - - std::ostream& Feature::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Feature::streamName( std::ostream& os ) const - { - os << "feature"; - return os; - } - - - std::ostream& Feature::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - FeatureAttributesPtr Feature::getAttributes() const - { - return myAttributes; - } - - - void Feature::setAttributes( const FeatureAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Feature::getValue() const - { - return myValue; - } - - - void Feature::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Feature::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Feature.h b/Sourcecode/private/mx/core/elements/Feature.h deleted file mode 100644 index 6b1b4923d..000000000 --- a/Sourcecode/private/mx/core/elements/Feature.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/FeatureAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FeatureAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Feature ) - - inline FeaturePtr makeFeature() { return std::make_shared(); } - inline FeaturePtr makeFeature( const XsString& value ) { return std::make_shared( value ); } - inline FeaturePtr makeFeature( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Feature : public ElementInterface - { - public: - Feature(); - Feature( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FeatureAttributesPtr getAttributes() const; - void setAttributes( const FeatureAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - FeatureAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FeatureAttributes.cpp b/Sourcecode/private/mx/core/elements/FeatureAttributes.cpp deleted file mode 100644 index c4384d079..000000000 --- a/Sourcecode/private/mx/core/elements/FeatureAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FeatureAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FeatureAttributes::FeatureAttributes() - :type() - ,hasType( false ) - {} - - - bool FeatureAttributes::hasValues() const - { - return hasType; - } - - - std::ostream& FeatureAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool FeatureAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "FeatureAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FeatureAttributes.h b/Sourcecode/private/mx/core/elements/FeatureAttributes.h deleted file mode 100644 index 170ebd13d..000000000 --- a/Sourcecode/private/mx/core/elements/FeatureAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FeatureAttributes ) - - struct FeatureAttributes : public AttributesInterface - { - public: - FeatureAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Fermata.cpp b/Sourcecode/private/mx/core/elements/Fermata.cpp deleted file mode 100644 index 001b24fa3..000000000 --- a/Sourcecode/private/mx/core/elements/Fermata.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Fermata.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Fermata::Fermata() - :myValue( FermataShape::normal ) - ,myAttributes( std::make_shared() ) - {} - - - Fermata::Fermata( const FermataShape& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Fermata::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Fermata::hasContents() const - { - return true; - } - - - std::ostream& Fermata::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Fermata::streamName( std::ostream& os ) const - { - os << "fermata"; - return os; - } - - - std::ostream& Fermata::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - FermataAttributesPtr Fermata::getAttributes() const - { - return myAttributes; - } - - - void Fermata::setAttributes( const FermataAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - FermataShape Fermata::getValue() const - { - return myValue; - } - - - void Fermata::setValue( const FermataShape& value ) - { - myValue = value; - } - - - bool Fermata::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseFermataShape( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Fermata.h b/Sourcecode/private/mx/core/elements/Fermata.h deleted file mode 100644 index 6b5e0cd7e..000000000 --- a/Sourcecode/private/mx/core/elements/Fermata.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/FermataAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FermataAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Fermata ) - - inline FermataPtr makeFermata() { return std::make_shared(); } - inline FermataPtr makeFermata( const FermataShape& value ) { return std::make_shared( value ); } - inline FermataPtr makeFermata( FermataShape&& value ) { return std::make_shared( std::move( value ) ); } - - class Fermata : public ElementInterface - { - public: - Fermata(); - Fermata( const FermataShape& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FermataAttributesPtr getAttributes() const; - void setAttributes( const FermataAttributesPtr& attributes ); - FermataShape getValue() const; - void setValue( const FermataShape& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FermataShape myValue; - FermataAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FermataAttributes.cpp b/Sourcecode/private/mx/core/elements/FermataAttributes.cpp deleted file mode 100644 index 719554ce8..000000000 --- a/Sourcecode/private/mx/core/elements/FermataAttributes.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FermataAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FermataAttributes::FermataAttributes() - :type( UprightInverted::upright ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,color() - ,hasType( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - {} - - - bool FermataAttributes::hasValues() const - { - return hasType || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor; - } - - - std::ostream& FermataAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - } - return os; - } - - - bool FermataAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "FermataAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type", &parseUprightInverted ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FermataAttributes.h b/Sourcecode/private/mx/core/elements/FermataAttributes.h deleted file mode 100644 index fe37d055b..000000000 --- a/Sourcecode/private/mx/core/elements/FermataAttributes.h +++ /dev/null @@ -1,57 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FermataAttributes ) - - struct FermataAttributes : public AttributesInterface - { - public: - FermataAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - UprightInverted type; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - bool hasType; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Fifths.cpp b/Sourcecode/private/mx/core/elements/Fifths.cpp deleted file mode 100644 index 5d34f9533..000000000 --- a/Sourcecode/private/mx/core/elements/Fifths.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Fifths.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Fifths::Fifths() - :myValue{ 0 } - {} - - - Fifths::Fifths( const FifthsValue& value ) - :myValue( value ) - {} - - - bool Fifths::hasAttributes() const - { - return false; - } - - - bool Fifths::hasContents() const - { - return true; - } - - - std::ostream& Fifths::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Fifths::streamName( std::ostream& os ) const - { - os << "fifths"; - return os; - } - - - std::ostream& Fifths::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - FifthsValue Fifths::getValue() const - { - return myValue; - } - - - void Fifths::setValue( const FifthsValue& value ) - { - myValue = value; - } - - - bool Fifths::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Fifths.h b/Sourcecode/private/mx/core/elements/Fifths.h deleted file mode 100644 index 36173ea55..000000000 --- a/Sourcecode/private/mx/core/elements/Fifths.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Fifths ) - - inline FifthsPtr makeFifths() { return std::make_shared(); } - inline FifthsPtr makeFifths( const FifthsValue& value ) { return std::make_shared( value ); } - inline FifthsPtr makeFifths( FifthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Fifths : public ElementInterface - { - public: - Fifths(); - Fifths( const FifthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FifthsValue getValue() const; - void setValue( const FifthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FifthsValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Figure.cpp b/Sourcecode/private/mx/core/elements/Figure.cpp deleted file mode 100644 index 1f40dc2b0..000000000 --- a/Sourcecode/private/mx/core/elements/Figure.cpp +++ /dev/null @@ -1,214 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Figure.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Extend.h" -#include "mx/core/elements/FigureNumber.h" -#include "mx/core/elements/Prefix.h" -#include "mx/core/elements/Suffix.h" -#include - -namespace mx -{ - namespace core - { - Figure::Figure() - :myPrefix( makePrefix() ) - ,myHasPrefix( false ) - ,myFigureNumber( makeFigureNumber() ) - ,myHasFigureNumber( false ) - ,mySuffix( makeSuffix() ) - ,myHasSuffix( false ) - ,myExtend( makeExtend() ) - ,myHasExtend( false ) - {} - - - bool Figure::hasAttributes() const - { - return false; - } - - - std::ostream& Figure::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Figure::streamName( std::ostream& os ) const - { - os << "figure"; - return os; - } - - - bool Figure::hasContents() const - { - return myHasPrefix || myHasFigureNumber || myHasSuffix || myHasExtend; - } - - - std::ostream& Figure::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasPrefix ) - { - os << std::endl; - myPrefix->toStream( os, indentLevel+1 ); - } - if ( myHasFigureNumber ) - { - os << std::endl; - myFigureNumber->toStream( os, indentLevel+1 ); - } - if ( myHasSuffix ) - { - os << std::endl; - mySuffix->toStream( os, indentLevel+1 ); - } - if ( myHasExtend ) - { - os << std::endl; - myExtend->toStream( os, indentLevel+1 ); - } - if ( hasContents() ) - { - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - PrefixPtr Figure::getPrefix() const - { - return myPrefix; - } - - - void Figure::setPrefix( const PrefixPtr& value ) - { - if( value ) - { - myPrefix = value; - } - } - - - bool Figure::getHasPrefix() const - { - return myHasPrefix; - } - - - void Figure::setHasPrefix( const bool value ) - { - myHasPrefix = value; - } - - - FigureNumberPtr Figure::getFigureNumber() const - { - return myFigureNumber; - } - - - void Figure::setFigureNumber( const FigureNumberPtr& value ) - { - if( value ) - { - myFigureNumber = value; - } - } - - - bool Figure::getHasFigureNumber() const - { - return myHasFigureNumber; - } - - - void Figure::setHasFigureNumber( const bool value ) - { - myHasFigureNumber = value; - } - - - SuffixPtr Figure::getSuffix() const - { - return mySuffix; - } - - - void Figure::setSuffix( const SuffixPtr& value ) - { - if( value ) - { - mySuffix = value; - } - } - - - bool Figure::getHasSuffix() const - { - return myHasSuffix; - } - - - void Figure::setHasSuffix( const bool value ) - { - myHasSuffix = value; - } - - - ExtendPtr Figure::getExtend() const - { - return myExtend; - } - - - void Figure::setExtend( const ExtendPtr& value ) - { - if( value ) - { - myExtend = value; - } - } - - - bool Figure::getHasExtend() const - { - return myHasExtend; - } - - - void Figure::setHasExtend( const bool value ) - { - myHasExtend = value; - } - - - bool Figure::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myPrefix, myHasPrefix ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myFigureNumber, myHasFigureNumber ) ) { continue; } - if ( importElement( message, *it, isSuccess, *mySuffix, myHasSuffix ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myExtend, myHasExtend ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Figure.h b/Sourcecode/private/mx/core/elements/Figure.h deleted file mode 100644 index 881056f8b..000000000 --- a/Sourcecode/private/mx/core/elements/Figure.h +++ /dev/null @@ -1,76 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Extend ) - MX_FORWARD_DECLARE_ELEMENT( FigureNumber ) - MX_FORWARD_DECLARE_ELEMENT( Prefix ) - MX_FORWARD_DECLARE_ELEMENT( Suffix ) - MX_FORWARD_DECLARE_ELEMENT( Figure ) - - inline FigurePtr makeFigure() { return std::make_shared
(); } - - class Figure : public ElementInterface - { - public: - Figure(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Prefix minOccurs = 0, maxOccurs = 1 _________ */ - PrefixPtr getPrefix() const; - void setPrefix( const PrefixPtr& value ); - bool getHasPrefix() const; - void setHasPrefix( const bool value ); - - /* _________ FigureNumber minOccurs = 0, maxOccurs = 1 _________ */ - FigureNumberPtr getFigureNumber() const; - void setFigureNumber( const FigureNumberPtr& value ); - bool getHasFigureNumber() const; - void setHasFigureNumber( const bool value ); - - /* _________ Suffix minOccurs = 0, maxOccurs = 1 _________ */ - SuffixPtr getSuffix() const; - void setSuffix( const SuffixPtr& value ); - bool getHasSuffix() const; - void setHasSuffix( const bool value ); - - /* _________ Extend minOccurs = 0, maxOccurs = 1 _________ */ - ExtendPtr getExtend() const; - void setExtend( const ExtendPtr& value ); - bool getHasExtend() const; - void setHasExtend( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PrefixPtr myPrefix; - bool myHasPrefix; - FigureNumberPtr myFigureNumber; - bool myHasFigureNumber; - SuffixPtr mySuffix; - bool myHasSuffix; - ExtendPtr myExtend; - bool myHasExtend; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FigureNumber.cpp b/Sourcecode/private/mx/core/elements/FigureNumber.cpp deleted file mode 100644 index ae210dfb6..000000000 --- a/Sourcecode/private/mx/core/elements/FigureNumber.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FigureNumber.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FigureNumber::FigureNumber() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - FigureNumber::FigureNumber( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool FigureNumber::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool FigureNumber::hasContents() const - { - return true; - } - - - std::ostream& FigureNumber::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& FigureNumber::streamName( std::ostream& os ) const - { - os << "figure-number"; - return os; - } - - - std::ostream& FigureNumber::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - FigureNumberAttributesPtr FigureNumber::getAttributes() const - { - return myAttributes; - } - - - void FigureNumber::setAttributes( const FigureNumberAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString FigureNumber::getValue() const - { - return myValue; - } - - - void FigureNumber::setValue( const XsString& value ) - { - myValue = value; - } - - - bool FigureNumber::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FigureNumber.h b/Sourcecode/private/mx/core/elements/FigureNumber.h deleted file mode 100644 index 6ceb5c2e7..000000000 --- a/Sourcecode/private/mx/core/elements/FigureNumber.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/FigureNumberAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FigureNumberAttributes ) - MX_FORWARD_DECLARE_ELEMENT( FigureNumber ) - - inline FigureNumberPtr makeFigureNumber() { return std::make_shared(); } - inline FigureNumberPtr makeFigureNumber( const XsString& value ) { return std::make_shared( value ); } - inline FigureNumberPtr makeFigureNumber( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class FigureNumber : public ElementInterface - { - public: - FigureNumber(); - FigureNumber( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FigureNumberAttributesPtr getAttributes() const; - void setAttributes( const FigureNumberAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - FigureNumberAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FigureNumberAttributes.cpp b/Sourcecode/private/mx/core/elements/FigureNumberAttributes.cpp deleted file mode 100644 index e75c7ffc3..000000000 --- a/Sourcecode/private/mx/core/elements/FigureNumberAttributes.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FigureNumberAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FigureNumberAttributes::FigureNumberAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool FigureNumberAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& FigureNumberAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool FigureNumberAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "FigureNumberAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FigureNumberAttributes.h b/Sourcecode/private/mx/core/elements/FigureNumberAttributes.h deleted file mode 100644 index 3289d86d0..000000000 --- a/Sourcecode/private/mx/core/elements/FigureNumberAttributes.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FigureNumberAttributes ) - - struct FigureNumberAttributes : public AttributesInterface - { - public: - FigureNumberAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FiguredBass.cpp b/Sourcecode/private/mx/core/elements/FiguredBass.cpp deleted file mode 100644 index 95a0cf8e0..000000000 --- a/Sourcecode/private/mx/core/elements/FiguredBass.cpp +++ /dev/null @@ -1,196 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FiguredBass.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Duration.h" -#include "mx/core/elements/EditorialGroup.h" -#include "mx/core/elements/Figure.h" -#include - -namespace mx -{ - namespace core - { - FiguredBass::FiguredBass() - :myAttributes( std::make_shared() ) - ,myFigureSet() - ,myDuration( makeDuration() ) - ,myHasDuration( false ) - ,myEditorialGroup( makeEditorialGroup() ) - { - myFigureSet.push_back( makeFigure() ); - } - - - bool FiguredBass::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& FiguredBass::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& FiguredBass::streamName( std::ostream& os ) const - { - os << "figured-bass"; - return os; - } - - - bool FiguredBass::hasContents() const - { - return true; - } - - - std::ostream& FiguredBass::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto x : myFigureSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasDuration ) - { - os << std::endl; - myDuration->toStream( os, indentLevel+1 ); - } - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - FiguredBassAttributesPtr FiguredBass::getAttributes() const - { - return myAttributes; - } - - - void FiguredBass::setAttributes( const FiguredBassAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const FigureSet& FiguredBass::getFigureSet() const - { - return myFigureSet; - } - - - void FiguredBass::removeFigure( const FigureSetIterConst& value ) - { - if ( value != myFigureSet.cend() ) - { - if ( myFigureSet.size() > 1 ) - { - myFigureSet.erase( value ); - } - } - } - - - void FiguredBass::addFigure( const FigurePtr& value ) - { - if ( value ) - { - myFigureSet.push_back( value ); - } - } - - - void FiguredBass::clearFigureSet() - { - myFigureSet.clear(); - while( myFigureSet.size() < 1 ) - { - myFigureSet.push_back( makeFigure() ); - } - } - - - FigurePtr FiguredBass::getFigure( const FigureSetIterConst& setIterator ) const - { - if( setIterator != myFigureSet.cend() ) - { - return *setIterator; - } - return FigurePtr(); - } - - - DurationPtr FiguredBass::getDuration() const - { - return myDuration; - } - - - void FiguredBass::setDuration( const DurationPtr& value ) - { - if ( value ) - { - myDuration = value; - } - } - - - bool FiguredBass::getHasDuration() const - { - return myHasDuration; - } - - - void FiguredBass::setHasDuration( const bool value ) - { - myHasDuration = value; - } - - - EditorialGroupPtr FiguredBass::getEditorialGroup() const - { - return myEditorialGroup; - } - - - void FiguredBass::setEditorialGroup( const EditorialGroupPtr& value ) - { - if ( value ) - { - myEditorialGroup = value; - } - } - - - bool FiguredBass::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "figure", myFigureSet ); - if ( importElement( message, *it, isSuccess, *myDuration, myHasDuration ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialGroup ); - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FiguredBass.h b/Sourcecode/private/mx/core/elements/FiguredBass.h deleted file mode 100644 index 4af6aa7d6..000000000 --- a/Sourcecode/private/mx/core/elements/FiguredBass.h +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/FiguredBassAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FiguredBassAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Duration ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( Figure ) - MX_FORWARD_DECLARE_ELEMENT( FiguredBass ) - - inline FiguredBassPtr makeFiguredBass() { return std::make_shared(); } - - class FiguredBass : public ElementInterface - { - public: - FiguredBass(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FiguredBassAttributesPtr getAttributes() const; - void setAttributes( const FiguredBassAttributesPtr& value ); - - /* _________ Figure minOccurs = 1, maxOccurs = unbounded _________ */ - const FigureSet& getFigureSet() const; - void addFigure( const FigurePtr& value ); - void removeFigure( const FigureSetIterConst& value ); - void clearFigureSet(); - FigurePtr getFigure( const FigureSetIterConst& setIterator ) const; - - /* _________ Duration minOccurs = 0, maxOccurs = 1 _________ */ - DurationPtr getDuration() const; - void setDuration( const DurationPtr& value ); - bool getHasDuration() const; - void setHasDuration( const bool value ); - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FiguredBassAttributesPtr myAttributes; - FigureSet myFigureSet; - DurationPtr myDuration; - bool myHasDuration; - EditorialGroupPtr myEditorialGroup; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FiguredBassAttributes.cpp b/Sourcecode/private/mx/core/elements/FiguredBassAttributes.cpp deleted file mode 100644 index 1b9b1e127..000000000 --- a/Sourcecode/private/mx/core/elements/FiguredBassAttributes.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FiguredBassAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FiguredBassAttributes::FiguredBassAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,printObject( YesNo::no ) - ,printDot( YesNo::no ) - ,printSpacing( YesNo::no ) - ,printLyric( YesNo::no ) - ,parentheses( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPrintObject( false ) - ,hasPrintDot( false ) - ,hasPrintSpacing( false ) - ,hasPrintLyric( false ) - ,hasParentheses( false ) - {} - - - bool FiguredBassAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPrintObject || - hasPrintDot || - hasPrintSpacing || - hasPrintLyric || - hasParentheses; - } - - - std::ostream& FiguredBassAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, printDot, "print-dot", hasPrintDot ); - streamAttribute( os, printSpacing, "print-spacing", hasPrintSpacing ); - streamAttribute( os, printLyric, "print-lyric", hasPrintLyric ); - streamAttribute( os, parentheses, "parentheses", hasParentheses ); - } - return os; - } - - - bool FiguredBassAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "FiguredBassAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printDot, hasPrintDot, "print-dot", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printSpacing, hasPrintSpacing, "print-spacing", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printLyric, hasPrintLyric, "print-lyric", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FiguredBassAttributes.h b/Sourcecode/private/mx/core/elements/FiguredBassAttributes.h deleted file mode 100644 index a83bdfa0f..000000000 --- a/Sourcecode/private/mx/core/elements/FiguredBassAttributes.h +++ /dev/null @@ -1,65 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FiguredBassAttributes ) - - struct FiguredBassAttributes : public AttributesInterface - { - public: - FiguredBassAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - YesNo printObject; - YesNo printDot; - YesNo printSpacing; - YesNo printLyric; - YesNo parentheses; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPrintObject; - bool hasPrintDot; - bool hasPrintSpacing; - bool hasPrintLyric; - bool hasParentheses; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Fingering.cpp b/Sourcecode/private/mx/core/elements/Fingering.cpp deleted file mode 100644 index 322333c47..000000000 --- a/Sourcecode/private/mx/core/elements/Fingering.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Fingering.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Fingering::Fingering() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Fingering::Fingering( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Fingering::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Fingering::hasContents() const - { - return true; - } - - - std::ostream& Fingering::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Fingering::streamName( std::ostream& os ) const - { - os << "fingering"; - return os; - } - - - std::ostream& Fingering::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - FingeringAttributesPtr Fingering::getAttributes() const - { - return myAttributes; - } - - - void Fingering::setAttributes( const FingeringAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Fingering::getValue() const - { - return myValue; - } - - - void Fingering::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Fingering::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Fingering.h b/Sourcecode/private/mx/core/elements/Fingering.h deleted file mode 100644 index 220fe0f52..000000000 --- a/Sourcecode/private/mx/core/elements/Fingering.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/FingeringAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FingeringAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Fingering ) - - inline FingeringPtr makeFingering() { return std::make_shared(); } - inline FingeringPtr makeFingering( const XsString& value ) { return std::make_shared( value ); } - inline FingeringPtr makeFingering( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Fingering : public ElementInterface - { - public: - Fingering(); - Fingering( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FingeringAttributesPtr getAttributes() const; - void setAttributes( const FingeringAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - FingeringAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FingeringAttributes.cpp b/Sourcecode/private/mx/core/elements/FingeringAttributes.cpp deleted file mode 100644 index bffa41338..000000000 --- a/Sourcecode/private/mx/core/elements/FingeringAttributes.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FingeringAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FingeringAttributes::FingeringAttributes() - :substitution( YesNo::no ) - ,alternate( YesNo::no ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasSubstitution( false ) - ,hasAlternate( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool FingeringAttributes::hasValues() const - { - return hasSubstitution || - hasAlternate || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& FingeringAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, substitution, "substitution", hasSubstitution ); - streamAttribute( os, alternate, "alternate", hasAlternate ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool FingeringAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "FingeringAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, substitution, hasSubstitution, "substitution", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, alternate, hasAlternate, "alternate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FingeringAttributes.h b/Sourcecode/private/mx/core/elements/FingeringAttributes.h deleted file mode 100644 index 3312ab040..000000000 --- a/Sourcecode/private/mx/core/elements/FingeringAttributes.h +++ /dev/null @@ -1,58 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FingeringAttributes ) - - struct FingeringAttributes : public AttributesInterface - { - public: - FingeringAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo substitution; - YesNo alternate; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasSubstitution; - bool hasAlternate; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Fingernails.cpp b/Sourcecode/private/mx/core/elements/Fingernails.cpp deleted file mode 100644 index c119170ba..000000000 --- a/Sourcecode/private/mx/core/elements/Fingernails.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Fingernails.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Fingernails::Fingernails() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Fingernails::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Fingernails::hasContents() const { return false; } - std::ostream& Fingernails::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Fingernails::streamName( std::ostream& os ) const { os << "fingernails"; return os; } - std::ostream& Fingernails::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr Fingernails::getAttributes() const - { - return myAttributes; - } - - - void Fingernails::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Fingernails::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Fingernails.h b/Sourcecode/private/mx/core/elements/Fingernails.h deleted file mode 100644 index b6161dd04..000000000 --- a/Sourcecode/private/mx/core/elements/Fingernails.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Fingernails ) - - inline FingernailsPtr makeFingernails() { return std::make_shared(); } - - class Fingernails : public ElementInterface - { - public: - Fingernails(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FirstFret.cpp b/Sourcecode/private/mx/core/elements/FirstFret.cpp deleted file mode 100644 index 866f12f66..000000000 --- a/Sourcecode/private/mx/core/elements/FirstFret.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FirstFret.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FirstFret::FirstFret() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - FirstFret::FirstFret( const PositiveInteger& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool FirstFret::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool FirstFret::hasContents() const - { - return true; - } - - - std::ostream& FirstFret::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& FirstFret::streamName( std::ostream& os ) const - { - os << "first-fret"; - return os; - } - - - std::ostream& FirstFret::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - FirstFretAttributesPtr FirstFret::getAttributes() const - { - return myAttributes; - } - - - void FirstFret::setAttributes( const FirstFretAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - PositiveInteger FirstFret::getValue() const - { - return myValue; - } - - - void FirstFret::setValue( const PositiveInteger& value ) - { - myValue = value; - } - - - bool FirstFret::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FirstFret.h b/Sourcecode/private/mx/core/elements/FirstFret.h deleted file mode 100644 index 456e33b71..000000000 --- a/Sourcecode/private/mx/core/elements/FirstFret.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" -#include "mx/core/elements/FirstFretAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FirstFretAttributes ) - MX_FORWARD_DECLARE_ELEMENT( FirstFret ) - - inline FirstFretPtr makeFirstFret() { return std::make_shared(); } - inline FirstFretPtr makeFirstFret( const PositiveInteger& value ) { return std::make_shared( value ); } - inline FirstFretPtr makeFirstFret( PositiveInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class FirstFret : public ElementInterface - { - public: - FirstFret(); - FirstFret( const PositiveInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FirstFretAttributesPtr getAttributes() const; - void setAttributes( const FirstFretAttributesPtr& attributes ); - PositiveInteger getValue() const; - void setValue( const PositiveInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveInteger myValue; - FirstFretAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FirstFretAttributes.cpp b/Sourcecode/private/mx/core/elements/FirstFretAttributes.cpp deleted file mode 100644 index 2894b8f24..000000000 --- a/Sourcecode/private/mx/core/elements/FirstFretAttributes.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FirstFretAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FirstFretAttributes::FirstFretAttributes() - :text() - ,location() - ,hasText( false ) - ,hasLocation( false ) - {} - - - bool FirstFretAttributes::hasValues() const - { - return hasText || - hasLocation; - } - - - std::ostream& FirstFretAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, text, "text", hasText ); - streamAttribute( os, location, "location", hasLocation ); - } - return os; - } - - - bool FirstFretAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "FirstFretAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, text, hasText, "text" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, location, hasLocation, "location", &parseLeftRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FirstFretAttributes.h b/Sourcecode/private/mx/core/elements/FirstFretAttributes.h deleted file mode 100644 index 75587f07a..000000000 --- a/Sourcecode/private/mx/core/elements/FirstFretAttributes.h +++ /dev/null @@ -1,40 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/XmlLang.h" -#include "mx/core/XsString.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FirstFretAttributes ) - - struct FirstFretAttributes : public AttributesInterface - { - public: - FirstFretAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken text; - LeftRight location; - bool hasText; - bool hasLocation; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Footnote.cpp b/Sourcecode/private/mx/core/elements/Footnote.cpp deleted file mode 100644 index c1295641c..000000000 --- a/Sourcecode/private/mx/core/elements/Footnote.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Footnote.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Footnote::Footnote() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Footnote::Footnote( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Footnote::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Footnote::hasContents() const - { - return true; - } - - - std::ostream& Footnote::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Footnote::streamName( std::ostream& os ) const - { - os << "footnote"; - return os; - } - - - std::ostream& Footnote::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - FootnoteAttributesPtr Footnote::getAttributes() const - { - return myAttributes; - } - - - void Footnote::setAttributes( const FootnoteAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Footnote::getValue() const - { - return myValue; - } - - - void Footnote::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Footnote::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Footnote.h b/Sourcecode/private/mx/core/elements/Footnote.h deleted file mode 100644 index 63a168b22..000000000 --- a/Sourcecode/private/mx/core/elements/Footnote.h +++ /dev/null @@ -1,51 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/FootnoteAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FootnoteAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Footnote ) - - inline FootnotePtr makeFootnote() { return std::make_shared(); } - inline FootnotePtr makeFootnote( const XsString& value ) { return std::make_shared( value ); } - inline FootnotePtr makeFootnote( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Footnote : public ElementInterface - { - public: - Footnote(); - Footnote( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FootnoteAttributesPtr getAttributes() const; - void setAttributes( const FootnoteAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - FootnoteAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FootnoteAttributes.cpp b/Sourcecode/private/mx/core/elements/FootnoteAttributes.cpp deleted file mode 100644 index d4582b3f1..000000000 --- a/Sourcecode/private/mx/core/elements/FootnoteAttributes.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FootnoteAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FootnoteAttributes::FootnoteAttributes() - :justify( LeftCenterRight::center ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lineHeight() - ,lang( XmlLang{ "it" } ) - ,space( XmlSpace::default_ ) - ,enclosure( EnclosureShape::rectangle ) - ,hasJustify( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLineHeight( false ) - ,hasLang( false ) - ,hasSpace( false ) - ,hasEnclosure( false ) - {} - - - bool FootnoteAttributes::hasValues() const - { - return hasJustify || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLineHeight || - hasLang || - hasSpace || - hasEnclosure; - } - - - std::ostream& FootnoteAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lineHeight, "line-height", hasLineHeight ); - streamAttribute( os, lang, "xml:lang", hasLang ); - streamAttribute( os, space, "xml:space", hasSpace ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } - - - bool FootnoteAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "FootnoteAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FootnoteAttributes.h b/Sourcecode/private/mx/core/elements/FootnoteAttributes.h deleted file mode 100644 index f73f3e156..000000000 --- a/Sourcecode/private/mx/core/elements/FootnoteAttributes.h +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" -#include "mx/core/NumberOrNormal.h" -#include "mx/core/XmlLang.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FootnoteAttributes ) - - struct FootnoteAttributes : public AttributesInterface - { - public: - FootnoteAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LeftCenterRight justify; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - NumberOrNormal lineHeight; - XmlLang lang; - XmlSpace space; - EnclosureShape enclosure; - bool hasJustify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLineHeight; - bool hasLang; - bool hasSpace; - bool hasEnclosure; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Forward.cpp b/Sourcecode/private/mx/core/elements/Forward.cpp deleted file mode 100644 index e039d5f44..000000000 --- a/Sourcecode/private/mx/core/elements/Forward.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Forward.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Duration.h" -#include "mx/core/elements/EditorialVoiceGroup.h" -#include "mx/core/elements/Staff.h" -#include - -namespace mx -{ - namespace core - { - Forward::Forward() - :myDuration( makeDuration() ) - ,myEditorialVoiceGroup( makeEditorialVoiceGroup() ) - ,myStaff( makeStaff() ) - ,myHasStaff( false ) - {} - - - bool Forward::hasAttributes() const - { - return false; - } - - - std::ostream& Forward::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Forward::streamName( std::ostream& os ) const - { - os << "forward"; - return os; - } - - - bool Forward::hasContents() const - { - return true; - } - - - std::ostream& Forward::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myDuration->toStream( os, indentLevel+1 ); - if ( myEditorialVoiceGroup->hasContents() ) - { - os << std::endl; - myEditorialVoiceGroup->streamContents(os, indentLevel+1, isOneLineOnly ); - } - if ( myHasStaff ) - { - os << std::endl; - myStaff->toStream( os, indentLevel+1 ); - } - isOneLineOnly = false; - os << std::endl; - return os; - } - - - DurationPtr Forward::getDuration() const - { - return myDuration; - } - - - void Forward::setDuration( const DurationPtr& value ) - { - if( value ) - { - myDuration = value; - } - } - - - EditorialVoiceGroupPtr Forward::getEditorialVoiceGroup() const - { - return myEditorialVoiceGroup; - } - - - void Forward::setEditorialVoiceGroup( const EditorialVoiceGroupPtr& value ) - { - if ( value ) - { - myEditorialVoiceGroup = value; - } - } - - - StaffPtr Forward::getStaff() const - { - return myStaff; - } - - - void Forward::setStaff( const StaffPtr& value ) - { - if( value ) - { - myStaff = value; - } - } - - - bool Forward::getHasStaff() const - { - return myHasStaff; - } - - - void Forward::setHasStaff( const bool value ) - { - myHasStaff = value; - } - - - bool Forward::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isDurationFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myDuration, isDurationFound ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialVoiceGroup ); - if ( importElement( message, *it, isSuccess, *myStaff, myHasStaff ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Forward.h b/Sourcecode/private/mx/core/elements/Forward.h deleted file mode 100644 index 2597af8f5..000000000 --- a/Sourcecode/private/mx/core/elements/Forward.h +++ /dev/null @@ -1,62 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Duration ) - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceGroup ) - MX_FORWARD_DECLARE_ELEMENT( Footnote ) - MX_FORWARD_DECLARE_ELEMENT( Staff ) - MX_FORWARD_DECLARE_ELEMENT( Forward ) - - inline ForwardPtr makeForward() { return std::make_shared(); } - - class Forward : public ElementInterface - { - public: - Forward(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Duration minOccurs = 1, maxOccurs = 1 _________ */ - DurationPtr getDuration() const; - void setDuration( const DurationPtr& value ); - - /* _________ Footnote minOccurs = 1, maxOccurs = 1 _________ */ - EditorialVoiceGroupPtr getEditorialVoiceGroup() const; - void setEditorialVoiceGroup( const EditorialVoiceGroupPtr& value ); - - /* _________ Staff minOccurs = 0, maxOccurs = 1 _________ */ - StaffPtr getStaff() const; - void setStaff( const StaffPtr& value ); - bool getHasStaff() const; - void setHasStaff( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DurationPtr myDuration; - EditorialVoiceGroupPtr myEditorialVoiceGroup; - StaffPtr myStaff; - bool myHasStaff; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Frame.cpp b/Sourcecode/private/mx/core/elements/Frame.cpp deleted file mode 100644 index f51a92fa4..000000000 --- a/Sourcecode/private/mx/core/elements/Frame.cpp +++ /dev/null @@ -1,220 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Frame.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/FirstFret.h" -#include "mx/core/elements/FrameFrets.h" -#include "mx/core/elements/FrameNote.h" -#include "mx/core/elements/FrameStrings.h" -#include - -namespace mx -{ - namespace core - { - Frame::Frame() - :myAttributes( std::make_shared() ) - ,myFrameStrings( makeFrameStrings() ) - ,myFrameFrets( makeFrameFrets() ) - ,myFirstFret( makeFirstFret() ) - ,myHasFirstFret( false ) - ,myFrameNoteSet() - { - myFrameNoteSet.push_back( makeFrameNote() ); - } - - - bool Frame::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Frame::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Frame::streamName( std::ostream& os ) const - { - os << "frame"; - return os; - } - - - bool Frame::hasContents() const - { - return true; - } - - - std::ostream& Frame::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myFrameStrings->toStream( os, indentLevel+1 ); - os << std::endl; - myFrameFrets->toStream( os, indentLevel+1 ); - if ( myHasFirstFret ) - { - os << std::endl; - myFirstFret->toStream( os, indentLevel+1 ); - } - for ( auto x : myFrameNoteSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - return os; - } - - - FrameAttributesPtr Frame::getAttributes() const - { - return myAttributes; - } - - - void Frame::setAttributes( const FrameAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - FrameStringsPtr Frame::getFrameStrings() const - { - return myFrameStrings; - } - - - void Frame::setFrameStrings( const FrameStringsPtr& value ) - { - if( value ) - { - myFrameStrings = value; - } - } - - - FrameFretsPtr Frame::getFrameFrets() const - { - return myFrameFrets; - } - - - void Frame::setFrameFrets( const FrameFretsPtr& value ) - { - if( value ) - { - myFrameFrets = value; - } - } - - - FirstFretPtr Frame::getFirstFret() const - { - return myFirstFret; - } - - - void Frame::setFirstFret( const FirstFretPtr& value ) - { - if( value ) - { - myFirstFret = value; - } - } - - - bool Frame::getHasFirstFret() const - { - return myHasFirstFret; - } - - - void Frame::setHasFirstFret( const bool value ) - { - myHasFirstFret = value; - } - - - const FrameNoteSet& Frame::getFrameNoteSet() const - { - return myFrameNoteSet; - } - - - void Frame::removeFrameNote( const FrameNoteSetIterConst& value ) - { - if ( value != myFrameNoteSet.cend() ) - { - if ( myFrameNoteSet.size() > 1 ) - { - myFrameNoteSet.erase( value ); - } - } - } - - - void Frame::addFrameNote( const FrameNotePtr& value ) - { - if ( value ) - { - myFrameNoteSet.push_back( value ); - } - } - - - void Frame::clearFrameNoteSet() - { - myFrameNoteSet.clear(); - myFrameNoteSet.push_back( makeFrameNote() ); - } - - - FrameNotePtr Frame::getFrameNote( const FrameNoteSetIterConst& setIterator ) const - { - if( setIterator != myFrameNoteSet.cend() ) - { - return *setIterator; - } - return FrameNotePtr(); - } - - - bool Frame::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isFrameStringsFound = false; - bool isFrameFretsFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myFrameStrings, isFrameStringsFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myFrameFrets, isFrameFretsFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myFirstFret, myHasFirstFret ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "frame-note", myFrameNoteSet ); - } - - if( !isFrameStringsFound ) - { - message << "Frame: '" << myFrameStrings->getElementName() << "' is required but was not found" << std::endl; - } - if( !isFrameFretsFound ) - { - message << "Frame: '" << myFrameFrets->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Frame.h b/Sourcecode/private/mx/core/elements/Frame.h deleted file mode 100644 index 4feb6e214..000000000 --- a/Sourcecode/private/mx/core/elements/Frame.h +++ /dev/null @@ -1,75 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/FrameAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FrameAttributes ) - MX_FORWARD_DECLARE_ELEMENT( FirstFret ) - MX_FORWARD_DECLARE_ELEMENT( FrameFrets ) - MX_FORWARD_DECLARE_ELEMENT( FrameNote ) - MX_FORWARD_DECLARE_ELEMENT( FrameStrings ) - MX_FORWARD_DECLARE_ELEMENT( Frame ) - - inline FramePtr makeFrame() { return std::make_shared(); } - - class Frame : public ElementInterface - { - public: - Frame(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FrameAttributesPtr getAttributes() const; - void setAttributes( const FrameAttributesPtr& value ); - - /* _________ FrameStrings minOccurs = 1, maxOccurs = 1 _________ */ - FrameStringsPtr getFrameStrings() const; - void setFrameStrings( const FrameStringsPtr& value ); - - /* _________ FrameFrets minOccurs = 1, maxOccurs = 1 _________ */ - FrameFretsPtr getFrameFrets() const; - void setFrameFrets( const FrameFretsPtr& value ); - - /* _________ FirstFret minOccurs = 0, maxOccurs = 1 _________ */ - FirstFretPtr getFirstFret() const; - void setFirstFret( const FirstFretPtr& value ); - bool getHasFirstFret() const; - void setHasFirstFret( const bool value ); - - /* _________ FrameNote minOccurs = 1, maxOccurs = unbounded _________ */ - const FrameNoteSet& getFrameNoteSet() const; - void addFrameNote( const FrameNotePtr& value ); - void removeFrameNote( const FrameNoteSetIterConst& value ); - void clearFrameNoteSet(); - FrameNotePtr getFrameNote( const FrameNoteSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FrameAttributesPtr myAttributes; - FrameStringsPtr myFrameStrings; - FrameFretsPtr myFrameFrets; - FirstFretPtr myFirstFret; - bool myHasFirstFret; - FrameNoteSet myFrameNoteSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FrameAttributes.cpp b/Sourcecode/private/mx/core/elements/FrameAttributes.cpp deleted file mode 100644 index 82e1dcea8..000000000 --- a/Sourcecode/private/mx/core/elements/FrameAttributes.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FrameAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FrameAttributes::FrameAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,color() - ,halign( LeftCenterRight::center ) - ,valign() - ,height() - ,width() - ,unplayed() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - ,hasHeight( false ) - ,hasWidth( false ) - ,hasUnplayed( false ) - {} - - - bool FrameAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasColor || - hasHalign || - hasValign || - hasHeight || - hasWidth || - hasUnplayed; - } - - - std::ostream& FrameAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - streamAttribute( os, height, "height", hasHeight ); - streamAttribute( os, width, "width", hasWidth ); - streamAttribute( os, unplayed, "unplayed", hasUnplayed ); - } - return os; - } - - - bool FrameAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "FrameAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValignImage ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, height, hasHeight, "height" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, width, hasWidth, "width" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, unplayed, hasUnplayed, "unplayed" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FrameAttributes.h b/Sourcecode/private/mx/core/elements/FrameAttributes.h deleted file mode 100644 index 5549525ca..000000000 --- a/Sourcecode/private/mx/core/elements/FrameAttributes.h +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FrameAttributes ) - - struct FrameAttributes : public AttributesInterface - { - public: - FrameAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - Color color; - LeftCenterRight halign; - ValignImage valign; - TenthsValue height; - TenthsValue width; - XsToken unplayed; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasColor; - bool hasHalign; - bool hasValign; - bool hasHeight; - bool hasWidth; - bool hasUnplayed; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FrameFrets.cpp b/Sourcecode/private/mx/core/elements/FrameFrets.cpp deleted file mode 100644 index 3f8b72589..000000000 --- a/Sourcecode/private/mx/core/elements/FrameFrets.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FrameFrets.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FrameFrets::FrameFrets() - :myValue() - {} - - - FrameFrets::FrameFrets( const PositiveInteger& value ) - :myValue( value ) - {} - - - bool FrameFrets::hasAttributes() const - { - return false; - } - - - bool FrameFrets::hasContents() const - { - return true; - } - - - std::ostream& FrameFrets::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& FrameFrets::streamName( std::ostream& os ) const - { - os << "frame-frets"; - return os; - } - - - std::ostream& FrameFrets::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PositiveInteger FrameFrets::getValue() const - { - return myValue; - } - - - void FrameFrets::setValue( const PositiveInteger& value ) - { - myValue = value; - } - - - bool FrameFrets::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FrameFrets.h b/Sourcecode/private/mx/core/elements/FrameFrets.h deleted file mode 100644 index 1e6440b1f..000000000 --- a/Sourcecode/private/mx/core/elements/FrameFrets.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( FrameFrets ) - - inline FrameFretsPtr makeFrameFrets() { return std::make_shared(); } - inline FrameFretsPtr makeFrameFrets( const PositiveInteger& value ) { return std::make_shared( value ); } - inline FrameFretsPtr makeFrameFrets( PositiveInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class FrameFrets : public ElementInterface - { - public: - FrameFrets(); - FrameFrets( const PositiveInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PositiveInteger getValue() const; - void setValue( const PositiveInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveInteger myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FrameNote.cpp b/Sourcecode/private/mx/core/elements/FrameNote.cpp deleted file mode 100644 index 19d386da4..000000000 --- a/Sourcecode/private/mx/core/elements/FrameNote.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FrameNote.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Barre.h" -#include "mx/core/elements/Fingering.h" -#include "mx/core/elements/Fret.h" -#include "mx/core/elements/String.h" -#include - -namespace mx -{ - namespace core - { - FrameNote::FrameNote() - :myString( makeString() ) - ,myFret( makeFret() ) - ,myFingering( makeFingering() ) - ,myHasFingering( false ) - ,myBarre( makeBarre() ) - ,myHasBarre( false ) - {} - - - bool FrameNote::hasAttributes() const - { - return false; - } - - - std::ostream& FrameNote::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& FrameNote::streamName( std::ostream& os ) const - { - os << "frame-note"; - return os; - } - - - bool FrameNote::hasContents() const - { - return true; - } - - - std::ostream& FrameNote::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myString->toStream( os, indentLevel+1 ); - os << std::endl; - myFret->toStream( os, indentLevel+1 ); - if ( myHasFingering ) - { - os << std::endl; - myFingering->toStream( os, indentLevel+1 ); - } - if ( myHasBarre ) - { - os << std::endl; - myBarre->toStream( os, indentLevel+1 ); - } - os << std::endl; - return os; - } - - - StringPtr FrameNote::getString() const - { - return myString; - } - - - void FrameNote::setString( const StringPtr& value ) - { - if( value ) - { - myString = value; - } - } - - - FretPtr FrameNote::getFret() const - { - return myFret; - } - - - void FrameNote::setFret( const FretPtr& value ) - { - if( value ) - { - myFret = value; - } - } - - - FingeringPtr FrameNote::getFingering() const - { - return myFingering; - } - - - void FrameNote::setFingering( const FingeringPtr& value ) - { - if( value ) - { - myFingering = value; - } - } - - - bool FrameNote::getHasFingering() const - { - return myHasFingering; - } - - - void FrameNote::setHasFingering( const bool value ) - { - myHasFingering = value; - } - - - BarrePtr FrameNote::getBarre() const - { - return myBarre; - } - - - void FrameNote::setBarre( const BarrePtr& value ) - { - if( value ) - { - myBarre = value; - } - } - - - bool FrameNote::getHasBarre() const - { - return myHasBarre; - } - - - void FrameNote::setHasBarre( const bool value ) - { - myHasBarre = value; - } - - - bool FrameNote::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isStringFound = false; - bool isFretFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myString, isStringFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myFret, isFretFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myFingering, myHasFingering ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myBarre, myHasBarre ) ) { continue; } - } - - if( !isStringFound ) - { - message << "FrameNote: '" << myString->getElementName() << "' is required but was not found" << std::endl; - } - if( !isFretFound ) - { - message << "FrameNote: '" << myFret->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FrameNote.h b/Sourcecode/private/mx/core/elements/FrameNote.h deleted file mode 100644 index 1efd1e692..000000000 --- a/Sourcecode/private/mx/core/elements/FrameNote.h +++ /dev/null @@ -1,70 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Barre ) - MX_FORWARD_DECLARE_ELEMENT( Fingering ) - MX_FORWARD_DECLARE_ELEMENT( Fret ) - MX_FORWARD_DECLARE_ELEMENT( String ) - MX_FORWARD_DECLARE_ELEMENT( FrameNote ) - - inline FrameNotePtr makeFrameNote() { return std::make_shared(); } - - class FrameNote : public ElementInterface - { - public: - FrameNote(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ String minOccurs = 1, maxOccurs = 1 _________ */ - StringPtr getString() const; - void setString( const StringPtr& value ); - - /* _________ Fret minOccurs = 1, maxOccurs = 1 _________ */ - FretPtr getFret() const; - void setFret( const FretPtr& value ); - - /* _________ Fingering minOccurs = 0, maxOccurs = 1 _________ */ - FingeringPtr getFingering() const; - void setFingering( const FingeringPtr& value ); - bool getHasFingering() const; - void setHasFingering( const bool value ); - - /* _________ Barre minOccurs = 0, maxOccurs = 1 _________ */ - BarrePtr getBarre() const; - void setBarre( const BarrePtr& value ); - bool getHasBarre() const; - void setHasBarre( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StringPtr myString; - FretPtr myFret; - FingeringPtr myFingering; - bool myHasFingering; - BarrePtr myBarre; - bool myHasBarre; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FrameStrings.cpp b/Sourcecode/private/mx/core/elements/FrameStrings.cpp deleted file mode 100644 index 927bf2d08..000000000 --- a/Sourcecode/private/mx/core/elements/FrameStrings.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FrameStrings.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FrameStrings::FrameStrings() - :myValue() - {} - - - FrameStrings::FrameStrings( const PositiveInteger& value ) - :myValue( value ) - {} - - - bool FrameStrings::hasAttributes() const - { - return false; - } - - - bool FrameStrings::hasContents() const - { - return true; - } - - - std::ostream& FrameStrings::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& FrameStrings::streamName( std::ostream& os ) const - { - os << "frame-strings"; - return os; - } - - - std::ostream& FrameStrings::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PositiveInteger FrameStrings::getValue() const - { - return myValue; - } - - - void FrameStrings::setValue( const PositiveInteger& value ) - { - myValue = value; - } - - - bool FrameStrings::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FrameStrings.h b/Sourcecode/private/mx/core/elements/FrameStrings.h deleted file mode 100644 index 7988f1c2c..000000000 --- a/Sourcecode/private/mx/core/elements/FrameStrings.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( FrameStrings ) - - inline FrameStringsPtr makeFrameStrings() { return std::make_shared(); } - inline FrameStringsPtr makeFrameStrings( const PositiveInteger& value ) { return std::make_shared( value ); } - inline FrameStringsPtr makeFrameStrings( PositiveInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class FrameStrings : public ElementInterface - { - public: - FrameStrings(); - FrameStrings( const PositiveInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PositiveInteger getValue() const; - void setValue( const PositiveInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveInteger myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Fret.cpp b/Sourcecode/private/mx/core/elements/Fret.cpp deleted file mode 100644 index e48db2307..000000000 --- a/Sourcecode/private/mx/core/elements/Fret.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Fret.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Fret::Fret() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Fret::Fret( const NonNegativeInteger& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Fret::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Fret::hasContents() const - { - return true; - } - - - std::ostream& Fret::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Fret::streamName( std::ostream& os ) const - { - os << "fret"; - return os; - } - - - std::ostream& Fret::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - FretAttributesPtr Fret::getAttributes() const - { - return myAttributes; - } - - - void Fret::setAttributes( const FretAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - NonNegativeInteger Fret::getValue() const - { - return myValue; - } - - - void Fret::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } - - - bool Fret::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Fret.h b/Sourcecode/private/mx/core/elements/Fret.h deleted file mode 100644 index 85fa65081..000000000 --- a/Sourcecode/private/mx/core/elements/Fret.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" -#include "mx/core/elements/FretAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FretAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Fret ) - - inline FretPtr makeFret() { return std::make_shared(); } - inline FretPtr makeFret( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline FretPtr makeFret( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class Fret : public ElementInterface - { - public: - Fret(); - Fret( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FretAttributesPtr getAttributes() const; - void setAttributes( const FretAttributesPtr& attributes ); - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - FretAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FretAttributes.cpp b/Sourcecode/private/mx/core/elements/FretAttributes.cpp deleted file mode 100644 index b74c4da09..000000000 --- a/Sourcecode/private/mx/core/elements/FretAttributes.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FretAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FretAttributes::FretAttributes() - :fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool FretAttributes::hasValues() const - { - return hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& FretAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool FretAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "FretAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FretAttributes.h b/Sourcecode/private/mx/core/elements/FretAttributes.h deleted file mode 100644 index 2f63939fc..000000000 --- a/Sourcecode/private/mx/core/elements/FretAttributes.h +++ /dev/null @@ -1,43 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FretAttributes ) - - struct FretAttributes : public AttributesInterface - { - public: - FretAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FullNoteGroup.cpp b/Sourcecode/private/mx/core/elements/FullNoteGroup.cpp deleted file mode 100644 index 5f9c08f78..000000000 --- a/Sourcecode/private/mx/core/elements/FullNoteGroup.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FullNoteGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Chord.h" -#include "mx/core/elements/FullNoteTypeChoice.h" -#include - -namespace mx -{ - namespace core - { - FullNoteGroup::FullNoteGroup() - :myChord( makeChord() ) - ,myHasChord( false ) - ,myFullNoteTypeChoice( nullptr ) - {} - - - bool FullNoteGroup::hasAttributes() const - { - return false; - } - - - std::ostream& FullNoteGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& FullNoteGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool FullNoteGroup::hasContents() const - { - return true; - } - - - std::ostream& FullNoteGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasChord ) - { - myChord->toStream( os, indentLevel ); - os << std::endl; - } - getFullNoteTypeChoice()->streamContents( os, indentLevel, isOneLineOnly ); - isOneLineOnly = false; - return os; - } - - - ChordPtr FullNoteGroup::getChord() const - { - return myChord; - } - - - void FullNoteGroup::setChord( const ChordPtr& value ) - { - if ( value ) - { - myChord = value; - } - } - - - bool FullNoteGroup::getHasChord() const - { - return myHasChord; - } - - - void FullNoteGroup::setHasChord( const bool value ) - { - myHasChord = value; - } - - - FullNoteTypeChoicePtr FullNoteGroup::getFullNoteTypeChoice() const - { - MX_LOCK - MX_JIT_ALLOCATE( FullNoteTypeChoice ); - return myFullNoteTypeChoice; - } - - - void FullNoteGroup::setFullNoteTypeChoice( const FullNoteTypeChoicePtr& value ) - { - if ( value ) - { - myFullNoteTypeChoice = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( FullNoteGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/FullNoteGroup.h b/Sourcecode/private/mx/core/elements/FullNoteGroup.h deleted file mode 100644 index 8a2ac1ab0..000000000 --- a/Sourcecode/private/mx/core/elements/FullNoteGroup.h +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Chord ) - MX_FORWARD_DECLARE_ELEMENT( FullNoteTypeChoice ) - MX_FORWARD_DECLARE_ELEMENT( FullNoteGroup ) - - inline FullNoteGroupPtr makeFullNoteGroup() { return std::make_shared(); } - - class FullNoteGroup : public ElementInterface - { - public: - FullNoteGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Chord minOccurs = 0, maxOccurs = 1 _________ */ - ChordPtr getChord() const; - void setChord( const ChordPtr& value ); - bool getHasChord() const; - void setHasChord( const bool value ); - - /* _________ FullNoteTypeChoice minOccurs = 1, maxOccurs = 1 _________ */ - FullNoteTypeChoicePtr getFullNoteTypeChoice() const; - void setFullNoteTypeChoice( const FullNoteTypeChoicePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MX_MUTEX - ChordPtr myChord; - bool myHasChord; - mutable FullNoteTypeChoicePtr myFullNoteTypeChoice; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.cpp b/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.cpp deleted file mode 100644 index 4dbafbde8..000000000 --- a/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.cpp +++ /dev/null @@ -1,136 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FullNoteTypeChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Pitch.h" -#include "mx/core/elements/Rest.h" -#include "mx/core/elements/Unpitched.h" -#include - -namespace mx -{ - namespace core - { - FullNoteTypeChoice::FullNoteTypeChoice() - :myChoice( Choice::pitch ) - ,myPitch( makePitch() ) - ,myUnpitched( makeUnpitched() ) - ,myRest( makeRest() ) - {} - - - bool FullNoteTypeChoice::hasAttributes() const - { - return false; - } - - - std::ostream& FullNoteTypeChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& FullNoteTypeChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool FullNoteTypeChoice::hasContents() const - { - return true; - } - - - std::ostream& FullNoteTypeChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - - MX_UNUSED( indentLevel ); - MX_UNUSED( isOneLineOnly ); - - switch ( myChoice ) - { - case Choice::pitch: - getPitch()->toStream( os, indentLevel ); - break; - case Choice::unpitched: - getUnpitched()->toStream( os, indentLevel ); - break; - case Choice::rest: - getRest()->toStream( os, indentLevel ); - break; - default: - break; - } - return os; - } - - - FullNoteTypeChoice::Choice FullNoteTypeChoice::getChoice() const - { - return myChoice; - } - - - void FullNoteTypeChoice::setChoice( const FullNoteTypeChoice::Choice value ) - { - myChoice = value; - } - - - PitchPtr FullNoteTypeChoice::getPitch() const - { - MX_LOCK - MX_JIT_ALLOCATE( Pitch ); - return myPitch; - } - - - void FullNoteTypeChoice::setPitch( const PitchPtr& value ) - { - if ( value ) - { - myPitch = value; - } - } - - - UnpitchedPtr FullNoteTypeChoice::getUnpitched() const - { - MX_LOCK - MX_JIT_ALLOCATE( Unpitched ); - return myUnpitched; - } - - - void FullNoteTypeChoice::setUnpitched( const UnpitchedPtr& value ) - { - if ( value ) - { - myUnpitched = value; - } - } - - - RestPtr FullNoteTypeChoice::getRest() const - { - MX_LOCK - MX_JIT_ALLOCATE( Rest ); - return myRest; - } - - - void FullNoteTypeChoice::setRest( const RestPtr& value ) - { - if ( value ) - { - myRest = value; - } - } - - MX_FROM_XELEMENT_UNUSED( FullNoteTypeChoice ); - } -} diff --git a/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.h b/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.h deleted file mode 100644 index 986032a28..000000000 --- a/Sourcecode/private/mx/core/elements/FullNoteTypeChoice.h +++ /dev/null @@ -1,70 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Pitch ) - MX_FORWARD_DECLARE_ELEMENT( Rest ) - MX_FORWARD_DECLARE_ELEMENT( Unpitched ) - MX_FORWARD_DECLARE_ELEMENT( FullNoteTypeChoice ) - - inline FullNoteTypeChoicePtr makeFullNoteTypeChoice() { return std::make_shared(); } - - class FullNoteTypeChoice : public ElementInterface - { - public: - enum class Choice - { - pitch = 1, - unpitched = 2, - rest = 3 - }; - FullNoteTypeChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - FullNoteTypeChoice::Choice getChoice() const; - void setChoice( const FullNoteTypeChoice::Choice value ); - - /* _________ Pitch minOccurs = 1, maxOccurs = 1 _________ */ - PitchPtr getPitch() const; - void setPitch( const PitchPtr& value ); - - /* _________ Unpitched minOccurs = 1, maxOccurs = 1 _________ */ - UnpitchedPtr getUnpitched() const; - void setUnpitched( const UnpitchedPtr& value ); - - /* _________ Rest minOccurs = 1, maxOccurs = 1 _________ */ - RestPtr getRest() const; - void setRest( const RestPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MX_MUTEX - Choice myChoice; - mutable PitchPtr myPitch; - mutable UnpitchedPtr myUnpitched; - mutable RestPtr myRest; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Function.cpp b/Sourcecode/private/mx/core/elements/Function.cpp deleted file mode 100644 index 99b3ebab6..000000000 --- a/Sourcecode/private/mx/core/elements/Function.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Function.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Function::Function() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Function::Function( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Function::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Function::hasContents() const - { - return true; - } - - - std::ostream& Function::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Function::streamName( std::ostream& os ) const - { - os << "function"; - return os; - } - - - std::ostream& Function::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - FunctionAttributesPtr Function::getAttributes() const - { - return myAttributes; - } - - - void Function::setAttributes( const FunctionAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Function::getValue() const - { - return myValue; - } - - - void Function::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Function::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Function.h b/Sourcecode/private/mx/core/elements/Function.h deleted file mode 100644 index 1e35c3af7..000000000 --- a/Sourcecode/private/mx/core/elements/Function.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/FunctionAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FunctionAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Function ) - - inline FunctionPtr makeFunction() { return std::make_shared(); } - inline FunctionPtr makeFunction( const XsString& value ) { return std::make_shared( value ); } - inline FunctionPtr makeFunction( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Function : public ElementInterface - { - public: - Function(); - Function( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - FunctionAttributesPtr getAttributes() const; - void setAttributes( const FunctionAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - FunctionAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/FunctionAttributes.cpp b/Sourcecode/private/mx/core/elements/FunctionAttributes.cpp deleted file mode 100644 index 30b93770b..000000000 --- a/Sourcecode/private/mx/core/elements/FunctionAttributes.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/FunctionAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - FunctionAttributes::FunctionAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool FunctionAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& FunctionAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool FunctionAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "FunctionAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/FunctionAttributes.h b/Sourcecode/private/mx/core/elements/FunctionAttributes.h deleted file mode 100644 index 2cc6a4a7f..000000000 --- a/Sourcecode/private/mx/core/elements/FunctionAttributes.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( FunctionAttributes ) - - struct FunctionAttributes : public AttributesInterface - { - public: - FunctionAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Glass.cpp b/Sourcecode/private/mx/core/elements/Glass.cpp deleted file mode 100644 index f66cbc711..000000000 --- a/Sourcecode/private/mx/core/elements/Glass.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Glass.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Glass::Glass() - :myValue( GlassEnum::windChimes ) - {} - - - Glass::Glass( const GlassEnum& value ) - :myValue( value ) - {} - - - bool Glass::hasAttributes() const - { - return false; - } - - - bool Glass::hasContents() const - { - return true; - } - - - std::ostream& Glass::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Glass::streamName( std::ostream& os ) const - { - os << "glass"; - return os; - } - - - std::ostream& Glass::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - GlassEnum Glass::getValue() const - { - return myValue; - } - - - void Glass::setValue( const GlassEnum& value ) - { - myValue = value; - } - - - bool Glass::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseGlassEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Glass.h b/Sourcecode/private/mx/core/elements/Glass.h deleted file mode 100644 index 4a829cab4..000000000 --- a/Sourcecode/private/mx/core/elements/Glass.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Glass ) - - inline GlassPtr makeGlass() { return std::make_shared(); } - inline GlassPtr makeGlass( const GlassEnum& value ) { return std::make_shared( value ); } - inline GlassPtr makeGlass( GlassEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Glass : public ElementInterface - { - public: - Glass(); - Glass( const GlassEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GlassEnum getValue() const; - void setValue( const GlassEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GlassEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Glissando.cpp b/Sourcecode/private/mx/core/elements/Glissando.cpp deleted file mode 100644 index 22fe16ceb..000000000 --- a/Sourcecode/private/mx/core/elements/Glissando.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Glissando.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Glissando::Glissando() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Glissando::Glissando( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Glissando::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Glissando::hasContents() const - { - return true; - } - - - std::ostream& Glissando::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Glissando::streamName( std::ostream& os ) const - { - os << "glissando"; - return os; - } - - - std::ostream& Glissando::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - GlissandoAttributesPtr Glissando::getAttributes() const - { - return myAttributes; - } - - - void Glissando::setAttributes( const GlissandoAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Glissando::getValue() const - { - return myValue; - } - - - void Glissando::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Glissando::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Glissando.h b/Sourcecode/private/mx/core/elements/Glissando.h deleted file mode 100644 index 223d470a3..000000000 --- a/Sourcecode/private/mx/core/elements/Glissando.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/GlissandoAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GlissandoAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Glissando ) - - inline GlissandoPtr makeGlissando() { return std::make_shared(); } - inline GlissandoPtr makeGlissando( const XsString& value ) { return std::make_shared( value ); } - inline GlissandoPtr makeGlissando( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Glissando : public ElementInterface - { - public: - Glissando(); - Glissando( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GlissandoAttributesPtr getAttributes() const; - void setAttributes( const GlissandoAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - GlissandoAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GlissandoAttributes.cpp b/Sourcecode/private/mx/core/elements/GlissandoAttributes.cpp deleted file mode 100644 index fbeb6e9cd..000000000 --- a/Sourcecode/private/mx/core/elements/GlissandoAttributes.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GlissandoAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GlissandoAttributes::GlissandoAttributes() - :type( StartStop::start ) - ,number( 1 ) - ,lineType( LineType::solid ) - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasType( true ) - ,hasNumber( false ) - ,hasLineType( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool GlissandoAttributes::hasValues() const - { - return hasType || - hasNumber || - hasLineType || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& GlissandoAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, lineType, "line-type", hasLineType ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool GlissandoAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "GlissandoAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GlissandoAttributes.h b/Sourcecode/private/mx/core/elements/GlissandoAttributes.h deleted file mode 100644 index 81e67de0f..000000000 --- a/Sourcecode/private/mx/core/elements/GlissandoAttributes.h +++ /dev/null @@ -1,63 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GlissandoAttributes ) - - struct GlissandoAttributes : public AttributesInterface - { - public: - GlissandoAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - NumberLevel number; - LineType lineType; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - const bool hasType; - bool hasNumber; - bool hasLineType; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Grace.cpp b/Sourcecode/private/mx/core/elements/Grace.cpp deleted file mode 100644 index 4fcbf3ace..000000000 --- a/Sourcecode/private/mx/core/elements/Grace.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Grace.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Grace::Grace() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Grace::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Grace::hasContents() const { return false; } - std::ostream& Grace::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Grace::streamName( std::ostream& os ) const { os << "grace"; return os; } - std::ostream& Grace::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - GraceAttributesPtr Grace::getAttributes() const - { - return myAttributes; - } - - - void Grace::setAttributes( const GraceAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Grace::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Grace.h b/Sourcecode/private/mx/core/elements/Grace.h deleted file mode 100644 index 21ebf7b1e..000000000 --- a/Sourcecode/private/mx/core/elements/Grace.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/GraceAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GraceAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Grace ) - - inline GracePtr makeGrace() { return std::make_shared(); } - - class Grace : public ElementInterface - { - public: - Grace(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GraceAttributesPtr getAttributes() const; - void setAttributes( const GraceAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GraceAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GraceAttributes.cpp b/Sourcecode/private/mx/core/elements/GraceAttributes.cpp deleted file mode 100644 index e448e6928..000000000 --- a/Sourcecode/private/mx/core/elements/GraceAttributes.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GraceAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GraceAttributes::GraceAttributes() - :stealTimePrevious() - ,stealTimeFollowing() - ,makeTime() - ,slash( YesNo::no ) - ,hasStealTimePrevious( false ) - ,hasStealTimeFollowing( false ) - ,hasMakeTime( false ) - ,hasSlash( false ) - {} - - - bool GraceAttributes::hasValues() const - { - return hasStealTimePrevious || - hasStealTimeFollowing || - hasMakeTime || - hasSlash; - } - - - std::ostream& GraceAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, stealTimePrevious, "steal-time-previous", hasStealTimePrevious ); - streamAttribute( os, stealTimeFollowing, "steal-time-following", hasStealTimeFollowing ); - streamAttribute( os, makeTime, "make-time", hasMakeTime ); - streamAttribute( os, slash, "slash", hasSlash ); - } - return os; - } - - - bool GraceAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "GraceAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, stealTimePrevious, hasStealTimePrevious, "steal-time-previous" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, stealTimeFollowing, hasStealTimeFollowing, "steal-time-following" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, makeTime, hasMakeTime, "make-time" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, slash, hasSlash, "slash", &parseYesNo ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GraceAttributes.h b/Sourcecode/private/mx/core/elements/GraceAttributes.h deleted file mode 100644 index 76ac2fd0a..000000000 --- a/Sourcecode/private/mx/core/elements/GraceAttributes.h +++ /dev/null @@ -1,42 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GraceAttributes ) - - struct GraceAttributes : public AttributesInterface - { - public: - GraceAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - Percent stealTimePrevious; - Percent stealTimeFollowing; - DivisionsValue makeTime; - YesNo slash; - bool hasStealTimePrevious; - bool hasStealTimeFollowing; - bool hasMakeTime; - bool hasSlash; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GraceNoteGroup.cpp b/Sourcecode/private/mx/core/elements/GraceNoteGroup.cpp deleted file mode 100644 index a2f4fda6d..000000000 --- a/Sourcecode/private/mx/core/elements/GraceNoteGroup.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GraceNoteGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/FullNoteGroup.h" -#include "mx/core/elements/Grace.h" -#include "mx/core/elements/Tie.h" -#include - -namespace mx -{ - namespace core - { - GraceNoteGroup::GraceNoteGroup() - :myGrace( makeGrace() ) - ,myFullNoteGroup( makeFullNoteGroup() ) - ,myTieSet() - {} - - - bool GraceNoteGroup::hasAttributes() const - { - return false; - } - - - std::ostream& GraceNoteGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& GraceNoteGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool GraceNoteGroup::hasContents() const - { - return true; - } - - - std::ostream& GraceNoteGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - myGrace->toStream( os, indentLevel ); - os << std::endl; - myFullNoteGroup->streamContents( os, indentLevel, isOneLineOnly ); - for ( auto x : myTieSet ) - { - os << std::endl; - x->toStream( os, indentLevel ); - } - isOneLineOnly = false; - return os; - } - - - GracePtr GraceNoteGroup::getGrace() const - { - return myGrace; - } - - - void GraceNoteGroup::setGrace( const GracePtr& value ) - { - if ( value ) - { - myGrace = value; - } - } - - - FullNoteGroupPtr GraceNoteGroup::getFullNoteGroup() const - { - return myFullNoteGroup; - } - - - void GraceNoteGroup::setFullNoteGroup( const FullNoteGroupPtr& value ) - { - if ( value ) - { - myFullNoteGroup = value; - } - } - - - const TieSet& GraceNoteGroup::getTieSet() const - { - return myTieSet; - } - - - void GraceNoteGroup::addTie( const TiePtr& value ) - { - if ( value ) - { - if ( myTieSet.size() < 2 ) - { - myTieSet.push_back( value ); - } - } - } - - - void GraceNoteGroup::removeTie( const TieSetIterConst& value ) - { - if ( value != myTieSet.cend() ) - { - myTieSet.erase( value ); - } - } - - - void GraceNoteGroup::clearTieSet() - { - myTieSet.clear(); - } - - - TiePtr GraceNoteGroup::getTie( const TieSetIterConst& setIterator ) const - { - if( setIterator != myTieSet.cend() ) - { - return *setIterator; - } - return TiePtr(); - } - - - MX_FROM_XELEMENT_UNUSED( GraceNoteGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/GraceNoteGroup.h b/Sourcecode/private/mx/core/elements/GraceNoteGroup.h deleted file mode 100644 index 0b262a412..000000000 --- a/Sourcecode/private/mx/core/elements/GraceNoteGroup.h +++ /dev/null @@ -1,61 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( FullNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( Grace ) - MX_FORWARD_DECLARE_ELEMENT( Tie ) - MX_FORWARD_DECLARE_ELEMENT( GraceNoteGroup ) - - inline GraceNoteGroupPtr makeGraceNoteGroup() { return std::make_shared(); } - - class GraceNoteGroup : public ElementInterface - { - public: - GraceNoteGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Grace minOccurs = 1, maxOccurs = 1 _________ */ - GracePtr getGrace() const; - void setGrace( const GracePtr& value ); - - /* _________ FullNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ - FullNoteGroupPtr getFullNoteGroup() const; - void setFullNoteGroup( const FullNoteGroupPtr& value ); - - /* _________ Tie minOccurs = 0, maxOccurs = 2 _________ */ - const TieSet& getTieSet() const; - void addTie( const TiePtr& value ); - void removeTie( const TieSetIterConst& value ); - void clearTieSet(); - TiePtr getTie( const TieSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GracePtr myGrace; - FullNoteGroupPtr myFullNoteGroup; - TieSet myTieSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Group.cpp b/Sourcecode/private/mx/core/elements/Group.cpp deleted file mode 100644 index b418e5c66..000000000 --- a/Sourcecode/private/mx/core/elements/Group.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Group.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Group::Group() - :myValue() - {} - - - Group::Group( const XsString& value ) - :myValue( value ) - {} - - - bool Group::hasAttributes() const - { - return false; - } - - - bool Group::hasContents() const - { - return true; - } - - - std::ostream& Group::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Group::streamName( std::ostream& os ) const - { - os << "group"; - return os; - } - - - std::ostream& Group::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString Group::getValue() const - { - return myValue; - } - - - void Group::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Group::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Group.h b/Sourcecode/private/mx/core/elements/Group.h deleted file mode 100644 index dcc88d28c..000000000 --- a/Sourcecode/private/mx/core/elements/Group.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Group ) - - inline GroupPtr makeGroup() { return std::make_shared(); } - inline GroupPtr makeGroup( const XsString& value ) { return std::make_shared( value ); } - inline GroupPtr makeGroup( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Group : public ElementInterface - { - public: - Group(); - Group( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviation.cpp b/Sourcecode/private/mx/core/elements/GroupAbbreviation.cpp deleted file mode 100644 index 0554f0a97..000000000 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviation.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupAbbreviation.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GroupAbbreviation::GroupAbbreviation() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - GroupAbbreviation::GroupAbbreviation( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool GroupAbbreviation::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool GroupAbbreviation::hasContents() const - { - return true; - } - - - std::ostream& GroupAbbreviation::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& GroupAbbreviation::streamName( std::ostream& os ) const - { - os << "group-abbreviation"; - return os; - } - - - std::ostream& GroupAbbreviation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - GroupAbbreviationAttributesPtr GroupAbbreviation::getAttributes() const - { - return myAttributes; - } - - - void GroupAbbreviation::setAttributes( const GroupAbbreviationAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString GroupAbbreviation::getValue() const - { - return myValue; - } - - - void GroupAbbreviation::setValue( const XsString& value ) - { - myValue = value; - } - - - bool GroupAbbreviation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviation.h b/Sourcecode/private/mx/core/elements/GroupAbbreviation.h deleted file mode 100644 index 9026e7169..000000000 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviation.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/GroupAbbreviationAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupAbbreviationAttributes ) - MX_FORWARD_DECLARE_ELEMENT( GroupAbbreviation ) - - inline GroupAbbreviationPtr makeGroupAbbreviation() { return std::make_shared(); } - inline GroupAbbreviationPtr makeGroupAbbreviation( const XsString& value ) { return std::make_shared( value ); } - inline GroupAbbreviationPtr makeGroupAbbreviation( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class GroupAbbreviation : public ElementInterface - { - public: - GroupAbbreviation(); - GroupAbbreviation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupAbbreviationAttributesPtr getAttributes() const; - void setAttributes( const GroupAbbreviationAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - GroupAbbreviationAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.cpp deleted file mode 100644 index 5b01c1a74..000000000 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupAbbreviationAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GroupAbbreviationAttributes::GroupAbbreviationAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,justify( LeftCenterRight::center ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasJustify( false ) - {} - - - bool GroupAbbreviationAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasJustify; - } - - - std::ostream& GroupAbbreviationAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, justify, "justify", hasJustify ); - } - return os; - } - - - bool GroupAbbreviationAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "GroupAbbreviationAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.h b/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.h deleted file mode 100644 index 2e81b509e..000000000 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviationAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupAbbreviationAttributes ) - - struct GroupAbbreviationAttributes : public AttributesInterface - { - public: - GroupAbbreviationAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight justify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasJustify; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.cpp b/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.cpp deleted file mode 100644 index e1567031e..000000000 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.cpp +++ /dev/null @@ -1,140 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupAbbreviationDisplay.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/DisplayTextOrAccidentalText.h" -#include - -namespace mx -{ - namespace core - { - GroupAbbreviationDisplay::GroupAbbreviationDisplay() - :myAttributes( std::make_shared() ) - ,myDisplayTextOrAccidentalTextSet() - {} - - - bool GroupAbbreviationDisplay::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& GroupAbbreviationDisplay::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& GroupAbbreviationDisplay::streamName( std::ostream& os ) const - { - os << "group-abbreviation-display"; - return os; - } - - - bool GroupAbbreviationDisplay::hasContents() const - { - return myDisplayTextOrAccidentalTextSet.size() > 0; - } - - - std::ostream& GroupAbbreviationDisplay::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myDisplayTextOrAccidentalTextSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - isOneLineOnly = false; - os << std::endl; - } - isOneLineOnly = !hasContents(); - return os; - } - - - GroupAbbreviationDisplayAttributesPtr GroupAbbreviationDisplay::getAttributes() const - { - return myAttributes; - } - - - void GroupAbbreviationDisplay::setAttributes( const GroupAbbreviationDisplayAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const DisplayTextOrAccidentalTextSet& GroupAbbreviationDisplay::getDisplayTextOrAccidentalText() const - { - return myDisplayTextOrAccidentalTextSet; - } - - - void GroupAbbreviationDisplay::addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ) - { - if ( value ) - { - myDisplayTextOrAccidentalTextSet.push_back( value ); - } - } - - - void GroupAbbreviationDisplay::removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - myDisplayTextOrAccidentalTextSet.erase( setIterator ); - } - } - - - void GroupAbbreviationDisplay::clearDisplayTextOrAccidentalTextSet() - { - myDisplayTextOrAccidentalTextSet.clear(); - } - - - DisplayTextOrAccidentalTextPtr GroupAbbreviationDisplay::getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - return *setIterator; - } - return makeDisplayTextOrAccidentalText(); - } - - - const DisplayTextOrAccidentalTextSet& GroupAbbreviationDisplay::getDisplayTextOrAccidentalTextSet() const - { - return myDisplayTextOrAccidentalTextSet; - } - - - bool GroupAbbreviationDisplay::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - auto item = makeDisplayTextOrAccidentalText(); - isSuccess &= item->fromXElement( message, *it ); - myDisplayTextOrAccidentalTextSet.push_back( item ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.h b/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.h deleted file mode 100644 index 296a3058f..000000000 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplay.h +++ /dev/null @@ -1,60 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/GroupAbbreviationDisplayAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupAbbreviationDisplayAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DisplayTextOrAccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( GroupAbbreviationDisplay ) - - inline GroupAbbreviationDisplayPtr makeGroupAbbreviationDisplay() { return std::make_shared(); } - - class GroupAbbreviationDisplay : public ElementInterface - { - public: - enum class Choice - { - displayText = 1, - accidentalText = 2 - }; - GroupAbbreviationDisplay(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupAbbreviationDisplayAttributesPtr getAttributes() const; - void setAttributes( const GroupAbbreviationDisplayAttributesPtr& value ); - - /* _________ DisplayTextOrAccidentalText minOccurs = 0, maxOccurs = unbounded _________ */ - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalText() const; - void addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ); - void removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ); - void clearDisplayTextOrAccidentalTextSet(); - DisplayTextOrAccidentalTextPtr getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const; - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalTextSet() const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GroupAbbreviationDisplayAttributesPtr myAttributes; - DisplayTextOrAccidentalTextSet myDisplayTextOrAccidentalTextSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.cpp deleted file mode 100644 index 144224e05..000000000 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupAbbreviationDisplayAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GroupAbbreviationDisplayAttributes::GroupAbbreviationDisplayAttributes() - :printObject( YesNo::no ) - ,hasPrintObject( false ) - {} - - - bool GroupAbbreviationDisplayAttributes::hasValues() const - { - return hasPrintObject; - } - - - std::ostream& GroupAbbreviationDisplayAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } - - - bool GroupAbbreviationDisplayAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "GroupAbbreviationDisplayAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.h b/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.h deleted file mode 100644 index aea5f5643..000000000 --- a/Sourcecode/private/mx/core/elements/GroupAbbreviationDisplayAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupAbbreviationDisplayAttributes ) - - struct GroupAbbreviationDisplayAttributes : public AttributesInterface - { - public: - GroupAbbreviationDisplayAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - bool hasPrintObject; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupBarline.cpp b/Sourcecode/private/mx/core/elements/GroupBarline.cpp deleted file mode 100644 index f28940f80..000000000 --- a/Sourcecode/private/mx/core/elements/GroupBarline.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupBarline.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GroupBarline::GroupBarline() - :myValue( GroupBarlineValue::yes ) - ,myAttributes( std::make_shared() ) - {} - - - GroupBarline::GroupBarline( const GroupBarlineValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool GroupBarline::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool GroupBarline::hasContents() const - { - return true; - } - - - std::ostream& GroupBarline::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& GroupBarline::streamName( std::ostream& os ) const - { - os << "group-barline"; - return os; - } - - - std::ostream& GroupBarline::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - GroupBarlineAttributesPtr GroupBarline::getAttributes() const - { - return myAttributes; - } - - - void GroupBarline::setAttributes( const GroupBarlineAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - GroupBarlineValue GroupBarline::getValue() const - { - return myValue; - } - - - void GroupBarline::setValue( const GroupBarlineValue& value ) - { - myValue = value; - } - - - bool GroupBarline::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseGroupBarlineValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupBarline.h b/Sourcecode/private/mx/core/elements/GroupBarline.h deleted file mode 100644 index 62e7d39ee..000000000 --- a/Sourcecode/private/mx/core/elements/GroupBarline.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/GroupBarlineAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupBarlineAttributes ) - MX_FORWARD_DECLARE_ELEMENT( GroupBarline ) - - inline GroupBarlinePtr makeGroupBarline() { return std::make_shared(); } - inline GroupBarlinePtr makeGroupBarline( const GroupBarlineValue& value ) { return std::make_shared( value ); } - inline GroupBarlinePtr makeGroupBarline( GroupBarlineValue&& value ) { return std::make_shared( std::move( value ) ); } - - class GroupBarline : public ElementInterface - { - public: - GroupBarline(); - GroupBarline( const GroupBarlineValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupBarlineAttributesPtr getAttributes() const; - void setAttributes( const GroupBarlineAttributesPtr& attributes ); - GroupBarlineValue getValue() const; - void setValue( const GroupBarlineValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GroupBarlineValue myValue; - GroupBarlineAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.cpp deleted file mode 100644 index 3e128491d..000000000 --- a/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupBarlineAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GroupBarlineAttributes::GroupBarlineAttributes() - :color( "#FFFFFF" ) - ,hasColor( false ) - {} - - - bool GroupBarlineAttributes::hasValues() const - { - return hasColor; - } - - - std::ostream& GroupBarlineAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, color, "color", hasColor ); - } - return os; - } - - - bool GroupBarlineAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "GroupBarlineAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.h b/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.h deleted file mode 100644 index d6603b298..000000000 --- a/Sourcecode/private/mx/core/elements/GroupBarlineAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupBarlineAttributes ) - - struct GroupBarlineAttributes : public AttributesInterface - { - public: - GroupBarlineAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - Color color; - bool hasColor; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupName.cpp b/Sourcecode/private/mx/core/elements/GroupName.cpp deleted file mode 100644 index 6006ef00b..000000000 --- a/Sourcecode/private/mx/core/elements/GroupName.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupName.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GroupName::GroupName() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - GroupName::GroupName( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool GroupName::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool GroupName::hasContents() const - { - return true; - } - - - std::ostream& GroupName::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& GroupName::streamName( std::ostream& os ) const - { - os << "group-name"; - return os; - } - - - std::ostream& GroupName::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - GroupNameAttributesPtr GroupName::getAttributes() const - { - return myAttributes; - } - - - void GroupName::setAttributes( const GroupNameAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString GroupName::getValue() const - { - return myValue; - } - - - void GroupName::setValue( const XsString& value ) - { - myValue = value; - } - - - bool GroupName::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupName.h b/Sourcecode/private/mx/core/elements/GroupName.h deleted file mode 100644 index 5c45a812a..000000000 --- a/Sourcecode/private/mx/core/elements/GroupName.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/GroupNameAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupNameAttributes ) - MX_FORWARD_DECLARE_ELEMENT( GroupName ) - - inline GroupNamePtr makeGroupName() { return std::make_shared(); } - inline GroupNamePtr makeGroupName( const XsString& value ) { return std::make_shared( value ); } - inline GroupNamePtr makeGroupName( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class GroupName : public ElementInterface - { - public: - GroupName(); - GroupName( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupNameAttributesPtr getAttributes() const; - void setAttributes( const GroupNameAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - GroupNameAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupNameAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupNameAttributes.cpp deleted file mode 100644 index 38fb3e1fc..000000000 --- a/Sourcecode/private/mx/core/elements/GroupNameAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupNameAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GroupNameAttributes::GroupNameAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,justify( LeftCenterRight::center ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasJustify( false ) - {} - - - bool GroupNameAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasJustify; - } - - - std::ostream& GroupNameAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, justify, "justify", hasJustify ); - } - return os; - } - - - bool GroupNameAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "GroupNameAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupNameAttributes.h b/Sourcecode/private/mx/core/elements/GroupNameAttributes.h deleted file mode 100644 index a756f4909..000000000 --- a/Sourcecode/private/mx/core/elements/GroupNameAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupNameAttributes ) - - struct GroupNameAttributes : public AttributesInterface - { - public: - GroupNameAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight justify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasJustify; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupNameDisplay.cpp b/Sourcecode/private/mx/core/elements/GroupNameDisplay.cpp deleted file mode 100644 index f3003ffbe..000000000 --- a/Sourcecode/private/mx/core/elements/GroupNameDisplay.cpp +++ /dev/null @@ -1,140 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupNameDisplay.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/DisplayTextOrAccidentalText.h" -#include - -namespace mx -{ - namespace core - { - GroupNameDisplay::GroupNameDisplay() - :myAttributes( std::make_shared() ) - ,myDisplayTextOrAccidentalTextSet() - {} - - - bool GroupNameDisplay::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& GroupNameDisplay::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& GroupNameDisplay::streamName( std::ostream& os ) const - { - os << "group-name-display"; - return os; - } - - - bool GroupNameDisplay::hasContents() const - { - return myDisplayTextOrAccidentalTextSet.size() > 0; - } - - - std::ostream& GroupNameDisplay::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myDisplayTextOrAccidentalTextSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - isOneLineOnly = false; - os << std::endl; - } - isOneLineOnly = !hasContents(); - return os; - } - - - GroupNameDisplayAttributesPtr GroupNameDisplay::getAttributes() const - { - return myAttributes; - } - - - void GroupNameDisplay::setAttributes( const GroupNameDisplayAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const DisplayTextOrAccidentalTextSet& GroupNameDisplay::getDisplayTextOrAccidentalText() const - { - return myDisplayTextOrAccidentalTextSet; - } - - - void GroupNameDisplay::addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ) - { - if ( value ) - { - myDisplayTextOrAccidentalTextSet.push_back( value ); - } - } - - - void GroupNameDisplay::removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - myDisplayTextOrAccidentalTextSet.erase( setIterator ); - } - } - - - void GroupNameDisplay::clearDisplayTextOrAccidentalTextSet() - { - myDisplayTextOrAccidentalTextSet.clear(); - } - - - DisplayTextOrAccidentalTextPtr GroupNameDisplay::getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - return *setIterator; - } - return makeDisplayTextOrAccidentalText(); - } - - - const DisplayTextOrAccidentalTextSet& GroupNameDisplay::getDisplayTextOrAccidentalTextSet() const - { - return myDisplayTextOrAccidentalTextSet; - } - - - bool GroupNameDisplay::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - auto item = makeDisplayTextOrAccidentalText(); - isSuccess &= item->fromXElement( message, *it ); - myDisplayTextOrAccidentalTextSet.push_back( item ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupNameDisplay.h b/Sourcecode/private/mx/core/elements/GroupNameDisplay.h deleted file mode 100644 index 6361d786d..000000000 --- a/Sourcecode/private/mx/core/elements/GroupNameDisplay.h +++ /dev/null @@ -1,57 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/GroupNameDisplayAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupNameDisplayAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DisplayTextOrAccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( GroupNameDisplay ) - - inline GroupNameDisplayPtr makeGroupNameDisplay() { return std::make_shared(); } - - class GroupNameDisplay : public ElementInterface - { - public: - - GroupNameDisplay(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupNameDisplayAttributesPtr getAttributes() const; - void setAttributes( const GroupNameDisplayAttributesPtr& value ); - - /* _________ DisplayTextOrAccidentalText minOccurs = 0, maxOccurs = unbounded _________ */ - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalText() const; - void addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ); - void removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ); - void clearDisplayTextOrAccidentalTextSet(); - DisplayTextOrAccidentalTextPtr getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const; - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalTextSet() const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GroupNameDisplayAttributesPtr myAttributes; - DisplayTextOrAccidentalTextSet myDisplayTextOrAccidentalTextSet; - - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.cpp deleted file mode 100644 index 5f0eef857..000000000 --- a/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupNameDisplayAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GroupNameDisplayAttributes::GroupNameDisplayAttributes() - :printObject( YesNo::no ) - ,hasPrintObject( false ) - {} - - - bool GroupNameDisplayAttributes::hasValues() const - { - return hasPrintObject; - } - - - std::ostream& GroupNameDisplayAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } - - - bool GroupNameDisplayAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "GroupNameDisplayAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.h b/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.h deleted file mode 100644 index 5f86cf2ff..000000000 --- a/Sourcecode/private/mx/core/elements/GroupNameDisplayAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupNameDisplayAttributes ) - - struct GroupNameDisplayAttributes : public AttributesInterface - { - public: - GroupNameDisplayAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - bool hasPrintObject; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupSymbol.cpp b/Sourcecode/private/mx/core/elements/GroupSymbol.cpp deleted file mode 100644 index 693bbcb00..000000000 --- a/Sourcecode/private/mx/core/elements/GroupSymbol.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupSymbol.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GroupSymbol::GroupSymbol() - :myValue( GroupSymbolValue::none ) - ,myAttributes( std::make_shared() ) - {} - - - GroupSymbol::GroupSymbol( const GroupSymbolValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool GroupSymbol::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool GroupSymbol::hasContents() const - { - return true; - } - - - std::ostream& GroupSymbol::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& GroupSymbol::streamName( std::ostream& os ) const - { - os << "group-symbol"; - return os; - } - - - std::ostream& GroupSymbol::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - GroupSymbolAttributesPtr GroupSymbol::getAttributes() const - { - return myAttributes; - } - - - void GroupSymbol::setAttributes( const GroupSymbolAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - GroupSymbolValue GroupSymbol::getValue() const - { - return myValue; - } - - - void GroupSymbol::setValue( const GroupSymbolValue& value ) - { - myValue = value; - } - - - bool GroupSymbol::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseGroupSymbolValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupSymbol.h b/Sourcecode/private/mx/core/elements/GroupSymbol.h deleted file mode 100644 index 3117cdde3..000000000 --- a/Sourcecode/private/mx/core/elements/GroupSymbol.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/GroupSymbolAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupSymbolAttributes ) - MX_FORWARD_DECLARE_ELEMENT( GroupSymbol ) - - inline GroupSymbolPtr makeGroupSymbol() { return std::make_shared(); } - inline GroupSymbolPtr makeGroupSymbol( const GroupSymbolValue& value ) { return std::make_shared( value ); } - inline GroupSymbolPtr makeGroupSymbol( GroupSymbolValue&& value ) { return std::make_shared( std::move( value ) ); } - - class GroupSymbol : public ElementInterface - { - public: - GroupSymbol(); - GroupSymbol( const GroupSymbolValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupSymbolAttributesPtr getAttributes() const; - void setAttributes( const GroupSymbolAttributesPtr& attributes ); - GroupSymbolValue getValue() const; - void setValue( const GroupSymbolValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GroupSymbolValue myValue; - GroupSymbolAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.cpp deleted file mode 100644 index f312933c9..000000000 --- a/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupSymbolAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GroupSymbolAttributes::GroupSymbolAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - {} - - - bool GroupSymbolAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY; - } - - - std::ostream& GroupSymbolAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - } - return os; - } - - - bool GroupSymbolAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "GroupSymbolAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.h b/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.h deleted file mode 100644 index 568524366..000000000 --- a/Sourcecode/private/mx/core/elements/GroupSymbolAttributes.h +++ /dev/null @@ -1,41 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupSymbolAttributes ) - - struct GroupSymbolAttributes : public AttributesInterface - { - public: - GroupSymbolAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupTime.cpp b/Sourcecode/private/mx/core/elements/GroupTime.cpp deleted file mode 100644 index 4460ff32f..000000000 --- a/Sourcecode/private/mx/core/elements/GroupTime.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupTime.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GroupTime::GroupTime() : ElementInterface() {} - - - bool GroupTime::hasAttributes() const { return false; } - - - bool GroupTime::hasContents() const { return false; } - std::ostream& GroupTime::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& GroupTime::streamName( std::ostream& os ) const { os << "group-time"; return os; } - std::ostream& GroupTime::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool GroupTime::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupTime.h b/Sourcecode/private/mx/core/elements/GroupTime.h deleted file mode 100644 index 6f26e245c..000000000 --- a/Sourcecode/private/mx/core/elements/GroupTime.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( GroupTime ) - - inline GroupTimePtr makeGroupTime() { return std::make_shared(); } - - class GroupTime : public ElementInterface - { - public: - GroupTime(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Grouping.cpp b/Sourcecode/private/mx/core/elements/Grouping.cpp deleted file mode 100644 index a20e495ce..000000000 --- a/Sourcecode/private/mx/core/elements/Grouping.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Grouping.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Feature.h" -#include - -namespace mx -{ - namespace core - { - Grouping::Grouping() - :myAttributes( std::make_shared() ) - ,myFeatureSet() - {} - - - bool Grouping::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Grouping::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Grouping::streamName( std::ostream& os ) const - { - os << "grouping"; - return os; - } - - - bool Grouping::hasContents() const - { - return myFeatureSet.size() > 0; - } - - - std::ostream& Grouping::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myFeatureSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - GroupingAttributesPtr Grouping::getAttributes() const - { - return myAttributes; - } - - - void Grouping::setAttributes( const GroupingAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const FeatureSet& Grouping::getFeatureSet() const - { - return myFeatureSet; - } - - - void Grouping::removeFeature( const FeatureSetIterConst& value ) - { - if ( value != myFeatureSet.cend() ) - { - myFeatureSet.erase( value ); - } - } - - - void Grouping::addFeature( const FeaturePtr& value ) - { - if ( value ) - { - myFeatureSet.push_back( value ); - } - } - - - void Grouping::clearFeatureSet() - { - myFeatureSet.clear(); - } - - - FeaturePtr Grouping::getFeature( const FeatureSetIterConst& setIterator ) const - { - if( setIterator != myFeatureSet.cend() ) - { - return *setIterator; - } - return FeaturePtr(); - } - - - bool Grouping::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "feature", myFeatureSet ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Grouping.h b/Sourcecode/private/mx/core/elements/Grouping.h deleted file mode 100644 index ae25da1a3..000000000 --- a/Sourcecode/private/mx/core/elements/Grouping.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/GroupingAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupingAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Feature ) - MX_FORWARD_DECLARE_ELEMENT( Grouping ) - - inline GroupingPtr makeGrouping() { return std::make_shared(); } - - class Grouping : public ElementInterface - { - public: - Grouping(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - GroupingAttributesPtr getAttributes() const; - void setAttributes( const GroupingAttributesPtr& value ); - - /* _________ Feature minOccurs = 0, maxOccurs = unbounded _________ */ - const FeatureSet& getFeatureSet() const; - void addFeature( const FeaturePtr& value ); - void removeFeature( const FeatureSetIterConst& value ); - void clearFeatureSet(); - FeaturePtr getFeature( const FeatureSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GroupingAttributesPtr myAttributes; - FeatureSet myFeatureSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupingAttributes.cpp b/Sourcecode/private/mx/core/elements/GroupingAttributes.cpp deleted file mode 100644 index 0216c547a..000000000 --- a/Sourcecode/private/mx/core/elements/GroupingAttributes.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/GroupingAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - GroupingAttributes::GroupingAttributes() - :type( StartStopSingle::single ) - ,number( XsToken( "1" ) ) - ,memberOf() - ,hasType( true ) - ,hasNumber( false ) - ,hasMemberOf( false ) - {} - - - bool GroupingAttributes::hasValues() const - { - return hasType || - hasNumber || - hasMemberOf; - } - - - std::ostream& GroupingAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, memberOf, "member-of", hasMemberOf ); - } - return os; - } - - - bool GroupingAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "GroupingAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopSingle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, memberOf, hasMemberOf, "member-of" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/GroupingAttributes.h b/Sourcecode/private/mx/core/elements/GroupingAttributes.h deleted file mode 100644 index 686d83289..000000000 --- a/Sourcecode/private/mx/core/elements/GroupingAttributes.h +++ /dev/null @@ -1,40 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( GroupingAttributes ) - - struct GroupingAttributes : public AttributesInterface - { - public: - GroupingAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopSingle type; - XsToken number; - XsToken memberOf; - const bool hasType; - bool hasNumber; - bool hasMemberOf; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HammerOn.cpp b/Sourcecode/private/mx/core/elements/HammerOn.cpp deleted file mode 100644 index 5b678a9c4..000000000 --- a/Sourcecode/private/mx/core/elements/HammerOn.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HammerOn.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - HammerOn::HammerOn() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - HammerOn::HammerOn( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool HammerOn::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool HammerOn::hasContents() const - { - return true; - } - - - std::ostream& HammerOn::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& HammerOn::streamName( std::ostream& os ) const - { - os << "hammer-on"; - return os; - } - - - std::ostream& HammerOn::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - HammerOnAttributesPtr HammerOn::getAttributes() const - { - return myAttributes; - } - - - void HammerOn::setAttributes( const HammerOnAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString HammerOn::getValue() const - { - return myValue; - } - - - void HammerOn::setValue( const XsString& value ) - { - myValue = value; - } - - - bool HammerOn::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/HammerOn.h b/Sourcecode/private/mx/core/elements/HammerOn.h deleted file mode 100644 index b603a875b..000000000 --- a/Sourcecode/private/mx/core/elements/HammerOn.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/HammerOnAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HammerOnAttributes ) - MX_FORWARD_DECLARE_ELEMENT( HammerOn ) - - inline HammerOnPtr makeHammerOn() { return std::make_shared(); } - inline HammerOnPtr makeHammerOn( const XsString& value ) { return std::make_shared( value ); } - inline HammerOnPtr makeHammerOn( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class HammerOn : public ElementInterface - { - public: - HammerOn(); - HammerOn( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HammerOnAttributesPtr getAttributes() const; - void setAttributes( const HammerOnAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - HammerOnAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HammerOnAttributes.cpp b/Sourcecode/private/mx/core/elements/HammerOnAttributes.cpp deleted file mode 100644 index 2eb604e13..000000000 --- a/Sourcecode/private/mx/core/elements/HammerOnAttributes.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HammerOnAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - HammerOnAttributes::HammerOnAttributes() - :type( StartStop::start ) - ,number( 1 ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasType( true ) - ,hasNumber( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool HammerOnAttributes::hasValues() const - { - return hasType || - hasNumber || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& HammerOnAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool HammerOnAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "HammerOnAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/HammerOnAttributes.h b/Sourcecode/private/mx/core/elements/HammerOnAttributes.h deleted file mode 100644 index 791f95bea..000000000 --- a/Sourcecode/private/mx/core/elements/HammerOnAttributes.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HammerOnAttributes ) - - struct HammerOnAttributes : public AttributesInterface - { - public: - HammerOnAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - NumberLevel number; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - const bool hasType; - bool hasNumber; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Handbell.cpp b/Sourcecode/private/mx/core/elements/Handbell.cpp deleted file mode 100644 index 1ff68f1c9..000000000 --- a/Sourcecode/private/mx/core/elements/Handbell.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Handbell.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Handbell::Handbell() - :myValue( HandbellValue::damp ) - ,myAttributes( std::make_shared() ) - {} - - - Handbell::Handbell( const HandbellValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Handbell::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Handbell::hasContents() const - { - return true; - } - - - std::ostream& Handbell::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Handbell::streamName( std::ostream& os ) const - { - os << "handbell"; - return os; - } - - - std::ostream& Handbell::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - HandbellAttributesPtr Handbell::getAttributes() const - { - return myAttributes; - } - - - void Handbell::setAttributes( const HandbellAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - HandbellValue Handbell::getValue() const - { - return myValue; - } - - - void Handbell::setValue( const HandbellValue& value ) - { - myValue = value; - } - - - bool Handbell::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseHandbellValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Handbell.h b/Sourcecode/private/mx/core/elements/Handbell.h deleted file mode 100644 index 7aa2d5269..000000000 --- a/Sourcecode/private/mx/core/elements/Handbell.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/HandbellAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HandbellAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Handbell ) - - inline HandbellPtr makeHandbell() { return std::make_shared(); } - inline HandbellPtr makeHandbell( const HandbellValue& value ) { return std::make_shared( value ); } - inline HandbellPtr makeHandbell( HandbellValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Handbell : public ElementInterface - { - public: - Handbell(); - Handbell( const HandbellValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HandbellAttributesPtr getAttributes() const; - void setAttributes( const HandbellAttributesPtr& attributes ); - HandbellValue getValue() const; - void setValue( const HandbellValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HandbellValue myValue; - HandbellAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HandbellAttributes.cpp b/Sourcecode/private/mx/core/elements/HandbellAttributes.cpp deleted file mode 100644 index 4be078607..000000000 --- a/Sourcecode/private/mx/core/elements/HandbellAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HandbellAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - HandbellAttributes::HandbellAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool HandbellAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& HandbellAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool HandbellAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "HandbellAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/HandbellAttributes.h b/Sourcecode/private/mx/core/elements/HandbellAttributes.h deleted file mode 100644 index 5e267ba0c..000000000 --- a/Sourcecode/private/mx/core/elements/HandbellAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HandbellAttributes ) - - struct HandbellAttributes : public AttributesInterface - { - public: - HandbellAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Harmonic.cpp b/Sourcecode/private/mx/core/elements/Harmonic.cpp deleted file mode 100644 index b90d67244..000000000 --- a/Sourcecode/private/mx/core/elements/Harmonic.cpp +++ /dev/null @@ -1,192 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Harmonic.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Artificial.h" -#include "mx/core/elements/BasePitch.h" -#include "mx/core/elements/HarmonicInfoChoice.h" -#include "mx/core/elements/HarmonicTypeChoice.h" -#include "mx/core/elements/Natural.h" -#include "mx/core/elements/SoundingPitch.h" -#include "mx/core/elements/TouchingPitch.h" -#include - -namespace mx -{ - namespace core - { - Harmonic::Harmonic() - :myAttributes( std::make_shared() ) - ,myHarmonicTypeChoice( makeHarmonicTypeChoice() ) - ,myHasHarmonicTypeChoice( false ) - ,myHarmonicInfoChoice( makeHarmonicInfoChoice() ) - ,myHasHarmonicInfoChoice( false ) - {} - - - bool Harmonic::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Harmonic::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Harmonic::streamName( std::ostream& os ) const - { - os << "harmonic"; - return os; - } - - - bool Harmonic::hasContents() const - { - return myHasHarmonicTypeChoice || myHasHarmonicInfoChoice; - } - - - std::ostream& Harmonic::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - if ( myHasHarmonicTypeChoice ) - { - os << std::endl; - myHarmonicTypeChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasHarmonicInfoChoice ) - { - os << std::endl; - myHarmonicInfoChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - HarmonicTypeChoicePtr Harmonic::getHarmonicTypeChoice() const - { - return myHarmonicTypeChoice; - } - - - void Harmonic::setHarmonicTypeChoice( const HarmonicTypeChoicePtr& value ) - { - if ( value ) - { - myHarmonicTypeChoice = value; - } - } - - - bool Harmonic::getHasHarmonicTypeChoice() const - { - return myHasHarmonicTypeChoice; - } - - - void Harmonic::setHasHarmonicTypeChoice( const bool value ) - { - myHasHarmonicTypeChoice = value; - } - - - HarmonicAttributesPtr Harmonic::getAttributes() const - { - return myAttributes; - } - - - void Harmonic::setAttributes( const HarmonicAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - HarmonicInfoChoicePtr Harmonic::getHarmonicInfoChoice() const - { - return myHarmonicInfoChoice; - } - - - void Harmonic::setHarmonicInfoChoice( const HarmonicInfoChoicePtr& value ) - { - if ( value ) - { - myHarmonicInfoChoice = value; - } - } - - - bool Harmonic::getHasHarmonicInfoChoice() const - { - return myHasHarmonicInfoChoice; - } - - - void Harmonic::setHasHarmonicInfoChoice( const bool value ) - { - myHasHarmonicInfoChoice = value; - } - - - bool Harmonic::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if( checkSetChoiceMember( - message, *it, isSuccess, myHarmonicTypeChoice, - "natural", &HarmonicTypeChoice::getNatural, - static_cast( HarmonicTypeChoice::Choice::natural ) ) ) - { myHasHarmonicTypeChoice = true; continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, myHarmonicTypeChoice, - "artificial", &HarmonicTypeChoice::getArtificial, - static_cast( HarmonicTypeChoice::Choice::artificial ) ) ) - { myHasHarmonicTypeChoice = true; continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, myHarmonicInfoChoice, - "base-pitch", &HarmonicInfoChoice::getBasePitch, - static_cast( HarmonicInfoChoice::Choice::basePitch ) ) ) - { myHasHarmonicInfoChoice = true; continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, myHarmonicInfoChoice, - "touching-pitch", &HarmonicInfoChoice::getTouchingPitch, - static_cast( HarmonicInfoChoice::Choice::touchingPitch ) ) ) - { myHasHarmonicInfoChoice = true; continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, myHarmonicInfoChoice, - "sounding-pitch", &HarmonicInfoChoice::getSoundingPitch, - static_cast( HarmonicInfoChoice::Choice::soundingPitch ) ) ) - { myHasHarmonicInfoChoice = true; continue; } - - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Harmonic.h b/Sourcecode/private/mx/core/elements/Harmonic.h deleted file mode 100644 index 24a35f511..000000000 --- a/Sourcecode/private/mx/core/elements/Harmonic.h +++ /dev/null @@ -1,63 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/HarmonicAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HarmonicAttributes ) - MX_FORWARD_DECLARE_ELEMENT( HarmonicInfoChoice ) - MX_FORWARD_DECLARE_ELEMENT( HarmonicTypeChoice ) - MX_FORWARD_DECLARE_ELEMENT( Harmonic ) - - inline HarmonicPtr makeHarmonic() { return std::make_shared(); } - - class Harmonic : public ElementInterface - { - public: - Harmonic(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HarmonicAttributesPtr getAttributes() const; - void setAttributes( const HarmonicAttributesPtr& value ); - - /* _________ HarmonicTypeChoice minOccurs = 0, maxOccurs = 1 _________ */ - HarmonicTypeChoicePtr getHarmonicTypeChoice() const; - void setHarmonicTypeChoice( const HarmonicTypeChoicePtr& value ); - bool getHasHarmonicTypeChoice() const; - void setHasHarmonicTypeChoice( const bool value ); - - /* _________ HarmonicInfoChoice minOccurs = 0, maxOccurs = 1 _________ */ - HarmonicInfoChoicePtr getHarmonicInfoChoice() const; - void setHarmonicInfoChoice( const HarmonicInfoChoicePtr& value ); - bool getHasHarmonicInfoChoice() const; - void setHasHarmonicInfoChoice( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HarmonicAttributesPtr myAttributes; - HarmonicTypeChoicePtr myHarmonicTypeChoice; - bool myHasHarmonicTypeChoice; - HarmonicInfoChoicePtr myHarmonicInfoChoice; - bool myHasHarmonicInfoChoice; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HarmonicAttributes.cpp b/Sourcecode/private/mx/core/elements/HarmonicAttributes.cpp deleted file mode 100644 index e792deb27..000000000 --- a/Sourcecode/private/mx/core/elements/HarmonicAttributes.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HarmonicAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - HarmonicAttributes::HarmonicAttributes() - :printObject( YesNo::no ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - {} - - - bool HarmonicAttributes::hasValues() const - { - return hasPrintObject || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement; - } - - - std::ostream& HarmonicAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool HarmonicAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "HarmonicAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/HarmonicAttributes.h b/Sourcecode/private/mx/core/elements/HarmonicAttributes.h deleted file mode 100644 index 7b1c517bb..000000000 --- a/Sourcecode/private/mx/core/elements/HarmonicAttributes.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HarmonicAttributes ) - - struct HarmonicAttributes : public AttributesInterface - { - public: - HarmonicAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.cpp b/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.cpp deleted file mode 100644 index 12d7d02f3..000000000 --- a/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HarmonicInfoChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/BasePitch.h" -#include "mx/core/elements/SoundingPitch.h" -#include "mx/core/elements/TouchingPitch.h" -#include - -namespace mx -{ - namespace core - { - HarmonicInfoChoice::HarmonicInfoChoice() - :myChoice( Choice::basePitch ) - ,myBasePitch( makeBasePitch() ) - ,myTouchingPitch( makeTouchingPitch() ) - ,mySoundingPitch( makeSoundingPitch() ) - {} - - - bool HarmonicInfoChoice::hasAttributes() const - { - return false; - } - - - std::ostream& HarmonicInfoChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& HarmonicInfoChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool HarmonicInfoChoice::hasContents() const - { - return true; - } - - - std::ostream& HarmonicInfoChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::basePitch: - myBasePitch->toStream( os, indentLevel ); - break; - case Choice::touchingPitch: - myTouchingPitch->toStream( os, indentLevel ); - break; - case Choice::soundingPitch: - mySoundingPitch->toStream( os, indentLevel ); - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - HarmonicInfoChoice::Choice HarmonicInfoChoice::getChoice() const - { - return myChoice; - } - - - void HarmonicInfoChoice::setChoice( const HarmonicInfoChoice::Choice value ) - { - myChoice = value; - } - - - BasePitchPtr HarmonicInfoChoice::getBasePitch() const - { - return myBasePitch; - } - - - void HarmonicInfoChoice::setBasePitch( const BasePitchPtr& value ) - { - if ( value ) - { - myBasePitch = value; - } - } - - - TouchingPitchPtr HarmonicInfoChoice::getTouchingPitch() const - { - return myTouchingPitch; - } - - - void HarmonicInfoChoice::setTouchingPitch( const TouchingPitchPtr& value ) - { - if ( value ) - { - myTouchingPitch = value; - } - } - - - SoundingPitchPtr HarmonicInfoChoice::getSoundingPitch() const - { - return mySoundingPitch; - } - - - void HarmonicInfoChoice::setSoundingPitch( const SoundingPitchPtr& value ) - { - if ( value ) - { - mySoundingPitch = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( HarmonicInfoChoice ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.h b/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.h deleted file mode 100644 index 8ef94c3fe..000000000 --- a/Sourcecode/private/mx/core/elements/HarmonicInfoChoice.h +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BasePitch ) - MX_FORWARD_DECLARE_ELEMENT( SoundingPitch ) - MX_FORWARD_DECLARE_ELEMENT( TouchingPitch ) - MX_FORWARD_DECLARE_ELEMENT( HarmonicInfoChoice ) - - inline HarmonicInfoChoicePtr makeHarmonicInfoChoice() { return std::make_shared(); } - - class HarmonicInfoChoice : public ElementInterface - { - public: - enum class Choice - { - basePitch = 1, - touchingPitch = 2, - soundingPitch = 3 - }; - HarmonicInfoChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - HarmonicInfoChoice::Choice getChoice() const; - void setChoice( const HarmonicInfoChoice::Choice value ); - - /* _________ BasePitch minOccurs = 1, maxOccurs = 1 _________ */ - BasePitchPtr getBasePitch() const; - void setBasePitch( const BasePitchPtr& value ); - - /* _________ TouchingPitch minOccurs = 1, maxOccurs = 1 _________ */ - TouchingPitchPtr getTouchingPitch() const; - void setTouchingPitch( const TouchingPitchPtr& value ); - - /* _________ SoundingPitch minOccurs = 1, maxOccurs = 1 _________ */ - SoundingPitchPtr getSoundingPitch() const; - void setSoundingPitch( const SoundingPitchPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - BasePitchPtr myBasePitch; - TouchingPitchPtr myTouchingPitch; - SoundingPitchPtr mySoundingPitch; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.cpp b/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.cpp deleted file mode 100644 index 7784285e8..000000000 --- a/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HarmonicTypeChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Artificial.h" -#include "mx/core/elements/Natural.h" -#include - -namespace mx -{ - namespace core - { - HarmonicTypeChoice::HarmonicTypeChoice() - :myChoice( Choice::natural ) - ,myNatural( makeNatural() ) - ,myArtificial( makeArtificial() ) - {} - - - bool HarmonicTypeChoice::hasAttributes() const - { - return false; - } - - - std::ostream& HarmonicTypeChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& HarmonicTypeChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool HarmonicTypeChoice::hasContents() const - { - return true; - } - - - std::ostream& HarmonicTypeChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::natural: - myNatural->toStream( os, indentLevel ); - break; - case Choice::artificial: - myArtificial->toStream( os, indentLevel ); - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - HarmonicTypeChoice::Choice HarmonicTypeChoice::getChoice() const - { - return myChoice; - } - - - void HarmonicTypeChoice::setChoice( const HarmonicTypeChoice::Choice value ) - { - myChoice = value; - } - - - NaturalPtr HarmonicTypeChoice::getNatural() const - { - return myNatural; - } - - - void HarmonicTypeChoice::setNatural( const NaturalPtr& value ) - { - if ( value ) - { - myNatural = value; - } - } - - - ArtificialPtr HarmonicTypeChoice::getArtificial() const - { - return myArtificial; - } - - - void HarmonicTypeChoice::setArtificial( const ArtificialPtr& value ) - { - if ( value ) - { - myArtificial = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( HarmonicTypeChoice ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.h b/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.h deleted file mode 100644 index 9d7f75f3b..000000000 --- a/Sourcecode/private/mx/core/elements/HarmonicTypeChoice.h +++ /dev/null @@ -1,62 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Artificial ) - MX_FORWARD_DECLARE_ELEMENT( Natural ) - MX_FORWARD_DECLARE_ELEMENT( HarmonicTypeChoice ) - - inline HarmonicTypeChoicePtr makeHarmonicTypeChoice() { return std::make_shared(); } - - class HarmonicTypeChoice : public ElementInterface - { - public: - enum class Choice - { - natural = 1, - artificial = 2 - }; - HarmonicTypeChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - HarmonicTypeChoice::Choice getChoice() const; - void setChoice( const HarmonicTypeChoice::Choice value ); - - /* _________ Natural minOccurs = 1, maxOccurs = 1 _________ */ - NaturalPtr getNatural() const; - void setNatural( const NaturalPtr& value ); - - /* _________ Artificial minOccurs = 1, maxOccurs = 1 _________ */ - ArtificialPtr getArtificial() const; - void setArtificial( const ArtificialPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - NaturalPtr myNatural; - ArtificialPtr myArtificial; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Harmony.cpp b/Sourcecode/private/mx/core/elements/Harmony.cpp deleted file mode 100644 index f199cf1bd..000000000 --- a/Sourcecode/private/mx/core/elements/Harmony.cpp +++ /dev/null @@ -1,352 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Harmony.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Bass.h" -#include "mx/core/elements/Degree.h" -#include "mx/core/elements/EditorialGroup.h" -#include "mx/core/elements/Frame.h" -#include "mx/core/elements/Function.h" -#include "mx/core/elements/Inversion.h" -#include "mx/core/elements/HarmonyChordGroup.h" -#include "mx/core/elements/Kind.h" -#include "mx/core/elements/Root.h" -#include "mx/core/elements/Offset.h" -#include "mx/core/elements/Staff.h" -#include - -namespace mx -{ - namespace core - { - Harmony::Harmony() - :myAttributes( std::make_shared() ) - ,myHarmonyChordGroupSet() - ,myFrame( makeFrame() ) - ,myHasFrame( false ) - ,myOffset( makeOffset() ) - ,myHasOffset( false ) - ,myEditorialGroup( makeEditorialGroup() ) - ,myStaff( makeStaff() ) - ,myHasStaff( false ) - { - myHarmonyChordGroupSet.push_back( makeHarmonyChordGroup() ); - } - - - bool Harmony::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Harmony::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Harmony::streamName( std::ostream& os ) const - { - os << "harmony"; - return os; - } - - - bool Harmony::hasContents() const - { - return true; - } - - - std::ostream& Harmony::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto x : myHarmonyChordGroupSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasFrame ) - { - os << std::endl; - myFrame->toStream( os, indentLevel+1 ); - } - if ( myHasOffset ) - { - os << std::endl; - myOffset->toStream( os, indentLevel+1 ); - } - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasStaff ) - { - os << std::endl; - myStaff->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - HarmonyAttributesPtr Harmony::getAttributes() const - { - return myAttributes; - } - - - void Harmony::setAttributes( const HarmonyAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const HarmonyChordGroupSet& Harmony::getHarmonyChordGroupSet() const - { - return myHarmonyChordGroupSet; - } - - - void Harmony::addHarmonyChordGroup( const HarmonyChordGroupPtr& value ) - { - if ( value ) - { - myHarmonyChordGroupSet.push_back( value ); - } - } - - - void Harmony::removeHarmonyChordGroup( const HarmonyChordGroupSetIterConst& value ) - { - if ( value != myHarmonyChordGroupSet.cend() ) - { - if( myHarmonyChordGroupSet.size() > 1 ) - { - myHarmonyChordGroupSet.erase( value ); - } - } - } - - - void Harmony::clearHarmonyChordGroupSet() - { - myHarmonyChordGroupSet.clear(); - myHarmonyChordGroupSet.push_back( makeHarmonyChordGroup() ); - } - - - HarmonyChordGroupPtr Harmony::getHarmonyChordGroup( const HarmonyChordGroupSetIterConst& setIterator ) const - { - if( setIterator != myHarmonyChordGroupSet.cend() ) - { - return *setIterator; - } - return HarmonyChordGroupPtr(); - } - - - FramePtr Harmony::getFrame() const - { - return myFrame; - } - - - void Harmony::setFrame( const FramePtr& value ) - { - if ( value ) - { - myFrame = value; - } - } - - - bool Harmony::getHasFrame() const - { - return myHasFrame; - } - - - void Harmony::setHasFrame( const bool value ) - { - myHasFrame = value; - } - - - OffsetPtr Harmony::getOffset() const - { - return myOffset; - } - - - void Harmony::setOffset( const OffsetPtr& value ) - { - if ( value ) - { - myOffset = value; - } - } - - - bool Harmony::getHasOffset() const - { - return myHasOffset; - } - - - void Harmony::setHasOffset( const bool value ) - { - myHasOffset = value; - } - - - EditorialGroupPtr Harmony::getEditorialGroup() const - { - return myEditorialGroup; - } - - - void Harmony::setEditorialGroup( const EditorialGroupPtr& value ) - { - if ( value ) - { - myEditorialGroup = value; - } - } - - - StaffPtr Harmony::getStaff() const - { - return myStaff; - } - - - void Harmony::setStaff( const StaffPtr& value ) - { - if ( value ) - { - myStaff = value; - } - } - - - bool Harmony::getHasStaff() const - { - return myHasStaff; - } - - - void Harmony::setHasStaff( const bool value ) - { - myHasStaff = value; - } - - - bool Harmony::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isChoiceFound = false; - bool isFirstHarmonyChordGroupAdded = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - const std::string elementName = it->getName(); - if( elementName == "root" || elementName == "function" ) - { - bool decrementIter = false; - isChoiceFound = true; - auto item = makeHarmonyChordGroup(); - if( elementName == "root" ) - { - item->setChoice( HarmonyChordGroup::Choice::root ); - isSuccess &= item->getRoot()->fromXElement( message, *it ); - } - else - { - item->setChoice( HarmonyChordGroup::Choice::function ); - isSuccess &= item->getFunction()->fromXElement( message, *it ); - } - decrementIter = true; - ++it; - if( it == endIter || it->getName() != "kind" ) - { - message << "Harmony: 'kind' is a required element and is missing aborting" << std::endl; return false; - } - isSuccess &= item->getKind()->fromXElement( message, *it ); - decrementIter = true; - ++it; - if( it == endIter ) { addGroup( item, isFirstHarmonyChordGroupAdded ); MX_RETURN_IS_SUCCESS; } - if( it->getName() == "inversion" ) - { - isSuccess &= item->getInversion()->fromXElement( message, *it ); - item->setHasInversion( true ); - decrementIter = true; - ++it; - } - if( it == endIter ) { addGroup( item, isFirstHarmonyChordGroupAdded ); MX_RETURN_IS_SUCCESS; } - if( it->getName() == "bass" ) - { - isSuccess &= item->getBass()->fromXElement( message, *it ); - item->setHasBass( true ); - decrementIter = true; - ++it; - } - if( it == endIter ) { addGroup( item, isFirstHarmonyChordGroupAdded ); MX_RETURN_IS_SUCCESS; } - - while( it != endIter && it->getName() == "degree" ) - { - auto degree = makeDegree(); - isSuccess &= degree->fromXElement( message, *it ); - item->addDegree( degree ); - decrementIter = true; - ++it; - } - - addGroup( item, isFirstHarmonyChordGroupAdded ); - - if( decrementIter ) - { - --it; - } - continue; - } - - if ( importElement( message, *it, isSuccess, *myFrame, myHasFrame ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myOffset, myHasOffset ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialGroup ); - if ( importElement( message, *it, isSuccess, *myStaff, myHasStaff ) ) { continue; } - } - - if( !isChoiceFound ) - { - message << "Harmony: either 'root' or 'function' is required but neither was present" << std::endl; - isSuccess = false; - } - - return isSuccess; - } - - void Harmony::addGroup( HarmonyChordGroupPtr& grp, bool& isFirst ) - { - if( !isFirst && myHarmonyChordGroupSet.size() == 1 ) - { - *myHarmonyChordGroupSet.begin() = grp; - isFirst = true; - } - else - { - myHarmonyChordGroupSet.push_back( grp ); - isFirst = true; - } - } - } -} diff --git a/Sourcecode/private/mx/core/elements/Harmony.h b/Sourcecode/private/mx/core/elements/Harmony.h deleted file mode 100644 index 9230b6c33..000000000 --- a/Sourcecode/private/mx/core/elements/Harmony.h +++ /dev/null @@ -1,89 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/HarmonyAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HarmonyAttributes ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( Frame ) - MX_FORWARD_DECLARE_ELEMENT( HarmonyChordGroup ) - MX_FORWARD_DECLARE_ELEMENT( Offset ) - MX_FORWARD_DECLARE_ELEMENT( Staff ) - MX_FORWARD_DECLARE_ELEMENT( Harmony ) - - inline HarmonyPtr makeHarmony() { return std::make_shared(); } - - class Harmony : public ElementInterface - { - public: - Harmony(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HarmonyAttributesPtr getAttributes() const; - void setAttributes( const HarmonyAttributesPtr& value ); - - /* _________ HarmonyChordGroup minOccurs = 1, maxOccurs = unbounded _________ */ - const HarmonyChordGroupSet& getHarmonyChordGroupSet() const; - void addHarmonyChordGroup( const HarmonyChordGroupPtr& value ); - void removeHarmonyChordGroup( const HarmonyChordGroupSetIterConst& value ); - void clearHarmonyChordGroupSet(); - HarmonyChordGroupPtr getHarmonyChordGroup( const HarmonyChordGroupSetIterConst& setIterator ) const; - - /* _________ Frame minOccurs = 0, maxOccurs = 1 _________ */ - FramePtr getFrame() const; - void setFrame( const FramePtr& value ); - bool getHasFrame() const; - void setHasFrame( const bool value ); - - /* _________ Offset minOccurs = 0, maxOccurs = 1 _________ */ - OffsetPtr getOffset() const; - void setOffset( const OffsetPtr& value ); - bool getHasOffset() const; - void setHasOffset( const bool value ); - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - /* _________ Staff minOccurs = 0, maxOccurs = 1 _________ */ - StaffPtr getStaff() const; - void setStaff( const StaffPtr& value ); - bool getHasStaff() const; - void setHasStaff( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HarmonyAttributesPtr myAttributes; - HarmonyChordGroupSet myHarmonyChordGroupSet; - FramePtr myFrame; - bool myHasFrame; - OffsetPtr myOffset; - bool myHasOffset; - EditorialGroupPtr myEditorialGroup; - StaffPtr myStaff; - bool myHasStaff; - - void addGroup( HarmonyChordGroupPtr& grp, bool& isFirst ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HarmonyAttributes.cpp b/Sourcecode/private/mx/core/elements/HarmonyAttributes.cpp deleted file mode 100644 index 37d98b41a..000000000 --- a/Sourcecode/private/mx/core/elements/HarmonyAttributes.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HarmonyAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - HarmonyAttributes::HarmonyAttributes() - :type() - ,printObject( YesNo::no ) - ,printFrame( YesNo::no ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,hasType( false ) - ,hasPrintObject( false ) - ,hasPrintFrame( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - {} - - - bool HarmonyAttributes::hasValues() const - { - return hasType || - hasPrintObject || - hasPrintFrame || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement; - } - - - std::ostream& HarmonyAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, printFrame, "print-frame", hasPrintFrame ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool HarmonyAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "HarmonyAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type", &parseHarmonyType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printFrame, hasPrintFrame, "print-frame", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/HarmonyAttributes.h b/Sourcecode/private/mx/core/elements/HarmonyAttributes.h deleted file mode 100644 index e92a115f5..000000000 --- a/Sourcecode/private/mx/core/elements/HarmonyAttributes.h +++ /dev/null @@ -1,63 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HarmonyAttributes ) - - struct HarmonyAttributes : public AttributesInterface - { - public: - HarmonyAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - HarmonyType type; - YesNo printObject; - YesNo printFrame; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - bool hasType; - bool hasPrintObject; - bool hasPrintFrame; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HarmonyChordGroup.cpp b/Sourcecode/private/mx/core/elements/HarmonyChordGroup.cpp deleted file mode 100644 index 8b28a2d23..000000000 --- a/Sourcecode/private/mx/core/elements/HarmonyChordGroup.cpp +++ /dev/null @@ -1,245 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HarmonyChordGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Bass.h" -#include "mx/core/elements/Degree.h" -#include "mx/core/elements/Function.h" -#include "mx/core/elements/Inversion.h" -#include "mx/core/elements/Kind.h" -#include "mx/core/elements/Root.h" -#include - -namespace mx -{ - namespace core - { - HarmonyChordGroup::HarmonyChordGroup() - :myChoice( Choice::root ) - ,myRoot( makeRoot() ) - ,myFunction( makeFunction() ) - ,myKind( makeKind() ) - ,myInversion( makeInversion() ) - ,myHasInversion( false ) - ,myBass( makeBass() ) - ,myHasBass( false ) - ,myDegreeSet() - {} - - - bool HarmonyChordGroup::hasAttributes() const - { - return false; - } - - - std::ostream& HarmonyChordGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& HarmonyChordGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool HarmonyChordGroup::hasContents() const - { - return true; - } - - - std::ostream& HarmonyChordGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::root: - myRoot->toStream( os, indentLevel ); - break; - case Choice::function: - myFunction->toStream( os, indentLevel ); - break; - default: - break; - } - os << std::endl; - myKind->toStream( os, indentLevel ); - if ( myHasInversion ) - { - os << std::endl; - myInversion->toStream( os, indentLevel ); - } - if ( myHasBass ) - { - os << std::endl; - myBass->toStream( os, indentLevel ); - } - for ( auto x : myDegreeSet ) - { - os << std::endl; - x->toStream( os, indentLevel ); - } - isOneLineOnly = false; - return os; - } - - - HarmonyChordGroup::Choice HarmonyChordGroup::getChoice() const - { - return myChoice; - } - - - void HarmonyChordGroup::setChoice( const HarmonyChordGroup::Choice value ) - { - myChoice = value; - } - - - RootPtr HarmonyChordGroup::getRoot() const - { - return myRoot; - } - - - void HarmonyChordGroup::setRoot( const RootPtr& value ) - { - if ( value ) - { - myRoot = value; - } - } - - - FunctionPtr HarmonyChordGroup::getFunction() const - { - return myFunction; - } - - - void HarmonyChordGroup::setFunction( const FunctionPtr& value ) - { - if ( value ) - { - myFunction = value; - } - } - - - KindPtr HarmonyChordGroup::getKind() const - { - return myKind; - } - - - void HarmonyChordGroup::setKind( const KindPtr& value ) - { - if ( value ) - { - myKind = value; - } - } - - - InversionPtr HarmonyChordGroup::getInversion() const - { - return myInversion; - } - - - void HarmonyChordGroup::setInversion( const InversionPtr& value ) - { - if ( value ) - { - myInversion = value; - } - } - - - bool HarmonyChordGroup::getHasInversion() const - { - return myHasInversion; - } - - - void HarmonyChordGroup::setHasInversion( const bool value ) - { - myHasInversion = value; - } - - - BassPtr HarmonyChordGroup::getBass() const - { - return myBass; - } - - - void HarmonyChordGroup::setBass( const BassPtr& value ) - { - if ( value ) - { - myBass = value; - } - } - - - bool HarmonyChordGroup::getHasBass() const - { - return myHasBass; - } - - - void HarmonyChordGroup::setHasBass( const bool value ) - { - myHasBass = value; - } - - - const DegreeSet& HarmonyChordGroup::getDegreeSet() const - { - return myDegreeSet; - } - - - void HarmonyChordGroup::addDegree( const DegreePtr& value ) - { - if ( value ) - { - myDegreeSet.push_back( value ); - } - } - - - void HarmonyChordGroup::removeDegree( const DegreeSetIterConst& value ) - { - if ( value != myDegreeSet.cend() ) - { - myDegreeSet.erase( value ); - } - } - - - void HarmonyChordGroup::clearDegreeSet() - { - myDegreeSet.clear(); - } - - - DegreePtr HarmonyChordGroup::getDegree( const DegreeSetIterConst& setIterator ) const - { - if( setIterator != myDegreeSet.cend() ) - { - return *setIterator; - } - return DegreePtr(); - } - - - MX_FROM_XELEMENT_UNUSED( HarmonyChordGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/HarmonyChordGroup.h b/Sourcecode/private/mx/core/elements/HarmonyChordGroup.h deleted file mode 100644 index 1aa8fd735..000000000 --- a/Sourcecode/private/mx/core/elements/HarmonyChordGroup.h +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Bass ) - MX_FORWARD_DECLARE_ELEMENT( Degree ) - MX_FORWARD_DECLARE_ELEMENT( Function ) - MX_FORWARD_DECLARE_ELEMENT( Inversion ) - MX_FORWARD_DECLARE_ELEMENT( Kind ) - MX_FORWARD_DECLARE_ELEMENT( Root ) - MX_FORWARD_DECLARE_ELEMENT( HarmonyChordGroup ) - - inline HarmonyChordGroupPtr makeHarmonyChordGroup() { return std::make_shared(); } - - class HarmonyChordGroup : public ElementInterface - { - public: - enum class Choice - { - root = 1, - function = 2 - }; - HarmonyChordGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HarmonyChordGroup::Choice getChoice() const; - void setChoice( const HarmonyChordGroup::Choice value ); - - /* _________ Root minOccurs = 1, maxOccurs = 1 _________ */ - RootPtr getRoot() const; - void setRoot( const RootPtr& value ); - - /* _________ Function minOccurs = 1, maxOccurs = 1 _________ */ - FunctionPtr getFunction() const; - void setFunction( const FunctionPtr& value ); - - /* _________ Kind minOccurs = 1, maxOccurs = 1 _________ */ - KindPtr getKind() const; - void setKind( const KindPtr& value ); - - /* _________ Inversion minOccurs = 0, maxOccurs = 1 _________ */ - InversionPtr getInversion() const; - void setInversion( const InversionPtr& value ); - bool getHasInversion() const; - void setHasInversion( const bool value ); - - /* _________ Bass minOccurs = 0, maxOccurs = 1 _________ */ - BassPtr getBass() const; - void setBass( const BassPtr& value ); - bool getHasBass() const; - void setHasBass( const bool value ); - - /* _________ Degree minOccurs = 0, maxOccurs = unbounded _________ */ - const DegreeSet& getDegreeSet() const; - void addDegree( const DegreePtr& value ); - void removeDegree( const DegreeSetIterConst& value ); - void clearDegreeSet(); - DegreePtr getDegree( const DegreeSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - RootPtr myRoot; - FunctionPtr myFunction; - KindPtr myKind; - InversionPtr myInversion; - bool myHasInversion; - BassPtr myBass; - bool myHasBass; - DegreeSet myDegreeSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HarpPedals.cpp b/Sourcecode/private/mx/core/elements/HarpPedals.cpp deleted file mode 100644 index d42863810..000000000 --- a/Sourcecode/private/mx/core/elements/HarpPedals.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HarpPedals.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/PedalTuning.h" -#include - -namespace mx -{ - namespace core - { - HarpPedals::HarpPedals() - :myAttributes( std::make_shared() ) - ,myPedalTuningSet() - { - myPedalTuningSet.push_back( makePedalTuning() ); - } - - - bool HarpPedals::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& HarpPedals::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& HarpPedals::streamName( std::ostream& os ) const - { - os << "harp-pedals"; - return os; - } - - - bool HarpPedals::hasContents() const - { - return true; - } - - - std::ostream& HarpPedals::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - for ( auto x : myPedalTuningSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - return os; - } - - - HarpPedalsAttributesPtr HarpPedals::getAttributes() const - { - return myAttributes; - } - - - void HarpPedals::setAttributes( const HarpPedalsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const PedalTuningSet& HarpPedals::getPedalTuningSet() const - { - return myPedalTuningSet; - } - - - void HarpPedals::removePedalTuning( const PedalTuningSetIterConst& value ) - { - if ( value != myPedalTuningSet.cend() ) - { - if ( myPedalTuningSet.size() > 1 ) - { - myPedalTuningSet.erase( value ); - } - } - } - - - void HarpPedals::addPedalTuning( const PedalTuningPtr& value ) - { - if ( value ) - { - myPedalTuningSet.push_back( value ); - } - } - - - void HarpPedals::clearPedalTuningSet() - { - myPedalTuningSet.clear(); - myPedalTuningSet.push_back( makePedalTuning() ); - } - - - PedalTuningPtr HarpPedals::getPedalTuning( const PedalTuningSetIterConst& setIterator ) const - { - if( setIterator != myPedalTuningSet.cend() ) - { - return *setIterator; - } - return PedalTuningPtr(); - } - - - bool HarpPedals::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "pedal-tuning", myPedalTuningSet ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/HarpPedals.h b/Sourcecode/private/mx/core/elements/HarpPedals.h deleted file mode 100644 index 9ea3499bb..000000000 --- a/Sourcecode/private/mx/core/elements/HarpPedals.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/HarpPedalsAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HarpPedalsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PedalTuning ) - MX_FORWARD_DECLARE_ELEMENT( HarpPedals ) - - inline HarpPedalsPtr makeHarpPedals() { return std::make_shared(); } - - class HarpPedals : public ElementInterface - { - public: - HarpPedals(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HarpPedalsAttributesPtr getAttributes() const; - void setAttributes( const HarpPedalsAttributesPtr& value ); - - /* _________ PedalTuning minOccurs = 1, maxOccurs = unbounded _________ */ - const PedalTuningSet& getPedalTuningSet() const; - void addPedalTuning( const PedalTuningPtr& value ); - void removePedalTuning( const PedalTuningSetIterConst& value ); - void clearPedalTuningSet(); - PedalTuningPtr getPedalTuning( const PedalTuningSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HarpPedalsAttributesPtr myAttributes; - PedalTuningSet myPedalTuningSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.cpp b/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.cpp deleted file mode 100644 index 47b13ea9e..000000000 --- a/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HarpPedalsAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - HarpPedalsAttributes::HarpPedalsAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,halign( LeftCenterRight::center ) - ,valign() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - {} - - - bool HarpPedalsAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasHalign || - hasValign; - } - - - std::ostream& HarpPedalsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - } - return os; - } - - - bool HarpPedalsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "HarpPedalsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.h b/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.h deleted file mode 100644 index 39a1ab557..000000000 --- a/Sourcecode/private/mx/core/elements/HarpPedalsAttributes.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HarpPedalsAttributes ) - - struct HarpPedalsAttributes : public AttributesInterface - { - public: - HarpPedalsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Heel.cpp b/Sourcecode/private/mx/core/elements/Heel.cpp deleted file mode 100644 index da7125b83..000000000 --- a/Sourcecode/private/mx/core/elements/Heel.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Heel.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Heel::Heel() - :myAttributes( std::make_shared() ) - {} - - - bool Heel::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Heel::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Heel::streamName( std::ostream& os ) const - { - os << "heel"; - return os; - } - - - bool Heel::hasContents() const - { - return false; - } - - - std::ostream& Heel::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - HeelAttributesPtr Heel::getAttributes() const - { - return myAttributes; - } - - - void Heel::setAttributes( const HeelAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Heel::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Heel.h b/Sourcecode/private/mx/core/elements/Heel.h deleted file mode 100644 index 067d770a3..000000000 --- a/Sourcecode/private/mx/core/elements/Heel.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/HeelAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HeelAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Heel ) - - inline HeelPtr makeHeel() { return std::make_shared(); } - - class Heel : public ElementInterface - { - public: - Heel(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HeelAttributesPtr getAttributes() const; - void setAttributes( const HeelAttributesPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HeelAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HeelAttributes.cpp b/Sourcecode/private/mx/core/elements/HeelAttributes.cpp deleted file mode 100644 index f6f1bfbc3..000000000 --- a/Sourcecode/private/mx/core/elements/HeelAttributes.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HeelAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - HeelAttributes::HeelAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,substitution( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - ,hasSubstitution( false ) - {} - - - bool HeelAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement || - hasSubstitution; - } - - - std::ostream& HeelAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, substitution, "substitution", hasSubstitution ); - } - return os; - } - - - bool HeelAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "HeelAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, substitution, hasSubstitution, "substitution", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/HeelAttributes.h b/Sourcecode/private/mx/core/elements/HeelAttributes.h deleted file mode 100644 index 691d5e0fc..000000000 --- a/Sourcecode/private/mx/core/elements/HeelAttributes.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HeelAttributes ) - - struct HeelAttributes : public AttributesInterface - { - public: - HeelAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - YesNo substitution; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - bool hasSubstitution; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Hole.cpp b/Sourcecode/private/mx/core/elements/Hole.cpp deleted file mode 100644 index f8c7344b1..000000000 --- a/Sourcecode/private/mx/core/elements/Hole.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Hole.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/HoleClosed.h" -#include "mx/core/elements/HoleShape.h" -#include "mx/core/elements/HoleType.h" -#include - -namespace mx -{ - namespace core - { - Hole::Hole() - :myAttributes( std::make_shared() ) - ,myHoleType( makeHoleType() ) - ,myHasHoleType( false ) - ,myHoleClosed( makeHoleClosed() ) - ,myHoleShape( makeHoleShape() ) - ,myHasHoleShape( false ) - {} - - - bool Hole::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Hole::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Hole::streamName( std::ostream& os ) const - { - os << "hole"; - return os; - } - - - bool Hole::hasContents() const - { - return true; - } - - - std::ostream& Hole::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasHoleType ) - { - os << std::endl; - myHoleType->toStream( os, indentLevel+1 ); - } - os << std::endl; - myHoleClosed->toStream( os, indentLevel+1 ); - if ( myHasHoleShape ) - { - os << std::endl; - myHoleShape->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - HoleAttributesPtr Hole::getAttributes() const - { - return myAttributes; - } - - - void Hole::setAttributes( const HoleAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - HoleTypePtr Hole::getHoleType() const - { - return myHoleType; - } - - - void Hole::setHoleType( const HoleTypePtr& value ) - { - if( value ) - { - myHoleType = value; - } - } - - - bool Hole::getHasHoleType() const - { - return myHasHoleType; - } - - - void Hole::setHasHoleType( const bool value ) - { - myHasHoleType = value; - } - - - HoleClosedPtr Hole::getHoleClosed() const - { - return myHoleClosed; - } - - - void Hole::setHoleClosed( const HoleClosedPtr& value ) - { - if( value ) - { - myHoleClosed = value; - } - } - - - HoleShapePtr Hole::getHoleShape() const - { - return myHoleShape; - } - - - void Hole::setHoleShape( const HoleShapePtr& value ) - { - if( value ) - { - myHoleShape = value; - } - } - - - bool Hole::getHasHoleShape() const - { - return myHasHoleShape; - } - - - void Hole::setHasHoleShape( const bool value ) - { - myHasHoleShape = value; - } - - - bool Hole::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isHoleClosedFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myHoleType, myHasHoleType ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myHoleClosed, isHoleClosedFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myHoleShape, myHasHoleShape ) ) { continue; } - } - - if( !isHoleClosedFound ) - { - message << "Hole: '" << myHoleClosed->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Hole.h b/Sourcecode/private/mx/core/elements/Hole.h deleted file mode 100644 index 89ae7901a..000000000 --- a/Sourcecode/private/mx/core/elements/Hole.h +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/HoleAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HoleAttributes ) - MX_FORWARD_DECLARE_ELEMENT( HoleClosed ) - MX_FORWARD_DECLARE_ELEMENT( HoleShape ) - MX_FORWARD_DECLARE_ELEMENT( HoleType ) - MX_FORWARD_DECLARE_ELEMENT( Hole ) - - inline HolePtr makeHole() { return std::make_shared(); } - - class Hole : public ElementInterface - { - public: - Hole(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HoleAttributesPtr getAttributes() const; - void setAttributes( const HoleAttributesPtr& value ); - - /* _________ HoleType minOccurs = 0, maxOccurs = 1 _________ */ - HoleTypePtr getHoleType() const; - void setHoleType( const HoleTypePtr& value ); - bool getHasHoleType() const; - void setHasHoleType( const bool value ); - - /* _________ HoleClosed minOccurs = 1, maxOccurs = 1 _________ */ - HoleClosedPtr getHoleClosed() const; - void setHoleClosed( const HoleClosedPtr& value ); - - /* _________ HoleShape minOccurs = 0, maxOccurs = 1 _________ */ - HoleShapePtr getHoleShape() const; - void setHoleShape( const HoleShapePtr& value ); - bool getHasHoleShape() const; - void setHasHoleShape( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HoleAttributesPtr myAttributes; - HoleTypePtr myHoleType; - bool myHasHoleType; - HoleClosedPtr myHoleClosed; - HoleShapePtr myHoleShape; - bool myHasHoleShape; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HoleAttributes.cpp b/Sourcecode/private/mx/core/elements/HoleAttributes.cpp deleted file mode 100644 index d24cbc772..000000000 --- a/Sourcecode/private/mx/core/elements/HoleAttributes.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HoleAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - HoleAttributes::HoleAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - {} - - - bool HoleAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement; - } - - - std::ostream& HoleAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool HoleAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "HoleAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/HoleAttributes.h b/Sourcecode/private/mx/core/elements/HoleAttributes.h deleted file mode 100644 index b6aa5579b..000000000 --- a/Sourcecode/private/mx/core/elements/HoleAttributes.h +++ /dev/null @@ -1,57 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HoleAttributes ) - - struct HoleAttributes : public AttributesInterface - { - public: - HoleAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HoleClosed.cpp b/Sourcecode/private/mx/core/elements/HoleClosed.cpp deleted file mode 100644 index 2f6e7fbb2..000000000 --- a/Sourcecode/private/mx/core/elements/HoleClosed.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HoleClosed.h" -#include "ezxml/XElement.h" -#include - -namespace mx -{ - namespace core - { - HoleClosed::HoleClosed() - :myValue( HoleClosedValue::no ) - ,myAttributes( std::make_shared() ) - {} - - - HoleClosed::HoleClosed( const HoleClosedValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool HoleClosed::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool HoleClosed::hasContents() const - { - return true; - } - - - std::ostream& HoleClosed::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& HoleClosed::streamName( std::ostream& os ) const - { - os << "hole-closed"; - return os; - } - - - std::ostream& HoleClosed::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - HoleClosedAttributesPtr HoleClosed::getAttributes() const - { - return myAttributes; - } - - - void HoleClosed::setAttributes( const HoleClosedAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - HoleClosedValue HoleClosed::getValue() const - { - return myValue; - } - - - void HoleClosed::setValue( const HoleClosedValue& value ) - { - myValue = value; - } - - - bool HoleClosed::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = parseHoleClosedValue( xelement.getValue() ); - return true; - } - } -} diff --git a/Sourcecode/private/mx/core/elements/HoleClosed.h b/Sourcecode/private/mx/core/elements/HoleClosed.h deleted file mode 100644 index 79c722670..000000000 --- a/Sourcecode/private/mx/core/elements/HoleClosed.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/HoleClosedAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HoleClosedAttributes ) - MX_FORWARD_DECLARE_ELEMENT( HoleClosed ) - - inline HoleClosedPtr makeHoleClosed() { return std::make_shared(); } - inline HoleClosedPtr makeHoleClosed( const HoleClosedValue& value ) { return std::make_shared( value ); } - inline HoleClosedPtr makeHoleClosed( HoleClosedValue&& value ) { return std::make_shared( std::move( value ) ); } - - class HoleClosed : public ElementInterface - { - public: - HoleClosed(); - HoleClosed( const HoleClosedValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - HoleClosedAttributesPtr getAttributes() const; - void setAttributes( const HoleClosedAttributesPtr& attributes ); - HoleClosedValue getValue() const; - void setValue( const HoleClosedValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - HoleClosedValue myValue; - HoleClosedAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HoleClosedAttributes.cpp b/Sourcecode/private/mx/core/elements/HoleClosedAttributes.cpp deleted file mode 100644 index 6aca13517..000000000 --- a/Sourcecode/private/mx/core/elements/HoleClosedAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HoleClosedAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - HoleClosedAttributes::HoleClosedAttributes() - :location( HoleClosedLocation::top ) - ,hasLocation( false ) - {} - - - bool HoleClosedAttributes::hasValues() const - { - return hasLocation; - } - - - std::ostream& HoleClosedAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, location, "location", hasLocation ); - } - return os; - } - - - bool HoleClosedAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "HoleClosedAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, location, hasLocation, "location", &parseHoleClosedLocation ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/HoleClosedAttributes.h b/Sourcecode/private/mx/core/elements/HoleClosedAttributes.h deleted file mode 100644 index 5fe875c0f..000000000 --- a/Sourcecode/private/mx/core/elements/HoleClosedAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( HoleClosedAttributes ) - - struct HoleClosedAttributes : public AttributesInterface - { - public: - HoleClosedAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - HoleClosedLocation location; - bool hasLocation; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HoleShape.cpp b/Sourcecode/private/mx/core/elements/HoleShape.cpp deleted file mode 100644 index 3a86981a0..000000000 --- a/Sourcecode/private/mx/core/elements/HoleShape.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HoleShape.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - HoleShape::HoleShape() - :myValue() - {} - - - HoleShape::HoleShape( const XsString& value ) - :myValue( value ) - {} - - - bool HoleShape::hasAttributes() const - { - return false; - } - - - bool HoleShape::hasContents() const - { - return true; - } - - - std::ostream& HoleShape::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& HoleShape::streamName( std::ostream& os ) const - { - os << "hole-shape"; - return os; - } - - - std::ostream& HoleShape::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString HoleShape::getValue() const - { - return myValue; - } - - - void HoleShape::setValue( const XsString& value ) - { - myValue = value; - } - - - bool HoleShape::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/HoleShape.h b/Sourcecode/private/mx/core/elements/HoleShape.h deleted file mode 100644 index 4494aa836..000000000 --- a/Sourcecode/private/mx/core/elements/HoleShape.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( HoleShape ) - - inline HoleShapePtr makeHoleShape() { return std::make_shared(); } - inline HoleShapePtr makeHoleShape( const XsString& value ) { return std::make_shared( value ); } - inline HoleShapePtr makeHoleShape( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class HoleShape : public ElementInterface - { - public: - HoleShape(); - HoleShape( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/HoleType.cpp b/Sourcecode/private/mx/core/elements/HoleType.cpp deleted file mode 100644 index 638265e53..000000000 --- a/Sourcecode/private/mx/core/elements/HoleType.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/HoleType.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - HoleType::HoleType() - :myValue() - {} - - - HoleType::HoleType( const XsString& value ) - :myValue( value ) - {} - - - bool HoleType::hasAttributes() const - { - return false; - } - - - bool HoleType::hasContents() const - { - return true; - } - - - std::ostream& HoleType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& HoleType::streamName( std::ostream& os ) const - { - os << "hole-type"; - return os; - } - - - std::ostream& HoleType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString HoleType::getValue() const - { - return myValue; - } - - - void HoleType::setValue( const XsString& value ) - { - myValue = value; - } - - - bool HoleType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/HoleType.h b/Sourcecode/private/mx/core/elements/HoleType.h deleted file mode 100644 index 8a580263d..000000000 --- a/Sourcecode/private/mx/core/elements/HoleType.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( HoleType ) - - inline HoleTypePtr makeHoleType() { return std::make_shared(); } - inline HoleTypePtr makeHoleType( const XsString& value ) { return std::make_shared( value ); } - inline HoleTypePtr makeHoleType( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class HoleType : public ElementInterface - { - public: - HoleType(); - HoleType( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Humming.cpp b/Sourcecode/private/mx/core/elements/Humming.cpp deleted file mode 100644 index a4f2ddf2b..000000000 --- a/Sourcecode/private/mx/core/elements/Humming.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Humming.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Humming::Humming() : ElementInterface() {} - - - bool Humming::hasAttributes() const { return false; } - - - bool Humming::hasContents() const { return false; } - std::ostream& Humming::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Humming::streamName( std::ostream& os ) const { os << "humming"; return os; } - std::ostream& Humming::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool Humming::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Humming.h b/Sourcecode/private/mx/core/elements/Humming.h deleted file mode 100644 index 07e5a94cf..000000000 --- a/Sourcecode/private/mx/core/elements/Humming.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Humming ) - - inline HummingPtr makeHumming() { return std::make_shared(); } - - class Humming : public ElementInterface - { - public: - Humming(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Identification.cpp b/Sourcecode/private/mx/core/elements/Identification.cpp deleted file mode 100644 index 6a9a9b175..000000000 --- a/Sourcecode/private/mx/core/elements/Identification.cpp +++ /dev/null @@ -1,327 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Identification.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Creator.h" -#include "mx/core/elements/Encoding.h" -#include "mx/core/elements/Miscellaneous.h" -#include "mx/core/elements/Relation.h" -#include "mx/core/elements/Rights.h" -#include "mx/core/elements/Source.h" -#include - -namespace mx -{ - namespace core - { - Identification::Identification() - :myCreatorSet() - ,myRightsSet() - ,myEncoding( makeEncoding() ) - ,myHasEncoding( false ) - ,mySource( makeSource() ) - ,myHasSource( false ) - ,myRelationSet() - ,myMiscellaneous( makeMiscellaneous() ) - ,myHasMiscellaneous( false ) - {} - - - bool Identification::hasAttributes() const - { - return false; - } - - - std::ostream& Identification::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Identification::streamName( std::ostream& os ) const - { - os << "identification"; - return os; - } - - - bool Identification::hasContents() const - { - return myCreatorSet.size() > 0 - || myRightsSet.size() > 0 - || myHasEncoding - || myHasSource - || myRelationSet.size() > 0 - || myHasMiscellaneous; - } - - - std::ostream& Identification::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myCreatorSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myRightsSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasEncoding ) - { - os << std::endl; - myEncoding->toStream( os, indentLevel+1 ); - } - if ( myHasSource ) - { - os << std::endl; - mySource->toStream( os, indentLevel+1 ); - } - for ( auto x : myRelationSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasMiscellaneous ) - { - os << std::endl; - myMiscellaneous->toStream( os, indentLevel+1 ); - } - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - const CreatorSet& Identification::getCreatorSet() const - { - return myCreatorSet; - } - - - void Identification::removeCreator( const CreatorSetIterConst& value ) - { - if ( value != myCreatorSet.cend() ) - { - myCreatorSet.erase( value ); - } - } - - - void Identification::addCreator( const CreatorPtr& value ) - { - if ( value ) - { - myCreatorSet.push_back( value ); - } - } - - - void Identification::clearCreatorSet() - { - myCreatorSet.clear(); - } - - - CreatorPtr Identification::getCreator( const CreatorSetIterConst& setIterator ) const - { - if( setIterator != myCreatorSet.cend() ) - { - return *setIterator; - } - return CreatorPtr(); - } - - - const RightsSet& Identification::getRightsSet() const - { - return myRightsSet; - } - - - void Identification::removeRights( const RightsSetIterConst& value ) - { - if ( value != myRightsSet.cend() ) - { - myRightsSet.erase( value ); - } - } - - - void Identification::addRights( const RightsPtr& value ) - { - if ( value ) - { - myRightsSet.push_back( value ); - } - } - - - void Identification::clearRightsSet() - { - myRightsSet.clear(); - } - - - RightsPtr Identification::getRights( const RightsSetIterConst& setIterator ) const - { - if( setIterator != myRightsSet.cend() ) - { - return *setIterator; - } - return RightsPtr(); - } - - - EncodingPtr Identification::getEncoding() const - { - return myEncoding; - } - - - void Identification::setEncoding( const EncodingPtr& value ) - { - if( value ) - { - myEncoding = value; - } - } - - - bool Identification::getHasEncoding() const - { - return myHasEncoding; - } - - - void Identification::setHasEncoding( const bool value ) - { - myHasEncoding = value; - } - - - SourcePtr Identification::getSource() const - { - return mySource; - } - - - void Identification::setSource( const SourcePtr& value ) - { - if( value ) - { - mySource = value; - } - } - - - bool Identification::getHasSource() const - { - return myHasSource; - } - - - void Identification::setHasSource( const bool value ) - { - myHasSource = value; - } - - - const RelationSet& Identification::getRelationSet() const - { - return myRelationSet; - } - - - void Identification::removeRelation( const RelationSetIterConst& value ) - { - if ( value != myRelationSet.cend() ) - { - myRelationSet.erase( value ); - } - } - - - void Identification::addRelation( const RelationPtr& value ) - { - if ( value ) - { - myRelationSet.push_back( value ); - } - } - - - void Identification::clearRelationSet() - { - myRelationSet.clear(); - } - - - RelationPtr Identification::getRelation( const RelationSetIterConst& setIterator ) const - { - if( setIterator != myRelationSet.cend() ) - { - return *setIterator; - } - return RelationPtr(); - } - - - MiscellaneousPtr Identification::getMiscellaneous() const - { - return myMiscellaneous; - } - - - void Identification::setMiscellaneous( const MiscellaneousPtr& value ) - { - if( value ) - { - myMiscellaneous = value; - } - } - - - bool Identification::getHasMiscellaneous() const - { - return myHasMiscellaneous; - } - - - void Identification::setHasMiscellaneous( const bool value ) - { - myHasMiscellaneous = value; - } - - - bool Identification::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "creator", myCreatorSet ); - importElementSet( message, it, endIter, isSuccess, "rights", myRightsSet ); - if ( importElement( message, *it, isSuccess, *myEncoding, myHasEncoding ) ) { continue; } - if ( importElement( message, *it, isSuccess, *mySource, myHasSource ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "relation", myRelationSet ); - if ( importElement( message, *it, isSuccess, *myMiscellaneous, myHasMiscellaneous ) ) { continue; } - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Identification.h b/Sourcecode/private/mx/core/elements/Identification.h deleted file mode 100644 index 6eb32a800..000000000 --- a/Sourcecode/private/mx/core/elements/Identification.h +++ /dev/null @@ -1,94 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Creator ) - MX_FORWARD_DECLARE_ELEMENT( Encoding ) - MX_FORWARD_DECLARE_ELEMENT( Miscellaneous ) - MX_FORWARD_DECLARE_ELEMENT( Relation ) - MX_FORWARD_DECLARE_ELEMENT( Rights ) - MX_FORWARD_DECLARE_ELEMENT( Source ) - MX_FORWARD_DECLARE_ELEMENT( Identification ) - - inline IdentificationPtr makeIdentification() { return std::make_shared(); } - - class Identification : public ElementInterface - { - public: - Identification(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Creator minOccurs = 0, maxOccurs = unbounded _________ */ - const CreatorSet& getCreatorSet() const; - void addCreator( const CreatorPtr& value ); - void removeCreator( const CreatorSetIterConst& value ); - void clearCreatorSet(); - CreatorPtr getCreator( const CreatorSetIterConst& setIterator ) const; - - /* _________ Rights minOccurs = 0, maxOccurs = unbounded _________ */ - const RightsSet& getRightsSet() const; - void addRights( const RightsPtr& value ); - void removeRights( const RightsSetIterConst& value ); - void clearRightsSet(); - RightsPtr getRights( const RightsSetIterConst& setIterator ) const; - - /* _________ Encoding minOccurs = 0, maxOccurs = 1 _________ */ - EncodingPtr getEncoding() const; - void setEncoding( const EncodingPtr& value ); - bool getHasEncoding() const; - void setHasEncoding( const bool value ); - - /* _________ Source minOccurs = 0, maxOccurs = 1 _________ */ - SourcePtr getSource() const; - void setSource( const SourcePtr& value ); - bool getHasSource() const; - void setHasSource( const bool value ); - - /* _________ Relation minOccurs = 0, maxOccurs = unbounded _________ */ - const RelationSet& getRelationSet() const; - void addRelation( const RelationPtr& value ); - void removeRelation( const RelationSetIterConst& value ); - void clearRelationSet(); - RelationPtr getRelation( const RelationSetIterConst& setIterator ) const; - - /* _________ Miscellaneous minOccurs = 0, maxOccurs = 1 _________ */ - MiscellaneousPtr getMiscellaneous() const; - void setMiscellaneous( const MiscellaneousPtr& value ); - bool getHasMiscellaneous() const; - void setHasMiscellaneous( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - CreatorSet myCreatorSet; - RightsSet myRightsSet; - EncodingPtr myEncoding; - bool myHasEncoding; - SourcePtr mySource; - bool myHasSource; - RelationSet myRelationSet; - MiscellaneousPtr myMiscellaneous; - bool myHasMiscellaneous; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Image.cpp b/Sourcecode/private/mx/core/elements/Image.cpp deleted file mode 100644 index 6e5509c43..000000000 --- a/Sourcecode/private/mx/core/elements/Image.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Image.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Image::Image() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Image::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Image::hasContents() const { return false; } - std::ostream& Image::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Image::streamName( std::ostream& os ) const { os << "image"; return os; } - std::ostream& Image::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - ImageAttributesPtr Image::getAttributes() const - { - return myAttributes; - } - - - void Image::setAttributes( const ImageAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Image::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Image.h b/Sourcecode/private/mx/core/elements/Image.h deleted file mode 100644 index 10bbaaed7..000000000 --- a/Sourcecode/private/mx/core/elements/Image.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/ImageAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ImageAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Image ) - - inline ImagePtr makeImage() { return std::make_shared(); } - - class Image : public ElementInterface - { - public: - Image(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ImageAttributesPtr getAttributes() const; - void setAttributes( const ImageAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ImageAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ImageAttributes.cpp b/Sourcecode/private/mx/core/elements/ImageAttributes.cpp deleted file mode 100644 index 2172a66b2..000000000 --- a/Sourcecode/private/mx/core/elements/ImageAttributes.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ImageAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ImageAttributes::ImageAttributes() - :source() - ,type() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,halign( LeftCenterRight::center ) - ,hasSource( true ) - ,hasType( true ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasHalign( false ) - {} - - - bool ImageAttributes::hasValues() const - { - return hasSource || - hasType || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasHalign; - } - - - std::ostream& ImageAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, source, "source", hasSource ); - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; - } - - - bool ImageAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "ImageAttributes"; - bool isSuccess = true; - bool isSourceFound = false; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, source, isSourceFound, "source" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - if( !isSourceFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ImageAttributes.h b/Sourcecode/private/mx/core/elements/ImageAttributes.h deleted file mode 100644 index 1bd445c3d..000000000 --- a/Sourcecode/private/mx/core/elements/ImageAttributes.h +++ /dev/null @@ -1,50 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/XsAnyUri.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ImageAttributes ) - - struct ImageAttributes : public AttributesInterface - { - public: - ImageAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsAnyUri source; - XsToken type; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - LeftCenterRight halign; - const bool hasSource; - const bool hasType; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasHalign; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Instrument.cpp b/Sourcecode/private/mx/core/elements/Instrument.cpp deleted file mode 100644 index 63fc61005..000000000 --- a/Sourcecode/private/mx/core/elements/Instrument.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Instrument.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Instrument::Instrument() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Instrument::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Instrument::hasContents() const { return false; } - std::ostream& Instrument::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Instrument::streamName( std::ostream& os ) const { os << "instrument"; return os; } - std::ostream& Instrument::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - InstrumentAttributesPtr Instrument::getAttributes() const - { - return myAttributes; - } - - - void Instrument::setAttributes( const InstrumentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Instrument::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Instrument.h b/Sourcecode/private/mx/core/elements/Instrument.h deleted file mode 100644 index 069c9580b..000000000 --- a/Sourcecode/private/mx/core/elements/Instrument.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/InstrumentAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InstrumentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Instrument ) - - inline InstrumentPtr makeInstrument() { return std::make_shared(); } - - class Instrument : public ElementInterface - { - public: - Instrument(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - InstrumentAttributesPtr getAttributes() const; - void setAttributes( const InstrumentAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - InstrumentAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.cpp b/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.cpp deleted file mode 100644 index 1aebb7bf1..000000000 --- a/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/InstrumentAbbreviation.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - InstrumentAbbreviation::InstrumentAbbreviation() - :myValue() - {} - - - InstrumentAbbreviation::InstrumentAbbreviation( const XsString& value ) - :myValue( value ) - {} - - - bool InstrumentAbbreviation::hasAttributes() const - { - return false; - } - - - bool InstrumentAbbreviation::hasContents() const - { - return true; - } - - - std::ostream& InstrumentAbbreviation::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& InstrumentAbbreviation::streamName( std::ostream& os ) const - { - os << "instrument-abbreviation"; - return os; - } - - - std::ostream& InstrumentAbbreviation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString InstrumentAbbreviation::getValue() const - { - return myValue; - } - - - void InstrumentAbbreviation::setValue( const XsString& value ) - { - myValue = value; - } - - - bool InstrumentAbbreviation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.h b/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.h deleted file mode 100644 index e4165717b..000000000 --- a/Sourcecode/private/mx/core/elements/InstrumentAbbreviation.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( InstrumentAbbreviation ) - - inline InstrumentAbbreviationPtr makeInstrumentAbbreviation() { return std::make_shared(); } - inline InstrumentAbbreviationPtr makeInstrumentAbbreviation( const XsString& value ) { return std::make_shared( value ); } - inline InstrumentAbbreviationPtr makeInstrumentAbbreviation( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class InstrumentAbbreviation : public ElementInterface - { - public: - InstrumentAbbreviation(); - InstrumentAbbreviation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/InstrumentAttributes.cpp b/Sourcecode/private/mx/core/elements/InstrumentAttributes.cpp deleted file mode 100644 index 8d1d7d73f..000000000 --- a/Sourcecode/private/mx/core/elements/InstrumentAttributes.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/InstrumentAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - InstrumentAttributes::InstrumentAttributes() - :id() - ,hasId( true ) - {} - - - bool InstrumentAttributes::hasValues() const - { - return hasId; - } - - - std::ostream& InstrumentAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - } - return os; - } - - - bool InstrumentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "InstrumentAttributes"; - bool isSuccess = true; - bool isIdFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, isIdFound, "id" ) ) { continue; } - } - - if( !isIdFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/InstrumentAttributes.h b/Sourcecode/private/mx/core/elements/InstrumentAttributes.h deleted file mode 100644 index 5375b2b71..000000000 --- a/Sourcecode/private/mx/core/elements/InstrumentAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/XsIDREF.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InstrumentAttributes ) - - struct InstrumentAttributes : public AttributesInterface - { - public: - InstrumentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsIDREF id; - const bool hasId; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/InstrumentName.cpp b/Sourcecode/private/mx/core/elements/InstrumentName.cpp deleted file mode 100644 index 5c1e0d7a3..000000000 --- a/Sourcecode/private/mx/core/elements/InstrumentName.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/InstrumentName.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - InstrumentName::InstrumentName() - :myValue() - {} - - - InstrumentName::InstrumentName( const XsString& value ) - :myValue( value ) - {} - - - bool InstrumentName::hasAttributes() const - { - return false; - } - - - bool InstrumentName::hasContents() const - { - return true; - } - - - std::ostream& InstrumentName::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& InstrumentName::streamName( std::ostream& os ) const - { - os << "instrument-name"; - return os; - } - - - std::ostream& InstrumentName::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString InstrumentName::getValue() const - { - return myValue; - } - - - void InstrumentName::setValue( const XsString& value ) - { - myValue = value; - } - - - bool InstrumentName::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/InstrumentName.h b/Sourcecode/private/mx/core/elements/InstrumentName.h deleted file mode 100644 index 4a0ec56b4..000000000 --- a/Sourcecode/private/mx/core/elements/InstrumentName.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( InstrumentName ) - - inline InstrumentNamePtr makeInstrumentName() { return std::make_shared(); } - inline InstrumentNamePtr makeInstrumentName( const XsString& value ) { return std::make_shared( value ); } - inline InstrumentNamePtr makeInstrumentName( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class InstrumentName : public ElementInterface - { - public: - InstrumentName(); - InstrumentName( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/InstrumentSound.cpp b/Sourcecode/private/mx/core/elements/InstrumentSound.cpp deleted file mode 100644 index 09c2d4c79..000000000 --- a/Sourcecode/private/mx/core/elements/InstrumentSound.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/InstrumentSound.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - InstrumentSound::InstrumentSound() - :myValue( PlaybackSound::keyboardPiano ) - {} - - - InstrumentSound::InstrumentSound( const PlaybackSound& value ) - :myValue( value ) - {} - - - bool InstrumentSound::hasAttributes() const - { - return false; - } - - - bool InstrumentSound::hasContents() const - { - return true; - } - - - std::ostream& InstrumentSound::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& InstrumentSound::streamName( std::ostream& os ) const - { - os << "instrument-sound"; - return os; - } - - - std::ostream& InstrumentSound::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << PlaybackSoundToString( myValue ); - return os; - } - - - PlaybackSound InstrumentSound::getValue() const - { - return myValue; - } - - - void InstrumentSound::setValue( const PlaybackSound& value ) - { - myValue = value; - } - - - bool InstrumentSound::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = ( PlaybackSoundFromString( xelement.getValue() ) ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/InstrumentSound.h b/Sourcecode/private/mx/core/elements/InstrumentSound.h deleted file mode 100644 index e0077b8d4..000000000 --- a/Sourcecode/private/mx/core/elements/InstrumentSound.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/ForwardDeclare.h" -#include "mx/core/PlaybackSound.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( InstrumentSound ) - - inline InstrumentSoundPtr makeInstrumentSound() { return std::make_shared(); } - inline InstrumentSoundPtr makeInstrumentSound( PlaybackSound value ) { return std::make_shared( value ); } - - class InstrumentSound : public ElementInterface - { - public: - InstrumentSound(); - InstrumentSound( const PlaybackSound& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PlaybackSound getValue() const; - void setValue( const PlaybackSound& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PlaybackSound myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Instruments.cpp b/Sourcecode/private/mx/core/elements/Instruments.cpp deleted file mode 100644 index 0c4bcee4b..000000000 --- a/Sourcecode/private/mx/core/elements/Instruments.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Instruments.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Instruments::Instruments() - :myValue() - {} - - - Instruments::Instruments( const NonNegativeInteger& value ) - :myValue( value ) - {} - - - bool Instruments::hasAttributes() const - { - return false; - } - - - bool Instruments::hasContents() const - { - return true; - } - - - std::ostream& Instruments::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Instruments::streamName( std::ostream& os ) const - { - os << "instruments"; - return os; - } - - - std::ostream& Instruments::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NonNegativeInteger Instruments::getValue() const - { - return myValue; - } - - - void Instruments::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } - - - bool Instruments::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Instruments.h b/Sourcecode/private/mx/core/elements/Instruments.h deleted file mode 100644 index b10754c19..000000000 --- a/Sourcecode/private/mx/core/elements/Instruments.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Instruments ) - - inline InstrumentsPtr makeInstruments() { return std::make_shared(); } - inline InstrumentsPtr makeInstruments( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline InstrumentsPtr makeInstruments( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class Instruments : public ElementInterface - { - public: - Instruments(); - Instruments( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Interchangeable.cpp b/Sourcecode/private/mx/core/elements/Interchangeable.cpp deleted file mode 100644 index 14fd40be9..000000000 --- a/Sourcecode/private/mx/core/elements/Interchangeable.cpp +++ /dev/null @@ -1,168 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Interchangeable.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/BeatType.h" -#include "mx/core/elements/Beats.h" -#include "mx/core/elements/TimeRelation.h" -#include - -namespace mx -{ - namespace core - { - Interchangeable::Interchangeable() - :myAttributes( std::make_shared() ) - ,myTimeRelation( makeTimeRelation() ) - ,myHasTimeRelation( false ) - ,myBeats( makeBeats() ) - ,myBeatType( makeBeatType() ) - {} - - - bool Interchangeable::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Interchangeable::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Interchangeable::streamName( std::ostream& os ) const - { - os << "interchangeable"; - return os; - } - - - bool Interchangeable::hasContents() const - { - return true; - } - - - std::ostream& Interchangeable::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - if( myHasTimeRelation ) - { - os << std::endl; - myTimeRelation->toStream( os, indentLevel+1 ); - } - os << std::endl; - myBeats->toStream( os, indentLevel+1 ); - os << std::endl; - myBeatType->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } - - - InterchangeableAttributesPtr Interchangeable::getAttributes() const - { - return myAttributes; - } - - - void Interchangeable::setAttributes( const InterchangeableAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - TimeRelationPtr Interchangeable::getTimeRelation() const - { - return myTimeRelation; - } - - - void Interchangeable::setTimeRelation( const TimeRelationPtr& value ) - { - if( value ) - { - myTimeRelation = value; - } - } - - - bool Interchangeable::getHasTimeRelation() const - { - return myHasTimeRelation; - } - - - void Interchangeable::setHasTimeRelation( const bool value ) - { - myHasTimeRelation = value; - } - - - BeatsPtr Interchangeable::getBeats() const - { - return myBeats; - } - - - void Interchangeable::setBeats( const BeatsPtr& value ) - { - if( value ) - { - myBeats = value; - } - } - - - BeatTypePtr Interchangeable::getBeatType() const - { - return myBeatType; - } - - - void Interchangeable::setBeatType( const BeatTypePtr& value ) - { - if( value ) - { - myBeatType = value; - } - } - - - bool Interchangeable::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isBeatsFound = false; - bool isBeatTypeFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myTimeRelation, myHasTimeRelation ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myBeats, isBeatsFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myBeatType, isBeatTypeFound ) ) { continue; } - } - - if( !isBeatsFound ) - { - message << "Interchangeable: '" << myBeats->getElementName() << "' is required but was not found" << std::endl; - } - - if( !isBeatTypeFound ) - { - message << "Interchangeable: '" << myBeatType->getElementName() << "' is required but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Interchangeable.h b/Sourcecode/private/mx/core/elements/Interchangeable.h deleted file mode 100644 index bb4ebd850..000000000 --- a/Sourcecode/private/mx/core/elements/Interchangeable.h +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/InterchangeableAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InterchangeableAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BeatType ) - MX_FORWARD_DECLARE_ELEMENT( Beats ) - MX_FORWARD_DECLARE_ELEMENT( TimeRelation ) - MX_FORWARD_DECLARE_ELEMENT( Interchangeable ) - - inline InterchangeablePtr makeInterchangeable() { return std::make_shared(); } - - class Interchangeable : public ElementInterface - { - public: - Interchangeable(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - InterchangeableAttributesPtr getAttributes() const; - void setAttributes( const InterchangeableAttributesPtr& value ); - - /* _________ TimeRelation minOccurs = 0, maxOccurs = 1 _________ */ - TimeRelationPtr getTimeRelation() const; - void setTimeRelation( const TimeRelationPtr& value ); - bool getHasTimeRelation() const; - void setHasTimeRelation( const bool value ); - - /* _________ Beats minOccurs = 1, maxOccurs = 1 _________ */ - BeatsPtr getBeats() const; - void setBeats( const BeatsPtr& value ); - - /* _________ BeatType minOccurs = 1, maxOccurs = 1 _________ */ - BeatTypePtr getBeatType() const; - void setBeatType( const BeatTypePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - InterchangeableAttributesPtr myAttributes; - TimeRelationPtr myTimeRelation; - bool myHasTimeRelation; - BeatsPtr myBeats; - BeatTypePtr myBeatType; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/InterchangeableAttributes.cpp b/Sourcecode/private/mx/core/elements/InterchangeableAttributes.cpp deleted file mode 100644 index f1751f632..000000000 --- a/Sourcecode/private/mx/core/elements/InterchangeableAttributes.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/InterchangeableAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - InterchangeableAttributes::InterchangeableAttributes() - :symbol() - ,separator() - ,hasSymbol( false ) - ,hasSeparator( false ) - {} - - - bool InterchangeableAttributes::hasValues() const - { - return hasSymbol || - hasSeparator; - } - - - std::ostream& InterchangeableAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, symbol, "symbol", hasSymbol ); - streamAttribute( os, separator, "separator", hasSeparator ); - } - return os; - } - - - bool InterchangeableAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "InterchangeableAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, symbol, hasSymbol, "symbol", &parseTimeSymbol ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, separator, hasSeparator, "separator", &parseTimeSeparator ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/InterchangeableAttributes.h b/Sourcecode/private/mx/core/elements/InterchangeableAttributes.h deleted file mode 100644 index da1d19fb8..000000000 --- a/Sourcecode/private/mx/core/elements/InterchangeableAttributes.h +++ /dev/null @@ -1,37 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InterchangeableAttributes ) - - struct InterchangeableAttributes : public AttributesInterface - { - public: - InterchangeableAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TimeSymbol symbol; - TimeSeparator separator; - bool hasSymbol; - bool hasSeparator; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Inversion.cpp b/Sourcecode/private/mx/core/elements/Inversion.cpp deleted file mode 100644 index ade20e040..000000000 --- a/Sourcecode/private/mx/core/elements/Inversion.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Inversion.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Inversion::Inversion() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Inversion::Inversion( const NonNegativeInteger& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Inversion::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Inversion::hasContents() const - { - return true; - } - - - std::ostream& Inversion::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Inversion::streamName( std::ostream& os ) const - { - os << "inversion"; - return os; - } - - - std::ostream& Inversion::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - InversionAttributesPtr Inversion::getAttributes() const - { - return myAttributes; - } - - - void Inversion::setAttributes( const InversionAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - NonNegativeInteger Inversion::getValue() const - { - return myValue; - } - - - void Inversion::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } - - - bool Inversion::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Inversion.h b/Sourcecode/private/mx/core/elements/Inversion.h deleted file mode 100644 index 6c9529f68..000000000 --- a/Sourcecode/private/mx/core/elements/Inversion.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" -#include "mx/core/elements/InversionAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InversionAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Inversion ) - - inline InversionPtr makeInversion() { return std::make_shared(); } - inline InversionPtr makeInversion( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline InversionPtr makeInversion( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class Inversion : public ElementInterface - { - public: - Inversion(); - Inversion( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - InversionAttributesPtr getAttributes() const; - void setAttributes( const InversionAttributesPtr& attributes ); - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - InversionAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/InversionAttributes.cpp b/Sourcecode/private/mx/core/elements/InversionAttributes.cpp deleted file mode 100644 index e7fc0b429..000000000 --- a/Sourcecode/private/mx/core/elements/InversionAttributes.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/InversionAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - InversionAttributes::InversionAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool InversionAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& InversionAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool InversionAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "InversionAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/InversionAttributes.h b/Sourcecode/private/mx/core/elements/InversionAttributes.h deleted file mode 100644 index 07fa315cc..000000000 --- a/Sourcecode/private/mx/core/elements/InversionAttributes.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InversionAttributes ) - - struct InversionAttributes : public AttributesInterface - { - public: - InversionAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/InvertedMordent.cpp b/Sourcecode/private/mx/core/elements/InvertedMordent.cpp deleted file mode 100644 index 23c373841..000000000 --- a/Sourcecode/private/mx/core/elements/InvertedMordent.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/InvertedMordent.h" -#include - -namespace mx -{ - namespace core - { - InvertedMordent::InvertedMordent() - :myAttributes( std::make_shared() ) - {} - - - bool InvertedMordent::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& InvertedMordent::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& InvertedMordent::streamName( std::ostream& os ) const - { - os << "inverted-mordent"; - return os; - } - - - bool InvertedMordent::hasContents() const - { - return false; - } - - - std::ostream& InvertedMordent::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - InvertedMordentAttributesPtr InvertedMordent::getAttributes() const - { - return myAttributes; - } - - - void InvertedMordent::setAttributes( const InvertedMordentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool InvertedMordent::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/InvertedMordent.h b/Sourcecode/private/mx/core/elements/InvertedMordent.h deleted file mode 100644 index 7c2d040fb..000000000 --- a/Sourcecode/private/mx/core/elements/InvertedMordent.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/InvertedMordentAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InvertedMordentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( InvertedMordent ) - - inline InvertedMordentPtr makeInvertedMordent() { return std::make_shared(); } - - class InvertedMordent : public ElementInterface - { - public: - InvertedMordent(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - InvertedMordentAttributesPtr getAttributes() const; - void setAttributes( const InvertedMordentAttributesPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - InvertedMordentAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.cpp b/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.cpp deleted file mode 100644 index 4b0c42a8d..000000000 --- a/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.cpp +++ /dev/null @@ -1,149 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/InvertedMordentAttributes.h" -#include "mx/core/FromXElement.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - InvertedMordentAttributes::InvertedMordentAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,startNote( StartNote::main ) - ,trillStep( TrillStep::half ) - ,twoNoteTurn( TwoNoteTurn::none ) - ,accelerate( YesNo::no ) - ,beats() - ,secondBeat() - ,lastBeat() - ,long_( YesNo::no ) - ,approach( AboveBelow::below ) - ,departure( AboveBelow::below ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - ,hasStartNote( false ) - ,hasTrillStep( false ) - ,hasTwoNoteTurn( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasSecondBeat( false ) - ,hasLastBeat( false ) - ,hasLong( false ) - ,hasApproach( false ) - ,hasDeparture( false ) - {} - - - bool InvertedMordentAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement || - hasStartNote || - hasTrillStep || - hasTwoNoteTurn || - hasAccelerate || - hasBeats || - hasSecondBeat || - hasLastBeat || - hasLong || - hasApproach || - hasDeparture; - } - - - std::ostream& InvertedMordentAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, startNote, "start-note", hasStartNote ); - streamAttribute( os, trillStep, "trill-step", hasTrillStep ); - streamAttribute( os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, secondBeat, "second-beat", hasSecondBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - streamAttribute( os, long_, "long", hasLong ); - streamAttribute( os, approach, "approach", hasApproach ); - streamAttribute( os, departure, "departure", hasDeparture ); - } - return os; - } - - - bool InvertedMordentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "InvertedMordentAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", &parseTwoNoteTurn ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, long_, hasLong , "long", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, approach, hasApproach, "approach", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, departure, hasDeparture, "departure", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.h b/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.h deleted file mode 100644 index fb22a775b..000000000 --- a/Sourcecode/private/mx/core/elements/InvertedMordentAttributes.h +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InvertedMordentAttributes ) - - struct InvertedMordentAttributes : public AttributesInterface - { - public: - InvertedMordentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - StartNote startNote; - TrillStep trillStep; - TwoNoteTurn twoNoteTurn; - YesNo accelerate; - TrillBeats beats; - Percent secondBeat; - Percent lastBeat; - YesNo long_; - AboveBelow approach; - AboveBelow departure; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - bool hasStartNote; - bool hasTrillStep; - bool hasTwoNoteTurn; - bool hasAccelerate; - bool hasBeats; - bool hasSecondBeat; - bool hasLastBeat; - bool hasLong; - bool hasApproach; - bool hasDeparture; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/InvertedTurn.cpp b/Sourcecode/private/mx/core/elements/InvertedTurn.cpp deleted file mode 100644 index b99ed7031..000000000 --- a/Sourcecode/private/mx/core/elements/InvertedTurn.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/InvertedTurn.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - InvertedTurn::InvertedTurn() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool InvertedTurn::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool InvertedTurn::hasContents() const { return false; } - std::ostream& InvertedTurn::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& InvertedTurn::streamName( std::ostream& os ) const { os << "inverted-turn"; return os; } - std::ostream& InvertedTurn::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - InvertedTurnAttributesPtr InvertedTurn::getAttributes() const - { - return myAttributes; - } - - - void InvertedTurn::setAttributes( const InvertedTurnAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool InvertedTurn::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/InvertedTurn.h b/Sourcecode/private/mx/core/elements/InvertedTurn.h deleted file mode 100644 index 50ce5733c..000000000 --- a/Sourcecode/private/mx/core/elements/InvertedTurn.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/InvertedTurnAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InvertedTurnAttributes ) - MX_FORWARD_DECLARE_ELEMENT( InvertedTurn ) - - inline InvertedTurnPtr makeInvertedTurn() { return std::make_shared(); } - - class InvertedTurn : public ElementInterface - { - public: - InvertedTurn(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - InvertedTurnAttributesPtr getAttributes() const; - void setAttributes( const InvertedTurnAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - InvertedTurnAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.cpp b/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.cpp deleted file mode 100644 index fd3a96718..000000000 --- a/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/InvertedTurnAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - InvertedTurnAttributes::InvertedTurnAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,placement( AboveBelow::below ) - ,startNote( StartNote::main ) - ,trillStep() - ,twoNoteTurn( TwoNoteTurn::none ) - ,accelerate( YesNo::no ) - ,beats() - ,secondBeat() - ,lastBeat() - ,slash( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - ,hasStartNote( false ) - ,hasTrillStep( false ) - ,hasTwoNoteTurn( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasSecondBeat( false ) - ,hasLastBeat( false ) - ,hasSlash( false ) - {} - - - bool InvertedTurnAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement || - hasStartNote || - hasTrillStep || - hasTwoNoteTurn || - hasAccelerate || - hasBeats || - hasSecondBeat || - hasLastBeat || - hasSlash; - } - - - std::ostream& InvertedTurnAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, startNote, "start-note", hasStartNote ); - streamAttribute( os, trillStep, "trill-step", hasTrillStep ); - streamAttribute( os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, secondBeat, "second-beat", hasSecondBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - streamAttribute( os, slash, "slash", hasSlash ); - } - return os; - } - - - bool InvertedTurnAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "InvertedTurnAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", &parseTwoNoteTurn ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, slash, hasSlash, "slash", &parseYesNo ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.h b/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.h deleted file mode 100644 index 1a7c39bea..000000000 --- a/Sourcecode/private/mx/core/elements/InvertedTurnAttributes.h +++ /dev/null @@ -1,70 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( InvertedTurnAttributes ) - - struct InvertedTurnAttributes : public AttributesInterface - { - public: - InvertedTurnAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - StartNote startNote; - TrillStep trillStep; - TwoNoteTurn twoNoteTurn; - YesNo accelerate; - TrillBeats beats; - Percent secondBeat; - Percent lastBeat; - YesNo slash; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - bool hasStartNote; - bool hasTrillStep; - bool hasTwoNoteTurn; - bool hasAccelerate; - bool hasBeats; - bool hasSecondBeat; - bool hasLastBeat; - bool hasSlash; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Ipa.cpp b/Sourcecode/private/mx/core/elements/Ipa.cpp deleted file mode 100644 index e2cf083dc..000000000 --- a/Sourcecode/private/mx/core/elements/Ipa.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Ipa.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Ipa::Ipa() - :myValue() - {} - - - Ipa::Ipa( const XsString& value ) - :myValue( value ) - {} - - - bool Ipa::hasAttributes() const - { - return false; - } - - - bool Ipa::hasContents() const - { - return true; - } - - - std::ostream& Ipa::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Ipa::streamName( std::ostream& os ) const - { - os << "ipa"; - return os; - } - - - std::ostream& Ipa::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString Ipa::getValue() const - { - return myValue; - } - - - void Ipa::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Ipa::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Ipa.h b/Sourcecode/private/mx/core/elements/Ipa.h deleted file mode 100644 index 4c2c8917a..000000000 --- a/Sourcecode/private/mx/core/elements/Ipa.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Ipa ) - - inline IpaPtr makeIpa() { return std::make_shared(); } - inline IpaPtr makeIpa( const XsString& value ) { return std::make_shared( value ); } - inline IpaPtr makeIpa( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Ipa : public ElementInterface - { - public: - Ipa(); - Ipa( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Key.cpp b/Sourcecode/private/mx/core/elements/Key.cpp deleted file mode 100644 index 32477351a..000000000 --- a/Sourcecode/private/mx/core/elements/Key.cpp +++ /dev/null @@ -1,281 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Key.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/KeyChoice.h" -#include "mx/core/elements/KeyOctave.h" -#include "mx/core/elements/TraditionalKey.h" -#include "mx/core/elements/NonTraditionalKey.h" -#include "mx/core/elements/Cancel.h" -#include "mx/core/elements/Mode.h" -#include "mx/core/elements/Fifths.h" -#include "mx/core/elements/KeyAccidental.h" -#include "mx/core/elements/KeyAlter.h" -#include "mx/core/elements/KeyStep.h" -#include - -namespace mx -{ - namespace core - { - Key::Key() - :myAttributes( std::make_shared() ) - ,myKeyChoice( std::make_shared() ) - ,myKeyOctaveSet() - {} - - - bool Key::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Key::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Key::streamName( std::ostream& os ) const - { - os << "key"; - return os; - } - - - bool Key::hasContents() const - { - return myKeyChoice->hasContents() || myKeyOctaveSet.size() > 0; - } - - - std::ostream& Key::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myKeyChoice->hasContents() ) - { - os << std::endl; - if ( myKeyChoice ) - { - myKeyChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - } - for ( auto it = myKeyOctaveSet.cbegin(); - it != myKeyOctaveSet.cend(); - ++it ) - { - if ( it == myKeyOctaveSet.cbegin() ) - { - os << std::endl; - } - (*it)->toStream( os, indentLevel+1 ); - os << std::endl; - } - if ( myKeyChoice->hasContents() ) - { - isOneLineOnly = false; - } - if ( myKeyOctaveSet.size() > 0 ) - { - isOneLineOnly = false; - } - return os; - } - - - KeyAttributesPtr Key::getAttributes() const - { - return myAttributes; - } - - - void Key::setAttributes( const KeyAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - KeyChoicePtr Key::getKeyChoice() const - { - return myKeyChoice; - } - - - void Key::setKeyChoice( const KeyChoicePtr& value ) - { - if ( value ) - { - myKeyChoice = value; - } - } - - - const KeyOctaveSet& Key::getKeyOctaveSet() const - { - return myKeyOctaveSet; - } - - - void Key::removeKeyOctave( const KeyOctaveSetIterConst& value ) - { - if ( value != myKeyOctaveSet.cend() ) - { - myKeyOctaveSet.erase( value ); - } - } - - - void Key::addKeyOctave( const KeyOctavePtr& value ) - { - if ( value ) - { - myKeyOctaveSet.push_back( value ); - } - } - - - void Key::clearKeyOctaveSet() - { - myKeyOctaveSet.clear(); - } - - - bool Key::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importTraditionalKey( message, it, endIter, isSuccess ) ) { continue; } - if ( importNonTraditionalKey( message, it, endIter, isSuccess ) ) { continue; } - if ( importElementSet( message, it, endIter, isSuccess, "key-octave", myKeyOctaveSet ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - - bool Key::importTraditionalKey( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess ) - { - if( iter == endIter ) - { - return false; - } - - if( iter->getName() != "cancel" && iter->getName() != "fifths" && iter->getName() != "mode" ) - { - return false; - } - - bool isIterIncremented = false; - - if( iter != endIter && iter->getName() == "cancel" ) - { - myKeyChoice->setChoice( KeyChoice::Choice::traditionalKey ); - myKeyChoice->getTraditionalKey()->setHasCancel( true ); - isSuccess &= myKeyChoice->getTraditionalKey()->getCancel()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( iter != endIter && iter->getName() == "fifths" ) - { - myKeyChoice->setChoice( KeyChoice::Choice::traditionalKey ); - isSuccess &= myKeyChoice->getTraditionalKey()->getFifths()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( iter != endIter && iter->getName() == "mode" ) - { - myKeyChoice->setChoice( KeyChoice::Choice::traditionalKey ); - myKeyChoice->getTraditionalKey()->setHasMode( true ); - isSuccess &= myKeyChoice->getTraditionalKey()->getMode()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( isIterIncremented ) - { - --iter; - } - - return true; - } - - - bool Key::importNonTraditionalKey( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess ) - { - if( iter == endIter ) - { - return false; - } - - if( iter->getName() != "key-step" && iter->getName() != "key-alter" && iter->getName() != "key-accidental" ) - { - return false; - } - - bool isIterIncremented = false; - bool isFirstItemAdded = false; - - while ( iter != endIter && ( iter->getName() == "key-step" || iter->getName() == "key-alter" || iter->getName() == "key-accidental" ) ) - { - auto item = makeNonTraditionalKey(); - const auto& items = myKeyChoice->getNonTraditionalKeySet(); - myKeyChoice->setChoice( KeyChoice::Choice::nonTraditionalKey ); - - if( iter != endIter && iter->getName() == "key-step" ) - { - isSuccess &= item->getKeyStep()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( iter != endIter && iter->getName() == "key-alter" ) - { - isSuccess &= item->getKeyAlter()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( iter != endIter && iter->getName() == "key-accidental" ) - { - item->setHasKeyAccidental( true ); - isSuccess &= item->getKeyAccidental()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - - if( !isFirstItemAdded && items.size() == 1 ) - { - myKeyChoice->addNonTraditionalKey( item ); - myKeyChoice->removeNonTraditionalKey( items.cbegin() ); - isFirstItemAdded = true; - } - else - { - myKeyChoice->addNonTraditionalKey( item ); - isFirstItemAdded = true; - } - } - - if( isIterIncremented ) - { - --iter; - } - - return true; - } - - - } -} diff --git a/Sourcecode/private/mx/core/elements/Key.h b/Sourcecode/private/mx/core/elements/Key.h deleted file mode 100644 index 47214a002..000000000 --- a/Sourcecode/private/mx/core/elements/Key.h +++ /dev/null @@ -1,63 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/KeyAttributes.h" - -#include -#include -#include - -namespace ezxml -{ - class XElementIterator; -} - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( KeyAttributes ) - MX_FORWARD_DECLARE_ELEMENT( KeyChoice ) - MX_FORWARD_DECLARE_ELEMENT( KeyOctave ) - MX_FORWARD_DECLARE_ELEMENT( Key ) - - inline KeyPtr makeKey() { return std::make_shared(); } - - class Key : public ElementInterface - { - public: - Key(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - KeyAttributesPtr getAttributes() const; - void setAttributes( const KeyAttributesPtr& value ); - KeyChoicePtr getKeyChoice() const; - void setKeyChoice( const KeyChoicePtr& value ); - const KeyOctaveSet& getKeyOctaveSet() const; - void removeKeyOctave( const KeyOctaveSetIterConst& value ); - void addKeyOctave( const KeyOctavePtr& value ); - void clearKeyOctaveSet(); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - KeyAttributesPtr myAttributes; - KeyChoicePtr myKeyChoice; - KeyOctaveSet myKeyOctaveSet; - - bool importTraditionalKey( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess ); - bool importNonTraditionalKey( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyAccidental.cpp b/Sourcecode/private/mx/core/elements/KeyAccidental.cpp deleted file mode 100644 index a5d545c0a..000000000 --- a/Sourcecode/private/mx/core/elements/KeyAccidental.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/KeyAccidental.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - KeyAccidental::KeyAccidental() - :myValue( AccidentalValue::natural ) - {} - - - KeyAccidental::KeyAccidental( const AccidentalValue& value ) - :myValue( value ) - {} - - - bool KeyAccidental::hasAttributes() const - { - return false; - } - - - bool KeyAccidental::hasContents() const - { - return true; - } - - - std::ostream& KeyAccidental::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& KeyAccidental::streamName( std::ostream& os ) const - { - os << "key-accidental"; - return os; - } - - - std::ostream& KeyAccidental::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - AccidentalValue KeyAccidental::getValue() const - { - return myValue; - } - - - void KeyAccidental::setValue( const AccidentalValue& value ) - { - myValue = value; - } - - - bool KeyAccidental::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseAccidentalValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyAccidental.h b/Sourcecode/private/mx/core/elements/KeyAccidental.h deleted file mode 100644 index 0aa01193d..000000000 --- a/Sourcecode/private/mx/core/elements/KeyAccidental.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( KeyAccidental ) - - inline KeyAccidentalPtr makeKeyAccidental() { return std::make_shared(); } - inline KeyAccidentalPtr makeKeyAccidental( const AccidentalValue& value ) { return std::make_shared( value ); } - inline KeyAccidentalPtr makeKeyAccidental( AccidentalValue&& value ) { return std::make_shared( std::move( value ) ); } - - class KeyAccidental : public ElementInterface - { - public: - KeyAccidental(); - KeyAccidental( const AccidentalValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - AccidentalValue getValue() const; - void setValue( const AccidentalValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccidentalValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyAlter.cpp b/Sourcecode/private/mx/core/elements/KeyAlter.cpp deleted file mode 100644 index a412f0e0f..000000000 --- a/Sourcecode/private/mx/core/elements/KeyAlter.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/KeyAlter.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - KeyAlter::KeyAlter() - :myValue() - {} - - - KeyAlter::KeyAlter( const Semitones& value ) - :myValue( value ) - {} - - - bool KeyAlter::hasAttributes() const - { - return false; - } - - - bool KeyAlter::hasContents() const - { - return true; - } - - - std::ostream& KeyAlter::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& KeyAlter::streamName( std::ostream& os ) const - { - os << "key-alter"; - return os; - } - - - std::ostream& KeyAlter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Semitones KeyAlter::getValue() const - { - return myValue; - } - - - void KeyAlter::setValue( const Semitones& value ) - { - myValue = value; - } - - - bool KeyAlter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyAlter.h b/Sourcecode/private/mx/core/elements/KeyAlter.h deleted file mode 100644 index bd0ca5861..000000000 --- a/Sourcecode/private/mx/core/elements/KeyAlter.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( KeyAlter ) - - inline KeyAlterPtr makeKeyAlter() { return std::make_shared(); } - inline KeyAlterPtr makeKeyAlter( const Semitones& value ) { return std::make_shared( value ); } - inline KeyAlterPtr makeKeyAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class KeyAlter : public ElementInterface - { - public: - KeyAlter(); - KeyAlter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyAttributes.cpp b/Sourcecode/private/mx/core/elements/KeyAttributes.cpp deleted file mode 100644 index e67364904..000000000 --- a/Sourcecode/private/mx/core/elements/KeyAttributes.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/KeyAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - KeyAttributes::KeyAttributes() - :number() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,printObject( YesNo::no ) - ,hasNumber( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPrintObject( false ) - { - - } - - - bool KeyAttributes::hasValues() const - { - return hasNumber || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPrintObject; - } - - - std::ostream& KeyAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } - - - bool KeyAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "KeyAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyAttributes.h b/Sourcecode/private/mx/core/elements/KeyAttributes.h deleted file mode 100644 index 36090dfd8..000000000 --- a/Sourcecode/private/mx/core/elements/KeyAttributes.h +++ /dev/null @@ -1,60 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( KeyAttributes ) - - struct KeyAttributes : public AttributesInterface - { - public: - KeyAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffNumber number; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - YesNo printObject; - bool hasNumber; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPrintObject; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyChoice.cpp b/Sourcecode/private/mx/core/elements/KeyChoice.cpp deleted file mode 100644 index 9140c3b5a..000000000 --- a/Sourcecode/private/mx/core/elements/KeyChoice.cpp +++ /dev/null @@ -1,136 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/KeyChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/NonTraditionalKey.h" -#include "mx/core/elements/TraditionalKey.h" -#include - -namespace mx -{ - namespace core - { - KeyChoice::KeyChoice() - :myChoice( Choice::traditionalKey ) - ,myTraditionalKey( std::make_shared() ) - ,myNonTraditionalKeySet() - {} - - - bool KeyChoice::hasAttributes() const - { - return false; - } - - - std::ostream& KeyChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& KeyChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool KeyChoice::hasContents() const - { - return true; - } - - - std::ostream& KeyChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myChoice == Choice::traditionalKey ) - { - if ( myTraditionalKey ) - { - myTraditionalKey->streamContents( os, indentLevel, isOneLineOnly ); - } - } - else if ( myChoice == Choice::nonTraditionalKey ) - { - for ( auto it = myNonTraditionalKeySet.cbegin(); - it != myNonTraditionalKeySet.cend(); - ++it ) - { - if ( it != myNonTraditionalKeySet.cbegin() ) - { - os << std::endl; - } - (*it)->streamContents( os, indentLevel, isOneLineOnly ); - } - if ( myNonTraditionalKeySet.size() > 1 ) - { - isOneLineOnly = false; - } - } - return os; - } - - - KeyChoice::Choice KeyChoice::getChoice() const - { - return myChoice; - } - - - void KeyChoice::setChoice( const Choice value ) - { - myChoice = value; - } - - - TraditionalKeyPtr KeyChoice::getTraditionalKey() const - { - return myTraditionalKey; - } - - - void KeyChoice::setTraditionalKey( const TraditionalKeyPtr& value ) - { - if ( value ) - { - myTraditionalKey = value; - } - } - - - const NonTraditionalKeySet& KeyChoice::getNonTraditionalKeySet() const - { - return myNonTraditionalKeySet; - } - - - void KeyChoice::removeNonTraditionalKey( const NonTraditionalKeySetIterConst& value ) - { - if ( value != myNonTraditionalKeySet.cend() ) - { - myNonTraditionalKeySet.erase( value ); - } - } - - - void KeyChoice::addNonTraditionalKey( const NonTraditionalKeyPtr& value ) - { - if ( value ) - { - myNonTraditionalKeySet.push_back( value ); - } - } - - - void KeyChoice::clearNonTraditionalKeySet() - { - myNonTraditionalKeySet.clear(); - } - - - MX_FROM_XELEMENT_UNUSED( KeyChoice ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyChoice.h b/Sourcecode/private/mx/core/elements/KeyChoice.h deleted file mode 100644 index 0ce010091..000000000 --- a/Sourcecode/private/mx/core/elements/KeyChoice.h +++ /dev/null @@ -1,60 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( NonTraditionalKey ) - MX_FORWARD_DECLARE_ELEMENT( TraditionalKey ) - MX_FORWARD_DECLARE_ELEMENT( KeyChoice ) - - inline KeyChoicePtr makeKeyChoice() { return std::make_shared(); } - - class KeyChoice : public ElementInterface - { - public: - enum class Choice - { - traditionalKey = 0, - nonTraditionalKey = 1 - }; - KeyChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Choice getChoice() const; - void setChoice( const Choice value ); - TraditionalKeyPtr getTraditionalKey() const; - void setTraditionalKey( const TraditionalKeyPtr& value ); - - const NonTraditionalKeySet& getNonTraditionalKeySet() const; - void removeNonTraditionalKey( const NonTraditionalKeySetIterConst& value ); - void addNonTraditionalKey( const NonTraditionalKeyPtr& value ); - void clearNonTraditionalKeySet(); - - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - TraditionalKeyPtr myTraditionalKey; - NonTraditionalKeySet myNonTraditionalKeySet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyOctave.cpp b/Sourcecode/private/mx/core/elements/KeyOctave.cpp deleted file mode 100644 index afe7f2219..000000000 --- a/Sourcecode/private/mx/core/elements/KeyOctave.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/KeyOctave.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - KeyOctave::KeyOctave() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - KeyOctave::KeyOctave( const OctaveValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool KeyOctave::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool KeyOctave::hasContents() const - { - return true; - } - - - std::ostream& KeyOctave::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& KeyOctave::streamName( std::ostream& os ) const - { - os << "key-octave"; - return os; - } - - - std::ostream& KeyOctave::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - KeyOctaveAttributesPtr KeyOctave::getAttributes() const - { - return myAttributes; - } - - - void KeyOctave::setAttributes( const KeyOctaveAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - OctaveValue KeyOctave::getValue() const - { - return myValue; - } - - - void KeyOctave::setValue( const OctaveValue& value ) - { - myValue = value; - } - - - bool KeyOctave::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyOctave.h b/Sourcecode/private/mx/core/elements/KeyOctave.h deleted file mode 100644 index 02a09b63a..000000000 --- a/Sourcecode/private/mx/core/elements/KeyOctave.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" -#include "mx/core/elements/KeyOctaveAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( KeyOctaveAttributes ) - MX_FORWARD_DECLARE_ELEMENT( KeyOctave ) - - inline KeyOctavePtr makeKeyOctave() { return std::make_shared(); } - inline KeyOctavePtr makeKeyOctave( const OctaveValue& value ) { return std::make_shared( value ); } - inline KeyOctavePtr makeKeyOctave( OctaveValue&& value ) { return std::make_shared( std::move( value ) ); } - - class KeyOctave : public ElementInterface - { - public: - KeyOctave(); - KeyOctave( const OctaveValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - KeyOctaveAttributesPtr getAttributes() const; - void setAttributes( const KeyOctaveAttributesPtr& attributes ); - OctaveValue getValue() const; - void setValue( const OctaveValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - OctaveValue myValue; - KeyOctaveAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.cpp b/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.cpp deleted file mode 100644 index 292a1acf2..000000000 --- a/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/KeyOctaveAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - KeyOctaveAttributes::KeyOctaveAttributes() - :number( PositiveInteger{ 1 } ) - ,cancel( YesNo::no ) - ,hasNumber( true ) - ,hasCancel( false ) - {} - - - bool KeyOctaveAttributes::hasValues() const - { - return hasNumber || - hasCancel; - } - - - std::ostream& KeyOctaveAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, cancel, "cancel", hasCancel ); - } - return os; - } - - - bool KeyOctaveAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "KeyOctaveAttributes"; - bool isSuccess = true; - bool isNumberFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, isNumberFound, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, cancel, hasCancel, "cancel", &parseYesNo ) ) { continue; } - } - - if( !isNumberFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.h b/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.h deleted file mode 100644 index f4030021c..000000000 --- a/Sourcecode/private/mx/core/elements/KeyOctaveAttributes.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( KeyOctaveAttributes ) - - struct KeyOctaveAttributes : public AttributesInterface - { - public: - KeyOctaveAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - PositiveInteger number; - YesNo cancel; - const bool hasNumber; - bool hasCancel; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyStep.cpp b/Sourcecode/private/mx/core/elements/KeyStep.cpp deleted file mode 100644 index f705fbd9f..000000000 --- a/Sourcecode/private/mx/core/elements/KeyStep.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/KeyStep.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - KeyStep::KeyStep() - :myValue( StepEnum::a ) - {} - - - KeyStep::KeyStep( const StepEnum& value ) - :myValue( value ) - {} - - - bool KeyStep::hasAttributes() const - { - return false; - } - - - bool KeyStep::hasContents() const - { - return true; - } - - - std::ostream& KeyStep::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& KeyStep::streamName( std::ostream& os ) const - { - os << "key-step"; - return os; - } - - - std::ostream& KeyStep::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - StepEnum KeyStep::getValue() const - { - return myValue; - } - - - void KeyStep::setValue( const StepEnum& value ) - { - myValue = value; - } - - - bool KeyStep::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = parseStepEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/KeyStep.h b/Sourcecode/private/mx/core/elements/KeyStep.h deleted file mode 100644 index b8c29a337..000000000 --- a/Sourcecode/private/mx/core/elements/KeyStep.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( KeyStep ) - - inline KeyStepPtr makeKeyStep() { return std::make_shared(); } - inline KeyStepPtr makeKeyStep( const StepEnum& value ) { return std::make_shared( value ); } - inline KeyStepPtr makeKeyStep( StepEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class KeyStep : public ElementInterface - { - public: - KeyStep(); - KeyStep( const StepEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StepEnum getValue() const; - void setValue( const StepEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Kind.cpp b/Sourcecode/private/mx/core/elements/Kind.cpp deleted file mode 100644 index f1e49d368..000000000 --- a/Sourcecode/private/mx/core/elements/Kind.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Kind.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Kind::Kind() - :myValue( KindValue::none ) - ,myAttributes( std::make_shared() ) - {} - - - Kind::Kind( const KindValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Kind::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Kind::hasContents() const - { - return true; - } - - - std::ostream& Kind::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Kind::streamName( std::ostream& os ) const - { - os << "kind"; - return os; - } - - - std::ostream& Kind::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - KindAttributesPtr Kind::getAttributes() const - { - return myAttributes; - } - - - void Kind::setAttributes( const KindAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - KindValue Kind::getValue() const - { - return myValue; - } - - - void Kind::setValue( const KindValue& value ) - { - myValue = value; - } - - - bool Kind::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseKindValue( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Kind.h b/Sourcecode/private/mx/core/elements/Kind.h deleted file mode 100644 index c905f90bf..000000000 --- a/Sourcecode/private/mx/core/elements/Kind.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/KindAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( KindAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Kind ) - - inline KindPtr makeKind() { return std::make_shared(); } - inline KindPtr makeKind( const KindValue& value ) { return std::make_shared( value ); } - inline KindPtr makeKind( KindValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Kind : public ElementInterface - { - public: - Kind(); - Kind( const KindValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - KindAttributesPtr getAttributes() const; - void setAttributes( const KindAttributesPtr& attributes ); - KindValue getValue() const; - void setValue( const KindValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - KindValue myValue; - KindAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/KindAttributes.cpp b/Sourcecode/private/mx/core/elements/KindAttributes.cpp deleted file mode 100644 index abe7f40e7..000000000 --- a/Sourcecode/private/mx/core/elements/KindAttributes.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/KindAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - KindAttributes::KindAttributes() - :useSymbols() - ,text() - ,stackDegrees() - ,parenthesesDegrees() - ,bracketDegrees() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,hasUseSymbols( false ) - ,hasText( false ) - ,hasStackDegrees( false ) - ,hasParenthesesDegrees( false ) - ,hasBracketDegrees( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - {} - - - bool KindAttributes::hasValues() const - { - return hasUseSymbols || - hasText || - hasStackDegrees || - hasParenthesesDegrees || - hasBracketDegrees || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign; - } - - - std::ostream& KindAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, useSymbols, "use-symbols", hasUseSymbols ); - streamAttribute( os, text, "text", hasText ); - streamAttribute( os, stackDegrees, "stack-degrees", hasStackDegrees ); - streamAttribute( os, parenthesesDegrees, "parentheses-degrees", hasParenthesesDegrees ); - streamAttribute( os, bracketDegrees, "bracket-degrees", hasBracketDegrees ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; - } - - - bool KindAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "KindAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, useSymbols, hasUseSymbols, "use-symbols", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, text, hasText, "text" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, stackDegrees, hasStackDegrees, "stack-degrees", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, parenthesesDegrees, hasParenthesesDegrees, "parentheses-degrees", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bracketDegrees, hasBracketDegrees, "bracket-degrees", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/KindAttributes.h b/Sourcecode/private/mx/core/elements/KindAttributes.h deleted file mode 100644 index c99ac3a72..000000000 --- a/Sourcecode/private/mx/core/elements/KindAttributes.h +++ /dev/null @@ -1,64 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( KindAttributes ) - - struct KindAttributes : public AttributesInterface - { - public: - KindAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo useSymbols; - XsToken text; - YesNo stackDegrees; - YesNo parenthesesDegrees; - YesNo bracketDegrees; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - bool hasUseSymbols; - bool hasText; - bool hasStackDegrees; - bool hasParenthesesDegrees; - bool hasBracketDegrees; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Laughing.cpp b/Sourcecode/private/mx/core/elements/Laughing.cpp deleted file mode 100644 index c973b2ae3..000000000 --- a/Sourcecode/private/mx/core/elements/Laughing.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Laughing.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Laughing::Laughing() : ElementInterface() {} - - - bool Laughing::hasAttributes() const { return false; } - - - bool Laughing::hasContents() const { return false; } - std::ostream& Laughing::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Laughing::streamName( std::ostream& os ) const { os << "laughing"; return os; } - std::ostream& Laughing::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool Laughing::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Laughing.h b/Sourcecode/private/mx/core/elements/Laughing.h deleted file mode 100644 index d499b893e..000000000 --- a/Sourcecode/private/mx/core/elements/Laughing.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Laughing ) - - inline LaughingPtr makeLaughing() { return std::make_shared(); } - - class Laughing : public ElementInterface - { - public: - Laughing(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LayoutGroup.cpp b/Sourcecode/private/mx/core/elements/LayoutGroup.cpp deleted file mode 100644 index 678c86764..000000000 --- a/Sourcecode/private/mx/core/elements/LayoutGroup.cpp +++ /dev/null @@ -1,196 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LayoutGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/PageLayout.h" -#include "mx/core/elements/StaffLayout.h" -#include "mx/core/elements/SystemLayout.h" -#include - -namespace mx -{ - namespace core - { - LayoutGroup::LayoutGroup() - :myPageLayout( makePageLayout() ) - ,myHasPageLayout( false ) - ,mySystemLayout( makeSystemLayout() ) - ,myHasSystemLayout( false ) - ,myStaffLayoutSet() - {} - - - bool LayoutGroup::hasAttributes() const - { - return false; - } - - - std::ostream& LayoutGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& LayoutGroup::streamName( std::ostream& os ) const - { - os << "work"; - return os; - } - - - bool LayoutGroup::hasContents() const - { - return myHasPageLayout || myHasSystemLayout || myStaffLayoutSet.size() > 0; - } - - - std::ostream& LayoutGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - bool isFirst = true; - if ( myHasPageLayout ) - { - myPageLayout->toStream( os, indentLevel ); - isFirst = false; - } - if ( myHasSystemLayout ) - { - if ( !isFirst ) - { - os << std::endl; - isFirst = false; - } - mySystemLayout->toStream( os, indentLevel ); - } - if ( myStaffLayoutSet.size() > 0 ) - { - for ( auto it = myStaffLayoutSet.cbegin(); - it != myStaffLayoutSet.cend(); ++it ) - { - if ( it == myStaffLayoutSet.cbegin() ) - { - if ( !isFirst ) - { - os << std::endl; - isFirst = false; - } - } - else - { - os << std::endl; - } - (*it)->toStream( os, indentLevel ); - } - } - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - PageLayoutPtr LayoutGroup::getPageLayout() const - { - return myPageLayout; - } - - - void LayoutGroup::setPageLayout( const PageLayoutPtr& value ) - { - if ( value ) - { - myPageLayout = value; - } - } - - - bool LayoutGroup::getHasPageLayout() const - { - return myHasPageLayout; - } - - - void LayoutGroup::setHasPageLayout( const bool value ) - { - myHasPageLayout = value; - } - - - SystemLayoutPtr LayoutGroup::getSystemLayout() const - { - return mySystemLayout; - } - - - void LayoutGroup::setSystemLayout( const SystemLayoutPtr& value ) - { - if ( value ) - { - mySystemLayout = value; - } - } - - - bool LayoutGroup::getHasSystemLayout() const - { - return myHasSystemLayout; - } - - - void LayoutGroup::setHasSystemLayout( const bool value ) - { - myHasSystemLayout = value; - } - - - const StaffLayoutSet& LayoutGroup::getStaffLayoutSet() const - { - return myStaffLayoutSet; - } - - - void LayoutGroup::addStaffLayout( const StaffLayoutPtr& value ) - { - if ( value ) - { - myStaffLayoutSet.push_back( value ); - } - } - - - void LayoutGroup::removeStaffLayout( const StaffLayoutSetIterConst& value ) - { - if ( value != myStaffLayoutSet.cend() ) - { - myStaffLayoutSet.erase( value ); - } - } - - - void LayoutGroup::clearStaffLayoutSet() - { - myStaffLayoutSet.clear(); - } - - - StaffLayoutPtr LayoutGroup::getStaffLayout( const StaffLayoutSetIterConst& setIterator ) const - { - if( setIterator != myStaffLayoutSet.cend() ) - { - return *setIterator; - } - return StaffLayoutPtr(); - } - - - MX_FROM_XELEMENT_UNUSED( LayoutGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/LayoutGroup.h b/Sourcecode/private/mx/core/elements/LayoutGroup.h deleted file mode 100644 index 38603809c..000000000 --- a/Sourcecode/private/mx/core/elements/LayoutGroup.h +++ /dev/null @@ -1,67 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PageLayout ) - MX_FORWARD_DECLARE_ELEMENT( StaffLayout ) - MX_FORWARD_DECLARE_ELEMENT( SystemLayout ) - MX_FORWARD_DECLARE_ELEMENT( LayoutGroup ) - - inline LayoutGroupPtr makeLayoutGroup() { return std::make_shared(); } - - class LayoutGroup : public ElementInterface - { - public: - LayoutGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ PageLayout minOccurs = 0, maxOccurs = 1 _________ */ - PageLayoutPtr getPageLayout() const; - void setPageLayout( const PageLayoutPtr& value ); - bool getHasPageLayout() const; - void setHasPageLayout( const bool value ); - - /* _________ SystemLayout minOccurs = 0, maxOccurs = 1 _________ */ - SystemLayoutPtr getSystemLayout() const; - void setSystemLayout( const SystemLayoutPtr& value ); - bool getHasSystemLayout() const; - void setHasSystemLayout( const bool value ); - - /* _________ StaffLayout minOccurs = 0, maxOccurs = unbounded _________ */ - const StaffLayoutSet& getStaffLayoutSet() const; - void addStaffLayout( const StaffLayoutPtr& value ); - void removeStaffLayout( const StaffLayoutSetIterConst& value ); - void clearStaffLayoutSet(); - StaffLayoutPtr getStaffLayout( const StaffLayoutSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PageLayoutPtr myPageLayout; - bool myHasPageLayout; - SystemLayoutPtr mySystemLayout; - bool myHasSystemLayout; - StaffLayoutSet myStaffLayoutSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LeftDivider.cpp b/Sourcecode/private/mx/core/elements/LeftDivider.cpp deleted file mode 100644 index 28a9ceea5..000000000 --- a/Sourcecode/private/mx/core/elements/LeftDivider.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LeftDivider.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - LeftDivider::LeftDivider() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool LeftDivider::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool LeftDivider::hasContents() const { return false; } - std::ostream& LeftDivider::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& LeftDivider::streamName( std::ostream& os ) const { os << "left-divider"; return os; } - std::ostream& LeftDivider::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPrintObjectStyleAlignAttributesPtr LeftDivider::getAttributes() const - { - return myAttributes; - } - - - void LeftDivider::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool LeftDivider::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/LeftDivider.h b/Sourcecode/private/mx/core/elements/LeftDivider.h deleted file mode 100644 index a0c0ae144..000000000 --- a/Sourcecode/private/mx/core/elements/LeftDivider.h +++ /dev/null @@ -1,44 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( LeftDivider ) - - inline LeftDividerPtr makeLeftDivider() { return std::make_shared(); } - - class LeftDivider : public ElementInterface - { - public: - LeftDivider(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LeftMargin.cpp b/Sourcecode/private/mx/core/elements/LeftMargin.cpp deleted file mode 100644 index 6163cbb64..000000000 --- a/Sourcecode/private/mx/core/elements/LeftMargin.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LeftMargin.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - LeftMargin::LeftMargin() - :myValue() - {} - - - LeftMargin::LeftMargin( const TenthsValue& value ) - :myValue( value ) - {} - - - bool LeftMargin::hasAttributes() const - { - return false; - } - - - bool LeftMargin::hasContents() const - { - return true; - } - - - std::ostream& LeftMargin::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& LeftMargin::streamName( std::ostream& os ) const - { - os << "left-margin"; - return os; - } - - - std::ostream& LeftMargin::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - TenthsValue LeftMargin::getValue() const - { - return myValue; - } - - - void LeftMargin::setValue( const TenthsValue& value ) - { - myValue = value; - } - - - bool LeftMargin::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/LeftMargin.h b/Sourcecode/private/mx/core/elements/LeftMargin.h deleted file mode 100644 index 53f825a93..000000000 --- a/Sourcecode/private/mx/core/elements/LeftMargin.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( LeftMargin ) - - inline LeftMarginPtr makeLeftMargin() { return std::make_shared(); } - inline LeftMarginPtr makeLeftMargin( const TenthsValue& value ) { return std::make_shared( value ); } - inline LeftMarginPtr makeLeftMargin( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class LeftMargin : public ElementInterface - { - public: - LeftMargin(); - LeftMargin( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Level.cpp b/Sourcecode/private/mx/core/elements/Level.cpp deleted file mode 100644 index 987766c45..000000000 --- a/Sourcecode/private/mx/core/elements/Level.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Level.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Level::Level() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Level::Level( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Level::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Level::hasContents() const - { - return true; - } - - - std::ostream& Level::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Level::streamName( std::ostream& os ) const - { - os << "level"; - return os; - } - - - std::ostream& Level::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - LevelAttributesPtr Level::getAttributes() const - { - return myAttributes; - } - - - void Level::setAttributes( const LevelAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Level::getValue() const - { - return myValue; - } - - - void Level::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Level::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Level.h b/Sourcecode/private/mx/core/elements/Level.h deleted file mode 100644 index 94255f92f..000000000 --- a/Sourcecode/private/mx/core/elements/Level.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/LevelAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LevelAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Level ) - - inline LevelPtr makeLevel() { return std::make_shared(); } - inline LevelPtr makeLevel( const XsString& value ) { return std::make_shared( value ); } - inline LevelPtr makeLevel( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Level : public ElementInterface - { - public: - Level(); - Level( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LevelAttributesPtr getAttributes() const; - void setAttributes( const LevelAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - LevelAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LevelAttributes.cpp b/Sourcecode/private/mx/core/elements/LevelAttributes.cpp deleted file mode 100644 index 988796d44..000000000 --- a/Sourcecode/private/mx/core/elements/LevelAttributes.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LevelAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - LevelAttributes::LevelAttributes() - :reference() - ,parentheses() - ,bracket() - ,size() - ,hasReference( false ) - ,hasParentheses( false ) - ,hasBracket( false ) - ,hasSize( false ) - {} - - - bool LevelAttributes::hasValues() const - { - return hasReference || - hasParentheses || - hasBracket || - hasSize; - } - - - std::ostream& LevelAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, reference, "reference", hasReference ); - streamAttribute( os, parentheses, "parentheses", hasParentheses ); - streamAttribute( os, bracket, "bracket", hasBracket ); - streamAttribute( os, size, "size", hasSize ); - } - return os; - } - - - bool LevelAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "LevelAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, reference, hasReference, "reference", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bracket, hasBracket, "bracket", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, size, hasSize, "size", &parseSymbolSize ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/LevelAttributes.h b/Sourcecode/private/mx/core/elements/LevelAttributes.h deleted file mode 100644 index 594d2133f..000000000 --- a/Sourcecode/private/mx/core/elements/LevelAttributes.h +++ /dev/null @@ -1,41 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LevelAttributes ) - - struct LevelAttributes : public AttributesInterface - { - public: - LevelAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo reference; - YesNo parentheses; - YesNo bracket; - SymbolSize size; - bool hasReference; - bool hasParentheses; - bool hasBracket; - bool hasSize; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Line.cpp b/Sourcecode/private/mx/core/elements/Line.cpp deleted file mode 100644 index d19d129ff..000000000 --- a/Sourcecode/private/mx/core/elements/Line.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Line.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Line::Line() - :myValue() - {} - - - Line::Line( const StaffLine& value ) - :myValue( value ) - {} - - - bool Line::hasAttributes() const - { - return false; - } - - - bool Line::hasContents() const - { - return true; - } - - - std::ostream& Line::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Line::streamName( std::ostream& os ) const - { - os << "line"; - return os; - } - - - std::ostream& Line::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - StaffLine Line::getValue() const - { - return myValue; - } - - - void Line::setValue( const StaffLine& value ) - { - myValue = value; - } - - - bool Line::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Line.h b/Sourcecode/private/mx/core/elements/Line.h deleted file mode 100644 index 67ebf7f60..000000000 --- a/Sourcecode/private/mx/core/elements/Line.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Line ) - - inline LinePtr makeLine() { return std::make_shared(); } - inline LinePtr makeLine( const StaffLine& value ) { return std::make_shared( value ); } - inline LinePtr makeLine( StaffLine&& value ) { return std::make_shared( std::move( value ) ); } - - class Line : public ElementInterface - { - public: - Line(); - Line( const StaffLine& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StaffLine getValue() const; - void setValue( const StaffLine& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StaffLine myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LineWidth.cpp b/Sourcecode/private/mx/core/elements/LineWidth.cpp deleted file mode 100644 index b786106e3..000000000 --- a/Sourcecode/private/mx/core/elements/LineWidth.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LineWidth.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - LineWidth::LineWidth() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - LineWidth::LineWidth( const TenthsValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool LineWidth::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool LineWidth::hasContents() const - { - return true; - } - - - std::ostream& LineWidth::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& LineWidth::streamName( std::ostream& os ) const - { - os << "line-width"; - return os; - } - - - std::ostream& LineWidth::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - LineWidthAttributesPtr LineWidth::getAttributes() const - { - return myAttributes; - } - - - void LineWidth::setAttributes( const LineWidthAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - TenthsValue LineWidth::getValue() const - { - return myValue; - } - - - void LineWidth::setValue( const TenthsValue& value ) - { - myValue = value; - } - - - bool LineWidth::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/LineWidth.h b/Sourcecode/private/mx/core/elements/LineWidth.h deleted file mode 100644 index 1c3c3f4a0..000000000 --- a/Sourcecode/private/mx/core/elements/LineWidth.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/elements/LineWidthAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LineWidthAttributes ) - MX_FORWARD_DECLARE_ELEMENT( LineWidth ) - - inline LineWidthPtr makeLineWidth() { return std::make_shared(); } - inline LineWidthPtr makeLineWidth( const TenthsValue& value ) { return std::make_shared( value ); } - inline LineWidthPtr makeLineWidth( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class LineWidth : public ElementInterface - { - public: - LineWidth(); - LineWidth( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LineWidthAttributesPtr getAttributes() const; - void setAttributes( const LineWidthAttributesPtr& attributes ); - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - LineWidthAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LineWidthAttributes.cpp b/Sourcecode/private/mx/core/elements/LineWidthAttributes.cpp deleted file mode 100644 index e1d01d617..000000000 --- a/Sourcecode/private/mx/core/elements/LineWidthAttributes.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LineWidthAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - LineWidthAttributes::LineWidthAttributes() - :type( LineWidthTypeEnum::beam ) - ,hasType( true ) - {} - - - bool LineWidthAttributes::hasValues() const - { - return hasType; - } - - - std::ostream& LineWidthAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool LineWidthAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "LineWidthAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/LineWidthAttributes.h b/Sourcecode/private/mx/core/elements/LineWidthAttributes.h deleted file mode 100644 index a7823c94d..000000000 --- a/Sourcecode/private/mx/core/elements/LineWidthAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LineWidthAttributes ) - - struct LineWidthAttributes : public AttributesInterface - { - public: - LineWidthAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LineWidthType type; - const bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Link.cpp b/Sourcecode/private/mx/core/elements/Link.cpp deleted file mode 100644 index 0437855a8..000000000 --- a/Sourcecode/private/mx/core/elements/Link.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Link.h" -#include - -namespace mx -{ - namespace core - { - Link::Link() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Link::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Link::hasContents() const { return false; } - std::ostream& Link::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Link::streamName( std::ostream& os ) const { os << "link"; return os; } - std::ostream& Link::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - LinkAttributesPtr Link::getAttributes() const - { - return myAttributes; - } - - - void Link::setAttributes( const LinkAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Link::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Link.h b/Sourcecode/private/mx/core/elements/Link.h deleted file mode 100644 index 992c7c73b..000000000 --- a/Sourcecode/private/mx/core/elements/Link.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/LinkAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LinkAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Link ) - - inline LinkPtr makeLink() { return std::make_shared(); } - - class Link : public ElementInterface - { - public: - Link(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LinkAttributesPtr getAttributes() const; - void setAttributes( const LinkAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LinkAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LinkAttributes.cpp b/Sourcecode/private/mx/core/elements/LinkAttributes.cpp deleted file mode 100644 index 21f84759b..000000000 --- a/Sourcecode/private/mx/core/elements/LinkAttributes.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LinkAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - LinkAttributes::LinkAttributes() - :href() - ,type( XlinkType::simple ) - ,role() - ,title() - ,show( XlinkShow::replace ) - ,actuate( XlinkActuate::onRequest ) - ,name() - ,element() - ,position() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,hasHref( true ) - ,hasType( false ) - ,hasRole( false ) - ,hasTitle( false ) - ,hasShow( false ) - ,hasActuate( false ) - ,hasName( false ) - ,hasElement( false ) - ,hasPosition( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - {} - - - bool LinkAttributes::hasValues() const - { - return hasHref || - hasType || - hasRole || - hasTitle || - hasShow || - hasActuate || - hasName || - hasElement || - hasPosition || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY; - } - - - std::ostream& LinkAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, href, "xlink:href", hasHref ); - streamAttribute( os, type, "xlink:type", hasType ); - streamAttribute( os, role, "xlink:role", hasRole ); - streamAttribute( os, title, "xlink:title", hasTitle ); - streamAttribute( os, show, "xlink:show", hasShow ); - streamAttribute( os, actuate, "xlink:actuate", hasActuate ); - streamAttribute( os, name, "name", hasName ); - streamAttribute( os, element, "element", hasElement ); - streamAttribute( os, position, "position", hasPosition ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - } - return os; - } - - - bool LinkAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "LinkAttributes"; - bool isSuccess = true; - bool isHrefFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, href, isHrefFound, "href" ) ) { continue; } - - if( it->getName() == "xlink:type" ) - { - hasType = true; - continue; - } - - if( parseAttribute( message, it, className, isSuccess, role, hasRole, "role" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, title, hasTitle, "title" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, show, hasShow, "show", &parseXlinkShow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, actuate, hasActuate, "actuate", &parseXlinkActuate ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, name, hasName, "name" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, element, hasElement, "element" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, position, hasPosition, "position" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - } - - if( !isHrefFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/LinkAttributes.h b/Sourcecode/private/mx/core/elements/LinkAttributes.h deleted file mode 100644 index e38eb12d7..000000000 --- a/Sourcecode/private/mx/core/elements/LinkAttributes.h +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" -#include "mx/core/XlinkHref.h" -#include "mx/core/XlinkRole.h" -#include "mx/core/XlinkTitle.h" -#include "mx/core/XsNMToken.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LinkAttributes ) - - struct LinkAttributes : public AttributesInterface - { - public: - LinkAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XlinkHref href; - const XlinkType type; - XlinkRole role; - XlinkTitle title; - XlinkShow show; - XlinkActuate actuate; - XsToken name; - XsNMToken element; - PositiveInteger position; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - const bool hasHref; - bool hasType; - bool hasRole; - bool hasTitle; - bool hasShow; - bool hasActuate; - bool hasName; - bool hasElement; - bool hasPosition; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Lyric.cpp b/Sourcecode/private/mx/core/elements/Lyric.cpp deleted file mode 100644 index 40944008c..000000000 --- a/Sourcecode/private/mx/core/elements/Lyric.cpp +++ /dev/null @@ -1,228 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Lyric.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/EditorialGroup.h" -#include "mx/core/elements/EndLine.h" -#include "mx/core/elements/EndParagraph.h" -#include "mx/core/elements/Extend.h" -#include "mx/core/elements/Humming.h" -#include "mx/core/elements/Laughing.h" -#include "mx/core/elements/LyricTextChoice.h" -#include "mx/core/elements/SyllabicTextGroup.h" -#include - -namespace mx -{ - namespace core - { - Lyric::Lyric() - :myAttributes( std::make_shared() ) - ,myLyricTextChoice( makeLyricTextChoice() ) - ,myEndLine( makeEndLine() ) - ,myHasEndLine( false ) - ,myEndParagraph( makeEndParagraph() ) - ,myHasEndParagraph( false ) - ,myEditorialGroup( makeEditorialGroup() ) - {} - - - bool Lyric::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Lyric::streamAttributes( std::ostream& os ) const - { - if ( myAttributes->hasValues() ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Lyric::streamName( std::ostream& os ) const - { - return os << "lyric"; - } - - - bool Lyric::hasContents() const - { - return true; - } - - - LyricAttributesPtr Lyric::getAttributes() const - { - return myAttributes; - } - - - void Lyric::setAttributes( const LyricAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - std::ostream& Lyric::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myLyricTextChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - if ( myHasEndLine ) - { - os << std::endl; - myEndLine->toStream( os, indentLevel+1 ); - } - if ( myHasEndParagraph ) - { - os << std::endl; - myEndParagraph->toStream( os, indentLevel+1 ); - } - if( myEditorialGroup->hasContents() ) - { - os << std::endl; - } - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - os << std::endl; - isOneLineOnly = false; - return os; - } - - - LyricTextChoicePtr Lyric::getLyricTextChoice() const - { - return myLyricTextChoice; - } - - - void Lyric::setLyricTextChoice( const LyricTextChoicePtr& value ) - { - if ( value ) - { - myLyricTextChoice = value; - } - } - - - EndLinePtr Lyric::getEndLine() const - { - return myEndLine; - } - - - void Lyric::setEndLine( const EndLinePtr& value ) - { - if ( value ) - { - myEndLine = value; - } - } - - - bool Lyric::getHasEndLine() const - { - return myHasEndLine; - } - - - void Lyric::setHasEndLine( const bool value ) - { - myHasEndLine = value; - } - - - EndParagraphPtr Lyric::getEndParagraph() const - { - return myEndParagraph; - } - - - void Lyric::setEndParagraph( const EndParagraphPtr& value ) - { - if ( value ) - { - myEndParagraph = value; - } - } - - - bool Lyric::getHasEndParagraph() const - { - return myHasEndParagraph; - } - - - void Lyric::setHasEndParagraph( const bool value ) - { - myHasEndParagraph = value; - } - - - EditorialGroupPtr Lyric::getEditorialGroup() const - { - return myEditorialGroup; - } - - - void Lyric::setEditorialGroup( const EditorialGroupPtr& value ) - { - if ( value ) - { - myEditorialGroup = value; - } - } - - - bool Lyric::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isLyricTextChoiceFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - - if( checkSetChoiceMember( - message, *it, isSuccess, myLyricTextChoice, - "extend", &LyricTextChoice::getExtend, - static_cast( LyricTextChoice::Choice::extend ) ) ) - { isLyricTextChoiceFound = true; continue; } - - else if( checkSetChoiceMember( - message, *it, isSuccess, myLyricTextChoice, - "laughing", &LyricTextChoice::getLaughing, - static_cast( LyricTextChoice::Choice::laughing ) ) ) - { isLyricTextChoiceFound = true; continue; } - - else if( checkSetChoiceMember( - message, *it, isSuccess, myLyricTextChoice, - "humming", &LyricTextChoice::getHumming, - static_cast( LyricTextChoice::Choice::humming ) ) ) - { isLyricTextChoiceFound = true; continue; } - - else - { - myLyricTextChoice->setChoice( LyricTextChoice::Choice::syllabicTextGroup ); - SyllabicTextGroupPtr ptr = myLyricTextChoice->getSyllabicTextGroup(); - importGroup( message, it, endIter, isSuccess, ptr ); - } - if ( importElement( message, *it, isSuccess, *myEndLine, myHasEndLine ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myEndParagraph, myHasEndParagraph ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialGroup ); - - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Lyric.h b/Sourcecode/private/mx/core/elements/Lyric.h deleted file mode 100644 index 53895009b..000000000 --- a/Sourcecode/private/mx/core/elements/Lyric.h +++ /dev/null @@ -1,75 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/LyricAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LyricAttributes ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( EndLine ) - MX_FORWARD_DECLARE_ELEMENT( EndParagraph ) - MX_FORWARD_DECLARE_ELEMENT( LyricTextChoice ) - MX_FORWARD_DECLARE_ELEMENT( Lyric ) - - inline LyricPtr makeLyric() { return std::make_shared(); } - - class Lyric : public ElementInterface - { - public: - Lyric(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LyricAttributesPtr getAttributes() const; - void setAttributes( const LyricAttributesPtr& value ); - - /* _________ LyricTextChoice minOccurs = 1, maxOccurs = 1 _________ */ - LyricTextChoicePtr getLyricTextChoice() const; - void setLyricTextChoice( const LyricTextChoicePtr& value ); - - /* _________ EndLine minOccurs = 0, maxOccurs = 1 _________ */ - EndLinePtr getEndLine() const; - void setEndLine( const EndLinePtr& value ); - bool getHasEndLine() const; - void setHasEndLine( const bool value ); - - /* _________ EndParagraph minOccurs = 0, maxOccurs = 1 _________ */ - EndParagraphPtr getEndParagraph() const; - void setEndParagraph( const EndParagraphPtr& value ); - bool getHasEndParagraph() const; - void setHasEndParagraph( const bool value ); - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LyricAttributesPtr myAttributes; - LyricTextChoicePtr myLyricTextChoice; - EndLinePtr myEndLine; - bool myHasEndLine; - EndParagraphPtr myEndParagraph; - bool myHasEndParagraph; - EditorialGroupPtr myEditorialGroup; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LyricAttributes.cpp b/Sourcecode/private/mx/core/elements/LyricAttributes.cpp deleted file mode 100644 index 18f6afaed..000000000 --- a/Sourcecode/private/mx/core/elements/LyricAttributes.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LyricAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - LyricAttributes::LyricAttributes() - :number() - ,name() - ,justify( LeftCenterRight::center ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,placement( AboveBelow::below ) - ,color() - ,printObject( YesNo::no ) - ,hasNumber( false ) - ,hasName( false ) - ,hasJustify( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasPlacement( false ) - ,hasColor( false ) - ,hasPrintObject( false ) - {} - - - bool LyricAttributes::hasValues() const - { - return hasNumber || - hasName || - hasJustify || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasPlacement || - hasColor || - hasPrintObject; - } - - - std::ostream& LyricAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, name, "name", hasName ); - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } - - - bool LyricAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "LyricAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, name, hasName, "name" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/LyricAttributes.h b/Sourcecode/private/mx/core/elements/LyricAttributes.h deleted file mode 100644 index e587a1a16..000000000 --- a/Sourcecode/private/mx/core/elements/LyricAttributes.h +++ /dev/null @@ -1,57 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/XsNMToken.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LyricAttributes ) - - struct LyricAttributes : public AttributesInterface - { - public: - LyricAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsNMToken number; - XsToken name; - LeftCenterRight justify; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - AboveBelow placement; - Color color; - YesNo printObject; - bool hasNumber; - bool hasName; - bool hasJustify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasPlacement; - bool hasColor; - bool hasPrintObject; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LyricFont.cpp b/Sourcecode/private/mx/core/elements/LyricFont.cpp deleted file mode 100644 index ece30f7f0..000000000 --- a/Sourcecode/private/mx/core/elements/LyricFont.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LyricFont.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - LyricFont::LyricFont() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool LyricFont::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool LyricFont::hasContents() const { return false; } - std::ostream& LyricFont::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& LyricFont::streamName( std::ostream& os ) const { os << "lyric-font"; return os; } - std::ostream& LyricFont::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - LyricFontAttributesPtr LyricFont::getAttributes() const - { - return myAttributes; - } - - - void LyricFont::setAttributes( const LyricFontAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool LyricFont::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/LyricFont.h b/Sourcecode/private/mx/core/elements/LyricFont.h deleted file mode 100644 index 031558fb7..000000000 --- a/Sourcecode/private/mx/core/elements/LyricFont.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/LyricFontAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LyricFontAttributes ) - MX_FORWARD_DECLARE_ELEMENT( LyricFont ) - - inline LyricFontPtr makeLyricFont() { return std::make_shared(); } - - class LyricFont : public ElementInterface - { - public: - LyricFont(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LyricFontAttributesPtr getAttributes() const; - void setAttributes( const LyricFontAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LyricFontAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LyricFontAttributes.cpp b/Sourcecode/private/mx/core/elements/LyricFontAttributes.cpp deleted file mode 100644 index dbb5b7e2d..000000000 --- a/Sourcecode/private/mx/core/elements/LyricFontAttributes.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LyricFontAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - LyricFontAttributes::LyricFontAttributes() - :number() - ,name() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,hasNumber( false ) - ,hasName( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool LyricFontAttributes::hasValues() const - { - return hasNumber || - hasName || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& LyricFontAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, name, "name", hasName ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool LyricFontAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "LyricFontAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, name, hasName, "name" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/LyricFontAttributes.h b/Sourcecode/private/mx/core/elements/LyricFontAttributes.h deleted file mode 100644 index 3dfcf2e36..000000000 --- a/Sourcecode/private/mx/core/elements/LyricFontAttributes.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/XsNMToken.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LyricFontAttributes ) - - struct LyricFontAttributes : public AttributesInterface - { - public: - LyricFontAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsNMToken number; - XsToken name; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasNumber; - bool hasName; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LyricLanguage.cpp b/Sourcecode/private/mx/core/elements/LyricLanguage.cpp deleted file mode 100644 index 944f2fbd8..000000000 --- a/Sourcecode/private/mx/core/elements/LyricLanguage.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LyricLanguage.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - LyricLanguage::LyricLanguage() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool LyricLanguage::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool LyricLanguage::hasContents() const { return false; } - std::ostream& LyricLanguage::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& LyricLanguage::streamName( std::ostream& os ) const { os << "lyric-language"; return os; } - std::ostream& LyricLanguage::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - LyricLanguageAttributesPtr LyricLanguage::getAttributes() const - { - return myAttributes; - } - - - void LyricLanguage::setAttributes( const LyricLanguageAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool LyricLanguage::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/LyricLanguage.h b/Sourcecode/private/mx/core/elements/LyricLanguage.h deleted file mode 100644 index fb16c5d61..000000000 --- a/Sourcecode/private/mx/core/elements/LyricLanguage.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/LyricLanguageAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LyricLanguageAttributes ) - MX_FORWARD_DECLARE_ELEMENT( LyricLanguage ) - - inline LyricLanguagePtr makeLyricLanguage() { return std::make_shared(); } - - class LyricLanguage : public ElementInterface - { - public: - LyricLanguage(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LyricLanguageAttributesPtr getAttributes() const; - void setAttributes( const LyricLanguageAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LyricLanguageAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.cpp b/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.cpp deleted file mode 100644 index 33f3b7dd2..000000000 --- a/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LyricLanguageAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - LyricLanguageAttributes::LyricLanguageAttributes() - :number() - ,name() - ,lang( "it" ) - ,hasNumber( false ) - ,hasName( false ) - ,hasLang( true ) - {} - - - bool LyricLanguageAttributes::hasValues() const - { - return hasNumber || - hasName || - hasLang; - } - - - std::ostream& LyricLanguageAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, name, "name", hasName ); - streamAttribute( os, lang, "xml:lang", hasLang ); - } - return os; - } - - - bool LyricLanguageAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "LyricLanguageAttributes"; - bool isSuccess = true; - bool isLangFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, name, hasName, "name" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, isLangFound, "xml:lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, isLangFound, "lang" ) ) { continue; } - } - - if( !isLangFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.h b/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.h deleted file mode 100644 index e65b0bdd1..000000000 --- a/Sourcecode/private/mx/core/elements/LyricLanguageAttributes.h +++ /dev/null @@ -1,41 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/XmlLang.h" -#include "mx/core/XsNMToken.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( LyricLanguageAttributes ) - - struct LyricLanguageAttributes : public AttributesInterface - { - public: - LyricLanguageAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsNMToken number; - XsToken name; - XmlLang lang; - bool hasNumber; - bool hasName; - const bool hasLang; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/LyricTextChoice.cpp b/Sourcecode/private/mx/core/elements/LyricTextChoice.cpp deleted file mode 100644 index ee1de9863..000000000 --- a/Sourcecode/private/mx/core/elements/LyricTextChoice.cpp +++ /dev/null @@ -1,156 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/LyricTextChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Extend.h" -#include "mx/core/elements/Humming.h" -#include "mx/core/elements/Laughing.h" -#include "mx/core/elements/SyllabicTextGroup.h" -#include - -namespace mx -{ - namespace core - { - LyricTextChoice::LyricTextChoice() - :myChoice( Choice::syllabicTextGroup ) - ,mySyllabicTextGroup( makeSyllabicTextGroup() ) - ,myExtend( makeExtend() ) - ,myLaughing( makeLaughing() ) - ,myHumming( makeHumming() ) - {} - - - bool LyricTextChoice::hasAttributes() const - { - return false; - } - - - std::ostream& LyricTextChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& LyricTextChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool LyricTextChoice::hasContents() const - { - return myChoice == Choice::syllabicTextGroup; - } - - - std::ostream& LyricTextChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::syllabicTextGroup: - { - mySyllabicTextGroup->streamContents( os, indentLevel, isOneLineOnly ); - } - break; - case Choice::extend: - { - myExtend->toStream( os, indentLevel ); - } - break; - case Choice::laughing: - { - myLaughing->toStream( os, indentLevel ); - } - break; - case Choice::humming: - { - myHumming->toStream( os, indentLevel ); - } - break; - default: - break; - } - return os; - } - - - LyricTextChoice::Choice LyricTextChoice::getChoice() const - { - return myChoice; - } - - - void LyricTextChoice::setChoice( const LyricTextChoice::Choice value ) - { - myChoice = value; - } - - - SyllabicTextGroupPtr LyricTextChoice::getSyllabicTextGroup() const - { - return mySyllabicTextGroup; - } - - - void LyricTextChoice::setSyllabicTextGroup( const SyllabicTextGroupPtr& value ) - { - if ( value ) - { - mySyllabicTextGroup = value; - } - } - - - ExtendPtr LyricTextChoice::getExtend() const - { - return myExtend; - } - - - void LyricTextChoice::setExtend( const ExtendPtr& value ) - { - if ( value ) - { - myExtend = value; - } - } - - - LaughingPtr LyricTextChoice::getLaughing() const - { - return myLaughing; - } - - - void LyricTextChoice::setLaughing( const LaughingPtr& value ) - { - if ( value ) - { - myLaughing = value; - } - } - - - HummingPtr LyricTextChoice::getHumming() const - { - return myHumming; - } - - - void LyricTextChoice::setHumming( const HummingPtr& value ) - { - if ( value ) - { - myHumming = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( LyricTextChoice ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/LyricTextChoice.h b/Sourcecode/private/mx/core/elements/LyricTextChoice.h deleted file mode 100644 index f2180bb59..000000000 --- a/Sourcecode/private/mx/core/elements/LyricTextChoice.h +++ /dev/null @@ -1,74 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Extend ) - MX_FORWARD_DECLARE_ELEMENT( Humming ) - MX_FORWARD_DECLARE_ELEMENT( Laughing ) - MX_FORWARD_DECLARE_ELEMENT( SyllabicTextGroup ) - MX_FORWARD_DECLARE_ELEMENT( LyricTextChoice ) - - inline LyricTextChoicePtr makeLyricTextChoice() { return std::make_shared(); } - - class LyricTextChoice : public ElementInterface - { - public: - enum class Choice - { - syllabicTextGroup = 1, - extend = 2, - laughing = 3, - humming = 4 - }; - LyricTextChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - LyricTextChoice::Choice getChoice() const; - void setChoice( const LyricTextChoice::Choice value ); - - /* _________ SyllabicTextGroup minOccurs = 1, maxOccurs = 1 _________ */ - SyllabicTextGroupPtr getSyllabicTextGroup() const; - void setSyllabicTextGroup( const SyllabicTextGroupPtr& value ); - - /* _________ Extend minOccurs = 1, maxOccurs = 1 _________ */ - ExtendPtr getExtend() const; - void setExtend( const ExtendPtr& value ); - - /* _________ Laughing minOccurs = 1, maxOccurs = 1 _________ */ - LaughingPtr getLaughing() const; - void setLaughing( const LaughingPtr& value ); - - /* _________ Humming minOccurs = 1, maxOccurs = 1 _________ */ - HummingPtr getHumming() const; - void setHumming( const HummingPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - SyllabicTextGroupPtr mySyllabicTextGroup; - ExtendPtr myExtend; - LaughingPtr myLaughing; - HummingPtr myHumming; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureAttributes.cpp b/Sourcecode/private/mx/core/elements/MeasureAttributes.cpp deleted file mode 100644 index a3ab1f1fe..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureAttributes.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MeasureAttributes.h" -#include "mx/core/FromXElement.h" -#include "mx/core/FromString.h" -#include - -namespace mx -{ - namespace core - { - MeasureAttributes::MeasureAttributes() - :number() - ,implicit( YesNo::no ) - ,nonControlling( YesNo::no ) - ,width() - ,hasNumber( true ) - ,hasImplicit( false ) - ,hasNonControlling( false ) - ,hasWidth( false ) - {} - - - bool MeasureAttributes::hasValues() const - { - return hasNumber || - hasImplicit || - hasNonControlling || - hasWidth; - } - - - std::ostream& MeasureAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, implicit, "implicit", hasImplicit ); - streamAttribute( os, nonControlling, "non-controlling", hasNonControlling ); - streamAttribute( os, width, "width", hasWidth ); - } - return os; - } - - - bool MeasureAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MeasureAttributes"; - bool isSuccess = true; - bool isNumberFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, isNumberFound, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, implicit, hasImplicit, "implicit", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, nonControlling, hasNonControlling, "non-controlling", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, width, hasWidth, "width" ) ) { continue; } - } - - if( !isNumberFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureAttributes.h b/Sourcecode/private/mx/core/elements/MeasureAttributes.h deleted file mode 100644 index c5f789357..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureAttributes.h +++ /dev/null @@ -1,42 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureAttributes ) - - struct MeasureAttributes : public AttributesInterface - { - public: - MeasureAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken number; - YesNo implicit; - YesNo nonControlling; - TenthsValue width; - const bool hasNumber; - bool hasImplicit; - bool hasNonControlling; - bool hasWidth; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureDistance.cpp b/Sourcecode/private/mx/core/elements/MeasureDistance.cpp deleted file mode 100644 index f61e1f8e2..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureDistance.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MeasureDistance.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MeasureDistance::MeasureDistance() - :myValue() - {} - - - MeasureDistance::MeasureDistance( const TenthsValue& value ) - :myValue( value ) - {} - - - bool MeasureDistance::hasAttributes() const - { - return false; - } - - - bool MeasureDistance::hasContents() const - { - return true; - } - - - std::ostream& MeasureDistance::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MeasureDistance::streamName( std::ostream& os ) const - { - os << "measure-distance"; - return os; - } - - - std::ostream& MeasureDistance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - TenthsValue MeasureDistance::getValue() const - { - return myValue; - } - - - void MeasureDistance::setValue( const TenthsValue& value ) - { - myValue = value; - } - - - bool MeasureDistance::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureDistance.h b/Sourcecode/private/mx/core/elements/MeasureDistance.h deleted file mode 100644 index 4057e42e4..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureDistance.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MeasureDistance ) - - inline MeasureDistancePtr makeMeasureDistance() { return std::make_shared(); } - inline MeasureDistancePtr makeMeasureDistance( const TenthsValue& value ) { return std::make_shared( value ); } - inline MeasureDistancePtr makeMeasureDistance( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class MeasureDistance : public ElementInterface - { - public: - MeasureDistance(); - MeasureDistance( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureLayout.cpp b/Sourcecode/private/mx/core/elements/MeasureLayout.cpp deleted file mode 100644 index 749b98413..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureLayout.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MeasureLayout.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/MeasureDistance.h" -#include - -namespace mx -{ - namespace core - { - MeasureLayout::MeasureLayout() - :myMeasureDistance( makeMeasureDistance() ) - ,myHasMeasureDistance( false ) - {} - - - bool MeasureLayout::hasAttributes() const - { - return false; - } - - - std::ostream& MeasureLayout::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MeasureLayout::streamName( std::ostream& os ) const - { - os << "measure-layout"; - return os; - } - - - bool MeasureLayout::hasContents() const - { - return true; - } - - - std::ostream& MeasureLayout::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasMeasureDistance ) - { - os << std::endl; - myMeasureDistance->toStream( os, indentLevel+1 ); - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - MeasureDistancePtr MeasureLayout::getMeasureDistance() const - { - return myMeasureDistance; - } - - - void MeasureLayout::setMeasureDistance( const MeasureDistancePtr& value ) - { - if( value ) - { - myMeasureDistance = value; - } - } - - - bool MeasureLayout::getHasMeasureDistance() const - { - return myHasMeasureDistance; - } - - - void MeasureLayout::setHasMeasureDistance( const bool value ) - { - myHasMeasureDistance = value; - } - - - bool MeasureLayout::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myMeasureDistance, myHasMeasureDistance ) ) { continue; } - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureLayout.h b/Sourcecode/private/mx/core/elements/MeasureLayout.h deleted file mode 100644 index a29bfaaba..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureLayout.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MeasureDistance ) - MX_FORWARD_DECLARE_ELEMENT( MeasureLayout ) - - inline MeasureLayoutPtr makeMeasureLayout() { return std::make_shared(); } - - class MeasureLayout : public ElementInterface - { - public: - MeasureLayout(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MeasureDistance minOccurs = 0, maxOccurs = 1 _________ */ - MeasureDistancePtr getMeasureDistance() const; - void setMeasureDistance( const MeasureDistancePtr& value ); - bool getHasMeasureDistance() const; - void setHasMeasureDistance( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MeasureDistancePtr myMeasureDistance; - bool myHasMeasureDistance; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureNumbering.cpp b/Sourcecode/private/mx/core/elements/MeasureNumbering.cpp deleted file mode 100644 index 7e1d6b5a7..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureNumbering.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MeasureNumbering.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MeasureNumbering::MeasureNumbering() - :myValue( MeasureNumberingValue::none ) - ,myAttributes( std::make_shared() ) - {} - - - MeasureNumbering::MeasureNumbering( const MeasureNumberingValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool MeasureNumbering::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MeasureNumbering::hasContents() const - { - return true; - } - - - std::ostream& MeasureNumbering::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MeasureNumbering::streamName( std::ostream& os ) const - { - os << "measure-numbering"; - return os; - } - - - std::ostream& MeasureNumbering::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - MeasureNumberingAttributesPtr MeasureNumbering::getAttributes() const - { - return myAttributes; - } - - - void MeasureNumbering::setAttributes( const MeasureNumberingAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - MeasureNumberingValue MeasureNumbering::getValue() const - { - return myValue; - } - - - void MeasureNumbering::setValue( const MeasureNumberingValue& value ) - { - myValue = value; - } - - - bool MeasureNumbering::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseMeasureNumberingValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureNumbering.h b/Sourcecode/private/mx/core/elements/MeasureNumbering.h deleted file mode 100644 index 3fb0ecc1d..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureNumbering.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/MeasureNumberingAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureNumberingAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MeasureNumbering ) - - inline MeasureNumberingPtr makeMeasureNumbering() { return std::make_shared(); } - inline MeasureNumberingPtr makeMeasureNumbering( const MeasureNumberingValue& value ) { return std::make_shared( value ); } - inline MeasureNumberingPtr makeMeasureNumbering( MeasureNumberingValue&& value ) { return std::make_shared( std::move( value ) ); } - - class MeasureNumbering : public ElementInterface - { - public: - MeasureNumbering(); - MeasureNumbering( const MeasureNumberingValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MeasureNumberingAttributesPtr getAttributes() const; - void setAttributes( const MeasureNumberingAttributesPtr& attributes ); - MeasureNumberingValue getValue() const; - void setValue( const MeasureNumberingValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MeasureNumberingValue myValue; - MeasureNumberingAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.cpp b/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.cpp deleted file mode 100644 index f903b30ce..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MeasureNumberingAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MeasureNumberingAttributes::MeasureNumberingAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - {} - - - bool MeasureNumberingAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign; - } - - - std::ostream& MeasureNumberingAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; - } - - - bool MeasureNumberingAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MeasureNumberingAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.h b/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.h deleted file mode 100644 index 79f0f12a6..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureNumberingAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureNumberingAttributes ) - - struct MeasureNumberingAttributes : public AttributesInterface - { - public: - MeasureNumberingAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureRepeat.cpp b/Sourcecode/private/mx/core/elements/MeasureRepeat.cpp deleted file mode 100644 index a3a862640..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureRepeat.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MeasureRepeat.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MeasureRepeat::MeasureRepeat() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - MeasureRepeat::MeasureRepeat( const PositiveIntegerOrEmpty& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool MeasureRepeat::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MeasureRepeat::hasContents() const - { - return true; - } - - - std::ostream& MeasureRepeat::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MeasureRepeat::streamName( std::ostream& os ) const - { - os << "measure-repeat"; - return os; - } - - - std::ostream& MeasureRepeat::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - MeasureRepeatAttributesPtr MeasureRepeat::getAttributes() const - { - return myAttributes; - } - - - void MeasureRepeat::setAttributes( const MeasureRepeatAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - PositiveIntegerOrEmpty MeasureRepeat::getValue() const - { - return myValue; - } - - - void MeasureRepeat::setValue( const PositiveIntegerOrEmpty& value ) - { - myValue = value; - } - - - bool MeasureRepeat::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureRepeat.h b/Sourcecode/private/mx/core/elements/MeasureRepeat.h deleted file mode 100644 index ef09f276d..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureRepeat.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/PositiveIntegerOrEmpty.h" -#include "mx/core/elements/MeasureRepeatAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureRepeatAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MeasureRepeat ) - - inline MeasureRepeatPtr makeMeasureRepeat() { return std::make_shared(); } - inline MeasureRepeatPtr makeMeasureRepeat( const PositiveIntegerOrEmpty& value ) { return std::make_shared( value ); } - inline MeasureRepeatPtr makeMeasureRepeat( PositiveIntegerOrEmpty&& value ) { return std::make_shared( std::move( value ) ); } - - class MeasureRepeat : public ElementInterface - { - public: - MeasureRepeat(); - MeasureRepeat( const PositiveIntegerOrEmpty& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MeasureRepeatAttributesPtr getAttributes() const; - void setAttributes( const MeasureRepeatAttributesPtr& attributes ); - PositiveIntegerOrEmpty getValue() const; - void setValue( const PositiveIntegerOrEmpty& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveIntegerOrEmpty myValue; - MeasureRepeatAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.cpp b/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.cpp deleted file mode 100644 index 0c3982750..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MeasureRepeatAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MeasureRepeatAttributes::MeasureRepeatAttributes() - :type( StartStop::start ) - ,slashes() - ,hasType( true ) - ,hasSlashes( false ) - {} - - - bool MeasureRepeatAttributes::hasValues() const - { - return hasType || - hasSlashes; - } - - - std::ostream& MeasureRepeatAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, slashes, "slashes", hasSlashes ); - } - return os; - } - - - bool MeasureRepeatAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MeasureRepeatAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, slashes, hasSlashes, "slashes" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.h b/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.h deleted file mode 100644 index 44fe3346a..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureRepeatAttributes.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureRepeatAttributes ) - - struct MeasureRepeatAttributes : public AttributesInterface - { - public: - MeasureRepeatAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - PositiveInteger slashes; - const bool hasType; - bool hasSlashes; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureStyle.cpp b/Sourcecode/private/mx/core/elements/MeasureStyle.cpp deleted file mode 100644 index 16398914e..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureStyle.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MeasureStyle.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/MeasureStyleChoice.h" -#include - -namespace mx -{ - namespace core - { - MeasureStyle::MeasureStyle() - :myAttributes( std::make_shared() ) - ,myChoice( makeMeasureStyleChoice() ) - {} - - - bool MeasureStyle::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& MeasureStyle::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& MeasureStyle::streamName( std::ostream& os ) const - { - os << "measure-style"; - return os; - } - - - bool MeasureStyle::hasContents() const - { - return true; - } - - - std::ostream& MeasureStyle::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myChoice->streamContents( os, indentLevel, isOneLineOnly ); - os << std::endl; - return os; - } - - - MeasureStyleAttributesPtr MeasureStyle::getAttributes() const - { - return myAttributes; - } - - - void MeasureStyle::setAttributes( const MeasureStyleAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - MeasureStyleChoicePtr MeasureStyle::getMeasureStyleChoice() const - { - return myChoice; - } - - - void MeasureStyle::setMeasureStyleChoice( const MeasureStyleChoicePtr& value ) - { - if ( value ) - { - myChoice = value; - } - } - - - bool MeasureStyle::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - isSuccess &= myChoice->fromXElement( message, *it ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureStyle.h b/Sourcecode/private/mx/core/elements/MeasureStyle.h deleted file mode 100644 index e790a6781..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureStyle.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/MeasureStyleAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureStyleAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MeasureStyleChoice ) - MX_FORWARD_DECLARE_ELEMENT( MeasureStyle ) - - inline MeasureStylePtr makeMeasureStyle() { return std::make_shared(); } - - class MeasureStyle : public ElementInterface - { - public: - MeasureStyle(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MeasureStyleAttributesPtr getAttributes() const; - void setAttributes( const MeasureStyleAttributesPtr& value ); - MeasureStyleChoicePtr getMeasureStyleChoice() const; - void setMeasureStyleChoice( const MeasureStyleChoicePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MeasureStyleAttributesPtr myAttributes; - MeasureStyleChoicePtr myChoice; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.cpp b/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.cpp deleted file mode 100644 index a37c8f7fb..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MeasureStyleAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MeasureStyleAttributes::MeasureStyleAttributes() - :number() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,hasNumber( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - {} - - - bool MeasureStyleAttributes::hasValues() const - { - return hasNumber || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor; - } - - - std::ostream& MeasureStyleAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - } - return os; - } - - - bool MeasureStyleAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MeasureStyleAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.h b/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.h deleted file mode 100644 index dfdcae092..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureStyleAttributes.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureStyleAttributes ) - - struct MeasureStyleAttributes : public AttributesInterface - { - public: - MeasureStyleAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffNumber number; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - bool hasNumber; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureStyleChoice.cpp b/Sourcecode/private/mx/core/elements/MeasureStyleChoice.cpp deleted file mode 100644 index c9c71c347..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureStyleChoice.cpp +++ /dev/null @@ -1,158 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MeasureStyleChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/BeatRepeat.h" -#include "mx/core/elements/MeasureRepeat.h" -#include "mx/core/elements/MultipleRest.h" -#include "mx/core/elements/Slash.h" -#include - -namespace mx -{ - namespace core - { - MeasureStyleChoice::MeasureStyleChoice() - - - :myChoice( MeasureStyleChoice::Choice::multipleRest ) - ,myMultipleRest( makeMultipleRest() ) - ,myMeasureRepeat( makeMeasureRepeat() ) - ,myBeatRepeat( makeBeatRepeat() ) - ,mySlash( makeSlash() ) - {} - - - bool MeasureStyleChoice::hasAttributes() const - { - return false; - } - - - std::ostream& MeasureStyleChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MeasureStyleChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool MeasureStyleChoice::hasContents() const - { - return true; - } - - - std::ostream& MeasureStyleChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - switch ( myChoice ) - { - case Choice::multipleRest: - myMultipleRest->toStream( os, indentLevel+1 ); - break; - case Choice::measureRepeat: - myMeasureRepeat->toStream( os, indentLevel+1 ); - break; - case Choice::beatRepeat: - myBeatRepeat->toStream( os, indentLevel+1 ); - break; - case Choice::slash: - mySlash->toStream( os, indentLevel+1 ); - break; - default: - break; - } - return os; - } - - - MeasureStyleChoice::Choice MeasureStyleChoice::getChoice() const - { - return myChoice; - } - - - void MeasureStyleChoice::setChoice( const Choice value ) - { - myChoice = value; - } - - - MultipleRestPtr MeasureStyleChoice::getMultipleRest() const - { - return myMultipleRest; - } - - - void MeasureStyleChoice::setMultipleRest( const MultipleRestPtr& value ) - { - if ( value ) - { - myMultipleRest = value; - } - } - - - MeasureRepeatPtr MeasureStyleChoice::getMeasureRepeat() const - { - return myMeasureRepeat; - } - - - void MeasureStyleChoice::setMeasureRepeat( const MeasureRepeatPtr& value ) - { - if ( value ) - { - myMeasureRepeat = value; - } - } - - - BeatRepeatPtr MeasureStyleChoice::getBeatRepeat() const - { - return myBeatRepeat; - } - - - void MeasureStyleChoice::setBeatRepeat( const BeatRepeatPtr& value ) - { - if ( value ) - { - myBeatRepeat = value; - } - } - - - SlashPtr MeasureStyleChoice::getSlash() const - { - return mySlash; - } - - - void MeasureStyleChoice::setSlash( const SlashPtr& value ) - { - if ( value ) - { - mySlash = value; - } - } - - - bool MeasureStyleChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_CHOICE_IF( multipleRest, "multiple-rest", MultipleRest ); - MX_CHOICE_IF( measureRepeat, "measure-repeat", MeasureRepeat ); - MX_CHOICE_IF( beatRepeat, "beat-repeat", BeatRepeat ); - MX_CHOICE_IF( slash, "slash", Slash ); - MX_BAD_ELEMENT_FAILURE( MeasureStyleChoice ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MeasureStyleChoice.h b/Sourcecode/private/mx/core/elements/MeasureStyleChoice.h deleted file mode 100644 index 470f73c9c..000000000 --- a/Sourcecode/private/mx/core/elements/MeasureStyleChoice.h +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatRepeat ) - MX_FORWARD_DECLARE_ELEMENT( MeasureRepeat ) - MX_FORWARD_DECLARE_ELEMENT( MultipleRest ) - MX_FORWARD_DECLARE_ELEMENT( Slash ) - MX_FORWARD_DECLARE_ELEMENT( MeasureStyleChoice ) - - inline MeasureStyleChoicePtr makeMeasureStyleChoice() { return std::make_shared(); } - - class MeasureStyleChoice : public ElementInterface - { - public: - enum class Choice - { - multipleRest = 0, - measureRepeat = 1, - beatRepeat = 2, - slash = 3 - }; - MeasureStyleChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Choice getChoice() const; - void setChoice( const Choice value ); - MultipleRestPtr getMultipleRest() const; - void setMultipleRest( const MultipleRestPtr& value ); - MeasureRepeatPtr getMeasureRepeat() const; - void setMeasureRepeat( const MeasureRepeatPtr& value ); - BeatRepeatPtr getBeatRepeat() const; - void setBeatRepeat( const BeatRepeatPtr& value ); - SlashPtr getSlash() const; - void setSlash( const SlashPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - MultipleRestPtr myMultipleRest; - MeasureRepeatPtr myMeasureRepeat; - BeatRepeatPtr myBeatRepeat; - SlashPtr mySlash; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Membrane.cpp b/Sourcecode/private/mx/core/elements/Membrane.cpp deleted file mode 100644 index 1a4c6ec71..000000000 --- a/Sourcecode/private/mx/core/elements/Membrane.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Membrane.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Membrane::Membrane() - :myValue( MembraneEnum::snareDrum ) - {} - - - Membrane::Membrane( const MembraneEnum& value ) - :myValue( value ) - {} - - - bool Membrane::hasAttributes() const - { - return false; - } - - - bool Membrane::hasContents() const - { - return true; - } - - - std::ostream& Membrane::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Membrane::streamName( std::ostream& os ) const - { - os << "membrane"; - return os; - } - - - std::ostream& Membrane::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - MembraneEnum Membrane::getValue() const - { - return myValue; - } - - - void Membrane::setValue( const MembraneEnum& value ) - { - myValue = value; - } - - - bool Membrane::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = parseMembraneEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Membrane.h b/Sourcecode/private/mx/core/elements/Membrane.h deleted file mode 100644 index 74191d4ba..000000000 --- a/Sourcecode/private/mx/core/elements/Membrane.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Membrane ) - - inline MembranePtr makeMembrane() { return std::make_shared(); } - inline MembranePtr makeMembrane( const MembraneEnum& value ) { return std::make_shared( value ); } - inline MembranePtr makeMembrane( MembraneEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Membrane : public ElementInterface - { - public: - Membrane(); - Membrane( const MembraneEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MembraneEnum getValue() const; - void setValue( const MembraneEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MembraneEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Metal.cpp b/Sourcecode/private/mx/core/elements/Metal.cpp deleted file mode 100644 index 8cb490df2..000000000 --- a/Sourcecode/private/mx/core/elements/Metal.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Metal.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Metal::Metal() - :myValue( MetalEnum::bell ) - {} - - - Metal::Metal( const MetalEnum& value ) - :myValue( value ) - {} - - - bool Metal::hasAttributes() const - { - return false; - } - - - bool Metal::hasContents() const - { - return true; - } - - - std::ostream& Metal::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Metal::streamName( std::ostream& os ) const - { - os << "metal"; - return os; - } - - - std::ostream& Metal::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - MetalEnum Metal::getValue() const - { - return myValue; - } - - - void Metal::setValue( const MetalEnum& value ) - { - myValue = value; - } - - - bool Metal::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseMetalEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Metal.h b/Sourcecode/private/mx/core/elements/Metal.h deleted file mode 100644 index 345ae0c64..000000000 --- a/Sourcecode/private/mx/core/elements/Metal.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Metal ) - - inline MetalPtr makeMetal() { return std::make_shared(); } - inline MetalPtr makeMetal( const MetalEnum& value ) { return std::make_shared( value ); } - inline MetalPtr makeMetal( MetalEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Metal : public ElementInterface - { - public: - Metal(); - Metal( const MetalEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MetalEnum getValue() const; - void setValue( const MetalEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MetalEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Metronome.cpp b/Sourcecode/private/mx/core/elements/Metronome.cpp deleted file mode 100644 index 0b67c9a2f..000000000 --- a/Sourcecode/private/mx/core/elements/Metronome.cpp +++ /dev/null @@ -1,215 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Metronome.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/BeatUnitPerOrNoteRelationNoteChoice.h" -#include "mx/core/elements/BeatUnitGroup.h" -#include "mx/core/elements/PerMinuteOrBeatUnitChoice.h" -#include "mx/core/elements/BeatUnitGroup.h" -#include "mx/core/elements/BeatUnitPer.h" -#include "mx/core/elements/PerMinute.h" -#include "mx/core/elements/NoteRelationNote.h" -#include "mx/core/elements/MetronomeNote.h" -#include "mx/core/elements/MetronomeRelationGroup.h" -#include "mx/core/elements/MetronomeRelation.h" -#include - -namespace mx -{ - namespace core - { - Metronome::Metronome() - :myAttributes( std::make_shared() ) - ,myBeatUnitPerOrNoteRelationNoteChoice( makeBeatUnitPerOrNoteRelationNoteChoice() ) - {} - - - bool Metronome::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Metronome::streamAttributes( std::ostream& os ) const - { - myAttributes->toStream( os ); - return os; - } - - - std::ostream& Metronome::streamName( std::ostream& os ) const - { - return os << "metronome"; - } - - - bool Metronome::hasContents() const - { - return true; - } - - - std::ostream& Metronome::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myBeatUnitPerOrNoteRelationNoteChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - os << std::endl; - isOneLineOnly = false; - return os; - } - - - MetronomeAttributesPtr Metronome::getAttributes() const - { - return myAttributes; - } - - - void Metronome::setAttributes( const MetronomeAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - BeatUnitPerOrNoteRelationNoteChoicePtr Metronome::getBeatUnitPerOrNoteRelationNoteChoice() const - { - return myBeatUnitPerOrNoteRelationNoteChoice; - } - - - void Metronome::setBeatUnitPerOrNoteRelationNoteChoice( const BeatUnitPerOrNoteRelationNoteChoicePtr& value ) - { - if ( value ) - { - myBeatUnitPerOrNoteRelationNoteChoice = value; - } - } - - /* - - - - - - - - - - */ - - bool Metronome::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto iter = xelement.begin(); - auto endIter = xelement.end(); - - for( ; iter != endIter; ++iter ) - { - bool isIterIncremented = false; - - if( ( iter->getName() == "beat-unit" ) || ( iter->getName() == "beat-unit-dot" ) ) - { - myBeatUnitPerOrNoteRelationNoteChoice->setChoice( BeatUnitPerOrNoteRelationNoteChoice::Choice::beatUnitPer ); - auto beatUnitGroup = myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getBeatUnitGroup(); - importGroup( message, iter, endIter, isSuccess, beatUnitGroup ); - isIterIncremented = true; - ++iter; - - if( iter == endIter ) - { - return false; - } - - if( ( iter->getName() == "beat-unit" ) || ( iter->getName() == "beat-unit-dot" ) ) - { - auto beatUnitGroup2 = myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->getBeatUnitGroup(); - myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->setChoice( PerMinuteOrBeatUnitChoice::Choice::beatUnitGroup ); - importGroup( message, iter, endIter, isSuccess, beatUnitGroup2 ); - isIterIncremented = true; - ++iter; - } - else if ( iter->getName() == "per-minute" ) - { - myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->setChoice( PerMinuteOrBeatUnitChoice::Choice::perMinute ); - myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->getPerMinute()->fromXElement( message, *iter ); - isIterIncremented = true; - ++iter; - } - } - else if( ( iter->getName() == "metronome-note" ) ) - { - myBeatUnitPerOrNoteRelationNoteChoice->setChoice( BeatUnitPerOrNoteRelationNoteChoice::Choice::noteRelationNote ); - auto noteRelationNote = myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote(); - bool isFirstMetronomeNoteAdded = false; - - while( iter != endIter && iter->getName() == "metronome-note" ) - { - auto metronomeNote = makeMetronomeNote(); - isSuccess &= metronomeNote->fromXElement( message, *iter ); - - if( !isFirstMetronomeNoteAdded && noteRelationNote->getMetronomeNoteSet().size() == 1 ) - { - noteRelationNote->addMetronomeNote( metronomeNote ); - noteRelationNote->removeMetronomeNote( noteRelationNote->getMetronomeNoteSet().cbegin() ); - isFirstMetronomeNoteAdded = true; - } - else - { - noteRelationNote->addMetronomeNote( metronomeNote ); - isFirstMetronomeNoteAdded = true; - } - isIterIncremented = true; - ++iter; - } - - if( iter == endIter ) - { - MX_RETURN_IS_SUCCESS; - } - - if( iter->getName() == "metronome-relation" ) - { - myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote()->setHasMetronomeRelationGroup( true ); - auto metronomeRelationGroup = myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote()->getMetronomeRelationGroup(); - isSuccess &= metronomeRelationGroup->getMetronomeRelation()->fromXElement( message, *iter ); - ++iter; - isIterIncremented = true; - - if( iter == endIter ) - { - MX_RETURN_IS_SUCCESS; - } - - if( iter->getName() == "metronome-note" ) - { - myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote()->setHasMetronomeRelationGroup( true ); - isSuccess &= metronomeRelationGroup->getMetronomeNote()->fromXElement( message, *iter ); - ++iter; - isIterIncremented = true; - if( iter == endIter ) - { - MX_RETURN_IS_SUCCESS; - } - } - } - - } - - if( isIterIncremented ) - { - --iter; - } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Metronome.h b/Sourcecode/private/mx/core/elements/Metronome.h deleted file mode 100644 index a657b9ed2..000000000 --- a/Sourcecode/private/mx/core/elements/Metronome.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/MetronomeAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MetronomeAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BeatUnitPerOrNoteRelationNoteChoice ) - MX_FORWARD_DECLARE_ELEMENT( Metronome ) - - inline MetronomePtr makeMetronome() { return std::make_shared(); } - - class Metronome : public ElementInterface - { - public: - Metronome(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MetronomeAttributesPtr getAttributes() const; - void setAttributes( const MetronomeAttributesPtr& value ); - BeatUnitPerOrNoteRelationNoteChoicePtr getBeatUnitPerOrNoteRelationNoteChoice() const; - void setBeatUnitPerOrNoteRelationNoteChoice( const BeatUnitPerOrNoteRelationNoteChoicePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MetronomeAttributesPtr myAttributes; - BeatUnitPerOrNoteRelationNoteChoicePtr myBeatUnitPerOrNoteRelationNoteChoice; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeAttributes.cpp b/Sourcecode/private/mx/core/elements/MetronomeAttributes.cpp deleted file mode 100644 index a3dcc5bb7..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeAttributes.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MetronomeAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MetronomeAttributes::MetronomeAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,halign( LeftCenterRight::center ) - ,valign( Valign::baseline ) - ,justify( LeftCenterRight::center ) - ,parentheses( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - ,hasJustify( false ) - ,hasParentheses( false ) - {} - - - bool MetronomeAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasHalign || - hasValign || - hasJustify || - hasParentheses; - } - - - std::ostream& MetronomeAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, parentheses, "parentheses", hasParentheses ); - } - return os; - } - - - bool MetronomeAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MetronomeAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeAttributes.h b/Sourcecode/private/mx/core/elements/MetronomeAttributes.h deleted file mode 100644 index c4bacff5f..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeAttributes.h +++ /dev/null @@ -1,63 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MetronomeAttributes ) - - struct MetronomeAttributes : public AttributesInterface - { - public: - MetronomeAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - LeftCenterRight justify; - YesNo parentheses; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; - bool hasJustify; - bool hasParentheses; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeBeam.cpp b/Sourcecode/private/mx/core/elements/MetronomeBeam.cpp deleted file mode 100644 index 1e4f1da00..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeBeam.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MetronomeBeam.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MetronomeBeam::MetronomeBeam() - :myValue( BeamValue::begin ) - ,myAttributes( std::make_shared() ) - {} - - - MetronomeBeam::MetronomeBeam( const BeamValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool MetronomeBeam::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MetronomeBeam::hasContents() const - { - return true; - } - - - std::ostream& MetronomeBeam::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MetronomeBeam::streamName( std::ostream& os ) const - { - os << "metronome-beam"; - return os; - } - - - std::ostream& MetronomeBeam::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - MetronomeBeamAttributesPtr MetronomeBeam::getAttributes() const - { - return myAttributes; - } - - - void MetronomeBeam::setAttributes( const MetronomeBeamAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - BeamValue MetronomeBeam::getValue() const - { - return myValue; - } - - - void MetronomeBeam::setValue( const BeamValue& value ) - { - myValue = value; - } - - - bool MetronomeBeam::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseBeamValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeBeam.h b/Sourcecode/private/mx/core/elements/MetronomeBeam.h deleted file mode 100644 index 0263a4720..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeBeam.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/MetronomeBeamAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MetronomeBeamAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeBeam ) - - inline MetronomeBeamPtr makeMetronomeBeam() { return std::make_shared(); } - inline MetronomeBeamPtr makeMetronomeBeam( const BeamValue& value ) { return std::make_shared( value ); } - inline MetronomeBeamPtr makeMetronomeBeam( BeamValue&& value ) { return std::make_shared( std::move( value ) ); } - - class MetronomeBeam : public ElementInterface - { - public: - MetronomeBeam(); - MetronomeBeam( const BeamValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MetronomeBeamAttributesPtr getAttributes() const; - void setAttributes( const MetronomeBeamAttributesPtr& attributes ); - BeamValue getValue() const; - void setValue( const BeamValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - BeamValue myValue; - MetronomeBeamAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.cpp b/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.cpp deleted file mode 100644 index c0a02b1da..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MetronomeBeamAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MetronomeBeamAttributes::MetronomeBeamAttributes() - :number( 1 ) - ,hasNumber( false ) - {} - - - bool MetronomeBeamAttributes::hasValues() const - { - return hasNumber; - } - - - std::ostream& MetronomeBeamAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - } - return os; - } - - - bool MetronomeBeamAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MetronomeBeamAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.h b/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.h deleted file mode 100644 index 0d2751f96..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeBeamAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MetronomeBeamAttributes ) - - struct MetronomeBeamAttributes : public AttributesInterface - { - public: - MetronomeBeamAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - BeamLevel number; - bool hasNumber; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeDot.cpp b/Sourcecode/private/mx/core/elements/MetronomeDot.cpp deleted file mode 100644 index 329a3202a..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeDot.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MetronomeDot.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MetronomeDot::MetronomeDot() : ElementInterface() {} - - - bool MetronomeDot::hasAttributes() const { return false; } - - - bool MetronomeDot::hasContents() const { return false; } - std::ostream& MetronomeDot::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& MetronomeDot::streamName( std::ostream& os ) const { os << "metronome-dot"; return os; } - std::ostream& MetronomeDot::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool MetronomeDot::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeDot.h b/Sourcecode/private/mx/core/elements/MetronomeDot.h deleted file mode 100644 index 61cd1357a..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeDot.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MetronomeDot ) - - inline MetronomeDotPtr makeMetronomeDot() { return std::make_shared(); } - - class MetronomeDot : public ElementInterface - { - public: - MetronomeDot(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeNote.cpp b/Sourcecode/private/mx/core/elements/MetronomeNote.cpp deleted file mode 100644 index 71e780a86..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeNote.cpp +++ /dev/null @@ -1,220 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MetronomeNote.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/MetronomeBeam.h" -#include "mx/core/elements/MetronomeDot.h" -#include "mx/core/elements/MetronomeTuplet.h" -#include "mx/core/elements/MetronomeType.h" -#include - -namespace mx -{ - namespace core - { - MetronomeNote::MetronomeNote() - :myMetronomeType( makeMetronomeType() ) - ,myMetronomeDotSet() - ,myMetronomeBeamSet() - ,myMetronomeTuplet( makeMetronomeTuplet() ) - ,myHasMetronomeTuplet( false ) - {} - - - bool MetronomeNote::hasAttributes() const - { - return false; - } - - - std::ostream& MetronomeNote::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MetronomeNote::streamName( std::ostream& os ) const - { - os << "metronome-note"; - return os; - } - - - bool MetronomeNote::hasContents() const - { - return true; - } - - - std::ostream& MetronomeNote::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myMetronomeType->toStream( os, indentLevel+1 ); - for ( auto x : myMetronomeDotSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myMetronomeBeamSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasMetronomeTuplet ) - { - os << std::endl; - myMetronomeTuplet->toStream( os, indentLevel+1 ); - } - os << std::endl; - return os; - } - - - MetronomeTypePtr MetronomeNote::getMetronomeType() const - { - return myMetronomeType; - } - - - void MetronomeNote::setMetronomeType( const MetronomeTypePtr& value ) - { - if( value ) - { - myMetronomeType = value; - } - } - - - const MetronomeDotSet& MetronomeNote::getMetronomeDotSet() const - { - return myMetronomeDotSet; - } - - - void MetronomeNote::removeMetronomeDot( const MetronomeDotSetIterConst& value ) - { - if ( value != myMetronomeDotSet.cend() ) - { - myMetronomeDotSet.erase( value ); - } - } - - - void MetronomeNote::addMetronomeDot( const MetronomeDotPtr& value ) - { - if ( value ) - { - myMetronomeDotSet.push_back( value ); - } - } - - - void MetronomeNote::clearMetronomeDotSet() - { - myMetronomeDotSet.clear(); - } - - - MetronomeDotPtr MetronomeNote::getMetronomeDot( const MetronomeDotSetIterConst& setIterator ) const - { - if( setIterator != myMetronomeDotSet.cend() ) - { - return *setIterator; - } - return MetronomeDotPtr(); - } - - - const MetronomeBeamSet& MetronomeNote::getMetronomeBeamSet() const - { - return myMetronomeBeamSet; - } - - - void MetronomeNote::removeMetronomeBeam( const MetronomeBeamSetIterConst& value ) - { - if ( value != myMetronomeBeamSet.cend() ) - { - myMetronomeBeamSet.erase( value ); - } - } - - - void MetronomeNote::addMetronomeBeam( const MetronomeBeamPtr& value ) - { - if ( value ) - { - myMetronomeBeamSet.push_back( value ); - } - } - - - void MetronomeNote::clearMetronomeBeamSet() - { - myMetronomeBeamSet.clear(); - } - - - MetronomeBeamPtr MetronomeNote::getMetronomeBeam( const MetronomeBeamSetIterConst& setIterator ) const - { - if( setIterator != myMetronomeBeamSet.cend() ) - { - return *setIterator; - } - return MetronomeBeamPtr(); - } - - - MetronomeTupletPtr MetronomeNote::getMetronomeTuplet() const - { - return myMetronomeTuplet; - } - - - void MetronomeNote::setMetronomeTuplet( const MetronomeTupletPtr& value ) - { - if( value ) - { - myMetronomeTuplet = value; - } - } - - - bool MetronomeNote::getHasMetronomeTuplet() const - { - return myHasMetronomeTuplet; - } - - - void MetronomeNote::setHasMetronomeTuplet( const bool value ) - { - myHasMetronomeTuplet = value; - } - - - bool MetronomeNote::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isMetronomeTypeFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myMetronomeType, isMetronomeTypeFound ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "metronome-dot", myMetronomeDotSet ); - importElementSet( message, it, endIter, isSuccess, "metronome-beam", myMetronomeBeamSet ); - if ( importElement( message, *it, isSuccess, *myMetronomeTuplet, myHasMetronomeTuplet ) ) { continue; } - } - - if( !isMetronomeTypeFound ) - { - message << "MetronomeNote: '" << myMetronomeType->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeNote.h b/Sourcecode/private/mx/core/elements/MetronomeNote.h deleted file mode 100644 index dc6508ad6..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeNote.h +++ /dev/null @@ -1,73 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MetronomeBeam ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeDot ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeTuplet ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeType ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeNote ) - - inline MetronomeNotePtr makeMetronomeNote() { return std::make_shared(); } - - class MetronomeNote : public ElementInterface - { - public: - MetronomeNote(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MetronomeType minOccurs = 1, maxOccurs = 1 _________ */ - MetronomeTypePtr getMetronomeType() const; - void setMetronomeType( const MetronomeTypePtr& value ); - - /* _________ MetronomeDot minOccurs = 0, maxOccurs = unbounded _________ */ - const MetronomeDotSet& getMetronomeDotSet() const; - void addMetronomeDot( const MetronomeDotPtr& value ); - void removeMetronomeDot( const MetronomeDotSetIterConst& value ); - void clearMetronomeDotSet(); - MetronomeDotPtr getMetronomeDot( const MetronomeDotSetIterConst& setIterator ) const; - - /* _________ MetronomeBeam minOccurs = 0, maxOccurs = unbounded _________ */ - const MetronomeBeamSet& getMetronomeBeamSet() const; - void addMetronomeBeam( const MetronomeBeamPtr& value ); - void removeMetronomeBeam( const MetronomeBeamSetIterConst& value ); - void clearMetronomeBeamSet(); - MetronomeBeamPtr getMetronomeBeam( const MetronomeBeamSetIterConst& setIterator ) const; - - /* _________ MetronomeTuplet minOccurs = 0, maxOccurs = 1 _________ */ - MetronomeTupletPtr getMetronomeTuplet() const; - void setMetronomeTuplet( const MetronomeTupletPtr& value ); - bool getHasMetronomeTuplet() const; - void setHasMetronomeTuplet( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MetronomeTypePtr myMetronomeType; - MetronomeDotSet myMetronomeDotSet; - MetronomeBeamSet myMetronomeBeamSet; - MetronomeTupletPtr myMetronomeTuplet; - bool myHasMetronomeTuplet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeRelation.cpp b/Sourcecode/private/mx/core/elements/MetronomeRelation.cpp deleted file mode 100644 index b49ae6b1c..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeRelation.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MetronomeRelation.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MetronomeRelation::MetronomeRelation() - :myValue( "equals" ) - {} - - - MetronomeRelation::MetronomeRelation( const XsString& value ) - :myValue( value ) - {} - - - bool MetronomeRelation::hasAttributes() const - { - return false; - } - - - bool MetronomeRelation::hasContents() const - { - return true; - } - - - std::ostream& MetronomeRelation::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MetronomeRelation::streamName( std::ostream& os ) const - { - os << "metronome-relation"; - return os; - } - - - std::ostream& MetronomeRelation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString MetronomeRelation::getValue() const - { - return myValue; - } - - - void MetronomeRelation::setValue( const XsString& value ) - { - myValue.setValue( value.getValue() ); - } - - - bool MetronomeRelation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeRelation.h b/Sourcecode/private/mx/core/elements/MetronomeRelation.h deleted file mode 100644 index 0bcec723a..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeRelation.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MetronomeRelation ) - - inline MetronomeRelationPtr makeMetronomeRelation() { return std::make_shared(); } - - class MetronomeRelation : public ElementInterface - { - public: - MetronomeRelation(); - MetronomeRelation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.cpp b/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.cpp deleted file mode 100644 index 04a89767d..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MetronomeRelationGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/MetronomeNote.h" -#include "mx/core/elements/MetronomeRelation.h" -#include - -namespace mx -{ - namespace core - { - MetronomeRelationGroup::MetronomeRelationGroup() - :myMetronomeRelation( makeMetronomeRelation() ) - ,myMetronomeNote( makeMetronomeNote() ) - {} - - - bool MetronomeRelationGroup::hasAttributes() const - { - return false; - } - - - std::ostream& MetronomeRelationGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MetronomeRelationGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool MetronomeRelationGroup::hasContents() const - { - return true; - } - - - std::ostream& MetronomeRelationGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - myMetronomeRelation->toStream( os, indentLevel ); - os << std::endl; - myMetronomeNote->toStream( os, indentLevel ); - return os; - } - - - MetronomeRelationPtr MetronomeRelationGroup::getMetronomeRelation() const - { - return myMetronomeRelation; - } - - - void MetronomeRelationGroup::setMetronomeRelation( const MetronomeRelationPtr& value ) - { - if ( value ) - { - myMetronomeRelation = value; - } - } - - - MetronomeNotePtr MetronomeRelationGroup::getMetronomeNote() const - { - return myMetronomeNote; - } - - - void MetronomeRelationGroup::setMetronomeNote( const MetronomeNotePtr& value ) - { - if ( value ) - { - myMetronomeNote = value; - } - } - - MX_FROM_XELEMENT_UNUSED( MetronomeRelationGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.h b/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.h deleted file mode 100644 index 35a60a4d1..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeRelationGroup.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MetronomeNote ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeRelation ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeRelationGroup ) - - inline MetronomeRelationGroupPtr makeMetronomeRelationGroup() { return std::make_shared(); } - - class MetronomeRelationGroup : public ElementInterface - { - public: - MetronomeRelationGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MetronomeRelation minOccurs = 1, maxOccurs = 1 _________ */ - MetronomeRelationPtr getMetronomeRelation() const; - void setMetronomeRelation( const MetronomeRelationPtr& value ); - - /* _________ MetronomeNote minOccurs = 1, maxOccurs = 1 _________ */ - MetronomeNotePtr getMetronomeNote() const; - void setMetronomeNote( const MetronomeNotePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MetronomeRelationPtr myMetronomeRelation; - MetronomeNotePtr myMetronomeNote; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeTuplet.cpp b/Sourcecode/private/mx/core/elements/MetronomeTuplet.cpp deleted file mode 100644 index 0d20fcb4d..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeTuplet.cpp +++ /dev/null @@ -1,166 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MetronomeTuplet.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/ActualNotes.h" -#include "mx/core/elements/NormalNotes.h" -#include "mx/core/elements/TimeModificationNormalTypeNormalDot.h" -#include - -namespace mx -{ - namespace core - { - MetronomeTuplet::MetronomeTuplet() - :myAttributes( std::make_shared() ) - ,myActualNotes( makeActualNotes() ) - ,myNormalNotes( makeNormalNotes() ) - ,myTimeModificationNormalTypeNormalDot( makeTimeModificationNormalTypeNormalDot() ) - ,myHasTimeModificationNormalTypeNormalDot( false ) - {} - - - bool MetronomeTuplet::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& MetronomeTuplet::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& MetronomeTuplet::streamName( std::ostream& os ) const - { - os << "metronome-tuplet"; - return os; - } - - - bool MetronomeTuplet::hasContents() const - { - return true; - } - - - std::ostream& MetronomeTuplet::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myActualNotes->toStream( os, indentLevel+1 ); - os << std::endl; - myNormalNotes->toStream( os, indentLevel+1 ); - if ( myHasTimeModificationNormalTypeNormalDot ) - { - os << std::endl; - myTimeModificationNormalTypeNormalDot->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - MetronomeTupletAttributesPtr MetronomeTuplet::getAttributes() const - { - return myAttributes; - } - - - void MetronomeTuplet::setAttributes( const MetronomeTupletAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - ActualNotesPtr MetronomeTuplet::getActualNotes() const - { - return myActualNotes; - } - - - void MetronomeTuplet::setActualNotes( const ActualNotesPtr& value ) - { - if( value ) - { - myActualNotes = value; - } - } - - - NormalNotesPtr MetronomeTuplet::getNormalNotes() const - { - return myNormalNotes; - } - - - void MetronomeTuplet::setNormalNotes( const NormalNotesPtr& value ) - { - if( value ) - { - myNormalNotes = value; - } - } - - - TimeModificationNormalTypeNormalDotPtr MetronomeTuplet::getTimeModificationNormalTypeNormalDot() const - { - return myTimeModificationNormalTypeNormalDot; - } - - - void MetronomeTuplet::setTimeModificationNormalTypeNormalDot( const TimeModificationNormalTypeNormalDotPtr& value ) - { - if ( value ) - { - myTimeModificationNormalTypeNormalDot = value; - } - } - - - bool MetronomeTuplet::getHasTimeModificationNormalTypeNormalDot() const - { - return myHasTimeModificationNormalTypeNormalDot; - } - - - void MetronomeTuplet::setHasTimeModificationNormalTypeNormalDot( const bool value ) - { - myHasTimeModificationNormalTypeNormalDot = value; - } - - - bool MetronomeTuplet::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isActualNotesFound = false; - bool isNormalNotesFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myActualNotes, isActualNotesFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myNormalNotes, isNormalNotesFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTimeModificationNormalTypeNormalDot, myHasTimeModificationNormalTypeNormalDot ) ) { continue; } - } - - if( !isActualNotesFound ) - { - message << "MetronomeTuplet: '" << myActualNotes->getElementName() << "' is required but was not found" << std::endl; - } - if( !isNormalNotesFound ) - { - message << "MetronomeTuplet: '" << myNormalNotes->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeTuplet.h b/Sourcecode/private/mx/core/elements/MetronomeTuplet.h deleted file mode 100644 index f674f6a69..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeTuplet.h +++ /dev/null @@ -1,67 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/MetronomeTupletAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MetronomeTupletAttributes ) - MX_FORWARD_DECLARE_ELEMENT( ActualNotes ) - MX_FORWARD_DECLARE_ELEMENT( NormalNotes ) - MX_FORWARD_DECLARE_ELEMENT( TimeModificationNormalTypeNormalDot ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeTuplet ) - - inline MetronomeTupletPtr makeMetronomeTuplet() { return std::make_shared(); } - - - class MetronomeTuplet : public ElementInterface - { - public: - MetronomeTuplet(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MetronomeTupletAttributesPtr getAttributes() const; - void setAttributes( const MetronomeTupletAttributesPtr& value ); - - /* _________ ActualNotes minOccurs = 1, maxOccurs = 1 _________ */ - ActualNotesPtr getActualNotes() const; - void setActualNotes( const ActualNotesPtr& value ); - - /* _________ NormalNotes minOccurs = 1, maxOccurs = 1 _________ */ - NormalNotesPtr getNormalNotes() const; - void setNormalNotes( const NormalNotesPtr& value ); - - /* _________ TimeModificationNormalTypeNormalDot minOccurs = 0, maxOccurs = 1 _________ */ - TimeModificationNormalTypeNormalDotPtr getTimeModificationNormalTypeNormalDot() const; - void setTimeModificationNormalTypeNormalDot( const TimeModificationNormalTypeNormalDotPtr& value ); - bool getHasTimeModificationNormalTypeNormalDot() const; - void setHasTimeModificationNormalTypeNormalDot( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MetronomeTupletAttributesPtr myAttributes; - ActualNotesPtr myActualNotes; - NormalNotesPtr myNormalNotes; - TimeModificationNormalTypeNormalDotPtr myTimeModificationNormalTypeNormalDot; - bool myHasTimeModificationNormalTypeNormalDot; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.cpp b/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.cpp deleted file mode 100644 index 3f6aa7d04..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MetronomeTupletAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MetronomeTupletAttributes::MetronomeTupletAttributes() - :type( StartStop::start ) - ,bracket( YesNo::no ) - ,showNumber( ShowTuplet::actual ) - ,hasType( true ) - ,hasBracket( false ) - ,hasShowNumber( false ) - {} - - - bool MetronomeTupletAttributes::hasValues() const - { - return hasType || - hasBracket || - hasShowNumber; - } - - - std::ostream& MetronomeTupletAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, bracket, "bracket", hasBracket ); - streamAttribute( os, showNumber, "show-number", hasShowNumber ); - } - return os; - } - - - bool MetronomeTupletAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MetronomeTupletAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bracket, hasBracket, "bracket", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, showNumber, hasShowNumber, "show-number", &parseShowTuplet ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.h b/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.h deleted file mode 100644 index 36cb8edcd..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeTupletAttributes.h +++ /dev/null @@ -1,39 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MetronomeTupletAttributes ) - - struct MetronomeTupletAttributes : public AttributesInterface - { - public: - MetronomeTupletAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - YesNo bracket; - ShowTuplet showNumber; - const bool hasType; - bool hasBracket; - bool hasShowNumber; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeType.cpp b/Sourcecode/private/mx/core/elements/MetronomeType.cpp deleted file mode 100644 index a53a626a5..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeType.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MetronomeType.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MetronomeType::MetronomeType() - :myValue( NoteTypeValue::eighth ) - {} - - - MetronomeType::MetronomeType( const NoteTypeValue& value ) - :myValue( value ) - {} - - - bool MetronomeType::hasAttributes() const - { - return false; - } - - - bool MetronomeType::hasContents() const - { - return true; - } - - - std::ostream& MetronomeType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MetronomeType::streamName( std::ostream& os ) const - { - os << "metronome-type"; - return os; - } - - - std::ostream& MetronomeType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NoteTypeValue MetronomeType::getValue() const - { - return myValue; - } - - - void MetronomeType::setValue( const NoteTypeValue& value ) - { - myValue = value; - } - - - bool MetronomeType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseNoteTypeValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MetronomeType.h b/Sourcecode/private/mx/core/elements/MetronomeType.h deleted file mode 100644 index 7293f9b81..000000000 --- a/Sourcecode/private/mx/core/elements/MetronomeType.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MetronomeType ) - - inline MetronomeTypePtr makeMetronomeType() { return std::make_shared(); } - inline MetronomeTypePtr makeMetronomeType( const NoteTypeValue& value ) { return std::make_shared( value ); } - inline MetronomeTypePtr makeMetronomeType( NoteTypeValue&& value ) { return std::make_shared( std::move( value ) ); } - - class MetronomeType : public ElementInterface - { - public: - MetronomeType(); - MetronomeType( const NoteTypeValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteTypeValue getValue() const; - void setValue( const NoteTypeValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NoteTypeValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiBank.cpp b/Sourcecode/private/mx/core/elements/MidiBank.cpp deleted file mode 100644 index c0adcbca8..000000000 --- a/Sourcecode/private/mx/core/elements/MidiBank.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MidiBank.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MidiBank::MidiBank() - :myValue() - {} - - - MidiBank::MidiBank( const Midi16384& value ) - :myValue( value ) - {} - - - bool MidiBank::hasAttributes() const - { - return false; - } - - - bool MidiBank::hasContents() const - { - return true; - } - - - std::ostream& MidiBank::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MidiBank::streamName( std::ostream& os ) const - { - os << "midi-bank"; - return os; - } - - - std::ostream& MidiBank::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Midi16384 MidiBank::getValue() const - { - return myValue; - } - - - void MidiBank::setValue( const Midi16384& value ) - { - myValue = value; - } - - - bool MidiBank::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiBank.h b/Sourcecode/private/mx/core/elements/MidiBank.h deleted file mode 100644 index 41c8a76c8..000000000 --- a/Sourcecode/private/mx/core/elements/MidiBank.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MidiBank ) - - inline MidiBankPtr makeMidiBank() { return std::make_shared(); } - inline MidiBankPtr makeMidiBank( const Midi16384& value ) { return std::make_shared( value ); } - inline MidiBankPtr makeMidiBank( Midi16384&& value ) { return std::make_shared( std::move( value ) ); } - - class MidiBank : public ElementInterface - { - public: - MidiBank(); - MidiBank( const Midi16384& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Midi16384 getValue() const; - void setValue( const Midi16384& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Midi16384 myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiChannel.cpp b/Sourcecode/private/mx/core/elements/MidiChannel.cpp deleted file mode 100644 index 483f44d68..000000000 --- a/Sourcecode/private/mx/core/elements/MidiChannel.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MidiChannel.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MidiChannel::MidiChannel() - :myValue() - {} - - - MidiChannel::MidiChannel( const Midi16& value ) - :myValue( value ) - {} - - - bool MidiChannel::hasAttributes() const - { - return false; - } - - - bool MidiChannel::hasContents() const - { - return true; - } - - - std::ostream& MidiChannel::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MidiChannel::streamName( std::ostream& os ) const - { - os << "midi-channel"; - return os; - } - - - std::ostream& MidiChannel::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Midi16 MidiChannel::getValue() const - { - return myValue; - } - - - void MidiChannel::setValue( const Midi16& value ) - { - myValue = value; - } - - - bool MidiChannel::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiChannel.h b/Sourcecode/private/mx/core/elements/MidiChannel.h deleted file mode 100644 index ad229268b..000000000 --- a/Sourcecode/private/mx/core/elements/MidiChannel.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MidiChannel ) - - inline MidiChannelPtr makeMidiChannel() { return std::make_shared(); } - inline MidiChannelPtr makeMidiChannel( const Midi16& value ) { return std::make_shared( value ); } - inline MidiChannelPtr makeMidiChannel( Midi16&& value ) { return std::make_shared( std::move( value ) ); } - - class MidiChannel : public ElementInterface - { - public: - MidiChannel(); - MidiChannel( const Midi16& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Midi16 getValue() const; - void setValue( const Midi16& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Midi16 myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiDevice.cpp b/Sourcecode/private/mx/core/elements/MidiDevice.cpp deleted file mode 100644 index b719c4e73..000000000 --- a/Sourcecode/private/mx/core/elements/MidiDevice.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MidiDevice.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MidiDevice::MidiDevice() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - MidiDevice::MidiDevice( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool MidiDevice::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MidiDevice::hasContents() const - { - return true; - } - - - std::ostream& MidiDevice::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MidiDevice::streamName( std::ostream& os ) const - { - os << "midi-device"; - return os; - } - - - std::ostream& MidiDevice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - MidiDeviceAttributesPtr MidiDevice::getAttributes() const - { - return myAttributes; - } - - - void MidiDevice::setAttributes( const MidiDeviceAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString MidiDevice::getValue() const - { - return myValue; - } - - - void MidiDevice::setValue( const XsString& value ) - { - myValue = value; - } - - - bool MidiDevice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiDevice.h b/Sourcecode/private/mx/core/elements/MidiDevice.h deleted file mode 100644 index 71459a321..000000000 --- a/Sourcecode/private/mx/core/elements/MidiDevice.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/MidiDeviceAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MidiDeviceAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MidiDevice ) - - inline MidiDevicePtr makeMidiDevice() { return std::make_shared(); } - inline MidiDevicePtr makeMidiDevice( const XsString& value ) { return std::make_shared( value ); } - inline MidiDevicePtr makeMidiDevice( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class MidiDevice : public ElementInterface - { - public: - MidiDevice(); - MidiDevice( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MidiDeviceAttributesPtr getAttributes() const; - void setAttributes( const MidiDeviceAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - MidiDeviceAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.cpp b/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.cpp deleted file mode 100644 index 557a916df..000000000 --- a/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MidiDeviceAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MidiDeviceAttributes::MidiDeviceAttributes() - :port() - ,id() - ,hasPort( false ) - ,hasId( false ) - {} - - - bool MidiDeviceAttributes::hasValues() const - { - return hasPort || - hasId; - } - - - std::ostream& MidiDeviceAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, port, "port", hasPort ); - streamAttribute( os, id, "id", hasId ); - } - return os; - } - - - bool MidiDeviceAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MidiDeviceAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, port, hasPort, "port" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, id, hasId, "id" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.h b/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.h deleted file mode 100644 index 39ccbe9ca..000000000 --- a/Sourcecode/private/mx/core/elements/MidiDeviceAttributes.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Integers.h" -#include "mx/core/XsIDREF.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MidiDeviceAttributes ) - - struct MidiDeviceAttributes : public AttributesInterface - { - public: - MidiDeviceAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - Midi16 port; - XsIDREF id; - bool hasPort; - bool hasId; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.cpp b/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.cpp deleted file mode 100644 index 84afc0c19..000000000 --- a/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.cpp +++ /dev/null @@ -1,130 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MidiDeviceInstrumentGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/MidiDevice.h" -#include "mx/core/elements/MidiInstrument.h" -#include - -namespace mx -{ - namespace core - { - MidiDeviceInstrumentGroup::MidiDeviceInstrumentGroup() - :myMidiDevice( makeMidiDevice() ) - ,myHasMidiDevice( false ) - ,myMidiInstrument( makeMidiInstrument() ) - ,myHasMidiInstrument( false ) - {} - - - bool MidiDeviceInstrumentGroup::hasAttributes() const - { - return false; - } - - - std::ostream& MidiDeviceInstrumentGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MidiDeviceInstrumentGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool MidiDeviceInstrumentGroup::hasContents() const - { - return myHasMidiDevice || myHasMidiInstrument; - } - - - std::ostream& MidiDeviceInstrumentGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( this->hasContents() ) - { - if ( myHasMidiDevice ) - { - myMidiDevice->toStream( os, indentLevel ); - if ( myHasMidiInstrument ) - { - os << std::endl; - } - } - if ( myHasMidiInstrument ) - { - myMidiInstrument->toStream( os, indentLevel ); - } - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - MidiDevicePtr MidiDeviceInstrumentGroup::getMidiDevice() const - { - return myMidiDevice; - } - - - void MidiDeviceInstrumentGroup::setMidiDevice( const MidiDevicePtr& value ) - { - if ( value ) - { - myMidiDevice = value; - } - } - - - bool MidiDeviceInstrumentGroup::getHasMidiDevice() const - { - return myHasMidiDevice; - } - - - void MidiDeviceInstrumentGroup::setHasMidiDevice( const bool value ) - { - myHasMidiDevice = value; - } - - - MidiInstrumentPtr MidiDeviceInstrumentGroup::getMidiInstrument() const - { - return myMidiInstrument; - } - - - void MidiDeviceInstrumentGroup::setMidiInstrument( const MidiInstrumentPtr& value ) - { - if ( value ) - { - myMidiInstrument = value; - } - } - - - bool MidiDeviceInstrumentGroup::getHasMidiInstrument() const - { - return myHasMidiInstrument; - } - - - void MidiDeviceInstrumentGroup::setHasMidiInstrument( const bool value ) - { - myHasMidiInstrument = value; - } - - - MX_FROM_XELEMENT_UNUSED( MidiDeviceInstrumentGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.h b/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.h deleted file mode 100644 index 536abfb73..000000000 --- a/Sourcecode/private/mx/core/elements/MidiDeviceInstrumentGroup.h +++ /dev/null @@ -1,58 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MidiDevice ) - MX_FORWARD_DECLARE_ELEMENT( MidiInstrument ) - MX_FORWARD_DECLARE_ELEMENT( MidiDeviceInstrumentGroup ) - - inline MidiDeviceInstrumentGroupPtr makeMidiDeviceInstrumentGroup() { return std::make_shared(); } - - class MidiDeviceInstrumentGroup : public ElementInterface - { - public: - MidiDeviceInstrumentGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MidiDevice minOccurs = 0, maxOccurs = 1 _________ */ - MidiDevicePtr getMidiDevice() const; - void setMidiDevice( const MidiDevicePtr& value ); - bool getHasMidiDevice() const; - void setHasMidiDevice( const bool value ); - - /* _________ MidiInstrument minOccurs = 0, maxOccurs = 1 _________ */ - MidiInstrumentPtr getMidiInstrument() const; - void setMidiInstrument( const MidiInstrumentPtr& value ); - bool getHasMidiInstrument() const; - void setHasMidiInstrument( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MidiDevicePtr myMidiDevice; - bool myHasMidiDevice; - MidiInstrumentPtr myMidiInstrument; - bool myHasMidiInstrument; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiInstrument.cpp b/Sourcecode/private/mx/core/elements/MidiInstrument.cpp deleted file mode 100644 index 8518d2bbb..000000000 --- a/Sourcecode/private/mx/core/elements/MidiInstrument.cpp +++ /dev/null @@ -1,382 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MidiInstrument.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Elevation.h" -#include "mx/core/elements/MidiBank.h" -#include "mx/core/elements/MidiChannel.h" -#include "mx/core/elements/MidiName.h" -#include "mx/core/elements/MidiProgram.h" -#include "mx/core/elements/MidiUnpitched.h" -#include "mx/core/elements/Pan.h" -#include "mx/core/elements/Volume.h" -#include - -namespace mx -{ - namespace core - { - MidiInstrument::MidiInstrument() - :myAttributes( std::make_shared() ) - ,myMidiChannel( makeMidiChannel() ) - ,myHasMidiChannel( false ) - ,myMidiName( makeMidiName() ) - ,myHasMidiName( false ) - ,myMidiBank( makeMidiBank() ) - ,myHasMidiBank( false ) - ,myMidiProgram( makeMidiProgram() ) - ,myHasMidiProgram( false ) - ,myMidiUnpitched( makeMidiUnpitched() ) - ,myHasMidiUnpitched( false ) - ,myVolume( makeVolume() ) - ,myHasVolume( false ) - ,myPan( makePan() ) - ,myHasPan( false ) - ,myElevation( makeElevation() ) - ,myHasElevation( false ) - {} - - - bool MidiInstrument::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& MidiInstrument::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& MidiInstrument::streamName( std::ostream& os ) const - { - os << "midi-instrument"; - return os; - } - - - bool MidiInstrument::hasContents() const - { - return myHasMidiChannel - || myHasMidiName - || myHasMidiBank - || myHasMidiProgram - || myHasMidiUnpitched - || myHasVolume - || myHasPan - || myHasElevation; - } - - - std::ostream& MidiInstrument::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasMidiChannel ) - { - os << std::endl; - myMidiChannel->toStream( os, indentLevel+1 ); - } - if ( myHasMidiName ) - { - os << std::endl; - myMidiName->toStream( os, indentLevel+1 ); - } - if ( myHasMidiBank ) - { - os << std::endl; - myMidiBank->toStream( os, indentLevel+1 ); - } - if ( myHasMidiProgram ) - { - os << std::endl; - myMidiProgram->toStream( os, indentLevel+1 ); - } - if ( myHasMidiUnpitched ) - { - os << std::endl; - myMidiUnpitched->toStream( os, indentLevel+1 ); - } - if ( myHasVolume ) - { - os << std::endl; - myVolume->toStream( os, indentLevel+1 ); - } - if ( myHasPan ) - { - os << std::endl; - myPan->toStream( os, indentLevel+1 ); - } - if ( myHasElevation ) - { - os << std::endl; - myElevation->toStream( os, indentLevel+1 ); - } - if( hasContents() ) - { - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - MidiInstrumentAttributesPtr MidiInstrument::getAttributes() const - { - return myAttributes; - } - - - void MidiInstrument::setAttributes( const MidiInstrumentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - MidiChannelPtr MidiInstrument::getMidiChannel() const - { - return myMidiChannel; - } - - - void MidiInstrument::setMidiChannel( const MidiChannelPtr& value ) - { - if( value ) - { - myMidiChannel = value; - } - } - - - bool MidiInstrument::getHasMidiChannel() const - { - return myHasMidiChannel; - } - - - void MidiInstrument::setHasMidiChannel( const bool value ) - { - myHasMidiChannel = value; - } - - - MidiNamePtr MidiInstrument::getMidiName() const - { - return myMidiName; - } - - - void MidiInstrument::setMidiName( const MidiNamePtr& value ) - { - if( value ) - { - myMidiName = value; - } - } - - - bool MidiInstrument::getHasMidiName() const - { - return myHasMidiName; - } - - - void MidiInstrument::setHasMidiName( const bool value ) - { - myHasMidiName = value; - } - - - MidiBankPtr MidiInstrument::getMidiBank() const - { - return myMidiBank; - } - - - void MidiInstrument::setMidiBank( const MidiBankPtr& value ) - { - if( value ) - { - myMidiBank = value; - } - } - - - bool MidiInstrument::getHasMidiBank() const - { - return myHasMidiBank; - } - - - void MidiInstrument::setHasMidiBank( const bool value ) - { - myHasMidiBank = value; - } - - - MidiProgramPtr MidiInstrument::getMidiProgram() const - { - return myMidiProgram; - } - - - void MidiInstrument::setMidiProgram( const MidiProgramPtr& value ) - { - if( value ) - { - myMidiProgram = value; - } - } - - - bool MidiInstrument::getHasMidiProgram() const - { - return myHasMidiProgram; - } - - - void MidiInstrument::setHasMidiProgram( const bool value ) - { - myHasMidiProgram = value; - } - - - MidiUnpitchedPtr MidiInstrument::getMidiUnpitched() const - { - return myMidiUnpitched; - } - - - void MidiInstrument::setMidiUnpitched( const MidiUnpitchedPtr& value ) - { - if( value ) - { - myMidiUnpitched = value; - } - } - - - bool MidiInstrument::getHasMidiUnpitched() const - { - return myHasMidiUnpitched; - } - - - void MidiInstrument::setHasMidiUnpitched( const bool value ) - { - myHasMidiUnpitched = value; - } - - - VolumePtr MidiInstrument::getVolume() const - { - return myVolume; - } - - - void MidiInstrument::setVolume( const VolumePtr& value ) - { - if( value ) - { - myVolume = value; - } - } - - - bool MidiInstrument::getHasVolume() const - { - return myHasVolume; - } - - - void MidiInstrument::setHasVolume( const bool value ) - { - myHasVolume = value; - } - - - PanPtr MidiInstrument::getPan() const - { - return myPan; - } - - - void MidiInstrument::setPan( const PanPtr& value ) - { - if( value ) - { - myPan = value; - } - } - - - bool MidiInstrument::getHasPan() const - { - return myHasPan; - } - - - void MidiInstrument::setHasPan( const bool value ) - { - myHasPan = value; - } - - - ElevationPtr MidiInstrument::getElevation() const - { - return myElevation; - } - - - void MidiInstrument::setElevation( const ElevationPtr& value ) - { - if( value ) - { - myElevation = value; - } - } - - - bool MidiInstrument::getHasElevation() const - { - return myHasElevation; - } - - - void MidiInstrument::setHasElevation( const bool value ) - { - myHasElevation = value; - } - - - bool MidiInstrument::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myMidiChannel, myHasMidiChannel ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMidiName, myHasMidiName ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMidiBank, myHasMidiBank ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMidiProgram, myHasMidiProgram ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMidiUnpitched, myHasMidiUnpitched ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myVolume, myHasVolume ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPan, myHasPan ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myElevation, myHasElevation ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiInstrument.h b/Sourcecode/private/mx/core/elements/MidiInstrument.h deleted file mode 100644 index 254cdc547..000000000 --- a/Sourcecode/private/mx/core/elements/MidiInstrument.h +++ /dev/null @@ -1,117 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/MidiInstrumentAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MidiInstrumentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Elevation ) - MX_FORWARD_DECLARE_ELEMENT( MidiBank ) - MX_FORWARD_DECLARE_ELEMENT( MidiChannel ) - MX_FORWARD_DECLARE_ELEMENT( MidiName ) - MX_FORWARD_DECLARE_ELEMENT( MidiProgram ) - MX_FORWARD_DECLARE_ELEMENT( MidiUnpitched ) - MX_FORWARD_DECLARE_ELEMENT( Pan ) - MX_FORWARD_DECLARE_ELEMENT( Volume ) - MX_FORWARD_DECLARE_ELEMENT( MidiInstrument ) - - inline MidiInstrumentPtr makeMidiInstrument() { return std::make_shared(); } - - class MidiInstrument : public ElementInterface - { - public: - MidiInstrument(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MidiInstrumentAttributesPtr getAttributes() const; - void setAttributes( const MidiInstrumentAttributesPtr& value ); - - /* _________ MidiChannel minOccurs = 0, maxOccurs = 1 _________ */ - MidiChannelPtr getMidiChannel() const; - void setMidiChannel( const MidiChannelPtr& value ); - bool getHasMidiChannel() const; - void setHasMidiChannel( const bool value ); - - /* _________ MidiName minOccurs = 0, maxOccurs = 1 _________ */ - MidiNamePtr getMidiName() const; - void setMidiName( const MidiNamePtr& value ); - bool getHasMidiName() const; - void setHasMidiName( const bool value ); - - /* _________ MidiBank minOccurs = 0, maxOccurs = 1 _________ */ - MidiBankPtr getMidiBank() const; - void setMidiBank( const MidiBankPtr& value ); - bool getHasMidiBank() const; - void setHasMidiBank( const bool value ); - - /* _________ MidiProgram minOccurs = 0, maxOccurs = 1 _________ */ - MidiProgramPtr getMidiProgram() const; - void setMidiProgram( const MidiProgramPtr& value ); - bool getHasMidiProgram() const; - void setHasMidiProgram( const bool value ); - - /* _________ MidiUnpitched minOccurs = 0, maxOccurs = 1 _________ */ - MidiUnpitchedPtr getMidiUnpitched() const; - void setMidiUnpitched( const MidiUnpitchedPtr& value ); - bool getHasMidiUnpitched() const; - void setHasMidiUnpitched( const bool value ); - - /* _________ Volume minOccurs = 0, maxOccurs = 1 _________ */ - VolumePtr getVolume() const; - void setVolume( const VolumePtr& value ); - bool getHasVolume() const; - void setHasVolume( const bool value ); - - /* _________ Pan minOccurs = 0, maxOccurs = 1 _________ */ - PanPtr getPan() const; - void setPan( const PanPtr& value ); - bool getHasPan() const; - void setHasPan( const bool value ); - - /* _________ Elevation minOccurs = 0, maxOccurs = 1 _________ */ - ElevationPtr getElevation() const; - void setElevation( const ElevationPtr& value ); - bool getHasElevation() const; - void setHasElevation( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MidiInstrumentAttributesPtr myAttributes; - MidiChannelPtr myMidiChannel; - bool myHasMidiChannel; - MidiNamePtr myMidiName; - bool myHasMidiName; - MidiBankPtr myMidiBank; - bool myHasMidiBank; - MidiProgramPtr myMidiProgram; - bool myHasMidiProgram; - MidiUnpitchedPtr myMidiUnpitched; - bool myHasMidiUnpitched; - VolumePtr myVolume; - bool myHasVolume; - PanPtr myPan; - bool myHasPan; - ElevationPtr myElevation; - bool myHasElevation; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.cpp b/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.cpp deleted file mode 100644 index 25d88e611..000000000 --- a/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MidiInstrumentAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MidiInstrumentAttributes::MidiInstrumentAttributes() - :id() - ,hasId( true ) - {} - - - bool MidiInstrumentAttributes::hasValues() const - { - return hasId; - } - - - std::ostream& MidiInstrumentAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - } - return os; - } - - - bool MidiInstrumentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MidiInstrumentAttributes"; - bool isSuccess = true; - bool isIdFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, isIdFound, "id" ) ) { continue; } - } - - if( !isIdFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.h b/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.h deleted file mode 100644 index a4f733d0f..000000000 --- a/Sourcecode/private/mx/core/elements/MidiInstrumentAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/XsIDREF.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MidiInstrumentAttributes ) - - struct MidiInstrumentAttributes : public AttributesInterface - { - public: - MidiInstrumentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsIDREF id; - const bool hasId; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiName.cpp b/Sourcecode/private/mx/core/elements/MidiName.cpp deleted file mode 100644 index 958c5ca36..000000000 --- a/Sourcecode/private/mx/core/elements/MidiName.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MidiName.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MidiName::MidiName() - :myValue() - {} - - - MidiName::MidiName( const XsString& value ) - :myValue( value ) - {} - - - bool MidiName::hasAttributes() const - { - return false; - } - - - bool MidiName::hasContents() const - { - return true; - } - - - std::ostream& MidiName::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MidiName::streamName( std::ostream& os ) const - { - os << "midi-name"; - return os; - } - - - std::ostream& MidiName::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString MidiName::getValue() const - { - return myValue; - } - - - void MidiName::setValue( const XsString& value ) - { - myValue = value; - } - - - bool MidiName::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiName.h b/Sourcecode/private/mx/core/elements/MidiName.h deleted file mode 100644 index 6d0a585c8..000000000 --- a/Sourcecode/private/mx/core/elements/MidiName.h +++ /dev/null @@ -1,46 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - MX_FORWARD_DECLARE_ELEMENT( MidiName ) - - inline MidiNamePtr makeMidiName() { return std::make_shared(); } - inline MidiNamePtr makeMidiName( const XsString& value ) { return std::make_shared( value ); } - inline MidiNamePtr makeMidiName( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class MidiName : public ElementInterface - { - public: - MidiName(); - MidiName( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiProgram.cpp b/Sourcecode/private/mx/core/elements/MidiProgram.cpp deleted file mode 100644 index 15868e2da..000000000 --- a/Sourcecode/private/mx/core/elements/MidiProgram.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MidiProgram.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MidiProgram::MidiProgram() - :myValue() - {} - - - MidiProgram::MidiProgram( const Midi128& value ) - :myValue( value ) - {} - - - bool MidiProgram::hasAttributes() const - { - return false; - } - - - bool MidiProgram::hasContents() const - { - return true; - } - - - std::ostream& MidiProgram::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MidiProgram::streamName( std::ostream& os ) const - { - os << "midi-program"; - return os; - } - - - std::ostream& MidiProgram::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Midi128 MidiProgram::getValue() const - { - return myValue; - } - - - void MidiProgram::setValue( const Midi128& value ) - { - myValue = value; - } - - - bool MidiProgram::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiProgram.h b/Sourcecode/private/mx/core/elements/MidiProgram.h deleted file mode 100644 index 0eb4dcf77..000000000 --- a/Sourcecode/private/mx/core/elements/MidiProgram.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MidiProgram ) - - inline MidiProgramPtr makeMidiProgram() { return std::make_shared(); } - inline MidiProgramPtr makeMidiProgram( const Midi128& value ) { return std::make_shared( value ); } - inline MidiProgramPtr makeMidiProgram( Midi128&& value ) { return std::make_shared( std::move( value ) ); } - - class MidiProgram : public ElementInterface - { - public: - MidiProgram(); - MidiProgram( const Midi128& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Midi128 getValue() const; - void setValue( const Midi128& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Midi128 myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiUnpitched.cpp b/Sourcecode/private/mx/core/elements/MidiUnpitched.cpp deleted file mode 100644 index 6cb3e589e..000000000 --- a/Sourcecode/private/mx/core/elements/MidiUnpitched.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MidiUnpitched.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MidiUnpitched::MidiUnpitched() - :myValue() - {} - - - MidiUnpitched::MidiUnpitched( const Midi128& value ) - :myValue( value ) - {} - - - bool MidiUnpitched::hasAttributes() const - { - return false; - } - - - bool MidiUnpitched::hasContents() const - { - return true; - } - - - std::ostream& MidiUnpitched::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MidiUnpitched::streamName( std::ostream& os ) const - { - os << "midi-unpitched"; - return os; - } - - - std::ostream& MidiUnpitched::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Midi128 MidiUnpitched::getValue() const - { - return myValue; - } - - - void MidiUnpitched::setValue( const Midi128& value ) - { - myValue = value; - } - - - bool MidiUnpitched::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MidiUnpitched.h b/Sourcecode/private/mx/core/elements/MidiUnpitched.h deleted file mode 100644 index 43481e38f..000000000 --- a/Sourcecode/private/mx/core/elements/MidiUnpitched.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MidiUnpitched ) - - inline MidiUnpitchedPtr makeMidiUnpitched() { return std::make_shared(); } - inline MidiUnpitchedPtr makeMidiUnpitched( const Midi128& value ) { return std::make_shared( value ); } - inline MidiUnpitchedPtr makeMidiUnpitched( Midi128&& value ) { return std::make_shared( std::move( value ) ); } - - class MidiUnpitched : public ElementInterface - { - public: - MidiUnpitched(); - MidiUnpitched( const Midi128& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Midi128 getValue() const; - void setValue( const Midi128& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Midi128 myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Millimeters.cpp b/Sourcecode/private/mx/core/elements/Millimeters.cpp deleted file mode 100644 index ac2b0d40f..000000000 --- a/Sourcecode/private/mx/core/elements/Millimeters.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Millimeters.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Millimeters::Millimeters() - :myValue() - {} - - - Millimeters::Millimeters( const MillimetersValue& value ) - :myValue( value ) - {} - - - bool Millimeters::hasAttributes() const - { - return false; - } - - - bool Millimeters::hasContents() const - { - return true; - } - - - std::ostream& Millimeters::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Millimeters::streamName( std::ostream& os ) const - { - os << "millimeters"; - return os; - } - - - std::ostream& Millimeters::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - MillimetersValue Millimeters::getValue() const - { - return myValue; - } - - - void Millimeters::setValue( const MillimetersValue& value ) - { - myValue = value; - } - - - bool Millimeters::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Millimeters.h b/Sourcecode/private/mx/core/elements/Millimeters.h deleted file mode 100644 index ffd3b9770..000000000 --- a/Sourcecode/private/mx/core/elements/Millimeters.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Millimeters ) - - inline MillimetersPtr makeMillimeters() { return std::make_shared(); } - inline MillimetersPtr makeMillimeters( const MillimetersValue& value ) { return std::make_shared( value ); } - inline MillimetersPtr makeMillimeters( MillimetersValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Millimeters : public ElementInterface - { - public: - Millimeters(); - Millimeters( const MillimetersValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MillimetersValue getValue() const; - void setValue( const MillimetersValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MillimetersValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Miscellaneous.cpp b/Sourcecode/private/mx/core/elements/Miscellaneous.cpp deleted file mode 100644 index 1803e604d..000000000 --- a/Sourcecode/private/mx/core/elements/Miscellaneous.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Miscellaneous.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/MiscellaneousField.h" -#include - -namespace mx -{ - namespace core - { - Miscellaneous::Miscellaneous() - :myMiscellaneousFieldSet() - {} - - - bool Miscellaneous::hasAttributes() const - { - return false; - } - - - std::ostream& Miscellaneous::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Miscellaneous::streamName( std::ostream& os ) const - { - os << "miscellaneous"; - return os; - } - - - bool Miscellaneous::hasContents() const - { - return myMiscellaneousFieldSet.size() > 0; - } - - - std::ostream& Miscellaneous::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for( auto x : myMiscellaneousFieldSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( hasContents() ) - { - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - const MiscellaneousFieldSet& Miscellaneous::getMiscellaneousFieldSet() const - { - return myMiscellaneousFieldSet; - } - - - void Miscellaneous::removeMiscellaneousField( const MiscellaneousFieldSetIterConst& value ) - { - if ( value != myMiscellaneousFieldSet.cend() ) - { - myMiscellaneousFieldSet.erase( value ); - } - } - - - void Miscellaneous::addMiscellaneousField( const MiscellaneousFieldPtr& value ) - { - if ( value ) - { - myMiscellaneousFieldSet.push_back( value ); - } - } - - - void Miscellaneous::clearMiscellaneousFieldSet() - { - myMiscellaneousFieldSet.clear(); - } - - - MiscellaneousFieldPtr Miscellaneous::getMiscellaneousField( const MiscellaneousFieldSetIterConst& setIterator ) const - { - if( setIterator != myMiscellaneousFieldSet.cend() ) - { - return *setIterator; - } - return MiscellaneousFieldPtr(); - } - - - bool Miscellaneous::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "miscellaneous-field", myMiscellaneousFieldSet ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Miscellaneous.h b/Sourcecode/private/mx/core/elements/Miscellaneous.h deleted file mode 100644 index 9972c3444..000000000 --- a/Sourcecode/private/mx/core/elements/Miscellaneous.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MiscellaneousField ) - MX_FORWARD_DECLARE_ELEMENT( Miscellaneous ) - - inline MiscellaneousPtr makeMiscellaneous() { return std::make_shared(); } - - class Miscellaneous : public ElementInterface - { - public: - Miscellaneous(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MiscellaneousField minOccurs = 0, maxOccurs = unbounded _________ */ - const MiscellaneousFieldSet& getMiscellaneousFieldSet() const; - void addMiscellaneousField( const MiscellaneousFieldPtr& value ); - void removeMiscellaneousField( const MiscellaneousFieldSetIterConst& value ); - void clearMiscellaneousFieldSet(); - MiscellaneousFieldPtr getMiscellaneousField( const MiscellaneousFieldSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MiscellaneousFieldSet myMiscellaneousFieldSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MiscellaneousField.cpp b/Sourcecode/private/mx/core/elements/MiscellaneousField.cpp deleted file mode 100644 index 87d698bea..000000000 --- a/Sourcecode/private/mx/core/elements/MiscellaneousField.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MiscellaneousField.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MiscellaneousField::MiscellaneousField() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - MiscellaneousField::MiscellaneousField( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool MiscellaneousField::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MiscellaneousField::hasContents() const - { - return true; - } - - - std::ostream& MiscellaneousField::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MiscellaneousField::streamName( std::ostream& os ) const - { - os << "miscellaneous-field"; - return os; - } - - - std::ostream& MiscellaneousField::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - MiscellaneousFieldAttributesPtr MiscellaneousField::getAttributes() const - { - return myAttributes; - } - - - void MiscellaneousField::setAttributes( const MiscellaneousFieldAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString MiscellaneousField::getValue() const - { - return myValue; - } - - - void MiscellaneousField::setValue( const XsString& value ) - { - myValue = value; - } - - - bool MiscellaneousField::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MiscellaneousField.h b/Sourcecode/private/mx/core/elements/MiscellaneousField.h deleted file mode 100644 index a4050cd2e..000000000 --- a/Sourcecode/private/mx/core/elements/MiscellaneousField.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/MiscellaneousFieldAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MiscellaneousFieldAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MiscellaneousField ) - - inline MiscellaneousFieldPtr makeMiscellaneousField() { return std::make_shared(); } - inline MiscellaneousFieldPtr makeMiscellaneousField( const XsString& value ) { return std::make_shared( value ); } - inline MiscellaneousFieldPtr makeMiscellaneousField( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class MiscellaneousField : public ElementInterface - { - public: - MiscellaneousField(); - MiscellaneousField( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MiscellaneousFieldAttributesPtr getAttributes() const; - void setAttributes( const MiscellaneousFieldAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - MiscellaneousFieldAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.cpp b/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.cpp deleted file mode 100644 index 7d547f4ad..000000000 --- a/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MiscellaneousFieldAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MiscellaneousFieldAttributes::MiscellaneousFieldAttributes() - :name() - ,hasName( true ) - {} - - - bool MiscellaneousFieldAttributes::hasValues() const - { - return hasName; - } - - - std::ostream& MiscellaneousFieldAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, name, "name", hasName ); - } - return os; - } - - - bool MiscellaneousFieldAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MiscellaneousFieldAttributes"; - bool isSuccess = true; - bool isNameFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, name, isNameFound, "name" ) ) { continue; } - } - - if( !isNameFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.h b/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.h deleted file mode 100644 index b565c35d7..000000000 --- a/Sourcecode/private/mx/core/elements/MiscellaneousFieldAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MiscellaneousFieldAttributes ) - - struct MiscellaneousFieldAttributes : public AttributesInterface - { - public: - MiscellaneousFieldAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken name; - const bool hasName; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Mode.cpp b/Sourcecode/private/mx/core/elements/Mode.cpp deleted file mode 100644 index f25e27105..000000000 --- a/Sourcecode/private/mx/core/elements/Mode.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Mode.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Mode::Mode() - :myValue() - {} - - - Mode::Mode( const ModeValue& value ) - :myValue( value ) - {} - - - bool Mode::hasAttributes() const - { - return false; - } - - - bool Mode::hasContents() const - { - return true; - } - - - std::ostream& Mode::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Mode::streamName( std::ostream& os ) const - { - os << "mode"; - return os; - } - - - std::ostream& Mode::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - ModeValue Mode::getValue() const - { - return myValue; - } - - - void Mode::setValue( const ModeValue& value ) - { - myValue = value; - } - - - bool Mode::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Mode.h b/Sourcecode/private/mx/core/elements/Mode.h deleted file mode 100644 index 812a474a0..000000000 --- a/Sourcecode/private/mx/core/elements/Mode.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Mode ) - - inline ModePtr makeMode() { return std::make_shared(); } - inline ModePtr makeMode( const ModeValue& value ) { return std::make_shared( value ); } - inline ModePtr makeMode( ModeValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Mode : public ElementInterface - { - public: - Mode(); - Mode( const ModeValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ModeValue getValue() const; - void setValue( const ModeValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ModeValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Mordent.cpp b/Sourcecode/private/mx/core/elements/Mordent.cpp deleted file mode 100644 index 41bee3a75..000000000 --- a/Sourcecode/private/mx/core/elements/Mordent.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Mordent.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Mordent::Mordent() - :myAttributes( std::make_shared() ) - {} - - - bool Mordent::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Mordent::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Mordent::streamName( std::ostream& os ) const - { - os << "mordent"; - return os; - } - - - bool Mordent::hasContents() const - { - return false; - } - - - std::ostream& Mordent::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - MordentAttributesPtr Mordent::getAttributes() const - { - return myAttributes; - } - - - void Mordent::setAttributes( const MordentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Mordent::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Mordent.h b/Sourcecode/private/mx/core/elements/Mordent.h deleted file mode 100644 index a1bfcda55..000000000 --- a/Sourcecode/private/mx/core/elements/Mordent.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/MordentAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MordentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Mordent ) - - inline MordentPtr makeMordent() { return std::make_shared(); } - - class Mordent : public ElementInterface - { - public: - Mordent(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MordentAttributesPtr getAttributes() const; - void setAttributes( const MordentAttributesPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MordentAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MordentAttributes.cpp b/Sourcecode/private/mx/core/elements/MordentAttributes.cpp deleted file mode 100644 index 7871c547a..000000000 --- a/Sourcecode/private/mx/core/elements/MordentAttributes.cpp +++ /dev/null @@ -1,148 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MordentAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MordentAttributes::MordentAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,startNote( StartNote::main ) - ,trillStep( TrillStep::half ) - ,twoNoteTurn( TwoNoteTurn::none ) - ,accelerate( YesNo::no ) - ,beats() - ,secondBeat() - ,lastBeat() - ,long_( YesNo::no ) - ,approach( AboveBelow::below ) - ,departure( AboveBelow::below ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - ,hasStartNote( false ) - ,hasTrillStep( false ) - ,hasTwoNoteTurn( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasSecondBeat( false ) - ,hasLastBeat( false ) - ,hasLong( false ) - ,hasApproach( false ) - ,hasDeparture( false ) - {} - - - bool MordentAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement || - hasStartNote || - hasTrillStep || - hasTwoNoteTurn || - hasAccelerate || - hasBeats || - hasSecondBeat || - hasLastBeat || - hasLong || - hasApproach || - hasDeparture; - } - - - std::ostream& MordentAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, startNote, "start-note", hasStartNote ); - streamAttribute( os, trillStep, "trill-step", hasTrillStep ); - streamAttribute( os, twoNoteTurn, "two-note-turn", hasTwoNoteTurn ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, secondBeat, "second-beat", hasSecondBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - streamAttribute( os, long_, "long", hasLong ); - streamAttribute( os, approach, "approach", hasApproach ); - streamAttribute( os, departure, "departure", hasDeparture ); - } - return os; - } - - - bool MordentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MordentAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, startNote, hasStartNote, "start-note", &parseStartNote ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, trillStep, hasTrillStep, "trill-step", &parseTrillStep ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, twoNoteTurn, hasTwoNoteTurn, "two-note-turn", &parseTwoNoteTurn ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, secondBeat, hasSecondBeat, "second-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, long_, hasLong , "long", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, approach, hasApproach, "approach", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, departure, hasDeparture, "departure", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MordentAttributes.h b/Sourcecode/private/mx/core/elements/MordentAttributes.h deleted file mode 100644 index 7b0d8b82c..000000000 --- a/Sourcecode/private/mx/core/elements/MordentAttributes.h +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MordentAttributes ) - - struct MordentAttributes : public AttributesInterface - { - public: - MordentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - StartNote startNote; - TrillStep trillStep; - TwoNoteTurn twoNoteTurn; - YesNo accelerate; - TrillBeats beats; - Percent secondBeat; - Percent lastBeat; - YesNo long_; - AboveBelow approach; - AboveBelow departure; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - bool hasStartNote; - bool hasTrillStep; - bool hasTwoNoteTurn; - bool hasAccelerate; - bool hasBeats; - bool hasSecondBeat; - bool hasLastBeat; - bool hasLong; - bool hasApproach; - bool hasDeparture; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MovementNumber.cpp b/Sourcecode/private/mx/core/elements/MovementNumber.cpp deleted file mode 100644 index 08d8ada7e..000000000 --- a/Sourcecode/private/mx/core/elements/MovementNumber.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MovementNumber.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MovementNumber::MovementNumber() - :myValue() - {} - - - MovementNumber::MovementNumber( const XsString& value ) - :myValue( value ) - {} - - - bool MovementNumber::hasAttributes() const - { - return false; - } - - - bool MovementNumber::hasContents() const - { - return true; - } - - - std::ostream& MovementNumber::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MovementNumber::streamName( std::ostream& os ) const - { - os << "movement-number"; - return os; - } - - - std::ostream& MovementNumber::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString MovementNumber::getValue() const - { - return myValue; - } - - - void MovementNumber::setValue( const XsString& value ) - { - myValue = value; - } - - - bool MovementNumber::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MovementNumber.h b/Sourcecode/private/mx/core/elements/MovementNumber.h deleted file mode 100644 index 776713e26..000000000 --- a/Sourcecode/private/mx/core/elements/MovementNumber.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MovementNumber ) - - inline MovementNumberPtr makeMovementNumber() { return std::make_shared(); } - inline MovementNumberPtr makeMovementNumber( const XsString& value ) { return std::make_shared( value ); } - inline MovementNumberPtr makeMovementNumber( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class MovementNumber : public ElementInterface - { - public: - MovementNumber(); - MovementNumber( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MovementTitle.cpp b/Sourcecode/private/mx/core/elements/MovementTitle.cpp deleted file mode 100644 index aa9a87763..000000000 --- a/Sourcecode/private/mx/core/elements/MovementTitle.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MovementTitle.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MovementTitle::MovementTitle() - :myValue() - {} - - - MovementTitle::MovementTitle( const XsString& value ) - :myValue( value ) - {} - - - bool MovementTitle::hasAttributes() const - { - return false; - } - - - bool MovementTitle::hasContents() const - { - return true; - } - - - std::ostream& MovementTitle::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MovementTitle::streamName( std::ostream& os ) const - { - os << "movement-title"; - return os; - } - - - std::ostream& MovementTitle::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString MovementTitle::getValue() const - { - return myValue; - } - - - void MovementTitle::setValue( const XsString& value ) - { - myValue = value; - } - - - bool MovementTitle::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MovementTitle.h b/Sourcecode/private/mx/core/elements/MovementTitle.h deleted file mode 100644 index 0a8e62bf1..000000000 --- a/Sourcecode/private/mx/core/elements/MovementTitle.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MovementTitle ) - - inline MovementTitlePtr makeMovementTitle() { return std::make_shared(); } - inline MovementTitlePtr makeMovementTitle( const XsString& value ) { return std::make_shared( value ); } - inline MovementTitlePtr makeMovementTitle( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class MovementTitle : public ElementInterface - { - public: - MovementTitle(); - MovementTitle( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MultipleRest.cpp b/Sourcecode/private/mx/core/elements/MultipleRest.cpp deleted file mode 100644 index a428d3e9e..000000000 --- a/Sourcecode/private/mx/core/elements/MultipleRest.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MultipleRest.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MultipleRest::MultipleRest() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - MultipleRest::MultipleRest( const PositiveIntegerOrEmpty& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool MultipleRest::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MultipleRest::hasContents() const - { - return true; - } - - - std::ostream& MultipleRest::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MultipleRest::streamName( std::ostream& os ) const - { - os << "multiple-rest"; - return os; - } - - - std::ostream& MultipleRest::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - MultipleRestAttributesPtr MultipleRest::getAttributes() const - { - return myAttributes; - } - - - void MultipleRest::setAttributes( const MultipleRestAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - PositiveIntegerOrEmpty MultipleRest::getValue() const - { - return myValue; - } - - - void MultipleRest::setValue( const PositiveIntegerOrEmpty& value ) - { - myValue = value; - } - - - bool MultipleRest::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MultipleRest.h b/Sourcecode/private/mx/core/elements/MultipleRest.h deleted file mode 100644 index 66ee8bd94..000000000 --- a/Sourcecode/private/mx/core/elements/MultipleRest.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/PositiveIntegerOrEmpty.h" -#include "mx/core/elements/MultipleRestAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MultipleRestAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MultipleRest ) - - inline MultipleRestPtr makeMultipleRest() { return std::make_shared(); } - inline MultipleRestPtr makeMultipleRest( const PositiveIntegerOrEmpty& value ) { return std::make_shared( value ); } - inline MultipleRestPtr makeMultipleRest( PositiveIntegerOrEmpty&& value ) { return std::make_shared( std::move( value ) ); } - - class MultipleRest : public ElementInterface - { - public: - MultipleRest(); - MultipleRest( const PositiveIntegerOrEmpty& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MultipleRestAttributesPtr getAttributes() const; - void setAttributes( const MultipleRestAttributesPtr& attributes ); - PositiveIntegerOrEmpty getValue() const; - void setValue( const PositiveIntegerOrEmpty& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveIntegerOrEmpty myValue; - MultipleRestAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MultipleRestAttributes.cpp b/Sourcecode/private/mx/core/elements/MultipleRestAttributes.cpp deleted file mode 100644 index 1ca8f2d3c..000000000 --- a/Sourcecode/private/mx/core/elements/MultipleRestAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MultipleRestAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MultipleRestAttributes::MultipleRestAttributes() - :useSymbols() - ,hasUseSymbols( false ) - {} - - - bool MultipleRestAttributes::hasValues() const - { - return hasUseSymbols; - } - - - std::ostream& MultipleRestAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, useSymbols, "use-symbols", hasUseSymbols ); - } - return os; - } - - - bool MultipleRestAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "MultipleRestAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, useSymbols, hasUseSymbols, "use-symbols", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MultipleRestAttributes.h b/Sourcecode/private/mx/core/elements/MultipleRestAttributes.h deleted file mode 100644 index 1f6ac528e..000000000 --- a/Sourcecode/private/mx/core/elements/MultipleRestAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MultipleRestAttributes ) - - struct MultipleRestAttributes : public AttributesInterface - { - public: - MultipleRestAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo useSymbols; - bool hasUseSymbols; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MusicDataChoice.cpp b/Sourcecode/private/mx/core/elements/MusicDataChoice.cpp deleted file mode 100644 index 3eaf5c7b0..000000000 --- a/Sourcecode/private/mx/core/elements/MusicDataChoice.cpp +++ /dev/null @@ -1,356 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MusicDataChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Backup.h" -#include "mx/core/elements/Barline.h" -#include "mx/core/elements/Bookmark.h" -#include "mx/core/elements/Direction.h" -#include "mx/core/elements/FiguredBass.h" -#include "mx/core/elements/Forward.h" -#include "mx/core/elements/Grouping.h" -#include "mx/core/elements/Harmony.h" -#include "mx/core/elements/Link.h" -#include "mx/core/elements/Note.h" -#include "mx/core/elements/Print.h" -#include "mx/core/elements/Properties.h" -#include "mx/core/elements/Sound.h" -#include - - -namespace mx -{ - namespace core - { - MusicDataChoice::MusicDataChoice() - :myChoice( Choice::note ) - ,myNote( nullptr ) - ,myBackup( nullptr ) - ,myForward( nullptr ) - ,myDirection( nullptr ) - ,myProperties( nullptr ) - ,myHarmony( nullptr ) - ,myFiguredBass( nullptr ) - ,myPrint( nullptr ) - ,mySound( nullptr ) - ,myBarline( nullptr ) - ,myGrouping( nullptr ) - ,myLink( nullptr ) - ,myBookmark( nullptr ) - {} - - - bool MusicDataChoice::hasAttributes() const - { - return false; - } - - - std::ostream& MusicDataChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MusicDataChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool MusicDataChoice::hasContents() const - { - return true; - } - - - std::ostream& MusicDataChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::note: - getNote()->toStream( os, indentLevel ); - break; - case Choice::backup: - getBackup()->toStream( os, indentLevel ); - break; - case Choice::forward: - getForward()->toStream( os, indentLevel ); - break; - case Choice::direction: - getDirection()->toStream( os, indentLevel ); - break; - case Choice::properties: - getProperties()->toStream( os, indentLevel ); - break; - case Choice::harmony: - getHarmony()->toStream( os, indentLevel ); - break; - case Choice::figuredBass: - getFiguredBass()->toStream( os, indentLevel ); - break; - case Choice::print: - getPrint()->toStream( os, indentLevel ); - break; - case Choice::sound: - getSound()->toStream( os, indentLevel ); - break; - case Choice::barline: - getBarline()->toStream( os, indentLevel ); - break; - case Choice::grouping: - getGrouping()->toStream( os, indentLevel ); - break; - case Choice::link: - getLink()->toStream( os, indentLevel ); - break; - case Choice::bookmark: - getBookmark()->toStream( os, indentLevel ); - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - MusicDataChoice::Choice MusicDataChoice::getChoice() const - { - return myChoice; - } - - - void MusicDataChoice::setChoice( const MusicDataChoice::Choice value ) - { - myChoice = value; - } - - - NotePtr MusicDataChoice::getNote() const - { - MX_LOCK - MX_JIT_ALLOCATE( Note ); - return myNote; - } - - - void MusicDataChoice::setNote( const NotePtr& value ) - { - if ( value ) - { - myNote = value; - } - } - - - BackupPtr MusicDataChoice::getBackup() const - { - MX_LOCK - MX_JIT_ALLOCATE( Backup ); - return myBackup; - } - - - void MusicDataChoice::setBackup( const BackupPtr& value ) - { - if ( value ) - { - myBackup = value; - } - } - - - ForwardPtr MusicDataChoice::getForward() const - { - MX_LOCK - MX_JIT_ALLOCATE( Forward ); - return myForward; - } - - - void MusicDataChoice::setForward( const ForwardPtr& value ) - { - if ( value ) - { - myForward = value; - } - } - - - DirectionPtr MusicDataChoice::getDirection() const - { - MX_LOCK - MX_JIT_ALLOCATE( Direction ); - return myDirection; - } - - - void MusicDataChoice::setDirection( const DirectionPtr& value ) - { - if ( value ) - { - myDirection = value; - } - } - - - PropertiesPtr MusicDataChoice::getProperties() const - { - MX_LOCK - MX_JIT_ALLOCATE( Properties ); - return myProperties; - } - - - void MusicDataChoice::setProperties( const PropertiesPtr& value ) - { - if ( value ) - { - myProperties = value; - } - } - - - HarmonyPtr MusicDataChoice::getHarmony() const - { - MX_LOCK - MX_JIT_ALLOCATE( Harmony ); - return myHarmony; - } - - - void MusicDataChoice::setHarmony( const HarmonyPtr& value ) - { - if ( value ) - { - myHarmony = value; - } - } - - - FiguredBassPtr MusicDataChoice::getFiguredBass() const - { - MX_LOCK - MX_JIT_ALLOCATE( FiguredBass ); - return myFiguredBass; - } - - - void MusicDataChoice::setFiguredBass( const FiguredBassPtr& value ) - { - if ( value ) - { - myFiguredBass = value; - } - } - - - PrintPtr MusicDataChoice::getPrint() const - { - MX_LOCK - MX_JIT_ALLOCATE( Print ); - return myPrint; - } - - - void MusicDataChoice::setPrint( const PrintPtr& value ) - { - if ( value ) - { - myPrint = value; - } - } - - - SoundPtr MusicDataChoice::getSound() const - { - MX_LOCK - MX_JIT_ALLOCATE( Sound ); - return mySound; - } - - - void MusicDataChoice::setSound( const SoundPtr& value ) - { - if ( value ) - { - mySound = value; - } - } - - - BarlinePtr MusicDataChoice::getBarline() const - { - MX_LOCK - MX_JIT_ALLOCATE( Barline ); - return myBarline; - } - - - void MusicDataChoice::setBarline( const BarlinePtr& value ) - { - if ( value ) - { - myBarline = value; - } - } - - - GroupingPtr MusicDataChoice::getGrouping() const - { - MX_LOCK - MX_JIT_ALLOCATE( Grouping ); - return myGrouping; - } - - - void MusicDataChoice::setGrouping( const GroupingPtr& value ) - { - if ( value ) - { - myGrouping = value; - } - } - - - LinkPtr MusicDataChoice::getLink() const - { - MX_LOCK - MX_JIT_ALLOCATE( Link ); - return myLink; - } - - - void MusicDataChoice::setLink( const LinkPtr& value ) - { - if ( value ) - { - myLink = value; - } - } - - - BookmarkPtr MusicDataChoice::getBookmark() const - { - MX_LOCK - MX_JIT_ALLOCATE( Bookmark ); - return myBookmark; - } - - - void MusicDataChoice::setBookmark( const BookmarkPtr& value ) - { - if ( value ) - { - myBookmark = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( MusicDataChoice ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/MusicDataChoice.h b/Sourcecode/private/mx/core/elements/MusicDataChoice.h deleted file mode 100644 index 81e3f1798..000000000 --- a/Sourcecode/private/mx/core/elements/MusicDataChoice.h +++ /dev/null @@ -1,140 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Backup ) - MX_FORWARD_DECLARE_ELEMENT( Barline ) - MX_FORWARD_DECLARE_ELEMENT( Bookmark ) - MX_FORWARD_DECLARE_ELEMENT( Direction ) - MX_FORWARD_DECLARE_ELEMENT( FiguredBass ) - MX_FORWARD_DECLARE_ELEMENT( Forward ) - MX_FORWARD_DECLARE_ELEMENT( Grouping ) - MX_FORWARD_DECLARE_ELEMENT( Harmony ) - MX_FORWARD_DECLARE_ELEMENT( Link ) - MX_FORWARD_DECLARE_ELEMENT( Note ) - MX_FORWARD_DECLARE_ELEMENT( Print ) - MX_FORWARD_DECLARE_ELEMENT( Properties ) - MX_FORWARD_DECLARE_ELEMENT( Sound ) - MX_FORWARD_DECLARE_ELEMENT( MusicDataChoice ) - - inline MusicDataChoicePtr makeMusicDataChoice() { return std::make_shared(); } - - class MusicDataChoice : public ElementInterface - { - public: - enum class Choice - { - note = 1, - backup = 2, - forward = 3, - direction = 4, - properties = 5, - harmony = 6, - figuredBass = 7, - print = 8, - sound = 9, - barline = 10, - grouping = 11, - link = 12, - bookmark = 13 - }; - MusicDataChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - MusicDataChoice::Choice getChoice() const; - void setChoice( const MusicDataChoice::Choice value ); - - /* _________ Note minOccurs = 1, maxOccurs = 1 _________ */ - NotePtr getNote() const; - void setNote( const NotePtr& value ); - - /* _________ Backup minOccurs = 1, maxOccurs = 1 _________ */ - BackupPtr getBackup() const; - void setBackup( const BackupPtr& value ); - - /* _________ Forward minOccurs = 1, maxOccurs = 1 _________ */ - ForwardPtr getForward() const; - void setForward( const ForwardPtr& value ); - - /* _________ Direction minOccurs = 1, maxOccurs = 1 _________ */ - DirectionPtr getDirection() const; - void setDirection( const DirectionPtr& value ); - - /* _________ Properties minOccurs = 1, maxOccurs = 1 _________ */ - PropertiesPtr getProperties() const; - void setProperties( const PropertiesPtr& value ); - - /* _________ Harmony minOccurs = 1, maxOccurs = 1 _________ */ - HarmonyPtr getHarmony() const; - void setHarmony( const HarmonyPtr& value ); - - /* _________ FiguredBass minOccurs = 1, maxOccurs = 1 _________ */ - FiguredBassPtr getFiguredBass() const; - void setFiguredBass( const FiguredBassPtr& value ); - - /* _________ Print minOccurs = 1, maxOccurs = 1 _________ */ - PrintPtr getPrint() const; - void setPrint( const PrintPtr& value ); - - /* _________ Sound minOccurs = 1, maxOccurs = 1 _________ */ - SoundPtr getSound() const; - void setSound( const SoundPtr& value ); - - /* _________ Barline minOccurs = 1, maxOccurs = 1 _________ */ - BarlinePtr getBarline() const; - void setBarline( const BarlinePtr& value ); - - /* _________ Grouping minOccurs = 1, maxOccurs = 1 _________ */ - GroupingPtr getGrouping() const; - void setGrouping( const GroupingPtr& value ); - - /* _________ Link minOccurs = 1, maxOccurs = 1 _________ */ - LinkPtr getLink() const; - void setLink( const LinkPtr& value ); - - /* _________ Bookmark minOccurs = 1, maxOccurs = 1 _________ */ - BookmarkPtr getBookmark() const; - void setBookmark( const BookmarkPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MX_MUTEX - Choice myChoice; - mutable NotePtr myNote; - mutable BackupPtr myBackup; - mutable ForwardPtr myForward; - mutable DirectionPtr myDirection; - mutable PropertiesPtr myProperties; - mutable HarmonyPtr myHarmony; - mutable FiguredBassPtr myFiguredBass; - mutable PrintPtr myPrint; - mutable SoundPtr mySound; - mutable BarlinePtr myBarline; - mutable GroupingPtr myGrouping; - mutable LinkPtr myLink; - mutable BookmarkPtr myBookmark; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MusicDataGroup.cpp b/Sourcecode/private/mx/core/elements/MusicDataGroup.cpp deleted file mode 100644 index d073bbcbf..000000000 --- a/Sourcecode/private/mx/core/elements/MusicDataGroup.cpp +++ /dev/null @@ -1,102 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MusicDataGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/MusicDataChoice.h" -#include - -namespace mx -{ - namespace core - { - MusicDataGroup::MusicDataGroup() - :myMusicDataChoiceSet() - {} - - - bool MusicDataGroup::hasAttributes() const - { - return false; - } - - - std::ostream& MusicDataGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& MusicDataGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool MusicDataGroup::hasContents() const - { - return myMusicDataChoiceSet.size() > 0; - } - - - std::ostream& MusicDataGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto it = myMusicDataChoiceSet.cbegin(); - it != myMusicDataChoiceSet.cend(); ++it ) - { - if ( it != myMusicDataChoiceSet.cbegin() ) - { - os << std::endl; - } - (*it)->streamContents( os, indentLevel, isOneLineOnly ); - } - isOneLineOnly = false; - return os; - } - - - const MusicDataChoiceSet& MusicDataGroup::getMusicDataChoiceSet() const - { - return myMusicDataChoiceSet; - } - - - void MusicDataGroup::addMusicDataChoice( const MusicDataChoicePtr& value ) - { - if ( value ) - { - myMusicDataChoiceSet.push_back( value ); - } - } - - - void MusicDataGroup::removeMusicDataChoice( const MusicDataChoiceSetIterConst& value ) - { - if ( value != myMusicDataChoiceSet.cend() ) - { - myMusicDataChoiceSet.erase( value ); - } - } - - - void MusicDataGroup::clearMusicDataChoiceSet() - { - myMusicDataChoiceSet.clear(); - } - - - MusicDataChoicePtr MusicDataGroup::getMusicDataChoice( const MusicDataChoiceSetIterConst& setIterator ) const - { - if( setIterator != myMusicDataChoiceSet.cend() ) - { - return *setIterator; - } - return MusicDataChoicePtr(); - } - - - MX_FROM_XELEMENT_UNUSED( MusicDataGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/MusicDataGroup.h b/Sourcecode/private/mx/core/elements/MusicDataGroup.h deleted file mode 100644 index 943670661..000000000 --- a/Sourcecode/private/mx/core/elements/MusicDataGroup.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MusicDataChoice ) - MX_FORWARD_DECLARE_ELEMENT( MusicDataGroup ) - - inline MusicDataGroupPtr makeMusicDataGroup() { return std::make_shared(); } - - class MusicDataGroup : public ElementInterface - { - public: - MusicDataGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MusicDataChoice minOccurs = 0, maxOccurs = unbounded _________ */ - const MusicDataChoiceSet& getMusicDataChoiceSet() const; - void addMusicDataChoice( const MusicDataChoicePtr& value ); - void removeMusicDataChoice( const MusicDataChoiceSetIterConst& value ); - void clearMusicDataChoiceSet(); - MusicDataChoicePtr getMusicDataChoice( const MusicDataChoiceSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MusicDataChoiceSet myMusicDataChoiceSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/MusicFont.cpp b/Sourcecode/private/mx/core/elements/MusicFont.cpp deleted file mode 100644 index 64615b32b..000000000 --- a/Sourcecode/private/mx/core/elements/MusicFont.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/MusicFont.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - MusicFont::MusicFont() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool MusicFont::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool MusicFont::hasContents() const { return false; } - std::ostream& MusicFont::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& MusicFont::streamName( std::ostream& os ) const { os << "music-font"; return os; } - std::ostream& MusicFont::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyFontAttributesPtr MusicFont::getAttributes() const - { - return myAttributes; - } - - - void MusicFont::setAttributes( const EmptyFontAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool MusicFont::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/MusicFont.h b/Sourcecode/private/mx/core/elements/MusicFont.h deleted file mode 100644 index b9b244efc..000000000 --- a/Sourcecode/private/mx/core/elements/MusicFont.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyFontAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyFontAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MusicFont ) - - inline MusicFontPtr makeMusicFont() { return std::make_shared(); } - - class MusicFont : public ElementInterface - { - public: - MusicFont(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyFontAttributesPtr getAttributes() const; - void setAttributes( const EmptyFontAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyFontAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Mute.cpp b/Sourcecode/private/mx/core/elements/Mute.cpp deleted file mode 100644 index 896387a74..000000000 --- a/Sourcecode/private/mx/core/elements/Mute.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Mute.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Mute::Mute() - :myValue( MuteEnum::off ) - {} - - - Mute::Mute( const MuteEnum& value ) - :myValue( value ) - {} - - - bool Mute::hasAttributes() const - { - return false; - } - - - bool Mute::hasContents() const - { - return true; - } - - - std::ostream& Mute::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Mute::streamName( std::ostream& os ) const - { - os << "mute"; - return os; - } - - - std::ostream& Mute::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - MuteEnum Mute::getValue() const - { - return myValue; - } - - - void Mute::setValue( const MuteEnum& value ) - { - myValue = value; - } - - - bool Mute::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseMuteEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Mute.h b/Sourcecode/private/mx/core/elements/Mute.h deleted file mode 100644 index a775b58e0..000000000 --- a/Sourcecode/private/mx/core/elements/Mute.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Mute ) - - inline MutePtr makeMute() { return std::make_shared(); } - inline MutePtr makeMute( const MuteEnum& value ) { return std::make_shared( value ); } - inline MutePtr makeMute( MuteEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Mute : public ElementInterface - { - public: - Mute(); - Mute( const MuteEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MuteEnum getValue() const; - void setValue( const MuteEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MuteEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Natural.cpp b/Sourcecode/private/mx/core/elements/Natural.cpp deleted file mode 100644 index a5dd0404d..000000000 --- a/Sourcecode/private/mx/core/elements/Natural.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Natural.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Natural::Natural() : ElementInterface() {} - - - bool Natural::hasAttributes() const { return false; } - - - bool Natural::hasContents() const { return false; } - std::ostream& Natural::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Natural::streamName( std::ostream& os ) const { os << "natural"; return os; } - std::ostream& Natural::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool Natural::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Natural.h b/Sourcecode/private/mx/core/elements/Natural.h deleted file mode 100644 index 3e7b61b57..000000000 --- a/Sourcecode/private/mx/core/elements/Natural.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Natural ) - - inline NaturalPtr makeNatural() { return std::make_shared(); } - - class Natural : public ElementInterface - { - public: - Natural(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NonArpeggiate.cpp b/Sourcecode/private/mx/core/elements/NonArpeggiate.cpp deleted file mode 100644 index 46b4a6230..000000000 --- a/Sourcecode/private/mx/core/elements/NonArpeggiate.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NonArpeggiate.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - NonArpeggiate::NonArpeggiate() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool NonArpeggiate::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool NonArpeggiate::hasContents() const { return false; } - std::ostream& NonArpeggiate::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& NonArpeggiate::streamName( std::ostream& os ) const { os << "non-arpeggiate"; return os; } - std::ostream& NonArpeggiate::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - NonArpeggiateAttributesPtr NonArpeggiate::getAttributes() const - { - return myAttributes; - } - - - void NonArpeggiate::setAttributes( const NonArpeggiateAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool NonArpeggiate::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NonArpeggiate.h b/Sourcecode/private/mx/core/elements/NonArpeggiate.h deleted file mode 100644 index dde9c5d83..000000000 --- a/Sourcecode/private/mx/core/elements/NonArpeggiate.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/NonArpeggiateAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NonArpeggiateAttributes ) - MX_FORWARD_DECLARE_ELEMENT( NonArpeggiate ) - - inline NonArpeggiatePtr makeNonArpeggiate() { return std::make_shared(); } - - class NonArpeggiate : public ElementInterface - { - public: - NonArpeggiate(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonArpeggiateAttributesPtr getAttributes() const; - void setAttributes( const NonArpeggiateAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonArpeggiateAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.cpp b/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.cpp deleted file mode 100644 index 6cac1adb4..000000000 --- a/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NonArpeggiateAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - NonArpeggiateAttributes::NonArpeggiateAttributes() - :type( TopBottom::top ) - ,number() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,placement( AboveBelow::below ) - ,hasType( true ) - ,hasNumber( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasPlacement( false ) - {} - - - bool NonArpeggiateAttributes::hasValues() const - { - return hasType || - hasNumber || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasPlacement; - } - - - std::ostream& NonArpeggiateAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool NonArpeggiateAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "NonArpeggiateAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseTopBottom ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.h b/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.h deleted file mode 100644 index 2f004f6aa..000000000 --- a/Sourcecode/private/mx/core/elements/NonArpeggiateAttributes.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NonArpeggiateAttributes ) - - struct NonArpeggiateAttributes : public AttributesInterface - { - public: - NonArpeggiateAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TopBottom type; - NumberLevel number; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - AboveBelow placement; - const bool hasType; - bool hasNumber; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NonTraditionalKey.cpp b/Sourcecode/private/mx/core/elements/NonTraditionalKey.cpp deleted file mode 100644 index b17102912..000000000 --- a/Sourcecode/private/mx/core/elements/NonTraditionalKey.cpp +++ /dev/null @@ -1,152 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NonTraditionalKey.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/KeyAccidental.h" -#include "mx/core/elements/KeyAlter.h" -#include "mx/core/elements/KeyStep.h" -#include - -namespace mx -{ - namespace core - { - NonTraditionalKey::NonTraditionalKey() - :ElementInterface() - ,myKeyStep( std::make_shared() ) - ,myKeyAlter( std::make_shared() ) - ,myKeyAccidental( std::make_shared() ) - ,myHasKeyAccidental( false ) - {} - - - bool NonTraditionalKey::hasAttributes() const - { - return false; - } - - - std::ostream& NonTraditionalKey::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NonTraditionalKey::streamName( std::ostream& os ) const - { - return os; - } - - - bool NonTraditionalKey::hasContents() const - { - return true; - } - - - std::ostream& NonTraditionalKey::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - if ( myKeyStep ) - { - myKeyStep->toStream( os, indentLevel ) << std::endl; - } - if ( myKeyAlter ) - { - myKeyAlter->toStream( os, indentLevel ); - } - if ( myKeyAccidental && myHasKeyAccidental ) - { - os << std::endl; - myKeyAccidental->toStream( os, indentLevel ); - } - return os; - } - - - KeyStepPtr NonTraditionalKey::getKeyStep() const - { - return myKeyStep; - } - - - void NonTraditionalKey::setKeyStep( const KeyStepPtr& value ) - { - if ( value ) - { - myKeyStep = value; - } - } - - - KeyAlterPtr NonTraditionalKey::getKeyAlter() const - { - return myKeyAlter; - } - - - void NonTraditionalKey::setKeyAlter( const KeyAlterPtr& value ) - { - if ( value ) - { - myKeyAlter = value; - } - } - - - KeyAccidentalPtr NonTraditionalKey::getKeyAccidental() const - { - return myKeyAccidental; - } - - - void NonTraditionalKey::setKeyAccidental( const KeyAccidentalPtr& value ) - { - if ( value ) - { - myKeyAccidental = value; - } - } - - - bool NonTraditionalKey::getHasKeyAccidental() const - { - return myHasKeyAccidental; - } - - - void NonTraditionalKey::setHasKeyAccidental( const bool value ) - { - myHasKeyAccidental = value; - } - - - bool NonTraditionalKey::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isKeyStepFound = false; - bool isKeyAlterFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myKeyStep, isKeyStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myKeyAlter, isKeyAlterFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myKeyAccidental, myHasKeyAccidental ) ) { continue; } - } - - if( !isKeyStepFound ) - { - message << "NonTraditionalKey: '" << myKeyStep->getElementName() << "' is required but was not found" << std::endl; - } - if( !isKeyAlterFound ) - { - message << "NonTraditionalKey: '" << myKeyAlter->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NonTraditionalKey.h b/Sourcecode/private/mx/core/elements/NonTraditionalKey.h deleted file mode 100644 index 1416aef61..000000000 --- a/Sourcecode/private/mx/core/elements/NonTraditionalKey.h +++ /dev/null @@ -1,55 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( KeyAccidental ) - MX_FORWARD_DECLARE_ELEMENT( KeyAlter ) - MX_FORWARD_DECLARE_ELEMENT( KeyStep ) - MX_FORWARD_DECLARE_ELEMENT( NonTraditionalKey ) - - inline NonTraditionalKeyPtr makeNonTraditionalKey() { return std::make_shared(); } - - class NonTraditionalKey : public ElementInterface - { - public: - NonTraditionalKey(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - KeyStepPtr getKeyStep() const; - void setKeyStep( const KeyStepPtr& value ); - KeyAlterPtr getKeyAlter() const; - void setKeyAlter( const KeyAlterPtr& value ); - KeyAccidentalPtr getKeyAccidental() const; - void setKeyAccidental( const KeyAccidentalPtr& value ); - bool getHasKeyAccidental() const; - void setHasKeyAccidental( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - KeyStepPtr myKeyStep; - KeyAlterPtr myKeyAlter; - KeyAccidentalPtr myKeyAccidental; - bool myHasKeyAccidental; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NormalDot.cpp b/Sourcecode/private/mx/core/elements/NormalDot.cpp deleted file mode 100644 index 47f9289c4..000000000 --- a/Sourcecode/private/mx/core/elements/NormalDot.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NormalDot.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - NormalDot::NormalDot() : ElementInterface() {} - - - bool NormalDot::hasAttributes() const { return false; } - - - bool NormalDot::hasContents() const { return false; } - std::ostream& NormalDot::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& NormalDot::streamName( std::ostream& os ) const { os << "normal-dot"; return os; } - std::ostream& NormalDot::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool NormalDot::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NormalDot.h b/Sourcecode/private/mx/core/elements/NormalDot.h deleted file mode 100644 index 0bad92f4b..000000000 --- a/Sourcecode/private/mx/core/elements/NormalDot.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( NormalDot ) - - inline NormalDotPtr makeNormalDot() { return std::make_shared(); } - - class NormalDot : public ElementInterface - { - public: - NormalDot(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NormalNoteGroup.cpp b/Sourcecode/private/mx/core/elements/NormalNoteGroup.cpp deleted file mode 100644 index 02b0f311f..000000000 --- a/Sourcecode/private/mx/core/elements/NormalNoteGroup.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NormalNoteGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Duration.h" -#include "mx/core/elements/FullNoteGroup.h" -#include "mx/core/elements/Tie.h" -#include - -namespace mx -{ - namespace core - { - NormalNoteGroup::NormalNoteGroup() - :myFullNoteGroup( makeFullNoteGroup() ) - ,myDuration( makeDuration() ) - ,myTieSet() - {} - - - bool NormalNoteGroup::hasAttributes() const - { - return false; - } - - - std::ostream& NormalNoteGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NormalNoteGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool NormalNoteGroup::hasContents() const - { - return true; - } - - - std::ostream& NormalNoteGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - myFullNoteGroup->streamContents( os, indentLevel, isOneLineOnly ); - os << std::endl; - myDuration->toStream( os, indentLevel ); - for ( auto x : myTieSet ) - { - os << std::endl; - x->toStream( os, indentLevel ); - } - return os; - } - - - FullNoteGroupPtr NormalNoteGroup::getFullNoteGroup() const - { - return myFullNoteGroup; - } - - - void NormalNoteGroup::setFullNoteGroup( const FullNoteGroupPtr& value ) - { - if ( value ) - { - myFullNoteGroup = value; - } - } - - - DurationPtr NormalNoteGroup::getDuration() const - { - return myDuration; - } - - - void NormalNoteGroup::setDuration( const DurationPtr& value ) - { - if ( value ) - { - myDuration = value; - } - } - - - const TieSet& NormalNoteGroup::getTieSet() const - { - return myTieSet; - } - - - void NormalNoteGroup::addTie( const TiePtr& value ) - { - if ( value ) - { - if ( myTieSet.size() < 2 ) - { - myTieSet.push_back( value ); - } - } - } - - - void NormalNoteGroup::removeTie( const TieSetIterConst& value ) - { - if ( value != myTieSet.cend() ) - { - myTieSet.erase( value ); - } - } - - - void NormalNoteGroup::clearTieSet() - { - myTieSet.clear(); - } - - - TiePtr NormalNoteGroup::getTie( const TieSetIterConst& setIterator ) const - { - if( setIterator != myTieSet.cend() ) - { - return *setIterator; - } - return TiePtr(); - } - - MX_FROM_XELEMENT_UNUSED( NormalNoteGroup ); - } -} diff --git a/Sourcecode/private/mx/core/elements/NormalNoteGroup.h b/Sourcecode/private/mx/core/elements/NormalNoteGroup.h deleted file mode 100644 index 6816f6923..000000000 --- a/Sourcecode/private/mx/core/elements/NormalNoteGroup.h +++ /dev/null @@ -1,61 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Duration ) - MX_FORWARD_DECLARE_ELEMENT( FullNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( Tie ) - MX_FORWARD_DECLARE_ELEMENT( NormalNoteGroup ) - - inline NormalNoteGroupPtr makeNormalNoteGroup() { return std::make_shared(); } - - class NormalNoteGroup : public ElementInterface - { - public: - NormalNoteGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ FullNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ - FullNoteGroupPtr getFullNoteGroup() const; - void setFullNoteGroup( const FullNoteGroupPtr& value ); - - /* _________ Duration minOccurs = 1, maxOccurs = 1 _________ */ - DurationPtr getDuration() const; - void setDuration( const DurationPtr& value ); - - /* _________ Tie minOccurs = 0, maxOccurs = 2 _________ */ - const TieSet& getTieSet() const; - void addTie( const TiePtr& value ); - void removeTie( const TieSetIterConst& value ); - void clearTieSet(); - TiePtr getTie( const TieSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - FullNoteGroupPtr myFullNoteGroup; - DurationPtr myDuration; - TieSet myTieSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NormalNotes.cpp b/Sourcecode/private/mx/core/elements/NormalNotes.cpp deleted file mode 100644 index 20c2c5aa3..000000000 --- a/Sourcecode/private/mx/core/elements/NormalNotes.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NormalNotes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - NormalNotes::NormalNotes() - :myValue() - {} - - - NormalNotes::NormalNotes( const NonNegativeInteger& value ) - :myValue( value ) - {} - - - bool NormalNotes::hasAttributes() const - { - return false; - } - - - bool NormalNotes::hasContents() const - { - return true; - } - - - std::ostream& NormalNotes::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NormalNotes::streamName( std::ostream& os ) const - { - os << "normal-notes"; - return os; - } - - - std::ostream& NormalNotes::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NonNegativeInteger NormalNotes::getValue() const - { - return myValue; - } - - - void NormalNotes::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } - - - bool NormalNotes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NormalNotes.h b/Sourcecode/private/mx/core/elements/NormalNotes.h deleted file mode 100644 index 05f6c8820..000000000 --- a/Sourcecode/private/mx/core/elements/NormalNotes.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( NormalNotes ) - - inline NormalNotesPtr makeNormalNotes() { return std::make_shared(); } - inline NormalNotesPtr makeNormalNotes( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline NormalNotesPtr makeNormalNotes( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class NormalNotes : public ElementInterface - { - public: - NormalNotes(); - NormalNotes( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NormalType.cpp b/Sourcecode/private/mx/core/elements/NormalType.cpp deleted file mode 100644 index 786f96aaf..000000000 --- a/Sourcecode/private/mx/core/elements/NormalType.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NormalType.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - NormalType::NormalType() - :myValue( NoteTypeValue::eighth ) - {} - - - NormalType::NormalType( const NoteTypeValue& value ) - :myValue( value ) - {} - - - bool NormalType::hasAttributes() const - { - return false; - } - - - bool NormalType::hasContents() const - { - return true; - } - - - std::ostream& NormalType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NormalType::streamName( std::ostream& os ) const - { - os << "normal-type"; - return os; - } - - - std::ostream& NormalType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NoteTypeValue NormalType::getValue() const - { - return myValue; - } - - - void NormalType::setValue( const NoteTypeValue& value ) - { - myValue = value; - } - - - bool NormalType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseNoteTypeValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NormalType.h b/Sourcecode/private/mx/core/elements/NormalType.h deleted file mode 100644 index 576618458..000000000 --- a/Sourcecode/private/mx/core/elements/NormalType.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( NormalType ) - - inline NormalTypePtr makeNormalType() { return std::make_shared(); } - inline NormalTypePtr makeNormalType( const NoteTypeValue& value ) { return std::make_shared( value ); } - inline NormalTypePtr makeNormalType( NoteTypeValue&& value ) { return std::make_shared( std::move( value ) ); } - - class NormalType : public ElementInterface - { - public: - NormalType(); - NormalType( const NoteTypeValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteTypeValue getValue() const; - void setValue( const NoteTypeValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NoteTypeValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.cpp b/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.cpp deleted file mode 100644 index 60a70ac0f..000000000 --- a/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NormalTypeNormalDotGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/NormalDot.h" -#include "mx/core/elements/NormalType.h" -#include - -namespace mx -{ - namespace core - { - NormalTypeNormalDotGroup::NormalTypeNormalDotGroup() - :myNormalType( makeNormalType() ) - ,myNormalDotSet() - {} - - - bool NormalTypeNormalDotGroup::hasAttributes() const - { - return false; - } - - - std::ostream& NormalTypeNormalDotGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NormalTypeNormalDotGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool NormalTypeNormalDotGroup::hasContents() const - { - return true; - } - - - std::ostream& NormalTypeNormalDotGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - myNormalType->toStream( os, indentLevel ); - for ( auto x : myNormalDotSet ) - { - os << std::endl; - x->toStream( os, indentLevel ); - } - return os; - } - - - NormalTypePtr NormalTypeNormalDotGroup::getNormalType() const - { - return myNormalType; - } - - - void NormalTypeNormalDotGroup::setNormalType( const NormalTypePtr& value ) - { - if( value ) - { - myNormalType = value; - } - } - - - const NormalDotSet& NormalTypeNormalDotGroup::getNormalDotSet() const - { - return myNormalDotSet; - } - - - void NormalTypeNormalDotGroup::removeNormalDot( const NormalDotSetIterConst& value ) - { - if ( value != myNormalDotSet.cend() ) - { - myNormalDotSet.erase( value ); - } - } - - - void NormalTypeNormalDotGroup::addNormalDot( const NormalDotPtr& value ) - { - if ( value ) - { - myNormalDotSet.push_back( value ); - } - } - - - void NormalTypeNormalDotGroup::clearNormalDotSet() - { - myNormalDotSet.clear(); - } - - - NormalDotPtr NormalTypeNormalDotGroup::getNormalDot( const NormalDotSetIterConst& setIterator ) const - { - if( setIterator != myNormalDotSet.cend() ) - { - return *setIterator; - } - return NormalDotPtr(); - } - - - bool NormalTypeNormalDotGroup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isNormalTypeFound = false; - bool isFirstNormalDotAdded = false; - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - const std::string elementName = it->getName(); - - if( elementName == "normal-type" ) - { - isNormalTypeFound = true; - isSuccess &= myNormalType->fromXElement( message, *it ); - } - else if( elementName == "normal-dot" ) - { - auto normalDot = makeNormalDot(); - isSuccess &= normalDot->fromXElement( message, *it ); - - if( !isFirstNormalDotAdded && myNormalDotSet.size() == 1 ) - { - *( myNormalDotSet.begin() ) = normalDot; - isFirstNormalDotAdded = true; - } - else - { - myNormalDotSet.push_back( normalDot ); - isFirstNormalDotAdded = true; - } - } - else - { - if( !isNormalTypeFound ) - { - isSuccess = false; - message << "NormalTypeNormalDotGroup: 'normal-type' element is required but was not found" << std::endl; - } - break; - } - } - MX_RETURN_IS_SUCCESS; - } - } -} diff --git a/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.h b/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.h deleted file mode 100644 index 4e5a7460e..000000000 --- a/Sourcecode/private/mx/core/elements/NormalTypeNormalDotGroup.h +++ /dev/null @@ -1,55 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( NormalDot ) - MX_FORWARD_DECLARE_ELEMENT( NormalType ) - MX_FORWARD_DECLARE_ELEMENT( NormalTypeNormalDotGroup ) - - inline NormalTypeNormalDotGroupPtr makeNormalTypeNormalDotGroup() { return std::make_shared(); } - - class NormalTypeNormalDotGroup : public ElementInterface - { - public: - NormalTypeNormalDotGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ NormalType minOccurs = 1, maxOccurs = 1 _________ */ - NormalTypePtr getNormalType() const; - void setNormalType( const NormalTypePtr& value ); - - /* _________ NormalDot minOccurs = 0, maxOccurs = unbounded _________ */ - const NormalDotSet& getNormalDotSet() const; - void addNormalDot( const NormalDotPtr& value ); - void removeNormalDot( const NormalDotSetIterConst& value ); - void clearNormalDotSet(); - NormalDotPtr getNormalDot( const NormalDotSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NormalTypePtr myNormalType; - NormalDotSet myNormalDotSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Notations.cpp b/Sourcecode/private/mx/core/elements/Notations.cpp deleted file mode 100644 index c04477ac3..000000000 --- a/Sourcecode/private/mx/core/elements/Notations.cpp +++ /dev/null @@ -1,285 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Notations.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/NotationsChoice.h" -#include "mx/core/elements/AccidentalMark.h" -#include "mx/core/elements/Arpeggiate.h" -#include "mx/core/elements/Articulations.h" -#include "mx/core/elements/Dynamics.h" -#include "mx/core/elements/EditorialGroup.h" -#include "mx/core/elements/Fermata.h" -#include "mx/core/elements/Footnote.h" -#include "mx/core/elements/Glissando.h" -#include "mx/core/elements/Level.h" -#include "mx/core/elements/NonArpeggiate.h" -#include "mx/core/elements/Ornaments.h" -#include "mx/core/elements/OtherNotation.h" -#include "mx/core/elements/Slide.h" -#include "mx/core/elements/Slur.h" -#include "mx/core/elements/Technical.h" -#include "mx/core/elements/Tied.h" -#include "mx/core/elements/Tuplet.h" -#include - -namespace mx -{ - namespace core - { - Notations::Notations() - :myAttributes( std::make_shared() ) - ,myEditorialGroup( makeEditorialGroup() ) - ,myNotationsChoiceSet() - {} - - - bool Notations::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Notations::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Notations::streamName( std::ostream& os ) const - { - os << "notations"; - return os; - } - - - bool Notations::hasContents() const - { - return myEditorialGroup->hasContents() || myNotationsChoiceSet.size() > 0; - } - - - std::ostream& Notations::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - for ( auto x : myNotationsChoiceSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - NotationsAttributesPtr Notations::getAttributes() const - { - return myAttributes; - } - - - void Notations::setAttributes( const NotationsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - EditorialGroupPtr Notations::getEditorialGroup() const - { - return myEditorialGroup; - } - - - void Notations::setEditorialGroup( const EditorialGroupPtr& value ) - { - if ( value ) - { - myEditorialGroup = value; - } - } - - - const NotationsChoiceSet& Notations::getNotationsChoiceSet() const - { - return myNotationsChoiceSet; - } - - - void Notations::addNotationsChoice( const NotationsChoicePtr& value ) - { - if ( value ) - { - myNotationsChoiceSet.push_back( value ); - } - } - - - void Notations::removeNotationsChoice( const NotationsChoiceSetIterConst& value ) - { - if ( value != myNotationsChoiceSet.cend() ) - { - myNotationsChoiceSet.erase( value ); - } - } - - - void Notations::clearNotationsChoiceSet() - { - myNotationsChoiceSet.clear(); - } - - - NotationsChoicePtr Notations::getNotationsChoice( const NotationsChoiceSetIterConst& setIterator ) const - { - if( setIterator != myNotationsChoiceSet.cend() ) - { - return *setIterator; - } - return NotationsChoicePtr(); - } - - - bool Notations::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - const std::string elementName = it->getName(); - - if( elementName == "footnote" ) - { - myEditorialGroup->setHasFootnote( true ); - isSuccess &= myEditorialGroup->getFootnote()->fromXElement( message, *it ); - } - else if ( elementName == "level" ) - { - myEditorialGroup->setHasLevel( true ); - isSuccess &= myEditorialGroup->getLevel()->fromXElement( message, *it ); - } - else if ( elementName == "tied" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::tied ); - isSuccess &= choice->getTied()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "tuplet" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::tuplet ); - isSuccess &= choice->getTuplet()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "slur" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::slur ); - isSuccess &= choice->getSlur()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "glissando" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::glissando ); - isSuccess &= choice->getGlissando()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "slide" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::slide ); - isSuccess &= choice->getSlide()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "ornaments" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::ornaments ); - isSuccess &= choice->getOrnaments()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "technical" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::technical ); - isSuccess &= choice->getTechnical()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "articulations" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::articulations ); - isSuccess &= choice->getArticulations()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "dynamics" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::dynamics ); - isSuccess &= choice->getDynamics()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "fermata" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::fermata ); - isSuccess &= choice->getFermata()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "arpeggiate" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::arpeggiate ); - isSuccess &= choice->getArpeggiate()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "non-arpeggiate" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::nonArpeggiate ); - isSuccess &= choice->getNonArpeggiate()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "accidental-mark" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::accidentalMark ); - isSuccess &= choice->getAccidentalMark()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else if ( elementName == "other-notations" ) - { - auto choice = makeNotationsChoice(); - choice->setChoice( NotationsChoice::Choice::otherNotation ); - isSuccess &= choice->getOtherNotation()->fromXElement( message, *it ); - myNotationsChoiceSet.push_back( choice ); - } - else - { - isSuccess = false; - message << "Notations: fromXElement unexpected element '" << elementName << "' encountered" << std::endl; - } - } - - MX_RETURN_IS_SUCCESS; - } - } -} diff --git a/Sourcecode/private/mx/core/elements/Notations.h b/Sourcecode/private/mx/core/elements/Notations.h deleted file mode 100644 index ca2b286be..000000000 --- a/Sourcecode/private/mx/core/elements/Notations.h +++ /dev/null @@ -1,60 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/NotationsAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NotationsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( NotationsChoice ) - MX_FORWARD_DECLARE_ELEMENT( Notations ) - - inline NotationsPtr makeNotations() { return std::make_shared(); } - - class Notations : public ElementInterface - { - public: - Notations(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NotationsAttributesPtr getAttributes() const; - void setAttributes( const NotationsAttributesPtr& value ); - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - /* _________ NotationsChoice minOccurs = 0, maxOccurs = unbounded _________ */ - const NotationsChoiceSet& getNotationsChoiceSet() const; - void addNotationsChoice( const NotationsChoicePtr& value ); - void removeNotationsChoice( const NotationsChoiceSetIterConst& value ); - void clearNotationsChoiceSet(); - NotationsChoicePtr getNotationsChoice( const NotationsChoiceSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NotationsAttributesPtr myAttributes; - EditorialGroupPtr myEditorialGroup; - NotationsChoiceSet myNotationsChoiceSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NotationsAttributes.cpp b/Sourcecode/private/mx/core/elements/NotationsAttributes.cpp deleted file mode 100644 index e07aa4fa4..000000000 --- a/Sourcecode/private/mx/core/elements/NotationsAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NotationsAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - NotationsAttributes::NotationsAttributes() - :printObject( YesNo::no ) - ,hasPrintObject( false ) - {} - - - bool NotationsAttributes::hasValues() const - { - return hasPrintObject; - } - - - std::ostream& NotationsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } - - - bool NotationsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "NotationsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NotationsAttributes.h b/Sourcecode/private/mx/core/elements/NotationsAttributes.h deleted file mode 100644 index 729f831bc..000000000 --- a/Sourcecode/private/mx/core/elements/NotationsAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NotationsAttributes ) - - struct NotationsAttributes : public AttributesInterface - { - public: - NotationsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - bool hasPrintObject; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NotationsChoice.cpp b/Sourcecode/private/mx/core/elements/NotationsChoice.cpp deleted file mode 100644 index 9575b591c..000000000 --- a/Sourcecode/private/mx/core/elements/NotationsChoice.cpp +++ /dev/null @@ -1,349 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NotationsChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/AccidentalMark.h" -#include "mx/core/elements/Arpeggiate.h" -#include "mx/core/elements/Articulations.h" -#include "mx/core/elements/Dynamics.h" -#include "mx/core/elements/Fermata.h" -#include "mx/core/elements/Glissando.h" -#include "mx/core/elements/NonArpeggiate.h" -#include "mx/core/elements/Ornaments.h" -#include "mx/core/elements/OtherNotation.h" -#include "mx/core/elements/Slide.h" -#include "mx/core/elements/Slur.h" -#include "mx/core/elements/Technical.h" -#include "mx/core/elements/Tied.h" -#include "mx/core/elements/Tuplet.h" -#include - -namespace mx -{ - namespace core - { - NotationsChoice::NotationsChoice() - :myChoice( Choice::tied ) - ,myTied( makeTied() ) - ,mySlur( makeSlur() ) - ,myTuplet( makeTuplet() ) - ,myGlissando( makeGlissando() ) - ,mySlide( makeSlide() ) - ,myOrnaments( makeOrnaments() ) - ,myTechnical( makeTechnical() ) - ,myArticulations( makeArticulations() ) - ,myDynamics( makeDynamics() ) - ,myFermata( makeFermata() ) - ,myArpeggiate( makeArpeggiate() ) - ,myNonArpeggiate( makeNonArpeggiate() ) - ,myAccidentalMark( makeAccidentalMark() ) - ,myOtherNotation( makeOtherNotation() ) - {} - - - bool NotationsChoice::hasAttributes() const - { - return false; - } - - - std::ostream& NotationsChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NotationsChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool NotationsChoice::hasContents() const - { - return true; - } - - - std::ostream& NotationsChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::tied: - myTied->toStream( os, indentLevel ); - break; - case Choice::slur: - mySlur->toStream( os, indentLevel ); - break; - case Choice::tuplet: - myTuplet->toStream( os, indentLevel ); - break; - case Choice::glissando: - myGlissando->toStream( os, indentLevel ); - break; - case Choice::slide: - mySlide->toStream( os, indentLevel ); - break; - case Choice::ornaments: - myOrnaments->toStream( os, indentLevel ); - break; - case Choice::technical: - myTechnical->toStream( os, indentLevel ); - break; - case Choice::articulations: - myArticulations->toStream( os, indentLevel ); - break; - case Choice::dynamics: - myDynamics->toStream( os, indentLevel ); - break; - case Choice::fermata: - myFermata->toStream( os, indentLevel ); - break; - case Choice::arpeggiate: - myArpeggiate->toStream( os, indentLevel ); - break; - case Choice::nonArpeggiate: - myNonArpeggiate->toStream( os, indentLevel ); - break; - case Choice::accidentalMark: - myAccidentalMark->toStream( os, indentLevel ); - break; - case Choice::otherNotation: - myOtherNotation->toStream( os, indentLevel ); - break; - default: - break; - } - isOneLineOnly = hasContents(); - return os; - } - - - NotationsChoice::Choice NotationsChoice::getChoice() const - { - return myChoice; - } - - - void NotationsChoice::setChoice( const NotationsChoice::Choice value ) - { - myChoice = value; - } - - - TiedPtr NotationsChoice::getTied() const - { - return myTied; - } - - - void NotationsChoice::setTied( const TiedPtr& value ) - { - if( value ) - { - myTied = value; - } - } - - - SlurPtr NotationsChoice::getSlur() const - { - return mySlur; - } - - - void NotationsChoice::setSlur( const SlurPtr& value ) - { - if( value ) - { - mySlur = value; - } - } - - - TupletPtr NotationsChoice::getTuplet() const - { - return myTuplet; - } - - - void NotationsChoice::setTuplet( const TupletPtr& value ) - { - if( value ) - { - myTuplet = value; - } - } - - - GlissandoPtr NotationsChoice::getGlissando() const - { - return myGlissando; - } - - - void NotationsChoice::setGlissando( const GlissandoPtr& value ) - { - if( value ) - { - myGlissando = value; - } - } - - - SlidePtr NotationsChoice::getSlide() const - { - return mySlide; - } - - - void NotationsChoice::setSlide( const SlidePtr& value ) - { - if( value ) - { - mySlide = value; - } - } - - - OrnamentsPtr NotationsChoice::getOrnaments() const - { - return myOrnaments; - } - - - void NotationsChoice::setOrnaments( const OrnamentsPtr& value ) - { - if( value ) - { - myOrnaments = value; - } - } - - - TechnicalPtr NotationsChoice::getTechnical() const - { - return myTechnical; - } - - - void NotationsChoice::setTechnical( const TechnicalPtr& value ) - { - if( value ) - { - myTechnical = value; - } - } - - - ArticulationsPtr NotationsChoice::getArticulations() const - { - return myArticulations; - } - - - void NotationsChoice::setArticulations( const ArticulationsPtr& value ) - { - if( value ) - { - myArticulations = value; - } - } - - - DynamicsPtr NotationsChoice::getDynamics() const - { - return myDynamics; - } - - - void NotationsChoice::setDynamics( const DynamicsPtr& value ) - { - if( value ) - { - myDynamics = value; - } - } - - - FermataPtr NotationsChoice::getFermata() const - { - return myFermata; - } - - - void NotationsChoice::setFermata( const FermataPtr& value ) - { - if( value ) - { - myFermata = value; - } - } - - - ArpeggiatePtr NotationsChoice::getArpeggiate() const - { - return myArpeggiate; - } - - - void NotationsChoice::setArpeggiate( const ArpeggiatePtr& value ) - { - if( value ) - { - myArpeggiate = value; - } - } - - - NonArpeggiatePtr NotationsChoice::getNonArpeggiate() const - { - return myNonArpeggiate; - } - - - void NotationsChoice::setNonArpeggiate( const NonArpeggiatePtr& value ) - { - if( value ) - { - myNonArpeggiate = value; - } - } - - - AccidentalMarkPtr NotationsChoice::getAccidentalMark() const - { - return myAccidentalMark; - } - - - void NotationsChoice::setAccidentalMark( const AccidentalMarkPtr& value ) - { - if( value ) - { - myAccidentalMark = value; - } - } - - - OtherNotationPtr NotationsChoice::getOtherNotation() const - { - return myOtherNotation; - } - - - void NotationsChoice::setOtherNotation( const OtherNotationPtr& value ) - { - if( value ) - { - myOtherNotation = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( NotationsChoice ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/NotationsChoice.h b/Sourcecode/private/mx/core/elements/NotationsChoice.h deleted file mode 100644 index cc1a1ec98..000000000 --- a/Sourcecode/private/mx/core/elements/NotationsChoice.h +++ /dev/null @@ -1,146 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccidentalMark ) - MX_FORWARD_DECLARE_ELEMENT( Arpeggiate ) - MX_FORWARD_DECLARE_ELEMENT( Articulations ) - MX_FORWARD_DECLARE_ELEMENT( Dynamics ) - MX_FORWARD_DECLARE_ELEMENT( Fermata ) - MX_FORWARD_DECLARE_ELEMENT( Glissando ) - MX_FORWARD_DECLARE_ELEMENT( NonArpeggiate ) - MX_FORWARD_DECLARE_ELEMENT( Ornaments ) - MX_FORWARD_DECLARE_ELEMENT( OtherNotation ) - MX_FORWARD_DECLARE_ELEMENT( Slide ) - MX_FORWARD_DECLARE_ELEMENT( Slur ) - MX_FORWARD_DECLARE_ELEMENT( Technical ) - MX_FORWARD_DECLARE_ELEMENT( Tied ) - MX_FORWARD_DECLARE_ELEMENT( Tuplet ) - MX_FORWARD_DECLARE_ELEMENT( NotationsChoice ) - - inline NotationsChoicePtr makeNotationsChoice() { return std::make_shared(); } - - class NotationsChoice : public ElementInterface - { - public: - enum class Choice - { - tied = 1, - slur = 2, - tuplet = 3, - glissando = 4, - slide = 5, - ornaments = 6, - technical = 7, - articulations = 8, - dynamics = 9, - fermata = 10, - arpeggiate = 11, - nonArpeggiate = 12, - accidentalMark = 13, - otherNotation = 14 - }; - NotationsChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - NotationsChoice::Choice getChoice() const; - void setChoice( const NotationsChoice::Choice value ); - - /* _________ Tied minOccurs = 1, maxOccurs = 1 _________ */ - TiedPtr getTied() const; - void setTied( const TiedPtr& value ); - - /* _________ Slur minOccurs = 1, maxOccurs = 1 _________ */ - SlurPtr getSlur() const; - void setSlur( const SlurPtr& value ); - - /* _________ Tuplet minOccurs = 1, maxOccurs = 1 _________ */ - TupletPtr getTuplet() const; - void setTuplet( const TupletPtr& value ); - - /* _________ Glissando minOccurs = 1, maxOccurs = 1 _________ */ - GlissandoPtr getGlissando() const; - void setGlissando( const GlissandoPtr& value ); - - /* _________ Slide minOccurs = 1, maxOccurs = 1 _________ */ - SlidePtr getSlide() const; - void setSlide( const SlidePtr& value ); - - /* _________ Ornaments minOccurs = 1, maxOccurs = 1 _________ */ - OrnamentsPtr getOrnaments() const; - void setOrnaments( const OrnamentsPtr& value ); - - /* _________ Technical minOccurs = 1, maxOccurs = 1 _________ */ - TechnicalPtr getTechnical() const; - void setTechnical( const TechnicalPtr& value ); - - /* _________ Articulations minOccurs = 1, maxOccurs = 1 _________ */ - ArticulationsPtr getArticulations() const; - void setArticulations( const ArticulationsPtr& value ); - - /* _________ Dynamics minOccurs = 1, maxOccurs = 1 _________ */ - DynamicsPtr getDynamics() const; - void setDynamics( const DynamicsPtr& value ); - - /* _________ Fermata minOccurs = 1, maxOccurs = 1 _________ */ - FermataPtr getFermata() const; - void setFermata( const FermataPtr& value ); - - /* _________ Arpeggiate minOccurs = 1, maxOccurs = 1 _________ */ - ArpeggiatePtr getArpeggiate() const; - void setArpeggiate( const ArpeggiatePtr& value ); - - /* _________ NonArpeggiate minOccurs = 1, maxOccurs = 1 _________ */ - NonArpeggiatePtr getNonArpeggiate() const; - void setNonArpeggiate( const NonArpeggiatePtr& value ); - - /* _________ AccidentalMark minOccurs = 1, maxOccurs = 1 _________ */ - AccidentalMarkPtr getAccidentalMark() const; - void setAccidentalMark( const AccidentalMarkPtr& value ); - - /* _________ OtherNotation minOccurs = 1, maxOccurs = 1 _________ */ - OtherNotationPtr getOtherNotation() const; - void setOtherNotation( const OtherNotationPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - TiedPtr myTied; - SlurPtr mySlur; - TupletPtr myTuplet; - GlissandoPtr myGlissando; - SlidePtr mySlide; - OrnamentsPtr myOrnaments; - TechnicalPtr myTechnical; - ArticulationsPtr myArticulations; - DynamicsPtr myDynamics; - FermataPtr myFermata; - ArpeggiatePtr myArpeggiate; - NonArpeggiatePtr myNonArpeggiate; - AccidentalMarkPtr myAccidentalMark; - OtherNotationPtr myOtherNotation; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Note.cpp b/Sourcecode/private/mx/core/elements/Note.cpp deleted file mode 100644 index eba64984f..000000000 --- a/Sourcecode/private/mx/core/elements/Note.cpp +++ /dev/null @@ -1,987 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Note.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Accidental.h" -#include "mx/core/elements/Beam.h" -#include "mx/core/elements/CueNoteGroup.h" -#include "mx/core/elements/Dot.h" -#include "mx/core/elements/Duration.h" -#include "mx/core/elements/EditorialVoiceGroup.h" -#include "mx/core/elements/Footnote.h" -#include "mx/core/elements/FullNoteGroup.h" -#include "mx/core/elements/FullNoteTypeChoice.h" -#include "mx/core/elements/GraceNoteGroup.h" -#include "mx/core/elements/Grace.h" -#include "mx/core/elements/Cue.h" -#include "mx/core/elements/Instrument.h" -#include "mx/core/elements/Level.h" -#include "mx/core/elements/Lyric.h" -#include "mx/core/elements/Notations.h" -#include "mx/core/elements/NoteChoice.h" -#include "mx/core/elements/Notehead.h" -#include "mx/core/elements/NoteheadText.h" -#include "mx/core/elements/NormalNoteGroup.h" -#include "mx/core/elements/Pitch.h" -#include "mx/core/elements/Play.h" -#include "mx/core/elements/Staff.h" -#include "mx/core/elements/Stem.h" -#include "mx/core/elements/Rest.h" -#include "mx/core/elements/Tie.h" -#include "mx/core/elements/TimeModification.h" -#include "mx/core/elements/Type.h" -#include "mx/core/elements/Unpitched.h" -#include "mx/core/elements/Voice.h" -#include - -namespace mx -{ - namespace core - { - Note::Note() - :myAttributes( nullptr ) - ,myNoteChoice( nullptr ) - ,myInstrument( nullptr ) - ,myHasInstrument( false ) - ,myEditorialVoiceGroup( nullptr ) - ,myType( nullptr ) - ,myHasType( false ) - ,myDotSet() - ,myAccidental( nullptr ) - ,myHasAccidental( false ) - ,myTimeModification( nullptr ) - ,myHasTimeModification( false ) - ,myStem( nullptr ) - ,myHasStem( false ) - ,myNotehead( nullptr ) - ,myHasNotehead( false ) - ,myNoteheadText( nullptr ) - ,myHasNoteheadText( false ) - ,myStaff( nullptr ) - ,myHasStaff( false ) - ,myBeamSet() - ,myNotationsSet() - ,myLyricSet() - ,myPlay( nullptr ) - ,myHasPlay( false ) - {} - - - bool Note::hasAttributes() const - { - return getAttributes()->hasValues(); - } - - - std::ostream& Note::streamAttributes( std::ostream& os ) const - { - return getAttributes()->toStream( os ); - } - - - std::ostream& Note::streamName( std::ostream& os ) const - { - os << "note"; - return os; - } - - - bool Note::hasContents() const - { - return true; - } - - - std::ostream& Note::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - getNoteChoice()->streamContents( os, indentLevel+1, isOneLineOnly ); - if ( myHasInstrument ) - { - os << std::endl; - getInstrument()->toStream( os, indentLevel+1 ); - } - if ( getEditorialVoiceGroup()->hasContents() ) - { - os << std::endl; - getEditorialVoiceGroup()->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasType ) - { - os << std::endl; - getType()->toStream( os, indentLevel+1 ); - } - for ( auto x : myDotSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasAccidental ) - { - os << std::endl; - getAccidental()->toStream( os, indentLevel+1 ); - } - if ( myHasTimeModification ) - { - os << std::endl; - getTimeModification()->toStream( os, indentLevel+1 ); - } - if ( myHasStem ) - { - os << std::endl; - getStem()->toStream( os, indentLevel+1 ); - } - if ( myHasNotehead ) - { - os << std::endl; - getNotehead()->toStream( os, indentLevel+1 ); - } - if ( myHasNoteheadText ) - { - os << std::endl; - getNoteheadText()->toStream( os, indentLevel+1 ); - } - if ( myHasStaff ) - { - os << std::endl; - getStaff()->toStream( os, indentLevel+1 ); - } - for ( auto x : myBeamSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myNotationsSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myLyricSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasPlay ) - { - os << std::endl; - getPlay()->toStream( os, indentLevel+1 ); - } - isOneLineOnly = false; - os << std::endl; - return os; - } - - - NoteAttributesPtr Note::getAttributes() const - { - MX_LOCK; - MX_JIT_ALLOCATE_ATTRIBUTES( NoteAttributes ); - return myAttributes; - } - - - void Note::setAttributes( const NoteAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - NoteChoicePtr Note::getNoteChoice() const - { - MX_LOCK; - MX_JIT_ALLOCATE( NoteChoice ); - return myNoteChoice; - } - - - void Note::setNoteChoice( const NoteChoicePtr& value ) - { - if( value ) - { - myNoteChoice = value; - } - } - - - InstrumentPtr Note::getInstrument() const - { - MX_LOCK; - MX_JIT_ALLOCATE( Instrument ); - return myInstrument; - } - - - void Note::setInstrument( const InstrumentPtr& value ) - { - if( value ) - { - myInstrument = value; - } - } - - - bool Note::getHasInstrument() const - { - return myHasInstrument; - } - - - void Note::setHasInstrument( const bool value ) - { - myHasInstrument = value; - } - - - EditorialVoiceGroupPtr Note::getEditorialVoiceGroup() const - { - MX_LOCK; - MX_JIT_ALLOCATE( EditorialVoiceGroup ); - return myEditorialVoiceGroup; - } - - - void Note::setEditorialVoiceGroup( const EditorialVoiceGroupPtr& value ) - { - if ( value ) - { - myEditorialVoiceGroup = value; - } - } - - - TypePtr Note::getType() const - { - MX_LOCK; - MX_JIT_ALLOCATE( Type ); - return myType; - } - - - void Note::setType( const TypePtr& value ) - { - if( value ) - { - myType = value; - } - } - - - bool Note::getHasType() const - { - return myHasType; - } - - - void Note::setHasType( const bool value ) - { - myHasType = value; - } - - - const DotSet& Note::getDotSet() const - { - return myDotSet; - } - - - void Note::removeDot( const DotSetIterConst& value ) - { - if ( value != myDotSet.cend() ) - { - myDotSet.erase( value ); - } - } - - - void Note::addDot( const DotPtr& value ) - { - if ( value ) - { - myDotSet.push_back( value ); - } - } - - - void Note::clearDotSet() - { - myDotSet.clear(); - } - - - DotPtr Note::getDot( const DotSetIterConst& setIterator ) const - { - if( setIterator != myDotSet.cend() ) - { - return *setIterator; - } - return DotPtr(); - } - - - AccidentalPtr Note::getAccidental() const - { - MX_LOCK; - MX_JIT_ALLOCATE( Accidental ); - return myAccidental; - } - - - void Note::setAccidental( const AccidentalPtr& value ) - { - if( value ) - { - myAccidental = value; - } - } - - - bool Note::getHasAccidental() const - { - return myHasAccidental; - } - - - void Note::setHasAccidental( const bool value ) - { - myHasAccidental = value; - } - - - TimeModificationPtr Note::getTimeModification() const - { - MX_LOCK; - MX_JIT_ALLOCATE( TimeModification ); - return myTimeModification; - } - - - void Note::setTimeModification( const TimeModificationPtr& value ) - { - if( value ) - { - myTimeModification = value; - } - } - - - bool Note::getHasTimeModification() const - { - return myHasTimeModification; - } - - - void Note::setHasTimeModification( const bool value ) - { - myHasTimeModification = value; - } - - - StemPtr Note::getStem() const - { - MX_LOCK; - MX_JIT_ALLOCATE( Stem ); - return myStem; - } - - - void Note::setStem( const StemPtr& value ) - { - if( value ) - { - myStem = value; - } - } - - - bool Note::getHasStem() const - { - return myHasStem; - } - - - void Note::setHasStem( const bool value ) - { - myHasStem = value; - } - - - NoteheadPtr Note::getNotehead() const - { - MX_LOCK; - MX_JIT_ALLOCATE( Notehead ); - return myNotehead; - } - - - void Note::setNotehead( const NoteheadPtr& value ) - { - if( value ) - { - myNotehead = value; - } - } - - - bool Note::getHasNotehead() const - { - return myHasNotehead; - } - - - void Note::setHasNotehead( const bool value ) - { - myHasNotehead = value; - } - - - NoteheadTextPtr Note::getNoteheadText() const - { - MX_LOCK; - MX_JIT_ALLOCATE( NoteheadText ); - return myNoteheadText; - } - - - void Note::setNoteheadText( const NoteheadTextPtr& value ) - { - if( value ) - { - myNoteheadText = value; - } - } - - - bool Note::getHasNoteheadText() const - { - return myHasNoteheadText; - } - - - void Note::setHasNoteheadText( const bool value ) - { - myHasNoteheadText = value; - } - - - StaffPtr Note::getStaff() const - { - MX_LOCK; - MX_JIT_ALLOCATE( Staff ); - return myStaff; - } - - - void Note::setStaff( const StaffPtr& value ) - { - if ( value ) - { - myStaff = value; - } - } - - - bool Note::getHasStaff() const - { - return myHasStaff; - } - - - void Note::setHasStaff( const bool value ) - { - myHasStaff = value; - } - - - const BeamSet& Note::getBeamSet() const - { - return myBeamSet; - } - - - void Note::removeBeam( const BeamSetIterConst& value ) - { - if ( value != myBeamSet.cend() ) - { - myBeamSet.erase( value ); - } - } - - - void Note::addBeam( const BeamPtr& value ) - { - if ( value ) - { - if ( myBeamSet.size() < 8 ) - { - myBeamSet.push_back( value ); - } - } - } - - - void Note::clearBeamSet() - { - myBeamSet.clear(); - } - - - BeamPtr Note::getBeam( const BeamSetIterConst& setIterator ) const - { - if( setIterator != myBeamSet.cend() ) - { - return *setIterator; - } - return BeamPtr(); - } - - - const NotationsSet& Note::getNotationsSet() const - { - return myNotationsSet; - } - - - void Note::removeNotations( const NotationsSetIterConst& value ) - { - if ( value != myNotationsSet.cend() ) - { - myNotationsSet.erase( value ); - } - } - - - void Note::addNotations( const NotationsPtr& value ) - { - if ( value ) - { - myNotationsSet.push_back( value ); - } - } - - - void Note::clearNotationsSet() - { - myNotationsSet.clear(); - } - - - NotationsPtr Note::getNotations( const NotationsSetIterConst& setIterator ) const - { - if( setIterator != myNotationsSet.cend() ) - { - return *setIterator; - } - return NotationsPtr(); - } - - - const LyricSet& Note::getLyricSet() const - { - return myLyricSet; - } - - - void Note::removeLyric( const LyricSetIterConst& value ) - { - if ( value != myLyricSet.cend() ) - { - myLyricSet.erase( value ); - } - } - - - void Note::addLyric( const LyricPtr& value ) - { - if ( value ) - { - myLyricSet.push_back( value ); - } - } - - - void Note::clearLyricSet() - { - myLyricSet.clear(); - } - - - LyricPtr Note::getLyric( const LyricSetIterConst& setIterator ) const - { - if( setIterator != myLyricSet.cend() ) - { - return *setIterator; - } - return LyricPtr(); - } - - - PlayPtr Note::getPlay() const - { - MX_LOCK; - MX_JIT_ALLOCATE( Play ); - return myPlay; - } - - - void Note::setPlay( const PlayPtr& value ) - { - if( value ) - { - myPlay = value; - } - } - - - bool Note::getHasPlay() const - { - return myHasPlay; - } - - - void Note::setHasPlay( const bool value ) - { - myHasPlay = value; - } - - - bool Note::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isNoteChoiceFound = false; - bool isFirstDotAdded = false; - bool isFirstBeamAdded = false; - bool isFirstNotationsAdded = false; - bool isFirstLyricAdded = false; - - isSuccess &= getAttributes()->fromXElement( message, xelement ); - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - const std::string elementName = it->getName(); - - if( elementName == "pitch" - || elementName == "unpitched" - || elementName == "rest" - || elementName == "chord" - || elementName == "grace" - || elementName == "cue" ) - { - isNoteChoiceFound = true; - isSuccess &= parseNoteChoice( message, xelement, it ); - --it; - } - else if( elementName == "instrument" ) - { - myHasInstrument = true; - isSuccess &= getInstrument()->fromXElement( message, *it ); - } - else if( elementName == "footnote" - || elementName == "level" - || elementName == "voice" ) - { - isSuccess &= parseEditorialVoiceGroup( message, xelement, it ); - } - else if( elementName == "type" ) - { - myHasType = true; - isSuccess &= getType()->fromXElement( message, *it ); - } - else if( elementName == "dot" ) - { - auto dot = makeDot(); - isSuccess &= dot->fromXElement( message, *it ); - - if( !isFirstDotAdded && myDotSet.size() == 1 ) - { - *( myDotSet.begin() ) = dot; - isFirstDotAdded = true; - } - else - { - myDotSet.push_back( dot ); - isFirstDotAdded = true; - } - } - else if( elementName == "accidental" ) - { - myHasAccidental = true; - isSuccess &= getAccidental()->fromXElement( message, *it ); - } - else if( elementName == "time-modification" ) - { - myHasTimeModification = true; - isSuccess &= getTimeModification()->fromXElement( message, *it ); - } - else if( elementName == "stem" ) - { - myHasStem = true; - isSuccess &= getStem()->fromXElement( message, *it ); - } - else if( elementName == "notehead" ) - { - myHasNotehead = true; - isSuccess &= getNotehead()->fromXElement( message, *it ); - } - else if( elementName == "notehead-text" ) - { - myHasNoteheadText = true; - isSuccess &= getNoteheadText()->fromXElement( message, *it ); - } - else if( elementName == "staff" ) - { - myHasStaff = true; - isSuccess &= getStaff()->fromXElement( message, *it ); - } - else if( elementName == "beam" ) - { - auto beam = makeBeam(); - isSuccess &= beam->fromXElement( message, *it ); - - if( !isFirstBeamAdded && myBeamSet.size() == 1 ) - { - *( myBeamSet.begin() ) = beam; - isFirstBeamAdded = true; - } - else - { - myBeamSet.push_back( beam ); - isFirstBeamAdded = true; - } - } - else if( elementName == "notations" ) - { - auto notations = makeNotations(); - isSuccess &= notations->fromXElement( message, *it ); - - if( !isFirstNotationsAdded && myNotationsSet.size() == 1 ) - { - *( myNotationsSet.begin() ) = notations; - isFirstNotationsAdded = true; - } - else - { - myNotationsSet.push_back( notations ); - isFirstNotationsAdded = true; - } - } - else if( elementName == "lyric" ) - { - auto lyric = makeLyric(); - isSuccess &= lyric->fromXElement( message, *it ); - - if( !isFirstLyricAdded && myLyricSet.size() == 1 ) - { - *( myLyricSet.begin() ) = lyric; - isFirstLyricAdded = true; - } - else - { - myLyricSet.push_back( lyric ); - isFirstLyricAdded = true; - } - } - else if( elementName == "play" ) - { - myHasPlay = true; - isSuccess &= getPlay()->fromXElement( message, *it ); - } - else - { - isSuccess = false; - message << "Note: unexpected element '" << elementName << "'" << std::endl; - } - } - - if( !isNoteChoiceFound ) - { - isSuccess = false; - message << "Note: 'note-choice' elements were required but not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - - bool Note::parseNoteChoice( std::ostream& message, ::ezxml::XElement& noteElement, ::ezxml::XElementIterator& iter ) - { - if( iter == noteElement.end() ) - { - return false; - } - - bool isSuccess = true; - - - const std::string elementName = iter->getName(); - FullNoteGroupPtr fullNoteGroup = nullptr; - - if( elementName == "grace" ) - { - getNoteChoice()->setChoice( NoteChoice::Choice::grace ); - isSuccess &= getNoteChoice()->getGraceNoteGroup()->getGrace()->fromXElement( message, *iter ); - fullNoteGroup = getNoteChoice()->getGraceNoteGroup()->getFullNoteGroup(); - ++iter; - } - else if ( elementName == "cue" ) - { - getNoteChoice()->setChoice( NoteChoice::Choice::cue ); - isSuccess &= getNoteChoice()->getCueNoteGroup()->getCue()->fromXElement( message, *iter ); - fullNoteGroup = getNoteChoice()->getCueNoteGroup()->getFullNoteGroup(); - ++iter; - } - else - { - getNoteChoice()->setChoice( NoteChoice::Choice::normal ); - fullNoteGroup = getNoteChoice()->getNormalNoteGroup()->getFullNoteGroup(); - } - - // we should now be pointing at the full note group - isSuccess &= parseFullNoteGroup( message, noteElement, iter, fullNoteGroup ); - - // NormalNoteGroups and CueNoteGroups require a duration element - if( elementName != "grace" ) - { - if( iter == noteElement.end() || iter->getName() != "duration" ) - { - message << "Note: parseNoteChoice - a 'duration' element was required but not found" << std::endl; - return false; - } - - if( getNoteChoice()->getChoice() == NoteChoice::Choice::normal ) - { - getNoteChoice()->getNormalNoteGroup()->getDuration()->fromXElement( message, *iter ); - } - else if( getNoteChoice()->getChoice() == NoteChoice::Choice::cue ) - { - getNoteChoice()->getCueNoteGroup()->getDuration()->fromXElement( message, *iter ); - } - ++iter; - } - - // additional stuff is optional so we may be at the end iter - if( iter == noteElement.end() ) - { - MX_RETURN_IS_SUCCESS; - } - - // now we may be pointing at tie elements, but only if the choice is normal or grace - if( getNoteChoice()->getChoice() == NoteChoice::Choice::normal || getNoteChoice()->getChoice() == NoteChoice::Choice::grace ) - { - std::string possibleTieElementName = iter->getName(); - while( iter != noteElement.end() && iter->getName() == "tie" ) - { - auto tie = makeTie(); - isSuccess &= tie->fromXElement( message, *iter ); - if( getNoteChoice()->getChoice() == NoteChoice::Choice::normal ) - { - getNoteChoice()->getNormalNoteGroup()->addTie( tie ); - } - else if ( getNoteChoice()->getChoice() == NoteChoice::Choice::grace ) - { - getNoteChoice()->getGraceNoteGroup()->addTie( tie ); - } - ++iter; - } - } - else if( getNoteChoice()->getChoice() == NoteChoice::Choice::cue ) - { - MX_RETURN_IS_SUCCESS; - } - - - MX_RETURN_IS_SUCCESS; - } - - - bool Note::parseFullNoteGroup( std::ostream& message, ::ezxml::XElement& noteElement, ::ezxml::XElementIterator& iter, FullNoteGroupPtr& outFullNoteGroup ) - { - if( iter == noteElement.end() ) - { - return false; - } - - bool isSuccess = true; - - if( iter->getName() == "chord" ) - { - outFullNoteGroup->setHasChord( true ); - ++iter; - } - - // we should now be pointing at the FullNoteTypeChoice - if( iter == noteElement.end() ) - { - message << "Note: parseFullNoteGroup did not find the FullNoteChoice" << std::endl; - return false; - } - - const std::string noteChoiceElementName = iter->getName(); - - if( noteChoiceElementName == "pitch" ) - { - outFullNoteGroup->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::pitch ); - isSuccess &= outFullNoteGroup->getFullNoteTypeChoice()->getPitch()->fromXElement( message, *iter ); - ++iter; - } - else if( noteChoiceElementName == "unpitched" ) - { - outFullNoteGroup->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::unpitched ); - isSuccess &= outFullNoteGroup->getFullNoteTypeChoice()->getUnpitched()->fromXElement( message, *iter ); - ++iter; - } - else if( noteChoiceElementName == "rest" ) - { - outFullNoteGroup->getFullNoteTypeChoice()->setChoice( FullNoteTypeChoice::Choice::rest ); - isSuccess &= outFullNoteGroup->getFullNoteTypeChoice()->getRest()->fromXElement( message, *iter ); - ++iter; - } - else - { - message << "Note: parseFullNoteGroup encountered unexpected element '" << noteChoiceElementName << "'" << std::endl; - isSuccess = false; - ++iter; - } - - MX_RETURN_IS_SUCCESS; - } - - - bool Note::parseEditorialVoiceGroup( std::ostream& message, ::ezxml::XElement& noteElement, ::ezxml::XElementIterator& iter ) - { - bool isSuccess = true; - bool isIterIncremented = false; - while( iter != noteElement.end() && ( iter->getName() == "footnote" || iter->getName() == "level" || iter->getName() == "voice" ) ) - { - if( iter->getName() == "footnote" ) - { - getEditorialVoiceGroup()->setHasFootnote( true ); - isSuccess &= getEditorialVoiceGroup()->getFootnote()->fromXElement( message, *iter ); - } - else if ( iter->getName() == "level" ) - { - getEditorialVoiceGroup()->setHasLevel( true ); - isSuccess &= getEditorialVoiceGroup()->getLevel()->fromXElement( message, *iter ); - } - else if ( iter->getName() == "voice" ) - { - getEditorialVoiceGroup()->setHasVoice( true ); - isSuccess &= getEditorialVoiceGroup()->getVoice()->fromXElement( message, *iter ); - } - - ++iter; - isIterIncremented = true; - } - - if( isIterIncremented ) - { - --iter; - } - MX_RETURN_IS_SUCCESS; - } - } -} diff --git a/Sourcecode/private/mx/core/elements/Note.h b/Sourcecode/private/mx/core/elements/Note.h deleted file mode 100644 index acacb45d6..000000000 --- a/Sourcecode/private/mx/core/elements/Note.h +++ /dev/null @@ -1,197 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/NoteAttributes.h" - -#include -#include -#include - -namespace ezxml -{ - class XElementIterator; -} - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NoteAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Accidental ) - MX_FORWARD_DECLARE_ELEMENT( Beam ) - MX_FORWARD_DECLARE_ELEMENT( Dot ) - MX_FORWARD_DECLARE_ELEMENT( EditorialVoiceGroup ) - MX_FORWARD_DECLARE_ELEMENT( FullNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( Instrument ) - MX_FORWARD_DECLARE_ELEMENT( Lyric ) - MX_FORWARD_DECLARE_ELEMENT( Notations ) - MX_FORWARD_DECLARE_ELEMENT( NoteChoice ) - MX_FORWARD_DECLARE_ELEMENT( Notehead ) - MX_FORWARD_DECLARE_ELEMENT( NoteheadText ) - MX_FORWARD_DECLARE_ELEMENT( Play ) - MX_FORWARD_DECLARE_ELEMENT( Staff ) - MX_FORWARD_DECLARE_ELEMENT( Stem ) - MX_FORWARD_DECLARE_ELEMENT( TimeModification ) - MX_FORWARD_DECLARE_ELEMENT( Type ) - MX_FORWARD_DECLARE_ELEMENT( Note ) - - inline NotePtr makeNote() { return std::make_shared(); } - - class Note : public ElementInterface - { - public: - Note(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteAttributesPtr getAttributes() const; - void setAttributes( const NoteAttributesPtr& value ); - - /* _________ NoteChoice minOccurs = 1, maxOccurs = 1 _________ */ - NoteChoicePtr getNoteChoice() const; - void setNoteChoice( const NoteChoicePtr& value ); - - /* _________ Instrument minOccurs = 0, maxOccurs = 1 _________ */ - InstrumentPtr getInstrument() const; - void setInstrument( const InstrumentPtr& value ); - bool getHasInstrument() const; - void setHasInstrument( const bool value ); - - /* _________ EditorialVoiceGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialVoiceGroupPtr getEditorialVoiceGroup() const; - void setEditorialVoiceGroup( const EditorialVoiceGroupPtr& value ); - - /* _________ Type minOccurs = 0, maxOccurs = 1 _________ */ - TypePtr getType() const; - void setType( const TypePtr& value ); - bool getHasType() const; - void setHasType( const bool value ); - - /* _________ Dot minOccurs = 0, maxOccurs = unbounded _________ */ - const DotSet& getDotSet() const; - void addDot( const DotPtr& value ); - void removeDot( const DotSetIterConst& value ); - void clearDotSet(); - DotPtr getDot( const DotSetIterConst& setIterator ) const; - - /* _________ Accidental minOccurs = 0, maxOccurs = 1 _________ */ - AccidentalPtr getAccidental() const; - void setAccidental( const AccidentalPtr& value ); - bool getHasAccidental() const; - void setHasAccidental( const bool value ); - - /* _________ TimeModification minOccurs = 0, maxOccurs = 1 _________ */ - TimeModificationPtr getTimeModification() const; - void setTimeModification( const TimeModificationPtr& value ); - bool getHasTimeModification() const; - void setHasTimeModification( const bool value ); - - /* _________ Stem minOccurs = 0, maxOccurs = 1 _________ */ - StemPtr getStem() const; - void setStem( const StemPtr& value ); - bool getHasStem() const; - void setHasStem( const bool value ); - - /* _________ Notehead minOccurs = 0, maxOccurs = 1 _________ */ - NoteheadPtr getNotehead() const; - void setNotehead( const NoteheadPtr& value ); - bool getHasNotehead() const; - void setHasNotehead( const bool value ); - - /* _________ NoteheadText minOccurs = 0, maxOccurs = 1 _________ */ - NoteheadTextPtr getNoteheadText() const; - void setNoteheadText( const NoteheadTextPtr& value ); - bool getHasNoteheadText() const; - void setHasNoteheadText( const bool value ); - - /* _________ Staff minOccurs = 0, maxOccurs = 1 _________ */ - StaffPtr getStaff() const; - void setStaff( const StaffPtr& value ); - bool getHasStaff() const; - void setHasStaff( const bool value ); - - /* _________ Beam minOccurs = 0, maxOccurs = 8 _________ */ - const BeamSet& getBeamSet() const; - void addBeam( const BeamPtr& value ); - void removeBeam( const BeamSetIterConst& value ); - void clearBeamSet(); - BeamPtr getBeam( const BeamSetIterConst& setIterator ) const; - - /* _________ Notations minOccurs = 0, maxOccurs = unbounded _________ */ - const NotationsSet& getNotationsSet() const; - void addNotations( const NotationsPtr& value ); - void removeNotations( const NotationsSetIterConst& value ); - void clearNotationsSet(); - NotationsPtr getNotations( const NotationsSetIterConst& setIterator ) const; - - /* _________ Lyric minOccurs = 0, maxOccurs = unbounded _________ */ - const LyricSet& getLyricSet() const; - void addLyric( const LyricPtr& value ); - void removeLyric( const LyricSetIterConst& value ); - void clearLyricSet(); - LyricPtr getLyric( const LyricSetIterConst& setIterator ) const; - - /* _________ Play minOccurs = 0, maxOccurs = 1 _________ */ - PlayPtr getPlay() const; - void setPlay( const PlayPtr& value ); - bool getHasPlay() const; - void setHasPlay( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MX_MUTEX - mutable NoteAttributesPtr myAttributes; - mutable NoteChoicePtr myNoteChoice; - mutable InstrumentPtr myInstrument; - bool myHasInstrument; - mutable EditorialVoiceGroupPtr myEditorialVoiceGroup; - mutable TypePtr myType; - bool myHasType; - DotSet myDotSet; - mutable AccidentalPtr myAccidental; - bool myHasAccidental; - mutable TimeModificationPtr myTimeModification; - bool myHasTimeModification; - mutable StemPtr myStem; - bool myHasStem; - mutable NoteheadPtr myNotehead; - bool myHasNotehead; - mutable NoteheadTextPtr myNoteheadText; - bool myHasNoteheadText; - mutable StaffPtr myStaff; - bool myHasStaff; - BeamSet myBeamSet; - NotationsSet myNotationsSet; - LyricSet myLyricSet; - mutable PlayPtr myPlay; - bool myHasPlay; - - bool parseNoteChoice( - std::ostream& message, - ::ezxml::XElement& noteElement, - ::ezxml::XElementIterator& iter ); - - bool parseFullNoteGroup( - std::ostream& message, - ::ezxml::XElement& noteElement, - ::ezxml::XElementIterator& iter, - FullNoteGroupPtr& outFullNoteGroup ); - - bool parseEditorialVoiceGroup( - std::ostream& message, - ::ezxml::XElement& noteElement, - ::ezxml::XElementIterator& iter ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteAttributes.cpp b/Sourcecode/private/mx/core/elements/NoteAttributes.cpp deleted file mode 100644 index 96c45bff4..000000000 --- a/Sourcecode/private/mx/core/elements/NoteAttributes.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NoteAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - NoteAttributes::NoteAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,printObject( YesNo::no ) - ,printDot( YesNo::no ) - ,printSpacing( YesNo::no ) - ,printLyric( YesNo::no ) - ,dynamics() - ,endDynamics() - ,attack() - ,release() - ,timeOnly() - ,pizzicato( YesNo::no ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPrintObject( false ) - ,hasPrintDot( false ) - ,hasPrintSpacing( false ) - ,hasPrintLyric( false ) - ,hasDynamics( false ) - ,hasEndDynamics( false ) - ,hasAttack( false ) - ,hasRelease( false ) - ,hasTimeOnly( false ) - ,hasPizzicato( false ) - {} - - - bool NoteAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPrintObject || - hasPrintDot || - hasPrintSpacing || - hasPrintLyric || - hasDynamics || - hasEndDynamics || - hasAttack || - hasRelease || - hasTimeOnly || - hasPizzicato; - } - - - std::ostream& NoteAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, printDot, "print-dot", hasPrintDot ); - streamAttribute( os, printSpacing, "print-spacing", hasPrintSpacing ); - streamAttribute( os, printLyric, "print-lyric", hasPrintLyric ); - streamAttribute( os, dynamics, "dynamics", hasDynamics ); - streamAttribute( os, endDynamics, "end-dynamics", hasEndDynamics ); - streamAttribute( os, attack, "attack", hasAttack ); - streamAttribute( os, release, "release", hasRelease ); - streamAttribute( os, timeOnly, "time-only", hasTimeOnly ); - streamAttribute( os, pizzicato, "pizzicato", hasPizzicato ); - } - return os; - } - - - bool NoteAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "NoteAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printDot, hasPrintDot, "print-dot", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printSpacing, hasPrintSpacing, "print-spacing", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printLyric, hasPrintLyric, "print-lyric", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dynamics, hasDynamics, "dynamics" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, endDynamics, hasEndDynamics, "end-dynamics" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, attack, hasAttack, "attack" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, release, hasRelease, "release" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, timeOnly, hasTimeOnly, "time-only" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, pizzicato, hasPizzicato, "pizzicato", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteAttributes.h b/Sourcecode/private/mx/core/elements/NoteAttributes.h deleted file mode 100644 index 62ae406fe..000000000 --- a/Sourcecode/private/mx/core/elements/NoteAttributes.h +++ /dev/null @@ -1,75 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/TimeOnly.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NoteAttributes ) - - struct NoteAttributes : public AttributesInterface - { - public: - NoteAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - YesNo printObject; - YesNo printDot; - YesNo printSpacing; - YesNo printLyric; - NonNegativeDecimal dynamics; - NonNegativeDecimal endDynamics; - DivisionsValue attack; - DivisionsValue release; - TimeOnly timeOnly; - YesNo pizzicato; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPrintObject; - bool hasPrintDot; - bool hasPrintSpacing; - bool hasPrintLyric; - bool hasDynamics; - bool hasEndDynamics; - bool hasAttack; - bool hasRelease; - bool hasTimeOnly; - bool hasPizzicato; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteChoice.cpp b/Sourcecode/private/mx/core/elements/NoteChoice.cpp deleted file mode 100644 index aa3b60d0f..000000000 --- a/Sourcecode/private/mx/core/elements/NoteChoice.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NoteChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/CueNoteGroup.h" -#include "mx/core/elements/GraceNoteGroup.h" -#include "mx/core/elements/NormalNoteGroup.h" -#include - -namespace mx -{ - namespace core - { - NoteChoice::NoteChoice() - :myChoice( Choice::normal ) - ,myGraceNoteGroup( makeGraceNoteGroup() ) - ,myCueNoteGroup( makeCueNoteGroup() ) - ,myNormalNoteGroup( makeNormalNoteGroup() ) - {} - - - bool NoteChoice::hasAttributes() const - { - return false; - } - - - std::ostream& NoteChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NoteChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool NoteChoice::hasContents() const - { - return true; - } - - - std::ostream& NoteChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::grace: - myGraceNoteGroup->streamContents( os, indentLevel, isOneLineOnly ); - break; - case Choice::cue: - myCueNoteGroup->streamContents( os, indentLevel, isOneLineOnly ); - break; - case Choice::normal: - myNormalNoteGroup->streamContents( os, indentLevel, isOneLineOnly ); - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - NoteChoice::Choice NoteChoice::getChoice() const - { - return myChoice; - } - - - void NoteChoice::setChoice( const NoteChoice::Choice value ) - { - myChoice = value; - } - - - GraceNoteGroupPtr NoteChoice::getGraceNoteGroup() const - { - return myGraceNoteGroup; - } - - - void NoteChoice::setGraceNoteGroup( const GraceNoteGroupPtr& value ) - { - if ( value ) - { - myGraceNoteGroup = value; - } - } - - - CueNoteGroupPtr NoteChoice::getCueNoteGroup() const - { - return myCueNoteGroup; - } - - - void NoteChoice::setCueNoteGroup( const CueNoteGroupPtr& value ) - { - if ( value ) - { - myCueNoteGroup = value; - } - } - - - NormalNoteGroupPtr NoteChoice::getNormalNoteGroup() const - { - return myNormalNoteGroup; - } - - - void NoteChoice::setNormalNoteGroup( const NormalNoteGroupPtr& value ) - { - if ( value ) - { - myNormalNoteGroup = value; - } - } - - MX_FROM_XELEMENT_UNUSED( NoteChoice ); - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteChoice.h b/Sourcecode/private/mx/core/elements/NoteChoice.h deleted file mode 100644 index de3e3b537..000000000 --- a/Sourcecode/private/mx/core/elements/NoteChoice.h +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( CueNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( GraceNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( NormalNoteGroup ) - MX_FORWARD_DECLARE_ELEMENT( NoteChoice ) - - inline NoteChoicePtr makeNoteChoice() { return std::make_shared(); } - - class NoteChoice : public ElementInterface - { - public: - enum class Choice - { - grace = 1, - cue = 2, - normal = 3 - }; - NoteChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - NoteChoice::Choice getChoice() const; - void setChoice( const NoteChoice::Choice value ); - - /* _________ GraceNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ - GraceNoteGroupPtr getGraceNoteGroup() const; - void setGraceNoteGroup( const GraceNoteGroupPtr& value ); - - /* _________ CueNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ - CueNoteGroupPtr getCueNoteGroup() const; - void setCueNoteGroup( const CueNoteGroupPtr& value ); - - /* _________ NormalNoteGroup minOccurs = 1, maxOccurs = 1 _________ */ - NormalNoteGroupPtr getNormalNoteGroup() const; - void setNormalNoteGroup( const NormalNoteGroupPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - GraceNoteGroupPtr myGraceNoteGroup; - CueNoteGroupPtr myCueNoteGroup; - NormalNoteGroupPtr myNormalNoteGroup; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteRelationNote.cpp b/Sourcecode/private/mx/core/elements/NoteRelationNote.cpp deleted file mode 100644 index 2c8cfd749..000000000 --- a/Sourcecode/private/mx/core/elements/NoteRelationNote.cpp +++ /dev/null @@ -1,146 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NoteRelationNote.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/MetronomeNote.h" -#include "mx/core/elements/MetronomeRelationGroup.h" -#include - -namespace mx -{ - namespace core - { - NoteRelationNote::NoteRelationNote() - :myMetronomeNoteSet() - ,myMetronomeRelationGroup( makeMetronomeRelationGroup() ) - ,myHasMetronomeRelationGroup( false ) - { - myMetronomeNoteSet.push_back( makeMetronomeNote() ); - } - - - bool NoteRelationNote::hasAttributes() const - { - return false; - } - - - std::ostream& NoteRelationNote::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NoteRelationNote::streamName( std::ostream& os ) const - { - return os; - } - - - bool NoteRelationNote::hasContents() const - { - return true; - } - - - std::ostream& NoteRelationNote::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto it = myMetronomeNoteSet.cbegin(); - it != myMetronomeNoteSet.cend(); - ++it ) - { - if ( it != myMetronomeNoteSet.cbegin() ) - { - os << std::endl; - } - (*it)->toStream( os, indentLevel ); - } - if ( myHasMetronomeRelationGroup ) - { - os << std::endl; - myMetronomeRelationGroup->streamContents( os, indentLevel, isOneLineOnly ); - } - isOneLineOnly = false; - return os; - } - - - const MetronomeNoteSet& NoteRelationNote::getMetronomeNoteSet() const - { - return myMetronomeNoteSet; - } - - - void NoteRelationNote::addMetronomeNote( const MetronomeNotePtr& value ) - { - if ( value ) - { - myMetronomeNoteSet.push_back( value ); - } - } - - - void NoteRelationNote::removeMetronomeNote( const MetronomeNoteSetIterConst& setIterator ) - { - if ( setIterator != myMetronomeNoteSet.cend() ) - { - if ( myMetronomeNoteSet.size() > 1 ) - { - myMetronomeNoteSet.erase( setIterator ); - } - } - } - - - void NoteRelationNote::clearMetronomeNoteSet() - { - myMetronomeNoteSet.clear(); - myMetronomeNoteSet.push_back( makeMetronomeNote() ); - } - - - MetronomeRelationGroupPtr NoteRelationNote::getMetronomeRelationGroup() const - { - return myMetronomeRelationGroup; - } - - - void NoteRelationNote::setMetronomeRelationGroup( const MetronomeRelationGroupPtr& value ) - { - if ( value ) - { - myMetronomeRelationGroup = value; - } - } - - - bool NoteRelationNote::getHasMetronomeRelationGroup() const - { - return myHasMetronomeRelationGroup; - } - - - void NoteRelationNote::setHasMetronomeRelationGroup( const bool value ) - { - myHasMetronomeRelationGroup = value; - } - - - bool NoteRelationNote::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "metronome-note", myMetronomeNoteSet ); - importGroup( message, it, endIter, isSuccess, myMetronomeRelationGroup, myHasMetronomeRelationGroup ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteRelationNote.h b/Sourcecode/private/mx/core/elements/NoteRelationNote.h deleted file mode 100644 index 4c5c38dd0..000000000 --- a/Sourcecode/private/mx/core/elements/NoteRelationNote.h +++ /dev/null @@ -1,57 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( MetronomeNote ) - MX_FORWARD_DECLARE_ELEMENT( MetronomeRelationGroup ) - MX_FORWARD_DECLARE_ELEMENT( NoteRelationNote ) - - inline NoteRelationNotePtr makeNoteRelationNote() { return std::make_shared(); } - - class NoteRelationNote : public ElementInterface - { - public: - NoteRelationNote(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ MetronomeNote minOccurs = 1, maxOccurs = unbounded _________ */ - const MetronomeNoteSet& getMetronomeNoteSet() const; - void addMetronomeNote( const MetronomeNotePtr& value ); - void removeMetronomeNote( const MetronomeNoteSetIterConst& setIterator ); - void clearMetronomeNoteSet(); - - /* _________ MetronomeRelationGroup minOccurs = 0, maxOccurs = 1 _________ */ - MetronomeRelationGroupPtr getMetronomeRelationGroup() const; - void setMetronomeRelationGroup( const MetronomeRelationGroupPtr& value ); - bool getHasMetronomeRelationGroup() const; - void setHasMetronomeRelationGroup( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MetronomeNoteSet myMetronomeNoteSet; - MetronomeRelationGroupPtr myMetronomeRelationGroup; - bool myHasMetronomeRelationGroup; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteSize.cpp b/Sourcecode/private/mx/core/elements/NoteSize.cpp deleted file mode 100644 index edaecf47a..000000000 --- a/Sourcecode/private/mx/core/elements/NoteSize.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NoteSize.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - NoteSize::NoteSize() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - NoteSize::NoteSize( const NonNegativeDecimal& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool NoteSize::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool NoteSize::hasContents() const - { - return true; - } - - - std::ostream& NoteSize::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& NoteSize::streamName( std::ostream& os ) const - { - os << "note-size"; - return os; - } - - - std::ostream& NoteSize::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NoteSizeAttributesPtr NoteSize::getAttributes() const - { - return myAttributes; - } - - - void NoteSize::setAttributes( const NoteSizeAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - NonNegativeDecimal NoteSize::getValue() const - { - return myValue; - } - - - void NoteSize::setValue( const NonNegativeDecimal& value ) - { - myValue = value; - } - - - bool NoteSize::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteSize.h b/Sourcecode/private/mx/core/elements/NoteSize.h deleted file mode 100644 index 1d266482a..000000000 --- a/Sourcecode/private/mx/core/elements/NoteSize.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/elements/NoteSizeAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NoteSizeAttributes ) - MX_FORWARD_DECLARE_ELEMENT( NoteSize ) - - inline NoteSizePtr makeNoteSize() { return std::make_shared(); } - inline NoteSizePtr makeNoteSize( const NonNegativeDecimal& value ) { return std::make_shared( value ); } - inline NoteSizePtr makeNoteSize( NonNegativeDecimal&& value ) { return std::make_shared( std::move( value ) ); } - - class NoteSize : public ElementInterface - { - public: - NoteSize(); - NoteSize( const NonNegativeDecimal& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteSizeAttributesPtr getAttributes() const; - void setAttributes( const NoteSizeAttributesPtr& attributes ); - NonNegativeDecimal getValue() const; - void setValue( const NonNegativeDecimal& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeDecimal myValue; - NoteSizeAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteSizeAttributes.cpp b/Sourcecode/private/mx/core/elements/NoteSizeAttributes.cpp deleted file mode 100644 index a2e4a50f4..000000000 --- a/Sourcecode/private/mx/core/elements/NoteSizeAttributes.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NoteSizeAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - NoteSizeAttributes::NoteSizeAttributes() - :type( NoteSizeType::large ) - ,hasType( true ) - {} - - - bool NoteSizeAttributes::hasValues() const - { - return hasType; - } - - - std::ostream& NoteSizeAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool NoteSizeAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "NoteSizeAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseNoteSizeType ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteSizeAttributes.h b/Sourcecode/private/mx/core/elements/NoteSizeAttributes.h deleted file mode 100644 index 80b060263..000000000 --- a/Sourcecode/private/mx/core/elements/NoteSizeAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NoteSizeAttributes ) - - struct NoteSizeAttributes : public AttributesInterface - { - public: - NoteSizeAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - NoteSizeType type; - const bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Notehead.cpp b/Sourcecode/private/mx/core/elements/Notehead.cpp deleted file mode 100644 index 07cecdab6..000000000 --- a/Sourcecode/private/mx/core/elements/Notehead.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Notehead.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Notehead::Notehead() - :myValue( NoteheadValue::normal ) - ,myAttributes( std::make_shared() ) - {} - - - Notehead::Notehead( const NoteheadValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Notehead::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Notehead::hasContents() const - { - return true; - } - - - std::ostream& Notehead::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Notehead::streamName( std::ostream& os ) const - { - os << "notehead"; - return os; - } - - - std::ostream& Notehead::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NoteheadAttributesPtr Notehead::getAttributes() const - { - return myAttributes; - } - - - void Notehead::setAttributes( const NoteheadAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - NoteheadValue Notehead::getValue() const - { - return myValue; - } - - - void Notehead::setValue( const NoteheadValue& value ) - { - myValue = value; - } - - - bool Notehead::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseNoteheadValue( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Notehead.h b/Sourcecode/private/mx/core/elements/Notehead.h deleted file mode 100644 index aec8c27c7..000000000 --- a/Sourcecode/private/mx/core/elements/Notehead.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/NoteheadAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NoteheadAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Notehead ) - - inline NoteheadPtr makeNotehead() { return std::make_shared(); } - inline NoteheadPtr makeNotehead( const NoteheadValue& value ) { return std::make_shared( value ); } - inline NoteheadPtr makeNotehead( NoteheadValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Notehead : public ElementInterface - { - public: - Notehead(); - Notehead( const NoteheadValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteheadAttributesPtr getAttributes() const; - void setAttributes( const NoteheadAttributesPtr& attributes ); - NoteheadValue getValue() const; - void setValue( const NoteheadValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NoteheadValue myValue; - NoteheadAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteheadAttributes.cpp b/Sourcecode/private/mx/core/elements/NoteheadAttributes.cpp deleted file mode 100644 index e2d8ffcd9..000000000 --- a/Sourcecode/private/mx/core/elements/NoteheadAttributes.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NoteheadAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - NoteheadAttributes::NoteheadAttributes() - :filled() - ,parentheses() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasFilled( false ) - ,hasParentheses( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - {} - - - bool NoteheadAttributes::hasValues() const - { - return hasFilled || - hasParentheses || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight | - hasColor; - } - - - std::ostream& NoteheadAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, filled, "filled", hasFilled ); - streamAttribute( os, parentheses, "parentheses", hasParentheses ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - } - return os; - } - - - bool NoteheadAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "NoteheadAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, filled, hasFilled, "filled", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, parentheses, hasParentheses, "parentheses", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteheadAttributes.h b/Sourcecode/private/mx/core/elements/NoteheadAttributes.h deleted file mode 100644 index 93ad59995..000000000 --- a/Sourcecode/private/mx/core/elements/NoteheadAttributes.h +++ /dev/null @@ -1,50 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( NoteheadAttributes ) - - struct NoteheadAttributes : public AttributesInterface - { - public: - NoteheadAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo filled; - YesNo parentheses; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - bool hasFilled; - bool hasParentheses; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteheadText.cpp b/Sourcecode/private/mx/core/elements/NoteheadText.cpp deleted file mode 100644 index cb92a2030..000000000 --- a/Sourcecode/private/mx/core/elements/NoteheadText.cpp +++ /dev/null @@ -1,142 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NoteheadText.h" -#include "mx/core/elements/NoteheadTextChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/AccidentalText.h" -#include "mx/core/elements/DisplayText.h" -#include - -namespace mx -{ - namespace core - { - NoteheadText::NoteheadText() - :myNoteheadTextChoiceSet() - { - myNoteheadTextChoiceSet.push_back( makeNoteheadTextChoice() ); - } - - - bool NoteheadText::hasAttributes() const - { - return false; - } - - - std::ostream& NoteheadText::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NoteheadText::streamName( std::ostream& os ) const - { - os << "notehead-text"; - return os; - } - - - bool NoteheadText::hasContents() const - { - return true; - } - - - std::ostream& NoteheadText::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - for( auto x : myNoteheadTextChoiceSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - return os; - } - - - const NoteheadTextChoiceSet& NoteheadText::getNoteheadTextChoiceSet() const - { - return myNoteheadTextChoiceSet; - } - - - void NoteheadText::removeNoteheadTextChoice( const NoteheadTextChoiceSetIterConst& value ) - { - if ( value != myNoteheadTextChoiceSet.cend() ) - { - myNoteheadTextChoiceSet.erase( value ); - } - } - - - void NoteheadText::addNoteheadTextChoice( const NoteheadTextChoicePtr& value ) - { - if ( value ) - { - myNoteheadTextChoiceSet.push_back( value ); - } - } - - - void NoteheadText::clearNoteheadTextChoiceSet() - { - myNoteheadTextChoiceSet.clear(); - myNoteheadTextChoiceSet.push_back( makeNoteheadTextChoice() ); - } - - - bool NoteheadText::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isFirstItemAdded = false; - auto it = xelement.begin(); - auto endIter = xelement.end(); - - for( ; it != endIter; ++ it ) - { - if( it->getName() == "accidental-text" ) - { - auto item = makeNoteheadTextChoice(); - item->setChoice( NoteheadTextChoice::Choice::accidentalText ); - isSuccess &= item->getAccidentalText()->fromXElement( message, xelement ); - - if( !isFirstItemAdded && myNoteheadTextChoiceSet.size() == 1 ) - { - *myNoteheadTextChoiceSet.begin() = item; - isFirstItemAdded = true; - } - else - { - myNoteheadTextChoiceSet.push_back( item ); - isFirstItemAdded = true; - } - } - else if( it->getName() == "display-text" ) - { - auto item = makeNoteheadTextChoice(); - item->setChoice( NoteheadTextChoice::Choice::displayText ); - isSuccess &= item->getDisplayText()->fromXElement( message, xelement ); - - if( !isFirstItemAdded && myNoteheadTextChoiceSet.size() == 1 ) - { - *myNoteheadTextChoiceSet.begin() = item; - isFirstItemAdded = true; - } - else - { - myNoteheadTextChoiceSet.push_back( item ); - isFirstItemAdded = true; - } - } - - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteheadText.h b/Sourcecode/private/mx/core/elements/NoteheadText.h deleted file mode 100644 index 9d930c33a..000000000 --- a/Sourcecode/private/mx/core/elements/NoteheadText.h +++ /dev/null @@ -1,51 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( DisplayText ) - MX_FORWARD_DECLARE_ELEMENT( NoteheadTextChoice ) - MX_FORWARD_DECLARE_ELEMENT( NoteheadText ) - - inline NoteheadTextPtr makeNoteheadText() { return std::make_shared(); } - - class NoteheadText : public ElementInterface - { - public: - NoteheadText(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ NoteheadTextChoice minOccurs = 1, maxOccurs = unbounded _________ */ - const NoteheadTextChoiceSet& getNoteheadTextChoiceSet() const; - void addNoteheadTextChoice( const NoteheadTextChoicePtr& value ); - void removeNoteheadTextChoice( const NoteheadTextChoiceSetIterConst& value ); - void clearNoteheadTextChoiceSet(); - NoteheadTextChoicePtr getNoteheadTextChoice( const NoteheadTextChoiceSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NoteheadTextChoiceSet myNoteheadTextChoiceSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteheadTextChoice.cpp b/Sourcecode/private/mx/core/elements/NoteheadTextChoice.cpp deleted file mode 100644 index b5050a622..000000000 --- a/Sourcecode/private/mx/core/elements/NoteheadTextChoice.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/NoteheadTextChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/AccidentalText.h" -#include "mx/core/elements/DisplayText.h" -#include - -namespace mx -{ - namespace core - { - NoteheadTextChoice::NoteheadTextChoice() - :myChoice( Choice::displayText ) - ,myDisplayText( makeDisplayText() ) - ,myAccidentalText( makeAccidentalText() ) - {} - - - bool NoteheadTextChoice::hasAttributes() const - { - return false; - } - - - std::ostream& NoteheadTextChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& NoteheadTextChoice::streamName( std::ostream& os ) const - { - os << "notehead-text"; - return os; - } - - - bool NoteheadTextChoice::hasContents() const - { - return true; - } - - - std::ostream& NoteheadTextChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - MX_UNUSED( isOneLineOnly ); - switch ( myChoice ) - { - case Choice::displayText: - myDisplayText->toStream( os, indentLevel ); - break; - case Choice::accidentalText: - myAccidentalText->toStream( os, indentLevel ); - break; - default: - break; - } - return os; - } - - - NoteheadTextChoice::Choice NoteheadTextChoice::getChoice() const - { - return myChoice; - } - - - void NoteheadTextChoice::setChoice( NoteheadTextChoice::Choice value ) - { - myChoice = value; - } - - - DisplayTextPtr NoteheadTextChoice::getDisplayText() const - { - return myDisplayText; - } - - - void NoteheadTextChoice::setDisplayText( const DisplayTextPtr& value ) - { - if( value ) - { - myDisplayText = value; - } - } - - - AccidentalTextPtr NoteheadTextChoice::getAccidentalText() const - { - return myAccidentalText; - } - - - void NoteheadTextChoice::setAccidentalText( const AccidentalTextPtr& value ) - { - if( value ) - { - myAccidentalText = value; - } - } - - - bool NoteheadTextChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - - if( xelement.getName() == "display-text" ) - { - myChoice = Choice::displayText; - return getDisplayText()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "accidental-text" ) - { - myChoice = Choice::accidentalText; - return getAccidentalText()->fromXElement( message, xelement ); - } - - message << "NoteheadTextChoice: '" << xelement.getName() << "' is not a valid element" << std::endl; - - return false; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/NoteheadTextChoice.h b/Sourcecode/private/mx/core/elements/NoteheadTextChoice.h deleted file mode 100644 index 62c5fea42..000000000 --- a/Sourcecode/private/mx/core/elements/NoteheadTextChoice.h +++ /dev/null @@ -1,63 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( DisplayText ) - MX_FORWARD_DECLARE_ELEMENT( NoteheadTextChoice ) - - inline NoteheadTextChoicePtr makeNoteheadTextChoice() { return std::make_shared(); } - - class NoteheadTextChoice : public ElementInterface - { - public: - - enum class Choice - { - displayText = 0, - accidentalText = 1 - }; - - NoteheadTextChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - NoteheadTextChoice::Choice getChoice() const; - void setChoice( NoteheadTextChoice::Choice value ); - - /* _________ DisplayText minOccurs = 1, maxOccurs = 1 _________ */ - DisplayTextPtr getDisplayText() const; - void setDisplayText( const DisplayTextPtr& value ); - - /* _________ AccidentalText minOccurs = 1, maxOccurs = 1 _________ */ - AccidentalTextPtr getAccidentalText() const; - void setAccidentalText( const AccidentalTextPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - DisplayTextPtr myDisplayText; - AccidentalTextPtr myAccidentalText; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Octave.cpp b/Sourcecode/private/mx/core/elements/Octave.cpp deleted file mode 100644 index c48407e7c..000000000 --- a/Sourcecode/private/mx/core/elements/Octave.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Octave.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Octave::Octave() - :myValue() - {} - - - Octave::Octave( const OctaveValue& value ) - :myValue( value ) - {} - - - bool Octave::hasAttributes() const - { - return false; - } - - - bool Octave::hasContents() const - { - return true; - } - - - std::ostream& Octave::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Octave::streamName( std::ostream& os ) const - { - os << "octave"; - return os; - } - - - std::ostream& Octave::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - OctaveValue Octave::getValue() const - { - return myValue; - } - - - void Octave::setValue( const OctaveValue& value ) - { - myValue = value; - } - - - bool Octave::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Octave.h b/Sourcecode/private/mx/core/elements/Octave.h deleted file mode 100644 index 7c1aaa90e..000000000 --- a/Sourcecode/private/mx/core/elements/Octave.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Octave ) - - inline OctavePtr makeOctave() { return std::make_shared(); } - inline OctavePtr makeOctave( const OctaveValue& value ) { return std::make_shared( value ); } - inline OctavePtr makeOctave( OctaveValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Octave : public ElementInterface - { - public: - Octave(); - Octave( const OctaveValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OctaveValue getValue() const; - void setValue( const OctaveValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - OctaveValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OctaveChange.cpp b/Sourcecode/private/mx/core/elements/OctaveChange.cpp deleted file mode 100644 index 6974b3a28..000000000 --- a/Sourcecode/private/mx/core/elements/OctaveChange.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OctaveChange.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OctaveChange::OctaveChange() - :myValue() - {} - - - OctaveChange::OctaveChange( const Integer& value ) - :myValue( value ) - {} - - - bool OctaveChange::hasAttributes() const - { - return false; - } - - - bool OctaveChange::hasContents() const - { - return true; - } - - - std::ostream& OctaveChange::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& OctaveChange::streamName( std::ostream& os ) const - { - os << "octave-change"; - return os; - } - - - std::ostream& OctaveChange::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Integer OctaveChange::getValue() const - { - return myValue; - } - - - void OctaveChange::setValue( const Integer& value ) - { - myValue = value; - } - - - bool OctaveChange::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OctaveChange.h b/Sourcecode/private/mx/core/elements/OctaveChange.h deleted file mode 100644 index ed9e74a51..000000000 --- a/Sourcecode/private/mx/core/elements/OctaveChange.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( OctaveChange ) - - inline OctaveChangePtr makeOctaveChange() { return std::make_shared(); } - inline OctaveChangePtr makeOctaveChange( const Integer& value ) { return std::make_shared( value ); } - inline OctaveChangePtr makeOctaveChange( Integer&& value ) { return std::make_shared( std::move( value ) ); } - - class OctaveChange : public ElementInterface - { - public: - OctaveChange(); - OctaveChange( const Integer& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Integer getValue() const; - void setValue( const Integer& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Integer myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OctaveShift.cpp b/Sourcecode/private/mx/core/elements/OctaveShift.cpp deleted file mode 100644 index e21f60432..000000000 --- a/Sourcecode/private/mx/core/elements/OctaveShift.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OctaveShift.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OctaveShift::OctaveShift() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool OctaveShift::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OctaveShift::hasContents() const { return false; } - std::ostream& OctaveShift::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OctaveShift::streamName( std::ostream& os ) const { os << "octave-shift"; return os; } - std::ostream& OctaveShift::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - OctaveShiftAttributesPtr OctaveShift::getAttributes() const - { - return myAttributes; - } - - - void OctaveShift::setAttributes( const OctaveShiftAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool OctaveShift::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OctaveShift.h b/Sourcecode/private/mx/core/elements/OctaveShift.h deleted file mode 100644 index 2e4e8ea08..000000000 --- a/Sourcecode/private/mx/core/elements/OctaveShift.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/OctaveShiftAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OctaveShiftAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OctaveShift ) - - inline OctaveShiftPtr makeOctaveShift() { return std::make_shared(); } - - class OctaveShift : public ElementInterface - { - public: - OctaveShift(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OctaveShiftAttributesPtr getAttributes() const; - void setAttributes( const OctaveShiftAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - OctaveShiftAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.cpp b/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.cpp deleted file mode 100644 index 3167f3c5e..000000000 --- a/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OctaveShiftAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OctaveShiftAttributes::OctaveShiftAttributes() - :type( UpDownStopContinue::up ) - ,number() - ,size( 8 ) - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,hasType( true ) - ,hasNumber( false ) - ,hasSize( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool OctaveShiftAttributes::hasValues() const - { - return hasType || - hasNumber || - hasSize || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& OctaveShiftAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, size, "size", hasSize ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool OctaveShiftAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "OctaveShiftAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseUpDownStopContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, size, hasSize, "size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.h b/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.h deleted file mode 100644 index 124bb20b2..000000000 --- a/Sourcecode/private/mx/core/elements/OctaveShiftAttributes.h +++ /dev/null @@ -1,63 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OctaveShiftAttributes ) - - struct OctaveShiftAttributes : public AttributesInterface - { - public: - OctaveShiftAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - UpDownStopContinue type; - NumberLevel number; - PositiveInteger size; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - const bool hasType; - bool hasNumber; - bool hasSize; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Offset.cpp b/Sourcecode/private/mx/core/elements/Offset.cpp deleted file mode 100644 index 5a6a3df24..000000000 --- a/Sourcecode/private/mx/core/elements/Offset.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Offset.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Offset::Offset() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Offset::Offset( const DivisionsValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Offset::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Offset::hasContents() const - { - return true; - } - - - std::ostream& Offset::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Offset::streamName( std::ostream& os ) const - { - os << "offset"; - return os; - } - - - std::ostream& Offset::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - OffsetAttributesPtr Offset::getAttributes() const - { - return myAttributes; - } - - - void Offset::setAttributes( const OffsetAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - DivisionsValue Offset::getValue() const - { - return myValue; - } - - - void Offset::setValue( const DivisionsValue& value ) - { - myValue = value; - } - - - bool Offset::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Offset.h b/Sourcecode/private/mx/core/elements/Offset.h deleted file mode 100644 index 9abb121e1..000000000 --- a/Sourcecode/private/mx/core/elements/Offset.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/elements/OffsetAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OffsetAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Offset ) - - inline OffsetPtr makeOffset() { return std::make_shared(); } - inline OffsetPtr makeOffset( const DivisionsValue& value ) { return std::make_shared( value ); } - inline OffsetPtr makeOffset( DivisionsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Offset : public ElementInterface - { - public: - Offset(); - Offset( const DivisionsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OffsetAttributesPtr getAttributes() const; - void setAttributes( const OffsetAttributesPtr& attributes ); - DivisionsValue getValue() const; - void setValue( const DivisionsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - DivisionsValue myValue; - OffsetAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OffsetAttributes.cpp b/Sourcecode/private/mx/core/elements/OffsetAttributes.cpp deleted file mode 100644 index c255e40f6..000000000 --- a/Sourcecode/private/mx/core/elements/OffsetAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OffsetAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OffsetAttributes::OffsetAttributes() - :sound() - ,hasSound( false ) - {} - - - bool OffsetAttributes::hasValues() const - { - return hasSound; - } - - - std::ostream& OffsetAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, sound, "sound", hasSound ); - } - return os; - } - - - bool OffsetAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "OffsetAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, sound, hasSound, "sound", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OffsetAttributes.h b/Sourcecode/private/mx/core/elements/OffsetAttributes.h deleted file mode 100644 index e360c3968..000000000 --- a/Sourcecode/private/mx/core/elements/OffsetAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OffsetAttributes ) - - struct OffsetAttributes : public AttributesInterface - { - public: - OffsetAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo sound; - bool hasSound; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OpenString.cpp b/Sourcecode/private/mx/core/elements/OpenString.cpp deleted file mode 100644 index 76eb8fd91..000000000 --- a/Sourcecode/private/mx/core/elements/OpenString.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OpenString.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OpenString::OpenString() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool OpenString::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OpenString::hasContents() const { return false; } - std::ostream& OpenString::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OpenString::streamName( std::ostream& os ) const { os << "open-string"; return os; } - std::ostream& OpenString::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr OpenString::getAttributes() const - { - return myAttributes; - } - - - void OpenString::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool OpenString::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OpenString.h b/Sourcecode/private/mx/core/elements/OpenString.h deleted file mode 100644 index ea2c00538..000000000 --- a/Sourcecode/private/mx/core/elements/OpenString.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OpenString ) - - inline OpenStringPtr makeOpenString() { return std::make_shared(); } - - class OpenString : public ElementInterface - { - public: - OpenString(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Opus.cpp b/Sourcecode/private/mx/core/elements/Opus.cpp deleted file mode 100644 index f46d04956..000000000 --- a/Sourcecode/private/mx/core/elements/Opus.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Opus.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Opus::Opus() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Opus::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Opus::hasContents() const { return false; } - std::ostream& Opus::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Opus::streamName( std::ostream& os ) const { os << "opus"; return os; } - std::ostream& Opus::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - OpusAttributesPtr Opus::getAttributes() const - { - return myAttributes; - } - - - void Opus::setAttributes( const OpusAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Opus::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Opus.h b/Sourcecode/private/mx/core/elements/Opus.h deleted file mode 100644 index f289d9afc..000000000 --- a/Sourcecode/private/mx/core/elements/Opus.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/OpusAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OpusAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Opus ) - - inline OpusPtr makeOpus() { return std::make_shared(); } - - class Opus : public ElementInterface - { - public: - Opus(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OpusAttributesPtr getAttributes() const; - void setAttributes( const OpusAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - OpusAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OpusAttributes.cpp b/Sourcecode/private/mx/core/elements/OpusAttributes.cpp deleted file mode 100644 index dd5aa181f..000000000 --- a/Sourcecode/private/mx/core/elements/OpusAttributes.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OpusAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OpusAttributes::OpusAttributes() - :href() - ,type( XlinkType::simple ) - ,role() - ,title() - ,show( XlinkShow::replace ) - ,actuate( XlinkActuate::onRequest ) - ,hasHref( true ) - ,hasType( false ) - ,hasRole( false ) - ,hasTitle( false ) - ,hasShow( false ) - ,hasActuate( false ) - {} - - - bool OpusAttributes::hasValues() const - { - return hasHref || - hasType || - hasRole || - hasTitle || - hasShow || - hasActuate; - } - - - std::ostream& OpusAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, href, "xlink:href", hasHref ); - streamAttribute( os, type, "xlink:type", hasType ); - streamAttribute( os, role, "xlink:role", hasRole ); - streamAttribute( os, title, "xlink:title", hasTitle ); - streamAttribute( os, show, "xlink:show", hasShow ); - streamAttribute( os, actuate, "xlink:actuate", hasActuate ); - } - return os; - } - - - bool OpusAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "OpusAttributes"; - bool isSuccess = true; - bool isHrefFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, href, isHrefFound, "href" ) ) { continue; } - - if( it->getName() == "xlink:type" ) - { - hasType = true; - continue; - } - - if( parseAttribute( message, it, className, isSuccess, role, hasRole, "role" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, title, hasTitle, "title" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, show, hasShow, "show", &parseXlinkShow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, actuate, hasActuate, "actuate", &parseXlinkActuate ) ) { continue; } - } - - if( !isHrefFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OpusAttributes.h b/Sourcecode/private/mx/core/elements/OpusAttributes.h deleted file mode 100644 index 27178e784..000000000 --- a/Sourcecode/private/mx/core/elements/OpusAttributes.h +++ /dev/null @@ -1,48 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/XlinkHref.h" -#include "mx/core/XlinkRole.h" -#include "mx/core/XlinkTitle.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OpusAttributes ) - - struct OpusAttributes : public AttributesInterface - { - public: - OpusAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XlinkHref href; - const XlinkType type; - XlinkRole role; - XlinkTitle title; - XlinkShow show; - XlinkActuate actuate; - const bool hasHref; - bool hasType; - bool hasRole; - bool hasTitle; - bool hasShow; - bool hasActuate; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Ornaments.cpp b/Sourcecode/private/mx/core/elements/Ornaments.cpp deleted file mode 100644 index 2c938ceed..000000000 --- a/Sourcecode/private/mx/core/elements/Ornaments.cpp +++ /dev/null @@ -1,201 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Ornaments.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/AccidentalMark.h" -#include "mx/core/elements/OrnamentsChoice.h" -#include -#include - -namespace mx -{ - namespace core - { - Ornaments::Ornaments() - :myOrnamentsChoiceSet() - ,myAccidentalMarkSet() - {} - - - bool Ornaments::hasAttributes() const - { - return false; - } - - - std::ostream& Ornaments::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Ornaments::streamName( std::ostream& os ) const - { - os << "ornaments"; - return os; - } - - - bool Ornaments::hasContents() const - { - return true; - } - - - std::ostream& Ornaments::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto x : myOrnamentsChoiceSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - for ( auto x : myAccidentalMarkSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - isOneLineOnly = false; - os << std::endl; - return os; - } - - - const OrnamentsChoiceSet& Ornaments::getOrnamentsChoiceSet() const - { - return myOrnamentsChoiceSet; - } - - - void Ornaments::removeOrnamentsChoice( const OrnamentsChoiceSetIterConst& value ) - { - if ( value != myOrnamentsChoiceSet.cend() ) - { - myOrnamentsChoiceSet.erase( value ); - } - } - - - void Ornaments::addOrnamentsChoice( const OrnamentsChoicePtr& value ) - { - if ( value ) - { - myOrnamentsChoiceSet.push_back( value ); - } - } - - - void Ornaments::clearOrnamentsChoiceSet() - { - myOrnamentsChoiceSet.clear(); - } - - - OrnamentsChoicePtr Ornaments::getOrnamentsChoice( const OrnamentsChoiceSetIterConst& setIterator ) const - { - if( setIterator != myOrnamentsChoiceSet.cend() ) - { - return *setIterator; - } - return OrnamentsChoicePtr(); - } - - - const AccidentalMarkSet& Ornaments::getAccidentalMarkSet() const - { - return myAccidentalMarkSet; - } - - - void Ornaments::removeAccidentalMark( const AccidentalMarkSetIterConst& value ) - { - if ( value != myAccidentalMarkSet.cend() ) - { - myAccidentalMarkSet.erase( value ); - } - } - - - void Ornaments::addAccidentalMark( const AccidentalMarkPtr& value ) - { - if ( value ) - { - myAccidentalMarkSet.push_back( value ); - } - } - - - void Ornaments::clearAccidentalMarkSet() - { - myAccidentalMarkSet.clear(); - } - - - AccidentalMarkPtr Ornaments::getAccidentalMark( const AccidentalMarkSetIterConst& setIterator ) const - { - if( setIterator != myAccidentalMarkSet.cend() ) - { - return *setIterator; - } - return AccidentalMarkPtr(); - } - - - constexpr const char* const ornamentsChoices[] = - { - "trill-mark" - , "turn" - , "delayed-turn" - , "inverted-turn" - , "delayed-inverted-turn" - , "vertical-turn" - , "shake" - , "wavy-line" - , "mordent" - , "inverted-mordent" - , "schleifer" - , "tremolo" - , "other-ornament" - }; - - - constexpr size_t ornamentsChoicesSize = 13; - - - bool Ornaments::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if( isOrnamentsChoice( it->getName().c_str() ) ) - { - auto item = makeOrnamentsChoice(); - isSuccess &= item->fromXElement( message, *it ); - addOrnamentsChoice( item ); - continue; - } - - if( importElementSet( message, it, endIter, isSuccess, "accidental-mark", myAccidentalMarkSet ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - - bool Ornaments::isOrnamentsChoice( const char* const name ) const - { - for( size_t i = 0; i < ornamentsChoicesSize; ++ i ) - { - if( strcmp( name, ornamentsChoices[i] ) == 0 ) - { - return true; - } - } - return false; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Ornaments.h b/Sourcecode/private/mx/core/elements/Ornaments.h deleted file mode 100644 index 3a7273c5f..000000000 --- a/Sourcecode/private/mx/core/elements/Ornaments.h +++ /dev/null @@ -1,61 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( AccidentalMark ) - MX_FORWARD_DECLARE_ELEMENT( OrnamentsChoice ) - MX_FORWARD_DECLARE_ELEMENT( Ornaments ) - - inline OrnamentsPtr makeOrnaments() { return std::make_shared(); } - - class Ornaments : public ElementInterface - { - public: - Ornaments(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ OrnamentsChoice minOccurs = 0, maxOccurs = unbounded _________ */ - const OrnamentsChoiceSet& getOrnamentsChoiceSet() const; - void addOrnamentsChoice( const OrnamentsChoicePtr& value ); - void removeOrnamentsChoice( const OrnamentsChoiceSetIterConst& value ); - void clearOrnamentsChoiceSet(); - OrnamentsChoicePtr getOrnamentsChoice( const OrnamentsChoiceSetIterConst& setIterator ) const; - - - /* _________ AccidentalMark minOccurs = 0, maxOccurs = unbounded _________ */ - const AccidentalMarkSet& getAccidentalMarkSet() const; - void addAccidentalMark( const AccidentalMarkPtr& value ); - void removeAccidentalMark( const AccidentalMarkSetIterConst& value ); - void clearAccidentalMarkSet(); - AccidentalMarkPtr getAccidentalMark( const AccidentalMarkSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - OrnamentsChoiceSet myOrnamentsChoiceSet; - AccidentalMarkSet myAccidentalMarkSet; - - bool isOrnamentsChoice( const char* const name ) const; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OrnamentsChoice.cpp b/Sourcecode/private/mx/core/elements/OrnamentsChoice.cpp deleted file mode 100644 index 811fd4fdf..000000000 --- a/Sourcecode/private/mx/core/elements/OrnamentsChoice.cpp +++ /dev/null @@ -1,434 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OrnamentsChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/DelayedInvertedTurn.h" -#include "mx/core/elements/DelayedTurn.h" -#include "mx/core/elements/InvertedMordent.h" -#include "mx/core/elements/InvertedTurn.h" -#include "mx/core/elements/Mordent.h" -#include "mx/core/elements/OtherOrnament.h" -#include "mx/core/elements/Schleifer.h" -#include "mx/core/elements/Shake.h" -#include "mx/core/elements/Tremolo.h" -#include "mx/core/elements/TrillMark.h" -#include "mx/core/elements/Turn.h" -#include "mx/core/elements/VerticalTurn.h" -#include "mx/core/elements/WavyLine.h" -#include - -namespace mx -{ - namespace core - { - OrnamentsChoice::OrnamentsChoice() - :myChoice( Choice::trillMark ) - ,myTrillMark( makeTrillMark() ) - ,myTurn( makeTurn() ) - ,myDelayedTurn( makeDelayedTurn() ) - ,myInvertedTurn( makeInvertedTurn() ) - ,myDelayedInvertedTurn( makeDelayedInvertedTurn() ) - ,myVerticalTurn( makeVerticalTurn() ) - ,myShake( makeShake() ) - ,myWavyLine( makeWavyLine() ) - ,myMordent( makeMordent() ) - ,myInvertedMordent( makeInvertedMordent() ) - ,mySchleifer( makeSchleifer() ) - ,myTremolo( makeTremolo() ) - ,myOtherOrnament( makeOtherOrnament() ) - {} - - - bool OrnamentsChoice::hasAttributes() const - { - return false; - } - - - std::ostream& OrnamentsChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& OrnamentsChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool OrnamentsChoice::hasContents() const - { - return true; - } - - - std::ostream& OrnamentsChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( isOneLineOnly ); - - switch ( myChoice ) - { - case Choice::trillMark: - { - myTrillMark->toStream( os, indentLevel ); - } - break; - case Choice::turn: - { - myTurn->toStream( os, indentLevel ); - } - break; - case Choice::delayedTurn: - { - myDelayedTurn->toStream( os, indentLevel ); - } - break; - case Choice::invertedTurn: - { - myInvertedTurn->toStream( os, indentLevel ); - } - break; - case Choice::delayedInvertedTurn: - { - myDelayedInvertedTurn->toStream( os, indentLevel ); - } - break; - case Choice::verticalTurn: - { - myVerticalTurn->toStream( os, indentLevel ); - } - break; - case Choice::shake: - { - myShake->toStream( os, indentLevel ); - } - break; - case Choice::wavyLine: - { - myWavyLine->toStream( os, indentLevel ); - } - break; - case Choice::mordent: - { - myMordent->toStream( os, indentLevel ); - } - break; - case Choice::invertedMordent: - { - myInvertedMordent->toStream( os, indentLevel ); - } - break; - case Choice::schleifer: - { - mySchleifer->toStream( os, indentLevel ); - } - break; - case Choice::tremolo: - { - myTremolo->toStream( os, indentLevel ); - } - break; - case Choice::otherOrnament: - { - myOtherOrnament->toStream( os, indentLevel ); - } - break; - default: - break; - } - return os; - } - - - OrnamentsChoice::Choice OrnamentsChoice::getChoice() const - { - return myChoice; - } - - - void OrnamentsChoice::setChoice( const OrnamentsChoice::Choice value ) - { - myChoice = value; - } - - - TrillMarkPtr OrnamentsChoice::getTrillMark() const - { - return myTrillMark; - } - - - void OrnamentsChoice::setTrillMark( const TrillMarkPtr& value ) - { - if( value ) - { - myTrillMark = value; - } - } - - - TurnPtr OrnamentsChoice::getTurn() const - { - return myTurn; - } - - - void OrnamentsChoice::setTurn( const TurnPtr& value ) - { - if( value ) - { - myTurn = value; - } - } - - - DelayedTurnPtr OrnamentsChoice::getDelayedTurn() const - { - return myDelayedTurn; - } - - - void OrnamentsChoice::setDelayedTurn( const DelayedTurnPtr& value ) - { - if( value ) - { - myDelayedTurn = value; - } - } - - - InvertedTurnPtr OrnamentsChoice::getInvertedTurn() const - { - return myInvertedTurn; - } - - - void OrnamentsChoice::setInvertedTurn( const InvertedTurnPtr& value ) - { - if( value ) - { - myInvertedTurn = value; - } - } - - - DelayedInvertedTurnPtr OrnamentsChoice::getDelayedInvertedTurn() const - { - return myDelayedInvertedTurn; - } - - - void OrnamentsChoice::setDelayedInvertedTurn( const DelayedInvertedTurnPtr& value ) - { - if( value ) - { - myDelayedInvertedTurn = value; - } - } - - - VerticalTurnPtr OrnamentsChoice::getVerticalTurn() const - { - return myVerticalTurn; - } - - - void OrnamentsChoice::setVerticalTurn( const VerticalTurnPtr& value ) - { - if( value ) - { - myVerticalTurn = value; - } - } - - - ShakePtr OrnamentsChoice::getShake() const - { - return myShake; - } - - - void OrnamentsChoice::setShake( const ShakePtr& value ) - { - if( value ) - { - myShake = value; - } - } - - - WavyLinePtr OrnamentsChoice::getWavyLine() const - { - return myWavyLine; - } - - - void OrnamentsChoice::setWavyLine( const WavyLinePtr& value ) - { - if( value ) - { - myWavyLine = value; - } - } - - - MordentPtr OrnamentsChoice::getMordent() const - { - return myMordent; - } - - - void OrnamentsChoice::setMordent( const MordentPtr& value ) - { - if( value ) - { - myMordent = value; - } - } - - - InvertedMordentPtr OrnamentsChoice::getInvertedMordent() const - { - return myInvertedMordent; - } - - - void OrnamentsChoice::setInvertedMordent( const InvertedMordentPtr& value ) - { - if( value ) - { - myInvertedMordent = value; - } - } - - - SchleiferPtr OrnamentsChoice::getSchleifer() const - { - return mySchleifer; - } - - - void OrnamentsChoice::setSchleifer( const SchleiferPtr& value ) - { - if( value ) - { - mySchleifer = value; - } - } - - - TremoloPtr OrnamentsChoice::getTremolo() const - { - return myTremolo; - } - - - void OrnamentsChoice::setTremolo( const TremoloPtr& value ) - { - if( value ) - { - myTremolo = value; - } - } - - - OtherOrnamentPtr OrnamentsChoice::getOtherOrnament() const - { - return myOtherOrnament; - } - - - void OrnamentsChoice::setOtherOrnament( const OtherOrnamentPtr& value ) - { - if( value ) - { - myOtherOrnament = value; - } - } - - - bool OrnamentsChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - const std::string elementName = xelement.getName(); - - if( elementName == "trill-mark" ) - { - myChoice = Choice::trillMark; - isSuccess &= getTrillMark()->fromXElement( message, xelement ); - } - else if ( elementName == "turn" ) - { - myChoice = Choice::turn; - isSuccess &= getTurn()->fromXElement( message, xelement ); - } - else if ( elementName == "delayed-turn" ) - { - myChoice = Choice::delayedTurn; - isSuccess &= getDelayedTurn()->fromXElement( message, xelement ); - } - else if ( elementName == "inverted-turn" ) - { - myChoice = Choice::invertedTurn; - isSuccess &= getInvertedTurn()->fromXElement( message, xelement ); - } - else if ( elementName == "delayed-inverted-turn" ) - { - myChoice = Choice::delayedInvertedTurn; - isSuccess &= getDelayedInvertedTurn()->fromXElement( message, xelement ); - } - else if ( elementName == "vertical-turn" ) - { - myChoice = Choice::verticalTurn; - isSuccess &= getVerticalTurn()->fromXElement( message, xelement ); - } - else if ( elementName == "shake" ) - { - myChoice = Choice::shake; - isSuccess &= getShake()->fromXElement( message, xelement ); - } - else if ( elementName == "wavy-line" ) - { - myChoice = Choice::wavyLine; - isSuccess &= getWavyLine()->fromXElement( message, xelement ); - } - else if ( elementName == "mordent" ) - { - myChoice = Choice::mordent; - isSuccess &= getMordent()->fromXElement( message, xelement ); - } - else if ( elementName == "inverted-mordent" ) - { - myChoice = Choice::invertedMordent; - isSuccess &= getInvertedMordent()->fromXElement( message, xelement ); - } - else if ( elementName == "schleifer" ) - { - myChoice = Choice::schleifer; - isSuccess &= getSchleifer()->fromXElement( message, xelement ); - } - else if ( elementName == "tremolo" ) - { - myChoice = Choice::tremolo; - isSuccess &= getTremolo()->fromXElement( message, xelement ); - } - else if ( elementName == "other-ornament" ) - { - myChoice = Choice::otherOrnament; - isSuccess &= getOtherOrnament()->fromXElement( message, xelement ); - } - else - { - message << "OrnamentsChoice::fromXElement unrecognized element '" << elementName << "'" << std::endl; - isSuccess = false; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OrnamentsChoice.h b/Sourcecode/private/mx/core/elements/OrnamentsChoice.h deleted file mode 100644 index 5596c9947..000000000 --- a/Sourcecode/private/mx/core/elements/OrnamentsChoice.h +++ /dev/null @@ -1,139 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( DelayedInvertedTurn ) - MX_FORWARD_DECLARE_ELEMENT( DelayedTurn ) - MX_FORWARD_DECLARE_ELEMENT( InvertedMordent ) - MX_FORWARD_DECLARE_ELEMENT( InvertedTurn ) - MX_FORWARD_DECLARE_ELEMENT( Mordent ) - MX_FORWARD_DECLARE_ELEMENT( OtherOrnament ) - MX_FORWARD_DECLARE_ELEMENT( Schleifer ) - MX_FORWARD_DECLARE_ELEMENT( Shake ) - MX_FORWARD_DECLARE_ELEMENT( Tremolo ) - MX_FORWARD_DECLARE_ELEMENT( TrillMark ) - MX_FORWARD_DECLARE_ELEMENT( Turn ) - MX_FORWARD_DECLARE_ELEMENT( VerticalTurn ) - MX_FORWARD_DECLARE_ELEMENT( WavyLine ) - MX_FORWARD_DECLARE_ELEMENT( OrnamentsChoice ) - - inline OrnamentsChoicePtr makeOrnamentsChoice() { return std::make_shared(); } - - class OrnamentsChoice : public ElementInterface - { - public: - enum class Choice - { - trillMark = 1, - turn = 2, - delayedTurn = 3, - invertedTurn = 4, - delayedInvertedTurn = 5, - verticalTurn = 6, - shake = 7, - wavyLine = 8, - mordent = 9, - invertedMordent = 10, - schleifer = 11, - tremolo = 12, - otherOrnament = 13 - }; - OrnamentsChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice enum _________ */ - OrnamentsChoice::Choice getChoice() const; - void setChoice( const OrnamentsChoice::Choice value ); - - /* _________ TrillMark minOccurs = 1, maxOccurs = 1 _________ */ - TrillMarkPtr getTrillMark() const; - void setTrillMark( const TrillMarkPtr& value ); - - /* _________ Turn minOccurs = 1, maxOccurs = 1 _________ */ - TurnPtr getTurn() const; - void setTurn( const TurnPtr& value ); - - /* _________ DelayedTurn minOccurs = 1, maxOccurs = 1 _________ */ - DelayedTurnPtr getDelayedTurn() const; - void setDelayedTurn( const DelayedTurnPtr& value ); - - /* _________ InvertedTurn minOccurs = 1, maxOccurs = 1 _________ */ - InvertedTurnPtr getInvertedTurn() const; - void setInvertedTurn( const InvertedTurnPtr& value ); - - /* _________ DelayedInvertedTurn minOccurs = 1, maxOccurs = 1 _________ */ - DelayedInvertedTurnPtr getDelayedInvertedTurn() const; - void setDelayedInvertedTurn( const DelayedInvertedTurnPtr& value ); - - /* _________ VerticalTurn minOccurs = 1, maxOccurs = 1 _________ */ - VerticalTurnPtr getVerticalTurn() const; - void setVerticalTurn( const VerticalTurnPtr& value ); - - /* _________ Shake minOccurs = 1, maxOccurs = 1 _________ */ - ShakePtr getShake() const; - void setShake( const ShakePtr& value ); - - /* _________ WavyLine minOccurs = 1, maxOccurs = 1 _________ */ - WavyLinePtr getWavyLine() const; - void setWavyLine( const WavyLinePtr& value ); - - /* _________ Mordent minOccurs = 1, maxOccurs = 1 _________ */ - MordentPtr getMordent() const; - void setMordent( const MordentPtr& value ); - - /* _________ InvertedMordent minOccurs = 1, maxOccurs = 1 _________ */ - InvertedMordentPtr getInvertedMordent() const; - void setInvertedMordent( const InvertedMordentPtr& value ); - - /* _________ Schleifer minOccurs = 1, maxOccurs = 1 _________ */ - SchleiferPtr getSchleifer() const; - void setSchleifer( const SchleiferPtr& value ); - - /* _________ Tremolo minOccurs = 1, maxOccurs = 1 _________ */ - TremoloPtr getTremolo() const; - void setTremolo( const TremoloPtr& value ); - - /* _________ OtherOrnament minOccurs = 1, maxOccurs = 1 _________ */ - OtherOrnamentPtr getOtherOrnament() const; - void setOtherOrnament( const OtherOrnamentPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - TrillMarkPtr myTrillMark; - TurnPtr myTurn; - DelayedTurnPtr myDelayedTurn; - InvertedTurnPtr myInvertedTurn; - DelayedInvertedTurnPtr myDelayedInvertedTurn; - VerticalTurnPtr myVerticalTurn; - ShakePtr myShake; - WavyLinePtr myWavyLine; - MordentPtr myMordent; - InvertedMordentPtr myInvertedMordent; - SchleiferPtr mySchleifer; - TremoloPtr myTremolo; - OtherOrnamentPtr myOtherOrnament; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherAppearance.cpp b/Sourcecode/private/mx/core/elements/OtherAppearance.cpp deleted file mode 100644 index 08c9f06d4..000000000 --- a/Sourcecode/private/mx/core/elements/OtherAppearance.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherAppearance.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherAppearance::OtherAppearance() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherAppearance::OtherAppearance( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherAppearance::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherAppearance::hasContents() const - { - return true; - } - - - std::ostream& OtherAppearance::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherAppearance::streamName( std::ostream& os ) const - { - os << "other-appearance"; - return os; - } - - - std::ostream& OtherAppearance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - OtherAppearanceAttributesPtr OtherAppearance::getAttributes() const - { - return myAttributes; - } - - - void OtherAppearance::setAttributes( const OtherAppearanceAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString OtherAppearance::getValue() const - { - return myValue; - } - - - void OtherAppearance::setValue( const XsString& value ) - { - myValue = value; - } - - - bool OtherAppearance::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherAppearance.h b/Sourcecode/private/mx/core/elements/OtherAppearance.h deleted file mode 100644 index 909e8eec7..000000000 --- a/Sourcecode/private/mx/core/elements/OtherAppearance.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/OtherAppearanceAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherAppearanceAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherAppearance ) - - inline OtherAppearancePtr makeOtherAppearance() { return std::make_shared(); } - inline OtherAppearancePtr makeOtherAppearance( const XsString& value ) { return std::make_shared( value ); } - inline OtherAppearancePtr makeOtherAppearance( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherAppearance : public ElementInterface - { - public: - OtherAppearance(); - OtherAppearance( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherAppearanceAttributesPtr getAttributes() const; - void setAttributes( const OtherAppearanceAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherAppearanceAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.cpp deleted file mode 100644 index a6460dc9b..000000000 --- a/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherAppearanceAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherAppearanceAttributes::OtherAppearanceAttributes() - :type( "undefined" ) - ,hasType( true ) - {} - - - bool OtherAppearanceAttributes::hasValues() const - { - return hasType; - } - - - std::ostream& OtherAppearanceAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool OtherAppearanceAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "OtherAppearanceAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.h b/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.h deleted file mode 100644 index e5d566059..000000000 --- a/Sourcecode/private/mx/core/elements/OtherAppearanceAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherAppearanceAttributes ) - - struct OtherAppearanceAttributes : public AttributesInterface - { - public: - OtherAppearanceAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - const bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherArticulation.cpp b/Sourcecode/private/mx/core/elements/OtherArticulation.cpp deleted file mode 100644 index b8bca2397..000000000 --- a/Sourcecode/private/mx/core/elements/OtherArticulation.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherArticulation.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherArticulation::OtherArticulation() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherArticulation::OtherArticulation( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherArticulation::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherArticulation::hasContents() const - { - return true; - } - - - std::ostream& OtherArticulation::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherArticulation::streamName( std::ostream& os ) const - { - os << "other-articulation"; - return os; - } - - - std::ostream& OtherArticulation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - OtherArticulationAttributesPtr OtherArticulation::getAttributes() const - { - return myAttributes; - } - - - void OtherArticulation::setAttributes( const OtherArticulationAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString OtherArticulation::getValue() const - { - return myValue; - } - - - void OtherArticulation::setValue( const XsString& value ) - { - myValue = value; - } - - - bool OtherArticulation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherArticulation.h b/Sourcecode/private/mx/core/elements/OtherArticulation.h deleted file mode 100644 index 67c9c6ef4..000000000 --- a/Sourcecode/private/mx/core/elements/OtherArticulation.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/OtherArticulationAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherArticulationAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherArticulation ) - - inline OtherArticulationPtr makeOtherArticulation() { return std::make_shared(); } - inline OtherArticulationPtr makeOtherArticulation( const XsString& value ) { return std::make_shared( value ); } - inline OtherArticulationPtr makeOtherArticulation( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherArticulation : public ElementInterface - { - public: - OtherArticulation(); - OtherArticulation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherArticulationAttributesPtr getAttributes() const; - void setAttributes( const OtherArticulationAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherArticulationAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.cpp deleted file mode 100644 index d54dd9e6a..000000000 --- a/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherArticulationAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherArticulationAttributes::OtherArticulationAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool OtherArticulationAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& OtherArticulationAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool OtherArticulationAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "OtherArticulationAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.h b/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.h deleted file mode 100644 index 548ca2444..000000000 --- a/Sourcecode/private/mx/core/elements/OtherArticulationAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherArticulationAttributes ) - - struct OtherArticulationAttributes : public AttributesInterface - { - public: - OtherArticulationAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherDirection.cpp b/Sourcecode/private/mx/core/elements/OtherDirection.cpp deleted file mode 100644 index 4441d294d..000000000 --- a/Sourcecode/private/mx/core/elements/OtherDirection.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherDirection.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherDirection::OtherDirection() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherDirection::OtherDirection( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherDirection::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherDirection::hasContents() const - { - return true; - } - - - std::ostream& OtherDirection::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherDirection::streamName( std::ostream& os ) const - { - os << "other-direction"; - return os; - } - - - std::ostream& OtherDirection::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - OtherDirectionAttributesPtr OtherDirection::getAttributes() const - { - return myAttributes; - } - - - void OtherDirection::setAttributes( const OtherDirectionAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString OtherDirection::getValue() const - { - return myValue; - } - - - void OtherDirection::setValue( const XsString& value ) - { - myValue = value; - } - - - bool OtherDirection::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherDirection.h b/Sourcecode/private/mx/core/elements/OtherDirection.h deleted file mode 100644 index fa243fe35..000000000 --- a/Sourcecode/private/mx/core/elements/OtherDirection.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/OtherDirectionAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherDirectionAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherDirection ) - - inline OtherDirectionPtr makeOtherDirection() { return std::make_shared(); } - inline OtherDirectionPtr makeOtherDirection( const XsString& value ) { return std::make_shared( value ); } - inline OtherDirectionPtr makeOtherDirection( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherDirection : public ElementInterface - { - public: - OtherDirection(); - OtherDirection( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherDirectionAttributesPtr getAttributes() const; - void setAttributes( const OtherDirectionAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherDirectionAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.cpp deleted file mode 100644 index dc7abc07f..000000000 --- a/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherDirectionAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherDirectionAttributes::OtherDirectionAttributes() - :printObject() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - {} - - - bool OtherDirectionAttributes::hasValues() const - { - return hasPrintObject || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign; - } - - - std::ostream& OtherDirectionAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; - } - - - bool OtherDirectionAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "OtherDirectionAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.h b/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.h deleted file mode 100644 index 99e43c70e..000000000 --- a/Sourcecode/private/mx/core/elements/OtherDirectionAttributes.h +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherDirectionAttributes ) - - struct OtherDirectionAttributes : public AttributesInterface - { - public: - OtherDirectionAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherNotation.cpp b/Sourcecode/private/mx/core/elements/OtherNotation.cpp deleted file mode 100644 index 1b169ca65..000000000 --- a/Sourcecode/private/mx/core/elements/OtherNotation.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherNotation.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherNotation::OtherNotation() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherNotation::OtherNotation( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherNotation::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherNotation::hasContents() const - { - return true; - } - - - std::ostream& OtherNotation::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherNotation::streamName( std::ostream& os ) const - { - os << "other-notation"; - return os; - } - - - std::ostream& OtherNotation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - OtherNotationAttributesPtr OtherNotation::getAttributes() const - { - return myAttributes; - } - - - void OtherNotation::setAttributes( const OtherNotationAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString OtherNotation::getValue() const - { - return myValue; - } - - - void OtherNotation::setValue( const XsString& value ) - { - myValue = value; - } - - - bool OtherNotation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherNotation.h b/Sourcecode/private/mx/core/elements/OtherNotation.h deleted file mode 100644 index 887d0fc4d..000000000 --- a/Sourcecode/private/mx/core/elements/OtherNotation.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/OtherNotationAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherNotationAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherNotation ) - - inline OtherNotationPtr makeOtherNotation() { return std::make_shared(); } - inline OtherNotationPtr makeOtherNotation( const XsString& value ) { return std::make_shared( value ); } - inline OtherNotationPtr makeOtherNotation( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherNotation : public ElementInterface - { - public: - OtherNotation(); - OtherNotation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherNotationAttributesPtr getAttributes() const; - void setAttributes( const OtherNotationAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherNotationAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherNotationAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherNotationAttributes.cpp deleted file mode 100644 index 77c37bf99..000000000 --- a/Sourcecode/private/mx/core/elements/OtherNotationAttributes.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherNotationAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherNotationAttributes::OtherNotationAttributes() - :type( StartStopSingle::start ) - ,number( 1 ) - ,printObject() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasType( true ) - ,hasNumber( false ) - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool OtherNotationAttributes::hasValues() const - { - return hasType || - hasNumber || - hasPrintObject || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& OtherNotationAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool OtherNotationAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "OtherNotationAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopSingle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherNotationAttributes.h b/Sourcecode/private/mx/core/elements/OtherNotationAttributes.h deleted file mode 100644 index 1e3ad6740..000000000 --- a/Sourcecode/private/mx/core/elements/OtherNotationAttributes.h +++ /dev/null @@ -1,61 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherNotationAttributes ) - - struct OtherNotationAttributes : public AttributesInterface - { - public: - OtherNotationAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopSingle type; - NumberLevel number; - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - const bool hasType; - bool hasNumber; - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherOrnament.cpp b/Sourcecode/private/mx/core/elements/OtherOrnament.cpp deleted file mode 100644 index 081ba8272..000000000 --- a/Sourcecode/private/mx/core/elements/OtherOrnament.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherOrnament.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherOrnament::OtherOrnament() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherOrnament::OtherOrnament( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherOrnament::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherOrnament::hasContents() const - { - return true; - } - - - std::ostream& OtherOrnament::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherOrnament::streamName( std::ostream& os ) const - { - os << "other-ornament"; - return os; - } - - - std::ostream& OtherOrnament::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - OtherOrnamentAttributesPtr OtherOrnament::getAttributes() const - { - return myAttributes; - } - - - void OtherOrnament::setAttributes( const OtherOrnamentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString OtherOrnament::getValue() const - { - return myValue; - } - - - void OtherOrnament::setValue( const XsString& value ) - { - myValue = value; - } - - - bool OtherOrnament::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherOrnament.h b/Sourcecode/private/mx/core/elements/OtherOrnament.h deleted file mode 100644 index 928fc5988..000000000 --- a/Sourcecode/private/mx/core/elements/OtherOrnament.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/OtherOrnamentAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherOrnamentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherOrnament ) - - inline OtherOrnamentPtr makeOtherOrnament() { return std::make_shared(); } - inline OtherOrnamentPtr makeOtherOrnament( const XsString& value ) { return std::make_shared( value ); } - inline OtherOrnamentPtr makeOtherOrnament( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherOrnament : public ElementInterface - { - public: - OtherOrnament(); - OtherOrnament( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherOrnamentAttributesPtr getAttributes() const; - void setAttributes( const OtherOrnamentAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherOrnamentAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.cpp deleted file mode 100644 index d91428035..000000000 --- a/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherOrnamentAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherOrnamentAttributes::OtherOrnamentAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool OtherOrnamentAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& OtherOrnamentAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool OtherOrnamentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "OtherOrnamentAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.h b/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.h deleted file mode 100644 index 27dab6e84..000000000 --- a/Sourcecode/private/mx/core/elements/OtherOrnamentAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherOrnamentAttributes ) - - struct OtherOrnamentAttributes : public AttributesInterface - { - public: - OtherOrnamentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherPercussion.cpp b/Sourcecode/private/mx/core/elements/OtherPercussion.cpp deleted file mode 100644 index fd5bcea67..000000000 --- a/Sourcecode/private/mx/core/elements/OtherPercussion.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherPercussion.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherPercussion::OtherPercussion() - :myValue() - {} - - - OtherPercussion::OtherPercussion( const XsString& value ) - :myValue( value ) - {} - - - bool OtherPercussion::hasAttributes() const - { - return false; - } - - - bool OtherPercussion::hasContents() const - { - return true; - } - - - std::ostream& OtherPercussion::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& OtherPercussion::streamName( std::ostream& os ) const - { - os << "other-percussion"; - return os; - } - - - std::ostream& OtherPercussion::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString OtherPercussion::getValue() const - { - return myValue; - } - - - void OtherPercussion::setValue( const XsString& value ) - { - myValue = value; - } - - - bool OtherPercussion::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherPercussion.h b/Sourcecode/private/mx/core/elements/OtherPercussion.h deleted file mode 100644 index 78f482003..000000000 --- a/Sourcecode/private/mx/core/elements/OtherPercussion.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( OtherPercussion ) - - inline OtherPercussionPtr makeOtherPercussion() { return std::make_shared(); } - inline OtherPercussionPtr makeOtherPercussion( const XsString& value ) { return std::make_shared( value ); } - inline OtherPercussionPtr makeOtherPercussion( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherPercussion : public ElementInterface - { - public: - OtherPercussion(); - OtherPercussion( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherPlay.cpp b/Sourcecode/private/mx/core/elements/OtherPlay.cpp deleted file mode 100644 index d6567c5e4..000000000 --- a/Sourcecode/private/mx/core/elements/OtherPlay.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherPlay.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherPlay::OtherPlay() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherPlay::OtherPlay( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherPlay::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherPlay::hasContents() const - { - return true; - } - - - std::ostream& OtherPlay::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherPlay::streamName( std::ostream& os ) const - { - os << "other-play"; - return os; - } - - - std::ostream& OtherPlay::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - OtherPlayAttributesPtr OtherPlay::getAttributes() const - { - return myAttributes; - } - - - void OtherPlay::setAttributes( const OtherPlayAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString OtherPlay::getValue() const - { - return myValue; - } - - - void OtherPlay::setValue( const XsString& value ) - { - myValue = value; - } - - - bool OtherPlay::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherPlay.h b/Sourcecode/private/mx/core/elements/OtherPlay.h deleted file mode 100644 index d5a5b7882..000000000 --- a/Sourcecode/private/mx/core/elements/OtherPlay.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/OtherPlayAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherPlayAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherPlay ) - - inline OtherPlayPtr makeOtherPlay() { return std::make_shared(); } - inline OtherPlayPtr makeOtherPlay( const XsString& value ) { return std::make_shared( value ); } - inline OtherPlayPtr makeOtherPlay( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherPlay : public ElementInterface - { - public: - OtherPlay(); - OtherPlay( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherPlayAttributesPtr getAttributes() const; - void setAttributes( const OtherPlayAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherPlayAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherPlayAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherPlayAttributes.cpp deleted file mode 100644 index c5b831653..000000000 --- a/Sourcecode/private/mx/core/elements/OtherPlayAttributes.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherPlayAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherPlayAttributes::OtherPlayAttributes() - :type() - ,hasType( true ) - {} - - - bool OtherPlayAttributes::hasValues() const - { - return hasType; - } - - - std::ostream& OtherPlayAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool OtherPlayAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "OtherPlayAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherPlayAttributes.h b/Sourcecode/private/mx/core/elements/OtherPlayAttributes.h deleted file mode 100644 index 20a26d642..000000000 --- a/Sourcecode/private/mx/core/elements/OtherPlayAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherPlayAttributes ) - - struct OtherPlayAttributes : public AttributesInterface - { - public: - OtherPlayAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - const bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherTechnical.cpp b/Sourcecode/private/mx/core/elements/OtherTechnical.cpp deleted file mode 100644 index 3baf810ff..000000000 --- a/Sourcecode/private/mx/core/elements/OtherTechnical.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherTechnical.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherTechnical::OtherTechnical() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - OtherTechnical::OtherTechnical( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool OtherTechnical::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool OtherTechnical::hasContents() const - { - return true; - } - - - std::ostream& OtherTechnical::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& OtherTechnical::streamName( std::ostream& os ) const - { - os << "other-technical"; - return os; - } - - - std::ostream& OtherTechnical::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - OtherTechnicalAttributesPtr OtherTechnical::getAttributes() const - { - return myAttributes; - } - - - void OtherTechnical::setAttributes( const OtherTechnicalAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString OtherTechnical::getValue() const - { - return myValue; - } - - - void OtherTechnical::setValue( const XsString& value ) - { - myValue = value; - } - - - bool OtherTechnical::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherTechnical.h b/Sourcecode/private/mx/core/elements/OtherTechnical.h deleted file mode 100644 index 14be7adf5..000000000 --- a/Sourcecode/private/mx/core/elements/OtherTechnical.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/OtherTechnicalAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherTechnicalAttributes ) - MX_FORWARD_DECLARE_ELEMENT( OtherTechnical ) - - inline OtherTechnicalPtr makeOtherTechnical() { return std::make_shared(); } - inline OtherTechnicalPtr makeOtherTechnical( const XsString& value ) { return std::make_shared( value ); } - inline OtherTechnicalPtr makeOtherTechnical( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class OtherTechnical : public ElementInterface - { - public: - OtherTechnical(); - OtherTechnical( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - OtherTechnicalAttributesPtr getAttributes() const; - void setAttributes( const OtherTechnicalAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - OtherTechnicalAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.cpp b/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.cpp deleted file mode 100644 index 7b55e9c4a..000000000 --- a/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/OtherTechnicalAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - OtherTechnicalAttributes::OtherTechnicalAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool OtherTechnicalAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& OtherTechnicalAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool OtherTechnicalAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "OtherTechnicalAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.h b/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.h deleted file mode 100644 index d7543de61..000000000 --- a/Sourcecode/private/mx/core/elements/OtherTechnicalAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( OtherTechnicalAttributes ) - - struct OtherTechnicalAttributes : public AttributesInterface - { - public: - OtherTechnicalAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PageHeight.cpp b/Sourcecode/private/mx/core/elements/PageHeight.cpp deleted file mode 100644 index 9d1cbde85..000000000 --- a/Sourcecode/private/mx/core/elements/PageHeight.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PageHeight.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PageHeight::PageHeight() - :myValue() - {} - - - PageHeight::PageHeight( const TenthsValue& value ) - :myValue( value ) - {} - - - bool PageHeight::hasAttributes() const - { - return false; - } - - - bool PageHeight::hasContents() const - { - return true; - } - - - std::ostream& PageHeight::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PageHeight::streamName( std::ostream& os ) const - { - os << "page-height"; - return os; - } - - - std::ostream& PageHeight::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - TenthsValue PageHeight::getValue() const - { - return myValue; - } - - - void PageHeight::setValue( const TenthsValue& value ) - { - myValue = value; - } - - - bool PageHeight::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PageHeight.h b/Sourcecode/private/mx/core/elements/PageHeight.h deleted file mode 100644 index e55cd34e5..000000000 --- a/Sourcecode/private/mx/core/elements/PageHeight.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PageHeight ) - - inline PageHeightPtr makePageHeight() { return std::make_shared(); } - inline PageHeightPtr makePageHeight( const TenthsValue& value ) { return std::make_shared( value ); } - inline PageHeightPtr makePageHeight( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class PageHeight : public ElementInterface - { - public: - PageHeight(); - PageHeight( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PageLayout.cpp b/Sourcecode/private/mx/core/elements/PageLayout.cpp deleted file mode 100644 index 9f36d9ab7..000000000 --- a/Sourcecode/private/mx/core/elements/PageLayout.cpp +++ /dev/null @@ -1,164 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PageLayout.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/PageHeight.h" -#include "mx/core/elements/PageMargins.h" -#include "mx/core/elements/PageWidth.h" -#include - -namespace mx -{ - namespace core - { - PageLayout::PageLayout() - :myPageHeight( makePageHeight() ) - ,myPageWidth( makePageWidth() ) - ,myPageMarginsSet() - {} - - - bool PageLayout::hasAttributes() const - { - return false; - } - - - std::ostream& PageLayout::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PageLayout::streamName( std::ostream& os ) const - { - os << "page-layout"; - return os; - } - - - bool PageLayout::hasContents() const - { - return true; - } - - - std::ostream& PageLayout::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myPageHeight->toStream( os, indentLevel+1 ); - os << std::endl; - myPageWidth->toStream( os, indentLevel+1 ); - for ( auto x : myPageMarginsSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - PageHeightPtr PageLayout::getPageHeight() const - { - return myPageHeight; - } - - - void PageLayout::setPageHeight( const PageHeightPtr& value ) - { - if( value ) - { - myPageHeight = value; - } - } - - - PageWidthPtr PageLayout::getPageWidth() const - { - return myPageWidth; - } - - - void PageLayout::setPageWidth( const PageWidthPtr& value ) - { - if( value ) - { - myPageWidth = value; - } - } - - - const PageMarginsSet& PageLayout::getPageMarginsSet() const - { - return myPageMarginsSet; - } - - - void PageLayout::removePageMargins( const PageMarginsSetIterConst& value ) - { - if ( value != myPageMarginsSet.cend() ) - { - myPageMarginsSet.erase( value ); - } - } - - - void PageLayout::addPageMargins( const PageMarginsPtr& value ) - { - if ( value ) - { - if( myPageMarginsSet.size() < 2 ) - { - myPageMarginsSet.push_back( value ); - } - } - } - - - void PageLayout::clearPageMarginsSet() - { - myPageMarginsSet.clear(); - } - - - PageMarginsPtr PageLayout::getPageMargins( const PageMarginsSetIterConst& setIterator ) const - { - if( setIterator != myPageMarginsSet.cend() ) - { - return *setIterator; - } - return PageMarginsPtr(); - } - - - bool PageLayout::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isPageHeightFound = false; - bool isPageWidthFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myPageHeight, isPageHeightFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPageWidth, isPageWidthFound ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "page-margins", myPageMarginsSet ); - } - - if( !isPageHeightFound ) - { - message << "PageLayout: '" << myPageHeight->getElementName() << "' is required but was not found" << std::endl; - } - if( !isPageWidthFound ) - { - message << "PageLayout: '" << myPageWidth->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PageLayout.h b/Sourcecode/private/mx/core/elements/PageLayout.h deleted file mode 100644 index 9b0dd4a43..000000000 --- a/Sourcecode/private/mx/core/elements/PageLayout.h +++ /dev/null @@ -1,61 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PageHeight ) - MX_FORWARD_DECLARE_ELEMENT( PageMargins ) - MX_FORWARD_DECLARE_ELEMENT( PageWidth ) - MX_FORWARD_DECLARE_ELEMENT( PageLayout ) - - inline PageLayoutPtr makePageLayout() { return std::make_shared(); } - - class PageLayout : public ElementInterface - { - public: - PageLayout(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ PageHeight minOccurs = 1, maxOccurs = 1 _________ */ - PageHeightPtr getPageHeight() const; - void setPageHeight( const PageHeightPtr& value ); - - /* _________ PageWidth minOccurs = 1, maxOccurs = 1 _________ */ - PageWidthPtr getPageWidth() const; - void setPageWidth( const PageWidthPtr& value ); - - /* _________ PageMargins minOccurs = 0, maxOccurs = 2 _________ */ - const PageMarginsSet& getPageMarginsSet() const; - void addPageMargins( const PageMarginsPtr& value ); - void removePageMargins( const PageMarginsSetIterConst& value ); - void clearPageMarginsSet(); - PageMarginsPtr getPageMargins( const PageMarginsSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PageHeightPtr myPageHeight; - PageWidthPtr myPageWidth; - PageMarginsSet myPageMarginsSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PageMargins.cpp b/Sourcecode/private/mx/core/elements/PageMargins.cpp deleted file mode 100644 index 733308c3e..000000000 --- a/Sourcecode/private/mx/core/elements/PageMargins.cpp +++ /dev/null @@ -1,180 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PageMargins.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/BottomMargin.h" -#include "mx/core/elements/LeftMargin.h" -#include "mx/core/elements/RightMargin.h" -#include "mx/core/elements/TopMargin.h" -#include - -namespace mx -{ - namespace core - { - PageMargins::PageMargins() - :myAttributes( std::make_shared() ) - ,myLeftMargin( makeLeftMargin() ) - ,myRightMargin( makeRightMargin() ) - ,myTopMargin( makeTopMargin() ) - ,myBottomMargin( makeBottomMargin() ) - {} - - - bool PageMargins::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& PageMargins::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& PageMargins::streamName( std::ostream& os ) const - { - os << "page-margins"; - return os; - } - - - bool PageMargins::hasContents() const - { - return true; - } - - - std::ostream& PageMargins::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myLeftMargin->toStream( os, indentLevel+1 ); - os << std::endl; - myRightMargin->toStream( os, indentLevel+1 ); - os << std::endl; - myTopMargin->toStream( os, indentLevel+1 ); - os << std::endl; - myBottomMargin->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } - - - PageMarginsAttributesPtr PageMargins::getAttributes() const - { - return myAttributes; - } - - - void PageMargins::setAttributes( const PageMarginsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - LeftMarginPtr PageMargins::getLeftMargin() const - { - return myLeftMargin; - } - - - void PageMargins::setLeftMargin( const LeftMarginPtr& value ) - { - if( value ) - { - myLeftMargin = value; - } - } - - - RightMarginPtr PageMargins::getRightMargin() const - { - return myRightMargin; - } - - - void PageMargins::setRightMargin( const RightMarginPtr& value ) - { - if( value ) - { - myRightMargin = value; - } - } - - - TopMarginPtr PageMargins::getTopMargin() const - { - return myTopMargin; - } - - - void PageMargins::setTopMargin( const TopMarginPtr& value ) - { - if( value ) - { - myTopMargin = value; - } - } - - - BottomMarginPtr PageMargins::getBottomMargin() const - { - return myBottomMargin; - } - - - void PageMargins::setBottomMargin( const BottomMarginPtr& value ) - { - if( value ) - { - myBottomMargin = value; - } - } - - - bool PageMargins::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isLeftMarginFound = false; - bool isRightMarginFound = false; - bool isTopMarginFound = false; - bool isBottomMarginFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myLeftMargin, isLeftMarginFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myRightMargin, isRightMarginFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTopMargin, isTopMarginFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myBottomMargin, isBottomMarginFound ) ) { continue; } - } - - if( !isLeftMarginFound ) - { - message << "PageMargins: '" << myLeftMargin->getElementName() << "' is required but was not found" << std::endl; - } - if( !isRightMarginFound ) - { - message << "PageMargins: '" << myRightMargin->getElementName() << "' is required but was not found" << std::endl; - } - if( !isTopMarginFound ) - { - message << "PageMargins: '" << myTopMargin->getElementName() << "' is required but was not found" << std::endl; - } - if( !isBottomMarginFound ) - { - message << "PageMargins: '" << myBottomMargin->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PageMargins.h b/Sourcecode/private/mx/core/elements/PageMargins.h deleted file mode 100644 index 4f382bd85..000000000 --- a/Sourcecode/private/mx/core/elements/PageMargins.h +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/PageMarginsAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PageMarginsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( BottomMargin ) - MX_FORWARD_DECLARE_ELEMENT( LeftMargin ) - MX_FORWARD_DECLARE_ELEMENT( RightMargin ) - MX_FORWARD_DECLARE_ELEMENT( TopMargin ) - MX_FORWARD_DECLARE_ELEMENT( PageMargins ) - - inline PageMarginsPtr makePageMargins() { return std::make_shared(); } - - class PageMargins : public ElementInterface - { - public: - PageMargins(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PageMarginsAttributesPtr getAttributes() const; - void setAttributes( const PageMarginsAttributesPtr& value ); - - /* _________ LeftMargin minOccurs = 1, maxOccurs = 1 _________ */ - LeftMarginPtr getLeftMargin() const; - void setLeftMargin( const LeftMarginPtr& value ); - - /* _________ RightMargin minOccurs = 1, maxOccurs = 1 _________ */ - RightMarginPtr getRightMargin() const; - void setRightMargin( const RightMarginPtr& value ); - - /* _________ TopMargin minOccurs = 1, maxOccurs = 1 _________ */ - TopMarginPtr getTopMargin() const; - void setTopMargin( const TopMarginPtr& value ); - - /* _________ BottomMargin minOccurs = 1, maxOccurs = 1 _________ */ - BottomMarginPtr getBottomMargin() const; - void setBottomMargin( const BottomMarginPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PageMarginsAttributesPtr myAttributes; - LeftMarginPtr myLeftMargin; - RightMarginPtr myRightMargin; - TopMarginPtr myTopMargin; - BottomMarginPtr myBottomMargin; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PageMarginsAttributes.cpp b/Sourcecode/private/mx/core/elements/PageMarginsAttributes.cpp deleted file mode 100644 index d10f197b7..000000000 --- a/Sourcecode/private/mx/core/elements/PageMarginsAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PageMarginsAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PageMarginsAttributes::PageMarginsAttributes() - :type( MarginType::both ) - ,hasType( false ) - {} - - - bool PageMarginsAttributes::hasValues() const - { - return hasType; - } - - - std::ostream& PageMarginsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool PageMarginsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PageMarginsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type", &parseMarginType ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PageMarginsAttributes.h b/Sourcecode/private/mx/core/elements/PageMarginsAttributes.h deleted file mode 100644 index bcdecd8f7..000000000 --- a/Sourcecode/private/mx/core/elements/PageMarginsAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PageMarginsAttributes ) - - struct PageMarginsAttributes : public AttributesInterface - { - public: - PageMarginsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - MarginType type; - bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PageWidth.cpp b/Sourcecode/private/mx/core/elements/PageWidth.cpp deleted file mode 100644 index 98c25bff8..000000000 --- a/Sourcecode/private/mx/core/elements/PageWidth.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PageWidth.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PageWidth::PageWidth() - :myValue() - {} - - - PageWidth::PageWidth( const TenthsValue& value ) - :myValue( value ) - {} - - - bool PageWidth::hasAttributes() const - { - return false; - } - - - bool PageWidth::hasContents() const - { - return true; - } - - - std::ostream& PageWidth::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PageWidth::streamName( std::ostream& os ) const - { - os << "page-width"; - return os; - } - - - std::ostream& PageWidth::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - TenthsValue PageWidth::getValue() const - { - return myValue; - } - - - void PageWidth::setValue( const TenthsValue& value ) - { - myValue = value; - } - - - bool PageWidth::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PageWidth.h b/Sourcecode/private/mx/core/elements/PageWidth.h deleted file mode 100644 index 8eaff1fac..000000000 --- a/Sourcecode/private/mx/core/elements/PageWidth.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PageWidth ) - - inline PageWidthPtr makePageWidth() { return std::make_shared(); } - inline PageWidthPtr makePageWidth( const TenthsValue& value ) { return std::make_shared( value ); } - inline PageWidthPtr makePageWidth( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class PageWidth : public ElementInterface - { - public: - PageWidth(); - PageWidth( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Pan.cpp b/Sourcecode/private/mx/core/elements/Pan.cpp deleted file mode 100644 index e2184c92f..000000000 --- a/Sourcecode/private/mx/core/elements/Pan.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Pan.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Pan::Pan() - :myValue() - {} - - - Pan::Pan( const RotationDegrees& value ) - :myValue( value ) - {} - - - bool Pan::hasAttributes() const - { - return false; - } - - - bool Pan::hasContents() const - { - return true; - } - - - std::ostream& Pan::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Pan::streamName( std::ostream& os ) const - { - os << "pan"; - return os; - } - - - std::ostream& Pan::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - RotationDegrees Pan::getValue() const - { - return myValue; - } - - - void Pan::setValue( const RotationDegrees& value ) - { - myValue = value; - } - - - bool Pan::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Pan.h b/Sourcecode/private/mx/core/elements/Pan.h deleted file mode 100644 index c112febe3..000000000 --- a/Sourcecode/private/mx/core/elements/Pan.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Pan ) - - inline PanPtr makePan() { return std::make_shared(); } - inline PanPtr makePan( const RotationDegrees& value ) { return std::make_shared( value ); } - inline PanPtr makePan( RotationDegrees&& value ) { return std::make_shared( std::move( value ) ); } - - class Pan : public ElementInterface - { - public: - Pan(); - Pan( const RotationDegrees& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RotationDegrees getValue() const; - void setValue( const RotationDegrees& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - RotationDegrees myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviation.cpp b/Sourcecode/private/mx/core/elements/PartAbbreviation.cpp deleted file mode 100644 index 56cc7ccc2..000000000 --- a/Sourcecode/private/mx/core/elements/PartAbbreviation.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartAbbreviation.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PartAbbreviation::PartAbbreviation() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - PartAbbreviation::PartAbbreviation( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool PartAbbreviation::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool PartAbbreviation::hasContents() const - { - return true; - } - - - std::ostream& PartAbbreviation::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& PartAbbreviation::streamName( std::ostream& os ) const - { - os << "part-abbreviation"; - return os; - } - - - std::ostream& PartAbbreviation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PartAbbreviationAttributesPtr PartAbbreviation::getAttributes() const - { - return myAttributes; - } - - - void PartAbbreviation::setAttributes( const PartAbbreviationAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString PartAbbreviation::getValue() const - { - return myValue; - } - - - void PartAbbreviation::setValue( const XsString& value ) - { - myValue = value; - } - - - bool PartAbbreviation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviation.h b/Sourcecode/private/mx/core/elements/PartAbbreviation.h deleted file mode 100644 index 38ea5e6ed..000000000 --- a/Sourcecode/private/mx/core/elements/PartAbbreviation.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/PartAbbreviationAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartAbbreviationAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PartAbbreviation ) - - inline PartAbbreviationPtr makePartAbbreviation() { return std::make_shared(); } - inline PartAbbreviationPtr makePartAbbreviation( const XsString& value ) { return std::make_shared( value ); } - inline PartAbbreviationPtr makePartAbbreviation( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class PartAbbreviation : public ElementInterface - { - public: - PartAbbreviation(); - PartAbbreviation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartAbbreviationAttributesPtr getAttributes() const; - void setAttributes( const PartAbbreviationAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PartAbbreviationAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.cpp b/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.cpp deleted file mode 100644 index 5c872120a..000000000 --- a/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartAbbreviationAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PartAbbreviationAttributes::PartAbbreviationAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,printObject() - ,justify( LeftCenterRight::center ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPrintObject( false ) - ,hasJustify( false ) - {} - - - bool PartAbbreviationAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPrintObject || - hasJustify; - } - - - std::ostream& PartAbbreviationAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, justify, "justify", hasJustify ); - } - return os; - } - - - bool PartAbbreviationAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PartAbbreviationAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.h b/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.h deleted file mode 100644 index e0d50dbbb..000000000 --- a/Sourcecode/private/mx/core/elements/PartAbbreviationAttributes.h +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartAbbreviationAttributes ) - - struct PartAbbreviationAttributes : public AttributesInterface - { - public: - PartAbbreviationAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - YesNo printObject; - LeftCenterRight justify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPrintObject; - bool hasJustify; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.cpp b/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.cpp deleted file mode 100644 index bf3d93570..000000000 --- a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartAbbreviationDisplay.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/DisplayTextOrAccidentalText.h" -#include - -namespace mx -{ - namespace core - { - PartAbbreviationDisplay::PartAbbreviationDisplay() - :myAttributes( std::make_shared() ) - ,myDisplayTextOrAccidentalTextSet() - {} - - - bool PartAbbreviationDisplay::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& PartAbbreviationDisplay::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& PartAbbreviationDisplay::streamName( std::ostream& os ) const - { - os << "part-abbreviation-display"; - return os; - } - - - bool PartAbbreviationDisplay::hasContents() const - { - return myDisplayTextOrAccidentalTextSet.size() > 0; - } - - - std::ostream& PartAbbreviationDisplay::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myDisplayTextOrAccidentalTextSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - isOneLineOnly = !hasContents(); - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - PartAbbreviationDisplayAttributesPtr PartAbbreviationDisplay::getAttributes() const - { - return myAttributes; - } - - - void PartAbbreviationDisplay::setAttributes( const PartAbbreviationDisplayAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const DisplayTextOrAccidentalTextSet& PartAbbreviationDisplay::getDisplayTextOrAccidentalText() const - { - return myDisplayTextOrAccidentalTextSet; - } - - - void PartAbbreviationDisplay::addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ) - { - if ( value ) - { - myDisplayTextOrAccidentalTextSet.push_back( value ); - } - } - - - void PartAbbreviationDisplay::removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - myDisplayTextOrAccidentalTextSet.erase( setIterator ); - } - } - - - void PartAbbreviationDisplay::clearDisplayTextOrAccidentalTextSet() - { - myDisplayTextOrAccidentalTextSet.clear(); - } - - - DisplayTextOrAccidentalTextPtr PartAbbreviationDisplay::getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - return *setIterator; - } - return makeDisplayTextOrAccidentalText(); - } - - - const DisplayTextOrAccidentalTextSet& PartAbbreviationDisplay::getDisplayTextOrAccidentalTextSet() const - { - return myDisplayTextOrAccidentalTextSet; - } - - - bool PartAbbreviationDisplay::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - auto item = makeDisplayTextOrAccidentalText(); - isSuccess &= item->fromXElement( message, *it ); - myDisplayTextOrAccidentalTextSet.push_back( item ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.h b/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.h deleted file mode 100644 index 54337cd55..000000000 --- a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplay.h +++ /dev/null @@ -1,55 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/PartAbbreviationDisplayAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartAbbreviationDisplayAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DisplayTextOrAccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( PartAbbreviationDisplay ) - - inline PartAbbreviationDisplayPtr makePartAbbreviationDisplay() { return std::make_shared(); } - - class PartAbbreviationDisplay : public ElementInterface - { - public: - PartAbbreviationDisplay(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartAbbreviationDisplayAttributesPtr getAttributes() const; - void setAttributes( const PartAbbreviationDisplayAttributesPtr& value ); - - /* _________ DisplayTextOrAccidentalText minOccurs = 0, maxOccurs = unbounded _________ */ - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalText() const; - void addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ); - void removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ); - void clearDisplayTextOrAccidentalTextSet(); - DisplayTextOrAccidentalTextPtr getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const; - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalTextSet() const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PartAbbreviationDisplayAttributesPtr myAttributes; - DisplayTextOrAccidentalTextSet myDisplayTextOrAccidentalTextSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.cpp b/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.cpp deleted file mode 100644 index 23b3ca14f..000000000 --- a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartAbbreviationDisplayAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PartAbbreviationDisplayAttributes::PartAbbreviationDisplayAttributes() - :printObject( YesNo::no ) - ,hasPrintObject( false ) - {} - - - bool PartAbbreviationDisplayAttributes::hasValues() const - { - return hasPrintObject; - } - - - std::ostream& PartAbbreviationDisplayAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } - - - bool PartAbbreviationDisplayAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PartAbbreviationDisplayAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.h b/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.h deleted file mode 100644 index 3b5d8b35f..000000000 --- a/Sourcecode/private/mx/core/elements/PartAbbreviationDisplayAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartAbbreviationDisplayAttributes ) - - struct PartAbbreviationDisplayAttributes : public AttributesInterface - { - public: - PartAbbreviationDisplayAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - bool hasPrintObject; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartAttributes.cpp b/Sourcecode/private/mx/core/elements/PartAttributes.cpp deleted file mode 100644 index d61c13d0a..000000000 --- a/Sourcecode/private/mx/core/elements/PartAttributes.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PartAttributes::PartAttributes() - :id() - ,hasId( true ) - {} - - - bool PartAttributes::hasValues() const - { - return hasId; - } - - - std::ostream& PartAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - } - return os; - } - - - bool PartAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PartAttributes"; - bool isSuccess = true; - bool isIdFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, isIdFound, "id" ) ) { continue; } - } - - if( !isIdFound ) - { - isSuccess = false; - message << className << ": 'id' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartAttributes.h b/Sourcecode/private/mx/core/elements/PartAttributes.h deleted file mode 100644 index d6d73b6c2..000000000 --- a/Sourcecode/private/mx/core/elements/PartAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/XsIDREF.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartAttributes ) - - struct PartAttributes : public AttributesInterface - { - public: - PartAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsIDREF id; - const bool hasId; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartGroup.cpp b/Sourcecode/private/mx/core/elements/PartGroup.cpp deleted file mode 100644 index 91cef5edd..000000000 --- a/Sourcecode/private/mx/core/elements/PartGroup.cpp +++ /dev/null @@ -1,368 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/EditorialGroup.h" -#include "mx/core/elements/GroupAbbreviation.h" -#include "mx/core/elements/GroupAbbreviationDisplay.h" -#include "mx/core/elements/GroupBarline.h" -#include "mx/core/elements/GroupName.h" -#include "mx/core/elements/GroupNameDisplay.h" -#include "mx/core/elements/GroupSymbol.h" -#include "mx/core/elements/GroupTime.h" -#include - -namespace mx -{ - namespace core - { - PartGroup::PartGroup() - :myAttributes( std::make_shared() ) - ,myGroupName( makeGroupName() ) - ,myHasGroupName( false ) - ,myGroupNameDisplay( makeGroupNameDisplay() ) - ,myHasGroupNameDisplay( false ) - ,myGroupAbbreviation( makeGroupAbbreviation() ) - ,myHasGroupAbbreviation( false ) - ,myGroupAbbreviationDisplay( makeGroupAbbreviationDisplay() ) - ,myHasGroupAbbreviationDisplay( false ) - ,myGroupSymbol( makeGroupSymbol() ) - ,myHasGroupSymbol( false ) - ,myGroupBarline( makeGroupBarline() ) - ,myHasGroupBarline( false ) - ,myGroupTime( makeGroupTime() ) - ,myHasGroupTime( false ) - ,myEditorialGroup( makeEditorialGroup() ) - {} - - - bool PartGroup::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& PartGroup::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& PartGroup::streamName( std::ostream& os ) const - { - os << "part-group"; - return os; - } - - - bool PartGroup::hasContents() const - { - return myHasGroupName - || myHasGroupNameDisplay - || myHasGroupAbbreviation - || myHasGroupAbbreviationDisplay - || myHasGroupSymbol - || myHasGroupBarline - || myHasGroupTime - || myEditorialGroup->hasContents(); - } - - - std::ostream& PartGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - if ( myHasGroupName ) - { - os << std::endl; - myGroupName->toStream( os, indentLevel+1 ); - } - if ( myHasGroupNameDisplay ) - { - os << std::endl; - myGroupNameDisplay->toStream( os, indentLevel+1 ); - } - if ( myHasGroupAbbreviation ) - { - os << std::endl; - myGroupAbbreviation->toStream( os, indentLevel+1 ); - } - if ( myHasGroupAbbreviationDisplay ) - { - os << std::endl; - myGroupAbbreviationDisplay->toStream( os, indentLevel+1 ); - } - if ( myHasGroupSymbol ) - { - os << std::endl; - myGroupSymbol->toStream( os, indentLevel+1 ); - } - if ( myHasGroupBarline ) - { - os << std::endl; - myGroupBarline->toStream( os, indentLevel+1 ); - } - if ( myHasGroupTime ) - { - os << std::endl; - myGroupTime->toStream( os, indentLevel+1 ); - } - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - PartGroupAttributesPtr PartGroup::getAttributes() const - { - return myAttributes; - } - - - void PartGroup::setAttributes( const PartGroupAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - GroupNamePtr PartGroup::getGroupName() const - { - return myGroupName; - } - - - void PartGroup::setGroupName( const GroupNamePtr& value ) - { - if( value ) - { - myGroupName = value; - } - } - - - bool PartGroup::getHasGroupName() const - { - return myHasGroupName; - } - - - void PartGroup::setHasGroupName( const bool value ) - { - myHasGroupName = value; - } - - - GroupNameDisplayPtr PartGroup::getGroupNameDisplay() const - { - return myGroupNameDisplay; - } - - - void PartGroup::setGroupNameDisplay( const GroupNameDisplayPtr& value ) - { - if( value ) - { - myGroupNameDisplay = value; - } - } - - - bool PartGroup::getHasGroupNameDisplay() const - { - return myHasGroupNameDisplay; - } - - - void PartGroup::setHasGroupNameDisplay( const bool value ) - { - myHasGroupNameDisplay = value; - } - - - GroupAbbreviationPtr PartGroup::getGroupAbbreviation() const - { - return myGroupAbbreviation; - } - - - void PartGroup::setGroupAbbreviation( const GroupAbbreviationPtr& value ) - { - if( value ) - { - myGroupAbbreviation = value; - } - } - - - bool PartGroup::getHasGroupAbbreviation() const - { - return myHasGroupAbbreviation; - } - - - void PartGroup::setHasGroupAbbreviation( const bool value ) - { - myHasGroupAbbreviation = value; - } - - - GroupAbbreviationDisplayPtr PartGroup::getGroupAbbreviationDisplay() const - { - return myGroupAbbreviationDisplay; - } - - - void PartGroup::setGroupAbbreviationDisplay( const GroupAbbreviationDisplayPtr& value ) - { - if( value ) - { - myGroupAbbreviationDisplay = value; - } - } - - - bool PartGroup::getHasGroupAbbreviationDisplay() const - { - return myHasGroupAbbreviationDisplay; - } - - - void PartGroup::setHasGroupAbbreviationDisplay( const bool value ) - { - myHasGroupAbbreviationDisplay = value; - } - - - GroupSymbolPtr PartGroup::getGroupSymbol() const - { - return myGroupSymbol; - } - - - void PartGroup::setGroupSymbol( const GroupSymbolPtr& value ) - { - if( value ) - { - myGroupSymbol = value; - } - } - - - bool PartGroup::getHasGroupSymbol() const - { - return myHasGroupSymbol; - } - - - void PartGroup::setHasGroupSymbol( const bool value ) - { - myHasGroupSymbol = value; - } - - - GroupBarlinePtr PartGroup::getGroupBarline() const - { - return myGroupBarline; - } - - - void PartGroup::setGroupBarline( const GroupBarlinePtr& value ) - { - if( value ) - { - myGroupBarline = value; - } - } - - - bool PartGroup::getHasGroupBarline() const - { - return myHasGroupBarline; - } - - - void PartGroup::setHasGroupBarline( const bool value ) - { - myHasGroupBarline = value; - } - - - GroupTimePtr PartGroup::getGroupTime() const - { - return myGroupTime; - } - - - void PartGroup::setGroupTime( const GroupTimePtr& value ) - { - if( value ) - { - myGroupTime = value; - } - } - - - bool PartGroup::getHasGroupTime() const - { - return myHasGroupTime; - } - - - void PartGroup::setHasGroupTime( const bool value ) - { - myHasGroupTime = value; - } - - - EditorialGroupPtr PartGroup::getEditorialGroup() const - { - return myEditorialGroup; - } - - - void PartGroup::setEditorialGroup( const EditorialGroupPtr& value ) - { - if( value ) - { - myEditorialGroup = value; - } - } - - - bool PartGroup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myGroupName, myHasGroupName ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myGroupNameDisplay, myHasGroupNameDisplay ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myGroupAbbreviation, myHasGroupAbbreviation ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myGroupAbbreviationDisplay, myHasGroupAbbreviationDisplay ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myGroupSymbol, myHasGroupSymbol ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myGroupBarline, myHasGroupBarline ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myGroupTime, myHasGroupTime ) ) { continue; } - importGroup( message, it, endIter, isSuccess, myEditorialGroup ); - } - - MX_RETURN_IS_SUCCESS; - } - } -} diff --git a/Sourcecode/private/mx/core/elements/PartGroup.h b/Sourcecode/private/mx/core/elements/PartGroup.h deleted file mode 100644 index be9493039..000000000 --- a/Sourcecode/private/mx/core/elements/PartGroup.h +++ /dev/null @@ -1,114 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/PartGroupAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartGroupAttributes ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( GroupAbbreviation ) - MX_FORWARD_DECLARE_ELEMENT( GroupAbbreviationDisplay ) - MX_FORWARD_DECLARE_ELEMENT( GroupBarline ) - MX_FORWARD_DECLARE_ELEMENT( GroupName ) - MX_FORWARD_DECLARE_ELEMENT( GroupNameDisplay ) - MX_FORWARD_DECLARE_ELEMENT( GroupSymbol ) - MX_FORWARD_DECLARE_ELEMENT( GroupTime ) - MX_FORWARD_DECLARE_ELEMENT( PartGroup ) - - inline PartGroupPtr makePartGroup() { return std::make_shared(); } - - class PartGroup : public ElementInterface - { - public: - PartGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartGroupAttributesPtr getAttributes() const; - void setAttributes( const PartGroupAttributesPtr& value ); - - /* _________ GroupName minOccurs = 0, maxOccurs = 1 _________ */ - GroupNamePtr getGroupName() const; - void setGroupName( const GroupNamePtr& value ); - bool getHasGroupName() const; - void setHasGroupName( const bool value ); - - /* _________ GroupNameDisplay minOccurs = 0, maxOccurs = 1 _________ */ - GroupNameDisplayPtr getGroupNameDisplay() const; - void setGroupNameDisplay( const GroupNameDisplayPtr& value ); - bool getHasGroupNameDisplay() const; - void setHasGroupNameDisplay( const bool value ); - - /* _________ GroupAbbreviation minOccurs = 0, maxOccurs = 1 _________ */ - GroupAbbreviationPtr getGroupAbbreviation() const; - void setGroupAbbreviation( const GroupAbbreviationPtr& value ); - bool getHasGroupAbbreviation() const; - void setHasGroupAbbreviation( const bool value ); - - /* _________ GroupAbbreviationDisplay minOccurs = 0, maxOccurs = 1 _________ */ - GroupAbbreviationDisplayPtr getGroupAbbreviationDisplay() const; - void setGroupAbbreviationDisplay( const GroupAbbreviationDisplayPtr& value ); - bool getHasGroupAbbreviationDisplay() const; - void setHasGroupAbbreviationDisplay( const bool value ); - - /* _________ GroupSymbol minOccurs = 0, maxOccurs = 1 _________ */ - GroupSymbolPtr getGroupSymbol() const; - void setGroupSymbol( const GroupSymbolPtr& value ); - bool getHasGroupSymbol() const; - void setHasGroupSymbol( const bool value ); - - /* _________ GroupBarline minOccurs = 0, maxOccurs = 1 _________ */ - GroupBarlinePtr getGroupBarline() const; - void setGroupBarline( const GroupBarlinePtr& value ); - bool getHasGroupBarline() const; - void setHasGroupBarline( const bool value ); - - /* _________ GroupTime minOccurs = 0, maxOccurs = 1 _________ */ - GroupTimePtr getGroupTime() const; - void setGroupTime( const GroupTimePtr& value ); - bool getHasGroupTime() const; - void setHasGroupTime( const bool value ); - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PartGroupAttributesPtr myAttributes; - GroupNamePtr myGroupName; - bool myHasGroupName; - GroupNameDisplayPtr myGroupNameDisplay; - bool myHasGroupNameDisplay; - GroupAbbreviationPtr myGroupAbbreviation; - bool myHasGroupAbbreviation; - GroupAbbreviationDisplayPtr myGroupAbbreviationDisplay; - bool myHasGroupAbbreviationDisplay; - GroupSymbolPtr myGroupSymbol; - bool myHasGroupSymbol; - GroupBarlinePtr myGroupBarline; - bool myHasGroupBarline; - GroupTimePtr myGroupTime; - bool myHasGroupTime; - EditorialGroupPtr myEditorialGroup; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartGroupAttributes.cpp b/Sourcecode/private/mx/core/elements/PartGroupAttributes.cpp deleted file mode 100644 index c2ac65ec5..000000000 --- a/Sourcecode/private/mx/core/elements/PartGroupAttributes.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartGroupAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PartGroupAttributes::PartGroupAttributes() - :type( StartStop::start ) - ,number( XsToken( "1" ) ) - ,hasType( true ) - ,hasNumber( false ) - {} - - - bool PartGroupAttributes::hasValues() const - { - return hasType || - hasNumber; - } - - - std::ostream& PartGroupAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - } - return os; - } - - - bool PartGroupAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PartGroupAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartGroupAttributes.h b/Sourcecode/private/mx/core/elements/PartGroupAttributes.h deleted file mode 100644 index 31c3d4fec..000000000 --- a/Sourcecode/private/mx/core/elements/PartGroupAttributes.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartGroupAttributes ) - - struct PartGroupAttributes : public AttributesInterface - { - public: - PartGroupAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - XsToken number; - const bool hasType; - bool hasNumber; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.cpp b/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.cpp deleted file mode 100644 index e3bf66945..000000000 --- a/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartGroupOrScorePart.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/PartGroup.h" -#include "mx/core/elements/ScorePart.h" -#include - -namespace mx -{ - namespace core - { - PartGroupOrScorePart::PartGroupOrScorePart() - :myChoice( Choice::partGroup ) - ,myPartGroup( makePartGroup() ) - ,myScorePart( makeScorePart() ) - {} - - - bool PartGroupOrScorePart::hasAttributes() const - { - return false; - } - - - std::ostream& PartGroupOrScorePart::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PartGroupOrScorePart::streamName( std::ostream& os ) const - { - return os; - } - - - bool PartGroupOrScorePart::hasContents() const - { - return ( myChoice == Choice::partGroup && myPartGroup->hasContents() ) - || ( myChoice == Choice::scorePart && myScorePart->hasContents() ); - } - - - std::ostream& PartGroupOrScorePart::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::partGroup: - myPartGroup->toStream( os, indentLevel ); - break; - case Choice::scorePart: - myScorePart->toStream( os, indentLevel ); - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - PartGroupOrScorePart::Choice PartGroupOrScorePart::getChoice() const - { - return myChoice; - } - - - void PartGroupOrScorePart::setChoice( const PartGroupOrScorePart::Choice value ) - { - myChoice = value; - } - - - PartGroupPtr PartGroupOrScorePart::getPartGroup() const - { - return myPartGroup; - } - - - void PartGroupOrScorePart::setPartGroup( const PartGroupPtr& value ) - { - if ( value ) - { - myPartGroup = value; - } - } - - - ScorePartPtr PartGroupOrScorePart::getScorePart() const - { - return myScorePart; - } - - - void PartGroupOrScorePart::setScorePart( const ScorePartPtr& value ) - { - if ( value ) - { - myScorePart = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( PartGroupOrScorePart ) - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.h b/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.h deleted file mode 100644 index 6eeaf5806..000000000 --- a/Sourcecode/private/mx/core/elements/PartGroupOrScorePart.h +++ /dev/null @@ -1,62 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PartGroup ) - MX_FORWARD_DECLARE_ELEMENT( ScorePart ) - MX_FORWARD_DECLARE_ELEMENT( PartGroupOrScorePart ) - - inline PartGroupOrScorePartPtr makePartGroupOrScorePart() { return std::make_shared(); } - - class PartGroupOrScorePart : public ElementInterface - { - public: - enum class Choice - { - partGroup = 1, - scorePart = 2 - }; - PartGroupOrScorePart(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - PartGroupOrScorePart::Choice getChoice() const; - void setChoice( const PartGroupOrScorePart::Choice value ); - - /* _________ PartGroup minOccurs = 1, maxPartGroupOccurs = 1 _________ */ - PartGroupPtr getPartGroup() const; - void setPartGroup( const PartGroupPtr& value ); - - /* _________ ScorePart minOccurs = 1, maxOccurs = 1 _________ */ - ScorePartPtr getScorePart() const; - void setScorePart( const ScorePartPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - PartGroupPtr myPartGroup; - ScorePartPtr myScorePart; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartList.cpp b/Sourcecode/private/mx/core/elements/PartList.cpp deleted file mode 100644 index a2b482992..000000000 --- a/Sourcecode/private/mx/core/elements/PartList.cpp +++ /dev/null @@ -1,218 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartList.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/PartGroup.h" -#include "mx/core/elements/PartGroupOrScorePart.h" -#include "mx/core/elements/ScorePart.h" -#include - -namespace mx -{ - namespace core - { - PartList::PartList() - :myPartGroupSet() - ,myScorePart( makeScorePart() ) - ,myPartGroupOrScorePartSet() - {} - - - bool PartList::hasAttributes() const - { - return false; - } - - - std::ostream& PartList::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PartList::streamName( std::ostream& os ) const - { - os << "part-list"; - return os; - } - - - bool PartList::hasContents() const - { - return true; - } - - - std::ostream& PartList::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - for ( auto x : myPartGroupSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - myScorePart->toStream( os, indentLevel+1 ); - for ( auto x : myPartGroupOrScorePartSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - isOneLineOnly = false; - os << std::endl; - return os; - } - - - const PartGroupSet& PartList::getPartGroupSet() const - { - return myPartGroupSet; - } - - - void PartList::addPartGroup( const PartGroupPtr& value ) - { - if ( value ) - { - myPartGroupSet.push_back( value ); - } - } - - - void PartList::removePartGroup( const PartGroupSetIterConst& value ) - { - if ( value != myPartGroupSet.cend() ) - { - myPartGroupSet.erase( value ); - } - } - - - void PartList::clearPartGroupSet() - { - myPartGroupSet.clear(); - } - - - PartGroupPtr PartList::getPartGroup( const PartGroupSetIterConst& setIterator ) const - { - if( setIterator != myPartGroupSet.cend() ) - { - return *setIterator; - } - return PartGroupPtr(); - } - - - ScorePartPtr PartList::getScorePart() const - { - return myScorePart; - } - - - void PartList::setScorePart( const ScorePartPtr& value ) - { - if ( value ) - { - myScorePart = value; - } - } - - - const PartGroupOrScorePartSet& PartList::getPartGroupOrScorePartSet() const - { - return myPartGroupOrScorePartSet; - } - - - void PartList::addPartGroupOrScorePart( const PartGroupOrScorePartPtr& value ) - { - if ( value ) - { - myPartGroupOrScorePartSet.push_back( value ); - } - } - - - void PartList::removePartGroupOrScorePart( const PartGroupOrScorePartSetIterConst& value ) - { - if ( value != myPartGroupOrScorePartSet.cend() ) - { - myPartGroupOrScorePartSet.erase( value ); - } - } - - - void PartList::clearPartGroupOrScorePartSet() - { - myPartGroupOrScorePartSet.clear(); - } - - - PartGroupOrScorePartPtr PartList::getPartGroupOrScorePart( const PartGroupOrScorePartSetIterConst& setIterator ) const - { - if( setIterator != myPartGroupOrScorePartSet.cend() ) - { - return *setIterator; - } - return PartGroupOrScorePartPtr(); - } - - - bool PartList::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isFirstScorePartEncountered = false; - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - const std::string elementName = it->getName(); - if( elementName != "part-group" && elementName != "score-part" ) - { - message << "PartList: fromXElement encountered unexpected element '" << elementName << "'" << std::endl; - } - if( !isFirstScorePartEncountered ) - { - if( elementName == "part-group" ) - { - auto partGroup = makePartGroup(); - isSuccess &= partGroup->fromXElement( message, *it ); - myPartGroupSet.push_back( partGroup ); - } - else if( elementName == "score-part" ) - { - isFirstScorePartEncountered = true; - isSuccess &= myScorePart->fromXElement( message, *it ); - } - } - else - { - auto partGroupOrScorePart = makePartGroupOrScorePart(); - - if( elementName == "part-group" ) - { - partGroupOrScorePart->setChoice( PartGroupOrScorePart::Choice::partGroup ); - partGroupOrScorePart->getPartGroup()->fromXElement( message, *it ); - } - else if( elementName == "score-part" ) - { - partGroupOrScorePart->setChoice( PartGroupOrScorePart::Choice::scorePart ); - partGroupOrScorePart->getScorePart()->fromXElement( message, *it ); - } - - myPartGroupOrScorePartSet.push_back( partGroupOrScorePart ); - } - } - - if( !isFirstScorePartEncountered ) - { - message << "PartList: at least one 'score-part' elements are required but none were found" << std::endl; - isSuccess = false; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartList.h b/Sourcecode/private/mx/core/elements/PartList.h deleted file mode 100644 index f3073d2ff..000000000 --- a/Sourcecode/private/mx/core/elements/PartList.h +++ /dev/null @@ -1,64 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PartGroup ) - MX_FORWARD_DECLARE_ELEMENT( PartGroupOrScorePart ) - MX_FORWARD_DECLARE_ELEMENT( ScorePart ) - MX_FORWARD_DECLARE_ELEMENT( PartList ) - - inline PartListPtr makePartList() { return std::make_shared(); } - - class PartList : public ElementInterface - { - public: - PartList(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ PartGroup minOccurs = 0, maxOccurs = unbounded _________ */ - const PartGroupSet& getPartGroupSet() const; - void addPartGroup( const PartGroupPtr& value ); - void removePartGroup( const PartGroupSetIterConst& value ); - void clearPartGroupSet(); - PartGroupPtr getPartGroup( const PartGroupSetIterConst& setIterator ) const; - - /* _________ ScorePart minOccurs = 1, maxOccurs = 1 _________ */ - ScorePartPtr getScorePart() const; - void setScorePart( const ScorePartPtr& value ); - - /* _________ PartGroupOrScorePart minOccurs = 0, maxOccurs = unbounded _________ */ - const PartGroupOrScorePartSet& getPartGroupOrScorePartSet() const; - void addPartGroupOrScorePart( const PartGroupOrScorePartPtr& value ); - void removePartGroupOrScorePart( const PartGroupOrScorePartSetIterConst& value ); - void clearPartGroupOrScorePartSet(); - PartGroupOrScorePartPtr getPartGroupOrScorePart( const PartGroupOrScorePartSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PartGroupSet myPartGroupSet; - ScorePartPtr myScorePart; - PartGroupOrScorePartSet myPartGroupOrScorePartSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartName.cpp b/Sourcecode/private/mx/core/elements/PartName.cpp deleted file mode 100644 index f12b24bce..000000000 --- a/Sourcecode/private/mx/core/elements/PartName.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartName.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PartName::PartName() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - PartName::PartName( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool PartName::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool PartName::hasContents() const - { - return true; - } - - - std::ostream& PartName::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& PartName::streamName( std::ostream& os ) const - { - os << "part-name"; - return os; - } - - - std::ostream& PartName::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PartNameAttributesPtr PartName::getAttributes() const - { - return myAttributes; - } - - - void PartName::setAttributes( const PartNameAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString PartName::getValue() const - { - return myValue; - } - - - void PartName::setValue( const XsString& value ) - { - myValue = value; - } - - - bool PartName::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartName.h b/Sourcecode/private/mx/core/elements/PartName.h deleted file mode 100644 index 7ed462c35..000000000 --- a/Sourcecode/private/mx/core/elements/PartName.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/PartNameAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartNameAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PartName ) - - inline PartNamePtr makePartName() { return std::make_shared(); } - inline PartNamePtr makePartName( const XsString& value ) { return std::make_shared( value ); } - inline PartNamePtr makePartName( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class PartName : public ElementInterface - { - public: - PartName(); - PartName( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartNameAttributesPtr getAttributes() const; - void setAttributes( const PartNameAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PartNameAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartNameAttributes.cpp b/Sourcecode/private/mx/core/elements/PartNameAttributes.cpp deleted file mode 100644 index 2bb37ae65..000000000 --- a/Sourcecode/private/mx/core/elements/PartNameAttributes.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartNameAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PartNameAttributes::PartNameAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,color() - ,printObject() - ,justify( LeftCenterRight::center ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPrintObject( false ) - ,hasJustify( false ) - {} - - - bool PartNameAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPrintObject || - hasJustify; - } - - - std::ostream& PartNameAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, justify, "justify", hasJustify ); - } - return os; - } - - - bool PartNameAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PartNameAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartNameAttributes.h b/Sourcecode/private/mx/core/elements/PartNameAttributes.h deleted file mode 100644 index 4e36da8d5..000000000 --- a/Sourcecode/private/mx/core/elements/PartNameAttributes.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartNameAttributes ) - - struct PartNameAttributes : public AttributesInterface - { - public: - PartNameAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - YesNo printObject; - LeftCenterRight justify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPrintObject; - bool hasJustify; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartNameDisplay.cpp b/Sourcecode/private/mx/core/elements/PartNameDisplay.cpp deleted file mode 100644 index 33c73fca9..000000000 --- a/Sourcecode/private/mx/core/elements/PartNameDisplay.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartNameDisplay.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/DisplayTextOrAccidentalText.h" -#include - -namespace mx -{ - namespace core - { - PartNameDisplay::PartNameDisplay() - :myAttributes( std::make_shared() ) - ,myDisplayTextOrAccidentalTextSet() - {} - - - bool PartNameDisplay::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& PartNameDisplay::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& PartNameDisplay::streamName( std::ostream& os ) const - { - os << "part-name-display"; - return os; - } - - - bool PartNameDisplay::hasContents() const - { - return true; - } - - - std::ostream& PartNameDisplay::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myDisplayTextOrAccidentalTextSet.size() > 0 ) - { - for ( auto x : myDisplayTextOrAccidentalTextSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - PartNameDisplayAttributesPtr PartNameDisplay::getAttributes() const - { - return myAttributes; - } - - - void PartNameDisplay::setAttributes( const PartNameDisplayAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const DisplayTextOrAccidentalTextSet& PartNameDisplay::getDisplayTextOrAccidentalText() const - { - return myDisplayTextOrAccidentalTextSet; - } - - - void PartNameDisplay::addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ) - { - if ( value ) - { - myDisplayTextOrAccidentalTextSet.push_back( value ); - } - } - - - void PartNameDisplay::removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - myDisplayTextOrAccidentalTextSet.erase( setIterator ); - } - } - - - void PartNameDisplay::clearDisplayTextOrAccidentalTextSet() - { - myDisplayTextOrAccidentalTextSet.clear(); - } - - - DisplayTextOrAccidentalTextPtr PartNameDisplay::getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const - { - if ( setIterator != myDisplayTextOrAccidentalTextSet.cend() ) - { - return *setIterator; - } - return makeDisplayTextOrAccidentalText(); - } - - - const DisplayTextOrAccidentalTextSet& PartNameDisplay::getDisplayTextOrAccidentalTextSet() const - { - return myDisplayTextOrAccidentalTextSet; - } - - - bool PartNameDisplay::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - auto item = makeDisplayTextOrAccidentalText(); - isSuccess &= item->fromXElement( message, *it ); - myDisplayTextOrAccidentalTextSet.push_back( item ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartNameDisplay.h b/Sourcecode/private/mx/core/elements/PartNameDisplay.h deleted file mode 100644 index 4fdc20555..000000000 --- a/Sourcecode/private/mx/core/elements/PartNameDisplay.h +++ /dev/null @@ -1,55 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/PartNameDisplayAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartNameDisplayAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DisplayTextOrAccidentalText ) - MX_FORWARD_DECLARE_ELEMENT( PartNameDisplay ) - - inline PartNameDisplayPtr makePartNameDisplay() { return std::make_shared(); } - - class PartNameDisplay : public ElementInterface - { - public: - PartNameDisplay(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartNameDisplayAttributesPtr getAttributes() const; - void setAttributes( const PartNameDisplayAttributesPtr& value ); - - /* _________ DisplayTextOrAccidentalText minOccurs = 0, maxOccurs = unbounded _________ */ - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalText() const; - void addDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextPtr& value ); - void removeDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ); - void clearDisplayTextOrAccidentalTextSet(); - DisplayTextOrAccidentalTextPtr getDisplayTextOrAccidentalText( const DisplayTextOrAccidentalTextSetIterConst& setIterator ) const; - const DisplayTextOrAccidentalTextSet& getDisplayTextOrAccidentalTextSet() const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PartNameDisplayAttributesPtr myAttributes; - DisplayTextOrAccidentalTextSet myDisplayTextOrAccidentalTextSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.cpp b/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.cpp deleted file mode 100644 index 0b1b412b3..000000000 --- a/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartNameDisplayAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PartNameDisplayAttributes::PartNameDisplayAttributes() - :printObject( YesNo::no ) - ,hasPrintObject( false ) - {} - - - bool PartNameDisplayAttributes::hasValues() const - { - return hasPrintObject; - } - - - std::ostream& PartNameDisplayAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - } - return os; - } - - - bool PartNameDisplayAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PartNameDisplayAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.h b/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.h deleted file mode 100644 index f511c9088..000000000 --- a/Sourcecode/private/mx/core/elements/PartNameDisplayAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartNameDisplayAttributes ) - - struct PartNameDisplayAttributes : public AttributesInterface - { - public: - PartNameDisplayAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - bool hasPrintObject; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartSymbol.cpp b/Sourcecode/private/mx/core/elements/PartSymbol.cpp deleted file mode 100644 index 82460e404..000000000 --- a/Sourcecode/private/mx/core/elements/PartSymbol.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartSymbol.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PartSymbol::PartSymbol() - :myValue( GroupSymbolValue::none ) - ,myAttributes( std::make_shared() ) - {} - - - PartSymbol::PartSymbol( const GroupSymbolValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool PartSymbol::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool PartSymbol::hasContents() const - { - return true; - } - - - std::ostream& PartSymbol::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& PartSymbol::streamName( std::ostream& os ) const - { - os << "part-symbol"; - return os; - } - - - std::ostream& PartSymbol::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PartSymbolAttributesPtr PartSymbol::getAttributes() const - { - return myAttributes; - } - - - void PartSymbol::setAttributes( const PartSymbolAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - GroupSymbolValue PartSymbol::getValue() const - { - return myValue; - } - - - void PartSymbol::setValue( const GroupSymbolValue& value ) - { - myValue = value; - } - - - bool PartSymbol::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseGroupSymbolValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartSymbol.h b/Sourcecode/private/mx/core/elements/PartSymbol.h deleted file mode 100644 index 9be5f0197..000000000 --- a/Sourcecode/private/mx/core/elements/PartSymbol.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/PartSymbolAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartSymbolAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PartSymbol ) - - inline PartSymbolPtr makePartSymbol() { return std::make_shared(); } - inline PartSymbolPtr makePartSymbol( const GroupSymbolValue& value ) { return std::make_shared( value ); } - inline PartSymbolPtr makePartSymbol( GroupSymbolValue&& value ) { return std::make_shared( std::move( value ) ); } - - class PartSymbol : public ElementInterface - { - public: - PartSymbol(); - PartSymbol( const GroupSymbolValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartSymbolAttributesPtr getAttributes() const; - void setAttributes( const PartSymbolAttributesPtr& attributes ); - GroupSymbolValue getValue() const; - void setValue( const GroupSymbolValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - GroupSymbolValue myValue; - PartSymbolAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartSymbolAttributes.cpp b/Sourcecode/private/mx/core/elements/PartSymbolAttributes.cpp deleted file mode 100644 index aaf9a2279..000000000 --- a/Sourcecode/private/mx/core/elements/PartSymbolAttributes.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartSymbolAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PartSymbolAttributes::PartSymbolAttributes() - :topStaff() - ,bottomStaff() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,hasTopStaff( false ) - ,hasBottomStaff( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - {} - - - bool PartSymbolAttributes::hasValues() const - { - return hasTopStaff || - hasBottomStaff || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY; - } - - - std::ostream& PartSymbolAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, topStaff, "top-staff", hasTopStaff ); - streamAttribute( os, bottomStaff, "bottom-staff", hasBottomStaff ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - } - return os; - } - - - bool PartSymbolAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PartSymbolAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, topStaff, hasTopStaff, "top-staff" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bottomStaff, hasBottomStaff, "bottom-staff" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartSymbolAttributes.h b/Sourcecode/private/mx/core/elements/PartSymbolAttributes.h deleted file mode 100644 index f150554ca..000000000 --- a/Sourcecode/private/mx/core/elements/PartSymbolAttributes.h +++ /dev/null @@ -1,46 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartSymbolAttributes ) - - struct PartSymbolAttributes : public AttributesInterface - { - public: - PartSymbolAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffNumber topStaff; - StaffNumber bottomStaff; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - bool hasTopStaff; - bool hasBottomStaff; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartwiseMeasure.cpp b/Sourcecode/private/mx/core/elements/PartwiseMeasure.cpp deleted file mode 100644 index 381a58265..000000000 --- a/Sourcecode/private/mx/core/elements/PartwiseMeasure.cpp +++ /dev/null @@ -1,224 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartwiseMeasure.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/MusicDataGroup.h" -#include "mx/core/elements/MusicDataChoice.h" -#include "mx/core/elements/Backup.h" -#include "mx/core/elements/Barline.h" -#include "mx/core/elements/Bookmark.h" -#include "mx/core/elements/Direction.h" -#include "mx/core/elements/FiguredBass.h" -#include "mx/core/elements/Forward.h" -#include "mx/core/elements/Grouping.h" -#include "mx/core/elements/Harmony.h" -#include "mx/core/elements/Link.h" -#include "mx/core/elements/Note.h" -#include "mx/core/elements/Print.h" -#include "mx/core/elements/Properties.h" -#include "mx/core/elements/Sound.h" -#include - -namespace mx -{ - namespace core - { - PartwiseMeasure::PartwiseMeasure() - :myAttributes( nullptr ) - ,myMusicDataGroup( makeMusicDataGroup() ) - {} - - - bool PartwiseMeasure::hasAttributes() const - { - return getAttributes()->hasValues(); - } - - - std::ostream& PartwiseMeasure::streamAttributes( std::ostream& os ) const - { - return getAttributes()->toStream( os ); - } - - - std::ostream& PartwiseMeasure::streamName( std::ostream& os ) const - { - os << "measure"; - return os; - } - - - bool PartwiseMeasure::hasContents() const - { - return myMusicDataGroup->hasContents(); - } - - - std::ostream& PartwiseMeasure::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - os << std::endl; - myMusicDataGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - MeasureAttributesPtr PartwiseMeasure::getAttributes() const - { - MX_LOCK - MX_JIT_ALLOCATE_ATTRIBUTES( MeasureAttributes ); - return myAttributes; - } - - - void PartwiseMeasure::setAttributes( const MeasureAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - MusicDataGroupPtr PartwiseMeasure::getMusicDataGroup() const - { - return myMusicDataGroup; - } - - - void PartwiseMeasure::setMusicDataGroup( const MusicDataGroupPtr& value ) - { - if ( value ) - { - myMusicDataGroup = value; - } - } - - - bool PartwiseMeasure::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isFirstMusicDataChoiceAdded = false; - isSuccess &= getAttributes()->fromXElement( message, xelement ); - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - const std::string elementName = it->getName(); - - auto choiceObject = makeMusicDataChoice(); - bool choiceObjectShouldBeAdded = true; - - if( elementName == "note" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::note ); - isSuccess &= choiceObject->getNote()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "backup" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::backup ); - isSuccess &= choiceObject->getBackup()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "forward" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::forward ); - isSuccess &= choiceObject->getForward()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "direction" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::direction ); - isSuccess &= choiceObject->getDirection()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "attributes" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::properties ); - isSuccess &= choiceObject->getProperties()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "harmony" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::harmony ); - isSuccess &= choiceObject->getHarmony()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "figured-bass" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::figuredBass ); - isSuccess &= choiceObject->getFiguredBass()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "print" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::print ); - isSuccess &= choiceObject->getPrint()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "sound" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::sound ); - isSuccess &= choiceObject->getSound()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "barline" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::barline ); - isSuccess &= choiceObject->getBarline()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "grouping" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::grouping ); - isSuccess &= choiceObject->getGrouping()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "link" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::link ); - isSuccess &= choiceObject->getLink()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else if ( elementName == "bookmark" ) - { - choiceObject->setChoice( MusicDataChoice::Choice::bookmark ); - isSuccess &= choiceObject->getBookmark()->fromXElement( message, *it ); - MX_DEBUG_THROW_ON_PARSE_ISSUE; - } - else - { - choiceObjectShouldBeAdded = false; - } - - if( choiceObjectShouldBeAdded ) - { - if( !isFirstMusicDataChoiceAdded && myMusicDataGroup->getMusicDataChoiceSet().size() == 1 ) - { - myMusicDataGroup->addMusicDataChoice( choiceObject ); - myMusicDataGroup->removeMusicDataChoice( myMusicDataGroup->getMusicDataChoiceSet().cbegin() ); - isFirstMusicDataChoiceAdded = true; - } - else - { - myMusicDataGroup->addMusicDataChoice( choiceObject ); - isFirstMusicDataChoiceAdded = true; - } - } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PartwiseMeasure.h b/Sourcecode/private/mx/core/elements/PartwiseMeasure.h deleted file mode 100644 index 7e64dea6b..000000000 --- a/Sourcecode/private/mx/core/elements/PartwiseMeasure.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/MeasureAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( MeasureAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MusicDataGroup ) - MX_FORWARD_DECLARE_ELEMENT( PartwiseMeasure ) - - inline PartwiseMeasurePtr makePartwiseMeasure() { return std::make_shared(); } - - class PartwiseMeasure : public ElementInterface - { - public: - PartwiseMeasure(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - MeasureAttributesPtr getAttributes() const; - void setAttributes( const MeasureAttributesPtr& value ); - - /* _________ MusicDataGroup minOccurs = 1, maxOccurs = 1 _________ */ - MusicDataGroupPtr getMusicDataGroup() const; - void setMusicDataGroup( const MusicDataGroupPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MX_MUTEX - mutable MeasureAttributesPtr myAttributes; - MusicDataGroupPtr myMusicDataGroup; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PartwisePart.cpp b/Sourcecode/private/mx/core/elements/PartwisePart.cpp deleted file mode 100644 index 4030bad6e..000000000 --- a/Sourcecode/private/mx/core/elements/PartwisePart.cpp +++ /dev/null @@ -1,158 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PartwisePart.h" -#include "mx/core/elements/PartwiseMeasure.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PartwisePart::PartwisePart() - :myAttributes( std::make_shared() ) - ,myPartwiseMeasureSet() - { - myPartwiseMeasureSet.push_back( makePartwiseMeasure() ); - } - - - bool PartwisePart::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& PartwisePart::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& PartwisePart::streamName( std::ostream& os ) const - { - os << "part"; - return os; - } - - - bool PartwisePart::hasContents() const - { - return true; - } - - - std::ostream& PartwisePart::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myPartwiseMeasureSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - PartAttributesPtr PartwisePart::getAttributes() const - { - return myAttributes; - } - - - void PartwisePart::setAttributes( const PartAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - const PartwiseMeasureSet& PartwisePart::getPartwiseMeasureSet() const - { - return myPartwiseMeasureSet; - } - - - void PartwisePart::addPartwiseMeasure( const PartwiseMeasurePtr& value ) - { - if ( value ) - { - myPartwiseMeasureSet.push_back( value ); - } - } - - - void PartwisePart::removePartwiseMeasure( const PartwiseMeasureSetIterConst& value ) - { - if ( value != myPartwiseMeasureSet.cend() ) - { - if ( myPartwiseMeasureSet.size() > 1 ) - { - myPartwiseMeasureSet.erase( value ); - } - } - } - - - void PartwisePart::clearPartwiseMeasureSet() - { - myPartwiseMeasureSet.clear(); - myPartwiseMeasureSet.push_back( makePartwiseMeasure() ); - } - - - PartwiseMeasurePtr PartwisePart::getPartwiseMeasure( const PartwiseMeasureSetIterConst& setIterator ) const - { - if( setIterator != myPartwiseMeasureSet.cend() ) - { - return *setIterator; - } - return PartwiseMeasurePtr(); - } - - bool PartwisePart::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isFirstAdded = false; - - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - if( it->getName() != "measure" ) - { - message << "PartwisePart: encountered an unexpected element '" << it->getName() << "'" << std::endl; - isSuccess = false; - } - else - { - auto measure = makePartwiseMeasure(); - isSuccess &= measure->fromXElement( message, *it ); - if( !isFirstAdded && myPartwiseMeasureSet.size() == 1 ) - { - *myPartwiseMeasureSet.begin() = measure; - isFirstAdded = true; - } - else - { - myPartwiseMeasureSet.push_back( measure ); - isFirstAdded = true; - } - } - } - - MX_RETURN_IS_SUCCESS; - } - } -} diff --git a/Sourcecode/private/mx/core/elements/PartwisePart.h b/Sourcecode/private/mx/core/elements/PartwisePart.h deleted file mode 100644 index 5f07ea5d6..000000000 --- a/Sourcecode/private/mx/core/elements/PartwisePart.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/PartAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PartAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PartwiseMeasure ) - MX_FORWARD_DECLARE_ELEMENT( PartwisePart ) - - inline PartwisePartPtr makePartwisePart() { return std::make_shared(); } - - class PartwisePart : public ElementInterface - { - public: - PartwisePart(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PartAttributesPtr getAttributes() const; - void setAttributes( const PartAttributesPtr& value ); - - /* _________ PartwiseMeasure minOccurs = 0, maxOccurs = unbounded _________ */ - const PartwiseMeasureSet& getPartwiseMeasureSet() const; - void addPartwiseMeasure( const PartwiseMeasurePtr& value ); - void removePartwiseMeasure( const PartwiseMeasureSetIterConst& value ); - void clearPartwiseMeasureSet(); - PartwiseMeasurePtr getPartwiseMeasure( const PartwiseMeasureSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PartAttributesPtr myAttributes; - PartwiseMeasureSet myPartwiseMeasureSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Pedal.cpp b/Sourcecode/private/mx/core/elements/Pedal.cpp deleted file mode 100644 index cbb91ecf5..000000000 --- a/Sourcecode/private/mx/core/elements/Pedal.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Pedal.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Pedal::Pedal() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Pedal::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Pedal::hasContents() const { return false; } - std::ostream& Pedal::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Pedal::streamName( std::ostream& os ) const { os << "pedal"; return os; } - std::ostream& Pedal::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - PedalAttributesPtr Pedal::getAttributes() const - { - return myAttributes; - } - - - void Pedal::setAttributes( const PedalAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Pedal::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Pedal.h b/Sourcecode/private/mx/core/elements/Pedal.h deleted file mode 100644 index 6e784913f..000000000 --- a/Sourcecode/private/mx/core/elements/Pedal.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/PedalAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PedalAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Pedal ) - - inline PedalPtr makePedal() { return std::make_shared(); } - - class Pedal : public ElementInterface - { - public: - Pedal(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PedalAttributesPtr getAttributes() const; - void setAttributes( const PedalAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PedalAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PedalAlter.cpp b/Sourcecode/private/mx/core/elements/PedalAlter.cpp deleted file mode 100644 index 1bfb939ec..000000000 --- a/Sourcecode/private/mx/core/elements/PedalAlter.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PedalAlter.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PedalAlter::PedalAlter() - :myValue() - {} - - - PedalAlter::PedalAlter( const Semitones& value ) - :myValue( value ) - {} - - - bool PedalAlter::hasAttributes() const - { - return false; - } - - - bool PedalAlter::hasContents() const - { - return true; - } - - - std::ostream& PedalAlter::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PedalAlter::streamName( std::ostream& os ) const - { - os << "pedal-alter"; - return os; - } - - - std::ostream& PedalAlter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - Semitones PedalAlter::getValue() const - { - return myValue; - } - - - void PedalAlter::setValue( const Semitones& value ) - { - myValue = value; - } - - - bool PedalAlter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PedalAlter.h b/Sourcecode/private/mx/core/elements/PedalAlter.h deleted file mode 100644 index a97c38420..000000000 --- a/Sourcecode/private/mx/core/elements/PedalAlter.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PedalAlter ) - - inline PedalAlterPtr makePedalAlter() { return std::make_shared(); } - inline PedalAlterPtr makePedalAlter( const Semitones& value ) { return std::make_shared( value ); } - inline PedalAlterPtr makePedalAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class PedalAlter : public ElementInterface - { - public: - PedalAlter(); - PedalAlter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PedalAttributes.cpp b/Sourcecode/private/mx/core/elements/PedalAttributes.cpp deleted file mode 100644 index ae1602451..000000000 --- a/Sourcecode/private/mx/core/elements/PedalAttributes.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PedalAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PedalAttributes::PedalAttributes() - :type( StartStopChangeContinue::start ) - ,line( YesNo::no ) - ,sign( YesNo::no ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,halign( LeftCenterRight::center ) - ,hasType( true ) - ,hasLine( false ) - ,hasSign( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - {} - - - bool PedalAttributes::hasValues() const - { - return hasType || - hasLine || - hasSign || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign; - } - - - std::ostream& PedalAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, line, "line", hasLine ); - streamAttribute( os, sign, "sign", hasSign ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; - } - - - bool PedalAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PedalAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopChangeContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, line, hasLine, "line", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, sign, hasSign, "sign", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PedalAttributes.h b/Sourcecode/private/mx/core/elements/PedalAttributes.h deleted file mode 100644 index ceb555974..000000000 --- a/Sourcecode/private/mx/core/elements/PedalAttributes.h +++ /dev/null @@ -1,60 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PedalAttributes ) - - struct PedalAttributes : public AttributesInterface - { - public: - PedalAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopChangeContinue type; - YesNo line; - YesNo sign; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - const bool hasType; - bool hasLine; - bool hasSign; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PedalStep.cpp b/Sourcecode/private/mx/core/elements/PedalStep.cpp deleted file mode 100644 index b88562616..000000000 --- a/Sourcecode/private/mx/core/elements/PedalStep.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PedalStep.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PedalStep::PedalStep() - :myValue( StepEnum::a ) - {} - - - PedalStep::PedalStep( const StepEnum& value ) - :myValue( value ) - {} - - - bool PedalStep::hasAttributes() const - { - return false; - } - - - bool PedalStep::hasContents() const - { - return true; - } - - - std::ostream& PedalStep::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PedalStep::streamName( std::ostream& os ) const - { - os << "pedal-step"; - return os; - } - - - std::ostream& PedalStep::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - StepEnum PedalStep::getValue() const - { - return myValue; - } - - - void PedalStep::setValue( const StepEnum& value ) - { - myValue = value; - } - - - bool PedalStep::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseStepEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PedalStep.h b/Sourcecode/private/mx/core/elements/PedalStep.h deleted file mode 100644 index 998b15337..000000000 --- a/Sourcecode/private/mx/core/elements/PedalStep.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PedalStep ) - - inline PedalStepPtr makePedalStep() { return std::make_shared(); } - inline PedalStepPtr makePedalStep( const StepEnum& value ) { return std::make_shared( value ); } - inline PedalStepPtr makePedalStep( StepEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class PedalStep : public ElementInterface - { - public: - PedalStep(); - PedalStep( const StepEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StepEnum getValue() const; - void setValue( const StepEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PedalTuning.cpp b/Sourcecode/private/mx/core/elements/PedalTuning.cpp deleted file mode 100644 index f6632aeca..000000000 --- a/Sourcecode/private/mx/core/elements/PedalTuning.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PedalTuning.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/PedalAlter.h" -#include "mx/core/elements/PedalStep.h" -#include - -namespace mx -{ - namespace core - { - PedalTuning::PedalTuning() - :myPedalStep( makePedalStep() ) - ,myPedalAlter( makePedalAlter() ) - {} - - - bool PedalTuning::hasAttributes() const - { - return false; - } - - - std::ostream& PedalTuning::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PedalTuning::streamName( std::ostream& os ) const - { - os << "pedal-tuning"; - return os; - } - - - bool PedalTuning::hasContents() const - { - return true; - } - - - std::ostream& PedalTuning::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myPedalStep->toStream( os, indentLevel+1 ); - os << std::endl; - myPedalAlter->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } - - - PedalStepPtr PedalTuning::getPedalStep() const - { - return myPedalStep; - } - - - void PedalTuning::setPedalStep( const PedalStepPtr& value ) - { - if( value ) - { - myPedalStep = value; - } - } - - - PedalAlterPtr PedalTuning::getPedalAlter() const - { - return myPedalAlter; - } - - - void PedalTuning::setPedalAlter( const PedalAlterPtr& value ) - { - if( value ) - { - myPedalAlter = value; - } - } - - - bool PedalTuning::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isPedalStepFound = false; - bool isPedalAlterFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myPedalStep, isPedalStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPedalAlter, isPedalAlterFound ) ) { continue; } - } - - if( !isPedalStepFound ) - { - message << "PedalTuning: '" << myPedalStep->getElementName() << "' is required but was not found" << std::endl; - } - if( !isPedalAlterFound ) - { - message << "PedalTuning: '" << myPedalAlter->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PedalTuning.h b/Sourcecode/private/mx/core/elements/PedalTuning.h deleted file mode 100644 index 9c0b4ccff..000000000 --- a/Sourcecode/private/mx/core/elements/PedalTuning.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PedalAlter ) - MX_FORWARD_DECLARE_ELEMENT( PedalStep ) - MX_FORWARD_DECLARE_ELEMENT( PedalTuning ) - - inline PedalTuningPtr makePedalTuning() { return std::make_shared(); } - - class PedalTuning : public ElementInterface - { - public: - PedalTuning(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ PedalStep minOccurs = 1, maxOccurs = 1 _________ */ - PedalStepPtr getPedalStep() const; - void setPedalStep( const PedalStepPtr& value ); - - /* _________ PedalAlter minOccurs = 1, maxOccurs = 1 _________ */ - PedalAlterPtr getPedalAlter() const; - void setPedalAlter( const PedalAlterPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PedalStepPtr myPedalStep; - PedalAlterPtr myPedalAlter; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PerMinute.cpp b/Sourcecode/private/mx/core/elements/PerMinute.cpp deleted file mode 100644 index fc2bf6a91..000000000 --- a/Sourcecode/private/mx/core/elements/PerMinute.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PerMinute.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PerMinute::PerMinute() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - PerMinute::PerMinute( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool PerMinute::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool PerMinute::hasContents() const - { - return true; - } - - - std::ostream& PerMinute::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& PerMinute::streamName( std::ostream& os ) const - { - os << "per-minute"; - return os; - } - - - std::ostream& PerMinute::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PerMinuteAttributesPtr PerMinute::getAttributes() const - { - return myAttributes; - } - - - void PerMinute::setAttributes( const PerMinuteAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString PerMinute::getValue() const - { - return myValue; - } - - - void PerMinute::setValue( const XsString& value ) - { - myValue = value; - } - - - bool PerMinute::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PerMinute.h b/Sourcecode/private/mx/core/elements/PerMinute.h deleted file mode 100644 index 274ed5d6d..000000000 --- a/Sourcecode/private/mx/core/elements/PerMinute.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/PerMinuteAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PerMinuteAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PerMinute ) - - inline PerMinutePtr makePerMinute() { return std::make_shared(); } - inline PerMinutePtr makePerMinute( const XsString& value ) { return std::make_shared( value ); } - inline PerMinutePtr makePerMinute( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class PerMinute : public ElementInterface - { - public: - PerMinute(); - PerMinute( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PerMinuteAttributesPtr getAttributes() const; - void setAttributes( const PerMinuteAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PerMinuteAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PerMinuteAttributes.cpp b/Sourcecode/private/mx/core/elements/PerMinuteAttributes.cpp deleted file mode 100644 index 4a1475ab3..000000000 --- a/Sourcecode/private/mx/core/elements/PerMinuteAttributes.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PerMinuteAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PerMinuteAttributes::PerMinuteAttributes() - :fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool PerMinuteAttributes::hasValues() const - { - return hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& PerMinuteAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool PerMinuteAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PerMinuteAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PerMinuteAttributes.h b/Sourcecode/private/mx/core/elements/PerMinuteAttributes.h deleted file mode 100644 index 3f76fcdcd..000000000 --- a/Sourcecode/private/mx/core/elements/PerMinuteAttributes.h +++ /dev/null @@ -1,43 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PerMinuteAttributes ) - - struct PerMinuteAttributes : public AttributesInterface - { - public: - PerMinuteAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.cpp b/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.cpp deleted file mode 100644 index 34fb5ee2d..000000000 --- a/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PerMinuteOrBeatUnitChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/BeatUnitGroup.h" -#include "mx/core/elements/PerMinute.h" -#include - -namespace mx -{ - namespace core - { - PerMinuteOrBeatUnitChoice::PerMinuteOrBeatUnitChoice() - :myChoice( Choice::perMinute ) - ,myPerMinute( makePerMinute() ) - ,myBeatUnitGroup( makeBeatUnitGroup() ) - {} - - - bool PerMinuteOrBeatUnitChoice::hasAttributes() const - { - return false; - } - - - std::ostream& PerMinuteOrBeatUnitChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PerMinuteOrBeatUnitChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool PerMinuteOrBeatUnitChoice::hasContents() const - { - return true; - } - - - std::ostream& PerMinuteOrBeatUnitChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::perMinute: - { - myPerMinute->toStream( os, indentLevel ); - } - break; - case Choice::beatUnitGroup: - { - myBeatUnitGroup->streamContents( os, indentLevel, isOneLineOnly ); - } - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - PerMinuteOrBeatUnitChoice::Choice PerMinuteOrBeatUnitChoice::getChoice() const - { - return myChoice; - } - - - void PerMinuteOrBeatUnitChoice::setChoice( const PerMinuteOrBeatUnitChoice::Choice value ) - { - myChoice = value; - } - - - PerMinutePtr PerMinuteOrBeatUnitChoice::getPerMinute() const - { - return myPerMinute; - } - - - void PerMinuteOrBeatUnitChoice::setPerMinute( const PerMinutePtr& value ) - { - if ( value ) - { - myPerMinute = value; - } - } - - - BeatUnitGroupPtr PerMinuteOrBeatUnitChoice::getBeatUnitGroup() const - { - return myBeatUnitGroup; - } - - - void PerMinuteOrBeatUnitChoice::setBeatUnitGroup( const BeatUnitGroupPtr& value ) - { - if ( value ) - { - myBeatUnitGroup = value; - } - } - - - bool PerMinuteOrBeatUnitChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_CHOICE_IF( perMinute, "per-minute", PerMinute ); - MX_CHOICE_IF( beatUnitGroup, "beat-unit-group", BeatUnitGroup ); - MX_BAD_ELEMENT_FAILURE( PerMinuteOrBeatUnitChoice ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.h b/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.h deleted file mode 100644 index a98a12cfe..000000000 --- a/Sourcecode/private/mx/core/elements/PerMinuteOrBeatUnitChoice.h +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( BeatUnitGroup ) - MX_FORWARD_DECLARE_ELEMENT( PerMinute ) - MX_FORWARD_DECLARE_ELEMENT( PerMinuteOrBeatUnitChoice ) - - inline PerMinuteOrBeatUnitChoicePtr makePerMinuteOrBeatUnitChoice() { return std::make_shared(); } - - class PerMinuteOrBeatUnitChoice : public ElementInterface - { - public: - enum class Choice - { - perMinute = 0, - beatUnitGroup = 1 - }; - PerMinuteOrBeatUnitChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PerMinuteOrBeatUnitChoice::Choice getChoice() const; - void setChoice( const PerMinuteOrBeatUnitChoice::Choice value ); - PerMinutePtr getPerMinute() const; - void setPerMinute( const PerMinutePtr& value ); - BeatUnitGroupPtr getBeatUnitGroup() const; - void setBeatUnitGroup( const BeatUnitGroupPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - PerMinutePtr myPerMinute; - BeatUnitGroupPtr myBeatUnitGroup; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Percussion.cpp b/Sourcecode/private/mx/core/elements/Percussion.cpp deleted file mode 100644 index 689ecafde..000000000 --- a/Sourcecode/private/mx/core/elements/Percussion.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Percussion.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/PercussionChoice.h" -#include - -namespace mx -{ - namespace core - { - Percussion::Percussion() - :myAttributes( std::make_shared() ) - ,myChoice( makePercussionChoice() ) - {} - - - bool Percussion::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Percussion::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Percussion::streamName( std::ostream& os ) const - { - os << "percussion"; - return os; - } - - - bool Percussion::hasContents() const - { - return true; - } - - - std::ostream& Percussion::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - isOneLineOnly = false; - os << std::endl; - return os; - } - - - PercussionAttributesPtr Percussion::getAttributes() const - { - return myAttributes; - } - - - void Percussion::setAttributes( const PercussionAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - PercussionChoicePtr Percussion::getPercussionChoice() const - { - return myChoice; - } - - - void Percussion::setPercussionChoice( const PercussionChoicePtr& value ) - { - if( value ) - { - myChoice = value; - } - } - - - bool Percussion::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - isSuccess &= myChoice->fromXElement( message, xelement ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Percussion.h b/Sourcecode/private/mx/core/elements/Percussion.h deleted file mode 100644 index cc944e742..000000000 --- a/Sourcecode/private/mx/core/elements/Percussion.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/PercussionAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PercussionAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PercussionChoice ) - MX_FORWARD_DECLARE_ELEMENT( Percussion ) - - inline PercussionPtr makePercussion() { return std::make_shared(); } - - class Percussion : public ElementInterface - { - public: - Percussion(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PercussionAttributesPtr getAttributes() const; - void setAttributes( const PercussionAttributesPtr& value ); - PercussionChoicePtr getPercussionChoice() const; - void setPercussionChoice( const PercussionChoicePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PercussionAttributesPtr myAttributes; - PercussionChoicePtr myChoice; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PercussionAttributes.cpp b/Sourcecode/private/mx/core/elements/PercussionAttributes.cpp deleted file mode 100644 index 2b14834b0..000000000 --- a/Sourcecode/private/mx/core/elements/PercussionAttributes.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PercussionAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PercussionAttributes::PercussionAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,halign( LeftCenterRight::center ) - ,valign() - ,enclosure() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasHalign( false ) - ,hasValign( false ) - ,hasEnclosure( false ) - {} - - - bool PercussionAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasHalign || - hasValign || - hasEnclosure; - } - - - std::ostream& PercussionAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, valign, "valign", hasValign ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } - - - bool PercussionAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PercussionAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, valign, hasValign, "valign", &parseValign ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PercussionAttributes.h b/Sourcecode/private/mx/core/elements/PercussionAttributes.h deleted file mode 100644 index b3181a1da..000000000 --- a/Sourcecode/private/mx/core/elements/PercussionAttributes.h +++ /dev/null @@ -1,61 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PercussionAttributes ) - - struct PercussionAttributes : public AttributesInterface - { - public: - PercussionAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - LeftCenterRight halign; - Valign valign; - EnclosureShape enclosure; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasHalign; - bool hasValign; - bool hasEnclosure; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PercussionChoice.cpp b/Sourcecode/private/mx/core/elements/PercussionChoice.cpp deleted file mode 100644 index a006ac768..000000000 --- a/Sourcecode/private/mx/core/elements/PercussionChoice.cpp +++ /dev/null @@ -1,438 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PercussionChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Beater.h" -#include "mx/core/elements/Effect.h" -#include "mx/core/elements/Glass.h" -#include "mx/core/elements/Membrane.h" -#include "mx/core/elements/Metal.h" -#include "mx/core/elements/OtherPercussion.h" -#include "mx/core/elements/Pitched.h" -#include "mx/core/elements/Stick.h" -#include "mx/core/elements/StickLocation.h" -#include "mx/core/elements/StickMaterial.h" -#include "mx/core/elements/StickType.h" -#include "mx/core/elements/Timpani.h" -#include "mx/core/elements/Wood.h" -#include - -namespace mx -{ - namespace core - { - PercussionChoice::PercussionChoice() - - - :myChoice( PercussionChoice::Choice::glass ) - ,myGlass( makeGlass() ) - ,myMetal( makeMetal() ) - ,myWood( makeWood() ) - ,myPitched( makePitched() ) - ,myMembrane( makeMembrane() ) - ,myEffect( makeEffect() ) - ,myTimpani( makeTimpani() ) - ,myBeater( makeBeater() ) - ,myStick( makeStick() ) - ,myStickType( makeStickType() ) - ,myStickMaterial( makeStickMaterial() ) - ,myStickLocation( makeStickLocation() ) - ,myOtherPercussion( makeOtherPercussion() ) - {} - - - bool PercussionChoice::hasAttributes() const - { - return false; - } - - - std::ostream& PercussionChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& PercussionChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool PercussionChoice::hasContents() const - { - return true; - } - - - std::ostream& PercussionChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::glass: - { - myGlass->toStream( os, indentLevel ); - } - break; - case Choice::metal: - { - myMetal->toStream( os, indentLevel ); - } - break; - case Choice::wood: - { - myWood->toStream( os, indentLevel ); - } - break; - case Choice::pitched: - { - myPitched->toStream( os, indentLevel ); - } - break; - case Choice::membrane: - { - myMembrane->toStream( os, indentLevel ); - } - break; - case Choice::effect: - { - myEffect->toStream( os, indentLevel ); - } - break; - case Choice::timpani: - { - myTimpani->toStream( os, indentLevel ); - } - break; - case Choice::beater: - { - myBeater->toStream( os, indentLevel ); - } - break; - case Choice::stick: - { - myStick->toStream( os, indentLevel ); - } - break; - case Choice::stickType: - { - myStickType->toStream( os, indentLevel ); - } - break; - case Choice::stickMaterial: - { - myStickMaterial->toStream( os, indentLevel ); - } - break; - case Choice::stickLocation: - { - myStickLocation->toStream( os, indentLevel ); - } - break; - case Choice::otherPercussion: - { - myOtherPercussion->toStream( os, indentLevel ); - } - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - PercussionChoice::Choice PercussionChoice::getChoice() const - { - return myChoice; - } - - - void PercussionChoice::setChoice( const PercussionChoice::Choice value ) - { - myChoice = value; - } - - - GlassPtr PercussionChoice::getGlass() const - { - return myGlass; - } - - - void PercussionChoice::setGlass( const GlassPtr& value ) - { - if( value ) - { - myGlass = value; - } - } - - - MetalPtr PercussionChoice::getMetal() const - { - return myMetal; - } - - - void PercussionChoice::setMetal( const MetalPtr& value ) - { - if( value ) - { - myMetal = value; - } - } - - - WoodPtr PercussionChoice::getWood() const - { - return myWood; - } - - - void PercussionChoice::setWood( const WoodPtr& value ) - { - if( value ) - { - myWood = value; - } - } - - - PitchedPtr PercussionChoice::getPitched() const - { - return myPitched; - } - - - void PercussionChoice::setPitched( const PitchedPtr& value ) - { - if( value ) - { - myPitched = value; - } - } - - - MembranePtr PercussionChoice::getMembrane() const - { - return myMembrane; - } - - - void PercussionChoice::setMembrane( const MembranePtr& value ) - { - if( value ) - { - myMembrane = value; - } - } - - - EffectPtr PercussionChoice::getEffect() const - { - return myEffect; - } - - - void PercussionChoice::setEffect( const EffectPtr& value ) - { - if( value ) - { - myEffect = value; - } - } - - - TimpaniPtr PercussionChoice::getTimpani() const - { - return myTimpani; - } - - - void PercussionChoice::setTimpani( const TimpaniPtr& value ) - { - if( value ) - { - myTimpani = value; - } - } - - - BeaterPtr PercussionChoice::getBeater() const - { - return myBeater; - } - - - void PercussionChoice::setBeater( const BeaterPtr& value ) - { - if( value ) - { - myBeater = value; - } - } - - - StickPtr PercussionChoice::getStick() const - { - return myStick; - } - - - void PercussionChoice::setStick( const StickPtr& value ) - { - if( value ) - { - myStick = value; - } - } - - - StickTypePtr PercussionChoice::getStickType() const - { - return myStickType; - } - - - void PercussionChoice::setStickType( const StickTypePtr& value ) - { - if( value ) - { - myStickType = value; - } - } - - - StickMaterialPtr PercussionChoice::getStickMaterial() const - { - return myStickMaterial; - } - - - void PercussionChoice::setStickMaterial( const StickMaterialPtr& value ) - { - if( value ) - { - myStickMaterial = value; - } - } - - - StickLocationPtr PercussionChoice::getStickLocation() const - { - return myStickLocation; - } - - - void PercussionChoice::setStickLocation( const StickLocationPtr& value ) - { - if( value ) - { - myStickLocation = value; - } - } - - - OtherPercussionPtr PercussionChoice::getOtherPercussion() const - { - return myOtherPercussion; - } - - - void PercussionChoice::setOtherPercussion( const OtherPercussionPtr& value ) - { - if( value ) - { - myOtherPercussion = value; - } - } - - - bool PercussionChoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - if( xelement.getName() == "glass" ) - { - myChoice = Choice::glass; - return getGlass()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "metal" ) - { - myChoice = Choice::metal; - return getMetal()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "wood" ) - { - myChoice = Choice::wood; - return getWood()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "pitched" ) - { - myChoice = Choice::pitched; - return getPitched()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "membrane" ) - { - myChoice = Choice::membrane; - return getMembrane()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "effect" ) - { - myChoice = Choice::effect; - return getEffect()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "timpani" ) - { - myChoice = Choice::timpani; - return getTimpani()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "beater" ) - { - myChoice = Choice::beater; - return getBeater()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "stick" ) - { - myChoice = Choice::stick; - return getStick()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "stick-type" ) - { - myChoice = Choice::stickType; - return getStickType()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "stick-material" ) - { - myChoice = Choice::stickMaterial; - return getStickMaterial()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "stick-location" ) - { - myChoice = Choice::stickLocation; - return getStickLocation()->fromXElement( message, xelement ); - } - - if( xelement.getName() == "other-percussion" ) - { - myChoice = Choice::otherPercussion; - return getOtherPercussion()->fromXElement( message, xelement ); - } - - MX_BAD_ELEMENT_FAILURE( PercussionChoice ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PercussionChoice.h b/Sourcecode/private/mx/core/elements/PercussionChoice.h deleted file mode 100644 index 2f42f55c6..000000000 --- a/Sourcecode/private/mx/core/elements/PercussionChoice.h +++ /dev/null @@ -1,137 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Beater ) - MX_FORWARD_DECLARE_ELEMENT( Effect ) - MX_FORWARD_DECLARE_ELEMENT( Glass ) - MX_FORWARD_DECLARE_ELEMENT( Membrane ) - MX_FORWARD_DECLARE_ELEMENT( Metal ) - MX_FORWARD_DECLARE_ELEMENT( OtherPercussion ) - MX_FORWARD_DECLARE_ELEMENT( Pitched ) - MX_FORWARD_DECLARE_ELEMENT( Stick ) - MX_FORWARD_DECLARE_ELEMENT( StickLocation ) - MX_FORWARD_DECLARE_ELEMENT( StickMaterial ) - MX_FORWARD_DECLARE_ELEMENT( StickType ) - MX_FORWARD_DECLARE_ELEMENT( Timpani ) - MX_FORWARD_DECLARE_ELEMENT( Wood ) - MX_FORWARD_DECLARE_ELEMENT( PercussionChoice ) - - inline PercussionChoicePtr makePercussionChoice() { return std::make_shared(); } - - class PercussionChoice : public ElementInterface - { - public: - enum class Choice - { - glass = 1, - metal = 2, - wood = 3, - pitched = 4, - membrane = 5, - effect = 6, - timpani = 7, - beater = 8, - stick = 9, - stickType = 10, - stickMaterial = 11, - stickLocation = 12, - otherPercussion = 13 - }; - PercussionChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PercussionChoice::Choice getChoice() const; - void setChoice( const PercussionChoice::Choice value ); - - /* _________ Glass minOccurs = 1, maxOccurs = 1 _________ */ - GlassPtr getGlass() const; - void setGlass( const GlassPtr& value ); - - /* _________ Metal minOccurs = 1, maxOccurs = 1 _________ */ - MetalPtr getMetal() const; - void setMetal( const MetalPtr& value ); - - /* _________ Wood minOccurs = 1, maxOccurs = 1 _________ */ - WoodPtr getWood() const; - void setWood( const WoodPtr& value ); - - /* _________ Pitched minOccurs = 1, maxOccurs = 1 _________ */ - PitchedPtr getPitched() const; - void setPitched( const PitchedPtr& value ); - - /* _________ Membrane minOccurs = 1, maxOccurs = 1 _________ */ - MembranePtr getMembrane() const; - void setMembrane( const MembranePtr& value ); - - /* _________ Effect minOccurs = 1, maxOccurs = 1 _________ */ - EffectPtr getEffect() const; - void setEffect( const EffectPtr& value ); - - /* _________ Timpani minOccurs = 1, maxOccurs = 1 _________ */ - TimpaniPtr getTimpani() const; - void setTimpani( const TimpaniPtr& value ); - - /* _________ Beater minOccurs = 1, maxOccurs = 1 _________ */ - BeaterPtr getBeater() const; - void setBeater( const BeaterPtr& value ); - - /* _________ Stick minOccurs = 1, maxOccurs = 1 _________ */ - StickPtr getStick() const; - void setStick( const StickPtr& value ); - - /* _________ StickType minOccurs = 1, maxOccurs = 1 _________ */ - StickTypePtr getStickType() const; - void setStickType( const StickTypePtr& value ); - - /* _________ StickMaterial minOccurs = 1, maxOccurs = 1 _________ */ - StickMaterialPtr getStickMaterial() const; - void setStickMaterial( const StickMaterialPtr& value ); - - /* _________ StickLocation minOccurs = 1, maxOccurs = 1 _________ */ - StickLocationPtr getStickLocation() const; - void setStickLocation( const StickLocationPtr& value ); - - /* _________ OtherPercussion minOccurs = 1, maxOccurs = 1 _________ */ - OtherPercussionPtr getOtherPercussion() const; - void setOtherPercussion( const OtherPercussionPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - GlassPtr myGlass; - MetalPtr myMetal; - WoodPtr myWood; - PitchedPtr myPitched; - MembranePtr myMembrane; - EffectPtr myEffect; - TimpaniPtr myTimpani; - BeaterPtr myBeater; - StickPtr myStick; - StickTypePtr myStickType; - StickMaterialPtr myStickMaterial; - StickLocationPtr myStickLocation; - OtherPercussionPtr myOtherPercussion; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Pitch.cpp b/Sourcecode/private/mx/core/elements/Pitch.cpp deleted file mode 100644 index 32b1d07a3..000000000 --- a/Sourcecode/private/mx/core/elements/Pitch.cpp +++ /dev/null @@ -1,151 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Pitch.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Alter.h" -#include "mx/core/elements/Octave.h" -#include "mx/core/elements/Step.h" -#include - -namespace mx -{ - namespace core - { - Pitch::Pitch() - :myStep( makeStep() ) - ,myAlter( makeAlter() ) - ,myHasAlter( false ) - ,myOctave( makeOctave() ) - {} - - - bool Pitch::hasAttributes() const - { - return false; - } - - - std::ostream& Pitch::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Pitch::streamName( std::ostream& os ) const - { - os << "pitch"; - return os; - } - - - bool Pitch::hasContents() const - { - return true; - } - - - std::ostream& Pitch::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myStep->toStream( os, indentLevel+1 ); - if ( myHasAlter ) - { - os << std::endl; - myAlter->toStream( os, indentLevel+1 ); - } - os << std::endl; - myOctave->toStream( os, indentLevel+1 ); - isOneLineOnly = false; - os << std::endl; - return os; - } - - - StepPtr Pitch::getStep() const - { - return myStep; - } - - - void Pitch::setStep( const StepPtr& value ) - { - if( value ) - { - myStep = value; - } - } - - - AlterPtr Pitch::getAlter() const - { - return myAlter; - } - - - void Pitch::setAlter( const AlterPtr& value ) - { - if( value ) - { - myAlter = value; - } - } - - - bool Pitch::getHasAlter() const - { - return myHasAlter; - } - - - void Pitch::setHasAlter( const bool value ) - { - myHasAlter = value; - } - - - OctavePtr Pitch::getOctave() const - { - return myOctave; - } - - - void Pitch::setOctave( const OctavePtr& value ) - { - if( value ) - { - myOctave = value; - } - } - - - bool Pitch::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isStepFound = false; - bool isOctaveFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myStep, isStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myAlter, myHasAlter ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myOctave, isOctaveFound ) ) { continue; } - } - - if( !isStepFound ) - { - message << "Pitch: 'step' element is required but was not found" << std::endl; - } - - if( !isOctaveFound ) - { - message << "Pitch: 'octave' element is required but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Pitch.h b/Sourcecode/private/mx/core/elements/Pitch.h deleted file mode 100644 index 85eb4870b..000000000 --- a/Sourcecode/private/mx/core/elements/Pitch.h +++ /dev/null @@ -1,61 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Alter ) - MX_FORWARD_DECLARE_ELEMENT( Octave ) - MX_FORWARD_DECLARE_ELEMENT( Step ) - MX_FORWARD_DECLARE_ELEMENT( Pitch ) - - inline PitchPtr makePitch() { return std::make_shared(); } - - class Pitch : public ElementInterface - { - public: - Pitch(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Step minOccurs = 1, maxOccurs = 1 _________ */ - StepPtr getStep() const; - void setStep( const StepPtr& value ); - - /* _________ Alter minOccurs = 0, maxOccurs = 1 _________ */ - AlterPtr getAlter() const; - void setAlter( const AlterPtr& value ); - bool getHasAlter() const; - void setHasAlter( const bool value ); - - /* _________ Octave minOccurs = 1, maxOccurs = 1 _________ */ - OctavePtr getOctave() const; - void setOctave( const OctavePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepPtr myStep; - AlterPtr myAlter; - bool myHasAlter; - OctavePtr myOctave; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Pitched.cpp b/Sourcecode/private/mx/core/elements/Pitched.cpp deleted file mode 100644 index 27e15cf8e..000000000 --- a/Sourcecode/private/mx/core/elements/Pitched.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Pitched.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Pitched::Pitched() - :myValue( PitchedEnum::xylophone ) - {} - - - Pitched::Pitched( const PitchedEnum& value ) - :myValue( value ) - {} - - - bool Pitched::hasAttributes() const - { - return false; - } - - - bool Pitched::hasContents() const - { - return true; - } - - - std::ostream& Pitched::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Pitched::streamName( std::ostream& os ) const - { - os << "pitched"; - return os; - } - - - std::ostream& Pitched::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PitchedEnum Pitched::getValue() const - { - return myValue; - } - - - void Pitched::setValue( const PitchedEnum& value ) - { - myValue = value; - } - - - bool Pitched::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = parsePitchedEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Pitched.h b/Sourcecode/private/mx/core/elements/Pitched.h deleted file mode 100644 index a31af2377..000000000 --- a/Sourcecode/private/mx/core/elements/Pitched.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Pitched ) - - inline PitchedPtr makePitched() { return std::make_shared(); } - inline PitchedPtr makePitched( const PitchedEnum& value ) { return std::make_shared( value ); } - inline PitchedPtr makePitched( PitchedEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Pitched : public ElementInterface - { - public: - Pitched(); - Pitched( const PitchedEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PitchedEnum getValue() const; - void setValue( const PitchedEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PitchedEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Play.cpp b/Sourcecode/private/mx/core/elements/Play.cpp deleted file mode 100644 index bd489ab85..000000000 --- a/Sourcecode/private/mx/core/elements/Play.cpp +++ /dev/null @@ -1,201 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Play.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Ipa.h" -#include "mx/core/elements/Mute.h" -#include "mx/core/elements/OtherPlay.h" -#include "mx/core/elements/SemiPitched.h" -#include - -namespace mx -{ - namespace core - { - Play::Play() - :myAttributes( std::make_shared() ) - ,myChoice( Choice::ipa ) - ,myIpa( makeIpa() ) - ,myMute( makeMute() ) - ,mySemiPitched( makeSemiPitched() ) - ,myOtherPlay( makeOtherPlay() ) - {} - - - bool Play::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Play::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Play::streamName( std::ostream& os ) const - { - os << "play"; - return os; - } - - - bool Play::hasContents() const - { - return true; - } - - - std::ostream& Play::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - switch ( myChoice ) - { - case Choice::ipa: - { - myIpa->toStream( os, indentLevel+1 ); - } - break; - case Choice::mute: - { - myMute->toStream( os, indentLevel+1 ); - } - break; - case Choice::semiPitched: - { - mySemiPitched->toStream( os, indentLevel+1 ); - } - break; - case Choice::otherPlay: - { - myOtherPlay->toStream( os, indentLevel+1 ); - } - break; - default: - break; - } - isOneLineOnly = false; - os << std::endl; - return os; - } - - - PlayAttributesPtr Play::getAttributes() const - { - return myAttributes; - } - - - void Play::setAttributes( const PlayAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - Play::Choice Play::getChoice() const - { - return myChoice; - } - - - void Play::setChoice( const Play::Choice value ) - { - myChoice = value; - } - - - IpaPtr Play::getIpa() const - { - return myIpa; - } - - - void Play::setIpa( const IpaPtr& value ) - { - if( value ) - { - myIpa = value; - } - } - - - MutePtr Play::getMute() const - { - return myMute; - } - - - void Play::setMute( const MutePtr& value ) - { - if( value ) - { - myMute = value; - } - } - - - SemiPitchedPtr Play::getSemiPitched() const - { - return mySemiPitched; - } - - - void Play::setSemiPitched( const SemiPitchedPtr& value ) - { - if( value ) - { - mySemiPitched = value; - } - } - - - OtherPlayPtr Play::getOtherPlay() const - { - return myOtherPlay; - } - - - void Play::setOtherPlay( const OtherPlayPtr& value ) - { - if( value ) - { - myOtherPlay = value; - } - } - - - bool Play::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - if( xelement.getName() == "ipa" ) - { - myChoice = Choice::ipa; - return getIpa()->fromXElement( message, xelement ); - } - else if( xelement.getName() == "mute" ) - { - myChoice = Choice::mute; - return getMute()->fromXElement( message, xelement ); - } - else if( xelement.getName() == "semi-pitched" ) - { - myChoice = Choice::semiPitched; - return getSemiPitched()->fromXElement( message, xelement ); - } - else if( xelement.getName() == "other-play" ) - { - myChoice = Choice::otherPlay; - return getOtherPlay()->fromXElement( message, xelement ); - } - - message << "Encoding: '" << xelement.getName() << "' is not valid" << std::endl; - return false; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Play.h b/Sourcecode/private/mx/core/elements/Play.h deleted file mode 100644 index e939ed8e6..000000000 --- a/Sourcecode/private/mx/core/elements/Play.h +++ /dev/null @@ -1,82 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/PlayAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PlayAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Ipa ) - MX_FORWARD_DECLARE_ELEMENT( Mute ) - MX_FORWARD_DECLARE_ELEMENT( OtherPlay ) - MX_FORWARD_DECLARE_ELEMENT( SemiPitched ) - MX_FORWARD_DECLARE_ELEMENT( Play ) - - inline PlayPtr makePlay() { return std::make_shared(); } - - class Play : public ElementInterface - { - public: - enum class Choice - { - ipa = 1, - mute = 2, - semiPitched = 3, - otherPlay = 4 - }; - Play(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PlayAttributesPtr getAttributes() const; - void setAttributes( const PlayAttributesPtr& value ); - - /* _________ Choice __________ */ - Play::Choice getChoice() const; - void setChoice( const Play::Choice value ); - - /* _________ Ipa minOccurs = 1, maxOccurs = 1 _________ */ - IpaPtr getIpa() const; - void setIpa( const IpaPtr& value ); - - /* _________ Mute minOccurs = 1, maxOccurs = 1 _________ */ - MutePtr getMute() const; - void setMute( const MutePtr& value ); - - /* _________ SemiPitched minOccurs = 1, maxOccurs = 1 _________ */ - SemiPitchedPtr getSemiPitched() const; - void setSemiPitched( const SemiPitchedPtr& value ); - - /* _________ OtherPlay minOccurs = 1, maxOccurs = 1 _________ */ - OtherPlayPtr getOtherPlay() const; - void setOtherPlay( const OtherPlayPtr& value ); - - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PlayAttributesPtr myAttributes; - Choice myChoice; - IpaPtr myIpa; - MutePtr myMute; - SemiPitchedPtr mySemiPitched; - OtherPlayPtr myOtherPlay; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PlayAttributes.cpp b/Sourcecode/private/mx/core/elements/PlayAttributes.cpp deleted file mode 100644 index e028efefa..000000000 --- a/Sourcecode/private/mx/core/elements/PlayAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PlayAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PlayAttributes::PlayAttributes() - :id() - ,hasId( false ) - {} - - - bool PlayAttributes::hasValues() const - { - return hasId; - } - - - std::ostream& PlayAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - } - return os; - } - - - bool PlayAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PlayAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, hasId, "id" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PlayAttributes.h b/Sourcecode/private/mx/core/elements/PlayAttributes.h deleted file mode 100644 index e300001f4..000000000 --- a/Sourcecode/private/mx/core/elements/PlayAttributes.h +++ /dev/null @@ -1,36 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/XsIDREF.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PlayAttributes ) - - struct PlayAttributes : public AttributesInterface - { - public: - PlayAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsIDREF id; - bool hasId; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Plop.cpp b/Sourcecode/private/mx/core/elements/Plop.cpp deleted file mode 100644 index 96a0def57..000000000 --- a/Sourcecode/private/mx/core/elements/Plop.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Plop.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Plop::Plop() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Plop::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Plop::hasContents() const { return false; } - std::ostream& Plop::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Plop::streamName( std::ostream& os ) const { os << "plop"; return os; } - std::ostream& Plop::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyLineAttributesPtr Plop::getAttributes() const - { - return myAttributes; - } - - - void Plop::setAttributes( const EmptyLineAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Plop::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Plop.h b/Sourcecode/private/mx/core/elements/Plop.h deleted file mode 100644 index 760e64505..000000000 --- a/Sourcecode/private/mx/core/elements/Plop.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyLineAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyLineAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Plop ) - - inline PlopPtr makePlop() { return std::make_shared(); } - - class Plop : public ElementInterface - { - public: - Plop(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyLineAttributesPtr getAttributes() const; - void setAttributes( const EmptyLineAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyLineAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Pluck.cpp b/Sourcecode/private/mx/core/elements/Pluck.cpp deleted file mode 100644 index ff394fd83..000000000 --- a/Sourcecode/private/mx/core/elements/Pluck.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Pluck.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Pluck::Pluck() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Pluck::Pluck( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Pluck::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Pluck::hasContents() const - { - return true; - } - - - std::ostream& Pluck::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Pluck::streamName( std::ostream& os ) const - { - os << "pluck"; - return os; - } - - - std::ostream& Pluck::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PluckAttributesPtr Pluck::getAttributes() const - { - return myAttributes; - } - - - void Pluck::setAttributes( const PluckAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Pluck::getValue() const - { - return myValue; - } - - - void Pluck::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Pluck::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Pluck.h b/Sourcecode/private/mx/core/elements/Pluck.h deleted file mode 100644 index 72c163cf6..000000000 --- a/Sourcecode/private/mx/core/elements/Pluck.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/PluckAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PluckAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Pluck ) - - inline PluckPtr makePluck() { return std::make_shared(); } - inline PluckPtr makePluck( const XsString& value ) { return std::make_shared( value ); } - inline PluckPtr makePluck( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Pluck : public ElementInterface - { - public: - Pluck(); - Pluck( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PluckAttributesPtr getAttributes() const; - void setAttributes( const PluckAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PluckAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PluckAttributes.cpp b/Sourcecode/private/mx/core/elements/PluckAttributes.cpp deleted file mode 100644 index a95059b2d..000000000 --- a/Sourcecode/private/mx/core/elements/PluckAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PluckAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PluckAttributes::PluckAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool PluckAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& PluckAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool PluckAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PluckAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PluckAttributes.h b/Sourcecode/private/mx/core/elements/PluckAttributes.h deleted file mode 100644 index 22b051cd1..000000000 --- a/Sourcecode/private/mx/core/elements/PluckAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PluckAttributes ) - - struct PluckAttributes : public AttributesInterface - { - public: - PluckAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PreBend.cpp b/Sourcecode/private/mx/core/elements/PreBend.cpp deleted file mode 100644 index eb90e121b..000000000 --- a/Sourcecode/private/mx/core/elements/PreBend.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PreBend.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PreBend::PreBend() : ElementInterface() {} - - - bool PreBend::hasAttributes() const { return false; } - - - bool PreBend::hasContents() const { return false; } - std::ostream& PreBend::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& PreBend::streamName( std::ostream& os ) const { os << "pre-bend"; return os; } - std::ostream& PreBend::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool PreBend::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PreBend.h b/Sourcecode/private/mx/core/elements/PreBend.h deleted file mode 100644 index f4d0c2839..000000000 --- a/Sourcecode/private/mx/core/elements/PreBend.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( PreBend ) - - inline PreBendPtr makePreBend() { return std::make_shared(); } - - class PreBend : public ElementInterface - { - public: - PreBend(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Prefix.cpp b/Sourcecode/private/mx/core/elements/Prefix.cpp deleted file mode 100644 index 047a3077a..000000000 --- a/Sourcecode/private/mx/core/elements/Prefix.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Prefix.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Prefix::Prefix() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Prefix::Prefix( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Prefix::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Prefix::hasContents() const - { - return true; - } - - - std::ostream& Prefix::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Prefix::streamName( std::ostream& os ) const - { - os << "prefix"; - return os; - } - - - std::ostream& Prefix::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PrefixAttributesPtr Prefix::getAttributes() const - { - return myAttributes; - } - - - void Prefix::setAttributes( const PrefixAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Prefix::getValue() const - { - return myValue; - } - - - void Prefix::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Prefix::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Prefix.h b/Sourcecode/private/mx/core/elements/Prefix.h deleted file mode 100644 index 2b2fb0ab9..000000000 --- a/Sourcecode/private/mx/core/elements/Prefix.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/PrefixAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PrefixAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Prefix ) - - inline PrefixPtr makePrefix() { return std::make_shared(); } - inline PrefixPtr makePrefix( const XsString& value ) { return std::make_shared( value ); } - inline PrefixPtr makePrefix( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Prefix : public ElementInterface - { - public: - Prefix(); - Prefix( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PrefixAttributesPtr getAttributes() const; - void setAttributes( const PrefixAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PrefixAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PrefixAttributes.cpp b/Sourcecode/private/mx/core/elements/PrefixAttributes.cpp deleted file mode 100644 index d3ac584ca..000000000 --- a/Sourcecode/private/mx/core/elements/PrefixAttributes.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PrefixAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PrefixAttributes::PrefixAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool PrefixAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& PrefixAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool PrefixAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PrefixAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PrefixAttributes.h b/Sourcecode/private/mx/core/elements/PrefixAttributes.h deleted file mode 100644 index db2dcb7a5..000000000 --- a/Sourcecode/private/mx/core/elements/PrefixAttributes.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PrefixAttributes ) - - struct PrefixAttributes : public AttributesInterface - { - public: - PrefixAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PrincipalVoice.cpp b/Sourcecode/private/mx/core/elements/PrincipalVoice.cpp deleted file mode 100644 index 8e981dffc..000000000 --- a/Sourcecode/private/mx/core/elements/PrincipalVoice.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PrincipalVoice.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PrincipalVoice::PrincipalVoice() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - PrincipalVoice::PrincipalVoice( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool PrincipalVoice::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool PrincipalVoice::hasContents() const - { - return true; - } - - - std::ostream& PrincipalVoice::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& PrincipalVoice::streamName( std::ostream& os ) const - { - os << "principal-voice"; - return os; - } - - - std::ostream& PrincipalVoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PrincipalVoiceAttributesPtr PrincipalVoice::getAttributes() const - { - return myAttributes; - } - - - void PrincipalVoice::setAttributes( const PrincipalVoiceAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString PrincipalVoice::getValue() const - { - return myValue; - } - - - void PrincipalVoice::setValue( const XsString& value ) - { - myValue = value; - } - - - bool PrincipalVoice::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PrincipalVoice.h b/Sourcecode/private/mx/core/elements/PrincipalVoice.h deleted file mode 100644 index 37ff1a9ed..000000000 --- a/Sourcecode/private/mx/core/elements/PrincipalVoice.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/PrincipalVoiceAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PrincipalVoiceAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PrincipalVoice ) - - inline PrincipalVoicePtr makePrincipalVoice() { return std::make_shared(); } - inline PrincipalVoicePtr makePrincipalVoice( const XsString& value ) { return std::make_shared( value ); } - inline PrincipalVoicePtr makePrincipalVoice( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class PrincipalVoice : public ElementInterface - { - public: - PrincipalVoice(); - PrincipalVoice( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PrincipalVoiceAttributesPtr getAttributes() const; - void setAttributes( const PrincipalVoiceAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PrincipalVoiceAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.cpp b/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.cpp deleted file mode 100644 index 41ec545cb..000000000 --- a/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PrincipalVoiceAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PrincipalVoiceAttributes::PrincipalVoiceAttributes() - :type( StartStop::start ) - ,symbol( PrincipalVoiceSymbol::none ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,hasType( true ) - ,hasSymbol( true ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - {} - - - bool PrincipalVoiceAttributes::hasValues() const - { - return hasType || - hasSymbol || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign; - } - - - std::ostream& PrincipalVoiceAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, symbol, "symbol", hasSymbol ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; - } - - - bool PrincipalVoiceAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PrincipalVoiceAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - bool isSymbolFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, symbol, isSymbolFound, "symbol", &parsePrincipalVoiceSymbol ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - if( !isSymbolFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.h b/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.h deleted file mode 100644 index 354303956..000000000 --- a/Sourcecode/private/mx/core/elements/PrincipalVoiceAttributes.h +++ /dev/null @@ -1,58 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PrincipalVoiceAttributes ) - - struct PrincipalVoiceAttributes : public AttributesInterface - { - public: - PrincipalVoiceAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - PrincipalVoiceSymbol symbol; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - const bool hasType; - const bool hasSymbol; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Print.cpp b/Sourcecode/private/mx/core/elements/Print.cpp deleted file mode 100644 index 69082f6e2..000000000 --- a/Sourcecode/private/mx/core/elements/Print.cpp +++ /dev/null @@ -1,258 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Print.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/LayoutGroup.h" -#include "mx/core/elements/MeasureLayout.h" -#include "mx/core/elements/MeasureNumbering.h" -#include "mx/core/elements/PartAbbreviationDisplay.h" -#include "mx/core/elements/PartNameDisplay.h" -#include - -namespace mx -{ - namespace core - { - Print::Print() - :myAttributes( std::make_shared() ) - ,myLayoutGroup( makeLayoutGroup() ) - ,myMeasureLayout( makeMeasureLayout() ) - ,myHasMeasureLayout( false ) - ,myMeasureNumbering( makeMeasureNumbering() ) - ,myHasMeasureNumbering( false ) - ,myPartNameDisplay( makePartNameDisplay() ) - ,myHasPartNameDisplay( false ) - ,myPartAbbreviationDisplay( makePartAbbreviationDisplay() ) - ,myHasPartAbbreviationDisplay( false ) - {} - - - bool Print::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Print::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Print::streamName( std::ostream& os ) const - { - os << "print"; - return os; - } - - - bool Print::hasContents() const - { - return myLayoutGroup->hasContents() - || myHasMeasureLayout - || myHasMeasureNumbering - || myHasPartNameDisplay - || myHasPartAbbreviationDisplay; - } - - - std::ostream& Print::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - if ( myLayoutGroup->hasContents() ) - { - os << std::endl; - myLayoutGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasMeasureLayout ) - { - os << std::endl; - myMeasureLayout->toStream( os, indentLevel+1 ); - } - if ( myHasMeasureNumbering ) - { - os << std::endl; - myMeasureNumbering->toStream( os, indentLevel+1 ); - } - if ( myHasPartNameDisplay ) - { - os << std::endl; - myPartNameDisplay->toStream( os, indentLevel+1 ); - } - if ( myHasPartAbbreviationDisplay ) - { - os << std::endl; - myPartAbbreviationDisplay->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - PrintAttributesPtr Print::getAttributes() const - { - return myAttributes; - } - - - void Print::setAttributes( const PrintAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - LayoutGroupPtr Print::getLayoutGroup() const - { - return myLayoutGroup; - } - - - void Print::setLayoutGroup( const LayoutGroupPtr& value ) - { - if ( value ) - { - myLayoutGroup = value; - } - } - - - MeasureLayoutPtr Print::getMeasureLayout() const - { - return myMeasureLayout; - } - - - void Print::setMeasureLayout( const MeasureLayoutPtr& value ) - { - if ( value ) - { - myMeasureLayout = value; - } - } - - - bool Print::getHasMeasureLayout() const - { - return myHasMeasureLayout; - } - - - void Print::setHasMeasureLayout( const bool value ) - { - myHasMeasureLayout = value; - } - - - MeasureNumberingPtr Print::getMeasureNumbering() const - { - return myMeasureNumbering; - } - - - void Print::setMeasureNumbering( const MeasureNumberingPtr& value ) - { - if ( value ) - { - myMeasureNumbering = value; - } - } - - - bool Print::getHasMeasureNumbering() const - { - return myHasMeasureNumbering; - } - - - void Print::setHasMeasureNumbering( const bool value ) - { - myHasMeasureNumbering = value; - } - - - PartNameDisplayPtr Print::getPartNameDisplay() const - { - return myPartNameDisplay; - } - - - void Print::setPartNameDisplay( const PartNameDisplayPtr& value ) - { - if ( value ) - { - myPartNameDisplay = value; - } - } - - - bool Print::getHasPartNameDisplay() const - { - return myHasPartNameDisplay; - } - - - void Print::setHasPartNameDisplay( const bool value ) - { - myHasPartNameDisplay = value; - } - - - PartAbbreviationDisplayPtr Print::getPartAbbreviationDisplay() const - { - return myPartAbbreviationDisplay; - } - - - void Print::setPartAbbreviationDisplay( const PartAbbreviationDisplayPtr& value ) - { - if ( value ) - { - myPartAbbreviationDisplay = value; - } - } - - - bool Print::getHasPartAbbreviationDisplay() const - { - return myHasPartAbbreviationDisplay; - } - - - void Print::setHasPartAbbreviationDisplay( const bool value ) - { - myHasPartAbbreviationDisplay = value; - } - - - bool Print::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importGroup( message, it, endIter, isSuccess, myLayoutGroup ); - if ( importElement( message, *it, isSuccess, *myMeasureLayout, myHasMeasureLayout ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMeasureNumbering, myHasMeasureNumbering ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPartNameDisplay, myHasPartNameDisplay ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPartAbbreviationDisplay, myHasPartAbbreviationDisplay ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Print.h b/Sourcecode/private/mx/core/elements/Print.h deleted file mode 100644 index a89e87cff..000000000 --- a/Sourcecode/private/mx/core/elements/Print.h +++ /dev/null @@ -1,87 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/PrintAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PrintAttributes ) - MX_FORWARD_DECLARE_ELEMENT( LayoutGroup ) - MX_FORWARD_DECLARE_ELEMENT( MeasureLayout ) - MX_FORWARD_DECLARE_ELEMENT( MeasureNumbering ) - MX_FORWARD_DECLARE_ELEMENT( PartAbbreviationDisplay ) - MX_FORWARD_DECLARE_ELEMENT( PartNameDisplay ) - MX_FORWARD_DECLARE_ELEMENT( Print ) - - inline PrintPtr makePrint() { return std::make_shared(); } - - class Print : public ElementInterface - { - public: - Print(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PrintAttributesPtr getAttributes() const; - void setAttributes( const PrintAttributesPtr& value ); - - /* _________ LayoutGroup minOccurs = 1, maxOccurs = 1 _________ */ - LayoutGroupPtr getLayoutGroup() const; - void setLayoutGroup( const LayoutGroupPtr& value ); - - /* _________ MeasureLayout minOccurs = 0, maxOccurs = 1 _________ */ - MeasureLayoutPtr getMeasureLayout() const; - void setMeasureLayout( const MeasureLayoutPtr& value ); - bool getHasMeasureLayout() const; - void setHasMeasureLayout( const bool value ); - - /* _________ MeasureNumbering minOccurs = 0, maxOccurs = 1 _________ */ - MeasureNumberingPtr getMeasureNumbering() const; - void setMeasureNumbering( const MeasureNumberingPtr& value ); - bool getHasMeasureNumbering() const; - void setHasMeasureNumbering( const bool value ); - - /* _________ PartNameDisplay minOccurs = 0, maxOccurs = 1 _________ */ - PartNameDisplayPtr getPartNameDisplay() const; - void setPartNameDisplay( const PartNameDisplayPtr& value ); - bool getHasPartNameDisplay() const; - void setHasPartNameDisplay( const bool value ); - - /* _________ PartAbbreviationDisplay minOccurs = 0, maxOccurs = 1 _________ */ - PartAbbreviationDisplayPtr getPartAbbreviationDisplay() const; - void setPartAbbreviationDisplay( const PartAbbreviationDisplayPtr& value ); - bool getHasPartAbbreviationDisplay() const; - void setHasPartAbbreviationDisplay( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PrintAttributesPtr myAttributes; - LayoutGroupPtr myLayoutGroup; - MeasureLayoutPtr myMeasureLayout; - bool myHasMeasureLayout; - MeasureNumberingPtr myMeasureNumbering; - bool myHasMeasureNumbering; - PartNameDisplayPtr myPartNameDisplay; - bool myHasPartNameDisplay; - PartAbbreviationDisplayPtr myPartAbbreviationDisplay; - bool myHasPartAbbreviationDisplay; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PrintAttributes.cpp b/Sourcecode/private/mx/core/elements/PrintAttributes.cpp deleted file mode 100644 index 6fcf9dadb..000000000 --- a/Sourcecode/private/mx/core/elements/PrintAttributes.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PrintAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PrintAttributes::PrintAttributes() - :staffSpacing() - ,newSystem( YesNo::no ) - ,newPage( YesNo::no ) - ,blankPage() - ,pageNumber() - ,hasStaffSpacing( false ) - ,hasNewSystem( false ) - ,hasNewPage( false ) - ,hasBlankPage( false ) - ,hasPageNumber( false ) - {} - - - bool PrintAttributes::hasValues() const - { - return hasStaffSpacing || - hasNewSystem || - hasNewPage || - hasBlankPage || - hasPageNumber; - } - - - std::ostream& PrintAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, staffSpacing, "staff-spacing", hasStaffSpacing ); - streamAttribute( os, newSystem, "new-system", hasNewSystem ); - streamAttribute( os, newPage, "new-page", hasNewPage ); - streamAttribute( os, blankPage, "blank-page", hasBlankPage ); - streamAttribute( os, pageNumber, "page-number", hasPageNumber ); - } - return os; - } - - - bool PrintAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PrintAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, staffSpacing, hasStaffSpacing, "staff-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, newSystem, hasNewSystem, "new-system", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, newPage, hasNewPage, "new-page", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, blankPage, hasBlankPage, "blank-page" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, pageNumber, hasPageNumber, "page-number" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PrintAttributes.h b/Sourcecode/private/mx/core/elements/PrintAttributes.h deleted file mode 100644 index e69e30238..000000000 --- a/Sourcecode/private/mx/core/elements/PrintAttributes.h +++ /dev/null @@ -1,46 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PrintAttributes ) - - struct PrintAttributes : public AttributesInterface - { - public: - PrintAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue staffSpacing; - YesNo newSystem; - YesNo newPage; - PositiveInteger blankPage; - XsToken pageNumber; - bool hasStaffSpacing; - bool hasNewSystem; - bool hasNewPage; - bool hasBlankPage; - bool hasPageNumber; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Properties.cpp b/Sourcecode/private/mx/core/elements/Properties.cpp deleted file mode 100644 index 4b44fdcf5..000000000 --- a/Sourcecode/private/mx/core/elements/Properties.cpp +++ /dev/null @@ -1,600 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Properties.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Clef.h" -#include "mx/core/elements/Directive.h" -#include "mx/core/elements/Divisions.h" -#include "mx/core/elements/EditorialGroup.h" -#include "mx/core/elements/Footnote.h" -#include "mx/core/elements/Instruments.h" -#include "mx/core/elements/Key.h" -#include "mx/core/elements/Level.h" -#include "mx/core/elements/MeasureStyle.h" -#include "mx/core/elements/PartSymbol.h" -#include "mx/core/elements/StaffDetails.h" -#include "mx/core/elements/Staves.h" -#include "mx/core/elements/Time.h" -#include "mx/core/elements/Transpose.h" -#include - -namespace mx -{ - namespace core - { - Properties::Properties() - :myEditorialGroup( makeEditorialGroup() ) - ,myDivisions( makeDivisions() ) - ,myHasDivisions( false ) - ,myKeySet() - ,myTimeSet() - ,myStaves( makeStaves() ) - ,myHasStaves( false ) - ,myPartSymbol( makePartSymbol() ) - ,myHasPartSymbol( false ) - ,myInstruments( makeInstruments() ) - ,myHasInstruments( false ) - ,myClefSet() - ,myStaffDetailsSet() - ,myTransposeSet() - ,myDirectiveSet() - ,myMeasureStyleSet() - {} - - - bool Properties::hasAttributes() const - { - return false; - } - - - std::ostream& Properties::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Properties::streamName( std::ostream& os ) const - { - os << "attributes"; - return os; - } - - - bool Properties::hasContents() const - { - return myEditorialGroup->hasContents() - || myHasDivisions - || myKeySet.size() > 0 - || myTimeSet.size() > 0 - || myHasStaves - || myHasPartSymbol - || myHasInstruments - || myClefSet.size() > 0 - || myStaffDetailsSet.size() > 0 - || myTransposeSet.size() > 0 - || myDirectiveSet.size() > 0 - || myMeasureStyleSet.size() > 0; - } - - - std::ostream& Properties::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( this->hasContents() ) - { - if ( myEditorialGroup->hasContents() ) - { - os << std::endl; - myEditorialGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasDivisions ) - { - os << std::endl; - myDivisions->toStream( os, indentLevel+1 ); - } - for ( auto x : myKeySet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myTimeSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasStaves ) - { - os << std::endl; - myStaves->toStream( os, indentLevel+1 ); - } - if ( myHasPartSymbol ) - { - os << std::endl; - myPartSymbol->toStream( os, indentLevel+1 ); - } - if ( myHasInstruments ) - { - os << std::endl; - myInstruments->toStream( os, indentLevel+1 ); - } - for ( auto x : myClefSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myStaffDetailsSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myTransposeSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myDirectiveSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myMeasureStyleSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - EditorialGroupPtr Properties::getEditorialGroup() const - { - return myEditorialGroup; - } - - - void Properties::setEditorialGroup( const EditorialGroupPtr& value ) - { - if ( value ) - { - myEditorialGroup = value; - } - } - - - DivisionsPtr Properties::getDivisions() const - { - return myDivisions; - } - - - void Properties::setDivisions( const DivisionsPtr& value ) - { - if( value ) - { - myDivisions = value; - } - } - - - bool Properties::getHasDivisions() const - { - return myHasDivisions; - } - - - void Properties::setHasDivisions( const bool value ) - { - myHasDivisions = value; - } - - - const KeySet& Properties::getKeySet() const - { - return myKeySet; - } - - - void Properties::removeKey( const KeySetIterConst& value ) - { - if ( value != myKeySet.cend() ) - { - myKeySet.erase( value ); - } - } - - - void Properties::addKey( const KeyPtr& value ) - { - if ( value ) - { - myKeySet.push_back( value ); - } - } - - - void Properties::clearKeySet() - { - myKeySet.clear(); - } - - - KeyPtr Properties::getKey( const KeySetIterConst& setIterator ) const - { - if( setIterator != myKeySet.cend() ) - { - return *setIterator; - } - return KeyPtr(); - } - - - const TimeSet& Properties::getTimeSet() const - { - return myTimeSet; - } - - - void Properties::removeTime( const TimeSetIterConst& value ) - { - if ( value != myTimeSet.cend() ) - { - myTimeSet.erase( value ); - } - } - - - void Properties::addTime( const TimePtr& value ) - { - if ( value ) - { - myTimeSet.push_back( value ); - } - } - - - void Properties::clearTimeSet() - { - myTimeSet.clear(); - } - - - TimePtr Properties::getTime( const TimeSetIterConst& setIterator ) const - { - if( setIterator != myTimeSet.cend() ) - { - return *setIterator; - } - return TimePtr(); - } - - - StavesPtr Properties::getStaves() const - { - return myStaves; - } - - - void Properties::setStaves( const StavesPtr& value ) - { - if( value ) - { - myStaves = value; - } - } - - - bool Properties::getHasStaves() const - { - return myHasStaves; - } - - - void Properties::setHasStaves( const bool value ) - { - myHasStaves = value; - } - - - PartSymbolPtr Properties::getPartSymbol() const - { - return myPartSymbol; - } - - - void Properties::setPartSymbol( const PartSymbolPtr& value ) - { - if( value ) - { - myPartSymbol = value; - } - } - - - bool Properties::getHasPartSymbol() const - { - return myHasPartSymbol; - } - - - void Properties::setHasPartSymbol( const bool value ) - { - myHasPartSymbol = value; - } - - - InstrumentsPtr Properties::getInstruments() const - { - return myInstruments; - } - - - void Properties::setInstruments( const InstrumentsPtr& value ) - { - if( value ) - { - myInstruments = value; - } - } - - - bool Properties::getHasInstruments() const - { - return myHasInstruments; - } - - - void Properties::setHasInstruments( const bool value ) - { - myHasInstruments = value; - } - - - const ClefSet& Properties::getClefSet() const - { - return myClefSet; - } - - - void Properties::removeClef( const ClefSetIterConst& value ) - { - if ( value != myClefSet.cend() ) - { - myClefSet.erase( value ); - } - } - - - void Properties::addClef( const ClefPtr& value ) - { - if ( value ) - { - myClefSet.push_back( value ); - } - } - - - void Properties::clearClefSet() - { - myClefSet.clear(); - } - - - ClefPtr Properties::getClef( const ClefSetIterConst& setIterator ) const - { - if( setIterator != myClefSet.cend() ) - { - return *setIterator; - } - return ClefPtr(); - } - - - const StaffDetailsSet& Properties::getStaffDetailsSet() const - { - return myStaffDetailsSet; - } - - - void Properties::removeStaffDetails( const StaffDetailsSetIterConst& value ) - { - if ( value != myStaffDetailsSet.cend() ) - { - myStaffDetailsSet.erase( value ); - } - } - - - void Properties::addStaffDetails( const StaffDetailsPtr& value ) - { - if ( value ) - { - myStaffDetailsSet.push_back( value ); - } - } - - - void Properties::clearStaffDetailsSet() - { - myStaffDetailsSet.clear(); - } - - - StaffDetailsPtr Properties::getStaffDetails( const StaffDetailsSetIterConst& setIterator ) const - { - if( setIterator != myStaffDetailsSet.cend() ) - { - return *setIterator; - } - return StaffDetailsPtr(); - } - - - const TransposeSet& Properties::getTransposeSet() const - { - return myTransposeSet; - } - - - void Properties::removeTranspose( const TransposeSetIterConst& value ) - { - if ( value != myTransposeSet.cend() ) - { - myTransposeSet.erase( value ); - } - } - - - void Properties::addTranspose( const TransposePtr& value ) - { - if ( value ) - { - myTransposeSet.push_back( value ); - } - } - - - void Properties::clearTransposeSet() - { - myTransposeSet.clear(); - } - - - TransposePtr Properties::getTranspose( const TransposeSetIterConst& setIterator ) const - { - if( setIterator != myTransposeSet.cend() ) - { - return *setIterator; - } - return TransposePtr(); - } - - - const DirectiveSet& Properties::getDirectiveSet() const - { - return myDirectiveSet; - } - - - void Properties::removeDirective( const DirectiveSetIterConst& value ) - { - if ( value != myDirectiveSet.cend() ) - { - myDirectiveSet.erase( value ); - } - } - - - void Properties::addDirective( const DirectivePtr& value ) - { - if ( value ) - { - myDirectiveSet.push_back( value ); - } - } - - - void Properties::clearDirectiveSet() - { - myDirectiveSet.clear(); - } - - - DirectivePtr Properties::getDirective( const DirectiveSetIterConst& setIterator ) const - { - if( setIterator != myDirectiveSet.cend() ) - { - return *setIterator; - } - return DirectivePtr(); - } - - - const MeasureStyleSet& Properties::getMeasureStyleSet() const - { - return myMeasureStyleSet; - } - - - void Properties::removeMeasureStyle( const MeasureStyleSetIterConst& value ) - { - if ( value != myMeasureStyleSet.cend() ) - { - myMeasureStyleSet.erase( value ); - } - } - - - void Properties::addMeasureStyle( const MeasureStylePtr& value ) - { - if ( value ) - { - myMeasureStyleSet.push_back( value ); - } - } - - - void Properties::clearMeasureStyleSet() - { - myMeasureStyleSet.clear(); - } - - - MeasureStylePtr Properties::getMeasureStyle( const MeasureStyleSetIterConst& setIterator ) const - { - if( setIterator != myMeasureStyleSet.cend() ) - { - return *setIterator; - } - return MeasureStylePtr(); - } - - - bool Properties::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - ::ezxml::XElementIterator end = xelement.end(); - - bool hasFootnote = false; - bool hasLevel = false; - - for( auto it = xelement.begin(); it != end; ++it ) - { - importElement( message, *it, isSuccess, *myEditorialGroup->getFootnote(), hasFootnote ); - if( hasFootnote ) - { - myEditorialGroup->setHasFootnote( true ); - } - - importElement( message, *it, isSuccess, *myEditorialGroup->getLevel(), hasLevel ); - if( hasLevel ) - { - myEditorialGroup->setHasLevel( true ); - } - - if ( importElement( message, *it, isSuccess, *myDivisions, myHasDivisions ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "key", myKeySet ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "time", myTimeSet ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myStaves, myHasStaves ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPartSymbol, myHasPartSymbol ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myInstruments, myHasInstruments ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "clef", myClefSet ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "staff-details", myStaffDetailsSet ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "transpose", myTransposeSet ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "directive", myDirectiveSet ) ) { continue; } - if ( importElementSet( message, it, end, isSuccess, "measure-style", myMeasureStyleSet ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Properties.h b/Sourcecode/private/mx/core/elements/Properties.h deleted file mode 100644 index 8617bcd7e..000000000 --- a/Sourcecode/private/mx/core/elements/Properties.h +++ /dev/null @@ -1,145 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Clef ) - MX_FORWARD_DECLARE_ELEMENT( Directive ) - MX_FORWARD_DECLARE_ELEMENT( Divisions ) - MX_FORWARD_DECLARE_ELEMENT( EditorialGroup ) - MX_FORWARD_DECLARE_ELEMENT( Instruments ) - MX_FORWARD_DECLARE_ELEMENT( Key ) - MX_FORWARD_DECLARE_ELEMENT( MeasureStyle ) - MX_FORWARD_DECLARE_ELEMENT( PartSymbol ) - MX_FORWARD_DECLARE_ELEMENT( StaffDetails ) - MX_FORWARD_DECLARE_ELEMENT( Staves ) - MX_FORWARD_DECLARE_ELEMENT( Time ) - MX_FORWARD_DECLARE_ELEMENT( Transpose ) - MX_FORWARD_DECLARE_ELEMENT( Properties ) - - inline PropertiesPtr makeProperties() { return std::make_shared(); } - - class Properties : public ElementInterface - { - public: - Properties(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ EditorialGroup minOccurs = 1, maxOccurs = 1 _________ */ - EditorialGroupPtr getEditorialGroup() const; - void setEditorialGroup( const EditorialGroupPtr& value ); - - /* _________ Divisions minOccurs = 0, maxOccurs = 1 _________ */ - DivisionsPtr getDivisions() const; - void setDivisions( const DivisionsPtr& value ); - bool getHasDivisions() const; - void setHasDivisions( const bool value ); - - /* _________ Key minOccurs = 0, maxOccurs = unbounded _________ */ - const KeySet& getKeySet() const; - void addKey( const KeyPtr& value ); - void removeKey( const KeySetIterConst& value ); - void clearKeySet(); - KeyPtr getKey( const KeySetIterConst& setIterator ) const; - - /* _________ Time minOccurs = 0, maxOccurs = unbounded _________ */ - const TimeSet& getTimeSet() const; - void addTime( const TimePtr& value ); - void removeTime( const TimeSetIterConst& value ); - void clearTimeSet(); - TimePtr getTime( const TimeSetIterConst& setIterator ) const; - - /* _________ Staves minOccurs = 0, maxOccurs = 1 _________ */ - StavesPtr getStaves() const; - void setStaves( const StavesPtr& value ); - bool getHasStaves() const; - void setHasStaves( const bool value ); - - /* _________ PartSymbol minOccurs = 0, maxOccurs = 1 _________ */ - PartSymbolPtr getPartSymbol() const; - void setPartSymbol( const PartSymbolPtr& value ); - bool getHasPartSymbol() const; - void setHasPartSymbol( const bool value ); - - /* _________ Instruments minOccurs = 0, maxOccurs = 1 _________ */ - InstrumentsPtr getInstruments() const; - void setInstruments( const InstrumentsPtr& value ); - bool getHasInstruments() const; - void setHasInstruments( const bool value ); - - /* _________ Clef minOccurs = 0, maxOccurs = unbounded _________ */ - const ClefSet& getClefSet() const; - void addClef( const ClefPtr& value ); - void removeClef( const ClefSetIterConst& value ); - void clearClefSet(); - ClefPtr getClef( const ClefSetIterConst& setIterator ) const; - - /* _________ StaffDetails minOccurs = 0, maxOccurs = unbounded _________ */ - const StaffDetailsSet& getStaffDetailsSet() const; - void addStaffDetails( const StaffDetailsPtr& value ); - void removeStaffDetails( const StaffDetailsSetIterConst& value ); - void clearStaffDetailsSet(); - StaffDetailsPtr getStaffDetails( const StaffDetailsSetIterConst& setIterator ) const; - - /* _________ Transpose minOccurs = 0, maxOccurs = unbounded _________ */ - const TransposeSet& getTransposeSet() const; - void addTranspose( const TransposePtr& value ); - void removeTranspose( const TransposeSetIterConst& value ); - void clearTransposeSet(); - TransposePtr getTranspose( const TransposeSetIterConst& setIterator ) const; - - /* _________ Directive minOccurs = 0, maxOccurs = unbounded _________ */ - const DirectiveSet& getDirectiveSet() const; - void addDirective( const DirectivePtr& value ); - void removeDirective( const DirectiveSetIterConst& value ); - void clearDirectiveSet(); - DirectivePtr getDirective( const DirectiveSetIterConst& setIterator ) const; - - /* _________ MeasureStyle minOccurs = 0, maxOccurs = unbounded _________ */ - const MeasureStyleSet& getMeasureStyleSet() const; - void addMeasureStyle( const MeasureStylePtr& value ); - void removeMeasureStyle( const MeasureStyleSetIterConst& value ); - void clearMeasureStyleSet(); - MeasureStylePtr getMeasureStyle( const MeasureStyleSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EditorialGroupPtr myEditorialGroup; - DivisionsPtr myDivisions; - bool myHasDivisions; - KeySet myKeySet; - TimeSet myTimeSet; - StavesPtr myStaves; - bool myHasStaves; - PartSymbolPtr myPartSymbol; - bool myHasPartSymbol; - InstrumentsPtr myInstruments; - bool myHasInstruments; - ClefSet myClefSet; - StaffDetailsSet myStaffDetailsSet; - TransposeSet myTransposeSet; - DirectiveSet myDirectiveSet; - MeasureStyleSet myMeasureStyleSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PullOff.cpp b/Sourcecode/private/mx/core/elements/PullOff.cpp deleted file mode 100644 index f18966ee8..000000000 --- a/Sourcecode/private/mx/core/elements/PullOff.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PullOff.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PullOff::PullOff() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - PullOff::PullOff( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool PullOff::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool PullOff::hasContents() const - { - return true; - } - - - std::ostream& PullOff::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& PullOff::streamName( std::ostream& os ) const - { - os << "pull-off"; - return os; - } - - - std::ostream& PullOff::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PullOffAttributesPtr PullOff::getAttributes() const - { - return myAttributes; - } - - - void PullOff::setAttributes( const PullOffAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString PullOff::getValue() const - { - return myValue; - } - - - void PullOff::setValue( const XsString& value ) - { - myValue = value; - } - - - bool PullOff::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PullOff.h b/Sourcecode/private/mx/core/elements/PullOff.h deleted file mode 100644 index f5372a969..000000000 --- a/Sourcecode/private/mx/core/elements/PullOff.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/PullOffAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PullOffAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PullOff ) - - inline PullOffPtr makePullOff() { return std::make_shared(); } - inline PullOffPtr makePullOff( const XsString& value ) { return std::make_shared( value ); } - inline PullOffPtr makePullOff( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class PullOff : public ElementInterface - { - public: - PullOff(); - PullOff( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PullOffAttributesPtr getAttributes() const; - void setAttributes( const PullOffAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - PullOffAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/PullOffAttributes.cpp b/Sourcecode/private/mx/core/elements/PullOffAttributes.cpp deleted file mode 100644 index bffb05d0b..000000000 --- a/Sourcecode/private/mx/core/elements/PullOffAttributes.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/PullOffAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - PullOffAttributes::PullOffAttributes() - :type( StartStop::start ) - ,number( 1 ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasType( true ) - ,hasNumber( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool PullOffAttributes::hasValues() const - { - return hasType || - hasNumber || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& PullOffAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool PullOffAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "PullOffAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/PullOffAttributes.h b/Sourcecode/private/mx/core/elements/PullOffAttributes.h deleted file mode 100644 index d096e9243..000000000 --- a/Sourcecode/private/mx/core/elements/PullOffAttributes.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( PullOffAttributes ) - - struct PullOffAttributes : public AttributesInterface - { - public: - PullOffAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - NumberLevel number; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - const bool hasType; - bool hasNumber; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Rehearsal.cpp b/Sourcecode/private/mx/core/elements/Rehearsal.cpp deleted file mode 100644 index 594613753..000000000 --- a/Sourcecode/private/mx/core/elements/Rehearsal.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Rehearsal.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Rehearsal::Rehearsal() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Rehearsal::Rehearsal( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Rehearsal::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Rehearsal::hasContents() const - { - return true; - } - - - std::ostream& Rehearsal::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Rehearsal::streamName( std::ostream& os ) const - { - os << "rehearsal"; - return os; - } - - - std::ostream& Rehearsal::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - RehearsalAttributesPtr Rehearsal::getAttributes() const - { - return myAttributes; - } - - - void Rehearsal::setAttributes( const RehearsalAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Rehearsal::getValue() const - { - return myValue; - } - - - void Rehearsal::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Rehearsal::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Rehearsal.h b/Sourcecode/private/mx/core/elements/Rehearsal.h deleted file mode 100644 index 60304682c..000000000 --- a/Sourcecode/private/mx/core/elements/Rehearsal.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/RehearsalAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RehearsalAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Rehearsal ) - - inline RehearsalPtr makeRehearsal() { return std::make_shared(); } - inline RehearsalPtr makeRehearsal( const XsString& value ) { return std::make_shared( value ); } - inline RehearsalPtr makeRehearsal( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Rehearsal : public ElementInterface - { - public: - Rehearsal(); - Rehearsal( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RehearsalAttributesPtr getAttributes() const; - void setAttributes( const RehearsalAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - RehearsalAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/RehearsalAttributes.cpp b/Sourcecode/private/mx/core/elements/RehearsalAttributes.cpp deleted file mode 100644 index 5217fffac..000000000 --- a/Sourcecode/private/mx/core/elements/RehearsalAttributes.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/RehearsalAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - RehearsalAttributes::RehearsalAttributes() - :justify( LeftCenterRight::center ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,halign() - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lineHeight() - ,lang( XmlLang{ "it" } ) - ,space( XmlSpace::default_ ) - ,enclosure( EnclosureShape::rectangle ) - ,hasJustify( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLineHeight( false ) - ,hasLang( false ) - ,hasSpace( false ) - ,hasEnclosure( false ) - {} - - - bool RehearsalAttributes::hasValues() const - { - return hasJustify || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLineHeight || - hasLang || - hasSpace || - hasEnclosure; - } - - - std::ostream& RehearsalAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, justify, "justify", hasJustify ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lineHeight, "line-height", hasLineHeight ); - streamAttribute( os, lang, "xml:lang", hasLang ); - streamAttribute( os, space, "xml:space", hasSpace ); - streamAttribute( os, enclosure, "enclosure", hasEnclosure ); - } - return os; - } - - - bool RehearsalAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "RehearsalAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, justify, hasJustify, "justify", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineHeight, hasLineHeight, "line-height" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, space, hasSpace, "xml:space", &parseXmlSpace ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, enclosure, hasEnclosure, "enclosure", &parseEnclosureShape ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/RehearsalAttributes.h b/Sourcecode/private/mx/core/elements/RehearsalAttributes.h deleted file mode 100644 index 15bb0fd73..000000000 --- a/Sourcecode/private/mx/core/elements/RehearsalAttributes.h +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" -#include "mx/core/NumberOrNormal.h" -#include "mx/core/XmlLang.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RehearsalAttributes ) - - struct RehearsalAttributes : public AttributesInterface - { - public: - RehearsalAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - LeftCenterRight justify; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - NumberOrNormal lineHeight; - XmlLang lang; - XmlSpace space; - EnclosureShape enclosure; - bool hasJustify; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLineHeight; - bool hasLang; - bool hasSpace; - bool hasEnclosure; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Relation.cpp b/Sourcecode/private/mx/core/elements/Relation.cpp deleted file mode 100644 index 885bb92c2..000000000 --- a/Sourcecode/private/mx/core/elements/Relation.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Relation.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Relation::Relation() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Relation::Relation( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Relation::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Relation::hasContents() const - { - return true; - } - - - std::ostream& Relation::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Relation::streamName( std::ostream& os ) const - { - os << "relation"; - return os; - } - - - std::ostream& Relation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - RelationAttributesPtr Relation::getAttributes() const - { - return myAttributes; - } - - - void Relation::setAttributes( const RelationAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Relation::getValue() const - { - return myValue; - } - - - void Relation::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Relation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Relation.h b/Sourcecode/private/mx/core/elements/Relation.h deleted file mode 100644 index 4b89a9de2..000000000 --- a/Sourcecode/private/mx/core/elements/Relation.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/RelationAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RelationAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Relation ) - - inline RelationPtr makeRelation() { return std::make_shared(); } - inline RelationPtr makeRelation( const XsString& value ) { return std::make_shared( value ); } - inline RelationPtr makeRelation( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Relation : public ElementInterface - { - public: - Relation(); - Relation( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RelationAttributesPtr getAttributes() const; - void setAttributes( const RelationAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - RelationAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/RelationAttributes.cpp b/Sourcecode/private/mx/core/elements/RelationAttributes.cpp deleted file mode 100644 index 33de198bf..000000000 --- a/Sourcecode/private/mx/core/elements/RelationAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/RelationAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - RelationAttributes::RelationAttributes() - :type() - ,hasType( false ) - {} - - - bool RelationAttributes::hasValues() const - { - return hasType; - } - - - std::ostream& RelationAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool RelationAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "RelationAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type" ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/RelationAttributes.h b/Sourcecode/private/mx/core/elements/RelationAttributes.h deleted file mode 100644 index 5780692ce..000000000 --- a/Sourcecode/private/mx/core/elements/RelationAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RelationAttributes ) - - struct RelationAttributes : public AttributesInterface - { - public: - RelationAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Release.cpp b/Sourcecode/private/mx/core/elements/Release.cpp deleted file mode 100644 index e7f3fde5e..000000000 --- a/Sourcecode/private/mx/core/elements/Release.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Release.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Release::Release() : ElementInterface() {} - - - bool Release::hasAttributes() const { return false; } - - - bool Release::hasContents() const { return false; } - std::ostream& Release::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Release::streamName( std::ostream& os ) const { os << "release"; return os; } - std::ostream& Release::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool Release::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Release.h b/Sourcecode/private/mx/core/elements/Release.h deleted file mode 100644 index 154439dd2..000000000 --- a/Sourcecode/private/mx/core/elements/Release.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Release ) - - inline ReleasePtr makeRelease() { return std::make_shared(); } - - class Release : public ElementInterface - { - public: - Release(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Repeat.cpp b/Sourcecode/private/mx/core/elements/Repeat.cpp deleted file mode 100644 index deeac9bef..000000000 --- a/Sourcecode/private/mx/core/elements/Repeat.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Repeat.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Repeat::Repeat() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Repeat::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Repeat::hasContents() const { return false; } - std::ostream& Repeat::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Repeat::streamName( std::ostream& os ) const { os << "repeat"; return os; } - std::ostream& Repeat::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - RepeatAttributesPtr Repeat::getAttributes() const - { - return myAttributes; - } - - - void Repeat::setAttributes( const RepeatAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Repeat::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Repeat.h b/Sourcecode/private/mx/core/elements/Repeat.h deleted file mode 100644 index 7f697cea6..000000000 --- a/Sourcecode/private/mx/core/elements/Repeat.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/RepeatAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RepeatAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Repeat ) - - inline RepeatPtr makeRepeat() { return std::make_shared(); } - - class Repeat : public ElementInterface - { - public: - Repeat(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RepeatAttributesPtr getAttributes() const; - void setAttributes( const RepeatAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - RepeatAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/RepeatAttributes.cpp b/Sourcecode/private/mx/core/elements/RepeatAttributes.cpp deleted file mode 100644 index c3ae62638..000000000 --- a/Sourcecode/private/mx/core/elements/RepeatAttributes.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/RepeatAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - RepeatAttributes::RepeatAttributes() - :direction( BackwardForward::backward ) - ,times() - ,winged( Winged::none ) - ,hasDirection( true ) - ,hasTimes( false ) - ,hasWinged( false ) - {} - - - bool RepeatAttributes::hasValues() const - { - return hasDirection || - hasTimes || - hasWinged; - } - - - std::ostream& RepeatAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, direction, "direction", hasDirection ); - streamAttribute( os, times, "times", hasTimes ); - streamAttribute( os, winged, "winged", hasWinged ); - } - return os; - } - - - bool RepeatAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "RepeatAttributes"; - bool isSuccess = true; - bool isDirectionFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, direction, isDirectionFound, "direction", &parseBackwardForward ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, times, hasTimes, "times" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, winged, hasWinged, "winged", &parseWinged ) ) { continue; } - } - - if( !isDirectionFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/RepeatAttributes.h b/Sourcecode/private/mx/core/elements/RepeatAttributes.h deleted file mode 100644 index 2501c627f..000000000 --- a/Sourcecode/private/mx/core/elements/RepeatAttributes.h +++ /dev/null @@ -1,40 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RepeatAttributes ) - - struct RepeatAttributes : public AttributesInterface - { - public: - RepeatAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - BackwardForward direction; - NonNegativeInteger times; - Winged winged; - const bool hasDirection; - bool hasTimes; - bool hasWinged; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Rest.cpp b/Sourcecode/private/mx/core/elements/Rest.cpp deleted file mode 100644 index 6f9f445cf..000000000 --- a/Sourcecode/private/mx/core/elements/Rest.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Rest.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/DisplayStepOctaveGroup.h" -#include - -namespace mx -{ - namespace core - { - Rest::Rest() - :myAttributes( std::make_shared() ) - ,myDisplayStepOctaveGroup( makeDisplayStepOctaveGroup() ) - ,myHasDisplayStepOctaveGroup( false ) - {} - - - bool Rest::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Rest::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Rest::streamName( std::ostream& os ) const - { - os << "rest"; - return os; - } - - - bool Rest::hasContents() const - { - return myHasDisplayStepOctaveGroup; - } - - - std::ostream& Rest::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasDisplayStepOctaveGroup ) - { - os << std::endl; - myDisplayStepOctaveGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - isOneLineOnly = false; - os << std::endl; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - RestAttributesPtr Rest::getAttributes() const - { - return myAttributes; - } - - - void Rest::setAttributes( const RestAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - DisplayStepOctaveGroupPtr Rest::getDisplayStepOctaveGroup() const - { - return myDisplayStepOctaveGroup; - } - - - void Rest::setDisplayStepOctaveGroup( const DisplayStepOctaveGroupPtr& value ) - { - if ( value ) - { - myDisplayStepOctaveGroup = value; - } - } - - - bool Rest::getHasDisplayStepOctaveGroup() const - { - return myHasDisplayStepOctaveGroup; - } - - - void Rest::setHasDisplayStepOctaveGroup( const bool value ) - { - myHasDisplayStepOctaveGroup = value; - } - - - bool Rest::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto it = xelement.begin(); - auto endIter = xelement.end(); - importGroup( message, it, endIter, isSuccess, myDisplayStepOctaveGroup, myHasDisplayStepOctaveGroup ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Rest.h b/Sourcecode/private/mx/core/elements/Rest.h deleted file mode 100644 index 7d95883b5..000000000 --- a/Sourcecode/private/mx/core/elements/Rest.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/RestAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RestAttributes ) - MX_FORWARD_DECLARE_ELEMENT( DisplayStepOctaveGroup ) - MX_FORWARD_DECLARE_ELEMENT( Rest ) - - inline RestPtr makeRest() { return std::make_shared(); } - - class Rest : public ElementInterface - { - public: - Rest(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RestAttributesPtr getAttributes() const; - void setAttributes( const RestAttributesPtr& value ); - - /* _________ DisplayStepOctaveGroup minOccurs = 0, maxOccurs = 1 _________ */ - DisplayStepOctaveGroupPtr getDisplayStepOctaveGroup() const; - void setDisplayStepOctaveGroup( const DisplayStepOctaveGroupPtr& value ); - bool getHasDisplayStepOctaveGroup() const; - void setHasDisplayStepOctaveGroup( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - RestAttributesPtr myAttributes; - DisplayStepOctaveGroupPtr myDisplayStepOctaveGroup; - bool myHasDisplayStepOctaveGroup; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/RestAttributes.cpp b/Sourcecode/private/mx/core/elements/RestAttributes.cpp deleted file mode 100644 index 2fbcf6a23..000000000 --- a/Sourcecode/private/mx/core/elements/RestAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/RestAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - RestAttributes::RestAttributes() - :measure( YesNo::no ) - ,hasMeasure( false ) - {} - - - bool RestAttributes::hasValues() const - { - return hasMeasure; - } - - - std::ostream& RestAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, measure, "measure", hasMeasure ); - } - return os; - } - - - bool RestAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "RestAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, measure, hasMeasure, "measure", &parseYesNo ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/RestAttributes.h b/Sourcecode/private/mx/core/elements/RestAttributes.h deleted file mode 100644 index ca5f7f508..000000000 --- a/Sourcecode/private/mx/core/elements/RestAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RestAttributes ) - - struct RestAttributes : public AttributesInterface - { - public: - RestAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo measure; - bool hasMeasure; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/RightDivider.cpp b/Sourcecode/private/mx/core/elements/RightDivider.cpp deleted file mode 100644 index 629532189..000000000 --- a/Sourcecode/private/mx/core/elements/RightDivider.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/RightDivider.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - RightDivider::RightDivider() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool RightDivider::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool RightDivider::hasContents() const { return false; } - std::ostream& RightDivider::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& RightDivider::streamName( std::ostream& os ) const { os << "right-divider"; return os; } - std::ostream& RightDivider::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPrintObjectStyleAlignAttributesPtr RightDivider::getAttributes() const - { - return myAttributes; - } - - - void RightDivider::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool RightDivider::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/RightDivider.h b/Sourcecode/private/mx/core/elements/RightDivider.h deleted file mode 100644 index ac7810c91..000000000 --- a/Sourcecode/private/mx/core/elements/RightDivider.h +++ /dev/null @@ -1,44 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( RightDivider ) - - inline RightDividerPtr makeRightDivider() { return std::make_shared(); } - - class RightDivider : public ElementInterface - { - public: - RightDivider(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/RightMargin.cpp b/Sourcecode/private/mx/core/elements/RightMargin.cpp deleted file mode 100644 index d44e12fc6..000000000 --- a/Sourcecode/private/mx/core/elements/RightMargin.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/RightMargin.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - RightMargin::RightMargin() - :myValue() - {} - - - RightMargin::RightMargin( const TenthsValue& value ) - :myValue( value ) - {} - - - bool RightMargin::hasAttributes() const - { - return false; - } - - - bool RightMargin::hasContents() const - { - return true; - } - - - std::ostream& RightMargin::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& RightMargin::streamName( std::ostream& os ) const - { - os << "right-margin"; - return os; - } - - - std::ostream& RightMargin::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - TenthsValue RightMargin::getValue() const - { - return myValue; - } - - - void RightMargin::setValue( const TenthsValue& value ) - { - myValue = value; - } - - - bool RightMargin::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/RightMargin.h b/Sourcecode/private/mx/core/elements/RightMargin.h deleted file mode 100644 index 5271ae076..000000000 --- a/Sourcecode/private/mx/core/elements/RightMargin.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( RightMargin ) - - inline RightMarginPtr makeRightMargin() { return std::make_shared(); } - inline RightMarginPtr makeRightMargin( const TenthsValue& value ) { return std::make_shared( value ); } - inline RightMarginPtr makeRightMargin( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class RightMargin : public ElementInterface - { - public: - RightMargin(); - RightMargin( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Rights.cpp b/Sourcecode/private/mx/core/elements/Rights.cpp deleted file mode 100644 index 094655d44..000000000 --- a/Sourcecode/private/mx/core/elements/Rights.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Rights.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Rights::Rights() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Rights::Rights( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Rights::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Rights::hasContents() const - { - return true; - } - - - std::ostream& Rights::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Rights::streamName( std::ostream& os ) const - { - os << "rights"; - return os; - } - - - std::ostream& Rights::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - RightsAttributesPtr Rights::getAttributes() const - { - return myAttributes; - } - - - void Rights::setAttributes( const RightsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Rights::getValue() const - { - return myValue; - } - - - void Rights::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Rights::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Rights.h b/Sourcecode/private/mx/core/elements/Rights.h deleted file mode 100644 index 444185aab..000000000 --- a/Sourcecode/private/mx/core/elements/Rights.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/RightsAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RightsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Rights ) - - inline RightsPtr makeRights() { return std::make_shared(); } - inline RightsPtr makeRights( const XsString& value ) { return std::make_shared( value ); } - inline RightsPtr makeRights( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Rights : public ElementInterface - { - public: - Rights(); - Rights( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RightsAttributesPtr getAttributes() const; - void setAttributes( const RightsAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - RightsAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/RightsAttributes.cpp b/Sourcecode/private/mx/core/elements/RightsAttributes.cpp deleted file mode 100644 index e68fb5a7c..000000000 --- a/Sourcecode/private/mx/core/elements/RightsAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/RightsAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - RightsAttributes::RightsAttributes() - :type() - ,hasType( false ) - {} - - - bool RightsAttributes::hasValues() const - { - return hasType; - } - - - std::ostream& RightsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool RightsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "RightsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/RightsAttributes.h b/Sourcecode/private/mx/core/elements/RightsAttributes.h deleted file mode 100644 index 692da61d8..000000000 --- a/Sourcecode/private/mx/core/elements/RightsAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RightsAttributes ) - - struct RightsAttributes : public AttributesInterface - { - public: - RightsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken type; - bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Root.cpp b/Sourcecode/private/mx/core/elements/Root.cpp deleted file mode 100644 index 8e52e4c92..000000000 --- a/Sourcecode/private/mx/core/elements/Root.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Root.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/RootAlter.h" -#include "mx/core/elements/RootStep.h" -#include - -namespace mx -{ - namespace core - { - Root::Root() - :myRootStep( makeRootStep() ) - ,myRootAlter( makeRootAlter() ) - ,myHasRootAlter( false ) - {} - - - bool Root::hasAttributes() const - { - return false; - } - - - std::ostream& Root::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Root::streamName( std::ostream& os ) const - { - os << "root"; - return os; - } - - - bool Root::hasContents() const - { - return true; - } - - - std::ostream& Root::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myRootStep->toStream( os, indentLevel+1 ); - if ( myHasRootAlter ) - { - os << std::endl; - myRootAlter->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - RootStepPtr Root::getRootStep() const - { - return myRootStep; - } - - - void Root::setRootStep( const RootStepPtr& value ) - { - if( value ) - { - myRootStep = value; - } - } - - - RootAlterPtr Root::getRootAlter() const - { - return myRootAlter; - } - - - void Root::setRootAlter( const RootAlterPtr& value ) - { - if( value ) - { - myRootAlter = value; - } - } - - - bool Root::getHasRootAlter() const - { - return myHasRootAlter; - } - - - void Root::setHasRootAlter( const bool value ) - { - myHasRootAlter = value; - } - - - bool Root::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isRootStepFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myRootStep, isRootStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myRootAlter, myHasRootAlter ) ) { continue; } - } - - if( !isRootStepFound ) - { - message << "Root: '" << myRootStep->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Root.h b/Sourcecode/private/mx/core/elements/Root.h deleted file mode 100644 index 280d5c20b..000000000 --- a/Sourcecode/private/mx/core/elements/Root.h +++ /dev/null @@ -1,55 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( RootAlter ) - MX_FORWARD_DECLARE_ELEMENT( RootStep ) - MX_FORWARD_DECLARE_ELEMENT( Root ) - - inline RootPtr makeRoot() { return std::make_shared(); } - - class Root : public ElementInterface - { - public: - Root(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ RootStep minOccurs = 1, maxOccurs = 1 _________ */ - RootStepPtr getRootStep() const; - void setRootStep( const RootStepPtr& value ); - - /* _________ RootAlter minOccurs = 0, maxOccurs = 1 _________ */ - RootAlterPtr getRootAlter() const; - void setRootAlter( const RootAlterPtr& value ); - bool getHasRootAlter() const; - void setHasRootAlter( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - RootStepPtr myRootStep; - RootAlterPtr myRootAlter; - bool myHasRootAlter; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/RootAlter.cpp b/Sourcecode/private/mx/core/elements/RootAlter.cpp deleted file mode 100644 index 22027774f..000000000 --- a/Sourcecode/private/mx/core/elements/RootAlter.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/RootAlter.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - RootAlter::RootAlter() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - RootAlter::RootAlter( const Semitones& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool RootAlter::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool RootAlter::hasContents() const - { - return true; - } - - - std::ostream& RootAlter::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& RootAlter::streamName( std::ostream& os ) const - { - os << "root-alter"; - return os; - } - - - std::ostream& RootAlter::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - RootAlterAttributesPtr RootAlter::getAttributes() const - { - return myAttributes; - } - - - void RootAlter::setAttributes( const RootAlterAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - Semitones RootAlter::getValue() const - { - return myValue; - } - - - void RootAlter::setValue( const Semitones& value ) - { - myValue = value; - } - - - bool RootAlter::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/RootAlter.h b/Sourcecode/private/mx/core/elements/RootAlter.h deleted file mode 100644 index 5c58bb0bc..000000000 --- a/Sourcecode/private/mx/core/elements/RootAlter.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/elements/RootAlterAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RootAlterAttributes ) - MX_FORWARD_DECLARE_ELEMENT( RootAlter ) - - inline RootAlterPtr makeRootAlter() { return std::make_shared(); } - inline RootAlterPtr makeRootAlter( const Semitones& value ) { return std::make_shared( value ); } - inline RootAlterPtr makeRootAlter( Semitones&& value ) { return std::make_shared( std::move( value ) ); } - - class RootAlter : public ElementInterface - { - public: - RootAlter(); - RootAlter( const Semitones& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RootAlterAttributesPtr getAttributes() const; - void setAttributes( const RootAlterAttributesPtr& attributes ); - Semitones getValue() const; - void setValue( const Semitones& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Semitones myValue; - RootAlterAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/RootAlterAttributes.cpp b/Sourcecode/private/mx/core/elements/RootAlterAttributes.cpp deleted file mode 100644 index 494512873..000000000 --- a/Sourcecode/private/mx/core/elements/RootAlterAttributes.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/RootAlterAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - RootAlterAttributes::RootAlterAttributes() - :printObject() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,location() - ,hasPrintObject( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasLocation( false ) - {} - - - bool RootAlterAttributes::hasValues() const - { - return hasPrintObject || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasLocation; - } - - - std::ostream& RootAlterAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, location, "location", hasLocation ); - } - return os; - } - - - bool RootAlterAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "RootAlterAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, location, hasLocation, "location", &parseLeftRight ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/RootAlterAttributes.h b/Sourcecode/private/mx/core/elements/RootAlterAttributes.h deleted file mode 100644 index 78ed71b0c..000000000 --- a/Sourcecode/private/mx/core/elements/RootAlterAttributes.h +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RootAlterAttributes ) - - struct RootAlterAttributes : public AttributesInterface - { - public: - RootAlterAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo printObject; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftRight location; - bool hasPrintObject; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasLocation; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/RootStep.cpp b/Sourcecode/private/mx/core/elements/RootStep.cpp deleted file mode 100644 index 4ab6246db..000000000 --- a/Sourcecode/private/mx/core/elements/RootStep.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/RootStep.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - RootStep::RootStep() - :myValue( StepEnum::a ) - ,myAttributes( std::make_shared() ) - {} - - - RootStep::RootStep( const StepEnum& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool RootStep::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool RootStep::hasContents() const - { - return true; - } - - - std::ostream& RootStep::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& RootStep::streamName( std::ostream& os ) const - { - os << "root-step"; - return os; - } - - - std::ostream& RootStep::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - RootStepAttributesPtr RootStep::getAttributes() const - { - return myAttributes; - } - - - void RootStep::setAttributes( const RootStepAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - StepEnum RootStep::getValue() const - { - return myValue; - } - - - void RootStep::setValue( const StepEnum& value ) - { - myValue = value; - } - - - bool RootStep::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseStepEnum( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/RootStep.h b/Sourcecode/private/mx/core/elements/RootStep.h deleted file mode 100644 index a8af32c3a..000000000 --- a/Sourcecode/private/mx/core/elements/RootStep.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/RootStepAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RootStepAttributes ) - MX_FORWARD_DECLARE_ELEMENT( RootStep ) - - inline RootStepPtr makeRootStep() { return std::make_shared(); } - inline RootStepPtr makeRootStep( const StepEnum& value ) { return std::make_shared( value ); } - inline RootStepPtr makeRootStep( StepEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class RootStep : public ElementInterface - { - public: - RootStep(); - RootStep( const StepEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - RootStepAttributesPtr getAttributes() const; - void setAttributes( const RootStepAttributesPtr& attributes ); - StepEnum getValue() const; - void setValue( const StepEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepEnum myValue; - RootStepAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/RootStepAttributes.cpp b/Sourcecode/private/mx/core/elements/RootStepAttributes.cpp deleted file mode 100644 index 568bb3c5c..000000000 --- a/Sourcecode/private/mx/core/elements/RootStepAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/RootStepAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - RootStepAttributes::RootStepAttributes() - :text() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasText( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool RootStepAttributes::hasValues() const - { - return hasText || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& RootStepAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, text, "text", hasText ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool RootStepAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "RootStepAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, text, hasText, "text" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/RootStepAttributes.h b/Sourcecode/private/mx/core/elements/RootStepAttributes.h deleted file mode 100644 index f89704134..000000000 --- a/Sourcecode/private/mx/core/elements/RootStepAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( RootStepAttributes ) - - struct RootStepAttributes : public AttributesInterface - { - public: - RootStepAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken text; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasText; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Scaling.cpp b/Sourcecode/private/mx/core/elements/Scaling.cpp deleted file mode 100644 index 959cc20bc..000000000 --- a/Sourcecode/private/mx/core/elements/Scaling.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Scaling.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Millimeters.h" -#include "mx/core/elements/Tenths.h" -#include - -namespace mx -{ - namespace core - { - Scaling::Scaling() - :myMillimeters( makeMillimeters( MillimetersValue( 7 ) ) ) - ,myTenths( makeTenths( TenthsValue( 40 ) ) ) - {} - - - bool Scaling::hasAttributes() const - { - return false; - } - - - std::ostream& Scaling::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Scaling::streamName( std::ostream& os ) const - { - os << "scaling"; - return os; - } - - - bool Scaling::hasContents() const - { - return true; - } - - - std::ostream& Scaling::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myMillimeters->toStream( os, indentLevel+1 ); - os << std::endl; - myTenths->toStream( os, indentLevel+1 ); - os << std::endl; - isOneLineOnly = false; - return os; - } - - - MillimetersPtr Scaling::getMillimeters() const - { - return myMillimeters; - } - - - void Scaling::setMillimeters( const MillimetersPtr& value ) - { - if( value ) - { - myMillimeters = value; - } - } - - - TenthsPtr Scaling::getTenths() const - { - return myTenths; - } - - - void Scaling::setTenths( const TenthsPtr& value ) - { - if( value ) - { - myTenths = value; - } - } - - - bool Scaling::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isMillimetersFound = false; - bool isTenthsFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myMillimeters, isMillimetersFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTenths, isTenthsFound ) ) { continue; } - } - - if( !isMillimetersFound ) - { - message << "Scaling: '" << myMillimeters->getElementName() << "' is required but was not found" << std::endl; - } - if( !isTenthsFound ) - { - message << "Scaling: '" << myTenths->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Scaling.h b/Sourcecode/private/mx/core/elements/Scaling.h deleted file mode 100644 index 2b5249050..000000000 --- a/Sourcecode/private/mx/core/elements/Scaling.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Millimeters ) - MX_FORWARD_DECLARE_ELEMENT( Tenths ) - MX_FORWARD_DECLARE_ELEMENT( Scaling ) - - inline ScalingPtr makeScaling() { return std::make_shared(); } - - class Scaling : public ElementInterface - { - public: - Scaling(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Millimeters minOccurs = 1, maxOccurs = 1 _________ */ - MillimetersPtr getMillimeters() const; - void setMillimeters( const MillimetersPtr& value ); - - /* _________ Tenths minOccurs = 1, maxOccurs = 1 _________ */ - TenthsPtr getTenths() const; - void setTenths( const TenthsPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - MillimetersPtr myMillimeters; - TenthsPtr myTenths; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Schleifer.cpp b/Sourcecode/private/mx/core/elements/Schleifer.cpp deleted file mode 100644 index aa9b31421..000000000 --- a/Sourcecode/private/mx/core/elements/Schleifer.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Schleifer.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Schleifer::Schleifer() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Schleifer::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Schleifer::hasContents() const { return false; } - std::ostream& Schleifer::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Schleifer::streamName( std::ostream& os ) const { os << "schleifer"; return os; } - std::ostream& Schleifer::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr Schleifer::getAttributes() const - { - return myAttributes; - } - - - void Schleifer::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Schleifer::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Schleifer.h b/Sourcecode/private/mx/core/elements/Schleifer.h deleted file mode 100644 index 6efed5c80..000000000 --- a/Sourcecode/private/mx/core/elements/Schleifer.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Schleifer ) - - inline SchleiferPtr makeSchleifer() { return std::make_shared(); } - - class Schleifer : public ElementInterface - { - public: - Schleifer(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Scoop.cpp b/Sourcecode/private/mx/core/elements/Scoop.cpp deleted file mode 100644 index a798856e0..000000000 --- a/Sourcecode/private/mx/core/elements/Scoop.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Scoop.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Scoop::Scoop() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Scoop::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Scoop::hasContents() const { return false; } - std::ostream& Scoop::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Scoop::streamName( std::ostream& os ) const { os << "scoop"; return os; } - std::ostream& Scoop::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyLineAttributesPtr Scoop::getAttributes() const - { - return myAttributes; - } - - - void Scoop::setAttributes( const EmptyLineAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Scoop::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Scoop.h b/Sourcecode/private/mx/core/elements/Scoop.h deleted file mode 100644 index 8ac5ff8b8..000000000 --- a/Sourcecode/private/mx/core/elements/Scoop.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyLineAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyLineAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Scoop ) - - inline ScoopPtr makeScoop() { return std::make_shared(); } - - class Scoop : public ElementInterface - { - public: - Scoop(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyLineAttributesPtr getAttributes() const; - void setAttributes( const EmptyLineAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyLineAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Scordatura.cpp b/Sourcecode/private/mx/core/elements/Scordatura.cpp deleted file mode 100644 index c5359fe7f..000000000 --- a/Sourcecode/private/mx/core/elements/Scordatura.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Scordatura.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Accord.h" -#include - -namespace mx -{ - namespace core - { - Scordatura::Scordatura() - :myAccordSet() - { - myAccordSet.push_back( makeAccord() ); - } - - - bool Scordatura::hasAttributes() const - { - return false; - } - - - std::ostream& Scordatura::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Scordatura::streamName( std::ostream& os ) const - { - os << "scordatura"; - return os; - } - - - bool Scordatura::hasContents() const - { - return true; - } - - - std::ostream& Scordatura::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - for ( auto x : myAccordSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - return os; - } - - - const AccordSet& Scordatura::getAccordSet() const - { - return myAccordSet; - } - - - void Scordatura::removeAccord( const AccordSetIterConst& value ) - { - if ( value != myAccordSet.cend() ) - { - if ( myAccordSet.size() > 1 ) - { - myAccordSet.erase( value ); - } - } - } - - - void Scordatura::addAccord( const AccordPtr& value ) - { - if ( value ) - { - myAccordSet.push_back( value ); - } - } - - - void Scordatura::clearAccordSet() - { - myAccordSet.clear(); - myAccordSet.push_back( makeAccord() ); - } - - - AccordPtr Scordatura::getAccord( const AccordSetIterConst& setIterator ) const - { - if( setIterator != myAccordSet.cend() ) - { - return *setIterator; - } - return AccordPtr(); - } - - - bool Scordatura::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - importElementSet( message, it, endIter, isSuccess, "accord", myAccordSet ); - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Scordatura.h b/Sourcecode/private/mx/core/elements/Scordatura.h deleted file mode 100644 index 5bf8bb8b3..000000000 --- a/Sourcecode/private/mx/core/elements/Scordatura.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Accord ) - MX_FORWARD_DECLARE_ELEMENT( Scordatura ) - - inline ScordaturaPtr makeScordatura() { return std::make_shared(); } - - class Scordatura : public ElementInterface - { - public: - Scordatura(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Accord minOccurs = 1, maxOccurs = unbounded _________ */ - const AccordSet& getAccordSet() const; - void addAccord( const AccordPtr& value ); - void removeAccord( const AccordSetIterConst& value ); - void clearAccordSet(); - AccordPtr getAccord( const AccordSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - AccordSet myAccordSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.cpp b/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.cpp deleted file mode 100644 index 76736415f..000000000 --- a/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.cpp +++ /dev/null @@ -1,388 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ScoreHeaderGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Credit.h" -#include "mx/core/elements/Defaults.h" -#include "mx/core/elements/Identification.h" -#include "mx/core/elements/MovementNumber.h" -#include "mx/core/elements/MovementTitle.h" -#include "mx/core/elements/PartList.h" -#include "mx/core/elements/Work.h" -#include - -namespace mx -{ - namespace core - { - ScoreHeaderGroup::ScoreHeaderGroup() - :myWork( makeWork() ) - ,myHasWork( false ) - ,myMovementNumber( makeMovementNumber() ) - ,myHasMovementNumber( false ) - ,myMovementTitle( makeMovementTitle() ) - ,myHasMovementTitle( false ) - ,myIdentification( makeIdentification() ) - ,myHasIdentification( false ) - ,myDefaults( makeDefaults() ) - ,myHasDefaults( false ) - ,myCreditSet() - ,myPartList( makePartList() ) - {} - - - bool ScoreHeaderGroup::hasAttributes() const - { - return false; - } - - - std::ostream& ScoreHeaderGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& ScoreHeaderGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool ScoreHeaderGroup::hasContents() const - { - return true; - } - - - std::ostream& ScoreHeaderGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - bool isFirst = true; - if ( myHasWork ) - { - if ( !isFirst ) - { - os << std::endl; - } - myWork->toStream( os, indentLevel ); - isFirst = false; - } - if ( myHasMovementNumber ) - { - if ( !isFirst ) - { - os << std::endl; - } - myMovementNumber->toStream( os, indentLevel ); - isFirst = false; - } - if ( myHasMovementTitle ) - { - if ( !isFirst ) - { - os << std::endl; - } - myMovementTitle->toStream( os, indentLevel ); - isFirst = false; - } - if ( myHasIdentification ) - { - if ( !isFirst ) - { - os << std::endl; - } - myIdentification->toStream( os, indentLevel ); - isFirst = false; - } - if ( myHasDefaults ) - { - if ( !isFirst ) - { - os << std::endl; - } - myDefaults->toStream( os, indentLevel ); - isFirst = false; - } - for ( auto x : myCreditSet ) - { - if ( !isFirst ) - { - os << std::endl; - } - x->toStream( os, indentLevel ); - isFirst = false; - } - if ( !isFirst ) - { - os << std::endl; - } - myPartList->toStream( os, indentLevel ); - return os; - } - - - WorkPtr ScoreHeaderGroup::getWork() const - { - return myWork; - } - - - void ScoreHeaderGroup::setWork( const WorkPtr& value ) - { - if ( value ) - { - myWork = value; - } - } - - - bool ScoreHeaderGroup::getHasWork() const - { - return myHasWork; - } - - - void ScoreHeaderGroup::setHasWork( const bool value ) - { - myHasWork = value; - } - - - MovementNumberPtr ScoreHeaderGroup::getMovementNumber() const - { - return myMovementNumber; - } - - - void ScoreHeaderGroup::setMovementNumber( const MovementNumberPtr& value ) - { - if ( value ) - { - myMovementNumber = value; - } - } - - - bool ScoreHeaderGroup::getHasMovementNumber() const - { - return myHasMovementNumber; - } - - - void ScoreHeaderGroup::setHasMovementNumber( const bool value ) - { - myHasMovementNumber = value; - } - - - MovementTitlePtr ScoreHeaderGroup::getMovementTitle() const - { - return myMovementTitle; - } - - - void ScoreHeaderGroup::setMovementTitle( const MovementTitlePtr& value ) - { - if ( value ) - { - myMovementTitle = value; - } - } - - - bool ScoreHeaderGroup::getHasMovementTitle() const - { - return myHasMovementTitle; - } - - - void ScoreHeaderGroup::setHasMovementTitle( const bool value ) - { - myHasMovementTitle = value; - } - - - IdentificationPtr ScoreHeaderGroup::getIdentification() const - { - return myIdentification; - } - - - void ScoreHeaderGroup::setIdentification( const IdentificationPtr& value ) - { - if ( value ) - { - myIdentification = value; - } - } - - - bool ScoreHeaderGroup::getHasIdentification() const - { - return myHasIdentification; - } - - - void ScoreHeaderGroup::setHasIdentification( const bool value ) - { - myHasIdentification = value; - } - - - DefaultsPtr ScoreHeaderGroup::getDefaults() const - { - return myDefaults; - } - - - void ScoreHeaderGroup::setDefaults( const DefaultsPtr& value ) - { - if ( value ) - { - myDefaults = value; - } - } - - - bool ScoreHeaderGroup::getHasDefaults() const - { - return myHasDefaults; - } - - - void ScoreHeaderGroup::setHasDefaults( const bool value ) - { - myHasDefaults = value; - } - - - const CreditSet& ScoreHeaderGroup::getCreditSet() const - { - return myCreditSet; - } - - - void ScoreHeaderGroup::addCredit( const CreditPtr& value ) - { - if ( value ) - { - myCreditSet.push_back( value ); - } - } - - - void ScoreHeaderGroup::removeCredit( const CreditSetIterConst& value ) - { - if ( value != myCreditSet.cend() ) - { - myCreditSet.erase( value ); - } - } - - - void ScoreHeaderGroup::clearCreditSet() - { - myCreditSet.clear(); - } - - - CreditPtr ScoreHeaderGroup::getCredit( const CreditSetIterConst& setIterator ) const - { - if( setIterator != myCreditSet.cend() ) - { - return *setIterator; - } - return CreditPtr(); - } - - - PartListPtr ScoreHeaderGroup::getPartList() const - { - return myPartList; - } - - - void ScoreHeaderGroup::setPartList( const PartListPtr& value ) - { - if ( value ) - { - myPartList = value; - } - } - - - bool ScoreHeaderGroup::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isPartListFound = false; - bool isFirstCreditAdded = false; - for( auto it = xelement.begin(); it != xelement.end(); ++it ) - { - const std::string elementName = it->getName(); - - if( elementName == "work" ) - { - myHasWork = true; - isSuccess &= myWork->fromXElement( message, *it ); - } - else if( elementName == "movement-number" ) - { - myHasMovementNumber = true; - isSuccess &= myMovementNumber->fromXElement( message, *it ); - } - else if( elementName == "movement-title" ) - { - myHasMovementTitle = true; - isSuccess &= myMovementTitle->fromXElement( message, *it ); - } - else if( elementName == "identification" ) - { - myHasIdentification = true; - isSuccess &= myIdentification->fromXElement( message, *it ); - } - else if( elementName == "defaults" ) - { - myHasDefaults = true; - isSuccess &= myDefaults->fromXElement( message, *it ); - } - else if( elementName == "credit" ) - { - auto credit = makeCredit(); - isSuccess &= credit->fromXElement( message, *it ); - - if( !isFirstCreditAdded && myCreditSet.size() == 1 ) - { - *( myCreditSet.begin() ) = credit; - isFirstCreditAdded = true; - } - else - { - myCreditSet.push_back( credit ); - isFirstCreditAdded = true; - } - - } - else if( elementName == "part-list" ) - { - isPartListFound = true; - isSuccess &= myPartList->fromXElement( message, *it ); - } - else - { - if( !isPartListFound ) - { - message << "ScoreHeaderGroup: a 'part-list' element is required but was not found" << std::endl; - return false; - } - } - - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.h b/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.h deleted file mode 100644 index 37249356a..000000000 --- a/Sourcecode/private/mx/core/elements/ScoreHeaderGroup.h +++ /dev/null @@ -1,100 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Credit ) - MX_FORWARD_DECLARE_ELEMENT( Defaults ) - MX_FORWARD_DECLARE_ELEMENT( Identification ) - MX_FORWARD_DECLARE_ELEMENT( MovementNumber ) - MX_FORWARD_DECLARE_ELEMENT( MovementTitle ) - MX_FORWARD_DECLARE_ELEMENT( PartList ) - MX_FORWARD_DECLARE_ELEMENT( Work ) - MX_FORWARD_DECLARE_ELEMENT( ScoreHeaderGroup ) - - inline ScoreHeaderGroupPtr makeScoreHeaderGroup() { return std::make_shared(); } - - class ScoreHeaderGroup : public ElementInterface - { - public: - ScoreHeaderGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Work minOccurs = 0, maxOccurs = 1 _________ */ - WorkPtr getWork() const; - void setWork( const WorkPtr& value ); - bool getHasWork() const; - void setHasWork( const bool value ); - - /* _________ MovementNumber minOccurs = 0, maxOccurs = 1 _________ */ - MovementNumberPtr getMovementNumber() const; - void setMovementNumber( const MovementNumberPtr& value ); - bool getHasMovementNumber() const; - void setHasMovementNumber( const bool value ); - - /* _________ MovementTitle minOccurs = 0, maxOccurs = 1 _________ */ - MovementTitlePtr getMovementTitle() const; - void setMovementTitle( const MovementTitlePtr& value ); - bool getHasMovementTitle() const; - void setHasMovementTitle( const bool value ); - - /* _________ Identification minOccurs = 0, maxOccurs = 1 _________ */ - IdentificationPtr getIdentification() const; - void setIdentification( const IdentificationPtr& value ); - bool getHasIdentification() const; - void setHasIdentification( const bool value ); - - /* _________ Defaults minOccurs = 0, maxOccurs = 1 _________ */ - DefaultsPtr getDefaults() const; - void setDefaults( const DefaultsPtr& value ); - bool getHasDefaults() const; - void setHasDefaults( const bool value ); - - /* _________ Credit minOccurs = 0, maxOccurs = unbounded _________ */ - const CreditSet& getCreditSet() const; - void addCredit( const CreditPtr& value ); - void removeCredit( const CreditSetIterConst& value ); - void clearCreditSet(); - CreditPtr getCredit( const CreditSetIterConst& setIterator ) const; - - /* _________ PartList minOccurs = 1, maxOccurs = 1 _________ */ - PartListPtr getPartList() const; - void setPartList( const PartListPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - WorkPtr myWork; - bool myHasWork; - MovementNumberPtr myMovementNumber; - bool myHasMovementNumber; - MovementTitlePtr myMovementTitle; - bool myHasMovementTitle; - IdentificationPtr myIdentification; - bool myHasIdentification; - DefaultsPtr myDefaults; - bool myHasDefaults; - CreditSet myCreditSet; - PartListPtr myPartList; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ScoreInstrument.cpp b/Sourcecode/private/mx/core/elements/ScoreInstrument.cpp deleted file mode 100644 index afbd8f28b..000000000 --- a/Sourcecode/private/mx/core/elements/ScoreInstrument.cpp +++ /dev/null @@ -1,265 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ScoreInstrument.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Ensemble.h" -#include "mx/core/elements/InstrumentAbbreviation.h" -#include "mx/core/elements/InstrumentName.h" -#include "mx/core/elements/InstrumentSound.h" -#include "mx/core/elements/SoloOrEnsembleChoice.h" -#include "mx/core/elements/Solo.h" -#include "mx/core/elements/VirtualInstrument.h" -#include - -namespace mx -{ - namespace core - { - ScoreInstrument::ScoreInstrument() - :myAttributes( std::make_shared() ) - ,myInstrumentName( makeInstrumentName() ) - ,myInstrumentAbbreviation( makeInstrumentAbbreviation() ) - ,myHasInstrumentAbbreviation( false ) - ,myInstrumentSound( makeInstrumentSound() ) - ,myHasInstrumentSound( false ) - ,mySoloOrEnsembleChoice( makeSoloOrEnsembleChoice() ) - ,myHasSoloOrEnsembleChoice( false ) - ,myVirtualInstrument( makeVirtualInstrument() ) - ,myHasVirtualInstrument( false ) - {} - - - bool ScoreInstrument::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& ScoreInstrument::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& ScoreInstrument::streamName( std::ostream& os ) const - { - os << "score-instrument"; - return os; - } - - - bool ScoreInstrument::hasContents() const - { - return true; - } - - - std::ostream& ScoreInstrument::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myInstrumentName->toStream( os, indentLevel+1 ); - if ( myHasInstrumentAbbreviation ) - { - os << std::endl; - myInstrumentAbbreviation->toStream( os, indentLevel+1 ); - } - if ( myHasInstrumentSound ) - { - os << std::endl; - myInstrumentSound->toStream( os, indentLevel+1 ); - } - if ( myHasSoloOrEnsembleChoice ) - { - os << std::endl; - mySoloOrEnsembleChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - } - if ( myHasVirtualInstrument ) - { - os << std::endl; - myVirtualInstrument->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - ScoreInstrumentAttributesPtr ScoreInstrument::getAttributes() const - { - return myAttributes; - } - - - void ScoreInstrument::setAttributes( const ScoreInstrumentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - InstrumentNamePtr ScoreInstrument::getInstrumentName() const - { - return myInstrumentName; - } - - - void ScoreInstrument::setInstrumentName( const InstrumentNamePtr& value ) - { - if( value ) - { - myInstrumentName = value; - } - } - - - InstrumentAbbreviationPtr ScoreInstrument::getInstrumentAbbreviation() const - { - return myInstrumentAbbreviation; - } - - - void ScoreInstrument::setInstrumentAbbreviation( const InstrumentAbbreviationPtr& value ) - { - if( value ) - { - myInstrumentAbbreviation = value; - } - } - - - bool ScoreInstrument::getHasInstrumentAbbreviation() const - { - return myHasInstrumentAbbreviation; - } - - - void ScoreInstrument::setHasInstrumentAbbreviation( const bool value ) - { - myHasInstrumentAbbreviation = value; - } - - - InstrumentSoundPtr ScoreInstrument::getInstrumentSound() const - { - return myInstrumentSound; - } - - - void ScoreInstrument::setInstrumentSound( const InstrumentSoundPtr& value ) - { - if( value ) - { - myInstrumentSound = value; - } - } - - - bool ScoreInstrument::getHasInstrumentSound() const - { - return myHasInstrumentSound; - } - - - void ScoreInstrument::setHasInstrumentSound( const bool value ) - { - myHasInstrumentSound = value; - } - - - SoloOrEnsembleChoicePtr ScoreInstrument::getSoloOrEnsembleChoice() const - { - return mySoloOrEnsembleChoice; - } - - - void ScoreInstrument::setSoloOrEnsembleChoice( const SoloOrEnsembleChoicePtr& value ) - { - if ( value ) - { - mySoloOrEnsembleChoice = value; - } - } - - - bool ScoreInstrument::getHasSoloOrEnsembleChoice() const - { - return myHasSoloOrEnsembleChoice; - } - - - void ScoreInstrument::setHasSoloOrEnsembleChoice( const bool value ) - { - myHasSoloOrEnsembleChoice = value; - } - - - VirtualInstrumentPtr ScoreInstrument::getVirtualInstrument() const - { - return myVirtualInstrument; - } - - - void ScoreInstrument::setVirtualInstrument( const VirtualInstrumentPtr& value ) - { - if( value ) - { - myVirtualInstrument = value; - } - } - - - bool ScoreInstrument::getHasVirtualInstrument() const - { - return myHasVirtualInstrument; - } - - - void ScoreInstrument::setHasVirtualInstrument( const bool value ) - { - myHasVirtualInstrument = value; - } - - - bool ScoreInstrument::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isInstrumentNameFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myInstrumentName, isInstrumentNameFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myInstrumentAbbreviation, myHasInstrumentAbbreviation ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myInstrumentSound, myHasInstrumentSound ) ) { continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, mySoloOrEnsembleChoice, - "solo", &SoloOrEnsembleChoice::getSolo, - static_cast( SoloOrEnsembleChoice::Choice::solo ) ) ) - { myHasSoloOrEnsembleChoice = true; continue; } - - if( checkSetChoiceMember( - message, *it, isSuccess, mySoloOrEnsembleChoice, - "ensemble", &SoloOrEnsembleChoice::getEnsemble, - static_cast( SoloOrEnsembleChoice::Choice::ensemble ) ) ) - { myHasSoloOrEnsembleChoice = true; continue; } - - if ( importElement( message, *it, isSuccess, *myVirtualInstrument, myHasVirtualInstrument ) ) { continue; } - } - - if( !isInstrumentNameFound ) - { - message << "ScoreInstrument: 'instrument-name' not found" << std::endl; - isSuccess = false; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ScoreInstrument.h b/Sourcecode/private/mx/core/elements/ScoreInstrument.h deleted file mode 100644 index 1985a2b16..000000000 --- a/Sourcecode/private/mx/core/elements/ScoreInstrument.h +++ /dev/null @@ -1,87 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/ScoreInstrumentAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ScoreInstrumentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( InstrumentAbbreviation ) - MX_FORWARD_DECLARE_ELEMENT( InstrumentName ) - MX_FORWARD_DECLARE_ELEMENT( InstrumentSound ) - MX_FORWARD_DECLARE_ELEMENT( SoloOrEnsembleChoice ) - MX_FORWARD_DECLARE_ELEMENT( VirtualInstrument ) - MX_FORWARD_DECLARE_ELEMENT( ScoreInstrument ) - - inline ScoreInstrumentPtr makeScoreInstrument() { return std::make_shared(); } - - class ScoreInstrument : public ElementInterface - { - public: - ScoreInstrument(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ScoreInstrumentAttributesPtr getAttributes() const; - void setAttributes( const ScoreInstrumentAttributesPtr& value ); - - /* _________ InstrumentName minOccurs = 1, maxOccurs = 1 _________ */ - InstrumentNamePtr getInstrumentName() const; - void setInstrumentName( const InstrumentNamePtr& value ); - - /* _________ InstrumentAbbreviation minOccurs = 0, maxOccurs = 1 _________ */ - InstrumentAbbreviationPtr getInstrumentAbbreviation() const; - void setInstrumentAbbreviation( const InstrumentAbbreviationPtr& value ); - bool getHasInstrumentAbbreviation() const; - void setHasInstrumentAbbreviation( const bool value ); - - /* _________ SoloOrEnsembleChoice minOccurs = 0, maxOccurs = 1 _________ */ - SoloOrEnsembleChoicePtr getSoloOrEnsembleChoice() const; - void setSoloOrEnsembleChoice( const SoloOrEnsembleChoicePtr& value ); - bool getHasSoloOrEnsembleChoice() const; - void setHasSoloOrEnsembleChoice( const bool value ); - - /* _________ InstrumentSound minOccurs = 0, maxOccurs = 1 _________ */ - InstrumentSoundPtr getInstrumentSound() const; - void setInstrumentSound( const InstrumentSoundPtr& value ); - bool getHasInstrumentSound() const; - void setHasInstrumentSound( const bool value ); - - /* _________ VirtualInstrument minOccurs = 0, maxOccurs = 1 _________ */ - VirtualInstrumentPtr getVirtualInstrument() const; - void setVirtualInstrument( const VirtualInstrumentPtr& value ); - bool getHasVirtualInstrument() const; - void setHasVirtualInstrument( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ScoreInstrumentAttributesPtr myAttributes; - InstrumentNamePtr myInstrumentName; - InstrumentAbbreviationPtr myInstrumentAbbreviation; - bool myHasInstrumentAbbreviation; - InstrumentSoundPtr myInstrumentSound; - bool myHasInstrumentSound; - SoloOrEnsembleChoicePtr mySoloOrEnsembleChoice; - bool myHasSoloOrEnsembleChoice; - VirtualInstrumentPtr myVirtualInstrument; - bool myHasVirtualInstrument; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.cpp b/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.cpp deleted file mode 100644 index e50b9d322..000000000 --- a/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ScoreInstrumentAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ScoreInstrumentAttributes::ScoreInstrumentAttributes() - :id() - ,hasId( true ) - {} - - - bool ScoreInstrumentAttributes::hasValues() const - { - return hasId; - } - - - std::ostream& ScoreInstrumentAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - } - return os; - } - - - bool ScoreInstrumentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "ScoreInstrumentAttributes"; - bool isSuccess = true; - bool isIdFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, isIdFound, "id" ) ) { continue; } - } - - if( !isIdFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.h b/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.h deleted file mode 100644 index 0f6bb8370..000000000 --- a/Sourcecode/private/mx/core/elements/ScoreInstrumentAttributes.h +++ /dev/null @@ -1,36 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/XsID.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ScoreInstrumentAttributes ) - - struct ScoreInstrumentAttributes : public AttributesInterface - { - public: - ScoreInstrumentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsID id; - const bool hasId; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ScorePart.cpp b/Sourcecode/private/mx/core/elements/ScorePart.cpp deleted file mode 100644 index 618294cd7..000000000 --- a/Sourcecode/private/mx/core/elements/ScorePart.cpp +++ /dev/null @@ -1,447 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ScorePart.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Group.h" -#include "mx/core/elements/Identification.h" -#include "mx/core/elements/MidiDeviceInstrumentGroup.h" -#include "mx/core/elements/PartAbbreviation.h" -#include "mx/core/elements/PartAbbreviationDisplay.h" -#include "mx/core/elements/PartName.h" -#include "mx/core/elements/PartNameDisplay.h" -#include "mx/core/elements/ScoreInstrument.h" -#include "mx/core/elements/MidiDevice.h" -#include "mx/core/elements/MidiInstrument.h" -#include - -namespace mx -{ - namespace core - { - ScorePart::ScorePart() - :myAttributes( std::make_shared() ) - ,myIdentification( makeIdentification() ) - ,myHasIdentification( false ) - ,myPartName( makePartName() ) - ,myPartNameDisplay( makePartNameDisplay() ) - ,myHasPartNameDisplay( false ) - ,myPartAbbreviation( makePartAbbreviation() ) - ,myHasPartAbbreviation( false ) - ,myPartAbbreviationDisplay( makePartAbbreviationDisplay() ) - ,myHasPartAbbreviationDisplay( false ) - ,myGroupSet() - ,myScoreInstrumentSet() - ,myMidiDeviceInstrumentGroupSet() - {} - - - bool ScorePart::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& ScorePart::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& ScorePart::streamName( std::ostream& os ) const - { - os << "score-part"; - return os; - } - - - bool ScorePart::hasContents() const - { - return true; - } - - - std::ostream& ScorePart::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasIdentification ) - { - os << std::endl; - myIdentification->toStream( os, indentLevel+1 ); - } - os << std::endl; - myPartName->toStream( os, indentLevel+1 ); - if ( myHasPartNameDisplay ) - { - os << std::endl; - myPartNameDisplay->toStream( os, indentLevel+1 ); - } - if ( myHasPartAbbreviation ) - { - os << std::endl; - myPartAbbreviation->toStream( os, indentLevel+1 ); - } - if ( myHasPartAbbreviationDisplay ) - { - os << std::endl; - myPartAbbreviationDisplay->toStream( os, indentLevel+1 ); - } - for ( auto x : myGroupSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myScoreInstrumentSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - for ( auto x : myMidiDeviceInstrumentGroupSet ) - { - if ( x->hasContents() ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - } - isOneLineOnly = false; - os << std::endl; - return os; - } - - - ScorePartAttributesPtr ScorePart::getAttributes() const - { - return myAttributes; - } - - - void ScorePart::setAttributes( const ScorePartAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - IdentificationPtr ScorePart::getIdentification() const - { - return myIdentification; - } - - - void ScorePart::setIdentification( const IdentificationPtr& value ) - { - if( value ) - { - myIdentification = value; - } - } - - - bool ScorePart::getHasIdentification() const - { - return myHasIdentification; - } - - - void ScorePart::setHasIdentification( const bool value ) - { - myHasIdentification = value; - } - - - PartNamePtr ScorePart::getPartName() const - { - return myPartName; - } - - - void ScorePart::setPartName( const PartNamePtr& value ) - { - if( value ) - { - myPartName = value; - } - } - - - PartNameDisplayPtr ScorePart::getPartNameDisplay() const - { - return myPartNameDisplay; - } - - - void ScorePart::setPartNameDisplay( const PartNameDisplayPtr& value ) - { - if( value ) - { - myPartNameDisplay = value; - } - } - - - bool ScorePart::getHasPartNameDisplay() const - { - return myHasPartNameDisplay; - } - - - void ScorePart::setHasPartNameDisplay( const bool value ) - { - myHasPartNameDisplay = value; - } - - - PartAbbreviationPtr ScorePart::getPartAbbreviation() const - { - return myPartAbbreviation; - } - - - void ScorePart::setPartAbbreviation( const PartAbbreviationPtr& value ) - { - if( value ) - { - myPartAbbreviation = value; - } - } - - - bool ScorePart::getHasPartAbbreviation() const - { - return myHasPartAbbreviation; - } - - - void ScorePart::setHasPartAbbreviation( const bool value ) - { - myHasPartAbbreviation = value; - } - - - PartAbbreviationDisplayPtr ScorePart::getPartAbbreviationDisplay() const - { - return myPartAbbreviationDisplay; - } - - - void ScorePart::setPartAbbreviationDisplay( const PartAbbreviationDisplayPtr& value ) - { - if( value ) - { - myPartAbbreviationDisplay = value; - } - } - - - bool ScorePart::getHasPartAbbreviationDisplay() const - { - return myHasPartAbbreviationDisplay; - } - - - void ScorePart::setHasPartAbbreviationDisplay( const bool value ) - { - myHasPartAbbreviationDisplay = value; - } - - - const GroupSet& ScorePart::getGroupSet() const - { - return myGroupSet; - } - - - void ScorePart::removeGroup( const GroupSetIterConst& value ) - { - if ( value != myGroupSet.cend() ) - { - myGroupSet.erase( value ); - } - } - - - void ScorePart::addGroup( const GroupPtr& value ) - { - if ( value ) - { - myGroupSet.push_back( value ); - } - } - - - void ScorePart::clearGroupSet() - { - myGroupSet.clear(); - } - - - GroupPtr ScorePart::getGroup( const GroupSetIterConst& setIterator ) const - { - if( setIterator != myGroupSet.cend() ) - { - return *setIterator; - } - return GroupPtr(); - } - - - const ScoreInstrumentSet& ScorePart::getScoreInstrumentSet() const - { - return myScoreInstrumentSet; - } - - - void ScorePart::removeScoreInstrument( const ScoreInstrumentSetIterConst& value ) - { - if ( value != myScoreInstrumentSet.cend() ) - { - myScoreInstrumentSet.erase( value ); - } - } - - - void ScorePart::addScoreInstrument( const ScoreInstrumentPtr& value ) - { - if ( value ) - { - myScoreInstrumentSet.push_back( value ); - } - } - - - void ScorePart::clearScoreInstrumentSet() - { - myScoreInstrumentSet.clear(); - } - - - ScoreInstrumentPtr ScorePart::getScoreInstrument( const ScoreInstrumentSetIterConst& setIterator ) const - { - if( setIterator != myScoreInstrumentSet.cend() ) - { - return *setIterator; - } - return ScoreInstrumentPtr(); - } - - - const MidiDeviceInstrumentGroupSet& ScorePart::getMidiDeviceInstrumentGroupSet() const - { - return myMidiDeviceInstrumentGroupSet; - } - - - void ScorePart::addMidiDeviceInstrumentGroup( const MidiDeviceInstrumentGroupPtr& value ) - { - if ( value ) - { - myMidiDeviceInstrumentGroupSet.push_back( value ); - } - } - - - void ScorePart::removeMidiDeviceInstrumentGroup( const MidiDeviceInstrumentGroupSetIterConst& value ) - { - if ( value != myMidiDeviceInstrumentGroupSet.cend() ) - { - myMidiDeviceInstrumentGroupSet.erase( value ); - } - } - - - void ScorePart::clearMidiDeviceInstrumentGroupSet() - { - myMidiDeviceInstrumentGroupSet.clear(); - } - - - MidiDeviceInstrumentGroupPtr ScorePart::getMidiDeviceInstrumentGroup( const MidiDeviceInstrumentGroupSetIterConst& setIterator ) const - { - if( setIterator != myMidiDeviceInstrumentGroupSet.cend() ) - { - return *setIterator; - } - return MidiDeviceInstrumentGroupPtr(); - } - - - bool ScorePart::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - bool isPartNameFound = false; - - ::ezxml::XElementIterator end = xelement.end(); - - for( auto it = xelement.begin(); it != end; ++it ) - { - importElement( message, *it, isSuccess, *myIdentification, myHasIdentification ); - importElement( message, *it, isSuccess, *myPartName, isPartNameFound ); - importElement( message, *it, isSuccess, *myPartNameDisplay, myHasPartNameDisplay ); - importElement( message, *it, isSuccess, *myPartAbbreviation, myHasPartAbbreviation ); - importElement( message, *it, isSuccess, *myPartAbbreviationDisplay, myHasPartAbbreviationDisplay ); - importElementSet( message, it, end, isSuccess, "group", myGroupSet ); - importElementSet( message, it, end, isSuccess, "score-instrument", myScoreInstrumentSet ); - importMidiDeviceInstrumentGroupSet( message, it, end, isSuccess ); - } - - if( !isPartNameFound ) - { - message << "ScorePart: 'part-name' element is required but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - - void ScorePart::importMidiDeviceInstrumentGroupSet( std::ostream& message, ::ezxml::XElementIterator& iter, ::ezxml::XElementIterator& endIter, bool& isSuccess ) - { - bool doDecrementIter = false; - while( iter != endIter && ( iter->getName() == "midi-device" || iter->getName() == "midi-instrument" ) ) - { - auto item = makeMidiDeviceInstrumentGroup(); - if( iter->getName() == "midi-device" ) - { - item->setHasMidiDevice( true ); - auto midiDevice = item->getMidiDevice(); - isSuccess &= midiDevice->fromXElement( message, *iter ); - doDecrementIter = true; - ++iter; - } - - if( iter != endIter && iter->getName() == "midi-instrument" ) - { - item->setHasMidiInstrument( true ); - auto midiInstrument = item->getMidiInstrument(); - isSuccess &= midiInstrument->fromXElement( message, *iter ); - importGroup( message, iter, endIter, isSuccess, midiInstrument ); - doDecrementIter = true; - ++iter; - } - - if( item->getHasMidiDevice() || item->getHasMidiInstrument() ) - { - myMidiDeviceInstrumentGroupSet.push_back( item ); - } - - if( iter != endIter && iter->getName() != "midi-device" && iter->getName() != "midi-instrument" ) - { - if( doDecrementIter ) - { - --iter; - } - return; - } - } - if( doDecrementIter ) - { - --iter; - } - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ScorePart.h b/Sourcecode/private/mx/core/elements/ScorePart.h deleted file mode 100644 index 9de271cc0..000000000 --- a/Sourcecode/private/mx/core/elements/ScorePart.h +++ /dev/null @@ -1,125 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/ScorePartAttributes.h" - -#include -#include -#include - -namespace ezxml -{ - class XElementIterator; -} - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ScorePartAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Group ) - MX_FORWARD_DECLARE_ELEMENT( Identification ) - MX_FORWARD_DECLARE_ELEMENT( MidiDeviceInstrumentGroup ) - MX_FORWARD_DECLARE_ELEMENT( PartAbbreviation ) - MX_FORWARD_DECLARE_ELEMENT( PartAbbreviationDisplay ) - MX_FORWARD_DECLARE_ELEMENT( PartName ) - MX_FORWARD_DECLARE_ELEMENT( PartNameDisplay ) - MX_FORWARD_DECLARE_ELEMENT( ScoreInstrument ) - MX_FORWARD_DECLARE_ELEMENT( ScorePart ) - - inline ScorePartPtr makeScorePart() { return std::make_shared(); } - - class ScorePart : public ElementInterface - { - public: - ScorePart(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ScorePartAttributesPtr getAttributes() const; - void setAttributes( const ScorePartAttributesPtr& value ); - - /* _________ Identification minOccurs = 0, maxOccurs = 1 _________ */ - IdentificationPtr getIdentification() const; - void setIdentification( const IdentificationPtr& value ); - bool getHasIdentification() const; - void setHasIdentification( const bool value ); - - /* _________ PartName minOccurs = 1, maxOccurs = 1 _________ */ - PartNamePtr getPartName() const; - void setPartName( const PartNamePtr& value ); - - /* _________ PartNameDisplay minOccurs = 0, maxOccurs = 1 _________ */ - PartNameDisplayPtr getPartNameDisplay() const; - void setPartNameDisplay( const PartNameDisplayPtr& value ); - bool getHasPartNameDisplay() const; - void setHasPartNameDisplay( const bool value ); - - /* _________ PartAbbreviation minOccurs = 0, maxOccurs = 1 _________ */ - PartAbbreviationPtr getPartAbbreviation() const; - void setPartAbbreviation( const PartAbbreviationPtr& value ); - bool getHasPartAbbreviation() const; - void setHasPartAbbreviation( const bool value ); - - /* _________ PartAbbreviationDisplay minOccurs = 0, maxOccurs = 1 _________ */ - PartAbbreviationDisplayPtr getPartAbbreviationDisplay() const; - void setPartAbbreviationDisplay( const PartAbbreviationDisplayPtr& value ); - bool getHasPartAbbreviationDisplay() const; - void setHasPartAbbreviationDisplay( const bool value ); - - /* _________ Group minOccurs = 0, maxOccurs = unbounded _________ */ - const GroupSet& getGroupSet() const; - void addGroup( const GroupPtr& value ); - void removeGroup( const GroupSetIterConst& value ); - void clearGroupSet(); - GroupPtr getGroup( const GroupSetIterConst& setIterator ) const; - - /* _________ ScoreInstrument minOccurs = 0, maxOccurs = unbounded _________ */ - const ScoreInstrumentSet& getScoreInstrumentSet() const; - void addScoreInstrument( const ScoreInstrumentPtr& value ); - void removeScoreInstrument( const ScoreInstrumentSetIterConst& value ); - void clearScoreInstrumentSet(); - ScoreInstrumentPtr getScoreInstrument( const ScoreInstrumentSetIterConst& setIterator ) const; - - /* _________ MidiDeviceInstrumentGroup minOccurs = 0, maxOccurs = unbounded _________ */ - const MidiDeviceInstrumentGroupSet& getMidiDeviceInstrumentGroupSet() const; - void addMidiDeviceInstrumentGroup( const MidiDeviceInstrumentGroupPtr& value ); - void removeMidiDeviceInstrumentGroup( const MidiDeviceInstrumentGroupSetIterConst& value ); - void clearMidiDeviceInstrumentGroupSet(); - MidiDeviceInstrumentGroupPtr getMidiDeviceInstrumentGroup( const MidiDeviceInstrumentGroupSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ScorePartAttributesPtr myAttributes; - IdentificationPtr myIdentification; - bool myHasIdentification; - PartNamePtr myPartName; - PartNameDisplayPtr myPartNameDisplay; - bool myHasPartNameDisplay; - PartAbbreviationPtr myPartAbbreviation; - bool myHasPartAbbreviation; - PartAbbreviationDisplayPtr myPartAbbreviationDisplay; - bool myHasPartAbbreviationDisplay; - GroupSet myGroupSet; - ScoreInstrumentSet myScoreInstrumentSet; - MidiDeviceInstrumentGroupSet myMidiDeviceInstrumentGroupSet; - - void importMidiDeviceInstrumentGroupSet( - std::ostream& message, - ::ezxml::XElementIterator& iter, - ::ezxml::XElementIterator& endIter, - bool& isSuccess ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ScorePartAttributes.cpp b/Sourcecode/private/mx/core/elements/ScorePartAttributes.cpp deleted file mode 100644 index 047032beb..000000000 --- a/Sourcecode/private/mx/core/elements/ScorePartAttributes.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ScorePartAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ScorePartAttributes::ScorePartAttributes() - :id() - ,hasId( true ) - {} - - - bool ScorePartAttributes::hasValues() const - { - return hasId; - } - - - std::ostream& ScorePartAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, id, "id", hasId ); - } - return os; - } - - - bool ScorePartAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "ScorePartAttributes"; - bool isSuccess = true; - bool isIdFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, id, isIdFound, "id" ) ) { continue; } - } - - if( !isIdFound ) - { - isSuccess = false; - message << className << ": 'id' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ScorePartAttributes.h b/Sourcecode/private/mx/core/elements/ScorePartAttributes.h deleted file mode 100644 index 803f2a57d..000000000 --- a/Sourcecode/private/mx/core/elements/ScorePartAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/XsID.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ScorePartAttributes ) - - struct ScorePartAttributes : public AttributesInterface - { - public: - ScorePartAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsID id; - const bool hasId; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ScorePartwise.cpp b/Sourcecode/private/mx/core/elements/ScorePartwise.cpp deleted file mode 100644 index c10d52cdb..000000000 --- a/Sourcecode/private/mx/core/elements/ScorePartwise.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ScorePartwise.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/PartwisePart.h" -#include "mx/core/elements/ScoreHeaderGroup.h" -#include - -namespace mx -{ - namespace core - { - ScorePartwise::ScorePartwise() - :myAttributes( std::make_shared() ) - ,myScoreHeaderGroup( makeScoreHeaderGroup() ) - ,myPartwisePartSet() - { - myPartwisePartSet.push_back( makePartwisePart() ); - } - - - bool ScorePartwise::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& ScorePartwise::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& ScorePartwise::streamName( std::ostream& os ) const - { - os << "score-partwise"; - return os; - } - - - bool ScorePartwise::hasContents() const - { - return true; - } - - - std::ostream& ScorePartwise::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myScoreHeaderGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - for ( auto x : myPartwisePartSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - ScorePartwiseAttributesPtr ScorePartwise::getAttributes() const - { - return myAttributes; - } - - - void ScorePartwise::setAttributes( const ScorePartwiseAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - ScoreHeaderGroupPtr ScorePartwise::getScoreHeaderGroup() const - { - return myScoreHeaderGroup; - } - - - void ScorePartwise::setScoreHeaderGroup( const ScoreHeaderGroupPtr& value ) - { - if ( value ) - { - myScoreHeaderGroup = value; - } - } - - - const PartwisePartSet& ScorePartwise::getPartwisePartSet() const - { - return myPartwisePartSet; - } - - - void ScorePartwise::removePartwisePart( const PartwisePartSetIterConst& value ) - { - if ( value != myPartwisePartSet.cend() ) - { - if ( myPartwisePartSet.size() > 1 ) - { - myPartwisePartSet.erase( value ); - } - } - } - - - void ScorePartwise::addPartwisePart( const PartwisePartPtr& value ) - { - if ( value ) - { - myPartwisePartSet.push_back( value ); - } - } - - - void ScorePartwise::clearPartwisePartSet() - { - myPartwisePartSet.clear(); - myPartwisePartSet.push_back( makePartwisePart() ); - } - - - PartwisePartPtr ScorePartwise::getPartwisePart( const PartwisePartSetIterConst& setIterator ) const - { - if( setIterator != myPartwisePartSet.cend() ) - { - return *setIterator; - } - return PartwisePartPtr(); - } - - - bool ScorePartwise::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isFirstPartAdded = false; - - isSuccess &= myAttributes->fromXElement( message, xelement ); - isSuccess &= myScoreHeaderGroup->fromXElement( message, xelement ); - - auto it = xelement.begin(); - auto end = xelement.end(); - - for( ; it != xelement.end(); ++it ) - { - const std::string elementName = it->getName(); - - if( elementName == "work" - || elementName == "movement-number" - || elementName == "movement-title" - || elementName == "identification" - || elementName == "defaults" - || elementName == "credit" ) - { - continue; - } - else if( elementName == "part" ) - { - auto part = makePartwisePart(); - - if( !isFirstPartAdded && myPartwisePartSet.size() == 1 ) - { - *( myPartwisePartSet.begin() ) = part; - isFirstPartAdded = true; - } - else - { - myPartwisePartSet.push_back( part ); - isFirstPartAdded = true; - } - - isSuccess &= part->fromXElement( message, *it ); - } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ScorePartwise.h b/Sourcecode/private/mx/core/elements/ScorePartwise.h deleted file mode 100644 index 0fc3f2209..000000000 --- a/Sourcecode/private/mx/core/elements/ScorePartwise.h +++ /dev/null @@ -1,60 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/ScorePartwiseAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ScorePartwiseAttributes ) - MX_FORWARD_DECLARE_ELEMENT( PartwisePart ) - MX_FORWARD_DECLARE_ELEMENT( ScoreHeaderGroup ) - MX_FORWARD_DECLARE_ELEMENT( ScorePartwise ) - - inline ScorePartwisePtr makeScorePartwise() { return std::make_shared(); } - - class ScorePartwise : public ElementInterface - { - public: - ScorePartwise(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ScorePartwiseAttributesPtr getAttributes() const; - void setAttributes( const ScorePartwiseAttributesPtr& value ); - - /* _________ ScoreHeaderGroup minOccurs = 1, maxOccurs = 1 _________ */ - ScoreHeaderGroupPtr getScoreHeaderGroup() const; - void setScoreHeaderGroup( const ScoreHeaderGroupPtr& value ); - - /* _________ PartwisePart minOccurs = 1, maxOccurs = unbounded _________ */ - const PartwisePartSet& getPartwisePartSet() const; - void addPartwisePart( const PartwisePartPtr& value ); - void removePartwisePart( const PartwisePartSetIterConst& value ); - void clearPartwisePartSet(); - PartwisePartPtr getPartwisePart( const PartwisePartSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ScorePartwiseAttributesPtr myAttributes; - ScoreHeaderGroupPtr myScoreHeaderGroup; - PartwisePartSet myPartwisePartSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.cpp b/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.cpp deleted file mode 100644 index 9daad9e45..000000000 --- a/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ScorePartwiseAttributes.h" -#include "mx/core/FromXElement.h" -#include "ezxml/XElement.h" -#include "ezxml/XAttributeIterator.h" - -#include - -namespace mx -{ - namespace core - { - ScorePartwiseAttributes::ScorePartwiseAttributes() - :version( "3.0" ) - ,hasVersion( false ) - {} - - - bool ScorePartwiseAttributes::hasValues() const - { - return hasVersion; - } - - - std::ostream& ScorePartwiseAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, version, "version", hasVersion ); - } - return os; - } - - - bool ScorePartwiseAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "ScorePartwiseAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, version, hasVersion, "version" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.h b/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.h deleted file mode 100644 index e1610e54f..000000000 --- a/Sourcecode/private/mx/core/elements/ScorePartwiseAttributes.h +++ /dev/null @@ -1,34 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/AttributesInterface.h" -#include "mx/core/ForwardDeclare.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - MX_FORWARD_DECLARE_ATTRIBUTES( ScorePartwiseAttributes ) - - struct ScorePartwiseAttributes : public AttributesInterface - { - public: - ScorePartwiseAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken version; - bool hasVersion; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ScoreTimewise.cpp b/Sourcecode/private/mx/core/elements/ScoreTimewise.cpp deleted file mode 100644 index 785757ac2..000000000 --- a/Sourcecode/private/mx/core/elements/ScoreTimewise.cpp +++ /dev/null @@ -1,188 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ScoreTimewise.h" -#include "mx/core/elements/ScoreHeaderGroup.h" -#include "mx/core/elements/TimewiseMeasure.h" -#include "mx/core/FromXElement.h" -#include "ezxml/XElement.h" -#include "ezxml/XElementIterator.h" -#include - -namespace mx -{ - namespace core - { - ScoreTimewise::ScoreTimewise() - :myAttributes( std::make_shared() ) - ,myScoreHeaderGroup( makeScoreHeaderGroup() ) - ,myTimewiseMeasureSet() - { - myTimewiseMeasureSet.push_back( makeTimewiseMeasure() ); - } - - - bool ScoreTimewise::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& ScoreTimewise::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& ScoreTimewise::streamName( std::ostream& os ) const - { - os << "score-timewise"; - return os; - } - - - bool ScoreTimewise::hasContents() const - { - return true; - } - - - std::ostream& ScoreTimewise::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myScoreHeaderGroup->streamContents( os, indentLevel+1, isOneLineOnly ); - for ( auto x : myTimewiseMeasureSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - os << std::endl; - isOneLineOnly = false; - return os; - } - - - ScoreTimewiseAttributesPtr ScoreTimewise::getAttributes() const - { - return myAttributes; - } - - - void ScoreTimewise::setAttributes( const ScoreTimewiseAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - ScoreHeaderGroupPtr ScoreTimewise::getScoreHeaderGroup() const - { - return myScoreHeaderGroup; - } - - - void ScoreTimewise::setScoreHeaderGroup( const ScoreHeaderGroupPtr& value ) - { - if ( value ) - { - myScoreHeaderGroup = value; - } - } - - - const TimewiseMeasureSet& ScoreTimewise::getTimewiseMeasureSet() const - { - return myTimewiseMeasureSet; - } - - - void ScoreTimewise::removeTimewiseMeasure( const TimewiseMeasureSetIterConst& value ) - { - if ( value != myTimewiseMeasureSet.cend() ) - { - if ( myTimewiseMeasureSet.size() > 1 ) - { - myTimewiseMeasureSet.erase( value ); - } - } - } - - - void ScoreTimewise::addTimewiseMeasure( const TimewiseMeasurePtr& value ) - { - if ( value ) - { - myTimewiseMeasureSet.push_back( value ); - } - } - - - void ScoreTimewise::clearTimewiseMeasureSet() - { - myTimewiseMeasureSet.clear(); - myTimewiseMeasureSet.push_back( makeTimewiseMeasure() ); - } - - - TimewiseMeasurePtr ScoreTimewise::getTimewiseMeasure( const TimewiseMeasureSetIterConst& setIterator ) const - { - if( setIterator != myTimewiseMeasureSet.cend() ) - { - return *setIterator; - } - return TimewiseMeasurePtr(); - } - - bool ScoreTimewise::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isFirstMeasureAdded = false; - - isSuccess &= myAttributes->fromXElement( message, xelement ); - isSuccess &= myScoreHeaderGroup->fromXElement( message, xelement ); - - auto it = xelement.begin(); - auto end = xelement.end(); - - for( ; it != end; ++it ) - { - const std::string elementName = it->getName(); - - if( elementName == "work" - || elementName == "movement-number" - || elementName == "movement-title" - || elementName == "identification" - || elementName == "defaults" - || elementName == "credit" ) - { - continue; - } - else if( elementName == "measure" ) - { - auto measure = makeTimewiseMeasure(); - - if( !isFirstMeasureAdded && myTimewiseMeasureSet.size() == 1 ) - { - *( myTimewiseMeasureSet.begin() ) = measure; - isFirstMeasureAdded = true; - } - else - { - myTimewiseMeasureSet.push_back( measure ); - isFirstMeasureAdded = true; - } - - isSuccess &= measure->fromXElement( message, *it ); - } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} - - diff --git a/Sourcecode/private/mx/core/elements/ScoreTimewise.h b/Sourcecode/private/mx/core/elements/ScoreTimewise.h deleted file mode 100644 index bd8bee8c9..000000000 --- a/Sourcecode/private/mx/core/elements/ScoreTimewise.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/ScoreTimewiseAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( ScoreTimewiseAttributes ) - MX_FORWARD_DECLARE_ELEMENT( ScoreHeaderGroup ) - MX_FORWARD_DECLARE_ELEMENT( TimewiseMeasure ) - MX_FORWARD_DECLARE_ELEMENT( ScoreTimewise ) - - inline ScoreTimewisePtr makeScoreTimewise() { return std::make_shared(); } - - class ScoreTimewise : public ElementInterface - { - public: - ScoreTimewise(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ScoreTimewiseAttributesPtr getAttributes() const; - void setAttributes( const ScoreTimewiseAttributesPtr& value ); - - /* _________ ScoreHeaderGroup minOccurs = 1, maxOccurs = 1 _________ */ - ScoreHeaderGroupPtr getScoreHeaderGroup() const; - void setScoreHeaderGroup( const ScoreHeaderGroupPtr& value ); - - /* _________ TimewiseMeasure minOccurs = 1, maxOccurs = unbounded _________ */ - const TimewiseMeasureSet& getTimewiseMeasureSet() const; - void addTimewiseMeasure( const TimewiseMeasurePtr& value ); - void removeTimewiseMeasure( const TimewiseMeasureSetIterConst& value ); - void clearTimewiseMeasureSet(); - TimewiseMeasurePtr getTimewiseMeasure( const TimewiseMeasureSetIterConst& setIterator ) const; - - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ScoreTimewiseAttributesPtr myAttributes; - ScoreHeaderGroupPtr myScoreHeaderGroup; - TimewiseMeasureSet myTimewiseMeasureSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.cpp b/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.cpp deleted file mode 100644 index 502e292cb..000000000 --- a/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ScoreTimewiseAttributes.h" -#include "mx/core/FromXElement.h" -#include "ezxml/XElement.h" -#include "ezxml/XAttributeIterator.h" -#include - -namespace mx -{ - namespace core - { - ScoreTimewiseAttributes::ScoreTimewiseAttributes() - :version( "3.0" ) - ,hasVersion( false ) - {} - - - bool ScoreTimewiseAttributes::hasValues() const - { - return hasVersion; - } - - - std::ostream& ScoreTimewiseAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, version, "version", hasVersion ); - } - return os; - } - - - bool ScoreTimewiseAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "ScoreTimewiseAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, version, hasVersion, "version" ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.h b/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.h deleted file mode 100644 index 14ff64c4b..000000000 --- a/Sourcecode/private/mx/core/elements/ScoreTimewiseAttributes.h +++ /dev/null @@ -1,34 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - MX_FORWARD_DECLARE_ATTRIBUTES( ScoreTimewiseAttributes ) - - struct ScoreTimewiseAttributes : public AttributesInterface - { - public: - ScoreTimewiseAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - XsToken version; - bool hasVersion; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Segno.cpp b/Sourcecode/private/mx/core/elements/Segno.cpp deleted file mode 100644 index f9b5178f1..000000000 --- a/Sourcecode/private/mx/core/elements/Segno.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Segno.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Segno::Segno() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Segno::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Segno::hasContents() const { return false; } - std::ostream& Segno::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Segno::streamName( std::ostream& os ) const { os << "segno"; return os; } - std::ostream& Segno::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPrintObjectStyleAlignAttributesPtr Segno::getAttributes() const - { - return myAttributes; - } - - - void Segno::setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Segno::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Segno.h b/Sourcecode/private/mx/core/elements/Segno.h deleted file mode 100644 index ddc059486..000000000 --- a/Sourcecode/private/mx/core/elements/Segno.h +++ /dev/null @@ -1,44 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/EmptyPrintObjectStyleAlignAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Segno ) - - inline SegnoPtr makeSegno() { return std::make_shared(); } - - class Segno : public ElementInterface - { - public: - Segno(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPrintObjectStyleAlignAttributesPtr getAttributes() const; - void setAttributes( const EmptyPrintObjectStyleAlignAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPrintObjectStyleAlignAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SemiPitched.cpp b/Sourcecode/private/mx/core/elements/SemiPitched.cpp deleted file mode 100644 index 8e5933d2d..000000000 --- a/Sourcecode/private/mx/core/elements/SemiPitched.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SemiPitched.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SemiPitched::SemiPitched() - :myValue( SemiPitchedEnum::medium ) - {} - - - SemiPitched::SemiPitched( const SemiPitchedEnum& value ) - :myValue( value ) - {} - - - bool SemiPitched::hasAttributes() const - { - return false; - } - - - bool SemiPitched::hasContents() const - { - return true; - } - - - std::ostream& SemiPitched::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SemiPitched::streamName( std::ostream& os ) const - { - os << "semi-pitched"; - return os; - } - - - std::ostream& SemiPitched::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - SemiPitchedEnum SemiPitched::getValue() const - { - return myValue; - } - - - void SemiPitched::setValue( const SemiPitchedEnum& value ) - { - myValue = value; - } - - - bool SemiPitched::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseSemiPitchedEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SemiPitched.h b/Sourcecode/private/mx/core/elements/SemiPitched.h deleted file mode 100644 index 01b32805f..000000000 --- a/Sourcecode/private/mx/core/elements/SemiPitched.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SemiPitched ) - - inline SemiPitchedPtr makeSemiPitched() { return std::make_shared(); } - inline SemiPitchedPtr makeSemiPitched( const SemiPitchedEnum& value ) { return std::make_shared( value ); } - inline SemiPitchedPtr makeSemiPitched( SemiPitchedEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class SemiPitched : public ElementInterface - { - public: - SemiPitched(); - SemiPitched( const SemiPitchedEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SemiPitchedEnum getValue() const; - void setValue( const SemiPitchedEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SemiPitchedEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SenzaMisura.cpp b/Sourcecode/private/mx/core/elements/SenzaMisura.cpp deleted file mode 100644 index f4fe7f082..000000000 --- a/Sourcecode/private/mx/core/elements/SenzaMisura.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SenzaMisura.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SenzaMisura::SenzaMisura() - :myValue() - {} - - - SenzaMisura::SenzaMisura( const XsString& value ) - :myValue( value ) - {} - - - bool SenzaMisura::hasAttributes() const - { - return false; - } - - - bool SenzaMisura::hasContents() const - { - return true; - } - - - std::ostream& SenzaMisura::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SenzaMisura::streamName( std::ostream& os ) const - { - os << "senza-misura"; - return os; - } - - - std::ostream& SenzaMisura::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString SenzaMisura::getValue() const - { - return myValue; - } - - - void SenzaMisura::setValue( const XsString& value ) - { - myValue = value; - } - - - bool SenzaMisura::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SenzaMisura.h b/Sourcecode/private/mx/core/elements/SenzaMisura.h deleted file mode 100644 index a4785a860..000000000 --- a/Sourcecode/private/mx/core/elements/SenzaMisura.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SenzaMisura ) - - inline SenzaMisuraPtr makeSenzaMisura() { return std::make_shared(); } - inline SenzaMisuraPtr makeSenzaMisura( const XsString& value ) { return std::make_shared( value ); } - inline SenzaMisuraPtr makeSenzaMisura( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class SenzaMisura : public ElementInterface - { - public: - SenzaMisura(); - SenzaMisura( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Shake.cpp b/Sourcecode/private/mx/core/elements/Shake.cpp deleted file mode 100644 index 17bb7d589..000000000 --- a/Sourcecode/private/mx/core/elements/Shake.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Shake.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Shake::Shake() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Shake::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Shake::hasContents() const { return false; } - std::ostream& Shake::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Shake::streamName( std::ostream& os ) const { os << "shake"; return os; } - std::ostream& Shake::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyTrillSoundAttributesPtr Shake::getAttributes() const - { - return myAttributes; - } - - - void Shake::setAttributes( const EmptyTrillSoundAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Shake::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Shake.h b/Sourcecode/private/mx/core/elements/Shake.h deleted file mode 100644 index e519b4e06..000000000 --- a/Sourcecode/private/mx/core/elements/Shake.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyTrillSoundAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyTrillSoundAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Shake ) - - inline ShakePtr makeShake() { return std::make_shared(); } - - class Shake : public ElementInterface - { - public: - Shake(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyTrillSoundAttributesPtr getAttributes() const; - void setAttributes( const EmptyTrillSoundAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyTrillSoundAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Sign.cpp b/Sourcecode/private/mx/core/elements/Sign.cpp deleted file mode 100644 index 5b0134281..000000000 --- a/Sourcecode/private/mx/core/elements/Sign.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Sign.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Sign::Sign() - :myValue( ClefSign::g ) - {} - - - Sign::Sign( const ClefSign& value ) - :myValue( value ) - {} - - - bool Sign::hasAttributes() const - { - return false; - } - - - bool Sign::hasContents() const - { - return true; - } - - - std::ostream& Sign::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Sign::streamName( std::ostream& os ) const - { - os << "sign"; - return os; - } - - - std::ostream& Sign::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - ClefSign Sign::getValue() const - { - return myValue; - } - - - void Sign::setValue( const ClefSign& value ) - { - myValue = value; - } - - - bool Sign::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseClefSign( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Sign.h b/Sourcecode/private/mx/core/elements/Sign.h deleted file mode 100644 index fedf5c055..000000000 --- a/Sourcecode/private/mx/core/elements/Sign.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Sign ) - - inline SignPtr makeSign() { return std::make_shared(); } - inline SignPtr makeSign( const ClefSign& value ) { return std::make_shared( value ); } - inline SignPtr makeSign( ClefSign&& value ) { return std::make_shared( std::move( value ) ); } - - class Sign : public ElementInterface - { - public: - Sign(); - Sign( const ClefSign& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - ClefSign getValue() const; - void setValue( const ClefSign& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - ClefSign myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Slash.cpp b/Sourcecode/private/mx/core/elements/Slash.cpp deleted file mode 100644 index b731611f7..000000000 --- a/Sourcecode/private/mx/core/elements/Slash.cpp +++ /dev/null @@ -1,146 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Slash.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/SlashDot.h" -#include "mx/core/elements/SlashType.h" -#include - -namespace mx -{ - namespace core - { - Slash::Slash() - :myAttributes( std::make_shared() ) - ,mySlashType( makeSlashType() ) - ,mySlashDotSet() - {} - - - bool Slash::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Slash::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Slash::streamName( std::ostream& os ) const - { - os << "slash"; - return os; - } - - - bool Slash::hasContents() const - { - return true; - } - - - std::ostream& Slash::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - mySlashType->toStream( os, indentLevel+1 ); - for ( auto x : mySlashDotSet ) - { - if ( x ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - } - os << std::endl; - return os; - } - - - SlashAttributesPtr Slash::getAttributes() const - { - return myAttributes; - } - - - void Slash::setAttributes( const SlashAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - SlashTypePtr Slash::getSlashType() const - { - return mySlashType; - } - - - void Slash::setSlashType( const SlashTypePtr& value ) - { - if( value ) - { - mySlashType = value; - } - } - - - const SlashDotSet& Slash::getSlashDotSet() const - { - return mySlashDotSet; - } - - - void Slash::removeSlashDot( const SlashDotSetIterConst& value ) - { - if ( value != mySlashDotSet.cend() ) - { - mySlashDotSet.erase( value ); - } - } - - - void Slash::addSlashDot( const SlashDotPtr& value ) - { - if ( value ) - { - mySlashDotSet.push_back( value ); - } - } - - - void Slash::clearSlashDotSet() - { - mySlashDotSet.clear(); - } - - - bool Slash::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isSlashTypeFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *mySlashType, isSlashTypeFound ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "slash-dot", mySlashDotSet ); - } - - if( !isSlashTypeFound ) - { - message << "Slash: '" << mySlashType->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Slash.h b/Sourcecode/private/mx/core/elements/Slash.h deleted file mode 100644 index e70165a4e..000000000 --- a/Sourcecode/private/mx/core/elements/Slash.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/SlashAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SlashAttributes ) - MX_FORWARD_DECLARE_ELEMENT( SlashDot ) - MX_FORWARD_DECLARE_ELEMENT( SlashType ) - MX_FORWARD_DECLARE_ELEMENT( Slash ) - - inline SlashPtr makeSlash() { return std::make_shared(); } - - class Slash : public ElementInterface - { - public: - Slash(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SlashAttributesPtr getAttributes() const; - void setAttributes( const SlashAttributesPtr& value ); - - /* _________ SlashType minOccurs = 1, maxOccurs = 1 _________ */ - SlashTypePtr getSlashType() const; - void setSlashType( const SlashTypePtr& value ); - - /* _________ SlashDot minOccurs = 0, maxOccurs = unbounded _________ */ - const SlashDotSet& getSlashDotSet() const; - void addSlashDot( const SlashDotPtr& value ); - void removeSlashDot( const SlashDotSetIterConst& value ); - void clearSlashDotSet(); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SlashAttributesPtr myAttributes; - SlashTypePtr mySlashType; - SlashDotSet mySlashDotSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SlashAttributes.cpp b/Sourcecode/private/mx/core/elements/SlashAttributes.cpp deleted file mode 100644 index 81e75b2ed..000000000 --- a/Sourcecode/private/mx/core/elements/SlashAttributes.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SlashAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SlashAttributes::SlashAttributes() - :type( StartStop::start ) - ,useDots( YesNo::no ) - ,useStems( YesNo::no ) - ,hasType( true ) - ,hasUseDots( false ) - ,hasUseStems( false ) - {} - - - bool SlashAttributes::hasValues() const - { - return hasType || - hasUseDots || - hasUseStems; - } - - - std::ostream& SlashAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, useDots, "use-dots", hasUseDots ); - streamAttribute( os, useStems, "use-stems", hasUseStems ); - } - return os; - } - - - bool SlashAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "SlashAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, useDots, hasUseDots, "use-dots", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, useStems, hasUseStems, "use-stems", &parseYesNo ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SlashAttributes.h b/Sourcecode/private/mx/core/elements/SlashAttributes.h deleted file mode 100644 index c3956c72c..000000000 --- a/Sourcecode/private/mx/core/elements/SlashAttributes.h +++ /dev/null @@ -1,39 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SlashAttributes ) - - struct SlashAttributes : public AttributesInterface - { - public: - SlashAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - YesNo useDots; - YesNo useStems; - const bool hasType; - bool hasUseDots; - bool hasUseStems; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SlashDot.cpp b/Sourcecode/private/mx/core/elements/SlashDot.cpp deleted file mode 100644 index 8751c89cd..000000000 --- a/Sourcecode/private/mx/core/elements/SlashDot.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SlashDot.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SlashDot::SlashDot() : ElementInterface() {} - - - bool SlashDot::hasAttributes() const { return false; } - - - bool SlashDot::hasContents() const { return false; } - std::ostream& SlashDot::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& SlashDot::streamName( std::ostream& os ) const { os << "slash-dot"; return os; } - std::ostream& SlashDot::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool SlashDot::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SlashDot.h b/Sourcecode/private/mx/core/elements/SlashDot.h deleted file mode 100644 index 4d920b910..000000000 --- a/Sourcecode/private/mx/core/elements/SlashDot.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SlashDot ) - - inline SlashDotPtr makeSlashDot() { return std::make_shared(); } - - class SlashDot : public ElementInterface - { - public: - SlashDot(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SlashType.cpp b/Sourcecode/private/mx/core/elements/SlashType.cpp deleted file mode 100644 index 84135872b..000000000 --- a/Sourcecode/private/mx/core/elements/SlashType.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SlashType.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SlashType::SlashType() - :myValue( NoteTypeValue::eighth ) - {} - - - SlashType::SlashType( const NoteTypeValue& value ) - :myValue( value ) - {} - - - bool SlashType::hasAttributes() const - { - return false; - } - - - bool SlashType::hasContents() const - { - return true; - } - - - std::ostream& SlashType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SlashType::streamName( std::ostream& os ) const - { - os << "slash-type"; - return os; - } - - - std::ostream& SlashType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NoteTypeValue SlashType::getValue() const - { - return myValue; - } - - - void SlashType::setValue( const NoteTypeValue& value ) - { - myValue = value; - } - - - bool SlashType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseNoteTypeValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SlashType.h b/Sourcecode/private/mx/core/elements/SlashType.h deleted file mode 100644 index d8c120489..000000000 --- a/Sourcecode/private/mx/core/elements/SlashType.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SlashType ) - - inline SlashTypePtr makeSlashType() { return std::make_shared(); } - inline SlashTypePtr makeSlashType( const NoteTypeValue& value ) { return std::make_shared( value ); } - inline SlashTypePtr makeSlashType( NoteTypeValue&& value ) { return std::make_shared( std::move( value ) ); } - - class SlashType : public ElementInterface - { - public: - SlashType(); - SlashType( const NoteTypeValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NoteTypeValue getValue() const; - void setValue( const NoteTypeValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NoteTypeValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Slide.cpp b/Sourcecode/private/mx/core/elements/Slide.cpp deleted file mode 100644 index 718d1cba4..000000000 --- a/Sourcecode/private/mx/core/elements/Slide.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Slide.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Slide::Slide() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Slide::Slide( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Slide::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Slide::hasContents() const - { - return true; - } - - - std::ostream& Slide::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Slide::streamName( std::ostream& os ) const - { - os << "slide"; - return os; - } - - - std::ostream& Slide::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - SlideAttributesPtr Slide::getAttributes() const - { - return myAttributes; - } - - - void Slide::setAttributes( const SlideAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Slide::getValue() const - { - return myValue; - } - - - void Slide::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Slide::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Slide.h b/Sourcecode/private/mx/core/elements/Slide.h deleted file mode 100644 index 38fa90e4c..000000000 --- a/Sourcecode/private/mx/core/elements/Slide.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/SlideAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SlideAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Slide ) - - inline SlidePtr makeSlide() { return std::make_shared(); } - inline SlidePtr makeSlide( const XsString& value ) { return std::make_shared( value ); } - inline SlidePtr makeSlide( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Slide : public ElementInterface - { - public: - Slide(); - Slide( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SlideAttributesPtr getAttributes() const; - void setAttributes( const SlideAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - SlideAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SlideAttributes.cpp b/Sourcecode/private/mx/core/elements/SlideAttributes.cpp deleted file mode 100644 index 673ddc3f3..000000000 --- a/Sourcecode/private/mx/core/elements/SlideAttributes.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SlideAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SlideAttributes::SlideAttributes() - :type( StartStop::start ) - ,number( 1 ) - ,lineType( LineType::solid ) - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,accelerate() - ,beats() - ,firstBeat() - ,lastBeat() - ,hasType( true ) - ,hasNumber( false ) - ,hasLineType( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasAccelerate( false ) - ,hasBeats( false ) - ,hasFirstBeat( false ) - ,hasLastBeat( false ) - {} - - - bool SlideAttributes::hasValues() const - { - return hasType || - hasNumber || - hasLineType || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasAccelerate || - hasBeats || - hasFirstBeat || - hasLastBeat; - } - - - std::ostream& SlideAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, lineType, "line-type", hasLineType ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, accelerate, "accelerate", hasAccelerate ); - streamAttribute( os, beats, "beats", hasBeats ); - streamAttribute( os, firstBeat, "first-beat", hasFirstBeat ); - streamAttribute( os, lastBeat, "last-beat", hasLastBeat ); - } - return os; - } - - - bool SlideAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "SlideAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, firstBeat, hasFirstBeat, "first-beat" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SlideAttributes.h b/Sourcecode/private/mx/core/elements/SlideAttributes.h deleted file mode 100644 index 54e9b7a8a..000000000 --- a/Sourcecode/private/mx/core/elements/SlideAttributes.h +++ /dev/null @@ -1,71 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SlideAttributes ) - - struct SlideAttributes : public AttributesInterface - { - public: - SlideAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - NumberLevel number; - LineType lineType; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - YesNo accelerate; - TrillBeats beats; - Percent firstBeat; - Percent lastBeat; - const bool hasType; - bool hasNumber; - bool hasLineType; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasAccelerate; - bool hasBeats; - bool hasFirstBeat; - bool hasLastBeat; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Slur.cpp b/Sourcecode/private/mx/core/elements/Slur.cpp deleted file mode 100644 index b60e1e0d1..000000000 --- a/Sourcecode/private/mx/core/elements/Slur.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Slur.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Slur::Slur() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Slur::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Slur::hasContents() const { return false; } - std::ostream& Slur::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Slur::streamName( std::ostream& os ) const { os << "slur"; return os; } - std::ostream& Slur::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - SlurAttributesPtr Slur::getAttributes() const - { - return myAttributes; - } - - - void Slur::setAttributes( const SlurAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Slur::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Slur.h b/Sourcecode/private/mx/core/elements/Slur.h deleted file mode 100644 index c356bb926..000000000 --- a/Sourcecode/private/mx/core/elements/Slur.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/SlurAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SlurAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Slur ) - - inline SlurPtr makeSlur() { return std::make_shared(); } - - class Slur : public ElementInterface - { - public: - Slur(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SlurAttributesPtr getAttributes() const; - void setAttributes( const SlurAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SlurAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SlurAttributes.cpp b/Sourcecode/private/mx/core/elements/SlurAttributes.cpp deleted file mode 100644 index 47864ee9b..000000000 --- a/Sourcecode/private/mx/core/elements/SlurAttributes.cpp +++ /dev/null @@ -1,142 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SlurAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SlurAttributes::SlurAttributes() - :type( StartStopContinue::start ) - ,number( 1 ) - ,lineType( LineType::solid ) - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,placement( AboveBelow::below ) - ,orientation() - ,bezierOffset() - ,bezierOffset2() - ,bezierX() - ,bezierY() - ,bezierX2() - ,bezierY2() - ,color() - ,hasType( true ) - ,hasNumber( false ) - ,hasLineType( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasPlacement( false ) - ,hasOrientation( false ) - ,hasBezierOffset( false ) - ,hasBezierOffset2( false ) - ,hasBezierX( false ) - ,hasBezierY( false ) - ,hasBezierX2( false ) - ,hasBezierY2( false ) - ,hasColor( false ) - {} - - - bool SlurAttributes::hasValues() const - { - return hasType || - hasNumber || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasPlacement || - hasOrientation || - hasBezierOffset || - hasBezierOffset2 || - hasBezierX || - hasBezierY || - hasBezierX2 || - hasBezierY2; - } - - - std::ostream& SlurAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, lineType, "line-type", hasLineType ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, orientation, "orientation", hasOrientation ); - streamAttribute( os, bezierOffset, "bezier-offset", hasBezierOffset ); - streamAttribute( os, bezierOffset2, "bezier-offset2", hasBezierOffset2 ); - streamAttribute( os, bezierX, "bezier-x", hasBezierX ); - streamAttribute( os, bezierY, "bezier-y", hasBezierY ); - streamAttribute( os, bezierX2, "bezier-x2", hasBezierX2 ); - streamAttribute( os, bezierY2, "bezier-y2", hasBezierY2 ); - streamAttribute( os, color, "color", hasColor ); - } - return os; - } - - - bool SlurAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "SlurAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, orientation, hasOrientation, "orientation", &parseOverUnder ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierOffset, hasBezierOffset, "bezier-offset" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierOffset2, hasBezierOffset2, "bezier-offset2" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierX, hasBezierX, "bezier-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierY, hasBezierY, "bezier-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierX2, hasBezierX2, "bezier-x2" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierY2, hasBezierY2, "bezier-y2" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'type' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SlurAttributes.h b/Sourcecode/private/mx/core/elements/SlurAttributes.h deleted file mode 100644 index 29be72be6..000000000 --- a/Sourcecode/private/mx/core/elements/SlurAttributes.h +++ /dev/null @@ -1,95 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" -#include "mx/core/Color.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SlurAttributes ) - - /* - - - - - - - - - - */ - - /* - - - - - - - */ - - struct SlurAttributes : public AttributesInterface - { - public: - SlurAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - - StartStopContinue type; - NumberLevel number; - LineType lineType; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - AboveBelow placement; - OverUnder orientation; - DivisionsValue bezierOffset; - DivisionsValue bezierOffset2; - TenthsValue bezierX; - TenthsValue bezierY; - TenthsValue bezierX2; - TenthsValue bezierY2; - Color color; - - const bool hasType; - bool hasNumber; - bool hasLineType; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasPlacement; - bool hasOrientation; - bool hasBezierOffset; - bool hasBezierOffset2; - bool hasBezierX; - bool hasBezierY; - bool hasBezierX2; - bool hasBezierY2; - bool hasColor; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SnapPizzicato.cpp b/Sourcecode/private/mx/core/elements/SnapPizzicato.cpp deleted file mode 100644 index 4988439bf..000000000 --- a/Sourcecode/private/mx/core/elements/SnapPizzicato.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SnapPizzicato.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SnapPizzicato::SnapPizzicato() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool SnapPizzicato::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool SnapPizzicato::hasContents() const { return false; } - std::ostream& SnapPizzicato::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& SnapPizzicato::streamName( std::ostream& os ) const { os << "snap-pizzicato"; return os; } - std::ostream& SnapPizzicato::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr SnapPizzicato::getAttributes() const - { - return myAttributes; - } - - - void SnapPizzicato::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool SnapPizzicato::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SnapPizzicato.h b/Sourcecode/private/mx/core/elements/SnapPizzicato.h deleted file mode 100644 index 91dbce55d..000000000 --- a/Sourcecode/private/mx/core/elements/SnapPizzicato.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( SnapPizzicato ) - - inline SnapPizzicatoPtr makeSnapPizzicato() { return std::make_shared(); } - - class SnapPizzicato : public ElementInterface - { - public: - SnapPizzicato(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Software.cpp b/Sourcecode/private/mx/core/elements/Software.cpp deleted file mode 100644 index 8c3421beb..000000000 --- a/Sourcecode/private/mx/core/elements/Software.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Software.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Software::Software() - :myValue() - {} - - - Software::Software( const XsString& value ) - :myValue( value ) - {} - - - bool Software::hasAttributes() const - { - return false; - } - - - bool Software::hasContents() const - { - return true; - } - - - std::ostream& Software::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Software::streamName( std::ostream& os ) const - { - os << "software"; - return os; - } - - - std::ostream& Software::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString Software::getValue() const - { - return myValue; - } - - - void Software::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Software::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Software.h b/Sourcecode/private/mx/core/elements/Software.h deleted file mode 100644 index 4c2261dba..000000000 --- a/Sourcecode/private/mx/core/elements/Software.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Software ) - - inline SoftwarePtr makeSoftware() { return std::make_shared(); } - inline SoftwarePtr makeSoftware( const XsString& value ) { return std::make_shared( value ); } - inline SoftwarePtr makeSoftware( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Software : public ElementInterface - { - public: - Software(); - Software( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Solo.cpp b/Sourcecode/private/mx/core/elements/Solo.cpp deleted file mode 100644 index f49560a71..000000000 --- a/Sourcecode/private/mx/core/elements/Solo.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Solo.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Solo::Solo() : ElementInterface() {} - - - bool Solo::hasAttributes() const { return false; } - - - bool Solo::hasContents() const { return false; } - std::ostream& Solo::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& Solo::streamName( std::ostream& os ) const { os << "solo"; return os; } - std::ostream& Solo::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool Solo::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( xelement ); - MX_UNUSED( message ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Solo.h b/Sourcecode/private/mx/core/elements/Solo.h deleted file mode 100644 index e9c6118b8..000000000 --- a/Sourcecode/private/mx/core/elements/Solo.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Solo ) - - inline SoloPtr makeSolo() { return std::make_shared(); } - - class Solo : public ElementInterface - { - public: - Solo(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.cpp b/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.cpp deleted file mode 100644 index 3d3a3d5e0..000000000 --- a/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SoloOrEnsembleChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Ensemble.h" -#include "mx/core/elements/Solo.h" -#include - -namespace mx -{ - namespace core - { - SoloOrEnsembleChoice::SoloOrEnsembleChoice() - :myChoice( Choice::solo ) - ,mySolo( makeSolo() ) - ,myEnsemble( makeEnsemble() ) - {} - - - bool SoloOrEnsembleChoice::hasAttributes() const - { - return false; - } - - - std::ostream& SoloOrEnsembleChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SoloOrEnsembleChoice::streamName( std::ostream& os ) const - { - return os; - } - - - bool SoloOrEnsembleChoice::hasContents() const - { - return true; - } - - - std::ostream& SoloOrEnsembleChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::solo: - { - mySolo->toStream( os, indentLevel ); - } - break; - case Choice::ensemble: - { - myEnsemble->toStream( os, indentLevel ); - } - break; - default: - break; - } - isOneLineOnly = true; - return os; - } - - - SoloOrEnsembleChoice::Choice SoloOrEnsembleChoice::getChoice() const - { - return myChoice; - } - - - void SoloOrEnsembleChoice::setChoice( const SoloOrEnsembleChoice::Choice value ) - { - myChoice = value; - } - - - SoloPtr SoloOrEnsembleChoice::getSolo() const - { - return mySolo; - } - - - void SoloOrEnsembleChoice::setSolo( const SoloPtr& value ) - { - if ( value ) - { - mySolo = value; - } - } - - - EnsemblePtr SoloOrEnsembleChoice::getEnsemble() const - { - return myEnsemble; - } - - - void SoloOrEnsembleChoice::setEnsemble( const EnsemblePtr& value ) - { - if ( value ) - { - myEnsemble = value; - } - } - - - MX_FROM_XELEMENT_UNUSED( SoloOrEnsembleChoice ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.h b/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.h deleted file mode 100644 index 304edc690..000000000 --- a/Sourcecode/private/mx/core/elements/SoloOrEnsembleChoice.h +++ /dev/null @@ -1,62 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Ensemble ) - MX_FORWARD_DECLARE_ELEMENT( Solo ) - MX_FORWARD_DECLARE_ELEMENT( SoloOrEnsembleChoice ) - - inline SoloOrEnsembleChoicePtr makeSoloOrEnsembleChoice() { return std::make_shared(); } - - class SoloOrEnsembleChoice : public ElementInterface - { - public: - enum class Choice - { - solo = 1, - ensemble = 2 - }; - SoloOrEnsembleChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice _________ */ - SoloOrEnsembleChoice::Choice getChoice() const; - void setChoice( const SoloOrEnsembleChoice::Choice value ); - - /* _________ Solo minOccurs = 1, maxOccurs = 1 _________ */ - SoloPtr getSolo() const; - void setSolo( const SoloPtr& value ); - - /* _________ Ensemble minOccurs = 1, maxOccurs = 1 _________ */ - EnsemblePtr getEnsemble() const; - void setEnsemble( const EnsemblePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - SoloPtr mySolo; - EnsemblePtr myEnsemble; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Sound.cpp b/Sourcecode/private/mx/core/elements/Sound.cpp deleted file mode 100644 index eedab009a..000000000 --- a/Sourcecode/private/mx/core/elements/Sound.cpp +++ /dev/null @@ -1,195 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Sound.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/MidiDevice.h" -#include "mx/core/elements/MidiInstrument.h" -#include "mx/core/elements/Play.h" -#include - -namespace mx -{ - namespace core - { - Sound::Sound() - :myAttributes( std::make_shared() ) - ,myMidiDevice( makeMidiDevice() ) - ,myHasMidiDevice( false ) - ,myMidiInstrument( makeMidiInstrument() ) - ,myHasMidiInstrument( false ) - ,myPlay( makePlay() ) - ,myHasPlay( false ) - {} - - - bool Sound::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Sound::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Sound::streamName( std::ostream& os ) const - { - os << "sound"; - return os; - } - - - bool Sound::hasContents() const - { - return myHasMidiDevice || myHasMidiInstrument || myHasPlay; - } - - - std::ostream& Sound::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasMidiDevice ) - { - os << std::endl; - myMidiDevice->toStream( os, indentLevel+1 ); - } - if ( myMidiInstrument ) - { - os << std::endl; - myMidiInstrument->toStream( os, indentLevel+1 ); - } - if ( myHasPlay ) - { - os << std::endl; - myPlay->toStream( os, indentLevel+1 ); - } - if ( hasContents() ) - { - os << std::endl; - isOneLineOnly = false; - } - else - { - isOneLineOnly = true; - } - return os; - } - - - SoundAttributesPtr Sound::getAttributes() const - { - return myAttributes; - } - - - void Sound::setAttributes( const SoundAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - MidiDevicePtr Sound::getMidiDevice() const - { - return myMidiDevice; - } - - - void Sound::setMidiDevice( const MidiDevicePtr& value ) - { - if( value ) - { - myMidiDevice = value; - } - } - - - bool Sound::getHasMidiDevice() const - { - return myHasMidiDevice; - } - - - void Sound::setHasMidiDevice( const bool value ) - { - myHasMidiDevice = value; - } - - - MidiInstrumentPtr Sound::getMidiInstrument() const - { - return myMidiInstrument; - } - - - void Sound::setMidiInstrument( const MidiInstrumentPtr& value ) - { - if( value ) - { - myMidiInstrument = value; - } - } - - - bool Sound::getHasMidiInstrument() const - { - return myHasMidiInstrument; - } - - - void Sound::setHasMidiInstrument( const bool value ) - { - myHasMidiInstrument = value; - } - - - PlayPtr Sound::getPlay() const - { - return myPlay; - } - - - void Sound::setPlay( const PlayPtr& value ) - { - if( value ) - { - myPlay = value; - } - } - - - bool Sound::getHasPlay() const - { - return myHasPlay; - } - - - void Sound::setHasPlay( const bool value ) - { - myHasPlay = value; - } - - - bool Sound::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myMidiDevice, myHasMidiDevice ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myMidiInstrument, myHasMidiInstrument ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myPlay, myHasPlay ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Sound.h b/Sourcecode/private/mx/core/elements/Sound.h deleted file mode 100644 index b901fddfe..000000000 --- a/Sourcecode/private/mx/core/elements/Sound.h +++ /dev/null @@ -1,72 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/SoundAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SoundAttributes ) - MX_FORWARD_DECLARE_ELEMENT( MidiDevice ) - MX_FORWARD_DECLARE_ELEMENT( MidiInstrument ) - MX_FORWARD_DECLARE_ELEMENT( Play ) - MX_FORWARD_DECLARE_ELEMENT( Sound ) - - inline SoundPtr makeSound() { return std::make_shared(); } - - class Sound : public ElementInterface - { - public: - Sound(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SoundAttributesPtr getAttributes() const; - void setAttributes( const SoundAttributesPtr& value ); - - /* _________ MidiDevice minOccurs = 0, maxOccurs = 1 _________ */ - MidiDevicePtr getMidiDevice() const; - void setMidiDevice( const MidiDevicePtr& value ); - bool getHasMidiDevice() const; - void setHasMidiDevice( const bool value ); - - /* _________ MidiInstrument minOccurs = 0, maxOccurs = 1 _________ */ - MidiInstrumentPtr getMidiInstrument() const; - void setMidiInstrument( const MidiInstrumentPtr& value ); - bool getHasMidiInstrument() const; - void setHasMidiInstrument( const bool value ); - - /* _________ Play minOccurs = 0, maxOccurs = 1 _________ */ - PlayPtr getPlay() const; - void setPlay( const PlayPtr& value ); - bool getHasPlay() const; - void setHasPlay( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SoundAttributesPtr myAttributes; - MidiDevicePtr myMidiDevice; - bool myHasMidiDevice; - MidiInstrumentPtr myMidiInstrument; - bool myHasMidiInstrument; - PlayPtr myPlay; - bool myHasPlay; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SoundAttributes.cpp b/Sourcecode/private/mx/core/elements/SoundAttributes.cpp deleted file mode 100644 index 25496d81a..000000000 --- a/Sourcecode/private/mx/core/elements/SoundAttributes.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SoundAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SoundAttributes::SoundAttributes() - :tempo() - ,dynamics() - ,dacapo( YesNo::no ) - ,segno() - ,dalsegno() - ,coda() - ,tocoda() - ,divisions() - ,forwardRepeat( YesNo::no ) - ,fine() - ,timeOnly() - ,pizzicato( YesNo::no ) - ,pan() - ,elevation() - ,damperPedal() - ,softPedal() - ,sostenutoPedal() - ,hasTempo( false ) - ,hasDynamics( false ) - ,hasDacapo( false ) - ,hasSegno( false ) - ,hasDalsegno( false ) - ,hasCoda( false ) - ,hasTocoda( false ) - ,hasDivisions( false ) - ,hasForwardRepeat( false ) - ,hasFine( false ) - ,hasTimeOnly( false ) - ,hasPizzicato( false ) - ,hasPan( false ) - ,hasElevation( false ) - ,hasDamperPedal( false ) - ,hasSoftPedal( false ) - ,hasSostenutoPedal( false ) - {} - - - bool SoundAttributes::hasValues() const - { - return hasTempo || - hasDynamics || - hasDacapo || - hasSegno || - hasDalsegno || - hasCoda || - hasTocoda || - hasDivisions || - hasForwardRepeat || - hasFine || - hasTimeOnly || - hasPizzicato || - hasPan || - hasElevation || - hasDamperPedal || - hasSoftPedal || - hasSostenutoPedal; - } - - - std::ostream& SoundAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, tempo, "tempo", hasTempo ); - streamAttribute( os, dynamics, "dynamics", hasDynamics ); - streamAttribute( os, dacapo, "dacapo", hasDacapo ); - streamAttribute( os, segno, "segno", hasSegno ); - streamAttribute( os, dalsegno, "dalsegno", hasDalsegno ); - streamAttribute( os, coda, "coda", hasCoda ); - streamAttribute( os, tocoda, "tocoda", hasTocoda ); - streamAttribute( os, divisions, "divisions", hasDivisions ); - streamAttribute( os, forwardRepeat, "forward-repeat", hasForwardRepeat ); - streamAttribute( os, fine, "fine", hasFine ); - streamAttribute( os, timeOnly, "time-only", hasTimeOnly ); - streamAttribute( os, pizzicato, "pizzicato", hasPizzicato ); - streamAttribute( os, pan, "pan", hasPan ); - streamAttribute( os, elevation, "elevation", hasElevation ); - streamAttribute( os, damperPedal, "damper-pedal", hasDamperPedal ); - streamAttribute( os, softPedal, "soft-pedal", hasSoftPedal ); - streamAttribute( os, sostenutoPedal, "sostenuto-pedal", hasSostenutoPedal ); - } - return os; - } - - - bool SoundAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "SoundAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, tempo, hasTempo, "tempo" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dynamics, hasDynamics, "dynamics" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dacapo, hasDacapo, "dacapo", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, segno, hasSegno, "segno" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dalsegno, hasDalsegno, "dalsegno" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, coda, hasCoda, "coda" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, tocoda, hasTocoda, "tocoda" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, divisions, hasDivisions, "divisions" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, forwardRepeat, hasForwardRepeat, "forward-repeat", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fine, hasFine, "fine" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, timeOnly, hasTimeOnly, "time-only" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, pizzicato, hasPizzicato, "pizzicato", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, pan, hasPan, "pan" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, elevation, hasElevation, "elevation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, damperPedal, hasDamperPedal, "damper-pedal" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, softPedal, hasSoftPedal, "soft-pedal" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, sostenutoPedal, hasSostenutoPedal, "sostenuto-pedal" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SoundAttributes.h b/Sourcecode/private/mx/core/elements/SoundAttributes.h deleted file mode 100644 index 0305fd8df..000000000 --- a/Sourcecode/private/mx/core/elements/SoundAttributes.h +++ /dev/null @@ -1,71 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/TimeOnly.h" -#include "mx/core/YesNoNumber.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SoundAttributes ) - - struct SoundAttributes : public AttributesInterface - { - public: - SoundAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - NonNegativeDecimal tempo; - NonNegativeDecimal dynamics; - YesNo dacapo; - XsToken segno; - XsToken dalsegno; - XsToken coda; - XsToken tocoda; - DivisionsValue divisions; - YesNo forwardRepeat; - XsToken fine; - TimeOnly timeOnly; - YesNo pizzicato; - RotationDegrees pan; - RotationDegrees elevation; - YesNoNumber damperPedal; - YesNoNumber softPedal; - YesNoNumber sostenutoPedal; - bool hasTempo; - bool hasDynamics; - bool hasDacapo; - bool hasSegno; - bool hasDalsegno; - bool hasCoda; - bool hasTocoda; - bool hasDivisions; - bool hasForwardRepeat; - bool hasFine; - bool hasTimeOnly; - bool hasPizzicato; - bool hasPan; - bool hasElevation; - bool hasDamperPedal; - bool hasSoftPedal; - bool hasSostenutoPedal; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SoundingPitch.cpp b/Sourcecode/private/mx/core/elements/SoundingPitch.cpp deleted file mode 100644 index c3e86344f..000000000 --- a/Sourcecode/private/mx/core/elements/SoundingPitch.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SoundingPitch.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SoundingPitch::SoundingPitch() : ElementInterface() {} - - - bool SoundingPitch::hasAttributes() const { return false; } - - - bool SoundingPitch::hasContents() const { return false; } - std::ostream& SoundingPitch::streamAttributes( std::ostream& os ) const { return os; } - std::ostream& SoundingPitch::streamName( std::ostream& os ) const { os << "sounding-pitch"; return os; } - std::ostream& SoundingPitch::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - bool SoundingPitch::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SoundingPitch.h b/Sourcecode/private/mx/core/elements/SoundingPitch.h deleted file mode 100644 index c8d19a372..000000000 --- a/Sourcecode/private/mx/core/elements/SoundingPitch.h +++ /dev/null @@ -1,38 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SoundingPitch ) - - inline SoundingPitchPtr makeSoundingPitch() { return std::make_shared(); } - - class SoundingPitch : public ElementInterface - { - public: - SoundingPitch(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Source.cpp b/Sourcecode/private/mx/core/elements/Source.cpp deleted file mode 100644 index 68df179e0..000000000 --- a/Sourcecode/private/mx/core/elements/Source.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Source.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Source::Source() - :myValue() - {} - - - Source::Source( const XsString& value ) - :myValue( value ) - {} - - - bool Source::hasAttributes() const - { - return false; - } - - - bool Source::hasContents() const - { - return true; - } - - - std::ostream& Source::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Source::streamName( std::ostream& os ) const - { - os << "source"; - return os; - } - - - std::ostream& Source::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - XsString Source::getValue() const - { - return myValue; - } - - - void Source::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Source::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.setValue( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Source.h b/Sourcecode/private/mx/core/elements/Source.h deleted file mode 100644 index fbacd99dc..000000000 --- a/Sourcecode/private/mx/core/elements/Source.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Source ) - - inline SourcePtr makeSource() { return std::make_shared(); } - inline SourcePtr makeSource( const XsString& value ) { return std::make_shared( value ); } - inline SourcePtr makeSource( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Source : public ElementInterface - { - public: - Source(); - Source( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Spiccato.cpp b/Sourcecode/private/mx/core/elements/Spiccato.cpp deleted file mode 100644 index b81e1d9e8..000000000 --- a/Sourcecode/private/mx/core/elements/Spiccato.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Spiccato.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Spiccato::Spiccato() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Spiccato::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Spiccato::hasContents() const { return false; } - std::ostream& Spiccato::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Spiccato::streamName( std::ostream& os ) const { os << "spiccato"; return os; } - std::ostream& Spiccato::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr Spiccato::getAttributes() const - { - return myAttributes; - } - - - void Spiccato::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Spiccato::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Spiccato.h b/Sourcecode/private/mx/core/elements/Spiccato.h deleted file mode 100644 index eb8fbb457..000000000 --- a/Sourcecode/private/mx/core/elements/Spiccato.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Spiccato ) - - inline SpiccatoPtr makeSpiccato() { return std::make_shared(); } - - class Spiccato : public ElementInterface - { - public: - Spiccato(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Staccatissimo.cpp b/Sourcecode/private/mx/core/elements/Staccatissimo.cpp deleted file mode 100644 index 5e7f994bc..000000000 --- a/Sourcecode/private/mx/core/elements/Staccatissimo.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Staccatissimo.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Staccatissimo::Staccatissimo() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Staccatissimo::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Staccatissimo::hasContents() const { return false; } - std::ostream& Staccatissimo::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Staccatissimo::streamName( std::ostream& os ) const { os << "staccatissimo"; return os; } - std::ostream& Staccatissimo::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr Staccatissimo::getAttributes() const - { - return myAttributes; - } - - - void Staccatissimo::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Staccatissimo::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Staccatissimo.h b/Sourcecode/private/mx/core/elements/Staccatissimo.h deleted file mode 100644 index 9ce7a54cc..000000000 --- a/Sourcecode/private/mx/core/elements/Staccatissimo.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Staccatissimo ) - - inline StaccatissimoPtr makeStaccatissimo() { return std::make_shared(); } - - class Staccatissimo : public ElementInterface - { - public: - Staccatissimo(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Staccato.cpp b/Sourcecode/private/mx/core/elements/Staccato.cpp deleted file mode 100644 index 58f82be2d..000000000 --- a/Sourcecode/private/mx/core/elements/Staccato.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Staccato.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Staccato::Staccato() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Staccato::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Staccato::hasContents() const { return false; } - std::ostream& Staccato::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Staccato::streamName( std::ostream& os ) const { os << "staccato"; return os; } - std::ostream& Staccato::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr Staccato::getAttributes() const - { - return myAttributes; - } - - - void Staccato::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Staccato::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Staccato.h b/Sourcecode/private/mx/core/elements/Staccato.h deleted file mode 100644 index 238c6abd6..000000000 --- a/Sourcecode/private/mx/core/elements/Staccato.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Staccato ) - - inline StaccatoPtr makeStaccato() { return std::make_shared(); } - - class Staccato : public ElementInterface - { - public: - Staccato(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Staff.cpp b/Sourcecode/private/mx/core/elements/Staff.cpp deleted file mode 100644 index fe045eccb..000000000 --- a/Sourcecode/private/mx/core/elements/Staff.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Staff.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Staff::Staff() - :myValue() - {} - - - Staff::Staff( const PositiveInteger& value ) - :myValue( value ) - {} - - - bool Staff::hasAttributes() const - { - return false; - } - - - bool Staff::hasContents() const - { - return true; - } - - - std::ostream& Staff::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Staff::streamName( std::ostream& os ) const - { - os << "staff"; - return os; - } - - - std::ostream& Staff::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - PositiveInteger Staff::getValue() const - { - return myValue; - } - - - void Staff::setValue( const PositiveInteger& value ) - { - myValue = value; - } - - - bool Staff::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Staff.h b/Sourcecode/private/mx/core/elements/Staff.h deleted file mode 100644 index 66479e044..000000000 --- a/Sourcecode/private/mx/core/elements/Staff.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Staff ) - - inline StaffPtr makeStaff() { return std::make_shared(); } - inline StaffPtr makeStaff( const PositiveInteger& value ) { return std::make_shared( value ); } - inline StaffPtr makeStaff( PositiveInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class Staff : public ElementInterface - { - public: - Staff(); - Staff( const PositiveInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - PositiveInteger getValue() const; - void setValue( const PositiveInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - PositiveInteger myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffDetails.cpp b/Sourcecode/private/mx/core/elements/StaffDetails.cpp deleted file mode 100644 index c0f9624e7..000000000 --- a/Sourcecode/private/mx/core/elements/StaffDetails.cpp +++ /dev/null @@ -1,273 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StaffDetails.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Capo.h" -#include "mx/core/elements/StaffLines.h" -#include "mx/core/elements/StaffSize.h" -#include "mx/core/elements/StaffTuning.h" -#include "mx/core/elements/StaffType.h" -#include - -namespace mx -{ - namespace core - { - StaffDetails::StaffDetails() - :myAttributes( std::make_shared() ) - ,myStaffType( makeStaffType() ) - ,myHasStaffType( false ) - ,myStaffLines( makeStaffLines( NonNegativeInteger( 5 ) ) ) - ,myHasStaffLines( false ) - ,myStaffTuningSet() - ,myCapo( makeCapo() ) - ,myHasCapo( false ) - ,myStaffSize( makeStaffSize() ) - ,myHasStaffSize( false ) - {} - - - bool StaffDetails::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& StaffDetails::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& StaffDetails::streamName( std::ostream& os ) const - { - os << "staff-details"; - return os; - } - - - bool StaffDetails::hasContents() const - { - return myHasStaffType - || myHasStaffLines - || myStaffTuningSet.size() > 0 - || myHasCapo - || myHasStaffSize; - } - - - std::ostream& StaffDetails::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = !( myHasStaffType - || myHasStaffLines - || myStaffTuningSet.size() > 0 - || myHasCapo - || myHasStaffSize); - if ( myHasStaffType ) - { - os << std::endl; - myStaffType->toStream( os, indentLevel+1 ); - } - if ( myHasStaffLines ) - { - os << std::endl; - myStaffLines->toStream( os, indentLevel+1 ); - } - for ( auto x : myStaffTuningSet ) - { - os << std::endl; - x->toStream( os, indentLevel+1 ); - } - if ( myHasCapo ) - { - os << std::endl; - myCapo->toStream( os, indentLevel+1 ); - } - if ( myHasStaffSize ) - { - os << std::endl; - myStaffSize->toStream( os, indentLevel+1 ); - } - if( hasContents() ) - { - os << std::endl; - } - return os; - } - - - StaffDetailsAttributesPtr StaffDetails::getAttributes() const - { - return myAttributes; - } - - - void StaffDetails::setAttributes( const StaffDetailsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - StaffTypePtr StaffDetails::getStaffType() const - { - return myStaffType; - } - - - void StaffDetails::setStaffType( const StaffTypePtr& value ) - { - if( value ) - { - myStaffType = value; - } - } - - - bool StaffDetails::getHasStaffType() const - { - return myHasStaffType; - } - - - void StaffDetails::setHasStaffType( const bool value ) - { - myHasStaffType = value; - } - - - StaffLinesPtr StaffDetails::getStaffLines() const - { - return myStaffLines; - } - - - void StaffDetails::setStaffLines( const StaffLinesPtr& value ) - { - if( value ) - { - myStaffLines = value; - } - } - - - bool StaffDetails::getHasStaffLines() const - { - return myHasStaffLines; - } - - - void StaffDetails::setHasStaffLines( const bool value ) - { - myHasStaffLines = value; - } - - - const StaffTuningSet& StaffDetails::getStaffTuningSet() const - { - return myStaffTuningSet; - } - - - void StaffDetails::removeStaffTuning( const StaffTuningSetIterConst& value ) - { - if ( value != myStaffTuningSet.cend() ) - { - myStaffTuningSet.erase( value ); - } - } - - - void StaffDetails::addStaffTuning( const StaffTuningPtr& value ) - { - if ( value ) - { - myStaffTuningSet.push_back( value ); - } - } - - - void StaffDetails::clearStaffTuningSet() - { - myStaffTuningSet.clear(); - } - - - CapoPtr StaffDetails::getCapo() const - { - return myCapo; - } - - - void StaffDetails::setCapo( const CapoPtr& value ) - { - if( value ) - { - myCapo = value; - } - } - - - bool StaffDetails::getHasCapo() const - { - return myHasCapo; - } - - - void StaffDetails::setHasCapo( const bool value ) - { - myHasCapo = value; - } - - - StaffSizePtr StaffDetails::getStaffSize() const - { - return myStaffSize; - } - - - void StaffDetails::setStaffSize( const StaffSizePtr& value ) - { - if( value ) - { - myStaffSize = value; - } - } - - - bool StaffDetails::getHasStaffSize() const - { - return myHasStaffSize; - } - - - void StaffDetails::setHasStaffSize( const bool value ) - { - myHasStaffSize = value; - } - - - bool StaffDetails::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myStaffType, myHasStaffType ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myStaffLines, myHasStaffLines ) ) { continue; } - importElementSet( message, it, endIter, isSuccess, "staff-tuning", myStaffTuningSet ); - if ( importElement( message, *it, isSuccess, *myCapo, myHasCapo ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myStaffSize, myHasStaffSize ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffDetails.h b/Sourcecode/private/mx/core/elements/StaffDetails.h deleted file mode 100644 index ec60545b4..000000000 --- a/Sourcecode/private/mx/core/elements/StaffDetails.h +++ /dev/null @@ -1,91 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/StaffDetailsAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StaffDetailsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Capo ) - MX_FORWARD_DECLARE_ELEMENT( StaffLines ) - MX_FORWARD_DECLARE_ELEMENT( StaffSize ) - MX_FORWARD_DECLARE_ELEMENT( StaffTuning ) - MX_FORWARD_DECLARE_ELEMENT( StaffType ) - MX_FORWARD_DECLARE_ELEMENT( StaffDetails ) - - inline StaffDetailsPtr makeStaffDetails() { return std::make_shared(); } - - class StaffDetails : public ElementInterface - { - public: - StaffDetails(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StaffDetailsAttributesPtr getAttributes() const; - void setAttributes( const StaffDetailsAttributesPtr& value ); - - /* _________ StaffType minOccurs = 0, maxOccurs = 1 _________ */ - StaffTypePtr getStaffType() const; - void setStaffType( const StaffTypePtr& value ); - bool getHasStaffType() const; - void setHasStaffType( const bool value ); - - /* _________ StaffLines minOccurs = 0, maxOccurs = 1 _________ */ - StaffLinesPtr getStaffLines() const; - void setStaffLines( const StaffLinesPtr& value ); - bool getHasStaffLines() const; - void setHasStaffLines( const bool value ); - - /* _________ StaffTuning minOccurs = 0, maxOccurs = unbounded _________ */ - const StaffTuningSet& getStaffTuningSet() const; - void addStaffTuning( const StaffTuningPtr& value ); - void removeStaffTuning( const StaffTuningSetIterConst& value ); - bool getHasStaffTuning() const; - void setHasStaffTuning( const bool value ); - void clearStaffTuningSet(); - - /* _________ Capo minOccurs = 0, maxOccurs = 1 _________ */ - CapoPtr getCapo() const; - void setCapo( const CapoPtr& value ); - bool getHasCapo() const; - void setHasCapo( const bool value ); - - /* _________ StaffSize minOccurs = 0, maxOccurs = 1 _________ */ - StaffSizePtr getStaffSize() const; - void setStaffSize( const StaffSizePtr& value ); - bool getHasStaffSize() const; - void setHasStaffSize( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StaffDetailsAttributesPtr myAttributes; - StaffTypePtr myStaffType; - bool myHasStaffType; - StaffLinesPtr myStaffLines; - bool myHasStaffLines; - StaffTuningSet myStaffTuningSet; - CapoPtr myCapo; - bool myHasCapo; - StaffSizePtr myStaffSize; - bool myHasStaffSize; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.cpp b/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.cpp deleted file mode 100644 index d7b215dce..000000000 --- a/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StaffDetailsAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StaffDetailsAttributes::StaffDetailsAttributes() - :number() - ,showFrets( ShowFrets::numbers ) - ,printObject( YesNo::no ) - ,printSpacing( YesNo::no ) - ,hasNumber( false ) - ,hasShowFrets( false ) - ,hasPrintObject( false ) - ,hasPrintSpacing( false ) - {} - - - bool StaffDetailsAttributes::hasValues() const - { - return hasNumber || - hasShowFrets || - hasPrintObject || - hasPrintSpacing; - } - - - std::ostream& StaffDetailsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, showFrets, "show-frets", hasShowFrets ); - streamAttribute( os, printObject, "print-object", hasPrintObject ); - streamAttribute( os, printSpacing, "print-spacing", hasPrintSpacing ); - } - return os; - } - - - bool StaffDetailsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "StaffDetailsAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, showFrets, hasShowFrets, "show-frets", &parseShowFrets ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printObject, hasPrintObject, "print-object", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, printSpacing, hasPrintSpacing, "print-spacing", &parseYesNo ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.h b/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.h deleted file mode 100644 index 2fee30e3e..000000000 --- a/Sourcecode/private/mx/core/elements/StaffDetailsAttributes.h +++ /dev/null @@ -1,42 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StaffDetailsAttributes ) - - struct StaffDetailsAttributes : public AttributesInterface - { - public: - StaffDetailsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffNumber number; - ShowFrets showFrets; - YesNo printObject; - YesNo printSpacing; - bool hasNumber; - bool hasShowFrets; - bool hasPrintObject; - bool hasPrintSpacing; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffDistance.cpp b/Sourcecode/private/mx/core/elements/StaffDistance.cpp deleted file mode 100644 index c23d022f1..000000000 --- a/Sourcecode/private/mx/core/elements/StaffDistance.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StaffDistance.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StaffDistance::StaffDistance() - :myValue() - {} - - - StaffDistance::StaffDistance( const TenthsValue& value ) - :myValue( value ) - {} - - - bool StaffDistance::hasAttributes() const - { - return false; - } - - - bool StaffDistance::hasContents() const - { - return true; - } - - - std::ostream& StaffDistance::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StaffDistance::streamName( std::ostream& os ) const - { - os << "staff-distance"; - return os; - } - - - std::ostream& StaffDistance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - TenthsValue StaffDistance::getValue() const - { - return myValue; - } - - - void StaffDistance::setValue( const TenthsValue& value ) - { - myValue = value; - } - - - bool StaffDistance::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffDistance.h b/Sourcecode/private/mx/core/elements/StaffDistance.h deleted file mode 100644 index 11af07bb1..000000000 --- a/Sourcecode/private/mx/core/elements/StaffDistance.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StaffDistance ) - - inline StaffDistancePtr makeStaffDistance() { return std::make_shared(); } - inline StaffDistancePtr makeStaffDistance( const TenthsValue& value ) { return std::make_shared( value ); } - inline StaffDistancePtr makeStaffDistance( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class StaffDistance : public ElementInterface - { - public: - StaffDistance(); - StaffDistance( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffLayout.cpp b/Sourcecode/private/mx/core/elements/StaffLayout.cpp deleted file mode 100644 index 1b7fd99d4..000000000 --- a/Sourcecode/private/mx/core/elements/StaffLayout.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StaffLayout.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/StaffDistance.h" -#include - -namespace mx -{ - namespace core - { - StaffLayout::StaffLayout() - :myAttributes( std::make_shared() ) - ,myStaffDistance( makeStaffDistance() ) - ,myHasStaffDistance( false ) - {} - - - bool StaffLayout::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& StaffLayout::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& StaffLayout::streamName( std::ostream& os ) const - { - os << "staff-layout"; - return os; - } - - - bool StaffLayout::hasContents() const - { - return myHasStaffDistance; - } - - - std::ostream& StaffLayout::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasStaffDistance ) - { - os << std::endl; - myStaffDistance->toStream( os, indentLevel+1 ); - } - isOneLineOnly = ! hasContents(); - if ( ! isOneLineOnly ) - { - os << std::endl; - } - return os; - } - - - StaffLayoutAttributesPtr StaffLayout::getAttributes() const - { - return myAttributes; - } - - - void StaffLayout::setAttributes( const StaffLayoutAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - StaffDistancePtr StaffLayout::getStaffDistance() const - { - return myStaffDistance; - } - - - void StaffLayout::setStaffDistance( const StaffDistancePtr& value ) - { - if( value ) - { - myStaffDistance = value; - } - } - - - bool StaffLayout::getHasStaffDistance() const - { - return myHasStaffDistance; - } - - - void StaffLayout::setHasStaffDistance( const bool value ) - { - myHasStaffDistance = value; - } - - - bool StaffLayout::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myStaffDistance, myHasStaffDistance ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffLayout.h b/Sourcecode/private/mx/core/elements/StaffLayout.h deleted file mode 100644 index c03995394..000000000 --- a/Sourcecode/private/mx/core/elements/StaffLayout.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/StaffLayoutAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StaffLayoutAttributes ) - MX_FORWARD_DECLARE_ELEMENT( StaffDistance ) - MX_FORWARD_DECLARE_ELEMENT( StaffLayout ) - - inline StaffLayoutPtr makeStaffLayout() { return std::make_shared(); } - - class StaffLayout : public ElementInterface - { - public: - StaffLayout(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StaffLayoutAttributesPtr getAttributes() const; - void setAttributes( const StaffLayoutAttributesPtr& value ); - - /* _________ StaffDistance minOccurs = 0, maxOccurs = 1 _________ */ - StaffDistancePtr getStaffDistance() const; - void setStaffDistance( const StaffDistancePtr& value ); - bool getHasStaffDistance() const; - void setHasStaffDistance( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StaffLayoutAttributesPtr myAttributes; - StaffDistancePtr myStaffDistance; - bool myHasStaffDistance; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.cpp b/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.cpp deleted file mode 100644 index 2b40aea8a..000000000 --- a/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StaffLayoutAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StaffLayoutAttributes::StaffLayoutAttributes() - :number() - ,hasNumber( false ) - {} - - - bool StaffLayoutAttributes::hasValues() const - { - return hasNumber; - } - - - std::ostream& StaffLayoutAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, number, "number", hasNumber ); - } - return os; - } - - - bool StaffLayoutAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "StaffLayoutAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.h b/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.h deleted file mode 100644 index f291be90f..000000000 --- a/Sourcecode/private/mx/core/elements/StaffLayoutAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StaffLayoutAttributes ) - - struct StaffLayoutAttributes : public AttributesInterface - { - public: - StaffLayoutAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffNumber number; - bool hasNumber; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffLines.cpp b/Sourcecode/private/mx/core/elements/StaffLines.cpp deleted file mode 100644 index 253276a1d..000000000 --- a/Sourcecode/private/mx/core/elements/StaffLines.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StaffLines.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StaffLines::StaffLines() - :myValue() - {} - - - StaffLines::StaffLines( const NonNegativeInteger& value ) - :myValue( value ) - {} - - - bool StaffLines::hasAttributes() const - { - return false; - } - - - bool StaffLines::hasContents() const - { - return true; - } - - - std::ostream& StaffLines::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StaffLines::streamName( std::ostream& os ) const - { - os << "staff-lines"; - return os; - } - - - std::ostream& StaffLines::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NonNegativeInteger StaffLines::getValue() const - { - return myValue; - } - - - void StaffLines::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } - - - bool StaffLines::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffLines.h b/Sourcecode/private/mx/core/elements/StaffLines.h deleted file mode 100644 index 611f6b2c8..000000000 --- a/Sourcecode/private/mx/core/elements/StaffLines.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StaffLines ) - - inline StaffLinesPtr makeStaffLines() { return std::make_shared(); } - inline StaffLinesPtr makeStaffLines( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline StaffLinesPtr makeStaffLines( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class StaffLines : public ElementInterface - { - public: - StaffLines(); - StaffLines( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffSize.cpp b/Sourcecode/private/mx/core/elements/StaffSize.cpp deleted file mode 100644 index 64e39ca15..000000000 --- a/Sourcecode/private/mx/core/elements/StaffSize.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StaffSize.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StaffSize::StaffSize() - :myValue() - {} - - - StaffSize::StaffSize( const NonNegativeDecimal& value ) - :myValue( value ) - {} - - - bool StaffSize::hasAttributes() const - { - return false; - } - - - bool StaffSize::hasContents() const - { - return true; - } - - - std::ostream& StaffSize::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StaffSize::streamName( std::ostream& os ) const - { - os << "staff-size"; - return os; - } - - - std::ostream& StaffSize::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NonNegativeDecimal StaffSize::getValue() const - { - return myValue; - } - - - void StaffSize::setValue( const NonNegativeDecimal& value ) - { - myValue = value; - } - - - bool StaffSize::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffSize.h b/Sourcecode/private/mx/core/elements/StaffSize.h deleted file mode 100644 index bcb6f9848..000000000 --- a/Sourcecode/private/mx/core/elements/StaffSize.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StaffSize ) - - inline StaffSizePtr makeStaffSize() { return std::make_shared(); } - inline StaffSizePtr makeStaffSize( const NonNegativeDecimal& value ) { return std::make_shared( value ); } - inline StaffSizePtr makeStaffSize( NonNegativeDecimal&& value ) { return std::make_shared( std::move( value ) ); } - - class StaffSize : public ElementInterface - { - public: - StaffSize(); - StaffSize( const NonNegativeDecimal& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeDecimal getValue() const; - void setValue( const NonNegativeDecimal& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeDecimal myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffTuning.cpp b/Sourcecode/private/mx/core/elements/StaffTuning.cpp deleted file mode 100644 index 964eec492..000000000 --- a/Sourcecode/private/mx/core/elements/StaffTuning.cpp +++ /dev/null @@ -1,166 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StaffTuning.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/TuningAlter.h" -#include "mx/core/elements/TuningOctave.h" -#include "mx/core/elements/TuningStep.h" -#include - -namespace mx -{ - namespace core - { - StaffTuning::StaffTuning() - :myAttributes( std::make_shared() ) - ,myTuningStep( makeTuningStep() ) - ,myTuningAlter( makeTuningAlter() ) - ,myHasTuningAlter( false ) - ,myTuningOctave( makeTuningOctave() ) - {} - - - bool StaffTuning::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& StaffTuning::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& StaffTuning::streamName( std::ostream& os ) const - { - os << "staff-tuning"; - return os; - } - - - bool StaffTuning::hasContents() const - { - return true; - } - - - std::ostream& StaffTuning::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myTuningStep->toStream( os, indentLevel+1 ); - if ( myHasTuningAlter ) - { - os << std::endl; - myTuningAlter->toStream( os, indentLevel+1 ); - } - os << std::endl; - myTuningOctave->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } - - - StaffTuningAttributesPtr StaffTuning::getAttributes() const - { - return myAttributes; - } - - - void StaffTuning::setAttributes( const StaffTuningAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - TuningStepPtr StaffTuning::getTuningStep() const - { - return myTuningStep; - } - - - void StaffTuning::setTuningStep( const TuningStepPtr& value ) - { - if( value ) - { - myTuningStep = value; - } - } - - - TuningAlterPtr StaffTuning::getTuningAlter() const - { - return myTuningAlter; - } - - - void StaffTuning::setTuningAlter( const TuningAlterPtr& value ) - { - if( value ) - { - myTuningAlter = value; - } - } - - - bool StaffTuning::getHasTuningAlter() const - { - return myHasTuningAlter; - } - - - void StaffTuning::setHasTuningAlter( const bool value ) - { - myHasTuningAlter = value; - } - - - TuningOctavePtr StaffTuning::getTuningOctave() const - { - return myTuningOctave; - } - - - void StaffTuning::setTuningOctave( const TuningOctavePtr& value ) - { - if( value ) - { - myTuningOctave = value; - } - } - - - bool StaffTuning::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isTuningStepFound = false; - bool isTuningOctaveFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myTuningStep, isTuningStepFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTuningAlter, myHasTuningAlter ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTuningOctave, isTuningOctaveFound ) ) { continue; } - } - - if( !isTuningStepFound ) - { - message << "StaffTuning: '" << myTuningStep->getElementName() << "' is required but was not found" << std::endl; - } - if( !isTuningOctaveFound ) - { - message << "StaffTuning: '" << myTuningOctave->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffTuning.h b/Sourcecode/private/mx/core/elements/StaffTuning.h deleted file mode 100644 index 509a0bd6f..000000000 --- a/Sourcecode/private/mx/core/elements/StaffTuning.h +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/StaffTuningAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StaffTuningAttributes ) - MX_FORWARD_DECLARE_ELEMENT( TuningAlter ) - MX_FORWARD_DECLARE_ELEMENT( TuningOctave ) - MX_FORWARD_DECLARE_ELEMENT( TuningStep ) - MX_FORWARD_DECLARE_ELEMENT( StaffTuning ) - - inline StaffTuningPtr makeStaffTuning() { return std::make_shared(); } - - class StaffTuning : public ElementInterface - { - public: - StaffTuning(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StaffTuningAttributesPtr getAttributes() const; - void setAttributes( const StaffTuningAttributesPtr& value ); - - /* _________ TuningStep minOccurs = 1, maxOccurs = 1 _________ */ - TuningStepPtr getTuningStep() const; - void setTuningStep( const TuningStepPtr& value ); - - /* _________ TuningAlter minOccurs = 0, maxOccurs = 1 _________ */ - TuningAlterPtr getTuningAlter() const; - void setTuningAlter( const TuningAlterPtr& value ); - bool getHasTuningAlter() const; - void setHasTuningAlter( const bool value ); - - /* _________ TuningOctave minOccurs = 1, maxOccurs = 1 _________ */ - TuningOctavePtr getTuningOctave() const; - void setTuningOctave( const TuningOctavePtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StaffTuningAttributesPtr myAttributes; - TuningStepPtr myTuningStep; - TuningAlterPtr myTuningAlter; - bool myHasTuningAlter; - TuningOctavePtr myTuningOctave; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffTuningAttributes.cpp b/Sourcecode/private/mx/core/elements/StaffTuningAttributes.cpp deleted file mode 100644 index eab65f7af..000000000 --- a/Sourcecode/private/mx/core/elements/StaffTuningAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StaffTuningAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StaffTuningAttributes::StaffTuningAttributes() - :line() - ,hasLine( false ) - {} - - - bool StaffTuningAttributes::hasValues() const - { - return hasLine; - } - - - std::ostream& StaffTuningAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, line, "line", hasLine ); - } - return os; - } - - - bool StaffTuningAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "StaffTuningAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, line, hasLine, "line" ) ) { continue; } - } - - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffTuningAttributes.h b/Sourcecode/private/mx/core/elements/StaffTuningAttributes.h deleted file mode 100644 index 1225dbea0..000000000 --- a/Sourcecode/private/mx/core/elements/StaffTuningAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StaffTuningAttributes ) - - struct StaffTuningAttributes : public AttributesInterface - { - public: - StaffTuningAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StaffLine line; - bool hasLine; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffType.cpp b/Sourcecode/private/mx/core/elements/StaffType.cpp deleted file mode 100644 index d01175555..000000000 --- a/Sourcecode/private/mx/core/elements/StaffType.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StaffType.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StaffType::StaffType() - :myValue( StaffTypeEnum::regular ) - {} - - - StaffType::StaffType( const StaffTypeEnum& value ) - :myValue( value ) - {} - - - bool StaffType::hasAttributes() const - { - return false; - } - - - bool StaffType::hasContents() const - { - return true; - } - - - std::ostream& StaffType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StaffType::streamName( std::ostream& os ) const - { - os << "staff-type"; - return os; - } - - - std::ostream& StaffType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - StaffTypeEnum StaffType::getValue() const - { - return myValue; - } - - - void StaffType::setValue( const StaffTypeEnum& value ) - { - myValue = value; - } - - - bool StaffType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = parseStaffTypeEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StaffType.h b/Sourcecode/private/mx/core/elements/StaffType.h deleted file mode 100644 index 3179a478d..000000000 --- a/Sourcecode/private/mx/core/elements/StaffType.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StaffType ) - - inline StaffTypePtr makeStaffType() { return std::make_shared(); } - inline StaffTypePtr makeStaffType( const StaffTypeEnum& value ) { return std::make_shared( value ); } - inline StaffTypePtr makeStaffType( StaffTypeEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class StaffType : public ElementInterface - { - public: - StaffType(); - StaffType( const StaffTypeEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StaffTypeEnum getValue() const; - void setValue( const StaffTypeEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StaffTypeEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Staves.cpp b/Sourcecode/private/mx/core/elements/Staves.cpp deleted file mode 100644 index b03d79ec8..000000000 --- a/Sourcecode/private/mx/core/elements/Staves.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Staves.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Staves::Staves() - :myValue() - {} - - - Staves::Staves( const NonNegativeInteger& value ) - :myValue( value ) - {} - - - bool Staves::hasAttributes() const - { - return false; - } - - - bool Staves::hasContents() const - { - return true; - } - - - std::ostream& Staves::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Staves::streamName( std::ostream& os ) const - { - os << "staves"; - return os; - } - - - std::ostream& Staves::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - NonNegativeInteger Staves::getValue() const - { - return myValue; - } - - - void Staves::setValue( const NonNegativeInteger& value ) - { - myValue = value; - } - - - bool Staves::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Staves.h b/Sourcecode/private/mx/core/elements/Staves.h deleted file mode 100644 index 8ede1bbe5..000000000 --- a/Sourcecode/private/mx/core/elements/Staves.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Staves ) - - inline StavesPtr makeStaves() { return std::make_shared(); } - inline StavesPtr makeStaves( const NonNegativeInteger& value ) { return std::make_shared( value ); } - inline StavesPtr makeStaves( NonNegativeInteger&& value ) { return std::make_shared( std::move( value ) ); } - - class Staves : public ElementInterface - { - public: - Staves(); - Staves( const NonNegativeInteger& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - NonNegativeInteger getValue() const; - void setValue( const NonNegativeInteger& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - NonNegativeInteger myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Stem.cpp b/Sourcecode/private/mx/core/elements/Stem.cpp deleted file mode 100644 index 9722fbf7e..000000000 --- a/Sourcecode/private/mx/core/elements/Stem.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Stem.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Stem::Stem() - :myValue( StemValue::none ) - ,myAttributes( std::make_shared() ) - {} - - - Stem::Stem( const StemValue& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Stem::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Stem::hasContents() const - { - return true; - } - - - std::ostream& Stem::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Stem::streamName( std::ostream& os ) const - { - os << "stem"; - return os; - } - - - std::ostream& Stem::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - StemAttributesPtr Stem::getAttributes() const - { - return myAttributes; - } - - - void Stem::setAttributes( const StemAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - StemValue Stem::getValue() const - { - return myValue; - } - - - void Stem::setValue( const StemValue& value ) - { - myValue = value; - } - - - bool Stem::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue = parseStemValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Stem.h b/Sourcecode/private/mx/core/elements/Stem.h deleted file mode 100644 index 0dfe17f39..000000000 --- a/Sourcecode/private/mx/core/elements/Stem.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" -#include "mx/core/elements/StemAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StemAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Stem ) - - inline StemPtr makeStem() { return std::make_shared(); } - inline StemPtr makeStem( const StemValue& value ) { return std::make_shared( value ); } - inline StemPtr makeStem( StemValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Stem : public ElementInterface - { - public: - Stem(); - Stem( const StemValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StemAttributesPtr getAttributes() const; - void setAttributes( const StemAttributesPtr& attributes ); - StemValue getValue() const; - void setValue( const StemValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StemValue myValue; - StemAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StemAttributes.cpp b/Sourcecode/private/mx/core/elements/StemAttributes.cpp deleted file mode 100644 index 4e3df15b1..000000000 --- a/Sourcecode/private/mx/core/elements/StemAttributes.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StemAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StemAttributes::StemAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - {} - - - bool StemAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY; - } - - - std::ostream& StemAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - } - return os; - } - - - bool StemAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "StemAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StemAttributes.h b/Sourcecode/private/mx/core/elements/StemAttributes.h deleted file mode 100644 index 586b89c05..000000000 --- a/Sourcecode/private/mx/core/elements/StemAttributes.h +++ /dev/null @@ -1,41 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StemAttributes ) - - struct StemAttributes : public AttributesInterface - { - public: - StemAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Step.cpp b/Sourcecode/private/mx/core/elements/Step.cpp deleted file mode 100644 index 5fcadedfd..000000000 --- a/Sourcecode/private/mx/core/elements/Step.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Step.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Step::Step() - :myValue( StepEnum::a ) - {} - - - Step::Step( const StepEnum& value ) - :myValue( value ) - {} - - - bool Step::hasAttributes() const - { - return false; - } - - - bool Step::hasContents() const - { - return true; - } - - - std::ostream& Step::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Step::streamName( std::ostream& os ) const - { - os << "step"; - return os; - } - - - std::ostream& Step::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - StepEnum Step::getValue() const - { - return myValue; - } - - - void Step::setValue( const StepEnum& value ) - { - myValue = value; - } - - - bool Step::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseStepEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Step.h b/Sourcecode/private/mx/core/elements/Step.h deleted file mode 100644 index 1628511f1..000000000 --- a/Sourcecode/private/mx/core/elements/Step.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Step ) - - inline StepPtr makeStep() { return std::make_shared(); } - inline StepPtr makeStep( const StepEnum& value ) { return std::make_shared( value ); } - inline StepPtr makeStep( StepEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Step : public ElementInterface - { - public: - Step(); - Step( const StepEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StepEnum getValue() const; - void setValue( const StepEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StepEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Stick.cpp b/Sourcecode/private/mx/core/elements/Stick.cpp deleted file mode 100644 index f6c6dc5a2..000000000 --- a/Sourcecode/private/mx/core/elements/Stick.cpp +++ /dev/null @@ -1,130 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Stick.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/StickMaterial.h" -#include "mx/core/elements/StickType.h" -#include - -namespace mx -{ - namespace core - { - Stick::Stick() - :myAttributes( std::make_shared() ) - ,myStickType( makeStickType() ) - ,myStickMaterial( makeStickMaterial() ) - {} - - - bool Stick::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Stick::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Stick::streamName( std::ostream& os ) const - { - os << "stick"; - return os; - } - - - bool Stick::hasContents() const - { - return true; - } - - - std::ostream& Stick::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myStickType->toStream( os, indentLevel+1 ); - os << std::endl; - myStickMaterial->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } - - - StickAttributesPtr Stick::getAttributes() const - { - return myAttributes; - } - - - void Stick::setAttributes( const StickAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - StickTypePtr Stick::getStickType() const - { - return myStickType; - } - - - void Stick::setStickType( const StickTypePtr& value ) - { - if( value ) - { - myStickType = value; - } - } - - - StickMaterialPtr Stick::getStickMaterial() const - { - return myStickMaterial; - } - - - void Stick::setStickMaterial( const StickMaterialPtr& value ) - { - if( value ) - { - myStickMaterial = value; - } - } - - - bool Stick::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isStickTypeFound = false; - bool isStickMaterialFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myStickType, isStickTypeFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myStickMaterial, isStickMaterialFound ) ) { continue; } - } - - if( !isStickTypeFound ) - { - message << "Stick: '" << myStickType->getElementName() << "' is required but was not found" << std::endl; - } - if( !isStickMaterialFound ) - { - message << "Stick: '" << myStickMaterial->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Stick.h b/Sourcecode/private/mx/core/elements/Stick.h deleted file mode 100644 index 2d01441da..000000000 --- a/Sourcecode/private/mx/core/elements/Stick.h +++ /dev/null @@ -1,57 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/StickAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StickAttributes ) - MX_FORWARD_DECLARE_ELEMENT( StickMaterial ) - MX_FORWARD_DECLARE_ELEMENT( StickType ) - MX_FORWARD_DECLARE_ELEMENT( Stick ) - - inline StickPtr makeStick() { return std::make_shared(); } - - class Stick : public ElementInterface - { - public: - Stick(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StickAttributesPtr getAttributes() const; - void setAttributes( const StickAttributesPtr& value ); - - /* _________ StickType minOccurs = 1, maxOccurs = 1 _________ */ - StickTypePtr getStickType() const; - void setStickType( const StickTypePtr& value ); - - /* _________ StickMaterial minOccurs = 1, maxOccurs = 1 _________ */ - StickMaterialPtr getStickMaterial() const; - void setStickMaterial( const StickMaterialPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StickAttributesPtr myAttributes; - StickTypePtr myStickType; - StickMaterialPtr myStickMaterial; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StickAttributes.cpp b/Sourcecode/private/mx/core/elements/StickAttributes.cpp deleted file mode 100644 index 6361b39bc..000000000 --- a/Sourcecode/private/mx/core/elements/StickAttributes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StickAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StickAttributes::StickAttributes() - :tip() - ,hasTip( false ) - {} - - - bool StickAttributes::hasValues() const - { - return hasTip; - } - - - std::ostream& StickAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, tip, "tip", hasTip ); - } - return os; - } - - - bool StickAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "StickAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, tip, hasTip, "tip", &parseTipDirection ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StickAttributes.h b/Sourcecode/private/mx/core/elements/StickAttributes.h deleted file mode 100644 index 4cbc6c34f..000000000 --- a/Sourcecode/private/mx/core/elements/StickAttributes.h +++ /dev/null @@ -1,35 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StickAttributes ) - - struct StickAttributes : public AttributesInterface - { - public: - StickAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TipDirection tip; - bool hasTip; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StickLocation.cpp b/Sourcecode/private/mx/core/elements/StickLocation.cpp deleted file mode 100644 index a46c7a26a..000000000 --- a/Sourcecode/private/mx/core/elements/StickLocation.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StickLocation.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StickLocation::StickLocation() - :myValue( StickLocationEnum::center ) - {} - - - StickLocation::StickLocation( const StickLocationEnum& value ) - :myValue( value ) - {} - - - bool StickLocation::hasAttributes() const - { - return false; - } - - - bool StickLocation::hasContents() const - { - return true; - } - - - std::ostream& StickLocation::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StickLocation::streamName( std::ostream& os ) const - { - os << "stick-location"; - return os; - } - - - std::ostream& StickLocation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - StickLocationEnum StickLocation::getValue() const - { - return myValue; - } - - - void StickLocation::setValue( const StickLocationEnum& value ) - { - myValue = value; - } - - - bool StickLocation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseStickLocationEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StickLocation.h b/Sourcecode/private/mx/core/elements/StickLocation.h deleted file mode 100644 index 138a493b0..000000000 --- a/Sourcecode/private/mx/core/elements/StickLocation.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StickLocation ) - - inline StickLocationPtr makeStickLocation() { return std::make_shared(); } - inline StickLocationPtr makeStickLocation( const StickLocationEnum& value ) { return std::make_shared( value ); } - inline StickLocationPtr makeStickLocation( StickLocationEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class StickLocation : public ElementInterface - { - public: - StickLocation(); - StickLocation( const StickLocationEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StickLocationEnum getValue() const; - void setValue( const StickLocationEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StickLocationEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StickMaterial.cpp b/Sourcecode/private/mx/core/elements/StickMaterial.cpp deleted file mode 100644 index bdc48984a..000000000 --- a/Sourcecode/private/mx/core/elements/StickMaterial.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StickMaterial.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StickMaterial::StickMaterial() - :myValue( StickMaterialEnum::medium ) - {} - - - StickMaterial::StickMaterial( const StickMaterialEnum& value ) - :myValue( value ) - {} - - - bool StickMaterial::hasAttributes() const - { - return false; - } - - - bool StickMaterial::hasContents() const - { - return true; - } - - - std::ostream& StickMaterial::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StickMaterial::streamName( std::ostream& os ) const - { - os << "stick-material"; - return os; - } - - - std::ostream& StickMaterial::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - StickMaterialEnum StickMaterial::getValue() const - { - return myValue; - } - - - void StickMaterial::setValue( const StickMaterialEnum& value ) - { - myValue = value; - } - - - bool StickMaterial::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseStickMaterialEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StickMaterial.h b/Sourcecode/private/mx/core/elements/StickMaterial.h deleted file mode 100644 index 35c3acb33..000000000 --- a/Sourcecode/private/mx/core/elements/StickMaterial.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StickMaterial ) - - inline StickMaterialPtr makeStickMaterial() { return std::make_shared(); } - inline StickMaterialPtr makeStickMaterial( const StickMaterialEnum& value ) { return std::make_shared( value ); } - inline StickMaterialPtr makeStickMaterial( StickMaterialEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class StickMaterial : public ElementInterface - { - public: - StickMaterial(); - StickMaterial( const StickMaterialEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StickMaterialEnum getValue() const; - void setValue( const StickMaterialEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StickMaterialEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StickType.cpp b/Sourcecode/private/mx/core/elements/StickType.cpp deleted file mode 100644 index 4491855dd..000000000 --- a/Sourcecode/private/mx/core/elements/StickType.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StickType.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StickType::StickType() - :myValue( StickTypeEnum::yarn ) - {} - - - StickType::StickType( const StickTypeEnum& value ) - :myValue( value ) - {} - - - bool StickType::hasAttributes() const - { - return false; - } - - - bool StickType::hasContents() const - { - return true; - } - - - std::ostream& StickType::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& StickType::streamName( std::ostream& os ) const - { - os << "stick-type"; - return os; - } - - - std::ostream& StickType::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - StickTypeEnum StickType::getValue() const - { - return myValue; - } - - - void StickType::setValue( const StickTypeEnum& value ) - { - myValue = value; - } - - - bool StickType::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - myValue = parseStickTypeEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StickType.h b/Sourcecode/private/mx/core/elements/StickType.h deleted file mode 100644 index ad8c69140..000000000 --- a/Sourcecode/private/mx/core/elements/StickType.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( StickType ) - - inline StickTypePtr makeStickType() { return std::make_shared(); } - inline StickTypePtr makeStickType( const StickTypeEnum& value ) { return std::make_shared( value ); } - inline StickTypePtr makeStickType( StickTypeEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class StickType : public ElementInterface - { - public: - StickType(); - StickType( const StickTypeEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StickTypeEnum getValue() const; - void setValue( const StickTypeEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StickTypeEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Stopped.cpp b/Sourcecode/private/mx/core/elements/Stopped.cpp deleted file mode 100644 index 7d755e244..000000000 --- a/Sourcecode/private/mx/core/elements/Stopped.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Stopped.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Stopped::Stopped() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Stopped::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Stopped::hasContents() const { return false; } - std::ostream& Stopped::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Stopped::streamName( std::ostream& os ) const { os << "stopped"; return os; } - std::ostream& Stopped::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr Stopped::getAttributes() const - { - return myAttributes; - } - - - void Stopped::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Stopped::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Stopped.h b/Sourcecode/private/mx/core/elements/Stopped.h deleted file mode 100644 index 361f92a39..000000000 --- a/Sourcecode/private/mx/core/elements/Stopped.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Stopped ) - - inline StoppedPtr makeStopped() { return std::make_shared(); } - - class Stopped : public ElementInterface - { - public: - Stopped(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Stress.cpp b/Sourcecode/private/mx/core/elements/Stress.cpp deleted file mode 100644 index 0c813af15..000000000 --- a/Sourcecode/private/mx/core/elements/Stress.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Stress.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Stress::Stress() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Stress::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Stress::hasContents() const { return false; } - std::ostream& Stress::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Stress::streamName( std::ostream& os ) const { os << "stress"; return os; } - std::ostream& Stress::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr Stress::getAttributes() const - { - return myAttributes; - } - - - void Stress::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Stress::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Stress.h b/Sourcecode/private/mx/core/elements/Stress.h deleted file mode 100644 index e8534582e..000000000 --- a/Sourcecode/private/mx/core/elements/Stress.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Stress ) - - inline StressPtr makeStress() { return std::make_shared(); } - - class Stress : public ElementInterface - { - public: - Stress(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/String.cpp b/Sourcecode/private/mx/core/elements/String.cpp deleted file mode 100644 index f9c14a04e..000000000 --- a/Sourcecode/private/mx/core/elements/String.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/String.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - String::String() - :myAttributes( std::make_shared() ) - ,myValue() - { - - } - - - String::String( const StringNumber& value ) - :myAttributes( std::make_shared() ) - ,myValue( value ) - { - - } - - - bool String::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& String::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& String::streamName( std::ostream& os ) const - { - os << "string"; - return os; - } - - - bool String::hasContents() const - { - return true; - } - - - std::ostream& String::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - core::toStream( os, myValue ); - return os; - } - - - StringAttributesPtr String::getAttributes() const - { - return myAttributes; - } - - - void String::setAttributes( const StringAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - StringNumber String::getValue() const - { - return myValue; - } - - - void String::setValue( const StringNumber& value ) - { - myValue = value; - } - - - bool String::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.parse( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/String.h b/Sourcecode/private/mx/core/elements/String.h deleted file mode 100644 index f8be3c7d9..000000000 --- a/Sourcecode/private/mx/core/elements/String.h +++ /dev/null @@ -1,53 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Integers.h" -#include "mx/core/elements/StringAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StringAttributes ) - MX_FORWARD_DECLARE_ELEMENT( String ) - - inline StringPtr makeString() { return std::make_shared(); } - inline StringPtr makeString( const StringNumber& value ) { return std::make_shared( value ); } - inline StringPtr makeString( StringNumber&& value ) { return std::make_shared( std::move( value ) ); } - - - class String : public ElementInterface - { - public: - String(); - String( const StringNumber& value ); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StringAttributesPtr getAttributes() const; - void setAttributes( const StringAttributesPtr& value ); - StringNumber getValue() const; - void setValue( const StringNumber& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StringAttributesPtr myAttributes; - StringNumber myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StringAttributes.cpp b/Sourcecode/private/mx/core/elements/StringAttributes.cpp deleted file mode 100644 index ead8b8bfe..000000000 --- a/Sourcecode/private/mx/core/elements/StringAttributes.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StringAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StringAttributes::StringAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - {} - - - bool StringAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement; - } - - - std::ostream& StringAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool StringAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "StringAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StringAttributes.h b/Sourcecode/private/mx/core/elements/StringAttributes.h deleted file mode 100644 index a1e6d0eda..000000000 --- a/Sourcecode/private/mx/core/elements/StringAttributes.h +++ /dev/null @@ -1,57 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StringAttributes ) - - struct StringAttributes : public AttributesInterface - { - public: - StringAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StringMute.cpp b/Sourcecode/private/mx/core/elements/StringMute.cpp deleted file mode 100644 index 0d2e8c716..000000000 --- a/Sourcecode/private/mx/core/elements/StringMute.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StringMute.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StringMute::StringMute() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool StringMute::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool StringMute::hasContents() const { return false; } - std::ostream& StringMute::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& StringMute::streamName( std::ostream& os ) const { os << "string-mute"; return os; } - std::ostream& StringMute::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - StringMuteAttributesPtr StringMute::getAttributes() const - { - return myAttributes; - } - - - void StringMute::setAttributes( const StringMuteAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool StringMute::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StringMute.h b/Sourcecode/private/mx/core/elements/StringMute.h deleted file mode 100644 index f7acec20b..000000000 --- a/Sourcecode/private/mx/core/elements/StringMute.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/StringMuteAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StringMuteAttributes ) - MX_FORWARD_DECLARE_ELEMENT( StringMute ) - - inline StringMutePtr makeStringMute() { return std::make_shared(); } - - class StringMute : public ElementInterface - { - public: - StringMute(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StringMuteAttributesPtr getAttributes() const; - void setAttributes( const StringMuteAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StringMuteAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StringMuteAttributes.cpp b/Sourcecode/private/mx/core/elements/StringMuteAttributes.cpp deleted file mode 100644 index 33434f8ba..000000000 --- a/Sourcecode/private/mx/core/elements/StringMuteAttributes.cpp +++ /dev/null @@ -1,104 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StringMuteAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StringMuteAttributes::StringMuteAttributes() - :type( OnOff::on ) - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,halign( LeftCenterRight::center ) - ,hasType( true ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasHalign( false ) - {} - - - bool StringMuteAttributes::hasValues() const - { - return hasType || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasHalign; - } - - - std::ostream& StringMuteAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, halign, "halign", hasHalign ); - } - return os; - } - - - bool StringMuteAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "StringMuteAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseOnOff ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, halign, hasHalign, "halign", &parseLeftCenterRight ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StringMuteAttributes.h b/Sourcecode/private/mx/core/elements/StringMuteAttributes.h deleted file mode 100644 index a2aa9876b..000000000 --- a/Sourcecode/private/mx/core/elements/StringMuteAttributes.h +++ /dev/null @@ -1,56 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StringMuteAttributes ) - - struct StringMuteAttributes : public AttributesInterface - { - public: - StringMuteAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - OnOff type; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - LeftCenterRight halign; - const bool hasType; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasHalign; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StrongAccent.cpp b/Sourcecode/private/mx/core/elements/StrongAccent.cpp deleted file mode 100644 index 7c581f891..000000000 --- a/Sourcecode/private/mx/core/elements/StrongAccent.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StrongAccent.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StrongAccent::StrongAccent() - :myAttributes( std::make_shared() ) - {} - - - bool StrongAccent::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& StrongAccent::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& StrongAccent::streamName( std::ostream& os ) const - { - os << "strong-accent"; - return os; - } - - - bool StrongAccent::hasContents() const - { - return false; - } - - - std::ostream& StrongAccent::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - StrongAccentAttributesPtr StrongAccent::getAttributes() const - { - return myAttributes; - } - - - void StrongAccent::setAttributes( const StrongAccentAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool StrongAccent::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StrongAccent.h b/Sourcecode/private/mx/core/elements/StrongAccent.h deleted file mode 100644 index bdf9d0785..000000000 --- a/Sourcecode/private/mx/core/elements/StrongAccent.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/StrongAccentAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StrongAccentAttributes ) - MX_FORWARD_DECLARE_ELEMENT( StrongAccent ) - - inline StrongAccentPtr makeStrongAccent() { return std::make_shared(); } - - class StrongAccent : public ElementInterface - { - public: - StrongAccent(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - StrongAccentAttributesPtr getAttributes() const; - void setAttributes( const StrongAccentAttributesPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - StrongAccentAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/StrongAccentAttributes.cpp b/Sourcecode/private/mx/core/elements/StrongAccentAttributes.cpp deleted file mode 100644 index c6230e564..000000000 --- a/Sourcecode/private/mx/core/elements/StrongAccentAttributes.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/StrongAccentAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - StrongAccentAttributes::StrongAccentAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( CssFontSize::medium ) - ,fontWeight( FontWeight::normal ) - ,color() - ,placement( AboveBelow::below ) - ,type( UpDown::up ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasColor( false ) - ,hasPlacement( false ) - ,hasType( false ) - {} - - - bool StrongAccentAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasColor || - hasPlacement || - hasType; - } - - - std::ostream& StrongAccentAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, color, "color", hasColor ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, type, "type", hasType ); - } - return os; - } - - - bool StrongAccentAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "StrongAccentAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, type, hasType, "type", &parseUpDown ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/StrongAccentAttributes.h b/Sourcecode/private/mx/core/elements/StrongAccentAttributes.h deleted file mode 100644 index 0293e8f5d..000000000 --- a/Sourcecode/private/mx/core/elements/StrongAccentAttributes.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Color.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( StrongAccentAttributes ) - - struct StrongAccentAttributes : public AttributesInterface - { - public: - StrongAccentAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - Color color; - AboveBelow placement; - UpDown type; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasColor; - bool hasPlacement; - bool hasType; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Suffix.cpp b/Sourcecode/private/mx/core/elements/Suffix.cpp deleted file mode 100644 index ef16e6a94..000000000 --- a/Sourcecode/private/mx/core/elements/Suffix.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Suffix.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Suffix::Suffix() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Suffix::Suffix( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Suffix::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Suffix::hasContents() const - { - return true; - } - - - std::ostream& Suffix::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Suffix::streamName( std::ostream& os ) const - { - os << "suffix"; - return os; - } - - - std::ostream& Suffix::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - SuffixAttributesPtr Suffix::getAttributes() const - { - return myAttributes; - } - - - void Suffix::setAttributes( const SuffixAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Suffix::getValue() const - { - return myValue; - } - - - void Suffix::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Suffix::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Suffix.h b/Sourcecode/private/mx/core/elements/Suffix.h deleted file mode 100644 index dacc3df3b..000000000 --- a/Sourcecode/private/mx/core/elements/Suffix.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/SuffixAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SuffixAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Suffix ) - - inline SuffixPtr makeSuffix() { return std::make_shared(); } - inline SuffixPtr makeSuffix( const XsString& value ) { return std::make_shared( value ); } - inline SuffixPtr makeSuffix( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Suffix : public ElementInterface - { - public: - Suffix(); - Suffix( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SuffixAttributesPtr getAttributes() const; - void setAttributes( const SuffixAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - SuffixAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SuffixAttributes.cpp b/Sourcecode/private/mx/core/elements/SuffixAttributes.cpp deleted file mode 100644 index 02ac2a1e9..000000000 --- a/Sourcecode/private/mx/core/elements/SuffixAttributes.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SuffixAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SuffixAttributes::SuffixAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - {} - - - bool SuffixAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight; - } - - - std::ostream& SuffixAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - } - return os; - } - - - bool SuffixAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "SuffixAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SuffixAttributes.h b/Sourcecode/private/mx/core/elements/SuffixAttributes.h deleted file mode 100644 index fa460c3ee..000000000 --- a/Sourcecode/private/mx/core/elements/SuffixAttributes.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SuffixAttributes ) - - struct SuffixAttributes : public AttributesInterface - { - public: - SuffixAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Supports.cpp b/Sourcecode/private/mx/core/elements/Supports.cpp deleted file mode 100644 index 86b56b9d7..000000000 --- a/Sourcecode/private/mx/core/elements/Supports.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Supports.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Supports::Supports() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Supports::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Supports::hasContents() const { return false; } - std::ostream& Supports::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Supports::streamName( std::ostream& os ) const { os << "supports"; return os; } - std::ostream& Supports::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - SupportsAttributesPtr Supports::getAttributes() const - { - return myAttributes; - } - - - void Supports::setAttributes( const SupportsAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Supports::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Supports.h b/Sourcecode/private/mx/core/elements/Supports.h deleted file mode 100644 index bdacda54c..000000000 --- a/Sourcecode/private/mx/core/elements/Supports.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/SupportsAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SupportsAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Supports ) - - inline SupportsPtr makeSupports() { return std::make_shared(); } - - class Supports : public ElementInterface - { - public: - Supports(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SupportsAttributesPtr getAttributes() const; - void setAttributes( const SupportsAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SupportsAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SupportsAttributes.cpp b/Sourcecode/private/mx/core/elements/SupportsAttributes.cpp deleted file mode 100644 index c3b7dbda0..000000000 --- a/Sourcecode/private/mx/core/elements/SupportsAttributes.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SupportsAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SupportsAttributes::SupportsAttributes() - :type( YesNo::no ) - ,element() - ,attribute() - ,value() - ,hasType( true ) - ,hasElement( true ) - ,hasAttribute( false ) - ,hasValue( false ) - {} - - - bool SupportsAttributes::hasValues() const - { - return hasType || - hasElement || - hasAttribute || - hasValue; - } - - - std::ostream& SupportsAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, element, "element", hasElement ); - streamAttribute( os, attribute, "attribute", hasAttribute ); - streamAttribute( os, value, "value", hasValue ); - } - return os; - } - - - bool SupportsAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "SupportsAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - bool isElementFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseYesNo ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, element, isElementFound, "element" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, attribute, hasAttribute, "attribute" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, value, hasValue, "value" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - if( !isElementFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SupportsAttributes.h b/Sourcecode/private/mx/core/elements/SupportsAttributes.h deleted file mode 100644 index 6656edd7e..000000000 --- a/Sourcecode/private/mx/core/elements/SupportsAttributes.h +++ /dev/null @@ -1,44 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Enums.h" -#include "mx/core/XsNMToken.h" -#include "mx/core/XsToken.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( SupportsAttributes ) - - struct SupportsAttributes : public AttributesInterface - { - public: - SupportsAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - YesNo type; - XsNMToken element; - XsNMToken attribute; - XsToken value; - const bool hasType; - const bool hasElement; - bool hasAttribute; - bool hasValue; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Syllabic.cpp b/Sourcecode/private/mx/core/elements/Syllabic.cpp deleted file mode 100644 index c0cbf2802..000000000 --- a/Sourcecode/private/mx/core/elements/Syllabic.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Syllabic.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Syllabic::Syllabic() - :myValue( SyllabicEnum::begin ) - {} - - - Syllabic::Syllabic( const SyllabicEnum& value ) - :myValue( value ) - {} - - - bool Syllabic::hasAttributes() const - { - return false; - } - - - bool Syllabic::hasContents() const - { - return true; - } - - - std::ostream& Syllabic::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Syllabic::streamName( std::ostream& os ) const - { - os << "syllabic"; - return os; - } - - - std::ostream& Syllabic::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - SyllabicEnum Syllabic::getValue() const - { - return myValue; - } - - - void Syllabic::setValue( const SyllabicEnum& value ) - { - myValue = value; - } - - - bool Syllabic::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue = parseSyllabicEnum( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Syllabic.h b/Sourcecode/private/mx/core/elements/Syllabic.h deleted file mode 100644 index de8846ee8..000000000 --- a/Sourcecode/private/mx/core/elements/Syllabic.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Enums.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Syllabic ) - - inline SyllabicPtr makeSyllabic() { return std::make_shared(); } - inline SyllabicPtr makeSyllabic( const SyllabicEnum& value ) { return std::make_shared( value ); } - inline SyllabicPtr makeSyllabic( SyllabicEnum&& value ) { return std::make_shared( std::move( value ) ); } - - class Syllabic : public ElementInterface - { - public: - Syllabic(); - Syllabic( const SyllabicEnum& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - SyllabicEnum getValue() const; - void setValue( const SyllabicEnum& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SyllabicEnum myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SyllabicTextGroup.cpp b/Sourcecode/private/mx/core/elements/SyllabicTextGroup.cpp deleted file mode 100644 index d684a0f75..000000000 --- a/Sourcecode/private/mx/core/elements/SyllabicTextGroup.cpp +++ /dev/null @@ -1,187 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SyllabicTextGroup.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/ElisionSyllabicTextGroup.h" -#include "mx/core/elements/Extend.h" -#include "mx/core/elements/Syllabic.h" -#include "mx/core/elements/Text.h" -#include - -namespace mx -{ - namespace core - { - SyllabicTextGroup::SyllabicTextGroup() - :mySyllabic( makeSyllabic() ) - ,myHasSyllabic( false ) - ,myText( makeText() ) - ,myElisionSyllabicTextGroupSet() - ,myExtend( makeExtend() ) - ,myHasExtend( false ) - {} - - - bool SyllabicTextGroup::hasAttributes() const - { - return false; - } - - - std::ostream& SyllabicTextGroup::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SyllabicTextGroup::streamName( std::ostream& os ) const - { - return os; - } - - - bool SyllabicTextGroup::hasContents() const - { - return true; - } - - - std::ostream& SyllabicTextGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = true; - if ( myHasSyllabic ) - { - mySyllabic->toStream( os, indentLevel ); - os << std::endl; - } - myText->toStream( os, indentLevel ); - for ( auto x : myElisionSyllabicTextGroupSet ) - { - os << std::endl; - x->streamContents( os, indentLevel, isOneLineOnly ); - } - if ( myHasExtend ) - { - os << std::endl; - myExtend->toStream( os, indentLevel ); - } - isOneLineOnly = ! ( myHasSyllabic || myElisionSyllabicTextGroupSet.size() > 0 || myHasExtend ); - return os; - } - - - SyllabicPtr SyllabicTextGroup::getSyllabic() const - { - return mySyllabic; - } - - - void SyllabicTextGroup::setSyllabic( const SyllabicPtr& value ) - { - if ( value ) - { - mySyllabic = value; - } - } - - - bool SyllabicTextGroup::getHasSyllabic() const - { - return myHasSyllabic; - } - - - void SyllabicTextGroup::setHasSyllabic( const bool value ) - { - myHasSyllabic = value; - } - - - TextPtr SyllabicTextGroup::getText() const - { - return myText; - } - - - void SyllabicTextGroup::setText( const TextPtr& value ) - { - if ( value ) - { - myText = value; - } - } - - - const ElisionSyllabicTextGroupSet& SyllabicTextGroup::getElisionSyllabicTextGroupSet() const - { - return myElisionSyllabicTextGroupSet; - } - - - void SyllabicTextGroup::addElisionSyllabicTextGroup( const ElisionSyllabicTextGroupPtr& value ) - { - if ( value ) - { - myElisionSyllabicTextGroupSet.push_back( value ); - } - } - - - void SyllabicTextGroup::removeElisionSyllabicTextGroup( const ElisionSyllabicTextGroupSetIterConst& value ) - { - if ( value != myElisionSyllabicTextGroupSet.cend() ) - { - myElisionSyllabicTextGroupSet.erase( value ); - } - } - - - void SyllabicTextGroup::clearElisionSyllabicTextGroupSet() - { - myElisionSyllabicTextGroupSet.clear(); - } - - - ElisionSyllabicTextGroupPtr SyllabicTextGroup::getElisionSyllabicTextGroup( const ElisionSyllabicTextGroupSetIterConst& setIterator ) const - { - if( setIterator != myElisionSyllabicTextGroupSet.cend() ) - { - return *setIterator; - } - return ElisionSyllabicTextGroupPtr(); - } - - - ExtendPtr SyllabicTextGroup::getExtend() const - { - return myExtend; - } - - - void SyllabicTextGroup::setExtend( const ExtendPtr& value ) - { - if ( value ) - { - myExtend = value; - } - } - - - bool SyllabicTextGroup::getHasExtend() const - { - return myHasExtend; - } - - - void SyllabicTextGroup::setHasExtend( const bool value ) - { - myHasExtend = value; - } - - - MX_FROM_XELEMENT_UNUSED( SyllabicTextGroup ); - - } -} diff --git a/Sourcecode/private/mx/core/elements/SyllabicTextGroup.h b/Sourcecode/private/mx/core/elements/SyllabicTextGroup.h deleted file mode 100644 index 0498c151a..000000000 --- a/Sourcecode/private/mx/core/elements/SyllabicTextGroup.h +++ /dev/null @@ -1,73 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( ElisionSyllabicTextGroup ) - MX_FORWARD_DECLARE_ELEMENT( Extend ) - MX_FORWARD_DECLARE_ELEMENT( Syllabic ) - MX_FORWARD_DECLARE_ELEMENT( Text ) - MX_FORWARD_DECLARE_ELEMENT( SyllabicTextGroup ) - - inline SyllabicTextGroupPtr makeSyllabicTextGroup() { return std::make_shared(); } - - class SyllabicTextGroup : public ElementInterface - { - public: - SyllabicTextGroup(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Syllabic minOccurs = 0, maxOccurs = 1 _________ */ - SyllabicPtr getSyllabic() const; - void setSyllabic( const SyllabicPtr& value ); - bool getHasSyllabic() const; - void setHasSyllabic( const bool value ); - - /* _________ Text minOccurs = 1, maxOccurs = 1 _________ */ - TextPtr getText() const; - void setText( const TextPtr& value ); - - /* _________ ElisionSyllabicTextGroup minOccurs = 0, maxOccurs = unbounded _________ */ - const ElisionSyllabicTextGroupSet& getElisionSyllabicTextGroupSet() const; - void addElisionSyllabicTextGroup( const ElisionSyllabicTextGroupPtr& value ); - void removeElisionSyllabicTextGroup( const ElisionSyllabicTextGroupSetIterConst& value ); - void clearElisionSyllabicTextGroupSet(); - ElisionSyllabicTextGroupPtr getElisionSyllabicTextGroup( const ElisionSyllabicTextGroupSetIterConst& setIterator ) const; - - /* _________ Extend minOccurs = 0, maxOccurs = 1 _________ */ - ExtendPtr getExtend() const; - void setExtend( const ExtendPtr& value ); - bool getHasExtend() const; - void setHasExtend( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SyllabicPtr mySyllabic; - bool myHasSyllabic; - TextPtr myText; - ElisionSyllabicTextGroupSet myElisionSyllabicTextGroupSet; - ExtendPtr myExtend; - bool myHasExtend; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SystemDistance.cpp b/Sourcecode/private/mx/core/elements/SystemDistance.cpp deleted file mode 100644 index c9dffd4bd..000000000 --- a/Sourcecode/private/mx/core/elements/SystemDistance.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SystemDistance.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - SystemDistance::SystemDistance() - :myValue() - {} - - - SystemDistance::SystemDistance( const TenthsValue& value ) - :myValue( value ) - {} - - - bool SystemDistance::hasAttributes() const - { - return false; - } - - - bool SystemDistance::hasContents() const - { - return true; - } - - - std::ostream& SystemDistance::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SystemDistance::streamName( std::ostream& os ) const - { - os << "system-distance"; - return os; - } - - - std::ostream& SystemDistance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - TenthsValue SystemDistance::getValue() const - { - return myValue; - } - - - void SystemDistance::setValue( const TenthsValue& value ) - { - myValue = value; - } - - - bool SystemDistance::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - } -} diff --git a/Sourcecode/private/mx/core/elements/SystemDistance.h b/Sourcecode/private/mx/core/elements/SystemDistance.h deleted file mode 100644 index 6937b0c8e..000000000 --- a/Sourcecode/private/mx/core/elements/SystemDistance.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SystemDistance ) - - inline SystemDistancePtr makeSystemDistance() { return std::make_shared(); } - inline SystemDistancePtr makeSystemDistance( const TenthsValue& value ) { return std::make_shared( value ); } - inline SystemDistancePtr makeSystemDistance( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class SystemDistance : public ElementInterface - { - public: - SystemDistance(); - SystemDistance( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SystemDividers.cpp b/Sourcecode/private/mx/core/elements/SystemDividers.cpp deleted file mode 100644 index 1b897443b..000000000 --- a/Sourcecode/private/mx/core/elements/SystemDividers.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SystemDividers.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/LeftDivider.h" -#include "mx/core/elements/RightDivider.h" -#include - -namespace mx -{ - namespace core - { - SystemDividers::SystemDividers() - :myLeftDivider( makeLeftDivider() ) - ,myRightDivider( makeRightDivider() ) - {} - - - bool SystemDividers::hasAttributes() const - { - return false; - } - - - std::ostream& SystemDividers::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SystemDividers::streamName( std::ostream& os ) const - { - os << "system-dividers"; - return os; - } - - - bool SystemDividers::hasContents() const - { - return true; - } - - - std::ostream& SystemDividers::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myLeftDivider->toStream( os, indentLevel+1 ); - os << std::endl; - myRightDivider->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } - - - LeftDividerPtr SystemDividers::getLeftDivider() const - { - return myLeftDivider; - } - - - void SystemDividers::setLeftDivider( const LeftDividerPtr& value ) - { - if( value ) - { - myLeftDivider = value; - } - } - - - RightDividerPtr SystemDividers::getRightDivider() const - { - return myRightDivider; - } - - - void SystemDividers::setRightDivider( const RightDividerPtr& value ) - { - if( value ) - { - myRightDivider = value; - } - } - - - bool SystemDividers::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isLeftDividerFound = false; - bool isRightDividerFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myLeftDivider, isLeftDividerFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myRightDivider, isRightDividerFound ) ) { continue; } - } - - if( !isLeftDividerFound ) - { - message << "SystemDividers: '" << myLeftDivider->getElementName() << "' is required but was not found" << std::endl; - } - if( !isRightDividerFound ) - { - message << "SystemDividers: '" << myRightDivider->getElementName() << "' is required but was not found" << std::endl; - } - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SystemDividers.h b/Sourcecode/private/mx/core/elements/SystemDividers.h deleted file mode 100644 index f4714b0dc..000000000 --- a/Sourcecode/private/mx/core/elements/SystemDividers.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( LeftDivider ) - MX_FORWARD_DECLARE_ELEMENT( RightDivider ) - MX_FORWARD_DECLARE_ELEMENT( SystemDividers ) - - inline SystemDividersPtr makeSystemDividers() { return std::make_shared(); } - - class SystemDividers : public ElementInterface - { - public: - SystemDividers(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ LeftDivider minOccurs = 1, maxOccurs = 1 _________ */ - LeftDividerPtr getLeftDivider() const; - void setLeftDivider( const LeftDividerPtr& value ); - - /* _________ RightDivider minOccurs = 1, maxOccurs = 1 _________ */ - RightDividerPtr getRightDivider() const; - void setRightDivider( const RightDividerPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LeftDividerPtr myLeftDivider; - RightDividerPtr myRightDivider; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SystemLayout.cpp b/Sourcecode/private/mx/core/elements/SystemLayout.cpp deleted file mode 100644 index 4ab47d38e..000000000 --- a/Sourcecode/private/mx/core/elements/SystemLayout.cpp +++ /dev/null @@ -1,213 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SystemLayout.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/SystemDistance.h" -#include "mx/core/elements/SystemDividers.h" -#include "mx/core/elements/SystemMargins.h" -#include "mx/core/elements/TopSystemDistance.h" -#include - -namespace mx -{ - namespace core - { - SystemLayout::SystemLayout() - :mySystemMargins( makeSystemMargins() ) - ,myHasSystemMargins( false ) - ,mySystemDistance( makeSystemDistance() ) - ,myHasSystemDistance( false ) - ,myTopSystemDistance( makeTopSystemDistance() ) - ,myHasTopSystemDistance( false ) - ,mySystemDividers( makeSystemDividers() ) - ,myHasSystemDividers( false ) - {} - - - bool SystemLayout::hasAttributes() const - { - return false; - } - - - std::ostream& SystemLayout::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SystemLayout::streamName( std::ostream& os ) const - { - os << "system-layout"; - return os; - } - - - bool SystemLayout::hasContents() const - { - return myHasSystemMargins - || myHasSystemDistance - || myHasTopSystemDistance - || myHasSystemDividers; - } - - - std::ostream& SystemLayout::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( myHasSystemMargins ) - { - os << std::endl; - mySystemMargins->toStream( os, indentLevel+1 ); - } - if ( myHasSystemDistance ) - { - os << std::endl; - mySystemDistance->toStream( os, indentLevel+1 ); - } - if ( myHasTopSystemDistance ) - { - os << std::endl; - myTopSystemDistance->toStream( os, indentLevel+1 ); - } - if ( myHasSystemDividers ) - { - os << std::endl; - mySystemDividers->toStream( os, indentLevel+1 ); - } - isOneLineOnly = ! hasContents(); - if ( ! isOneLineOnly ) - { - os << std::endl; - } - return os; - } - - - SystemMarginsPtr SystemLayout::getSystemMargins() const - { - return mySystemMargins; - } - - - void SystemLayout::setSystemMargins( const SystemMarginsPtr& value ) - { - if( value ) - { - mySystemMargins = value; - } - } - - - bool SystemLayout::getHasSystemMargins() const - { - return myHasSystemMargins; - } - - - void SystemLayout::setHasSystemMargins( const bool value ) - { - myHasSystemMargins = value; - } - - - SystemDistancePtr SystemLayout::getSystemDistance() const - { - return mySystemDistance; - } - - - void SystemLayout::setSystemDistance( const SystemDistancePtr& value ) - { - if( value ) - { - mySystemDistance = value; - } - } - - - bool SystemLayout::getHasSystemDistance() const - { - return myHasSystemDistance; - } - - - void SystemLayout::setHasSystemDistance( const bool value ) - { - myHasSystemDistance = value; - } - - - TopSystemDistancePtr SystemLayout::getTopSystemDistance() const - { - return myTopSystemDistance; - } - - - void SystemLayout::setTopSystemDistance( const TopSystemDistancePtr& value ) - { - if( value ) - { - myTopSystemDistance = value; - } - } - - - bool SystemLayout::getHasTopSystemDistance() const - { - return myHasTopSystemDistance; - } - - - void SystemLayout::setHasTopSystemDistance( const bool value ) - { - myHasTopSystemDistance = value; - } - - - SystemDividersPtr SystemLayout::getSystemDividers() const - { - return mySystemDividers; - } - - - void SystemLayout::setSystemDividers( const SystemDividersPtr& value ) - { - if( value ) - { - mySystemDividers = value; - } - } - - - bool SystemLayout::getHasSystemDividers() const - { - return myHasSystemDividers; - } - - - void SystemLayout::setHasSystemDividers( const bool value ) - { - myHasSystemDividers = value; - } - - - bool SystemLayout::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *mySystemMargins, myHasSystemMargins ) ) { continue; } - if ( importElement( message, *it, isSuccess, *mySystemDistance, myHasSystemDistance ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myTopSystemDistance, myHasTopSystemDistance ) ) { continue; } - if ( importElement( message, *it, isSuccess, *mySystemDividers, myHasSystemDividers ) ) { continue; } - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SystemLayout.h b/Sourcecode/private/mx/core/elements/SystemLayout.h deleted file mode 100644 index 03142f35e..000000000 --- a/Sourcecode/private/mx/core/elements/SystemLayout.h +++ /dev/null @@ -1,74 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( SystemDistance ) - MX_FORWARD_DECLARE_ELEMENT( SystemDividers ) - MX_FORWARD_DECLARE_ELEMENT( SystemMargins ) - MX_FORWARD_DECLARE_ELEMENT( TopSystemDistance ) - MX_FORWARD_DECLARE_ELEMENT( SystemLayout ) - - inline SystemLayoutPtr makeSystemLayout() { return std::make_shared(); } - - class SystemLayout : public ElementInterface - { - public: - SystemLayout(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ SystemMargins minOccurs = 0, maxOccurs = 1 _________ */ - SystemMarginsPtr getSystemMargins() const; - void setSystemMargins( const SystemMarginsPtr& value ); - bool getHasSystemMargins() const; - void setHasSystemMargins( const bool value ); - SystemDistancePtr getSystemDistance() const; - void setSystemDistance( const SystemDistancePtr& value ); - bool getHasSystemDistance() const; - void setHasSystemDistance( const bool value ); - - /* _________ TopSystemDistance minOccurs = 0, maxOccurs = 1 _________ */ - TopSystemDistancePtr getTopSystemDistance() const; - void setTopSystemDistance( const TopSystemDistancePtr& value ); - bool getHasTopSystemDistance() const; - void setHasTopSystemDistance( const bool value ); - - /* _________ SystemDividers minOccurs = 0, maxOccurs = 1 _________ */ - SystemDividersPtr getSystemDividers() const; - void setSystemDividers( const SystemDividersPtr& value ); - bool getHasSystemDividers() const; - void setHasSystemDividers( const bool value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - SystemMarginsPtr mySystemMargins; - bool myHasSystemMargins; - SystemDistancePtr mySystemDistance; - bool myHasSystemDistance; - TopSystemDistancePtr myTopSystemDistance; - bool myHasTopSystemDistance; - SystemDividersPtr mySystemDividers; - bool myHasSystemDividers; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/SystemMargins.cpp b/Sourcecode/private/mx/core/elements/SystemMargins.cpp deleted file mode 100644 index 2bd3c8243..000000000 --- a/Sourcecode/private/mx/core/elements/SystemMargins.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/SystemMargins.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/LeftMargin.h" -#include "mx/core/elements/RightMargin.h" -#include - -namespace mx -{ - namespace core - { - SystemMargins::SystemMargins() - :myLeftMargin( makeLeftMargin() ) - ,myRightMargin( makeRightMargin() ) - {} - - - bool SystemMargins::hasAttributes() const - { - return false; - } - - - std::ostream& SystemMargins::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& SystemMargins::streamName( std::ostream& os ) const - { - os << "system-margins"; - return os; - } - - - bool SystemMargins::hasContents() const - { - return true; - } - - - std::ostream& SystemMargins::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - isOneLineOnly = false; - os << std::endl; - myLeftMargin->toStream( os, indentLevel+1 ); - os << std::endl; - myRightMargin->toStream( os, indentLevel+1 ); - os << std::endl; - return os; - } - - - LeftMarginPtr SystemMargins::getLeftMargin() const - { - return myLeftMargin; - } - - - void SystemMargins::setLeftMargin( const LeftMarginPtr& value ) - { - if( value ) - { - myLeftMargin = value; - } - } - - - RightMarginPtr SystemMargins::getRightMargin() const - { - return myRightMargin; - } - - - void SystemMargins::setRightMargin( const RightMarginPtr& value ) - { - if( value ) - { - myRightMargin = value; - } - } - - - bool SystemMargins::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - bool isLeftMarginFound = false; - bool isRightMarginFound = false; - - auto endIter = xelement.end(); - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if ( importElement( message, *it, isSuccess, *myLeftMargin, isLeftMarginFound ) ) { continue; } - if ( importElement( message, *it, isSuccess, *myRightMargin, isRightMarginFound ) ) { continue; } - } - - if( !isLeftMarginFound ) - { - message << "SystemMargins: '" << myLeftMargin->getElementName() << "' is required but was not found" << std::endl; - } - if( !isRightMarginFound ) - { - message << "SystemMargins: '" << myRightMargin->getElementName() << "' is required but was not found" << std::endl; - } - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/SystemMargins.h b/Sourcecode/private/mx/core/elements/SystemMargins.h deleted file mode 100644 index d84dbbeb8..000000000 --- a/Sourcecode/private/mx/core/elements/SystemMargins.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( LeftMargin ) - MX_FORWARD_DECLARE_ELEMENT( RightMargin ) - MX_FORWARD_DECLARE_ELEMENT( SystemMargins ) - - inline SystemMarginsPtr makeSystemMargins() { return std::make_shared(); } - - class SystemMargins : public ElementInterface - { - public: - SystemMargins(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ LeftMargin minOccurs = 1, maxOccurs = 1 _________ */ - LeftMarginPtr getLeftMargin() const; - void setLeftMargin( const LeftMarginPtr& value ); - - /* _________ RightMargin minOccurs = 1, maxOccurs = 1 _________ */ - RightMarginPtr getRightMargin() const; - void setRightMargin( const RightMarginPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - LeftMarginPtr myLeftMargin; - RightMarginPtr myRightMargin; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Tap.cpp b/Sourcecode/private/mx/core/elements/Tap.cpp deleted file mode 100644 index a4dedf9bf..000000000 --- a/Sourcecode/private/mx/core/elements/Tap.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Tap.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Tap::Tap() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Tap::Tap( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Tap::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Tap::hasContents() const - { - return true; - } - - - std::ostream& Tap::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Tap::streamName( std::ostream& os ) const - { - os << "tap"; - return os; - } - - - std::ostream& Tap::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - TapAttributesPtr Tap::getAttributes() const - { - return myAttributes; - } - - - void Tap::setAttributes( const TapAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Tap::getValue() const - { - return myValue; - } - - - void Tap::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Tap::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Tap.h b/Sourcecode/private/mx/core/elements/Tap.h deleted file mode 100644 index b0315b725..000000000 --- a/Sourcecode/private/mx/core/elements/Tap.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/TapAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TapAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Tap ) - - inline TapPtr makeTap() { return std::make_shared(); } - inline TapPtr makeTap( const XsString& value ) { return std::make_shared( value ); } - inline TapPtr makeTap( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Tap : public ElementInterface - { - public: - Tap(); - Tap( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TapAttributesPtr getAttributes() const; - void setAttributes( const TapAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - TapAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/TapAttributes.cpp b/Sourcecode/private/mx/core/elements/TapAttributes.cpp deleted file mode 100644 index 1ad885e79..000000000 --- a/Sourcecode/private/mx/core/elements/TapAttributes.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/TapAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - TapAttributes::TapAttributes() - :defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,placement() - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasPlacement( false ) - {} - - - bool TapAttributes::hasValues() const - { - return hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasPlacement; - } - - - std::ostream& TapAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, placement, "placement", hasPlacement ); - } - return os; - } - - - bool TapAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "TapAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/TapAttributes.h b/Sourcecode/private/mx/core/elements/TapAttributes.h deleted file mode 100644 index 99ed1b044..000000000 --- a/Sourcecode/private/mx/core/elements/TapAttributes.h +++ /dev/null @@ -1,54 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TapAttributes ) - - struct TapAttributes : public AttributesInterface - { - public: - TapAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - AboveBelow placement; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasPlacement; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Technical.cpp b/Sourcecode/private/mx/core/elements/Technical.cpp deleted file mode 100644 index beeebb508..000000000 --- a/Sourcecode/private/mx/core/elements/Technical.cpp +++ /dev/null @@ -1,317 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Technical.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/TechnicalChoice.h" -#include "mx/core/elements/Arrow.h" -#include "mx/core/elements/Bend.h" -#include "mx/core/elements/DoubleTongue.h" -#include "mx/core/elements/DownBow.h" -#include "mx/core/elements/Fingering.h" -#include "mx/core/elements/Fingernails.h" -#include "mx/core/elements/Fret.h" -#include "mx/core/elements/HammerOn.h" -#include "mx/core/elements/Handbell.h" -#include "mx/core/elements/Harmonic.h" -#include "mx/core/elements/Heel.h" -#include "mx/core/elements/Hole.h" -#include "mx/core/elements/OpenString.h" -#include "mx/core/elements/OtherTechnical.h" -#include "mx/core/elements/Pluck.h" -#include "mx/core/elements/PullOff.h" -#include "mx/core/elements/SnapPizzicato.h" -#include "mx/core/elements/Stopped.h" -#include "mx/core/elements/String.h" -#include "mx/core/elements/Tap.h" -#include "mx/core/elements/ThumbPosition.h" -#include "mx/core/elements/Toe.h" -#include "mx/core/elements/TripleTongue.h" -#include "mx/core/elements/UpBow.h" -#include - -namespace mx -{ - namespace core - { - Technical::Technical() - :myTechnicalChoiceSet() - {} - - - bool Technical::hasAttributes() const - { - return false; - } - - - std::ostream& Technical::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Technical::streamName( std::ostream& os ) const - { - os << "technical"; - return os; - } - - - bool Technical::hasContents() const - { - return myTechnicalChoiceSet.size() > 0; - } - - - std::ostream& Technical::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - if ( hasContents() ) - { - for ( auto x : myTechnicalChoiceSet ) - { - os << std::endl; - x->streamContents( os, indentLevel+1, isOneLineOnly ); - } - os << std::endl; - } - else - { - isOneLineOnly = false; - } - return os; - } - - - const TechnicalChoiceSet& Technical::getTechnicalChoiceSet() const - { - return myTechnicalChoiceSet; - } - - - void Technical::addTechnicalChoice( const TechnicalChoicePtr& value ) - { - if ( value ) - { - myTechnicalChoiceSet.push_back( value ); - } - } - - - void Technical::removeTechnicalChoice( const TechnicalChoiceSetIterConst& value ) - { - if ( value != myTechnicalChoiceSet.cend() ) - { - myTechnicalChoiceSet.erase( value ); - } - } - - - void Technical::clearTechnicalChoiceSet() - { - myTechnicalChoiceSet.clear(); - } - - - TechnicalChoicePtr Technical::getTechnicalChoice( const TechnicalChoiceSetIterConst& setIterator ) const - { - if( setIterator != myTechnicalChoiceSet.cend() ) - { - return *setIterator; - } - return TechnicalChoicePtr(); - } - - - bool Technical::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - ::ezxml::XElementIterator end = xelement.end(); - - for( auto it = xelement.begin(); it != end; ++it ) - { - const std::string elementName = it->getName(); - auto choice = makeTechnicalChoice(); - - if( elementName == "up-bow" ) - { - choice->setChoice( TechnicalChoice::Choice::upBow ); - isSuccess &= choice->getUpBow()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "down-bow" ) - { - choice->setChoice( TechnicalChoice::Choice::downBow ); - isSuccess &= choice->getDownBow()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "harmonic" ) - { - choice->setChoice( TechnicalChoice::Choice::harmonic ); - isSuccess &= choice->getHarmonic()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "open-string" ) - { - choice->setChoice( TechnicalChoice::Choice::openString ); - isSuccess &= choice->getOpenString()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "thumb-position" ) - { - choice->setChoice( TechnicalChoice::Choice::thumbPosition ); - isSuccess &= choice->getThumbPosition()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "fingering" ) - { - choice->setChoice( TechnicalChoice::Choice::fingering ); - isSuccess &= choice->getFingering()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "pluck" ) - { - choice->setChoice( TechnicalChoice::Choice::pluck ); - isSuccess &= choice->getPluck()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "double-tongue" ) - { - choice->setChoice( TechnicalChoice::Choice::doubleTongue ); - isSuccess &= choice->getDoubleTongue()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "triple-tongue" ) - { - choice->setChoice( TechnicalChoice::Choice::tripleTongue ); - isSuccess &= choice->getTripleTongue()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "stopped" ) - { - choice->setChoice( TechnicalChoice::Choice::stopped ); - isSuccess &= choice->getStopped()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "snap-pizzicato" ) - { - choice->setChoice( TechnicalChoice::Choice::snapPizzicato ); - isSuccess &= choice->getSnapPizzicato()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "fret" ) - { - choice->setChoice( TechnicalChoice::Choice::fret ); - isSuccess &= choice->getFret()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "string" ) - { - choice->setChoice( TechnicalChoice::Choice::string_ ); - isSuccess &= choice->getString()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "hammer-on" ) - { - choice->setChoice( TechnicalChoice::Choice::hammerOn ); - isSuccess &= choice->getHammerOn()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "pull-off" ) - { - choice->setChoice( TechnicalChoice::Choice::pullOff ); - isSuccess &= choice->getPullOff()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "bend" ) - { - choice->setChoice( TechnicalChoice::Choice::bend ); - isSuccess &= choice->getBend()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "tap" ) - { - choice->setChoice( TechnicalChoice::Choice::tap ); - isSuccess &= choice->getTap()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "heel" ) - { - choice->setChoice( TechnicalChoice::Choice::heel ); - isSuccess &= choice->getHeel()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "toe" ) - { - choice->setChoice( TechnicalChoice::Choice::toe ); - isSuccess &= choice->getToe()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "fingernails" ) - { - choice->setChoice( TechnicalChoice::Choice::fingernails ); - isSuccess &= choice->getFingernails()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "hole" ) - { - choice->setChoice( TechnicalChoice::Choice::hole ); - isSuccess &= choice->getHole()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "arrow" ) - { - choice->setChoice( TechnicalChoice::Choice::arrow ); - isSuccess &= choice->getArrow()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "handbell" ) - { - choice->setChoice( TechnicalChoice::Choice::handbell ); - isSuccess &= choice->getHandbell()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else if ( elementName == "other-technical" ) - { - choice->setChoice( TechnicalChoice::Choice::otherTechnical ); - isSuccess &= choice->getOtherTechnical()->fromXElement( message, *it ); - myTechnicalChoiceSet.push_back( choice ); - continue; - } - else - { - message << "Technical: unexpected element '" << elementName << "' encountered" << std::endl; - isSuccess = false; - } - - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Technical.h b/Sourcecode/private/mx/core/elements/Technical.h deleted file mode 100644 index 50e7fa06c..000000000 --- a/Sourcecode/private/mx/core/elements/Technical.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( TechnicalChoice ) - MX_FORWARD_DECLARE_ELEMENT( Technical ) - - inline TechnicalPtr makeTechnical() { return std::make_shared(); } - - class Technical : public ElementInterface - { - public: - Technical(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ TechnicalChoice minOccurs = 0, maxOccurs = unbounded _________ */ - const TechnicalChoiceSet& getTechnicalChoiceSet() const; - void addTechnicalChoice( const TechnicalChoicePtr& value ); - void removeTechnicalChoice( const TechnicalChoiceSetIterConst& value ); - void clearTechnicalChoiceSet(); - TechnicalChoicePtr getTechnicalChoice( const TechnicalChoiceSetIterConst& setIterator ) const; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TechnicalChoiceSet myTechnicalChoiceSet; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/TechnicalChoice.cpp b/Sourcecode/private/mx/core/elements/TechnicalChoice.cpp deleted file mode 100644 index 530ed5f36..000000000 --- a/Sourcecode/private/mx/core/elements/TechnicalChoice.cpp +++ /dev/null @@ -1,596 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/TechnicalChoice.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/Arrow.h" -#include "mx/core/elements/Bend.h" -#include "mx/core/elements/DoubleTongue.h" -#include "mx/core/elements/DownBow.h" -#include "mx/core/elements/Fingering.h" -#include "mx/core/elements/Fingernails.h" -#include "mx/core/elements/Fret.h" -#include "mx/core/elements/HammerOn.h" -#include "mx/core/elements/Handbell.h" -#include "mx/core/elements/Harmonic.h" -#include "mx/core/elements/Heel.h" -#include "mx/core/elements/Hole.h" -#include "mx/core/elements/OpenString.h" -#include "mx/core/elements/OtherTechnical.h" -#include "mx/core/elements/Pluck.h" -#include "mx/core/elements/PullOff.h" -#include "mx/core/elements/SnapPizzicato.h" -#include "mx/core/elements/Stopped.h" -#include "mx/core/elements/String.h" -#include "mx/core/elements/Tap.h" -#include "mx/core/elements/ThumbPosition.h" -#include "mx/core/elements/Toe.h" -#include "mx/core/elements/TripleTongue.h" -#include "mx/core/elements/UpBow.h" -#include - -namespace mx -{ - namespace core - { - TechnicalChoice::TechnicalChoice() - :myChoice( Choice::upBow ) - ,myUpBow( makeUpBow() ) - ,myDownBow( makeDownBow() ) - ,myHarmonic( makeHarmonic() ) - ,myOpenString( makeOpenString() ) - ,myThumbPosition( makeThumbPosition() ) - ,myFingering( makeFingering() ) - ,myPluck( makePluck() ) - ,myDoubleTongue( makeDoubleTongue() ) - ,myTripleTongue( makeTripleTongue() ) - ,myStopped( makeStopped() ) - ,mySnapPizzicato( makeSnapPizzicato() ) - ,myFret( makeFret() ) - ,myString( makeString() ) - ,myHammerOn( makeHammerOn() ) - ,myPullOff( makePullOff() ) - ,myBend( makeBend() ) - ,myTap( makeTap() ) - ,myHeel( makeHeel() ) - ,myToe( makeToe() ) - ,myFingernails( makeFingernails() ) - ,myHole( makeHole() ) - ,myArrow( makeArrow() ) - ,myHandbell( makeHandbell() ) - ,myOtherTechnical( makeOtherTechnical() ) - {} - - - bool TechnicalChoice::hasAttributes() const - { - return false; - } - - - std::ostream& TechnicalChoice::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& TechnicalChoice::streamName( std::ostream& os ) const - { - os << "technical"; - return os; - } - - - bool TechnicalChoice::hasContents() const - { - return true; - } - - - std::ostream& TechnicalChoice::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - switch ( myChoice ) - { - case Choice::upBow: - { - myUpBow->toStream( os, indentLevel ); - } - break; - case Choice::downBow: - { - myDownBow->toStream( os, indentLevel ); - } - break; - case Choice::harmonic: - { - myHarmonic->toStream( os, indentLevel ); - } - break; - case Choice::openString: - { - myOpenString->toStream( os, indentLevel ); - } - break; - case Choice::thumbPosition: - { - myThumbPosition->toStream( os, indentLevel ); - } - break; - case Choice::fingering: - { - myFingering->toStream( os, indentLevel ); - } - break; - case Choice::pluck: - { - myPluck->toStream( os, indentLevel ); - } - break; - case Choice::doubleTongue: - { - myDoubleTongue->toStream( os, indentLevel ); - } - break; - case Choice::tripleTongue: - { - myTripleTongue->toStream( os, indentLevel ); - } - break; - case Choice::stopped: - { - myStopped->toStream( os, indentLevel ); - } - break; - case Choice::snapPizzicato: - { - mySnapPizzicato->toStream( os, indentLevel ); - } - break; - case Choice::fret: - { - myFret->toStream( os, indentLevel ); - } - break; - case Choice::string_: - { - myString->toStream( os, indentLevel ); - } - break; - case Choice::hammerOn: - { - myHammerOn->toStream( os, indentLevel ); - } - break; - case Choice::pullOff: - { - myPullOff->toStream( os, indentLevel ); - } - break; - case Choice::bend: - { - myBend->toStream( os, indentLevel ); - } - break; - case Choice::tap: - { - myTap->toStream( os, indentLevel ); - } - break; - case Choice::heel: - { - myHeel->toStream( os, indentLevel ); - } - break; - case Choice::toe: - { - myToe->toStream( os, indentLevel ); - } - break; - case Choice::fingernails: - { - myFingernails->toStream( os, indentLevel ); - } - break; - case Choice::hole: - { - myHole->toStream( os, indentLevel ); - } - break; - case Choice::arrow: - { - myArrow->toStream( os, indentLevel ); - } - break; - case Choice::handbell: - { - myHandbell->toStream( os, indentLevel ); - } - break; - case Choice::otherTechnical: - { - myOtherTechnical->toStream( os, indentLevel ); - } - break; - default: - break; - } - isOneLineOnly = false; - return os; - } - - - TechnicalChoice::Choice TechnicalChoice::getChoice() const - { - return myChoice; - } - - - void TechnicalChoice::setChoice( const TechnicalChoice::Choice value ) - { - myChoice = value; - } - - - UpBowPtr TechnicalChoice::getUpBow() const - { - return myUpBow; - } - - - void TechnicalChoice::setUpBow( const UpBowPtr& value ) - { - if( value ) - { - myUpBow = value; - } - } - - - DownBowPtr TechnicalChoice::getDownBow() const - { - return myDownBow; - } - - - void TechnicalChoice::setDownBow( const DownBowPtr& value ) - { - if( value ) - { - myDownBow = value; - } - } - - - HarmonicPtr TechnicalChoice::getHarmonic() const - { - return myHarmonic; - } - - - void TechnicalChoice::setHarmonic( const HarmonicPtr& value ) - { - if( value ) - { - myHarmonic = value; - } - } - - - OpenStringPtr TechnicalChoice::getOpenString() const - { - return myOpenString; - } - - - void TechnicalChoice::setOpenString( const OpenStringPtr& value ) - { - if( value ) - { - myOpenString = value; - } - } - - - ThumbPositionPtr TechnicalChoice::getThumbPosition() const - { - return myThumbPosition; - } - - - void TechnicalChoice::setThumbPosition( const ThumbPositionPtr& value ) - { - if( value ) - { - myThumbPosition = value; - } - } - - - FingeringPtr TechnicalChoice::getFingering() const - { - return myFingering; - } - - - void TechnicalChoice::setFingering( const FingeringPtr& value ) - { - if( value ) - { - myFingering = value; - } - } - - - PluckPtr TechnicalChoice::getPluck() const - { - return myPluck; - } - - - void TechnicalChoice::setPluck( const PluckPtr& value ) - { - if( value ) - { - myPluck = value; - } - } - - - DoubleTonguePtr TechnicalChoice::getDoubleTongue() const - { - return myDoubleTongue; - } - - - void TechnicalChoice::setDoubleTongue( const DoubleTonguePtr& value ) - { - if( value ) - { - myDoubleTongue = value; - } - } - - - TripleTonguePtr TechnicalChoice::getTripleTongue() const - { - return myTripleTongue; - } - - - void TechnicalChoice::setTripleTongue( const TripleTonguePtr& value ) - { - if( value ) - { - myTripleTongue = value; - } - } - - - StoppedPtr TechnicalChoice::getStopped() const - { - return myStopped; - } - - - void TechnicalChoice::setStopped( const StoppedPtr& value ) - { - if( value ) - { - myStopped = value; - } - } - - - SnapPizzicatoPtr TechnicalChoice::getSnapPizzicato() const - { - return mySnapPizzicato; - } - - - void TechnicalChoice::setSnapPizzicato( const SnapPizzicatoPtr& value ) - { - if( value ) - { - mySnapPizzicato = value; - } - } - - - FretPtr TechnicalChoice::getFret() const - { - return myFret; - } - - - void TechnicalChoice::setFret( const FretPtr& value ) - { - if( value ) - { - myFret = value; - } - } - - - StringPtr TechnicalChoice::getString() const - { - return myString; - } - - - void TechnicalChoice::setString( const StringPtr& value ) - { - if( value ) - { - myString = value; - } - } - - - HammerOnPtr TechnicalChoice::getHammerOn() const - { - return myHammerOn; - } - - - void TechnicalChoice::setHammerOn( const HammerOnPtr& value ) - { - if( value ) - { - myHammerOn = value; - } - } - - - PullOffPtr TechnicalChoice::getPullOff() const - { - return myPullOff; - } - - - void TechnicalChoice::setPullOff( const PullOffPtr& value ) - { - if( value ) - { - myPullOff = value; - } - } - - - BendPtr TechnicalChoice::getBend() const - { - return myBend; - } - - - void TechnicalChoice::setBend( const BendPtr& value ) - { - if( value ) - { - myBend = value; - } - } - - - TapPtr TechnicalChoice::getTap() const - { - return myTap; - } - - - void TechnicalChoice::setTap( const TapPtr& value ) - { - if( value ) - { - myTap = value; - } - } - - - HeelPtr TechnicalChoice::getHeel() const - { - return myHeel; - } - - - void TechnicalChoice::setHeel( const HeelPtr& value ) - { - if( value ) - { - myHeel = value; - } - } - - - ToePtr TechnicalChoice::getToe() const - { - return myToe; - } - - - void TechnicalChoice::setToe( const ToePtr& value ) - { - if( value ) - { - myToe = value; - } - } - - - FingernailsPtr TechnicalChoice::getFingernails() const - { - return myFingernails; - } - - - void TechnicalChoice::setFingernails( const FingernailsPtr& value ) - { - if( value ) - { - myFingernails = value; - } - } - - - HolePtr TechnicalChoice::getHole() const - { - return myHole; - } - - - void TechnicalChoice::setHole( const HolePtr& value ) - { - if( value ) - { - myHole = value; - } - } - - - ArrowPtr TechnicalChoice::getArrow() const - { - return myArrow; - } - - - void TechnicalChoice::setArrow( const ArrowPtr& value ) - { - if( value ) - { - myArrow = value; - } - } - - - HandbellPtr TechnicalChoice::getHandbell() const - { - return myHandbell; - } - - - void TechnicalChoice::setHandbell( const HandbellPtr& value ) - { - if( value ) - { - myHandbell = value; - } - } - - - OtherTechnicalPtr TechnicalChoice::getOtherTechnical() const - { - return myOtherTechnical; - } - - - void TechnicalChoice::setOtherTechnical( const OtherTechnicalPtr& value ) - { - if( value ) - { - myOtherTechnical = value; - } - } - - MX_FROM_XELEMENT_UNUSED( TechnicalChoice ); - } -} diff --git a/Sourcecode/private/mx/core/elements/TechnicalChoice.h b/Sourcecode/private/mx/core/elements/TechnicalChoice.h deleted file mode 100644 index df45d47cc..000000000 --- a/Sourcecode/private/mx/core/elements/TechnicalChoice.h +++ /dev/null @@ -1,216 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Arrow ) - MX_FORWARD_DECLARE_ELEMENT( Bend ) - MX_FORWARD_DECLARE_ELEMENT( DoubleTongue ) - MX_FORWARD_DECLARE_ELEMENT( DownBow ) - MX_FORWARD_DECLARE_ELEMENT( Fingering ) - MX_FORWARD_DECLARE_ELEMENT( Fingernails ) - MX_FORWARD_DECLARE_ELEMENT( Fret ) - MX_FORWARD_DECLARE_ELEMENT( HammerOn ) - MX_FORWARD_DECLARE_ELEMENT( Handbell ) - MX_FORWARD_DECLARE_ELEMENT( Harmonic ) - MX_FORWARD_DECLARE_ELEMENT( Heel ) - MX_FORWARD_DECLARE_ELEMENT( Hole ) - MX_FORWARD_DECLARE_ELEMENT( OpenString ) - MX_FORWARD_DECLARE_ELEMENT( OtherTechnical ) - MX_FORWARD_DECLARE_ELEMENT( Pluck ) - MX_FORWARD_DECLARE_ELEMENT( PullOff ) - MX_FORWARD_DECLARE_ELEMENT( SnapPizzicato ) - MX_FORWARD_DECLARE_ELEMENT( Stopped ) - MX_FORWARD_DECLARE_ELEMENT( String ) - MX_FORWARD_DECLARE_ELEMENT( Tap ) - MX_FORWARD_DECLARE_ELEMENT( ThumbPosition ) - MX_FORWARD_DECLARE_ELEMENT( Toe ) - MX_FORWARD_DECLARE_ELEMENT( TripleTongue ) - MX_FORWARD_DECLARE_ELEMENT( UpBow ) - MX_FORWARD_DECLARE_ELEMENT( TechnicalChoice ) - - inline TechnicalChoicePtr makeTechnicalChoice() { return std::make_shared(); } - - class TechnicalChoice : public ElementInterface - { - public: - enum class Choice - { - upBow = 1, - downBow = 2, - harmonic = 3, - openString = 4, - thumbPosition = 5, - fingering = 6, - pluck = 7, - doubleTongue = 8, - tripleTongue = 9, - stopped = 10, - snapPizzicato = 11, - fret = 12, - string_ = 13, - hammerOn = 14, - pullOff = 15, - bend = 16, - tap = 17, - heel = 18, - toe = 19, - fingernails = 20, - hole = 21, - arrow = 22, - handbell = 23, - otherTechnical = 24 - }; - TechnicalChoice(); - - virtual bool hasAttributes() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual bool hasContents() const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - - /* _________ Choice minOccurs = 1, maxOccurs = 1 _________ */ - TechnicalChoice::Choice getChoice() const; - void setChoice( const TechnicalChoice::Choice value ); - - /* _________ UpBow minOccurs = 1, maxOccurs = 1 _________ */ - UpBowPtr getUpBow() const; - void setUpBow( const UpBowPtr& value ); - - /* _________ DownBow minOccurs = 1, maxOccurs = 1 _________ */ - DownBowPtr getDownBow() const; - void setDownBow( const DownBowPtr& value ); - - /* _________ Harmonic minOccurs = 1, maxOccurs = 1 _________ */ - HarmonicPtr getHarmonic() const; - void setHarmonic( const HarmonicPtr& value ); - - /* _________ OpenString minOccurs = 1, maxOccurs = 1 _________ */ - OpenStringPtr getOpenString() const; - void setOpenString( const OpenStringPtr& value ); - - /* _________ ThumbPosition minOccurs = 1, maxOccurs = 1 _________ */ - ThumbPositionPtr getThumbPosition() const; - void setThumbPosition( const ThumbPositionPtr& value ); - - /* _________ Fingering minOccurs = 1, maxOccurs = 1 _________ */ - FingeringPtr getFingering() const; - void setFingering( const FingeringPtr& value ); - - /* _________ Pluck minOccurs = 1, maxOccurs = 1 _________ */ - PluckPtr getPluck() const; - void setPluck( const PluckPtr& value ); - - /* _________ DoubleTongue minOccurs = 1, maxOccurs = 1 _________ */ - DoubleTonguePtr getDoubleTongue() const; - void setDoubleTongue( const DoubleTonguePtr& value ); - - /* _________ TripleTongue minOccurs = 1, maxOccurs = 1 _________ */ - TripleTonguePtr getTripleTongue() const; - void setTripleTongue( const TripleTonguePtr& value ); - - /* _________ Stopped minOccurs = 1, maxOccurs = 1 _________ */ - StoppedPtr getStopped() const; - void setStopped( const StoppedPtr& value ); - - /* _________ SnapPizzicato minOccurs = 1, maxOccurs = 1 _________ */ - SnapPizzicatoPtr getSnapPizzicato() const; - void setSnapPizzicato( const SnapPizzicatoPtr& value ); - - /* _________ Fret minOccurs = 1, maxOccurs = 1 _________ */ - FretPtr getFret() const; - void setFret( const FretPtr& value ); - - /* _________ String minOccurs = 1, maxOccurs = 1 _________ */ - StringPtr getString() const; - void setString( const StringPtr& value ); - - /* _________ HammerOn minOccurs = 1, maxOccurs = 1 _________ */ - HammerOnPtr getHammerOn() const; - void setHammerOn( const HammerOnPtr& value ); - - /* _________ PullOff minOccurs = 1, maxOccurs = 1 _________ */ - PullOffPtr getPullOff() const; - void setPullOff( const PullOffPtr& value ); - - /* _________ Bend minOccurs = 1, maxOccurs = 1 _________ */ - BendPtr getBend() const; - void setBend( const BendPtr& value ); - - /* _________ Tap minOccurs = 1, maxOccurs = 1 _________ */ - TapPtr getTap() const; - void setTap( const TapPtr& value ); - - /* _________ Heel minOccurs = 1, maxOccurs = 1 _________ */ - HeelPtr getHeel() const; - void setHeel( const HeelPtr& value ); - - /* _________ Toe minOccurs = 1, maxOccurs = 1 _________ */ - ToePtr getToe() const; - void setToe( const ToePtr& value ); - - /* _________ Fingernails minOccurs = 1, maxOccurs = 1 _________ */ - FingernailsPtr getFingernails() const; - void setFingernails( const FingernailsPtr& value ); - - /* _________ Hole minOccurs = 1, maxOccurs = 1 _________ */ - HolePtr getHole() const; - void setHole( const HolePtr& value ); - - /* _________ Arrow minOccurs = 1, maxOccurs = 1 _________ */ - ArrowPtr getArrow() const; - void setArrow( const ArrowPtr& value ); - - /* _________ Handbell minOccurs = 1, maxOccurs = 1 _________ */ - HandbellPtr getHandbell() const; - void setHandbell( const HandbellPtr& value ); - - /* _________ OtherTechnical minOccurs = 1, maxOccurs = 1 _________ */ - OtherTechnicalPtr getOtherTechnical() const; - void setOtherTechnical( const OtherTechnicalPtr& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - Choice myChoice; - UpBowPtr myUpBow; - DownBowPtr myDownBow; - HarmonicPtr myHarmonic; - OpenStringPtr myOpenString; - ThumbPositionPtr myThumbPosition; - FingeringPtr myFingering; - PluckPtr myPluck; - DoubleTonguePtr myDoubleTongue; - TripleTonguePtr myTripleTongue; - StoppedPtr myStopped; - SnapPizzicatoPtr mySnapPizzicato; - FretPtr myFret; - StringPtr myString; - HammerOnPtr myHammerOn; - PullOffPtr myPullOff; - BendPtr myBend; - TapPtr myTap; - HeelPtr myHeel; - ToePtr myToe; - FingernailsPtr myFingernails; - HolePtr myHole; - ArrowPtr myArrow; - HandbellPtr myHandbell; - OtherTechnicalPtr myOtherTechnical; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Tenths.cpp b/Sourcecode/private/mx/core/elements/Tenths.cpp deleted file mode 100644 index 3c648e063..000000000 --- a/Sourcecode/private/mx/core/elements/Tenths.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Tenths.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Tenths::Tenths() - :myValue() - {} - - - Tenths::Tenths( const TenthsValue& value ) - :myValue( value ) - {} - - - bool Tenths::hasAttributes() const - { - return false; - } - - - bool Tenths::hasContents() const - { - return true; - } - - - std::ostream& Tenths::streamAttributes( std::ostream& os ) const - { - return os; - } - - - std::ostream& Tenths::streamName( std::ostream& os ) const - { - os << "tenths"; - return os; - } - - - std::ostream& Tenths::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - TenthsValue Tenths::getValue() const - { - return myValue; - } - - - void Tenths::setValue( const TenthsValue& value ) - { - myValue = value; - } - - - bool Tenths::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - MX_UNUSED( message ); - MX_UNUSED( xelement ); - myValue.parse( xelement.getValue() ); - return true; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Tenths.h b/Sourcecode/private/mx/core/elements/Tenths.h deleted file mode 100644 index 8fbdba281..000000000 --- a/Sourcecode/private/mx/core/elements/Tenths.h +++ /dev/null @@ -1,47 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/Decimals.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ELEMENT( Tenths ) - - inline TenthsPtr makeTenths() { return std::make_shared(); } - inline TenthsPtr makeTenths( const TenthsValue& value ) { return std::make_shared( value ); } - inline TenthsPtr makeTenths( TenthsValue&& value ) { return std::make_shared( std::move( value ) ); } - - class Tenths : public ElementInterface - { - public: - Tenths(); - Tenths( const TenthsValue& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TenthsValue getValue() const; - void setValue( const TenthsValue& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TenthsValue myValue; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Tenuto.cpp b/Sourcecode/private/mx/core/elements/Tenuto.cpp deleted file mode 100644 index e1f281e20..000000000 --- a/Sourcecode/private/mx/core/elements/Tenuto.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Tenuto.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Tenuto::Tenuto() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Tenuto::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Tenuto::hasContents() const { return false; } - std::ostream& Tenuto::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Tenuto::streamName( std::ostream& os ) const { os << "tenuto"; return os; } - std::ostream& Tenuto::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr Tenuto::getAttributes() const - { - return myAttributes; - } - - - void Tenuto::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Tenuto::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Tenuto.h b/Sourcecode/private/mx/core/elements/Tenuto.h deleted file mode 100644 index bc8481eea..000000000 --- a/Sourcecode/private/mx/core/elements/Tenuto.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Tenuto ) - - inline TenutoPtr makeTenuto() { return std::make_shared(); } - - class Tenuto : public ElementInterface - { - public: - Tenuto(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Text.cpp b/Sourcecode/private/mx/core/elements/Text.cpp deleted file mode 100644 index 40a2f92fb..000000000 --- a/Sourcecode/private/mx/core/elements/Text.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Text.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Text::Text() - :myValue() - ,myAttributes( std::make_shared() ) - {} - - - Text::Text( const XsString& value ) - :myValue( value ) - ,myAttributes( std::make_shared() ) - {} - - - bool Text::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Text::hasContents() const - { - return true; - } - - - std::ostream& Text::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Text::streamName( std::ostream& os ) const - { - os << "text"; - return os; - } - - - std::ostream& Text::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - os << myValue; - return os; - } - - - TextAttributesPtr Text::getAttributes() const - { - return myAttributes; - } - - - void Text::setAttributes( const TextAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - XsString Text::getValue() const - { - return myValue; - } - - - void Text::setValue( const XsString& value ) - { - myValue = value; - } - - - bool Text::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - myValue.setValue( xelement.getValue() ); - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Text.h b/Sourcecode/private/mx/core/elements/Text.h deleted file mode 100644 index bf0cb239a..000000000 --- a/Sourcecode/private/mx/core/elements/Text.h +++ /dev/null @@ -1,52 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/XsString.h" -#include "mx/core/elements/TextAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TextAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Text ) - - inline TextPtr makeText() { return std::make_shared(); } - inline TextPtr makeText( const XsString& value ) { return std::make_shared( value ); } - inline TextPtr makeText( XsString&& value ) { return std::make_shared( std::move( value ) ); } - - class Text : public ElementInterface - { - public: - Text(); - Text( const XsString& value ); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TextAttributesPtr getAttributes() const; - void setAttributes( const TextAttributesPtr& attributes ); - XsString getValue() const; - void setValue( const XsString& value ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - XsString myValue; - TextAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/TextAttributes.cpp b/Sourcecode/private/mx/core/elements/TextAttributes.cpp deleted file mode 100644 index 530da0831..000000000 --- a/Sourcecode/private/mx/core/elements/TextAttributes.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/TextAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - TextAttributes::TextAttributes() - :fontFamily() - ,fontStyle( FontStyle::normal ) - ,fontSize( FontSize{ CssFontSize::medium } ) - ,fontWeight( FontWeight::normal ) - ,underline() - ,overline() - ,lineThrough() - ,rotation() - ,letterSpacing() - ,lang( XmlLang{ "it" } ) - ,hasFontFamily( false ) - ,hasFontStyle( false ) - ,hasFontSize( false ) - ,hasFontWeight( false ) - ,hasUnderline( false ) - ,hasOverline( false ) - ,hasLineThrough( false ) - ,hasRotation( false ) - ,hasLetterSpacing( false ) - ,hasLang( false ) - {} - - - bool TextAttributes::hasValues() const - { - return hasFontFamily || - hasFontStyle || - hasFontSize || - hasFontWeight || - hasUnderline || - hasOverline || - hasLineThrough || - hasRotation || - hasLetterSpacing || - hasLang; - } - - - std::ostream& TextAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, fontFamily, "font-family", hasFontFamily ); - streamAttribute( os, fontStyle, "font-style", hasFontStyle ); - streamAttribute( os, fontSize, "font-size", hasFontSize ); - streamAttribute( os, fontWeight, "font-weight", hasFontWeight ); - streamAttribute( os, underline, "underline", hasUnderline ); - streamAttribute( os, overline, "overline", hasOverline ); - streamAttribute( os, lineThrough, "line-through", hasLineThrough ); - streamAttribute( os, rotation, "rotation", hasRotation ); - streamAttribute( os, letterSpacing, "letter-spacing", hasLetterSpacing ); - streamAttribute( os, lang, "xml:lang", hasLang ); - } - return os; - } - - - bool TextAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "TextAttributes"; - bool isSuccess = true; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, underline, hasUnderline, "underline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, overline, hasOverline, "overline" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineThrough, hasLineThrough, "line-through" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, rotation, hasRotation, "rotation" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, letterSpacing, hasLetterSpacing, "letter-spacing" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "lang" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lang, hasLang, "xml:lang" ) ) { continue; } - } - - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/TextAttributes.h b/Sourcecode/private/mx/core/elements/TextAttributes.h deleted file mode 100644 index 6187be664..000000000 --- a/Sourcecode/private/mx/core/elements/TextAttributes.h +++ /dev/null @@ -1,59 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/FontSize.h" -#include "mx/core/Integers.h" -#include "mx/core/NumberOrNormal.h" -#include "mx/core/XmlLang.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TextAttributes ) - - struct TextAttributes : public AttributesInterface - { - public: - TextAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - CommaSeparatedText fontFamily; - FontStyle fontStyle; - FontSize fontSize; - FontWeight fontWeight; - NumberOfLines underline; - NumberOfLines overline; - NumberOfLines lineThrough; - RotationDegrees rotation; - NumberOrNormal letterSpacing; - XmlLang lang; - bool hasFontFamily; - bool hasFontStyle; - bool hasFontSize; - bool hasFontWeight; - bool hasUnderline; - bool hasOverline; - bool hasLineThrough; - bool hasRotation; - bool hasLetterSpacing; - bool hasLang; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/ThumbPosition.cpp b/Sourcecode/private/mx/core/elements/ThumbPosition.cpp deleted file mode 100644 index a6b7886b0..000000000 --- a/Sourcecode/private/mx/core/elements/ThumbPosition.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/ThumbPosition.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - ThumbPosition::ThumbPosition() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool ThumbPosition::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool ThumbPosition::hasContents() const { return false; } - std::ostream& ThumbPosition::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& ThumbPosition::streamName( std::ostream& os ) const { os << "thumb-position"; return os; } - std::ostream& ThumbPosition::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - EmptyPlacementAttributesPtr ThumbPosition::getAttributes() const - { - return myAttributes; - } - - - void ThumbPosition::setAttributes( const EmptyPlacementAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool ThumbPosition::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/ThumbPosition.h b/Sourcecode/private/mx/core/elements/ThumbPosition.h deleted file mode 100644 index c1475e3ab..000000000 --- a/Sourcecode/private/mx/core/elements/ThumbPosition.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/EmptyPlacementAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( EmptyPlacementAttributes ) - MX_FORWARD_DECLARE_ELEMENT( ThumbPosition ) - - inline ThumbPositionPtr makeThumbPosition() { return std::make_shared(); } - - class ThumbPosition : public ElementInterface - { - public: - ThumbPosition(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - EmptyPlacementAttributesPtr getAttributes() const; - void setAttributes( const EmptyPlacementAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - EmptyPlacementAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Tie.cpp b/Sourcecode/private/mx/core/elements/Tie.cpp deleted file mode 100644 index a1385ace3..000000000 --- a/Sourcecode/private/mx/core/elements/Tie.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Tie.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Tie::Tie() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Tie::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Tie::hasContents() const { return false; } - std::ostream& Tie::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Tie::streamName( std::ostream& os ) const { os << "tie"; return os; } - std::ostream& Tie::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - TieAttributesPtr Tie::getAttributes() const - { - return myAttributes; - } - - - void Tie::setAttributes( const TieAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Tie::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Tie.h b/Sourcecode/private/mx/core/elements/Tie.h deleted file mode 100644 index bd649587c..000000000 --- a/Sourcecode/private/mx/core/elements/Tie.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/TieAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TieAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Tie ) - - inline TiePtr makeTie() { return std::make_shared(); } - - class Tie : public ElementInterface - { - public: - Tie(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TieAttributesPtr getAttributes() const; - void setAttributes( const TieAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TieAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/TieAttributes.cpp b/Sourcecode/private/mx/core/elements/TieAttributes.cpp deleted file mode 100644 index faf812469..000000000 --- a/Sourcecode/private/mx/core/elements/TieAttributes.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/TieAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - TieAttributes::TieAttributes() - :type( StartStop::start ) - ,timeOnly() - ,hasType( true ) - ,hasTimeOnly( false ) - {} - - - bool TieAttributes::hasValues() const - { - return hasType || - hasTimeOnly; - } - - - std::ostream& TieAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, timeOnly, "time-only", hasTimeOnly ); - } - return os; - } - - - bool TieAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "TieAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, timeOnly, hasTimeOnly, "time-only" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/TieAttributes.h b/Sourcecode/private/mx/core/elements/TieAttributes.h deleted file mode 100644 index 64abadfc1..000000000 --- a/Sourcecode/private/mx/core/elements/TieAttributes.h +++ /dev/null @@ -1,39 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/CommaSeparatedText.h" -#include "mx/core/Enums.h" -#include "mx/core/TimeOnly.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TieAttributes ) - - struct TieAttributes : public AttributesInterface - { - public: - TieAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStop type; - TimeOnly timeOnly; - const bool hasType; - bool hasTimeOnly; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Tied.cpp b/Sourcecode/private/mx/core/elements/Tied.cpp deleted file mode 100644 index dce63994e..000000000 --- a/Sourcecode/private/mx/core/elements/Tied.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Tied.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - Tied::Tied() - :ElementInterface() - ,myAttributes( std::make_shared() ) - {} - - - bool Tied::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - bool Tied::hasContents() const { return false; } - std::ostream& Tied::streamAttributes( std::ostream& os ) const - { - if ( myAttributes ) - { - myAttributes->toStream( os ); - } - return os; - } - - - std::ostream& Tied::streamName( std::ostream& os ) const { os << "tied"; return os; } - std::ostream& Tied::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - MX_UNUSED( indentLevel ); - isOneLineOnly = true; - return os; - } - - - TiedAttributesPtr Tied::getAttributes() const - { - return myAttributes; - } - - - void Tied::setAttributes( const TiedAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - bool Tied::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - return myAttributes->fromXElement( message, xelement ); - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Tied.h b/Sourcecode/private/mx/core/elements/Tied.h deleted file mode 100644 index 9d785c3a0..000000000 --- a/Sourcecode/private/mx/core/elements/Tied.h +++ /dev/null @@ -1,45 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/TiedAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TiedAttributes ) - MX_FORWARD_DECLARE_ELEMENT( Tied ) - - inline TiedPtr makeTied() { return std::make_shared(); } - - class Tied : public ElementInterface - { - public: - Tied(); - - virtual bool hasAttributes() const; - virtual bool hasContents() const; - virtual std::ostream& streamAttributes( std::ostream& os ) const; - virtual std::ostream& streamName( std::ostream& os ) const; - virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const; - TiedAttributesPtr getAttributes() const; - void setAttributes( const TiedAttributesPtr& attributes ); - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - - private: - TiedAttributesPtr myAttributes; - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/TiedAttributes.cpp b/Sourcecode/private/mx/core/elements/TiedAttributes.cpp deleted file mode 100644 index abd228bc4..000000000 --- a/Sourcecode/private/mx/core/elements/TiedAttributes.cpp +++ /dev/null @@ -1,144 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/TiedAttributes.h" -#include "mx/core/FromXElement.h" -#include - -namespace mx -{ - namespace core - { - TiedAttributes::TiedAttributes() - :type( StartStopContinue::start ) - ,number() - ,lineType( LineType::solid ) - ,dashLength() - ,spaceLength() - ,defaultX() - ,defaultY() - ,relativeX() - ,relativeY() - ,placement( AboveBelow::below ) - ,orientation() - ,bezierOffset() - ,bezierOffset2() - ,bezierX() - ,bezierY() - ,bezierX2() - ,bezierY2() - ,color() - ,hasType( true ) - ,hasNumber( false ) - ,hasLineType( false ) - ,hasDashLength( false ) - ,hasSpaceLength( false ) - ,hasDefaultX( false ) - ,hasDefaultY( false ) - ,hasRelativeX( false ) - ,hasRelativeY( false ) - ,hasPlacement( false ) - ,hasOrientation( false ) - ,hasBezierOffset( false ) - ,hasBezierOffset2( false ) - ,hasBezierX( false ) - ,hasBezierY( false ) - ,hasBezierX2( false ) - ,hasBezierY2( false ) - ,hasColor( false ) - {} - - - bool TiedAttributes::hasValues() const - { - return hasType || - hasNumber || - hasLineType || - hasDashLength || - hasSpaceLength || - hasDefaultX || - hasDefaultY || - hasRelativeX || - hasRelativeY || - hasPlacement || - hasOrientation || - hasBezierOffset || - hasBezierOffset2 || - hasBezierX || - hasBezierY || - hasBezierX2 || - hasBezierY2 || - hasColor; - } - - - std::ostream& TiedAttributes::toStream( std::ostream& os ) const - { - if ( hasValues() ) - { - streamAttribute( os, type, "type", hasType ); - streamAttribute( os, number, "number", hasNumber ); - streamAttribute( os, lineType, "line-type", hasLineType ); - streamAttribute( os, dashLength, "dash-length", hasDashLength ); - streamAttribute( os, spaceLength, "space-length", hasSpaceLength ); - streamAttribute( os, defaultX, "default-x", hasDefaultX ); - streamAttribute( os, defaultY, "default-y", hasDefaultY ); - streamAttribute( os, relativeX, "relative-x", hasRelativeX ); - streamAttribute( os, relativeY, "relative-y", hasRelativeY ); - streamAttribute( os, placement, "placement", hasPlacement ); - streamAttribute( os, orientation, "orientation", hasOrientation ); - streamAttribute( os, bezierOffset, "bezier-offset", hasBezierOffset ); - streamAttribute( os, bezierOffset2, "bezier-offset2", hasBezierOffset2 ); - streamAttribute( os, bezierX, "bezier-x", hasBezierX ); - streamAttribute( os, bezierY, "bezier-y", hasBezierY ); - streamAttribute( os, bezierX2, "bezier-x2", hasBezierX2 ); - streamAttribute( os, bezierY2, "bezier-y2", hasBezierY2 ); - streamAttribute( os, color, "color", hasColor ); - } - return os; - } - - - bool TiedAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - const char* const className = "TiedAttributes"; - bool isSuccess = true; - bool isTypeFound = false; - - auto it = xelement.attributesBegin(); - auto endIter = xelement.attributesEnd(); - - for( ; it != endIter; ++it ) - { - if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStopContinue ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, placement, hasPlacement, "placement", &parseAboveBelow ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, orientation, hasOrientation, "orientation", &parseOverUnder ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierOffset, hasBezierOffset, "bezier-offset" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierOffset2, hasBezierOffset2, "bezier-offset-2" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierX, hasBezierX, "bezier-x" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierY, hasBezierY, "bezier-y" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierX2, hasBezierX2, "bezier-x-2" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, bezierY2, hasBezierY2, "bezier-y-2" ) ) { continue; } - if( parseAttribute( message, it, className, isSuccess, color, hasColor, "color" ) ) { continue; } - } - - if( !isTypeFound ) - { - isSuccess = false; - message << className << ": 'number' is a required attribute but was not found" << std::endl; - } - - MX_RETURN_IS_SUCCESS; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/TiedAttributes.h b/Sourcecode/private/mx/core/elements/TiedAttributes.h deleted file mode 100644 index e1d31edcc..000000000 --- a/Sourcecode/private/mx/core/elements/TiedAttributes.h +++ /dev/null @@ -1,72 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/AttributesInterface.h" -#include "mx/core/Decimals.h" -#include "mx/core/Enums.h" -#include "mx/core/Integers.h" -#include "mx/core/Color.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TiedAttributes ) - - struct TiedAttributes : public AttributesInterface - { - public: - TiedAttributes(); - virtual bool hasValues() const; - virtual std::ostream& toStream( std::ostream& os ) const; - StartStopContinue type; - NumberLevel number; - LineType lineType; - TenthsValue dashLength; - TenthsValue spaceLength; - TenthsValue defaultX; - TenthsValue defaultY; - TenthsValue relativeX; - TenthsValue relativeY; - AboveBelow placement; - OverUnder orientation; - DivisionsValue bezierOffset; - DivisionsValue bezierOffset2; - TenthsValue bezierX; - TenthsValue bezierY; - TenthsValue bezierX2; - TenthsValue bezierY2; - Color color; - const bool hasType; - bool hasNumber; - bool hasLineType; - bool hasDashLength; - bool hasSpaceLength; - bool hasDefaultX; - bool hasDefaultY; - bool hasRelativeX; - bool hasRelativeY; - bool hasPlacement; - bool hasOrientation; - bool hasBezierOffset; - bool hasBezierOffset2; - bool hasBezierX; - bool hasBezierY; - bool hasBezierX2; - bool hasBezierY2; - bool hasColor; - - private: - virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ); - }; - } -} diff --git a/Sourcecode/private/mx/core/elements/Time.cpp b/Sourcecode/private/mx/core/elements/Time.cpp deleted file mode 100644 index ebb7e625d..000000000 --- a/Sourcecode/private/mx/core/elements/Time.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#include "mx/core/elements/Time.h" -#include "mx/core/FromXElement.h" -#include "mx/core/elements/TimeChoice.h" -#include "mx/core/elements/SenzaMisura.h" -#include "mx/core/elements/TimeSignatureGroup.h" -#include - -namespace mx -{ - namespace core - { - Time::Time() - :myAttributes( std::make_shared() ) - ,myChoice( makeTimeChoice() ) - {} - - - bool Time::hasAttributes() const - { - return myAttributes->hasValues(); - } - - - std::ostream& Time::streamAttributes( std::ostream& os ) const - { - return myAttributes->toStream( os ); - } - - - std::ostream& Time::streamName( std::ostream& os ) const - { - os << "time"; - return os; - } - - - bool Time::hasContents() const - { - return true; - } - - - std::ostream& Time::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const - { - os << std::endl; - myChoice->streamContents( os, indentLevel+1, isOneLineOnly ); - os << std::endl; - isOneLineOnly = false; - return os; - } - - - TimeAttributesPtr Time::getAttributes() const - { - return myAttributes; - } - - - void Time::setAttributes( const TimeAttributesPtr& value ) - { - if ( value ) - { - myAttributes = value; - } - } - - - TimeChoicePtr Time::getTimeChoice() const - { - return myChoice; - } - - - void Time::setTimeChoice( const TimeChoicePtr& value ) - { - myChoice = value; - } - - - bool Time::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement ) - { - bool isSuccess = true; - isSuccess &= myAttributes->fromXElement( message, xelement ); - bool isFirstTimeSignatureAdded = false; - - auto endIter = xelement.end(); - - for( auto it = xelement.begin(); it != endIter; ++it ) - { - if( it->getName() == "senza-misura" ) - { - myChoice->setChoice( TimeChoice::Choice::senzaMisura ); - isSuccess &= myChoice->getSenzaMisura()->fromXElement( message, *it ); - } - else - { - myChoice->setChoice( TimeChoice::Choice::timeSignature ); - auto timeSignature = makeTimeSignatureGroup(); - importGroup( message, it, endIter, isSuccess, timeSignature ); - - if( !isFirstTimeSignatureAdded && myChoice->getTimeSignatureGroupSet().size() == 1 ) - { - myChoice->addTimeSignatureGroup( timeSignature ); - myChoice->removeTimeSignatureGroup( myChoice->getTimeSignatureGroupSet().cbegin() ); - isFirstTimeSignatureAdded = true; - } - else - { - myChoice->addTimeSignatureGroup( timeSignature ); - isFirstTimeSignatureAdded = true; - } - } - } - - return isSuccess; - } - - } -} diff --git a/Sourcecode/private/mx/core/elements/Time.h b/Sourcecode/private/mx/core/elements/Time.h deleted file mode 100644 index f951f6758..000000000 --- a/Sourcecode/private/mx/core/elements/Time.h +++ /dev/null @@ -1,49 +0,0 @@ -// MusicXML Class Library -// Copyright (c) by Matthew James Briggs -// Distributed under the MIT License - -#pragma once - -#include "mx/core/ForwardDeclare.h" -#include "mx/core/ElementInterface.h" -#include "mx/core/elements/TimeAttributes.h" - -#include -#include -#include - -namespace mx -{ - namespace core - { - - MX_FORWARD_DECLARE_ATTRIBUTES( TimeAttributes ) - MX_FORWARD_DECLARE_ELEMENT( TimeChoice ) - MX_FORWARD_DECLARE_ELEMENT( Time ) - - inline TimePtr makeTime() { return std::make_shared