Added tune previews

This commit is contained in:
marc
2025-04-27 17:00:04 +02:00
parent 695e0b54bf
commit bc3d98aba2
14 changed files with 123 additions and 131 deletions

View File

@@ -18,7 +18,7 @@ RenderResult = Result[Path, list[RenderError]]
class RenderOutput(enum.Enum):
PDF = "pdf"
PNG_CROPPED = "png-cropped"
PNG_PREVIEW = "png-preview"
PREVIEW = "preview"
async def render(
@@ -61,16 +61,16 @@ async def render_file(
]
output_file = output_file.with_suffix(".cropped.png")
# output_file = output_file.with_suffix(".png")
case RenderOutput.PNG_PREVIEW:
case RenderOutput.PREVIEW:
command = [
"lilypond",
"-f", "png",
"-f", "svg",
"-dpreview=#t",
"-dno-print-pages",
"-o", str(output_file),
str(input_file)
]
output_file = output_file.with_suffix(".preview.png")
output_file = output_file.with_suffix(".preview.svg")
proc = await asyncio.create_subprocess_exec(
*command,