From: Han-Wen Nienhuys Date: Mon, 12 Oct 1998 13:51:16 +0000 (+0200) Subject: release: 1.0.15 X-Git-Tag: release/1.0.15 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=59ed0cee2aae58a3f0483f21261c68aee406fa10;p=lilypond.git release: 1.0.15 --- diff --git a/Documentation/tex/refman.yo b/Documentation/tex/refman.yo index 7bd5053e33..96983f7f35 100644 --- a/Documentation/tex/refman.yo +++ b/Documentation/tex/refman.yo @@ -289,10 +289,10 @@ code(\notes). In Note mode, words can only contain alphabetic characters. If code(word) is encountered, LilyPond first checks for a notename of code(word). If no notename is found, then code(word) is treated as a string. If you mistype a notename, the parser will most -likely complain that you should be in code(\lyric) mode to do lyrics. +likely complain that you should be in code(\lyrics) mode to do lyrics. dit(Lyric mode) Lyrics mode is introduced by the keyword -code(\lyric). This mode is has rules that make it easy to include +code(\lyrics). This mode is has rules that make it easy to include punctuation and diacritical marks in words. A word in Lyrics mode begins with: an alphabetic character, code(_), code(?), code(!), code(:), code('), @@ -513,7 +513,7 @@ mudela()( c''-\trill c''-\prall c''-\mordent c''-\prallprall c''-\prallmordent c''-\upprall c''-\downprall } - \type Lyrics \lyric{ + \type Lyrics \lyrics{ accent marcato staccatissimo fermata stopped staccato tenuto upbow downbow lheel rheel ltoe rtoe turn open flageolet reverseturn @@ -676,7 +676,7 @@ See Section ref(modes) for a description of what is interpreted as a lyric. In order to instruct LilyPond to write lyrics underneath the staff, you must enter the lyrics context with code(\type Lyrics). -Lyrics should be entered in lyrics mode which is entered with code(\lyric). +Lyrics should be entered in lyrics mode which is entered with code(\lyrics). Spaces can be introduced into a lyric either by using quotes (code(")) or by using an underscore without quotes: code(He_could4 not4). All @@ -684,7 +684,7 @@ unquoted underscores are converted to spaces. Here is a full example: mudela(verbatim)(\score{ < \notes \transpose c'' {c d e c | c d e c | e f g'2 | e'4 f g'2 \bar "|."; } - \type Lyrics \lyric { + \type Lyrics \lyrics { DOEXPAND(Fr\)`e-4 re Ja- que DOEXPAND(Fr\)`e- re Ja- que Dor- mez vous?2 Dor-4 mez vous?2 } > @@ -939,7 +939,7 @@ dit(code(\keysignature) var(pitchseq);) Specify an arbitrary key signature. The pitches from var(pitch) will be printed in the key signature in the order that they appear on the list. -dit(code(\lyric) var(lyriclist)) Parse var(lyriclist) in lyrics mode. +dit(code(\lyrics) var(lyriclist)) Parse var(lyriclist) in lyrics mode. dit(code(\maininput)) Internal command. This command is used for creating init files like file(init.fly) that read the user file into the middle of another diff --git a/Documentation/tex/tutorial.yo b/Documentation/tex/tutorial.yo index b213777cb9..02bdaaf9a3 100644 --- a/Documentation/tex/tutorial.yo +++ b/Documentation/tex/tutorial.yo @@ -1297,12 +1297,12 @@ Lyrics consist of syllables, which are strings together with durations. Previously we only entered note names, so for entering lyrics we have to instruct LilyPond that what we enter are not note names but words---or rather: strings. This instruction is the keyword -code(\lyric). After entering this keyword you can enter a musical +code(\lyrics). After entering this keyword you can enter a musical construct---sequential music, simultaneous music, code(\type) entries, etc.--- but with syllables in stead of pitches. For example: -verb( \lyric { 'got8 me on my knees4, Le-8 lie! }) +verb( \lyrics { 'got8 me on my knees4, Le-8 lie! }) -The effect of code(\lyric) can be compared with the effect of the +The effect of code(\lyrics) can be compared with the effect of the doublequote character, code("), for it also changes the lexical meaning of spaces and characters. This mode is another example of a handy input feature of the language. @@ -1316,14 +1316,14 @@ by a context called code(Lyrics). You can select this context with the code(\type) keyword. Here is a simple example: mudela(fragment,verbatim)( - \type Lyrics \lyric { 'got8 me on my knees,4 Le-8 lie! }) + \type Lyrics \lyrics { 'got8 me on my knees,4 Le-8 lie! }) The result is technically more or less correct, but without a melody it just doesn't work, so let's add a blob of cream: mudela(fragment,verbatim)( < \type Staff { c''8. c''16 bes'8. a'16 g'4 f'8 g'4. } - \type Lyrics \lyric { 'got8. me16 on8. my16 knees,4 Le-8 lie!4. } + \type Lyrics \lyrics { 'got8. me16 on8. my16 knees,4 Le-8 lie!4. } > ) @@ -1340,13 +1340,13 @@ underscore instead of a space. All these tricks are demonstrated in the following example: COMMENT( urg -\type Lyrics \lyric { 'got_m\textbf{e}4 on8. m$\cal_Y$16 knees,4 Le-8 lie!4.} -\type Lyrics \lyric { 'got_m{\bf e}4 on8. m$\cal_Y$16 knees,4 Le-8 lie!4.} +\type Lyrics \lyrics { 'got_m\textbf{e}4 on8. m$\cal_Y$16 knees,4 Le-8 lie!4.} +\type Lyrics \lyrics { 'got_m{\bf e}4 on8. m$\cal_Y$16 knees,4 Le-8 lie!4.} ) mudela(fragment,verbatim)(< \type Staff { c''8. c''16 bes'8. a'16 g'4 f'8 g'4. } - \type Lyrics \lyric { 'got_me4 on8. m$\cal_Y$16 "3s,"4 Le-8 lie!4.} + \type Lyrics \lyrics { 'got_me4 on8. m$\cal_Y$16 "3s,"4 Le-8 lie!4.} > ) @@ -1396,7 +1396,7 @@ code(\paper) definition is copied from a default definition The paper part also contains the definition of the contexts. -The keyword code(\notes) is analogous to the code(\lyric) keyword. It +The keyword code(\notes) is analogous to the code(\lyrics) keyword. It will switch the tokenizer into a mode that interprets plain words as note names. If it can't recognize the words as a note name, it will assume that they are strings. That is the reason why you can write diff --git a/NEWS b/NEWS index 5b362a2de4..104db47365 100644 --- a/NEWS +++ b/NEWS @@ -1,11 +1,24 @@ -pl 14.jcn1 - - moved most ugly lookup stuff - - {Ps,Tex}_{def,score}.{cc,hh} +pl 15 +pl 14.hwn1 + - \lyrics iso \lyric (mudela 1.0.7) + - cleaned up real_expression syntax. + - removed optional_semicolon nonterminal after toplevel assignment + - MInterval Music::time_int () -> Moment Music::duration () + - junked Music_iterator::daddy_iter_l_ + - junked Sequential_music::offset_mom_ + - tempo compression: + * syntax: \times 2/3 Music + * Compressed_music, Compressed_music_iterator + - flower: init rational to 0 + - flower: removed P?Cursor<>::P?Cursor (), using pointer iso ref now. + - don't install into TeX, but into ${datadir}/{mf,tex,ly} (todo: ps) + ********* pl 14 pl 13.uu1 + - syntax for \translator: (\name "Name") - bfs for footer - bf: init/{book,center}-fragment.ly, YODL nofooter stuff. - bf: redeclaration diff --git a/TODO b/TODO index 733c1ffd6a..8adbc8d1da 100644 --- a/TODO +++ b/TODO @@ -9,39 +9,36 @@ grep for TODO and ugh/ugr/urg BUGS: + + + * formatting of input stuff. - + - > \notes{ a \< b \cr } - > - > work but - > - > \notes{ a \< b \! } - > - > give a parse error? + * use real RTTI iso access_Stuff. + * \notes{ a \< b \cr } vs \notes{ a \< b \! } * if possible, it might be nice for a warning to appear if someone does - > \translator with no name and without assigning it to an -identifier. possible, it might be nice for a warning to appear if -someone does - > \translator with no name and without assigning it to an -identifier. + \translator with no name and without assigning it to an + identifier. * space after bars? * [/3 c8 c16 c c c]/1 + * I see that \prallprall and \prallmordent are identical. I think this is a + mistake, that \prallprall should not have the vertical line. + This can be fixed by removing the line + draw_mordent(twidth-0.5toverlap); + from the definition of \prallprall in mf/feta-slag.mf (see below) + * fix singleStaffBracket * repeat bars: need distance after ":|" and before "|:" - - The time signature warnings still remain, will be fixed later. - - * fix \n after proccing + * The time signature warnings still remain, will be fixed later. - Summary of minor spelling irregularities: -> capitalization/use of underscores in property names -> \lyric vs \notes \lyric vs \type Lyrics (\lyric should have an -s) + Summary of minor spelling irregularities: + - capitalization/use of underscores in property names * fix Score.skipBars @@ -51,30 +48,22 @@ identifier. * fix marks/barnumbers/marginal notes -**** - - > lbheel = \script { "bheel" 0 0 -1 0 0 } -> rbheel = \script { "bheel" 0 0 1 0 0 } -> lbtoe = \script { "btoe" 0 0 -1 0 0 } -> rbtoe = \script { "btoe" 0 0 1 0 0 } -> lfheel = \script { "fheel" 0 0 -1 0 0 } -> rfheel = \script { "fheel" 0 0 1 0 0 } -> lftoe = \script { "ftoe" 0 0 -1 0 0 } -> rftoe = \script { "ftoe" 0 0 1 0 0 } -> -> and also -> -> portato= \script { "portato" 0 -1 0 1 0 } + * broken scripts: + lbheel = \script { "bheel" 0 0 -1 0 0 } + rbheel = \script { "bheel" 0 0 1 0 0 } + lbtoe = \script { "btoe" 0 0 -1 0 0 } + rbtoe = \script { "btoe" 0 0 1 0 0 } + lfheel = \script { "fheel" 0 0 -1 0 0 } + rfheel = \script { "fheel" 0 0 1 0 0 } + lftoe = \script { "ftoe" 0 0 -1 0 0 } + rftoe = \script { "ftoe" 0 0 1 0 0 } + + and also + + portato= \script { "portato" 0 -1 0 1 0 } * MIDI spelling. - * foo = 1 - - \score{ - \notes { a } - \paper{ foo = \translator{ \StaffContext}; } - } - * Align_element::padding ? * uniformise property names. @@ -83,8 +72,6 @@ identifier. * typo checks on property names? - * egcs-1.1 support - * make engraver hacking robust. * use streambufs and iostream @@ -96,7 +83,7 @@ identifier. * zip target for binary windows dist (JBR) - * text continuationss + * text continuations * revise documentation @@ -105,14 +92,6 @@ identifier. * junking \skip req in lyrics * Language: - - general plet mechanism. - - \plet 2/3 { c8 c8 c8 } - - ie. - - Music: PLET int '/' int Music - - \type -> \context ? - \translator -> ? - fix \partial diff --git a/VERSION b/VERSION index 015f6f6e2a..146c8727d6 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=0 -PATCH_LEVEL=14 -MY_PATCH_LEVEL=tca1 +PATCH_LEVEL=15 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/buildscripts/lilypond-profile.sh b/buildscripts/lilypond-profile.sh new file mode 100644 index 0000000000..2cbd3e1115 --- /dev/null +++ b/buildscripts/lilypond-profile.sh @@ -0,0 +1,16 @@ +#!/bin/sh + + +# set environment for LilyPond. To be installed in /etc/profile.d/ + +LILYINCLUDE="@datadir@/ly" +MFINPUTS="@datadir@/mf:"${MFINPUTS:=":"} +TEXINPUTS="@datadir@/tex:"${TEXINPUTS:=":"} + +# todo: GS stuff + +export LILYINCLUDE MFINPUTS TEXINPUTS + +# echo $LILYINCLUDE $MFINPUTS $TEXINPUTS + + diff --git a/configure b/configure index 3bbe851497..fad9fdb1b4 100755 --- a/configure +++ b/configure @@ -83,12 +83,6 @@ ac_help="$ac_help with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale " ac_help="$ac_help with-lang=LANG use LANG as language to emit messages" -ac_help="$ac_help - enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)" -ac_help="$ac_help - enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. " -ac_help="$ac_help - enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. " # Initialize some variables set by options. # The variables have the same names as the options, with @@ -709,7 +703,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:713: checking host system type" >&5 +echo "configure:707: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -734,7 +728,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:738: checking for $ac_word" >&5 +echo "configure:732: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -768,7 +762,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:772: checking for $ac_word" >&5 +echo "configure:766: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -805,7 +799,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:809: checking for $ac_word" >&5 +echo "configure:803: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -839,7 +833,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:843: checking for $ac_word" >&5 +echo "configure:837: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_BASH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -872,7 +866,7 @@ test -n "$BASH" || BASH="/bin/sh" # Extract the first word of "${PYTHON:-python}", so it can be a program name with args. set dummy ${PYTHON:-python}; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:876: checking for $ac_word" >&5 +echo "configure:870: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PYTHON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1088,7 +1082,7 @@ EOF # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1092: checking for $ac_word" >&5 +echo "configure:1086: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1117,7 +1111,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1121: checking for $ac_word" >&5 +echo "configure:1115: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1165,7 +1159,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1169: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1163: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1175,11 +1169,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1199,12 +1193,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1203: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1197: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1208: checking whether we are using GNU C" >&5 +echo "configure:1202: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1213,7 +1207,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1228,7 +1222,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1232: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1226: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1285,7 +1279,7 @@ EOF fi echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:1289: checking how to run the C++ preprocessor" >&5 +echo "configure:1283: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1298,12 +1292,12 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1334,7 +1328,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1338: checking for $ac_word" >&5 +echo "configure:1332: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1365,7 +1359,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1369: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1363: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1375,11 +1369,11 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1399,12 +1393,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1403: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1397: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1408: checking whether we are using GNU C++" >&5 +echo "configure:1402: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1413,7 +1407,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1428,7 +1422,7 @@ if test $ac_cv_prog_gxx = yes; then ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1432: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1426: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1458,17 +1452,17 @@ fi ac_safe=`echo "FlexLexer.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for FlexLexer.h""... $ac_c" 1>&6 -echo "configure:1462: checking for FlexLexer.h" >&5 +echo "configure:1456: checking for FlexLexer.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1466: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1518,12 +1512,12 @@ fi echo $ac_n "checking whether explicit instantiation is needed""... $ac_c" 1>&6 -echo "configure:1522: checking whether explicit instantiation is needed" >&5 +echo "configure:1516: checking whether explicit instantiation is needed" >&5 if eval "test \"`echo '$''{'lily_cv_need_explicit_instantiation'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < struct foo { static int baz; }; @@ -1533,7 +1527,7 @@ int main() { return foo::baz; ; return 0; } EOF -if { (eval echo configure:1537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* lily_cv_need_explicit_instantiation=no else @@ -1560,7 +1554,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1564: checking for $ac_word" >&5 +echo "configure:1558: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1602,7 +1596,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1606: checking for $ac_word" >&5 +echo "configure:1600: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1636,7 +1630,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1640: checking for $ac_word" >&5 +echo "configure:1634: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1703,7 +1697,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1707: checking for $ac_word" >&5 +echo "configure:1701: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1735,7 +1729,7 @@ test -n "$AR" || AR="error" # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1739: checking for $ac_word" >&5 +echo "configure:1733: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1790,7 +1784,7 @@ fi echo $ac_n "checking language""... $ac_c" 1>&6 -echo "configure:1794: checking language" >&5 +echo "configure:1788: checking language" >&5 case "$language" in En* | en* | Am* | am* | US* | us*) lang=English;; @@ -1826,7 +1820,7 @@ EOF echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:1830: checking for gettext in -lintl" >&5 +echo "configure:1824: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1834,7 +1828,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1878,12 +1872,12 @@ fi for ac_func in gettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1882: checking for $ac_func" >&5 +echo "configure:1876: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1941,7 +1935,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1945: checking for $ac_word" >&5 +echo "configure:1939: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1971,7 +1965,7 @@ done test -n "$MSGFMT" || MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh " echo $ac_n "checking whether msgfmt accepts -o""... $ac_c" 1>&6 -echo "configure:1975: checking whether msgfmt accepts -o" >&5 +echo "configure:1969: checking whether msgfmt accepts -o" >&5 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`" if test "$msgfmt_output" = ""; then echo "$ac_t""yes" 1>&6 @@ -1991,129 +1985,7 @@ echo "configure:1975: checking whether msgfmt accepts -o" >&5 fi - - # Check whether --enable-tex-prefix or --disable-tex-prefix was given. -if test "${enable_tex_prefix+set}" = set; then - enableval="$enable_tex_prefix" - TEXPREFIX=$enableval -else - TEXPREFIX=auto -fi - - - # Check whether --enable-tex-dir or --disable-tex-dir was given. -if test "${enable_tex_dir+set}" = set; then - enableval="$enable_tex_dir" - TEXDIR=$enableval -else - TEXDIR=auto -fi - - - # Check whether --enable-mf-dir or --disable-mf-dir was given. -if test "${enable_mf_dir+set}" = set; then - enableval="$enable_mf_dir" - MFDIR=$enableval -else - MFDIR=auto -fi - - - if test "x$TEXPREFIX" = xauto ; then - - - - echo $ac_n "checking TeX/MF root dir directory""... $ac_c" 1>&6 -echo "configure:2028: checking TeX/MF root dir directory" >&5 - - find_root_prefix="$prefix" - - - test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix" - find_texpostfix=""; - for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do - find_texprefix="$find_root_prefix$postfix" - if test -d $find_texprefix; then - find_texpostfix=$postfix - break; - fi - done - - if test "x$find_texpostfix" = x; then - find_texpostfix='/lib/texmf/tex' - - echo "configure: warning: Cannot determine the TeX-directory. Please use --enable-tex-prefix" 1>&2 - warn_b=yes - - fi - - find_texprefix="$find_root_prefix/$find_texpostfix" - - # only assign if variablename not empty - if test x != "x$TEXPREFIX"; then - TEXPREFIX='${prefix}'/"$find_texpostfix" - fi - echo "$ac_t""$find_texprefix" 1>&6 - - - else - find_texprefix=$TEXPREFIX - fi - - if test "x$MFDIR" = xauto; then - - - - echo $ac_n "checking MF input directory""... $ac_c" 1>&6 -echo "configure:2069: checking MF input directory" >&5 - find_dirdir=`(cd $find_texprefix; - $FIND ./ -type d -a -name source -print |sort|head -1|sed 's#^\./##')` - - - if test "x$find_dirdir" = x; then - find_dirdir="/source"; - - echo "configure: warning: Cannot determine MF input subdirectory. Please set from command-line" 1>&2 - warn_b=yes - - true - fi - MFDIR=$find_dirdir - echo "$ac_t""$find_texprefix/$find_dirdir" 1>&6 - - MFDIR="$TEXPREFIX/$MFDIR" - - fi - - if test "x$TEXDIR" = xauto ; then - - - - echo $ac_n "checking TeX input directory""... $ac_c" 1>&6 -echo "configure:2094: checking TeX input directory" >&5 - find_dirdir=`(cd $find_texprefix; - $FIND ./ -type d -a -name tex -print |sort|head -1|sed 's#^\./##')` - - - if test "x$find_dirdir" = x; then - find_dirdir="/tex"; - - echo "configure: warning: Cannot determine TeX input subdirectory. Please set from command-line" 1>&2 - warn_b=yes - - true - fi - TEXDIR=$find_dirdir - echo "$ac_t""$find_texprefix/$find_dirdir" 1>&6 - - TEXDIR="$TEXPREFIX/$TEXDIR" - - fi - - - - - +# AC_STEPMAKE_TEXMF if test "x$YODL" = "x"; then for ac_prog in striproff @@ -2121,7 +1993,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2125: checking for $ac_word" >&5 +echo "configure:1997: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIPROFF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2155,7 +2027,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2159: checking for $ac_word" >&5 +echo "configure:2031: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2189,7 +2061,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2193: checking for $ac_word" >&5 +echo "configure:2065: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2HTML'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2223,7 +2095,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2227: checking for $ac_word" >&5 +echo "configure:2099: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2LATEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2256,7 +2128,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2260: checking for $ac_word" >&5 +echo "configure:2132: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2MAN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2290,7 +2162,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2294: checking for $ac_word" >&5 +echo "configure:2166: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2MSLESS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2324,7 +2196,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2328: checking for $ac_word" >&5 +echo "configure:2200: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2TEXINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2358,7 +2230,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2362: checking for $ac_word" >&5 +echo "configure:2234: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YODL2TXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2408,17 +2280,8 @@ test -n "$YODL2TXT" || YODL2TXT="-echo no yodl" - result="`echo \"$FIND\" | grep echo`" - if test "x$FIND" = "xerror" -o "x$result" != "x"; then - - echo "configure: warning: can\'t find find. Please use --enable-tex-dir" 1>&2 - warn_b=yes - - fi - - echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2422: checking for 8-bit clean memcmp" >&5 +echo "configure:2285: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2426,7 +2289,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -2457,12 +2320,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2461: checking for vprintf" >&5 +echo "configure:2324: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2512,12 +2375,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2516: checking for _doprnt" >&5 +echo "configure:2379: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2570,12 +2433,12 @@ fi for ac_func in memmem snprintf vsnprintf gettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2574: checking for $ac_func" >&5 +echo "configure:2437: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2640,7 +2503,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2644: checking for $ac_word" >&5 +echo "configure:2507: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2854,9 +2717,6 @@ s%@RANLIB@%$RANLIB%g s%@localedir@%$localedir%g s%@DIR_LOCALEDIR@%$DIR_LOCALEDIR%g s%@MSGFMT@%$MSGFMT%g -s%@TEXPREFIX@%$TEXPREFIX%g -s%@TEXDIR@%$TEXDIR%g -s%@MFDIR@%$MFDIR%g s%@STRIPROFF@%$STRIPROFF%g s%@YODL@%$YODL%g s%@YODL2HTML@%$YODL2HTML%g diff --git a/configure.in b/configure.in index 275a9cae64..0774dcc824 100644 --- a/configure.in +++ b/configure.in @@ -34,13 +34,13 @@ AC_STEPMAKE_LIB AC_STEPMAKE_LOCALE AC_STEPMAKE_GETTEXT AC_STEPMAKE_MSGFMT -AC_STEPMAKE_TEXMF +# AC_STEPMAKE_TEXMF AC_STEPMAKE_YODL dnl should check out -print dnl huh? -AC_CHECK_SEARCH_RESULT($FIND, find, Please use --enable-tex-dir) +dnl AC_CHECK_SEARCH_RESULT($FIND, find, Please use --enable-tex-dir) AC_FUNC_MEMCMP AC_FUNC_VPRINTF diff --git a/flower/include/cursor.hh b/flower/include/cursor.hh index 7aea72d334..a7e5a1836d 100644 --- a/flower/include/cursor.hh +++ b/flower/include/cursor.hh @@ -21,10 +21,6 @@ public: /** create cursor, set at top. The const part isn't true, actually, #list# surely isn't const, but I get tired of the warning messages. */ Cursor (const List& list, Link* pointer = 0); - /** - Create an invalid cursor (pointing to nothing, associated with no list.) - */ - Cursor(); Cursor (const Cursor& cursor); T& thing(); @@ -94,12 +90,14 @@ public: void del(); /// access the list this came from - List& list() const ; + List* list_l() const ; Link* pointer(); static int compare (Cursor a,Cursorb) { return a-b; } + private: - List& list_; + Link* pointer_; + List* list_l_; }; diff --git a/flower/include/cursor.icc b/flower/include/cursor.icc index 416faa52e8..ee1f23f2bb 100644 --- a/flower/include/cursor.icc +++ b/flower/include/cursor.icc @@ -4,6 +4,7 @@ source file of the Flower Library (c) 1997--1998 Han-Wen Nienhuys + Jan Nieuwenhuizen */ @@ -14,32 +15,27 @@ #include -// untested +/** + Initialisation of Cursor.. Set pointer and list fields. + */ template inline -Cursor::Cursor() - : list_(*(List *)0) // ugh -{ - pointer_ = 0; -} - - -template -inline -Cursor::Cursor (const List& list, Link* pointer) : - list_((List&) list) +Cursor::Cursor (const List & list, Link* p ) { + list_l_ = (List *) &list; // damn const if (list.size()) - pointer_ = pointer ? pointer : list.top_; + pointer_ = p ? p : list.top_; else - pointer_ = pointer; + pointer_ = p; } + + template inline -Cursor::Cursor (const Cursor& cursor) : - list_(cursor.list_) +Cursor::Cursor (const Cursor& cursor) { + list_l_= cursor.list_l_; pointer_ = cursor.pointer_; } @@ -55,7 +51,7 @@ template Cursor Cursor::operator =(const Cursor& c) { - assert (&list_ == &c.list_); + assert (list_l_ == c.list_l_); pointer_ = c.pointer_; return *this; } @@ -64,21 +60,21 @@ template inline void Cursor::add (const T& th) { - list_.add (th, *this); + list_l_->add (th, *this); } template inline void Cursor::insert (const T& th) { - list_.insert (th, *this); + list_l_->insert (th, *this); } template -inline List& -Cursor::list() const +inline List * +Cursor::list_l() const { - return list_; + return list_l_; // ugh! } template diff --git a/flower/include/cursor.tcc b/flower/include/cursor.tcc index ea204e1dc6..42b0c52f3c 100644 --- a/flower/include/cursor.tcc +++ b/flower/include/cursor.tcc @@ -5,23 +5,23 @@ #include template - void +void Cursor::backspace() { Cursor c (*this); if (c.ok()) - c--; - list_.remove (*this); + c--; + list_l_->remove (*this); } template - void +void Cursor::del() { Cursor c (*this); if (c.ok()) - c++; - list_.remove (*this); + c++; + list_l_->remove (*this); *this = c; } @@ -31,7 +31,7 @@ Cursor Cursor::operator -=(int j) { while (j--) - (*this)--; + (*this)--; return *this; } template @@ -39,7 +39,7 @@ Cursor Cursor::operator +=(int j) { while (j++) - (*this)++; + (*this)++; return *this; } @@ -50,10 +50,10 @@ Cursor::operator +(int i) const Cursor r = *this; if (i<0) - return r -(-i); + return r -(-i); while (i--) - r++; + r++; return r; } @@ -64,10 +64,10 @@ Cursor::operator -(int i) const { Cursor r = *this; if (i<0) - return r +(-i); + return r +(-i); while (i--) - r--; + r--; return r; } @@ -79,31 +79,31 @@ template int Cursor::operator-(Cursor rhs) const { - assert (&rhs.list_ == &list_); + assert (rhs.list_l_ == list_l_); int dif = 0; // search from *this on further up (positive difference) Cursor c (*this); while (c.ok() && c.pointer_ != rhs.pointer_) { - c--; - dif++; + c--; + dif++; } if (c.ok()) - goto gotcha; // so, sue me. + goto gotcha; // so, sue me. // search in direction of bottom. (negative diff) dif =0; c=*this; while (c.ok() && c.pointer_ !=rhs.pointer_) { - dif --; - c++; + dif --; + c++; } assert (c.ok()); -gotcha: + gotcha: assert ((*this - dif).pointer_ == c.pointer_); return dif; } diff --git a/flower/include/pcursor.hh b/flower/include/pcursor.hh index 981b43a10f..9e7959f8a1 100644 --- a/flower/include/pcursor.hh +++ b/flower/include/pcursor.hh @@ -39,15 +39,15 @@ public: return remove_p(); } - Link_list &list() { return (Link_list&)Cursor::list (); } + Link_list *list_l() { return (Link_list *)Cursor::list_l (); } PCursor operator++(int) { return Cursor::operator++(0);} PCursor operator--(int) { return Cursor::operator--(0); } PCursor operator+=(int i) { return Cursor::operator+=(i);} PCursor operator-=(int i) { return Cursor::operator-=(i); } PCursor operator -(int no) const { return Cursor::operator-(no);} int operator -(PCursor op) const { return Cursor::operator-(op);} - PCursor operator +(int no) const {return Cursor::operator+(no);} PCursor (const Link_list & l) : Cursor (l) {} - PCursor() : Cursor () {} + PCursor operator +(int no) const {return Cursor::operator+(no);} + PCursor (const Link_list & l) : Cursor (l) {} PCursor (const Cursor& cursor) : Cursor(cursor) { } void* vptr() const { return *((Cursor &) *this); } diff --git a/flower/include/pcursor.tcc b/flower/include/pcursor.tcc index c2b459a267..a1f706b8a2 100644 --- a/flower/include/pcursor.tcc +++ b/flower/include/pcursor.tcc @@ -5,12 +5,12 @@ void PCursor::junk() { #if !defined (NDEBUG) && defined (PARANOID) - list().OK(); + list_l()->OK(); #endif delete ptr(); #if !defined (NDEBUG)&&defined (PARANOID) thing() = 0; - list().OK(); + list_l()->OK(); #endif } diff --git a/flower/include/rational.hh b/flower/include/rational.hh index 115d5f85c7..7394af6aa5 100644 --- a/flower/include/rational.hh +++ b/flower/include/rational.hh @@ -20,7 +20,18 @@ #include "arithmetic-operator.hh" #include "fproto.hh" +/** + Rational numbers. Included is support for + and - infinity. + */ class Rational { + /** + Sign of rational. + -2, .. 2 + + -2,2 is - and + infinity. + -1,1 is negative and positive. + 0 if *this is zero. + */ int sign_; unsigned int num_, den_; void normalise (); @@ -32,12 +43,17 @@ public: void invert (); int num () const { return sign_ * num_; } int den () const { return den_; } + int num_i () const { return sign_ * num_; } + int den_i () const { return den_; } Rational truncated () const; void negate (); operator bool () const; operator int () const; operator double () const; Rational operator - () const; + /** + Initialize to 0. + */ Rational (); Rational (int, int =1); Rational (double); @@ -45,9 +61,9 @@ public: Rational &operator = (Rational const &); Rational &operator *= (Rational); - Rational &operator /= (Rational); - Rational &operator += (Rational); - Rational &operator -= (Rational); + Rational &operator /= (Rational); + Rational &operator += (Rational); + Rational &operator -= (Rational); static int compare (Rational const&, Rational const&); int sign () const; String str () const; diff --git a/flower/rational.cc b/flower/rational.cc index 10b3bc9c2c..cf99657acb 100644 --- a/flower/rational.cc +++ b/flower/rational.cc @@ -41,7 +41,7 @@ Rational::truncated () const Rational::Rational () { - sign_ = 1; + sign_ = 0; num_ = den_ = 1; } @@ -53,6 +53,10 @@ Rational::Rational (int n, int d) normalise (); } +Rational::Rational (Rational const &r) +{ + copy (r); +} static int gcd (int a, int b) @@ -252,11 +256,6 @@ Rational::operator = (Rational const &r) return *this; } -Rational::Rational (Rational const &r) -{ - copy (r); -} - String Rational::str () const { diff --git a/init/GNUmakefile b/init/GNUmakefile index 00000cc6c6..a9a23da2da 100644 --- a/init/GNUmakefile +++ b/init/GNUmakefile @@ -5,7 +5,7 @@ depth = .. INI_FILES = $(FLY_FILES) $(LY_FILES) # DIST_FILES = Makefile $(INI_FILES) -INSTALLATION_DIR=$(datadir) +INSTALLATION_DIR=$(datadir)/ly/ INSTALLATION_FILES=$(INI_FILES) LOCALSTEPMAKE_TEMPLATES=mutopia diff --git a/init/book-fragment.ly b/init/book-fragment.ly index 0aa5267045..f8b283faf4 100644 --- a/init/book-fragment.ly +++ b/init/book-fragment.ly @@ -1,6 +1,6 @@ % Toplevel initialisation file. -\version "1.0.6"; +\version "1.0.7"; \include "declarations.ly" diff --git a/init/book-init.ly b/init/book-init.ly index 42f06c1a1d..e2744aa352 100644 --- a/init/book-init.ly +++ b/init/book-init.ly @@ -1,6 +1,6 @@ % Toplevel initialisation file. -\version "1.0.6"; +\version "1.0.7"; \include "declarations.ly"; diff --git a/init/center-fragment.ly b/init/center-fragment.ly index 6c26e3840d..4bf04f5963 100644 --- a/init/center-fragment.ly +++ b/init/center-fragment.ly @@ -1,7 +1,7 @@ % Toplevel initialisation file. -\version "1.0.6"; +\version "1.0.7"; \include "declarations.ly" diff --git a/init/center.ly b/init/center.ly index 441f9c0182..5fddea855e 100644 --- a/init/center.ly +++ b/init/center.ly @@ -1,6 +1,6 @@ % Toplevel initialisation file. -\version "1.0.6"; +\version "1.0.7"; \include "declarations.ly" diff --git a/init/engraver.ly b/init/engraver.ly index be32475668..54c737dd61 100644 --- a/init/engraver.ly +++ b/init/engraver.ly @@ -23,6 +23,7 @@ StaffContext=\translator { \consists "Staff_sym_engraver"; \consists "Collision_engraver"; \consists "Rest_collision_engraver"; + \consists "Tuplet_engraver"; %{ Uncomment to get bar numbers on single staff systems: diff --git a/init/fragment.ly b/init/fragment.ly index b80b83d735..0de947cf26 100644 --- a/init/fragment.ly +++ b/init/fragment.ly @@ -1,6 +1,6 @@ % Toplevel initialisation file. -\version "1.0.6"; +\version "1.0.7"; \include "declarations.ly" diff --git a/init/init.fly b/init/init.fly index 1ab82d8016..d3d0c5294c 100644 --- a/init/init.fly +++ b/init/init.fly @@ -1,6 +1,6 @@ % Toplevel initialisation file. -\version "1.0.6"; +\version "1.0.7"; \include "declarations.ly" diff --git a/init/init.ly b/init/init.ly index f3622d278d..3627b7e864 100644 --- a/init/init.ly +++ b/init/init.ly @@ -1,6 +1,6 @@ % Toplevel initialisation file. -\version "1.0.6"; +\version "1.0.7"; \include "declarations.ly"; diff --git a/init/paper16.ly b/init/paper16.ly index ea7a7a0529..c7f7352521 100644 --- a/init/paper16.ly +++ b/init/paper16.ly @@ -6,7 +6,7 @@ -\version "1.0.6"; +\version "1.0.7"; paper_sixteen = \paper { staffheight = 16.0\pt; diff --git a/init/paper20.ly b/init/paper20.ly index b73b3817bf..c8bf25b35b 100644 --- a/init/paper20.ly +++ b/init/paper20.ly @@ -5,7 +5,7 @@ \include "table13.ly"; \include "table16.ly"; -\version "1.0.6"; +\version "1.0.7"; paper_twenty = \paper { staffheight = 20.0\pt; diff --git a/input/example-3.ly b/input/example-3.ly index dedefdc038..426d1e7809 100644 --- a/input/example-3.ly +++ b/input/example-3.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; one = \notes\relative c{ c'' d e f diff --git a/input/keys.ly b/input/keys.ly index d5f945ffab..bdc719a5d4 100644 --- a/input/keys.ly +++ b/input/keys.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; blah = \notes { diff --git a/input/kortjakje.ly b/input/kortjakje.ly index aeeaa4f93a..c327f45d81 100644 --- a/input/kortjakje.ly +++ b/input/kortjakje.ly @@ -10,7 +10,7 @@ copyright = "public domain"; Tested Features: example file with comments %} -\version "1.0.6"; +\version "1.0.7"; % the % is a comment. diff --git a/input/part.ly b/input/part.ly index 40a62279be..ffcfe99695 100644 --- a/input/part.ly +++ b/input/part.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; part = \notes { c-1 c c c r1*3 diff --git a/input/pedal.ly b/input/pedal.ly index 3e466e4fcb..360902ce67 100644 --- a/input/pedal.ly +++ b/input/pedal.ly @@ -28,7 +28,7 @@ % \lbheel \lbheel \lfheel \lftoe % \rbheel \rbtoe \rfheel \rftoe -\version "1.0.6"; +\version "1.0.7"; \score{ \notes { diff --git a/input/praeludium-fuga-E.ly b/input/praeludium-fuga-E.ly index da3004548d..876299fdb4 100644 --- a/input/praeludium-fuga-E.ly +++ b/input/praeludium-fuga-E.ly @@ -23,7 +23,7 @@ * organ staff... %} -\version "1.0.6"; +\version "1.0.7"; diff --git a/input/rhythm.ly b/input/rhythm.ly index 197df1fda6..75558c339a 100644 --- a/input/rhythm.ly +++ b/input/rhythm.ly @@ -7,7 +7,7 @@ TestedFeatures = "multiple meters, beaming, unsynced bars, userdefd engravers"; -\version "1.0.6"; +\version "1.0.7"; ritme = \notes\transpose c'' { \time 4/4; diff --git a/input/scales.ly b/input/scales.ly index de9a2c496b..4992d6ad22 100644 --- a/input/scales.ly +++ b/input/scales.ly @@ -16,7 +16,7 @@ copyright = "public domain"; % scales with accents. % -\version "1.0.6"; +\version "1.0.7"; blah = \notes { \time 6/8; \transpose c { diff --git a/input/scripts.ly b/input/scripts.ly index 869836046b..797eb4f5df 100644 --- a/input/scripts.ly +++ b/input/scripts.ly @@ -1,5 +1,5 @@ -\version "1.0.6"; +\version "1.0.7"; blah = \notes{ \transpose c'' { diff --git a/input/test/abbrev.ly b/input/test/abbrev.ly index 6230a2acb0..d707a6c9a9 100644 --- a/input/test/abbrev.ly +++ b/input/test/abbrev.ly @@ -1,5 +1,5 @@ -\version "1.0.6"; +\version "1.0.7"; \score{ \notes \transpose c'''{ \stemup diff --git a/input/test/bar-scripts.ly b/input/test/bar-scripts.ly index 895c1b5b26..e12aab30f2 100644 --- a/input/test/bar-scripts.ly +++ b/input/test/bar-scripts.ly @@ -1,7 +1,7 @@ -\version "1.0.6"; +\version "1.0.7"; onestaff = \type Staff = foo\notes { \property Staff.instr = instr diff --git a/input/test/beam-chord.ly b/input/test/beam-chord.ly index fe5b0aa074..362c7232e2 100644 --- a/input/test/beam-chord.ly +++ b/input/test/beam-chord.ly @@ -1,4 +1,4 @@ -\version "1.0.4"; +\version "1.0.7"; \score{ \notes\transpose c'{ diff --git a/input/test/beam-pos.ly b/input/test/beam-pos.ly index 41cdc2e5e4..a5148faa47 100644 --- a/input/test/beam-pos.ly +++ b/input/test/beam-pos.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; \score{ \notes\transpose c''{ diff --git a/input/test/beams.ly b/input/test/beams.ly index d961f90d86..dad9d23498 100644 --- a/input/test/beams.ly +++ b/input/test/beams.ly @@ -6,7 +6,7 @@ copyright = "PD"; TestedFeatures = "beams and beamflags"; } -\version "1.0.6"; +\version "1.0.7"; \score{ < diff --git a/input/test/broken.ly b/input/test/broken.ly index 7ac2085fc7..e18db38aff 100644 --- a/input/test/broken.ly +++ b/input/test/broken.ly @@ -5,7 +5,7 @@ TestedFeatures = "This file tests Feta embedded slurs" + "(Feta definitively is not an abbreviation of Font-En-TjA)"; } -\version "1.0.6"; +\version "1.0.7"; shortlong = \notes{ c4()c( c c | diff --git a/input/test/clefs.ly b/input/test/clefs.ly index 4e0ea68389..846cf62b42 100644 --- a/input/test/clefs.ly +++ b/input/test/clefs.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; \score { \notes{ diff --git a/input/test/collisions.ly b/input/test/collisions.ly index c545798657..cc84405cfb 100644 --- a/input/test/collisions.ly +++ b/input/test/collisions.ly @@ -5,7 +5,7 @@ enteredby = "HWN,JCN"; copyright = "public domain"; Tested = "test the Collision resolution "; } -\version "1.0.6"; +\version "1.0.7"; diff --git a/input/test/defaultbars.ly b/input/test/defaultbars.ly index c0654ac96d..ef013933d2 100644 --- a/input/test/defaultbars.ly +++ b/input/test/defaultbars.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; \score { diff --git a/input/test/denneboom.ly b/input/test/denneboom.ly index 3f06328cda..bdbf2ee191 100644 --- a/input/test/denneboom.ly +++ b/input/test/denneboom.ly @@ -7,9 +7,9 @@ TestedFeatures = "This file tests silly line shapes"; \include "paper20.ly" -\version "1.0.6"; +\version "1.0.7"; -oden = \lyric{ +oden = \lyrics{ O8 | den-8. ne-16 boom,4. o8 | den-8. ne-16 boom.4. Wat8 | @@ -17,7 +17,7 @@ oden = \lyric{ won-8. der-16 schoon4 _8 } -ikheb = \lyric{ +ikheb = \lyrics{ Ik8 | heb u laatst4. in_'t8 | bos8. zien16 staan4 _8 toen8 | @@ -25,7 +25,7 @@ ikheb = \lyric{ kaars-8. jes16 aan.4 _8 } -ugloeit = \lyric{ +ugloeit = \lyrics{ U8 | gloeit in bar-4. re8 | win-8. ter-16 tijd,4 r8 als8 | diff --git a/input/test/dotted-slur.ly b/input/test/dotted-slur.ly index 03db2071a0..29140d0b45 100644 --- a/input/test/dotted-slur.ly +++ b/input/test/dotted-slur.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; \score{ \notes{ diff --git a/input/test/find-quarts.ly b/input/test/find-quarts.ly index 91a236b2b5..6a1dedc89c 100644 --- a/input/test/find-quarts.ly +++ b/input/test/find-quarts.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; \score{ \notes \relative c { diff --git a/input/test/font-body.ly b/input/test/font-body.ly index d4c2e7c487..b7a5c7d520 100644 --- a/input/test/font-body.ly +++ b/input/test/font-body.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; FontBody= \notes\transpose c''{ \bar "|:"; diff --git a/input/test/font.ly b/input/test/font.ly index 9d38c7f5f3..7692b8c90b 100644 --- a/input/test/font.ly +++ b/input/test/font.ly @@ -7,7 +7,7 @@ description = "This file tests the Feta music font"; % "(Feta definitively is not an abbreviation of Font-En-TjA)"; } -\version "1.0.6"; +\version "1.0.7"; \include "font-body.ly" \score{ diff --git a/input/test/font16.ly b/input/test/font16.ly index 3b1364e181..2c32786c81 100644 --- a/input/test/font16.ly +++ b/input/test/font16.ly @@ -7,7 +7,7 @@ description = "This file tests the Feta music font"; % "(Feta definitively is not an abbreviation of Font-En-TjA)"; } -\version "1.0.6"; +\version "1.0.7"; \include "font-body.ly" \score{ diff --git a/input/test/gourlay.ly b/input/test/gourlay.ly index 38dd6faa52..62ca043229 100644 --- a/input/test/gourlay.ly +++ b/input/test/gourlay.ly @@ -4,7 +4,7 @@ copyright = "PD"; TestedFeatures = "This file tests some nasty Gourlay spacings"; } -\version "1.0.6"; +\version "1.0.7"; %{ diff --git a/input/test/grace.ly b/input/test/grace.ly index a769b569c5..81db2a8871 100644 --- a/input/test/grace.ly +++ b/input/test/grace.ly @@ -1,5 +1,5 @@ -\version "1.0.6"; +\version "1.0.7"; \include "table13.ly"; \include "table16.ly"; diff --git a/input/test/hara-kiri.ly b/input/test/hara-kiri.ly index 66a786342c..49af9b64fd 100644 --- a/input/test/hara-kiri.ly +++ b/input/test/hara-kiri.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; toeter_i = \notes\relative c { \property Staff.instrument = "Toeters" diff --git a/input/test/keys.ly b/input/test/keys.ly index e47814a6bc..211c7c1e20 100644 --- a/input/test/keys.ly +++ b/input/test/keys.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; %{ test key itemv breaking diff --git a/input/test/knee.ly b/input/test/knee.ly index ae746715e1..af9d114128 100644 --- a/input/test/knee.ly +++ b/input/test/knee.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; \score{ \notes\relative c'{ [c16 \stemdown c'' \stemboth c,, d] diff --git a/input/test/mark.ly b/input/test/mark.ly index 8feb99bfa4..f5e9deb060 100644 --- a/input/test/mark.ly +++ b/input/test/mark.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; global = \notes { s1 | \mark "A"; diff --git a/input/test/multi-rest.ly b/input/test/multi-rest.ly index 54bd95e755..ac055ef54f 100644 --- a/input/test/multi-rest.ly +++ b/input/test/multi-rest.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; voice_one = \notes\transpose c' { \stemup R1 * 2 | f'4-. r r2 | R1 * 3 | diff --git a/input/test/ossia.ly b/input/test/ossia.ly index 05d8229156..531b549afa 100644 --- a/input/test/ossia.ly +++ b/input/test/ossia.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; \score { diff --git a/input/test/score-bar-scripts.ly b/input/test/score-bar-scripts.ly index 102dfc59e6..72b545bc38 100644 --- a/input/test/score-bar-scripts.ly +++ b/input/test/score-bar-scripts.ly @@ -1,7 +1,7 @@ -\version "1.0.6"; +\version "1.0.7"; onestaff = \type Staff = foo\notes { \property Staff.instr = instr diff --git a/input/test/sleur.ly b/input/test/sleur.ly index 3a5ac5dce6..70f7cfb15a 100644 --- a/input/test/sleur.ly +++ b/input/test/sleur.ly @@ -5,7 +5,7 @@ TestedFeatures = "This file tests Feta embedded slurs" + "(Feta definitively is not an abbreviation of Font-En-TjA)"; } -\version "1.0.6"; +\version "1.0.7"; shortlong = \notes{ c4()c( c c | diff --git a/input/test/slur-bug.ly b/input/test/slur-bug.ly index edee54434d..10cf4bc782 100644 --- a/input/test/slur-bug.ly +++ b/input/test/slur-bug.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; % bug % excentric slur can't handle this ... diff --git a/input/test/slur-damping.ly b/input/test/slur-damping.ly index 43c422d38e..96f89df4c5 100644 --- a/input/test/slur-damping.ly +++ b/input/test/slur-damping.ly @@ -1,5 +1,5 @@ % test damping -\version "1.0.6"; +\version "1.0.7"; \score{ \notes\relative c'{ diff --git a/input/test/slur-swap.ly b/input/test/slur-swap.ly index 8b24a4e5a2..1cc9dbc7c4 100644 --- a/input/test/slur-swap.ly +++ b/input/test/slur-swap.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; % urg, the direction of the slur gets swapped! \score{ diff --git a/input/test/slurs.ly b/input/test/slurs.ly index 459ed7e48f..248f64ca9f 100644 --- a/input/test/slurs.ly +++ b/input/test/slurs.ly @@ -1,5 +1,5 @@ -\version "1.0.6"; +\version "1.0.7"; \score{ \notes\transpose c'{ diff --git a/input/test/spacing.ly b/input/test/spacing.ly index 6ba7255550..baf346b551 100644 --- a/input/test/spacing.ly +++ b/input/test/spacing.ly @@ -6,7 +6,7 @@ copyright = "public domain"; TestedFeatures = "This file tests various spacings"; } -\version "1.0.6"; +\version "1.0.7"; multipart = \notes{ \type StaffGroup < diff --git a/input/test/stem.ly b/input/test/stem.ly index 667be275d6..cf19937c7d 100644 --- a/input/test/stem.ly +++ b/input/test/stem.ly @@ -8,7 +8,7 @@ of beams"; } -\version "1.0.6"; +\version "1.0.7"; beamintervals = \notes{ \time 7/4; diff --git a/input/test/test-lyrics.ly b/input/test/test-lyrics.ly index 39eb2e13bc..01db413dbc 100644 --- a/input/test/test-lyrics.ly +++ b/input/test/test-lyrics.ly @@ -1,6 +1,6 @@ -\version "1.0.6"; +\version "1.0.7"; -$somewhat_long = \lyric{ +$somewhat_long = \lyrics{ \property Lyrics . textstyle = "roman" AaaaaaA2 BbbbbbB2 @@ -10,7 +10,7 @@ $somewhat_long = \lyric{ FfffffF2 } -$rather_long = \lyric{ +$rather_long = \lyrics{ \property Lyrics . textstyle = "roman" LLLLoooonggggg2 Syyllllaaabbble2 @@ -20,7 +20,7 @@ $rather_long = \lyric{ Syyyylllaaabbble2 } -$quite_long = \lyric{ +$quite_long = \lyrics{ \property Lyrics . textstyle = "roman" LLLLLLLLLooooongggggggg2 Syyyyyyyyyyyyylllllllaaaaaabbble2 diff --git a/input/test/tie-bug.ly b/input/test/tie-bug.ly index 1b21d5308b..e457a475e4 100644 --- a/input/test/tie-bug.ly +++ b/input/test/tie-bug.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; % middle tie is wrong diff --git a/input/test/tie.ly b/input/test/tie.ly index cddf1e9cc8..1d58f5ddcf 100644 --- a/input/test/tie.ly +++ b/input/test/tie.ly @@ -1,4 +1,4 @@ -\version "1.0.6"; +\version "1.0.7"; tie = \notes\transpose c''{ diff --git a/input/test/title.ly b/input/test/title.ly index ae1b5ee610..ff7c1b24cc 100644 --- a/input/test/title.ly +++ b/input/test/title.ly @@ -10,7 +10,7 @@ source = "urtext"; instrument= "Instrument"; } -\version "1.0.6"; +\version "1.0.7"; \score{ \notes diff --git a/input/test/transposition.ly b/input/test/transposition.ly index 8483b8735c..885feb994b 100644 --- a/input/test/transposition.ly +++ b/input/test/transposition.ly @@ -22,7 +22,7 @@ copyright = "public domain"; } -\version "1.0.6"; +\version "1.0.7"; vOne = \notes \relative c''{ \clef"violin"; diff --git a/input/test/vertical-align.ly b/input/test/vertical-align.ly index b74d873faf..ae4540940c 100644 --- a/input/test/vertical-align.ly +++ b/input/test/vertical-align.ly @@ -1,5 +1,5 @@ -\version "1.0.6"; +\version "1.0.7"; \score { \notes < diff --git a/input/tril.ly b/input/tril.ly index 1d3537747a..c2b72bcd57 100644 --- a/input/tril.ly +++ b/input/tril.ly @@ -5,7 +5,7 @@ TestedFeatures = "This file tests trills" + "(Feta definitively is not an abbreviation of Font-En-TjA)"; } -\version "1.0.6"; +\version "1.0.7"; \score{ \notes{ diff --git a/input/twinkle-pop.ly b/input/twinkle-pop.ly index b934bf900a..46c35973e3 100644 --- a/input/twinkle-pop.ly +++ b/input/twinkle-pop.ly @@ -12,7 +12,7 @@ copyright = "public domain"; Tested Features lyrics and chords %} -\version "1.0.6"; +\version "1.0.7"; melodie = \notes\relative c { \clef"violin"; @@ -26,7 +26,7 @@ melodie = \notes\relative c { f4^"F" f | e^"C" e | d^"G7" d | c2^"C" | } -text = \lyric{ +text = \lyrics{ \property Lyrics . textstyle = "italic" Ah!4 vous dir- ai_- je ma man2 @@ -40,7 +40,7 @@ text = \lyric{ \score { < \notes \type Staff \melodie - \lyric \type Lyrics \text + \lyrics \type Lyrics \text > \paper { } } diff --git a/input/twinkle.ly b/input/twinkle.ly index 739108a64a..1d1520f6af 100644 --- a/input/twinkle.ly +++ b/input/twinkle.ly @@ -20,7 +20,7 @@ traditional song in various languages. Tested Features: lyrics, interleaving lyrics and staffs %} -\version "1.0.6"; +\version "1.0.7"; melody = \notes \relative c'' { \clef violin; @@ -54,7 +54,7 @@ global = \notes { \bar ":|"; } -tekst = \lyric{ +tekst = \lyrics{ Al-4 tijd is Kort- jak- je ziek,2 midden4 in_de week maar s,_zon- dags niet.2 % ugly hack: insertion of empty syllables creates columns on extra @@ -74,7 +74,7 @@ Ja inderdaad. Dit is geen educatieve danwel muzikaal verantwoorde tekst. Mogen wij ook af en toe ergens op afgeven? %} -hegedraagjetekst = \lyric{ +hegedraagjetekst = \lyrics{ Al-4 tijd zuigt Bill Gates mijn piek,2 "\TeX"4 is slecht- ser dan mu- ziek.2 s,_Zon-4 dags gaat het door een raam,2 @@ -83,7 +83,7 @@ hegedraagjetekst = \lyric{ "\TeX"4 is slecht- ser dan mu- ziek.2 } -texte = \lyric{ +texte = \lyrics{ \property Lyrics . textstyle" = "italic" % \property Lyrics . textstyle" = "roman" Ah!4 vous dir- ai_- je ma- man2 @@ -94,7 +94,7 @@ texte = \lyric{ Va-4 lent mieux que la rai- son2 } -texti = \lyric{ +texti = \lyrics{ \property "Lyrics"."textstyle" = "roman" Twin-4 kle, twin- kle, lit- tle star,2 How4 I won- der what you are.2 @@ -104,7 +104,7 @@ texti = \lyric{ How4 I won- der what you are!2 } -textii = \lyric{ +textii = \lyrics{ When4 the bla- zing sun is gone,2 When4 he no- thing shines up- on,2 Then4 you show your lit- tle light,2 @@ -114,7 +114,7 @@ textii = \lyric{ } -textiii = \lyric{ +textiii = \lyrics{ Then4 the tra- veler in the dark2 Thanks4 you for your ti- ny spark;2 He_could4 not see which way to go,2 diff --git a/lib/duration.cc b/lib/duration.cc index 7bdf8d00dc..f65348ae6d 100644 --- a/lib/duration.cc +++ b/lib/duration.cc @@ -38,6 +38,13 @@ Duration::duration_type_b (int t) return t == Duration_convert::type2_i (Duration_convert::i2_type (t)); } +void +Duration::compress (Moment m) +{ + plet_.iso_i_ *= m.num_i (); + plet_.type_i_ *= m.den_i (); +} + // ugh, what's this? // i should be called "mom ()", ... or at least "length_mom ()" Moment diff --git a/lib/include/duration.hh b/lib/include/duration.hh index 367672ac4e..509a6d69d9 100644 --- a/lib/include/duration.hh +++ b/lib/include/duration.hh @@ -27,6 +27,7 @@ struct Duration { bool plet_b (); String str () const; void set_plet (int,int ); + void compress (Moment); static bool duration_type_b (int t); void set_ticks (int ticks_i ); diff --git a/lily/atom.cc b/lily/atom.cc index 8e32fd0133..76b59197d3 100644 --- a/lily/atom.cc +++ b/lily/atom.cc @@ -13,7 +13,7 @@ #include "array.hh" #include "debug.hh" #include "dimensions.hh" -#include "paper-def.hh" +#include "lookup.hh" #include "main.hh" inline bool @@ -29,7 +29,7 @@ Atom::check_infinity_b ()const if (abs (off_[ax]) >= 100 CM) { warning (_f ("ridiculous dimension: %s, %s", axis_name_str (ax), - dimension_str (off_[ax]))); + global_lookup_l->print_dimen (off_[ax]))); if (experimental_features_global_b) assert (false); @@ -76,7 +76,7 @@ Atom::Atom () But Atom is used as a simple type *everywhere*, and we don't have virtual contructors. */ - str_ = global_paper_l->unknown_str (); + str_ = global_lookup_l->unknown_str (); } Atom::Atom (String s, Box b) diff --git a/lily/auto-plet-engraver.cc b/lily/auto-plet-engraver.cc new file mode 100644 index 0000000000..8812f6245c --- /dev/null +++ b/lily/auto-plet-engraver.cc @@ -0,0 +1,109 @@ +/* + auto-plet-engraver.cc -- implement Auto_plet_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1998 Han-Wen Nienhuys + + */ + +#include "auto-plet-engraver.hh" +#include "command-request.hh" +#include "slur.hh" +#include "note-column.hh" + +bool +Tuplet_engraver::do_try_request (Request *r) +{ + Command_req * c = r->access_Command_req (); + if (!(c && + c->access_Bracket_req ())) + { + return false; + } + + Bracket_req * b = c->access_Bracket_req (); + bracket_req_arr_.push (b); + return true; +} + + +void +Tuplet_engraver::do_process_requests () +{ + int stopcount =0; + Link_array start_arr; + + for (int i=0; i < bracket_req_arr_.size (); i++) + { + if (bracket_req_arr_[i]->spantype == Span_req::STOP) + stopcount++; + if (bracket_req_arr_[i]->spantype == Span_req::START) + { + Slur *sp =new Slur; + start_arr.push (sp); + announce_element (Score_element_info (sp, bracket_req_arr_[i])); + } + } + + for (; stopcount--; ) + { + Slur *sp = started_span_p_arr_.pop (); + stop_now_span_p_arr_.push (sp); + } + + for (int i=0; i < start_arr.size (); i++) + started_span_p_arr_.push (start_arr.pop ()); +} + +void +Tuplet_engraver::acknowledge_element (Score_element_info i) +{ + if (i.elem_l_->is_type_b (Note_column::static_name ())) + { + Note_column *nc = (Note_column*)i.elem_l_->access_Item (); + for (int j =0; j add_column (nc); + } +} + +void +Tuplet_engraver::do_pre_move_processing () +{ + typeset_all (); +} + +void +Tuplet_engraver::typeset_all () +{ + for (int i=0; i < stop_now_span_p_arr_.size (); i++) + { + typeset_element (stop_now_span_p_arr_[i]); + } + + stop_now_span_p_arr_.clear (); +} + +void +Tuplet_engraver::do_removal_processing () +{ + typeset_all (); + for (int i=0; i < started_span_p_arr_.size (); i++) + { + typeset_element (started_span_p_arr_[i]); + } +} + +ADD_THIS_TRANSLATOR(Tuplet_engraver); +IMPLEMENT_IS_TYPE_B1(Tuplet_engraver, Engraver); + +Tuplet_engraver::Tuplet_engraver() +{ +} + + +void +Tuplet_engraver::do_post_move_processing () +{ + bracket_req_arr_.clear (); +} diff --git a/lily/change-iterator.cc b/lily/change-iterator.cc index d314f35385..b319c72089 100644 --- a/lily/change-iterator.cc +++ b/lily/change-iterator.cc @@ -11,37 +11,39 @@ #include "change-translator.hh" #include "debug.hh" -Change_iterator::Change_iterator (Change_translator *change_l) -{ - change_l_ = change_l; -} void Change_iterator::error (String reason) { - String to_type = change_l_->change_to_type_str_; - String to_id = change_l_->change_to_id_str_; + String to_type = change_l ()->change_to_type_str_; + String to_id = change_l ()->change_to_id_str_; String warn1 = _f ("can't change `%s\' to `%s\'", to_type, to_id) + ": " + reason; - String warn2= "Change_iterator::process_and_next (): " + String warn2= "Change_iterator::do_process_and_next (): " + report_to_l ()->type_str_ + " = `" + report_to_l ()->id_str_ + "\': "; warning (warn2); - change_l_->warning (warn1); + change_l ()->warning (warn1); +} + +Change_translator * +Change_iterator::change_l () +{ + return (Change_translator*) music_l_; } /* move to construct_children ? */ void -Change_iterator::process_and_next (Moment m) +Change_iterator::do_process_and_next (Moment m) { Translator_group * current = report_to_l (); Translator_group * last = 0; - String to_type = change_l_->change_to_type_str_; - String to_id = change_l_->change_to_id_str_; + String to_type = change_l ()->change_to_type_str_; + String to_id = change_l ()->change_to_id_str_; /* find the type of translator that we're changing. @@ -68,13 +70,13 @@ Change_iterator::process_and_next (Moment m) We could change the current translator's id, but that would make errors hard to catch - last->translator_id_str_ = change_l_->change_to_id_str_; + last->translator_id_str_ = change_l ()->change_to_id_str_; */ error ("I'm one myself"); } else error ("None of these in my family."); - Music_iterator::process_and_next (m); + Music_iterator::do_process_and_next (m); } IMPLEMENT_IS_TYPE_B1 (Change_iterator, Music_iterator); diff --git a/lily/chord-iterator.cc b/lily/chord-iterator.cc index 998ac40224..34c91c586c 100644 --- a/lily/chord-iterator.cc +++ b/lily/chord-iterator.cc @@ -13,27 +13,18 @@ #include "music-list.hh" -Simultaneous_music_iterator::~Simultaneous_music_iterator() -{ -} - -Simultaneous_music_iterator::Simultaneous_music_iterator (Simultaneous_music const *simultaneous_music_C) -{ - simultaneous_music_C_ = simultaneous_music_C; -} - void Simultaneous_music_iterator::construct_children() { int j = 0; - for (PCursor i (simultaneous_music_C_->music_p_list_p_->top()); + for (PCursor i (simultaneous_music_l ()->music_p_list_p_->top()); i.ok(); j++, i++) { Music_iterator * mi = get_iterator_p (i.ptr()); if (mi->ok()) { - if (simultaneous_music_C_->translator_type_str_.empty_b ()) - set_translator (mi->report_to_l()->ancestor_l (simultaneous_music_C_->multi_level_i_)); + if (simultaneous_music_l ()->translator_type_str_.empty_b ()) + set_translator (mi->report_to_l()->ancestor_l (simultaneous_music_l ()->multi_level_i_)); children_p_list_.bottom().add (mi); } else @@ -54,7 +45,7 @@ Simultaneous_music_iterator::do_print() const } void -Simultaneous_music_iterator::process_and_next (Moment until) +Simultaneous_music_iterator::do_process_and_next (Moment until) { for (PCursor i (children_p_list_.top()); i.ok ();) { @@ -67,7 +58,7 @@ Simultaneous_music_iterator::process_and_next (Moment until) else i++; } - Music_iterator::process_and_next (until); + Music_iterator::do_process_and_next (until); } @@ -90,3 +81,9 @@ Simultaneous_music_iterator::ok() const { return children_p_list_.size(); } + +Simultaneous_music* +Simultaneous_music_iterator::simultaneous_music_l ()const +{ + return ( Simultaneous_music *) music_l_; +} diff --git a/lily/command-request.cc b/lily/command-request.cc index 24f2fee50b..b32dc96ff4 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -54,12 +54,20 @@ Bar_req::do_equal_b (Request*r) const IMPLEMENT_IS_TYPE_B1(Bar_req,Command_req); +IMPLEMENT_IS_TYPE_B2(Bracket_req, Command_req, Span_req); + void Bar_req::do_print() const { DOUT << type_str_; } +void +Bracket_req::do_print () const +{ + Span_req::do_print (); +} + Bar_req::Bar_req (String s) { type_str_ = s; diff --git a/lily/compressed-music-iterator.cc b/lily/compressed-music-iterator.cc new file mode 100644 index 0000000000..c5c60acc78 --- /dev/null +++ b/lily/compressed-music-iterator.cc @@ -0,0 +1,68 @@ +/* + compressed-music-iterator.cc -- implement Compressed_music_iterator + + source file of the GNU LilyPond music typesetter + + (c) 1998 Han-Wen Nienhuys + + */ + +#include "compressed-music-iterator.hh" +#include "compressed-music.hh" +#include "musical-request.hh" +#include "translator-group.hh" +#include "command-request.hh" + +IMPLEMENT_IS_TYPE_B1(Compressed_music_iterator, Music_wrapper_iterator); + +Compressed_music_iterator::Compressed_music_iterator () +{ + Bracket_req pr; + pr.spantype = Span_req::START; + // pr.plet_i_ = 1; + start_req_p_ = new Bracket_req (pr); + pr.spantype = Span_req::STOP; + stop_req_p_ =new Bracket_req (pr); +} + +Compressed_music_iterator::~Compressed_music_iterator () +{ + delete start_req_p_; + delete stop_req_p_; +} + +Compressed_music * +Compressed_music_iterator::compressed_l () const +{ + return (Compressed_music*) music_l_; +} + +void +Compressed_music_iterator::construct_children () +{ + /* + start_req_p_->plet_i_ = compressed_l ()->den_i_; + stop_req_p_->plet_i_ = compressed_l ()->den_i_; + */ + Music_wrapper_iterator::construct_children (); +} + +void +Compressed_music_iterator::do_process_and_next (Moment m) +{ + if (first_b_) + { + bool success = report_to_l ()->try_request (start_req_p_); + if (!success) + music_l_->warning ( _("No one to print a tuplet start bracket")); + } + + Music_wrapper_iterator::do_process_and_next (m); + + if (!ok ()) + { + bool success = report_to_l ()->try_request (stop_req_p_); + if (!success) + music_l_->warning ( _("No one to print a tuplet stop bracket")); + } +} diff --git a/lily/compressed-music.cc b/lily/compressed-music.cc new file mode 100644 index 0000000000..5c03ef1649 --- /dev/null +++ b/lily/compressed-music.cc @@ -0,0 +1,23 @@ +/* + compressed-music.cc -- implement Compressed_music + + source file of the GNU LilyPond music typesetter + + (c) 1998 Han-Wen Nienhuys + + */ + +#include "compressed-music.hh" + + +Compressed_music::Compressed_music (int n, int d,Music *mp) + : Music_wrapper (mp) +{ + num_i_ = n; + den_i_ = d; + element_p_->compress (Moment (num_i_,den_i_)); +} + +IMPLEMENT_IS_TYPE_B1(Compressed_music, Music_wrapper); + + diff --git a/lily/dimensions.cc b/lily/dimensions.cc deleted file mode 100644 index 26a5c082e8..0000000000 --- a/lily/dimensions.cc +++ /dev/null @@ -1,16 +0,0 @@ - -#include "warn.hh" -#include "dimensions.hh" - -String -dimension_str (Real r) -{ - String s = to_str (r, "%.3f"); - if (s.index_i ("NaN") != -1) - { - warning (_ ("NaN")); - s = "0.0"; - } - return s; -} - diff --git a/lily/header.cc b/lily/header.cc deleted file mode 100644 index fc95d2f8b2..0000000000 --- a/lily/header.cc +++ /dev/null @@ -1,47 +0,0 @@ -/* - header.cc -- implement Header - - source file of the GNU LilyPond music typesetter - - (c) 1997--1998 Han-Wen Nienhuys - Jan Nieuwenhuizen -*/ - -#include "string.hh" -#include "dictionary-iter.hh" -#include "header.hh" -#include "main.hh" - -extern char const *lily_version_number_sz (); - -Header::Header () -{ - lily_id_str_ = "Lily was here, " + - String (lily_version_number_sz ()); -} - -//urg -String -Header::tex_string () const -{ - String s; - - s+= "\\def\\LilyIdString{" + lily_id_str_ + "}"; - - for (Dictionary_iter i (*this); i.ok (); i++) - s += "\\def\\mudela" + i.key () + "{" + i.val () + "}\n"; - return s; -} - -String -Header::ps_string () const -{ - String s; - - s+= "/lily_id_string\n{" + lily_id_str_ + "} bind def\n"; - - for (Dictionary_iter i (*this); i.ok (); i++) - s += "/mudela" + i.key () + "{" + i.val () + "} bind def\n"; - return s; -} - diff --git a/lily/include/auto-plet-engraver.hh b/lily/include/auto-plet-engraver.hh new file mode 100644 index 0000000000..a8cafb9c7c --- /dev/null +++ b/lily/include/auto-plet-engraver.hh @@ -0,0 +1,39 @@ +/* + auto-plet-engraver.hh -- declare Auto_plet_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1998 Han-Wen Nienhuys + + */ + +#ifndef AUTO_PLET_ENGRAVER_HH +#define AUTO_PLET_ENGRAVER_HH + +#include "engraver.hh" + +class Tuplet_engraver : public Engraver +{ + void typeset_all (); +public: + Tuplet_engraver (); + DECLARE_MY_RUNTIME_TYPEINFO; + TRANSLATOR_CLONE(Tuplet_engraver); + +protected: + Link_array bracket_req_arr_; + + Link_array started_span_p_arr_; + Link_array stop_now_span_p_arr_; + + virtual void do_removal_processing (); + virtual void acknowledge_element (Score_element_info); + virtual void do_pre_move_processing (); + virtual bool do_try_request (Request*r); + virtual void do_process_requests (); + virtual void do_post_move_processing (); +}; + + + +#endif /* AUTO_PLET_ENGRAVER_HH */ diff --git a/lily/include/change-iterator.hh b/lily/include/change-iterator.hh index a4d435be5b..409b3a648d 100644 --- a/lily/include/change-iterator.hh +++ b/lily/include/change-iterator.hh @@ -15,15 +15,13 @@ class Change_iterator : public Music_iterator { - Change_translator *change_l_; - + Change_translator *change_l (); void error (String); public: DECLARE_MY_RUNTIME_TYPEINFO; - Change_iterator (Change_translator* prop_l); protected: - virtual void process_and_next (Moment); + virtual void do_process_and_next (Moment); }; #endif diff --git a/lily/include/chord-iterator.hh b/lily/include/chord-iterator.hh index be48f33572..0ce4d63a32 100644 --- a/lily/include/chord-iterator.hh +++ b/lily/include/chord-iterator.hh @@ -16,16 +16,14 @@ class Simultaneous_music_iterator : public Music_iterator { - const Simultaneous_music *simultaneous_music_C_; + Simultaneous_music *simultaneous_music_l() const; Pointer_list children_p_list_; public: - ~Simultaneous_music_iterator(); - Simultaneous_music_iterator (Simultaneous_music const*); DECLARE_MY_RUNTIME_TYPEINFO; protected: virtual void do_print() const; virtual void construct_children(); - virtual void process_and_next (Moment); + virtual void do_process_and_next (Moment); virtual Moment next_moment() const; virtual bool ok() const; }; diff --git a/lily/include/clef-engraver.hh b/lily/include/clef-engraver.hh index 56c4fbc1d8..813a153393 100644 --- a/lily/include/clef-engraver.hh +++ b/lily/include/clef-engraver.hh @@ -37,7 +37,6 @@ public: Direction octave_dir_; String clef_type_str_; - /* ************** */ Clef_engraver(); DECLARE_MY_RUNTIME_TYPEINFO; diff --git a/lily/include/col-info.hh b/lily/include/col-info.hh index a01afd3c74..3b412a321f 100644 --- a/lily/include/col-info.hh +++ b/lily/include/col-info.hh @@ -34,7 +34,6 @@ struct Column_info { Drul_array< Array > rods_; - /* *************** */ Column_info(); Column_info (Paper_column *,Real const *); diff --git a/lily/include/colhpos.hh b/lily/include/colhpos.hh index e46991dc33..964933e2df 100644 --- a/lily/include/colhpos.hh +++ b/lily/include/colhpos.hh @@ -21,7 +21,6 @@ struct Column_x_positions { Real energy_f_; bool satisfies_constraints_b_; - /* ************** */ void OK() const; ~Column_x_positions(); void solve_line(); diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 3e187487f3..a76a351861 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -32,6 +32,7 @@ public: DEFAULTACCESSOR(Command_script_req) DEFAULTACCESSOR(Break_req) DEFAULTACCESSOR(Mark_req) + DEFAULTACCESSOR(Bracket_req) }; @@ -170,4 +171,10 @@ public: REQUESTMETHODS(Clef_change_req); }; +class Bracket_req : public Span_req, public Command_req { + +public: + REQUESTMETHODS(Bracket_req); +}; + #endif // COMMANDREQUEST_HH diff --git a/lily/include/compressed-music-iterator.hh b/lily/include/compressed-music-iterator.hh new file mode 100644 index 0000000000..84b92abe3d --- /dev/null +++ b/lily/include/compressed-music-iterator.hh @@ -0,0 +1,30 @@ +/* + compressed-music-iterator.hh -- declare Compressed_music_iterator + + source file of the GNU LilyPond music typesetter + + (c) 1998 Han-Wen Nienhuys + + */ + +#ifndef COMPRESSED_MUSIC_ITERATOR_HH +#define COMPRESSED_MUSIC_ITERATOR_HH + +#include "music-wrapper-iterator.hh" + +class Compressed_music_iterator : public Music_wrapper_iterator +{ +public: + Bracket_req* start_req_p_; + Bracket_req* stop_req_p_; + DECLARE_MY_RUNTIME_TYPEINFO; + Compressed_music_iterator(); + ~Compressed_music_iterator (); + virtual void do_process_and_next (Moment); + virtual void construct_children (); + Compressed_music *compressed_l ()const; +}; + + +#endif /* COMPRESSED_MUSIC_ITERATOR_HH */ + diff --git a/lily/include/compressed-music.hh b/lily/include/compressed-music.hh new file mode 100644 index 0000000000..f234b7497b --- /dev/null +++ b/lily/include/compressed-music.hh @@ -0,0 +1,29 @@ +/* + compressed-music.hh -- declare Compressed_music + + source file of the GNU LilyPond music typesetter + + (c) 1998 Han-Wen Nienhuys + + */ + +#ifndef COMPRESSED_MUSIC_HH +#define COMPRESSED_MUSIC_HH + +#include "music-wrapper.hh" +/** + Tempo expansion or compression. + */ +class Compressed_music : public Music_wrapper +{ +public: + int num_i_; + int den_i_; + + Compressed_music (int, int, Music *); + DECLARE_MY_RUNTIME_TYPEINFO; + VIRTUAL_COPY_CONS (Compressed_music, Music); +}; + +#endif /* COMPRESSED_MUSIC_HH */ + diff --git a/lily/include/dimensions.hh b/lily/include/dimensions.hh index 91b6e0c4d6..777d80e89c 100644 --- a/lily/include/dimensions.hh +++ b/lily/include/dimensions.hh @@ -14,7 +14,5 @@ const Real PT_TO_PT =1.0; #define CM *CM_TO_PT #define INCH *INCH_TO_PT -String dimension_str (Real r); - #endif // DIMENSIONS_HH diff --git a/lily/include/dynamic-engraver.hh b/lily/include/dynamic-engraver.hh index 1c2a574eff..d4add06755 100644 --- a/lily/include/dynamic-engraver.hh +++ b/lily/include/dynamic-engraver.hh @@ -19,7 +19,6 @@ class Dynamic_engraver : public Engraver { Crescendo * cresc_p_; Span_dynamic_req * cresc_req_l_; Array dynamic_req_l_arr_; - /* ************** */ public: TRANSLATOR_CLONE(Dynamic_engraver); Dynamic_engraver(); diff --git a/lily/include/file-results.hh b/lily/include/file-results.hh index a9cf1abdaf..5f4b221e1e 100644 --- a/lily/include/file-results.hh +++ b/lily/include/file-results.hh @@ -9,12 +9,10 @@ #ifndef FILE_RESULTS_HH #define FILE_RESULTS_HH - -#include "lily-proto.hh" -#include "string.hh" +#include "fproto.hh" void do_one_file (String init_str, String file_str); -extern Header *header_global_p; +extern Scope *header_global_p; extern Array target_str_global_array; extern Array inclusion_global_array; extern Link_array score_global_array; diff --git a/lily/include/grouping.hh b/lily/include/grouping.hh index b0bff2363d..ada7b4ab5c 100644 --- a/lily/include/grouping.hh +++ b/lily/include/grouping.hh @@ -18,7 +18,6 @@ struct Rhythmic_grouping { Array children; MInterval *interval_; - /* *************** */ Array intervals(); MInterval interval() const; diff --git a/lily/include/header.hh b/lily/include/header.hh index 288ca7a671..e65d065e92 100644 --- a/lily/include/header.hh +++ b/lily/include/header.hh @@ -12,19 +12,12 @@ #include "string.hh" #include "dictionary.hh" +#include "scope.hh" /** Store bibliographical information. The information in the \header block is read into this struct. Lily does not process this information. */ -struct Header : Dictionary -{ - Header (); - - String tex_string () const; - String ps_string () const; - - String lily_id_str_; -}; +typedef Scope Header; #endif // HEADER_HH diff --git a/lily/include/identifier.hh b/lily/include/identifier.hh index 63083109f7..cb36305966 100644 --- a/lily/include/identifier.hh +++ b/lily/include/identifier.hh @@ -37,8 +37,6 @@ virtual Class ## _identifier * access_ ## Class ## _identifier () { return 0; } /** A declarable data structure in mudela. - - */ struct Identifier : public Input { bool init_b_; diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index f1884ac8cf..b7af83ec16 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -61,7 +61,8 @@ struct Collision; struct Collision_engraver; struct Command_req; struct Command_script_req; -struct Complex_music; +struct Compressed_music; +struct Compressed_music_iterator; struct Cresc_req; struct Crescendo ; struct Decresc_req; @@ -82,11 +83,10 @@ struct Music_output; struct Musical_pitch; struct Music_output_def; struct Global_translator; -struct Group_change_req; struct Hara_kiri_line_group_engraver; struct Hara_kiri_vertical_group_spanner; struct Head_column; -struct Header; + struct Horizontal_align_item; struct Horizontal_group_element; struct Horizontal_group_item; @@ -144,6 +144,7 @@ struct Multi_measure_rest_engraver; struct Musical_script_req; struct Music_list; struct Musical_req; +struct Musical_span_req; struct Music; struct Music_sequence; struct Music_wrapper_iterator; @@ -173,8 +174,6 @@ struct Piano_brace; struct Performer; struct Performer_group_performer; struct Property_iterator; -struct Ps_score; -struct Ps_def; struct Ps_lookup; struct Ps_outputter; struct Ps_stream; @@ -229,8 +228,6 @@ struct Symtables; struct Super_element; struct Translation_property; struct Tempo_req; -struct Tex_def; -struct Tex_score; struct Tex_lookup; struct Tex_outputter; struct Tex_stream; @@ -256,4 +253,6 @@ struct Sequential_music; struct Request_chord; typedef Rational Moment; +typedef Scope Header; + #endif // LILY_PROTO_HH diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 9b1e198a44..7efe60bb7e 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -36,6 +36,7 @@ public: virtual Atom* atom_p (String, int, Box) const = 0; Atom ball (int) const; Atom bar (String, Real height) const; + String base_output_str () const; Atom beam (Real,Real, Real) const; virtual String character_str (int i) const; Atom clef (String) const; @@ -45,10 +46,14 @@ public: Atom fill (Box b) const; Atom flag (int, Direction) const; virtual Atom hairpin (Real width, bool decresc, bool continued) const = 0; + virtual Lookup* lookup_p (Lookup const&) const = 0; + virtual Lookup* lookup_p (Symtables const&) const = 0; + virtual Paper_outputter* paper_outputter_p (Paper_stream*, Paper_def*, Scope*, String) const = 0; + virtual Paper_stream* paper_stream_p () const = 0; virtual Atom plet (Real dy, Real dx, Direction dir) const = 0; void print () const; virtual Atom ps_beam (Real slope, Real width, Real thick) const = 0; - String print_dimen (Real) const; + virtual String print_dimen (Real) const; Atom rest (int, bool outside) const; Atom rule_symbol (Real height, Real width) const; Atom script (String idx) const; @@ -66,6 +71,7 @@ public: virtual Atom slur (Array controls) const = 0; Atom streepje (int type) const; virtual Atom text (String style, String text) const; + virtual String unknown_str () const = 0; Atom vbrace (Real &dy) const; virtual Atom vbracket (Real &dy) const = 0; Atom special_time_signature (String, Array) const; diff --git a/lily/include/main.hh b/lily/include/main.hh index 38399f71c5..072813b2f1 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -25,7 +25,6 @@ extern bool find_quarts_global_b; extern int exit_status_i_; extern bool experimental_features_global_b; extern Lookup* global_lookup_l; -extern Paper_def* global_paper_l; extern bool dependency_global_b; extern bool version_ignore_global_b; diff --git a/lily/include/molecule.hh b/lily/include/molecule.hh index f8edc37c25..7907be0ae4 100644 --- a/lily/include/molecule.hh +++ b/lily/include/molecule.hh @@ -19,7 +19,6 @@ struct Molecule { Pointer_list atoms_; // change to List? - /* *************** */ Molecule() { } Molecule (Atom const &a); diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index f5e04126f8..e7bda4c554 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -21,25 +21,26 @@ class Music_iterator { void push_translator (Translator_group*); void pop_translator(); protected: + Music const * music_l_; bool first_b_; virtual void do_print() const; virtual Translator_group* get_req_translator_l(); - Music_iterator* get_iterator_p (Music*) const; + Music_iterator* get_iterator_p (Music const*) const; void set_translator (Translator_group*); - Music_iterator *daddy_iter_l_; - + virtual void do_process_and_next (Moment until); + void inherit_info (Music_iterator const *parent); public: Translator_group*report_to_l() const; DECLARE_MY_RUNTIME_TYPEINFO; - static Music_iterator* static_get_iterator_p (Music*,Translator_group*); + static Music_iterator* static_get_iterator_p (Music const*,Translator_group*); Music_iterator(); - virtual void process_and_next (Moment until); virtual Moment next_moment() const; virtual bool ok() const; virtual ~Music_iterator(); + void process_and_next (Moment until); /** Construct sub-iterators, and set the translator to diff --git a/lily/include/music-list.hh b/lily/include/music-list.hh index 05822a649f..6cdda3dc5b 100644 --- a/lily/include/music-list.hh +++ b/lily/include/music-list.hh @@ -29,17 +29,17 @@ public: */ class Music_sequence : public Music { - public: int multi_level_i_; Music_list * music_p_list_p_; - + Music_sequence (Music_sequence const&); Music_sequence (Music_list *l_p); DECLARE_MY_RUNTIME_TYPEINFO; VIRTUAL_COPY_CONS(Music_sequence,Music); virtual void transpose (Musical_pitch ); + virtual void compress (Moment); void add_music (Music *music_p); protected: virtual void do_print() const; @@ -51,13 +51,12 @@ protected: class Simultaneous_music : public Music_sequence { public: - Simultaneous_music(Music_list *); DECLARE_MY_RUNTIME_TYPEINFO; VIRTUAL_COPY_CONS(Simultaneous_music,Music); + Simultaneous_music(Music_list *); virtual Musical_pitch to_relative_octave (Musical_pitch); - virtual void translate (Moment dt); - virtual MInterval time_int() const; + virtual Moment duration () const; }; /** @@ -67,24 +66,22 @@ public: class Request_chord : public Simultaneous_music { public: + VIRTUAL_COPY_CONS(Request_chord, Music); DECLARE_MY_RUNTIME_TYPEINFO; virtual Musical_pitch to_relative_octave (Musical_pitch); Request_chord(); - VIRTUAL_COPY_CONS(Request_chord, Music); }; /** Sequential_music is a list of music-elements which are placed behind each other. */ class Sequential_music : public Music_sequence { - public: - Moment offset_mom_; - virtual Musical_pitch to_relative_octave (Musical_pitch); - Sequential_music(Music_list*); DECLARE_MY_RUNTIME_TYPEINFO; VIRTUAL_COPY_CONS(Sequential_music, Music); - virtual void translate (Moment dt); - virtual MInterval time_int() const; + + virtual Musical_pitch to_relative_octave (Musical_pitch); + Sequential_music(Music_list*); + virtual Moment duration () const; }; #endif // Music_sequence_HH diff --git a/lily/include/music-output-def.hh b/lily/include/music-output-def.hh index aaa93383af..5940cc4177 100644 --- a/lily/include/music-output-def.hh +++ b/lily/include/music-output-def.hh @@ -38,9 +38,6 @@ public: DECLARE_MY_RUNTIME_TYPEINFO; virtual void print () const; - virtual Paper_def* paper_l (); - virtual Paper_score* paper_score_p () const; - Global_translator *get_global_translator_p (); Translator_group *get_group_translator_p (String type) const; String get_default_output () const; diff --git a/lily/include/music-output.hh b/lily/include/music-output.hh index 04a16e5d8d..cf17d6a641 100644 --- a/lily/include/music-output.hh +++ b/lily/include/music-output.hh @@ -19,7 +19,7 @@ class Music_output { public: - Header * header_l_; + Scope * header_l_; String default_out_str_; String origin_str_; int errorlevel_i_; diff --git a/lily/include/music-wrapper-iterator.hh b/lily/include/music-wrapper-iterator.hh index 4437d461ed..114704e152 100644 --- a/lily/include/music-wrapper-iterator.hh +++ b/lily/include/music-wrapper-iterator.hh @@ -16,13 +16,13 @@ class Music_wrapper_iterator : public Music_iterator { Music_iterator *child_iter_p_; - Music_wrapper *music_l_; + Music_wrapper *music_wrapper_l(); public: - Music_wrapper_iterator (Music_wrapper*); + Music_wrapper_iterator (); ~Music_wrapper_iterator (); virtual void do_print () const; virtual void construct_children () ; - virtual void process_and_next (Moment) ; + virtual void do_process_and_next (Moment) ; virtual Moment next_moment () const; virtual bool ok () const; DECLARE_MY_RUNTIME_TYPEINFO; diff --git a/lily/include/music-wrapper.hh b/lily/include/music-wrapper.hh index cdecc0b5ba..7c60c91dda 100644 --- a/lily/include/music-wrapper.hh +++ b/lily/include/music-wrapper.hh @@ -23,11 +23,12 @@ public: DECLARE_MY_RUNTIME_TYPEINFO; VIRTUAL_COPY_CONS (Music_wrapper, Music); Music_wrapper (Music_wrapper const&); - virtual MInterval time_int () const; + virtual Moment duration () const; virtual ~Music_wrapper (); }; + #endif /* MUSIC_WRAPPER_HH */ diff --git a/lily/include/music.hh b/lily/include/music.hh index 9a7b6f2d97..b05bc0db19 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -42,11 +42,12 @@ public: String translator_id_str_; virtual Musical_pitch to_relative_octave (Musical_pitch); - virtual MInterval time_int() const; + virtual Moment duration () const; + virtual ~Music(){} void print() const; virtual void transpose (Musical_pitch ); - virtual void translate (Moment dt); + virtual void compress (Moment); VIRTUAL_COPY_CONS(Music,Music); DECLARE_MY_RUNTIME_TYPEINFO; Music(); diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index d7bce858fa..70e6467542 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -36,7 +36,8 @@ public: DEFAULTACCESSOR(Skip_req) DEFAULTACCESSOR(Dynamic_req) DEFAULTACCESSOR(Absolute_dynamic_req ) - DEFAULTACCESSOR(Tie_req ) + DEFAULTACCESSOR(Tie_req) + DEFAULTACCESSOR(Musical_span_req) DEFAULTACCESSOR(Plet_req) DEFAULTACCESSOR(Span_dynamic_req ) DEFAULTACCESSOR(Abbreviation_req) @@ -47,15 +48,14 @@ public: /** a request with a duration. - This request is used only a base class. + This request is used only used as a base class. */ class Rhythmic_req : public virtual Musical_req { public: Duration duration_; - /* *************** */ - void set_duration (Duration); bool do_equal_b (Request*) const; + void compress (Moment); virtual Moment duration() const; Rhythmic_req(); static int compare (Rhythmic_req const&,Rhythmic_req const&); @@ -71,7 +71,6 @@ struct Spacing_req :virtual Request { Moment next; Real distance; Real strength; - /* *************** */ Spacing_req(); REQUESTMETHODS(Spacing_req); }; @@ -95,7 +94,6 @@ public: /// the characteristics of the text Text_def *tdef_p_; - /* *************** */ Text_req (int d, Text_def*); ~Text_req(); Text_req (Text_req const&); @@ -155,27 +153,16 @@ public: }; -/** - Requests to start or stop something. - This type of request typically results in the creation of a #Spanner# -*/ -class Span_req : public virtual Musical_req { +class Musical_span_req : public Span_req, public virtual Musical_req +{ public: - /// should the spanner start or stop, or is it unwanted? - enum Spantype { - NOSPAN, START, STOP - } spantype; - bool do_equal_b (Request*) const; - REQUESTMETHODS(Span_req); - - Span_req(); + REQUESTMETHODS(Musical_span_req); }; /** Start / stop a beam at this note */ -class Beam_req : public Span_req { +class Beam_req : public Musical_span_req { public: - /* *************** */ REQUESTMETHODS(Beam_req); Beam_req(); @@ -184,7 +171,7 @@ public: /** Start / stop an abbreviation beam at this note. */ -class Abbreviation_beam_req : public Span_req { +class Abbreviation_beam_req : public Musical_span_req { public: REQUESTMETHODS (Abbreviation_beam_req); @@ -202,14 +189,14 @@ public: }; /// a slur -class Slur_req : public Span_req { +class Slur_req : public Musical_span_req { public: REQUESTMETHODS(Slur_req); }; /// a plet (bracket with) number -class Plet_req : public Span_req { +class Plet_req : public Musical_span_req { public: int plet_i_; @@ -247,7 +234,7 @@ public: REQUESTMETHODS(Absolute_dynamic_req); }; -class Span_dynamic_req : public Dynamic_req, public Span_req { +class Span_dynamic_req : public Dynamic_req, public Musical_span_req { public: virtual bool do_equal_b (Request*) const; /// Grow or shrink the volume: 1=cresc, -1 = decresc diff --git a/lily/include/my-lily-lexer.hh b/lily/include/my-lily-lexer.hh index 5b5d17c008..3030a09eb4 100644 --- a/lily/include/my-lily-lexer.hh +++ b/lily/include/my-lily-lexer.hh @@ -43,7 +43,6 @@ public: Keyword_table * keytable_p_; int errorlevel_i_; - /* *************** */ void start_main_input (); void set_notename_table(Notename_table*tab_p); diff --git a/lily/include/my-lily-parser.hh b/lily/include/my-lily-parser.hh index e68324ddcd..8024bb552e 100644 --- a/lily/include/my-lily-parser.hh +++ b/lily/include/my-lily-parser.hh @@ -40,7 +40,7 @@ public: int default_abbrev_i_; Duration default_duration_; Plet plet_; - Header *default_header_p_; + Scope *default_header_p_; bool first_b_; diff --git a/lily/include/p-col.hh b/lily/include/p-col.hh index 674139c149..a6061778a9 100644 --- a/lily/include/p-col.hh +++ b/lily/include/p-col.hh @@ -55,7 +55,6 @@ public: bool error_mark_b_; bool used_b_ ; // manual override.. - /* *************** */ /// which one (left =0) int rank_i() const; diff --git a/lily/include/p-score.hh b/lily/include/p-score.hh index 3bf58582b5..6b627f9377 100644 --- a/lily/include/p-score.hh +++ b/lily/include/p-score.hh @@ -39,12 +39,7 @@ public: Line_of_score * line_l_; Paper_score (); - - virtual ~Paper_score(); - String base_output_str () const; - virtual Paper_outputter* paper_outputter_p (Paper_stream*) const = 0; - virtual Paper_stream* paper_stream_p () const = 0; /// add to bottom of pcols void add_column (Paper_column*); @@ -67,6 +62,8 @@ public: /// add a Spanner void typeset_unbroken_spanner (Spanner*); + + virtual ~Paper_score(); protected: diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index b42c400af4..87bfe54573 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -40,10 +40,12 @@ class Paper_def : public Music_output_def static int default_count_i_; bool ps_b_; +protected: + VIRTUAL_COPY_CONS(Paper_def,Music_output_def); + public: virtual ~Paper_def (); DECLARE_MY_RUNTIME_TYPEINFO; - VIRTUAL_COPY_CONS (Paper_def,Music_output_def); Array shape_int_a_; @@ -82,12 +84,6 @@ public: Lookup const * lookup_l (int sz) const; // TODO naming - virtual Paper_def* paper_l (); - virtual String dimension_str (Real r) const; - virtual Lookup* lookup_p (Lookup const&) const; - virtual Lookup* lookup_p (Symtables const&) const; - virtual String unknown_str () const; - /** convert a duration to an idealspacing influence using the geometric_ and paratime_signatures. */ @@ -96,10 +92,12 @@ public: Real arithmetic_constant (Moment minimal_mom) const; Real arithmetic_spacing (Moment mom,Real constant) const; virtual int get_next_default_count () const; - virtual String output_settings_str () const; + //urg + String tex_output_settings_str () const; + String ps_output_settings_str () const; // urg friend int yyparse (void*); }; -#endif // PAPER_DEF_HH +#endif // Paper_def_HH diff --git a/lily/include/property-iterator.hh b/lily/include/property-iterator.hh index ac0703dc29..ea429a36a4 100644 --- a/lily/include/property-iterator.hh +++ b/lily/include/property-iterator.hh @@ -14,13 +14,12 @@ class Property_iterator : public Music_iterator { - Translation_property *property_l_; + Translation_property *property_l() const; public: DECLARE_MY_RUNTIME_TYPEINFO; - Property_iterator (Translation_property* prop_l); protected: - virtual void process_and_next (Moment); + virtual void do_process_and_next (Moment); }; #endif // PROPERTY_ITERATOR_HH diff --git a/lily/include/ps-def.hh b/lily/include/ps-def.hh deleted file mode 100644 index 676d335e37..0000000000 --- a/lily/include/ps-def.hh +++ /dev/null @@ -1,28 +0,0 @@ -/* - ps-def.hh -- declare Ps_def - - source file of the GNU LilyPond music typesetter - - (c) 1998 Jan Nieuwenhuizen -*/ - -#ifndef PS_DEF_HH -#define PS_DEF_HH - -#include "paper-def.hh" - -class Ps_def : public Paper_def -{ -public: - VIRTUAL_COPY_CONS (Ps_def, Paper_def); - DECLARE_MY_RUNTIME_TYPEINFO; - - virtual Lookup* lookup_p (Lookup const&) const; - virtual Lookup* lookup_p (Symtables const&) const; - - virtual String output_settings_str () const; - virtual Paper_score* paper_score_p () const; - virtual String unknown_str () const; -}; - -#endif // PS_DEF_HH diff --git a/lily/include/ps-lookup.hh b/lily/include/ps-lookup.hh index 2ffb9af3b6..2eb9ed025a 100644 --- a/lily/include/ps-lookup.hh +++ b/lily/include/ps-lookup.hh @@ -24,11 +24,16 @@ public: virtual String character_str (int i) const; virtual Atom dashed_slur (Array controls, Real thick, Real dash) const; virtual Atom hairpin (Real width, bool decresc, bool continued) const; + virtual Lookup* lookup_p (Lookup const&) const; + virtual Lookup* lookup_p (Symtables const&) const; + virtual Paper_outputter* paper_outputter_p (Paper_stream*, Paper_def*, Scope*, String) const; + virtual Paper_stream* paper_stream_p () const; virtual Atom plet (Real dy , Real dx, Direction dir) const; virtual Atom ps_beam (Real slope, Real width, Real thick) const; virtual Atom slur (Array controls) const; virtual Atom stem (Real y1, Real y2) const; virtual Atom text (String style, String text) const; + virtual String unknown_str () const; virtual Atom vbracket (Real &y) const; }; diff --git a/lily/include/ps-score.hh b/lily/include/ps-score.hh deleted file mode 100644 index d83a503d86..0000000000 --- a/lily/include/ps-score.hh +++ /dev/null @@ -1,21 +0,0 @@ -/* - ps-score.hh -- declare Ps_score - - source file of the GNU LilyPond music typesetter - - (c) 1998 Jan Nieuwenhuizen -*/ - -#ifndef PS_SCORE_HH -#define PS_SCORE_HH - -#include "p-score.hh" - -class Ps_score : public Paper_score -{ -public: - virtual Paper_outputter* paper_outputter_p (Paper_stream*) const; - virtual Paper_stream* paper_stream_p () const; -}; - -#endif // PS_SCORE_HH diff --git a/lily/include/request-iterator.hh b/lily/include/request-iterator.hh index 15640ccd74..6d5cd95baf 100644 --- a/lily/include/request-iterator.hh +++ b/lily/include/request-iterator.hh @@ -12,16 +12,23 @@ #include "music-iterator.hh" +/** + Walk through a Request_chord + */ class Request_chord_iterator : public Music_iterator { - const Request_chord * elt_l_; + Request_chord * elt_l () const; + /** + cache elt_l ()->duration (). + */ Moment elt_duration_; bool last_b_; + public: - Request_chord_iterator (Request_chord*); + Request_chord_iterator (); DECLARE_MY_RUNTIME_TYPEINFO; protected: - virtual void process_and_next (Moment); + virtual void do_process_and_next (Moment); virtual Moment next_moment() const; virtual void construct_children(); virtual bool ok() const; diff --git a/lily/include/request.hh b/lily/include/request.hh index eab7b2d8b0..c45d5905e1 100644 --- a/lily/include/request.hh +++ b/lily/include/request.hh @@ -29,16 +29,11 @@ class Request : public Music { public: - /* *************** */ - virtual ~Request(){} DECLARE_MY_RUNTIME_TYPEINFO; VIRTUAL_COPY_CONS(Request,Music); - virtual MInterval time_int() const; - virtual Moment duration() const { return 0; } - /* accessors for children maybe checkout RTTI */ @@ -82,5 +77,22 @@ public: Script_req (Script_req const&); }; - + +/** + Requests to start or stop something. + This type of request typically results in the creation of a #Spanner# +*/ +class Span_req : public virtual Request { +public: + /// should the spanner start or stop, or is it unwanted? + enum Spantype { + NOSPAN, START, STOP + } spantype; + bool do_equal_b (Request*) const; + REQUESTMETHODS(Span_req); + + Span_req(); +}; + + #endif diff --git a/lily/include/score-column.hh b/lily/include/score-column.hh index 6f0d7a6cdf..dfe944c5a5 100644 --- a/lily/include/score-column.hh +++ b/lily/include/score-column.hh @@ -40,7 +40,6 @@ public: /// length of notes/rests in this column Array durations; - /* *************** */ Moment when() { return when_; } Score_column (Moment when); diff --git a/lily/include/score-element-info.hh b/lily/include/score-element-info.hh index 3e31b87057..95d69a0d48 100644 --- a/lily/include/score-element-info.hh +++ b/lily/include/score-element-info.hh @@ -22,7 +22,6 @@ struct Score_element_info { Request*req_l_; Array origin_grav_l_arr_; - /* *** */ Score_element_info (Score_element*, Request*); Score_element_info(); }; diff --git a/lily/include/score.hh b/lily/include/score.hh index 7817d7f891..e86b629a28 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -24,7 +24,7 @@ public: /// paper_, staffs_ and commands_ form the problem definition. Link_array def_p_arr_; Music * music_p_; - Header * header_p_; + Scope * header_p_; int errorlevel_i_; diff --git a/lily/include/stem.hh b/lily/include/stem.hh index 6bef757c91..a54b211849 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -78,7 +78,6 @@ public: /// direction of the beam Direction beam_dir_; - /* *************** */ Stem (); /// ensure that this Stem also encompasses the Notehead #n# diff --git a/lily/include/tex-def.hh b/lily/include/tex-def.hh deleted file mode 100644 index 92f8783b9a..0000000000 --- a/lily/include/tex-def.hh +++ /dev/null @@ -1,29 +0,0 @@ -/* - tex-def.hh -- declare Tex_def - - source file of the GNU LilyPond music typesetter - - (c) 1998 Jan Nieuwenhuizen -*/ - -#ifndef TEX_DEF_HH -#define TEX_DEF_HH - -#include "paper-def.hh" - -class Tex_def : public Paper_def -{ -public: - VIRTUAL_COPY_CONS (Tex_def, Paper_def); - DECLARE_MY_RUNTIME_TYPEINFO; - - virtual String dimension_str (Real r) const; - virtual Lookup* lookup_p (Lookup const&) const; - virtual Lookup* lookup_p (Symtables const&) const; - - virtual String output_settings_str () const; - virtual Paper_score* paper_score_p () const; - virtual String unknown_str () const; -}; - -#endif // TEX_DEF_HH diff --git a/lily/include/tex-lookup.hh b/lily/include/tex-lookup.hh index 6b17bfa872..cdb9839fcc 100644 --- a/lily/include/tex-lookup.hh +++ b/lily/include/tex-lookup.hh @@ -26,11 +26,17 @@ public: virtual Atom* atom_p (String, int, Box) const; Atom embed (Atom a) const; virtual Atom hairpin (Real width, bool decresc, bool continued) const; + virtual Lookup* lookup_p (Lookup const&) const; + virtual Lookup* lookup_p (Symtables const&) const; + virtual Paper_outputter* paper_outputter_p (Paper_stream*, Paper_def*, Scope*, String) const; + virtual Paper_stream* paper_stream_p () const; virtual Atom plet (Real dy , Real dx, Direction dir) const; + virtual String print_dimen (Real) const; virtual Atom ps_beam (Real slope, Real width, Real thick) const; virtual Atom slur (Array controls) const; virtual Atom stem (Real y1, Real y2) const; virtual Atom text (String style, String text) const; + virtual String unknown_str () const; virtual Atom vbracket (Real &y) const; }; diff --git a/lily/include/tex-score.hh b/lily/include/tex-score.hh deleted file mode 100644 index 0bfa12b0d6..0000000000 --- a/lily/include/tex-score.hh +++ /dev/null @@ -1,21 +0,0 @@ -/* - tex-score.hh -- declare Tex_score - - source file of the GNU LilyPond music typesetter - - (c) 1998 Jan Nieuwenhuizen -*/ - -#ifndef TEX_SCORE_HH -#define TEX_SCORE_HH - -#include "p-score.hh" - -class Tex_score : public Paper_score -{ -public: - virtual Paper_outputter* paper_outputter_p (Paper_stream*) const; - virtual Paper_stream* paper_stream_p () const; -}; - -#endif // TEX_SCORE_HH diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh index 8c6ba84f69..b0ffa91f33 100644 --- a/lily/include/text-item.hh +++ b/lily/include/text-item.hh @@ -21,7 +21,6 @@ public: /// do I have width? bool fat_b_; - /* ***************/ Text_item (General_script_def* ,Direction dir=CENTER); virtual ~Text_item (); diff --git a/lily/include/time-description.hh b/lily/include/time-description.hh index f92b48ba79..5ac4e0330e 100644 --- a/lily/include/time-description.hh +++ b/lily/include/time-description.hh @@ -33,7 +33,6 @@ struct Time_description { /// idem int bars_i_; - /* *************** */ void set_cadenza (bool); Moment when_mom () const { return when_; } void OK() const; diff --git a/lily/include/voice-iterator.hh b/lily/include/voice-iterator.hh index d029496f41..97e905254f 100644 --- a/lily/include/voice-iterator.hh +++ b/lily/include/voice-iterator.hh @@ -14,23 +14,24 @@ #include "music-iterator.hh" #include "pcursor.hh" -class Sequential_music_iterator : private PCursor, public Music_iterator +class Sequential_music_iterator : public Music_iterator { Moment here_mom_; - const Sequential_music * sequential_music_C_; + PCursor *cursor_p_; Music_iterator * iter_p_; void start_next_element(); void leave_element(); void set_Sequential_music_translator(); - +protected: + Sequential_music * sequential_music_l() const; public: - Sequential_music_iterator (Sequential_music const*); + Sequential_music_iterator (); DECLARE_MY_RUNTIME_TYPEINFO; protected: virtual void do_print() const; virtual void construct_children(); ~Sequential_music_iterator(); - virtual void process_and_next (Moment); + virtual void do_process_and_next (Moment); virtual Moment next_moment() const; virtual bool ok() const; }; diff --git a/lily/line-spacer.cc b/lily/line-spacer.cc index b39be2aeda..ffd65ff34e 100644 --- a/lily/line-spacer.cc +++ b/lily/line-spacer.cc @@ -3,24 +3,22 @@ source file of the GNU LilyPond music typesetter - (c) 1997--1998 Han-Wen Nienhuys + (c) 1997--1998 Han-Wen Nienhuys */ #include "line-spacer.hh" -Line_spacer::Line_spacer () +Line_spacer::Line_spacer() { - paper_l_ = 0; + paper_l_ =0; } - -Line_spacer::~Line_spacer () -{ -} - Paper_def* -Line_spacer::paper_l () const +Line_spacer::paper_l() const { - return paper_l_; + return paper_l_ ; } +Line_spacer::~Line_spacer () +{ +} diff --git a/lily/lookup.cc b/lily/lookup.cc index 7f09106f3b..8ba88483f5 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -109,6 +109,21 @@ Lookup::bar (String str, Real h) const return s; } +String +Lookup::base_output_str () const +{ + assert (paper_l_); + String str = paper_l_->get_default_output (); + + if (str.empty_b ()) + { + str = default_outname_base_global; + int def = paper_l_->get_next_default_count (); + if (def) + str += "-" + to_str (def); + } + return str; +} Atom Lookup::beam (Real slope, Real width, Real thick) const @@ -175,7 +190,13 @@ Lookup::print () const String Lookup::print_dimen (Real r) const { - return paper_l_->dimension_str (r); + String s = to_str (r, "%.3f"); + if (s.index_i ("NaN") != -1) + { + warning (_ ("NaN")); + s = "0.0"; + } + return s; } Atom diff --git a/lily/main.cc b/lily/main.cc index 24278fb577..33df5a1c83 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -21,8 +21,6 @@ #include "config.hh" #include "file-results.hh" #include "debug.hh" -#include "ps-def.hh" -#include "tex-def.hh" #include "ps-lookup.hh" #include "tex-lookup.hh" @@ -43,10 +41,6 @@ Ps_lookup ps_lookup; Tex_lookup tex_lookup; Lookup* global_lookup_l = &tex_lookup; -Ps_def ps_def; -Tex_def tex_def; -Paper_def* global_paper_l = &tex_def; - bool experimental_features_global_b = false; bool dependency_global_b = false; @@ -247,7 +241,6 @@ main (int argc, char **argv) case 't': experimental_features_global_b = true; global_lookup_l = &ps_lookup; - global_paper_l = &ps_def; break; case 'o': outname_str = oparser.optional_argument_ch_C_; diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index 81622368a4..b19215f512 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -16,9 +16,11 @@ #include "translation-property.hh" #include "change-iterator.hh" #include "change-translator.hh" - #include "music-wrapper.hh" #include "music-wrapper-iterator.hh" +#include "compressed-music-iterator.hh" +#include "compressed-music.hh" + IMPLEMENT_IS_TYPE_B(Music_iterator); @@ -111,12 +113,18 @@ Music_iterator::next_moment() const return 0; } + void -Music_iterator::process_and_next (Moment) +Music_iterator::process_and_next (Moment m) { - first_b_ = false; + do_process_and_next (m); } +void +Music_iterator::do_process_and_next (Moment) +{ + first_b_ = false; +} bool Music_iterator::ok() const @@ -125,49 +133,55 @@ Music_iterator::ok() const } Music_iterator* -Music_iterator::static_get_iterator_p (Music *m, - Translator_group*report_l) +Music_iterator::static_get_iterator_p (Music const *m, Translator_group *report_l) { Music_iterator * p =0; if (m->is_type_b (Request_chord::static_name())) - p = new Request_chord_iterator ((Request_chord*) m); + p = new Request_chord_iterator; else if (m->is_type_b (Simultaneous_music::static_name())) - p = new Simultaneous_music_iterator ((Simultaneous_music*) m); + p = new Simultaneous_music_iterator; else if (m->is_type_b (Sequential_music::static_name())) - p = new Sequential_music_iterator ((Sequential_music*) m); + p = new Sequential_music_iterator; else if (m->is_type_b (Translation_property::static_name ())) - p = new Property_iterator((Translation_property *) m); + p = new Property_iterator; else if (m->is_type_b (Change_translator::static_name ())) - p = new Change_iterator((Change_translator*) m); + p = new Change_iterator; + else if (m->is_type_b (Compressed_music::static_name ())) + p = new Compressed_music_iterator; else if (m->is_type_b (Music_wrapper::static_name ())) - p = new Music_wrapper_iterator ((Music_wrapper *)m); - - - if (m -> translator_type_str_.length_i ()) + p = new Music_wrapper_iterator; + + p->music_l_ = m; + if (m->translator_type_str_.length_i ()) { Translator_group* a =report_l-> - find_create_translator_l (m-> translator_type_str_, m->translator_id_str_); + find_create_translator_l (m->translator_type_str_, m->translator_id_str_); p->set_translator (a); } if (! p->report_to_l()) p ->set_translator (report_l); + return p; } +void +Music_iterator::inherit_info(Music_iterator const *parent) +{ +} + Music_iterator* -Music_iterator::get_iterator_p (Music*m) const +Music_iterator::get_iterator_p (Music const*m) const { - Music_iterator*p = static_get_iterator_p (m,report_to_l()); - p->daddy_iter_l_ = (Music_iterator*)this; + Music_iterator*p = static_get_iterator_p (m, report_to_l()); + p->inherit_info (this); p->construct_children(); return p; } Music_iterator::Music_iterator() { - daddy_iter_l_ =0; first_b_ = true; } diff --git a/lily/music-list.cc b/lily/music-list.cc index b9b72ded25..8f29446699 100644 --- a/lily/music-list.cc +++ b/lily/music-list.cc @@ -17,21 +17,21 @@ IMPLEMENT_IS_TYPE_B1(Sequential_music,Music_sequence); IMPLEMENT_IS_TYPE_B1(Simultaneous_music,Music_sequence); -MInterval -Simultaneous_music::time_int() const +Moment +Simultaneous_music::duration () const { - MInterval m; + Moment dur = 0; for (iter (music_p_list_p_->top(), i); i.ok (); i++) - m.unite (i->time_int()); + dur = dur >? i->duration (); - return m; + return dur; } void -Simultaneous_music::translate (Moment m) +Music_sequence::compress (Moment m) { - for (iter (music_p_list_p_->top(), i); i.ok (); i++) - i->translate (m); + for (PCursor i(music_p_list_p_->top()); i.ok (); i++) + i->compress (m); } Simultaneous_music::Simultaneous_music(Music_list *p) @@ -43,24 +43,17 @@ Simultaneous_music::Simultaneous_music(Music_list *p) Sequential_music::Sequential_music(Music_list *p) : Music_sequence (p) { - offset_mom_ =0; } -MInterval -Sequential_music::time_int() const +Moment +Sequential_music::duration () const { Moment last=0; for (iter (music_p_list_p_->top(), i); i.ok (); i++) { - MInterval interval = i->time_int(); - - /* - c4 <> c4 - */ - if (!interval.empty_b()) - last += interval.length(); + last += i->duration (); } - return offset_mom_ + MInterval (0,last); + return last; } Musical_pitch @@ -75,14 +68,6 @@ Simultaneous_music::to_relative_octave (Musical_pitch p) return music_p_list_p_->do_relative_octave (p, true); } -void -Sequential_music::translate (Moment dt) -{ - offset_mom_ += dt; -} - - - Musical_pitch Music_list::do_relative_octave (Musical_pitch last, bool ret_first) diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index 7af3146eda..86a20a731e 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -82,18 +82,6 @@ Music_output_def::get_global_translator_p () return g; } -Paper_def* -Music_output_def::paper_l () -{ - return 0; -} - -Paper_score* -Music_output_def::paper_score_p () const -{ - return 0; -} - void Music_output_def::print () const { diff --git a/lily/music-wrapper-iterator.cc b/lily/music-wrapper-iterator.cc index 13b2a90c31..4e0ca78ff7 100644 --- a/lily/music-wrapper-iterator.cc +++ b/lily/music-wrapper-iterator.cc @@ -1,5 +1,5 @@ /* - music-wrapper-iterator.cc -- implement + music-wrapper-iterator.cc -- implement Music_wrapper_iterator source file of the GNU LilyPond music typesetter @@ -11,10 +11,9 @@ #include "music-wrapper-iterator.hh" #include "music-wrapper.hh" -Music_wrapper_iterator::Music_wrapper_iterator (Music_wrapper *r) +Music_wrapper_iterator::Music_wrapper_iterator () { child_iter_p_ =0; - music_l_ = r; } IMPLEMENT_IS_TYPE_B1(Music_wrapper_iterator, Music_iterator); @@ -28,7 +27,7 @@ Music_wrapper_iterator::do_print () const void Music_wrapper_iterator::construct_children () { - child_iter_p_ = get_iterator_p (music_l_->element_p_); + child_iter_p_ = get_iterator_p (music_wrapper_l ()->element_p_); } Music_wrapper_iterator::~Music_wrapper_iterator () @@ -36,7 +35,11 @@ Music_wrapper_iterator::~Music_wrapper_iterator () delete child_iter_p_; } - +Music_wrapper* +Music_wrapper_iterator::music_wrapper_l () +{ + return (Music_wrapper*) music_l_; +} bool Music_wrapper_iterator::ok () const { @@ -44,10 +47,10 @@ Music_wrapper_iterator::ok () const } void -Music_wrapper_iterator::process_and_next (Moment m) +Music_wrapper_iterator::do_process_and_next (Moment m) { child_iter_p_->process_and_next (m); - Music_iterator::process_and_next (m); + Music_iterator::do_process_and_next (m); } Moment diff --git a/lily/music-wrapper.cc b/lily/music-wrapper.cc index b6f6618e79..1785b386d4 100644 --- a/lily/music-wrapper.cc +++ b/lily/music-wrapper.cc @@ -44,8 +44,8 @@ Music_wrapper::Music_wrapper(Music*p) IMPLEMENT_IS_TYPE_B1 (Music_wrapper, Music); -MInterval -Music_wrapper::time_int () const +Moment +Music_wrapper::duration () const { - return element_p_->time_int (); + return element_p_->duration (); } diff --git a/lily/music.cc b/lily/music.cc index 10ee1a3b3f..2127783d7b 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -12,10 +12,10 @@ #include "debug.hh" #include "musical-pitch.hh" -MInterval -Music::time_int() const +Moment +Music::duration () const { - return MInterval (0,0); + return 0; } void @@ -38,11 +38,6 @@ Music::transpose (Musical_pitch ) } -void -Music::translate (Moment) -{ -} - void Music::do_print() const { @@ -64,4 +59,7 @@ Music::to_relative_octave (Musical_pitch m) return m; } - +void +Music::compress (Moment) +{ +} diff --git a/lily/musical-request.cc b/lily/musical-request.cc index b1d5120fe8..3ee6004add 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -22,12 +22,17 @@ void Tie_req::do_print () const{} -/* *************** */ +IMPLEMENT_IS_TYPE_B1(Span_req,Request); +IMPLEMENT_IS_TYPE_B2(Musical_span_req, Span_req, Musical_span_req); - -IMPLEMENT_IS_TYPE_B1 (Span_req,Musical_req); +void +Musical_span_req::do_print () const +{ + Span_req::do_print (); +} + void Span_req::do_print () const @@ -77,7 +82,6 @@ Blank_req::do_print () const { Spacing_req::do_print (); } -/* *************** */ Melodic_req::Melodic_req () { @@ -116,7 +120,6 @@ Melodic_req::do_print () const pitch_.print (); } -/* *************** */ int Rhythmic_req::compare (Rhythmic_req const &r1, Rhythmic_req const &r2) { @@ -131,11 +134,6 @@ Rhythmic_req::do_equal_b (Request*r) const return !compare (*this, *rh); } -void -Rhythmic_req::set_duration (Duration d) -{ - duration_ = d; -} Rhythmic_req::Rhythmic_req () { @@ -158,7 +156,13 @@ Rhythmic_req::duration () const { return duration_.length (); } -/* *************** */ + +void +Rhythmic_req::compress (Moment m) +{ + duration_.compress (m); +} + @@ -170,7 +174,6 @@ Lyric_req::do_print () const Rhythmic_req::do_print (); } -/* *************** */ bool Note_req::do_equal_b (Request*r) const @@ -198,7 +201,6 @@ Note_req::do_print () const Rhythmic_req::do_print (); #endif } -/* *************** */ IMPLEMENT_IS_TYPE_B1 (Rest_req, Rhythmic_req); @@ -208,7 +210,6 @@ Rest_req::do_print () const Rhythmic_req::do_print (); } -/* *************** */ @@ -221,7 +222,6 @@ Multi_measure_rest_req::do_print () const } -/* *************** */ IMPLEMENT_IS_TYPE_B1 (Beam_req,Span_req); @@ -234,7 +234,6 @@ Beam_req::do_print () const { } -/* *************** */ IMPLEMENT_IS_TYPE_B1 (Abbreviation_beam_req, Span_req); @@ -266,7 +265,6 @@ Plet_req::do_print () const { } -/* *************** */ bool Span_req:: do_equal_b (Request*r) const @@ -280,7 +278,6 @@ Span_req::Span_req () spantype = NOSPAN; } -/* *************** */ Script_req::Script_req (Script_req const&s) { dir_ = s.dir_; @@ -332,7 +329,6 @@ Script_req::~Script_req () { delete scriptdef_p_; } -/* *************** */ Text_req::~Text_req () @@ -365,7 +361,6 @@ Text_req::do_print () const #endif } -/* *************** */ IMPLEMENT_IS_TYPE_B1 (Skip_req,Musical_req); diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index ee308432d9..82948a3067 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -35,12 +35,13 @@ static Keyword_ent the_key_tab[]={ {"grouping", GROUPING}, {"header", HEADER}, {"in", IN_T}, - {"lyric", LYRIC}, + {"lyrics", LYRICS}, {"key", KEY}, {"keysignature", KEYSIGNATURE}, {"mark", MARK}, {"musicalpitch", MUSICAL_PITCH}, {"time", TIME_T}, + {"times", TIMES}, {"midi", MIDI}, {"mm", MM_T}, {"name", NAME}, diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index de8ae42c14..9f7e8c7fb3 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -14,7 +14,7 @@ #include "musical-request.hh" #include "command-request.hh" #include "parser.hh" -#include "header.hh" +#include "scope.hh" #include "file-results.hh" #include "midi-def.hh" #include "paper-def.hh" @@ -171,7 +171,7 @@ My_lily_parser::get_note_element (Note_req *rq, Duration * duration_p) assert (!duration_p->plet_b ()); duration_p->set_plet (1, 2); } - rq->set_duration (*duration_p); + rq->duration_ = *duration_p; rq->set_spot (here_input ()); delete duration_p ; return v; @@ -265,7 +265,7 @@ My_lily_parser::get_parens_request (int t) for (int i = 0; i < reqs.size (); i++) if (reqs[i]->access_Musical_req ()->access_Span_dynamic_req ()) { - Span_dynamic_req* s_l= (reqs[i]->access_Musical_req ()->access_Span_dynamic_req ()) ; + Span_dynamic_req* s_l= reqs[i]->access_Musical_req ()->access_Span_dynamic_req (); s_l->dynamic_dir_ = (t == '<') ? UP:DOWN; } @@ -314,7 +314,7 @@ Paper_def* My_lily_parser::default_paper_p () { Identifier *id = lexer_p_->lookup_identifier ("$defaultpaper"); - return id ? id->access_Paper_def () : (Paper_def*)global_paper_l->clone (); + return id ? id->access_Paper_def () : new Paper_def ; } Midi_def* diff --git a/lily/p-score.cc b/lily/p-score.cc index 901cfa48d2..2dbc75925b 100644 --- a/lily/p-score.cc +++ b/lily/p-score.cc @@ -17,7 +17,7 @@ #include "p-col.hh" #include "p-score.hh" #include "p-col.hh" -#include "header.hh" +#include "scope.hh" #include "word-wrap.hh" #include "gourlay-breaking.hh" #include "paper-stream.hh" @@ -58,22 +58,6 @@ Paper_score::~Paper_score () #endif } -String -Paper_score::base_output_str () const -{ - assert (paper_l_); - String str = paper_l_->get_default_output (); - - if (str.empty_b ()) - { - str = default_outname_base_global; - int def = paper_l_->get_next_default_count (); - if (def) - str += "-" + to_str (def); - } - return str; -} - void Paper_score::typeset_element (Score_element * elem_p) { @@ -210,6 +194,8 @@ Paper_score::calc_breaking () return sol; } + + void Paper_score::process () { @@ -224,8 +210,8 @@ Paper_score::process () Array breaking = calc_breaking (); - Paper_stream* pstream_p = paper_stream_p (); - outputter_l_ = paper_outputter_p (pstream_p); + Paper_stream* paper_stream_p = global_lookup_l->paper_stream_p (); + outputter_l_ = global_lookup_l->paper_outputter_p (paper_stream_p, paper_l_, header_l_, origin_str_); Link_array lines; for (int i=0; i < breaking.size (); i++) @@ -249,13 +235,14 @@ Paper_score::process () line_l->output_all (); *mlog << ']' << flush; remove_line (line_l); - } - + // huh? delete outputter_l_; - delete pstream_p; + delete paper_stream_p; outputter_l_ = 0; + + *mlog << '\n' << flush; } void diff --git a/lily/paper-def.cc b/lily/paper-def.cc index a0e81bb96c..d3d4a67954 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -23,28 +23,12 @@ #include "scope.hh" #include "assoc.hh" #include "assoc-iter.hh" -#include "dimensions.hh" - -IMPLEMENT_IS_TYPE_B1 (Paper_def, Music_output_def); - -int Paper_def::default_count_i_ = 0; Paper_def::Paper_def () { lookup_p_assoc_p_ = new Assoc; } -Paper_def::Paper_def (Paper_def const&s) - : Music_output_def (s) -{ - lookup_p_assoc_p_ = new Assoc; - for (Assoc_iter ai(*s.lookup_p_assoc_p_); ai.ok (); ai++) - { - Lookup * l = lookup_p (*ai.val ()); - l->paper_l_ = this; - set_lookup (ai.key(), l); - } -} Paper_def::~Paper_def () { @@ -56,43 +40,16 @@ Paper_def::~Paper_def () delete lookup_p_assoc_p_; } -/** - Get the measure wide constant for arithmetic. - - @see - John S. Gourlay. ``Spacing a Line of Music,'' Technical Report - OSU-CISRC-10/87-TR35, Department of Computer and Information Science, - The Ohio State University, 1987. - - */ -Real -Paper_def::arithmetic_constant (Moment d) const -{ - return get_var ("arithmetic_basicspace") - log_2 (Moment (1,8) ; + for (Assoc_iter ai(*s.lookup_p_assoc_p_); ai.ok (); ai++) + { + Lookup * l = global_lookup_l->lookup_p (*ai.val ()); + l->paper_l_ = this; + set_lookup (ai.key(), l); + } } Real @@ -125,6 +82,46 @@ Paper_def::line_dimensions_int (int n) const return shape_int_a_[n]; } +Real +Paper_def::beam_thickness_f () const +{ + return get_var ("beam_thickness"); +} + +Real +Paper_def::linewidth_f () const +{ + return get_var ("linewidth"); +} + +Real +Paper_def::duration_to_dist (Moment d,Real k) const +{ + return arithmetic_spacing (d,k); +} + + +/** + Get the measure wide constant for arithmetic. + + @see + John S. Gourlay. ``Spacing a Line of Music,'' Technical Report + OSU-CISRC-10/87-TR35, Department of Computer and Information Science, + The Ohio State University, 1987. + + */ +Real +Paper_def::arithmetic_constant (Moment d) const +{ + return get_var ("arithmetic_basicspace") - log_2 (Moment (1,8) elem_b (i)) + { + delete lookup_p_assoc_p_->elem (i); + } + l ->paper_l_ = this; + (*lookup_p_assoc_p_)[i] = l; +} + Real Paper_def::interline_f () const { @@ -139,17 +147,23 @@ Paper_def::interline_f () const } Real -Paper_def::linewidth_f () const +Paper_def::rule_thickness () const { - return get_var ("linewidth"); + return get_var ("rulethickness"); } Real -Paper_def::rule_thickness () const +Paper_def::staffline_f () const { return get_var ("rulethickness"); } +Real +Paper_def::staffheight_f () const +{ + return get_var ("staffheight"); +} + Real Paper_def::interbeam_f (int multiplicity_i) const { @@ -165,43 +179,12 @@ Paper_def::internote_f () const return get_var ("interline") /2.0 ; } -// urg, how c++ sucks -// virtual_copy_cons wants these... - -// aarg, its even worse, Paper_def gets constructed via Identifier, -// another input->output hardlink. -Lookup* -Paper_def::lookup_p (Lookup const& l) const -{ - // return 0; - return global_paper_l->lookup_p (l); -} - -Lookup* -Paper_def::lookup_p (Symtables const& s) const -{ - // return 0; - return global_paper_l->lookup_p (s); -} - -String -Paper_def::output_settings_str () const -{ - return ""; -} - Real Paper_def::note_width () const { return get_var ("notewidth"); } -Paper_def* -Paper_def::paper_l () -{ - return this; -} - void Paper_def::print () const { @@ -219,44 +202,43 @@ Paper_def::print () const #endif } -String -Paper_def::dimension_str (Real r) const -{ - return ::dimension_str (r); -} - Lookup const * Paper_def::lookup_l (int i) const { return (*lookup_p_assoc_p_)[i]; } -void -Paper_def::set_lookup (int i, Lookup*l) -{ - if (lookup_p_assoc_p_->elem_b (i)) - { - delete lookup_p_assoc_p_->elem (i); - } - l ->paper_l_ = this; - (*lookup_p_assoc_p_)[i] = l; -} +IMPLEMENT_IS_TYPE_B1 (Paper_def, Music_output_def); -Real -Paper_def::staffline_f () const +String +Paper_def::ps_output_settings_str () const { - return get_var ("rulethickness"); + String s ("\n "); + for (Assoc_iter i (*scope_p_); i.ok (); i++) + s += String ("/mudelapaper") + i.key () + + "{" + i.val ()->str () + "} bind def\n"; + s += *scope_p_->elem ("pssetting")->access_String (); + return s; } -Real -Paper_def::staffheight_f () const +String +Paper_def::tex_output_settings_str () const { - return get_var ("staffheight"); + String s ("\n "); + for (Assoc_iter i (*scope_p_); i.ok (); i++) + s += String ("\\def\\mudelapaper") + i.key () + + "{" + i.val ()->str () + "}\n"; + s += *scope_p_->elem ("texsetting")->access_String (); + return s; } -String -Paper_def::unknown_str () const +int Paper_def::default_count_i_ = 0; + +int +Paper_def::get_next_default_count () const { - return ""; + return default_count_i_ ++; } + + diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 17231564b8..1e8d450c7b 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -9,7 +9,6 @@ #include "paper-outputter.hh" #include "paper-stream.hh" -#include "paper-def.hh" #include "molecule.hh" #include "atom.hh" #include "array.hh" @@ -43,8 +42,8 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm, St Array a; String r; - a.push (global_paper_l->dimension_str (a_off.y())); - a.push (global_paper_l->dimension_str (a_off.x())); + a.push (global_lookup_l->print_dimen (a_off.y())); + a.push (global_lookup_l->print_dimen (a_off.x())); a.push (i->str_); r += global_lookup_l->substitute_args (s, a); *outstream_l_ << r; diff --git a/lily/parser.yy b/lily/parser.yy index f6e9764a17..428fff3c37 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -16,6 +16,8 @@ #include "script-def.hh" #include "symtable.hh" #include "lookup.hh" +#include "ps-lookup.hh" +#include "tex-lookup.hh" #include "misc.hh" #include "my-lily-lexer.hh" #include "paper-def.hh" @@ -34,7 +36,6 @@ #include "translator-group.hh" #include "score.hh" #include "music-list.hh" -#include "header.hh" #include "duration-convert.hh" #include "change-translator.hh" #include "file-results.hh" @@ -42,10 +43,11 @@ #include "scope.hh" #include "relative-music.hh" #include "transposed-music.hh" +#include "compressed-music.hh" // mmm -Mudela_version oldest_version ("1.0.6"); -Mudela_version version ("1.0.6"); +Mudela_version oldest_version ("1.0.7"); +Mudela_version version ("1.0.8"); // needed for bison.simple's malloc() and free() @@ -61,6 +63,24 @@ int guess_plet_a[GUESS_PLET] = 4 }; +struct Assignment { + String *name_p_; + Identifier *id_p_; + ~Assignment () { + delete name_p_; + delete id_p_; + } + Assignment () { + name_p_ = 0; + id_p_ =0; + } + Assignment (Assignment const&s) + { + name_p_ = new String (*s.name_p_); + id_p_ = s.id_p_->clone (); + } +}; + Paper_def* current_paper = 0; #ifndef NDEBUG @@ -93,7 +113,7 @@ Paper_def* current_paper = 0; Music *music; Music_list *music_list; Score *score; - Header *header; + Scope *scope; Interval *interval; Musical_req* musreq; Music_output_def * outputdef; @@ -154,7 +174,7 @@ yylex (YYSTYPE *s, void * v_l) %token IN_T %token KEY %token KEYSIGNATURE -%token LYRIC +%token LYRICS %token MAEBTELP %token MARK %token MEASURES @@ -185,6 +205,7 @@ yylex (YYSTYPE *s, void * v_l) %token TELP %token TEMPO %token TIME_T +%token TIMES %token TRANSLATOR %token TRANSPOSE %token TYPE @@ -218,17 +239,17 @@ yylex (YYSTYPE *s, void * v_l) %type output_def -%type
mudela_header mudela_header_body +%type mudela_header mudela_header_body %type box %type open_request_parens close_request_parens %type open_abbrev_parens %type open_plet_parens close_plet_parens %type sub_quotes sup_quotes -%type simple_element request_chord command_element +%type simple_element request_chord command_element Simple_music Composite_music %type abbrev_type %type int unsigned %type script_dir -%type identifier_init simple_identifier_init +%type identifier_init simple_identifier_init block_identifier %type steno_duration notemode_duration %type entered_notemode_duration explicit_duration %type dinterval @@ -246,16 +267,13 @@ yylex (YYSTYPE *s, void * v_l) %type property_def translator_change %type Music_list %type paper_block paper_def_body -%type dim real -%type real_mult_expression real_primary -%type unit +%type real_expression real dimension %type abbrev_command_req %type post_request structured_post_request %type plet_fraction %type command_req verbose_command_req %type script_req dynamic_req %type string -%type string_primary %type score_block score_body %type shape_array %type