Ebe123 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/371211 )
Change subject: Create hybrid-raw mode ...................................................................... Create hybrid-raw mode When a layout or midi block is added in a non-raw score tag, the default should be overridden. This change makes it so before adding the default blocks, the LY code is checked to see whether it already contains the tags. Bug: T49616 Change-Id: I7f0a4268c3834bf6ee91cbcec19592503f87da67 --- M Score.body.php 1 file changed, 14 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Score refs/changes/11/371211/1 diff --git a/Score.body.php b/Score.body.php index 0a6517f..12620a8 100644 --- a/Score.body.php +++ b/Score.body.php @@ -709,6 +709,19 @@ private static function embedLilypondCode( $lilypondCode ) { $version = self::getLilypondVersion(); + // Check if parameters have already been supplied (hybrid-raw mode) + $options = ""; + if ( strpos( $lilypondCode, '\\layout') !== true ) { + $options .= "\\layout { }\n"; + } + if ( strpos( $lilypondCode, '\\midi') !== true ) { + $options .= <<<LY + \\midi { + \\context { \Score tempoWholesPerMinute = #(ly:make-moment 100 4) } + }\n +LY; + } + /* Raw code. In Scheme, ##f is false and ##t is true. */ /* Set the default MIDI tempo to 100, 60 is a bit too slow */ $raw = <<<LILYPOND @@ -723,13 +736,7 @@ \\version "$version" \\score { $lilypondCode - \\layout { } - \\midi { - \\context { - \\Score - tempoWholesPerMinute = #(ly:make-moment 100 4) - } - } + $options } LILYPOND; -- To view, visit https://gerrit.wikimedia.org/r/371211 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f0a4268c3834bf6ee91cbcec19592503f87da67 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Score Gerrit-Branch: master Gerrit-Owner: Ebe123 <beauleetien...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits