33 lines
931 B
Python
33 lines
931 B
Python
from folkugat_web.model.lilypond.score import LilypondPlaylist, LilypondSet, LilypondTune
|
|
from folkugat_web.templates import templates
|
|
|
|
SCORE_BEGINNING = "% --- SCORE BEGINNING --- %"
|
|
|
|
|
|
def tune_source(tune: LilypondTune) -> str:
|
|
return templates.get_template("lilypond/single_tune.ly").render(
|
|
score_beginning=SCORE_BEGINNING,
|
|
tune=tune,
|
|
)
|
|
|
|
|
|
def preview_source(tune: LilypondTune) -> str:
|
|
return templates.get_template("lilypond/preview.ly").render(
|
|
score_beginning=SCORE_BEGINNING,
|
|
tune=tune,
|
|
)
|
|
|
|
|
|
def set_source(tune_set: LilypondSet) -> str:
|
|
return templates.get_template("lilypond/tune_set.ly").render(
|
|
score_beginning=SCORE_BEGINNING,
|
|
tune_set=tune_set,
|
|
)
|
|
|
|
|
|
def playlist_source(playlist: LilypondPlaylist) -> str:
|
|
return templates.get_template("lilypond/playlist.ly").render(
|
|
score_beginning=SCORE_BEGINNING,
|
|
playlist=playlist,
|
|
)
|