Notation
ci / checks (push) Successful in 38m51s

This commit is contained in:
khodowany
2026-09-05 16:18:34 -05:00
parent 6da21a2deb
commit ca285d63d4
6 changed files with 1463 additions and 238 deletions
+67
View File
@@ -1,6 +1,9 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <limits>
#include <string>
#include <string_view>
#include <vector>
@@ -17,11 +20,75 @@ enum class score_accidental_mark {
SHARP,
};
enum class score_layout_item_kind {
FILL_RECT,
STROKE_RECT,
STROKE_LINE,
CURVE,
GLYPH,
TEXT,
};
enum class score_layout_item_role {
PAPER,
BORDER,
STAFF_LINE,
BARLINE,
FINAL_BARLINE,
CLEF,
KEY_SIGNATURE,
TIME_SIGNATURE,
NOTEHEAD,
REST,
ACCIDENTAL,
STEM,
FLAG,
BEAM,
DOT,
TIE,
TUPLET,
TUPLET_BRACKET,
TITLE,
COMPOSER,
PART,
PAGE_NUMBER,
MEASURE_NUMBER,
SECTION_LABEL,
CHORD_SYMBOL,
LYRIC,
};
struct score_layout_item {
vamp_zero::score_layout_item_kind kind{};
vamp_zero::score_layout_item_role role{};
luma::rect bounds{};
luma::point origin{};
luma::point from{};
luma::point control{};
luma::point to{};
luma::color color{};
std::float32_t thickness{};
std::float32_t staff_spacing{};
std::int32_t codepoint{};
std::int32_t text_scale{};
std::size_t system_index{std::numeric_limits<std::size_t>::max()};
std::size_t measure_index{std::numeric_limits<std::size_t>::max()};
std::size_t note_index{std::numeric_limits<std::size_t>::max()};
std::string text{};
};
struct score_page_layout {
luma::rect bounds{};
std::float32_t staff_spacing{};
std::vector<vamp_zero::score_layout_item> items{};
};
constexpr auto score_measures_per_system = std::size_t{4};
constexpr auto score_systems_per_page = std::size_t{3};
constexpr auto score_measures_per_page = score_measures_per_system * score_systems_per_page;
auto notated_accidentals_for_measure(vamp_zero::score_measure const& measure, std::string_view inherited_key_signature) -> std::vector<vamp_zero::score_accidental_mark>;
auto layout_score_page(luma::rect bounds, vamp_zero::score_document const& score, std::size_t page_index) -> vamp_zero::score_page_layout;
auto draw_score_page(luma::draw_context& context, luma::rect bounds, vamp_zero::score_document const& score, std::size_t page_index) -> void;
}
+8
View File
@@ -32,15 +32,23 @@ struct score_note {
std::string lyric{};
std::bool_t tie_to_next{};
std::bool_t tie_from_previous{};
std::string tuplet_id{};
std::vector<vamp_zero::score_pitch> pitches{};
};
struct score_tuplet {
std::string id{};
std::int32_t note_count{};
std::int32_t space_count{};
};
struct score_measure {
std::string id{};
std::string section_label{};
std::string time_signature{};
std::string key_signature{};
std::vector<vamp_zero::score_note> notes{};
std::vector<vamp_zero::score_tuplet> tuplets{};
};
struct score_document {