[frogs] [PATCH]: Tracker 836 - Allow output filename and output-suffix to be specified for a \book block

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]


This is a multi-part message in MIME format.
init.ly - Add new parser variables book-output-suffix and book-filename initialized as #f and empty queue/stack structure.

music-functions-init.ly adds three new functions
  • \bookOutputSuffix - to set the output suffix for the \book block
  • \bookOutputName - to set output filename for the current \book block
  • \bookOuptutNameRevert - to restore the the output filename to the value prior to that of the last \bookOuputName call.
\bookOutputName and \bookOuptutNameRevert use the book-filename as a stack structure.  I have used this so we can we could eventually allow users to do stuff like the following (controlling the names used to open the midi files is not part of the current patch).
\book {
    \bookOutputName "My-Homeland"
    \score {
       \bookOutputName "Vysehrad"
          music-declarations ...
          \midi{
          % midi file gets written to Vysehrad.mid(i)
          }
          \layout{
          }
       \bookOutputNameRevert
    }
    \score {
        \bookOuputName "Vltava"
        ...
        \midi {
        % midi file is written to Vltava.mid(i)
        }
    }
..
..
.. 

lily-library.scm has changes to the filename generating code in print-book-with to pick up the current values of the new parser variables if set before using the current output-suffix or result of a call to ly:parser-output-name.
The routine to get the name now uses as combination of the current output name and output suffix value to at as a key for the internal a-list of filenames being written to during a compilation.

lily-guile.hh, lily-guile.cc and parser.yy have code that I would like to use to re-initialize book-output-suffix and book-filename to initial values on encountering the end of a \book block, but  I've hit a dead-end currently in this  as the code I tried to use in parser.yy negates the effect of calling the new functions altogether.  If anyone with more experience of how bison works has any better ideas as to how do this I'd be interested in hearing them.

Thanks in advance for any feedback.

Cheers,

Ian Hulin








Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/