[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] Music excerpt

From: Richard Shann
Subject: Re: [Denemo-devel] Music excerpt
Date: Wed, 28 May 2008 10:46:42 +0100

On Tue, 2008-05-27 at 12:32 -0500, Jeremiah Benham wrote:
> I began to write code to allow denemo to create music excerpts. I am not
> sure if I should have this function launch via the print icon or have it
> be a menu item. I was also wondering if I should have a switch inside
> print.c function run_lilypond_and_viewer
yes, generalize this function - it can take another argument to say how
lilypond and viewer are to be run. It doesn't, as it happens, need a
name change because you are still running lilypond and viewer :-)
But it is important to use the same function because we have important
fixes to do with all this spawn code & we don't want to have to fix it
in more places than we need to.

>  or if I should create its own
> function. Instead of launching a pdfviewer it would launch an
> imageviewer that would open an png file. I already edited my local
> version to do most everything except the print function. What are your
> opinions. 
> They only thing needed to create music excerpts is to add this line in
> the beginning of a lilypond file:
> \include ""
I take it you have to *not* have this line present for the ordinary
print? (That is, you can't just put it in all the time in case it is
In which case you will need to extend the exportlilypond function - this
already has parameters start, end which are not actually in use. (There
is a whole exportpdf file and routine which uses them, but without being
able to set them - this routine seems almost entirely redundant, since
the standard print generates pdf anyway). Some tidying up here would be
good. Try to adopt the naming conventions of the surrounding code as it
makes the code more readable.

> Then compile the example like this:
> lilypond --png -b eps -o filename
> This produces a filename.png. Once I am finished it opens up in the
> users imageviewer defined in their preferences. I just don't know if
> what I should label this in the menu. The file menu is getting rather
> large. Perhaps some submenu's can be created to trim it down a bit. 
Yes: I would go for an Open submenu (with everything that loads stuff
from file) a Save submenu, Print submenu etc. You do this by adding to
menu_entries[] in view.c and to the denemoui.xml
I'm currently grappling with a similar problem. I created an
AddRehearsalMark menuitem, realizing there would be hundreds of such
things that could be added, only a few of which any one person would
want. So I created this AddRehearsalMark as a sort of prototype; with
this I've sorted out how to add these menu items programmatically - you
would have a Favorites menu into which the user could install from the
LilyPond documentation any thing they like, without having to re-compile
the program. We could build up a library of LilyPond tweaks each of
which would have a name, a tooltip and a LilyPond insert.
So the user could choose the tweaks he wants from a catalog and create
ones of his own - you can add accelerators to these programatically
created menu items - Jean-Rene' please note, not all the menuitems will
be statically present in menu_items array!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]