From 3f12c17762d66731d5b4e12f7575519be2f3fd98 Mon Sep 17 00:00:00 2001 From: "zuk (Jakob Krueger)" Date: Fri, 11 Apr 2025 17:50:24 +0400 Subject: [PATCH] include adaptions/editings in author system --- default_songinfo_style.ly | 1 + footer_with_songinfo.ly | 10 ++++++++-- toc_include.ly | 10 +++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/default_songinfo_style.ly b/default_songinfo_style.ly index fbe8ef8..38f049b 100644 --- a/default_songinfo_style.ly +++ b/default_songinfo_style.ly @@ -2,6 +2,7 @@ poetPrefix = "Worte:" composerPrefix = "Weise:" compositionPrefix = "Satz:" + adaptionPrefix = "Bearbeitung:" poetAndComposerEqualPrefix = "Worte und Weise:" voicePrefix = "Stimme:" versePrefix = "Strophe:" diff --git a/footer_with_songinfo.ly b/footer_with_songinfo.ly index f41054e..44a9fa1 100644 --- a/footer_with_songinfo.ly +++ b/footer_with_songinfo.ly @@ -102,14 +102,16 @@ (verseComposerData (find-author-id-with-part-numbers 'meloverse authors)) (voiceComposerData (find-author-id-with-part-numbers 'voice authors)) (compositionIds (find-author-ids-by 'composition authors)) + (adaptionIds (find-author-ids-by 'adaption authors)) (bridgeIds (find-author-ids-by 'bridge authors)) (interludeIds (find-author-ids-by 'interlude authors)) (year_text (chain-assoc-get 'header:year_text props #f)) (year_translation (chain-assoc-get 'header:year_translation props #f)) (year_melody (chain-assoc-get 'header:year_melody props #f)) (year_composition (chain-assoc-get 'header:year_composition props #f)) + (year_adaption (chain-assoc-get 'header:year_adaption props #f)) ) - (if (and (equal? poetIds composerIds) (null? translatorIds) (null? versePoetData) (null? verseComposerData) (null? voiceComposerData) (null? compositionIds) (null? bridgeIds) (null? interludeIds)) + (if (and (equal? poetIds composerIds) (null? translatorIds) (null? versePoetData) (null? verseComposerData) (null? voiceComposerData) (null? compositionIds) (null? adaptionIds) (null? bridgeIds) (null? interludeIds)) (list (join-present (list (render-contribution-group (ly:output-def-lookup layout 'poetAndComposerEqualPrefix) poetIds) @@ -133,7 +135,7 @@ ) ", ") ) "; ") )) - (if (and (null? composerIds) (null? compositionIds) (null? verseComposerData) (null? voiceComposerData) (null? bridgeIds) (null? interludeIds)) #f + (if (and (null? composerIds) (null? compositionIds) (null? adaptionIds) (null? verseComposerData) (null? voiceComposerData) (null? bridgeIds) (null? interludeIds)) #f (string-append (ly:output-def-lookup layout 'composerPrefix) " " @@ -148,6 +150,10 @@ (render-contribution-group (ly:output-def-lookup layout 'compositionPrefix) compositionIds) year_composition ) ", ") + (join-present (list + (render-contribution-group (ly:output-def-lookup layout 'adaptionPrefix) adaptionIds) + year_adaption + ) ", ") (render-contribution-group (ly:output-def-lookup layout 'bridgePrefix) bridgeIds) (render-contribution-group (ly:output-def-lookup layout 'interludePrefix) interludeIds) ) "; ") diff --git a/toc_include.ly b/toc_include.ly index 4b93b0c..d96bfd5 100644 --- a/toc_include.ly +++ b/toc_include.ly @@ -279,10 +279,11 @@ headerToTOC = #(define-music-function (parser location header label) (ly:book? s (verseComposerData (find-author-id-with-part-numbers 'meloverse authors)) (voiceComposerData (find-author-id-with-part-numbers 'voice authors)) (compositionIds (find-author-ids-by 'composition authors)) + (adaptionIds (find-author-ids-by 'adaption authors)) (bridgeIds (find-author-ids-by 'bridge authors)) (interludeIds (find-author-ids-by 'interlude authors))) (delete-duplicates - (append poetIds translatorIds (map car versePoetData) composerIds (map car verseComposerData) (map car voiceComposerData) compositionIds bridgeIds interludeIds)) + (append poetIds translatorIds (map car versePoetData) composerIds (map car verseComposerData) (map car voiceComposerData) compositionIds adaptionIds bridgeIds interludeIds)) )) (let* ( @@ -358,7 +359,7 @@ headerToTOC = #(define-music-function (parser location header label) (ly:book? s (songvars (cdr song)) (page-number (number->string (assoc-get (assq-ref songvars 'label) labelPageTable))) (extractedheadervars (extract-and-check-vars-from-header (assq-ref songvars 'header) - '(title starttext alttitle categorytitle categories authors year_text year_melody year_translation year_composition infotext translation pronunciation copyright source))) + '(title starttext alttitle categorytitle categories authors year_text year_melody year_translation year_composition year_adaption infotext translation pronunciation copyright source))) (headervar-or-empty (lambda (varsym) (let ((extracted (assq-ref extractedheadervars varsym))) (if extracted extracted "")))) @@ -370,6 +371,7 @@ headerToTOC = #(define-music-function (parser location header label) (ly:book? s (verseComposerData (find-author-id-with-part-numbers 'meloverse authors)) (voiceComposerData (find-author-id-with-part-numbers 'voice authors)) (compositionIds (find-author-ids-by 'composition authors)) + (adaptionIds (find-author-ids-by 'adaption authors)) (bridgeIds (find-author-ids-by 'bridge authors)) (interludeIds (find-author-ids-by 'interlude authors))) (map csv-escape @@ -387,11 +389,12 @@ headerToTOC = #(define-music-function (parser location header label) (ly:book? s (headervar-or-empty 'categories) (format-authors (append poetIds (map car versePoetData))) (format-authors translatorIds) - (format-authors (append composerIds compositionIds bridgeIds interludeIds (map car voiceComposerData) (map car verseComposerData))) + (format-authors (append composerIds compositionIds adaptionIds bridgeIds interludeIds (map car voiceComposerData) (map car verseComposerData))) (headervar-or-empty 'year_text) (headervar-or-empty 'year_melody) (headervar-or-empty 'year_translation) (headervar-or-empty 'year_composition) + (headervar-or-empty 'year_adaption) (headervar-or-empty 'copyright) (headervar-or-empty 'source) (format-info-paragraphs (headervar-or-empty 'infotext)) @@ -416,6 +419,7 @@ headerToTOC = #(define-music-function (parser location header label) (ly:book? s "year_melody" "year_translation" "year_composition" + "year_adaption" "copyright" "source" "infotext"