Specify the Score Bundle Format, and make tempo an integer
The bundle is documented as a standalone format rather than as a note between two programs: producers and consumers are generic, the marker vocabulary is defined musically rather than by what a viewer does with it, and image properties are stated as guarantees with the reasoning where it is not obvious. Anything that reads scores can implement it without knowing this tool exists. Taking that view changed the substance in three places. Marker types now carry their musical meaning rather than a UI mapping. The rule against re-importing became a statement about identity - indices mean something only within one bundle, so two bundles of a piece are independent documents. And forward-compatibility rules were added, which a protocol needs and a handover note did not: ignore unknown fields and marker types, refuse an unknown version. Tempo is now an integer, beats per minute, exported as a JSON number and omitted when blank; the editor accepts digits only. A figure can drive a metronome or a click track where a verbal marking cannot, and readers do not agree on what Andante means. This needs the consumer's column changed from free-form text, which the format document flags. Every figure in the document comes from a real export.
This commit is contained in:
@@ -19,6 +19,7 @@ from PySide6.QtGui import (
|
||||
QBrush,
|
||||
QColor,
|
||||
QImage,
|
||||
QIntValidator,
|
||||
QKeySequence,
|
||||
QPainter,
|
||||
QPen,
|
||||
@@ -50,7 +51,7 @@ from PySide6.QtWidgets import (
|
||||
)
|
||||
|
||||
from . import bundle, lilypond
|
||||
from .bundle import METADATA_FIELDS
|
||||
from .bundle import METADATA_FIELDS, NUMERIC_FIELDS
|
||||
from .detect import deskew, detect_page
|
||||
from .pdf import Source, open_source, page_raster
|
||||
from .project import (
|
||||
@@ -564,6 +565,12 @@ class Editor(QMainWindow):
|
||||
required = field == "title"
|
||||
if required:
|
||||
edit.setPlaceholderText("required")
|
||||
if field in NUMERIC_FIELDS:
|
||||
# Beats per minute, and only that: a number can drive a
|
||||
# metronome where "Andante" cannot.
|
||||
edit.setValidator(QIntValidator(20, 400, edit))
|
||||
edit.setPlaceholderText("BPM")
|
||||
edit.setFixedWidth(90)
|
||||
meta_form.addRow(f"{field.replace('_', ' ').title()}{' *' if required else ''}", edit)
|
||||
|
||||
self.summary = QLabel()
|
||||
|
||||
Reference in New Issue
Block a user