Make a bundle reopenable, and number slices
A bundle was a one-way trip. The slice images are output and the cuts that produced them lived only in the producer's own project file, so a bundle someone handed you meant cutting the score again from scratch. The manifest now carries the geometry, in a `source` block: per page the cut polylines, skew, levels and content rectangle, all in normalised coordinates so they survive any render resolution, and per slice the page and slot it came from. Discards are stated by omission — a slot no slice claims was discarded — since shipping a discarded slice's image would defeat discarding it. `noteman-slicer open song.zip` unpacks the archived PDF, rebuilds the project from that geometry, restores markers, engravings and the title block, and opens the editor. Jump destinations go back from an array index to the (page, slot) the editor works in. The images in the zip are discarded: the PDF is what the pipeline renders from. Re-exporting a reopened bundle reproduces its manifest exactly. It refuses to overwrite a PDF or project file already sitting there, because the obvious place to unpack is where someone's unfinished cuts live. Separately, every slice can now carry the measure it starts at, not just a re-engraved one — a scanned system is numbered in the score the same way, and noteman wants to answer "take it from bar 33" about either. It moves off the replacement onto the page, alongside markers and discards, and out of the bundle's engraving object onto the slice.
This commit is contained in:
@@ -516,6 +516,20 @@ class Editor(QMainWindow):
|
||||
reset.clicked.connect(self._reset_rect)
|
||||
form.addRow(reset)
|
||||
|
||||
slice_layout = section("This slice", box)
|
||||
slice_form = QFormLayout()
|
||||
slice_layout.addLayout(slice_form)
|
||||
# Every slice can carry one, engraved or scanned: a scanned system has
|
||||
# a bar number printed on it just the same, and noteman wants to be
|
||||
# able to say "from bar 33" about either.
|
||||
self.bar = QLineEdit()
|
||||
self.bar.setValidator(QIntValidator(1, 9999, self.bar))
|
||||
self.bar.setFixedWidth(90)
|
||||
self.bar.setPlaceholderText("none")
|
||||
self.bar.setToolTip("The measure this slice starts at, as printed in the score")
|
||||
self.bar.textChanged.connect(self._bar_changed)
|
||||
slice_form.addRow("First bar", self.bar)
|
||||
|
||||
marker_layout = section("Markers on this slice", box)
|
||||
self.marker_list = QListWidget()
|
||||
self.marker_list.setMaximumHeight(110)
|
||||
@@ -657,6 +671,10 @@ class Editor(QMainWindow):
|
||||
widget.blockSignals(True)
|
||||
widget.setValue(value)
|
||||
widget.blockSignals(False)
|
||||
bar = page.bars[self.view.selected_slice]
|
||||
self.bar.blockSignals(True)
|
||||
self.bar.setText("" if bar is None else str(bar))
|
||||
self.bar.blockSignals(False)
|
||||
self._sync_markers()
|
||||
self._sync_replacement()
|
||||
kept = len(self.project.kept_slices())
|
||||
@@ -674,6 +692,11 @@ class Editor(QMainWindow):
|
||||
self._sync()
|
||||
self.autosave.start()
|
||||
|
||||
def _bar_changed(self, text: str) -> None:
|
||||
page = self.project.pages[self.index]
|
||||
page.bars[self.view.selected_slice] = int(text) if text.strip().isdigit() else None
|
||||
self.autosave.start()
|
||||
|
||||
def _skew_changed(self, value: float) -> None:
|
||||
self.project.pages[self.index].skew = value
|
||||
self.view.show_page(self.project, self.index, self._preview(self.index))
|
||||
|
||||
Reference in New Issue
Block a user