diff options
174 files changed, 1448 insertions, 1239 deletions
diff --git a/ANNOUNCEMENT b/ANNOUNCEMENT-1.0 index 33190c9cf2..33190c9cf2 100644 --- a/ANNOUNCEMENT +++ b/ANNOUNCEMENT-1.0 diff --git a/Documentation/faq.yo b/Documentation/faq.yo index a7694846c9..b7278b5206 100644 --- a/Documentation/faq.yo +++ b/Documentation/faq.yo @@ -22,6 +22,14 @@ It does em(not) work with windows 3.x; you need Windows-NT (95/98?). This is not a recommendation, however. We recommend you use Unix, in particular, use GNU/Linux. For further information see file(README-W32). +question(Where is guile-config) + +RedHat RPMS don't include guile-config. You need guile-config as it +was produced during the RPM build run. Build the RPM from source +(file(.src.rpm)), and use the guile-config that is in +file(/usr/src/redhat/BUILD/guile-1.3/guile-config/). + + question(I get all kinds of errors while compiling file(parser.cc)) LilyPond uses features of bison version 1.25. Please confirm that diff --git a/Documentation/topdocs/index.yo b/Documentation/topdocs/index.yo index 228b6685f5..e80cc7d9ae 100644 --- a/Documentation/topdocs/index.yo +++ b/Documentation/topdocs/index.yo @@ -83,8 +83,8 @@ description( dit(lurl(http://sca.uwaterloo.ca/lilypond/)) Eric Praetzel was kind enough to provide a mirror of both the website and the ftp site. -dit(lurl(ftp://ftp.lilypond.org/pub/lilypond/)) - A mirror of the FTP site. Updated at 12:00 MET daily. +dit(lurl(ftp://ftp.lilypond.org/pub/LilyPond/)) + A mirror of the FTP site. Updated at 0:00 MET daily. ) nsect(NEWS) @@ -1,5 +1,47 @@ -pl 34.jcn1 - - templates for windows +pl 35 + +pl 34.hwn2 + - "Lily Was Here" is def'd as \mudelatagline, override with + \header { tagline = "... " ; } + - \property currentBarNumber: set + current bar number. + - \property postBreakPadding: tune extra + space padding after linebreaks. + - \property textEmptyDimension: disregard script text + dimensions (untested) + - \property staffLineLeading: set the staff space + - adjustable staff space size (per staff) + - Staff_symbol_referencer as base class for elements that use + info of the staff symbol. \property numberOfStaffLines also works OK + with ledger lines. (Is that useful? dunno.) + - warning if someone does \translator with no name + - junk Item::breakable_b_ + - junk PointerList<Music*>, use Killing_cons + - bf: Auto_beam_engraver. + - bf: mmrest engraver. + - use callbacks for Dimension_cache. + - lots of small cleanups. Junk various members of + Score_element & derived classes: + * Item::original_l_, + * Spanner::original_l_, + * Score_element::transparent_b_, + * Item::break_priority_i_, + * Item::break_status_dir_, + - merge Score_priority_engraver / Score_horizontal_align_engraver + - Use more generic element properties. + - precompute SCM symbols. + - remove_elt_property (): Try to junk an element property, if not + needed anymore. + + + +pl 34.uu1 + - more PointerList junkings. + - MIDI bugfix. + - be more conservative with Dicts/Hashes mem usage + +********* +pl 34 pl 33.uu2 - some performance cleanups: junked PointerList instance, plugged some leaks. @@ -9,11 +9,16 @@ Most of the items are marked in the code as well Grep for TODO and ugh/ugr/urg. .* BUGS +. * AFM for BlueSky AFM files. +. * staff size for post/prebreaks . * .ly files . * input/star-spangled-banner . * mutopia/J.S.Bach/wtk1-fugue2.ly . * input/test/grace . * fix: text on rests: ridiculous dims +. * \score { \notes { c8 c8 c8 c c c } +\paper { \translator { \VoiceContext \remove "Auto_beam_engraver";}} +} . * m=\notes\relative c'''{ \time 2/4; @@ -41,18 +46,15 @@ Grep for TODO and ugh/ugr/urg. } } } -. * - Look at input/test/span-bars.ly. The staff lines extend too far - to the left on the note systems including the GrandStaff. . * midi key. . *P.P.S. It can be cool in mudela-book to distinguish in pre,postMudelaExample, whether MudelaExample is epsed or not: ( if this fragment is floating eps, than 1, otherwise 2). say preMudelaExample[eps]{}, and change it in document body sometimes. . * tetex: mfplain.mem -. * fix midi output: -. * default duration? d - duration must be not entered explicitely on first note. . * fix singleStaffBracket +. * declare performers in \midi +. * fix MIDI . * \shape 1st dim skipped? . * turn slope-damping on/off . * tremolo stuff @@ -72,35 +74,9 @@ present, they're not properly distinguished) but no distinct way to specify the third. Should there be? .* TODO before 1.2 +. * break priority setting from SCM. . * Gade score . * remove [] in favour of auto-beamer -. * In the score, the staff lines extend too far to the left. - This is also illustrated in the second score of span-bars.ly - as I've pointed out earlier. -. *m=\notes\relative c''{ - \property Staff.instr = "Instr " - \key f; - f4 \p \< g a bes | - c d e \f \! f | - f e d c | - bes \mf a g f \pp - } - -n=\notes\relative c'{ - \property Staff.instr = "Instr " - \key f; - f4 \mp g a \< bes | - c d e \ff \! f | - f e d c | - bes \mp a g f \ppp - } - -\score{ - \type StaffGroup < - \type Staff = a <{\stemup \property Voice.dynamicDir = \down \m} - {\stemdown \property Voice.dynamicDir = \up \n}> - > -} . * The minimum distance between different staffs works only within StaffGroups, not between StaffGroups. The Gade Score looks quite strange on the pages where the Timpani and/or Brass sections don't @@ -109,18 +85,7 @@ n=\notes\relative c'{ \OrchestralScoreContext minVerticalAlign = 2.5*\staffheight; } - - I sent a copy of the score to the conductor and his reaction was - that it would be easy to fix some "spacing problems" with Finale, - if we could convert the score to Finale. I'm not sure what he - meant, since we just have had mail conversations so far. Maybe - it's the staff distances I mentioned above. - -. * For the trumpet and horn parts, I wrote two parts on the same - staff line in the score. I haven't managed to get different - directions of the dynamics for the two parts. - Voice.dynamicDir seems to set the direction for the full staff. -. * hangOnClef with non-breakable clefs. +. * hangOnClef with non-breakable clefs. . * Aha, the problem is the new TeX code generation for changing fonts. > (The explanation below is mostly intended for Han-Wen and Jan) > Before, the font was changed with macros declared separately for @@ -138,35 +103,27 @@ n=\notes\relative c'{ > argument that's clearly irrelevant in our application. Yet we > see the problem for August. . * Check gcc 2.8.1 compatibility -. * Document source code. -. * limit memory usage; the full coriolan takes up too much resources. -. * Sort items after breaking in order of linenumber. Then be more - eficient with finding -. * Do Mark & sweep GC for Score_elems -. * make "in-between" engraver (Tie, Extender) -. * textWidthFatness property +. * Abstraction for engravers: +. * make "in-between" engraver (Tie, Extender) +. * make wide_spanner_engraver (line_group_spanne,r staff_symbol) +. * remove Interval dim_ from Dimension_cache and rename the struct. +. * merge align_element and axis_element_group. +. * do scaled fonts generally . * The Lilypond accidental symbols are available through the TeX macros, \textflat, \textsharp and \textnatural defined in the init file lilyponddefs.tex. All the symbols are defined in the files fetaXX.tex where XX corresponds to the size. I don't know where (or even if) they are installed but they are generated in the mf/out/ directory during the compilation. -. * compulsory hshift -. * 1. Can Lily be told where to start numbering? -. * do scaled fonts. -. * profile atom smobs . * make dependencies () a virtual function. . * fix Repeated_music design . * one big ly2dvi input that includes *all* tests. -. * Don't use boolean properties (0,1), instead check existence -of property. . * store req -> element, element -> element causes for warnings . * junk Text_def, use G_text_item in stead. . * junk Script_def +. * include examples in RPM. . * fix partial measures in meaningful way. -. * fix AFM for BlueSky AFM files. . * working notehead style. -. * remove links to non-free SW. . * add scripts to bars eg. |^"bla" . * relative mode for mi2mu . * uniformise recent feta contributions. @@ -176,8 +133,7 @@ of property. . * --prefix option? . * -I option per filetype? . * kpathsea? -. * todo doc left/rightbeamcount -. * doc Single_malt_grouping_item + . * ly2dvi/lilypond logfile. . * How can I specify a chord whose duration is longer than a whole note? \type ChordNames { \chord{ A1*2-min } } @@ -191,48 +147,8 @@ length? -Use of semicolons is still rather confusing. They are obligatory -after some types of assignments and illegal after others. - - \property foo=bar illegal - foo = 3 at top level illegal - foo = 3 inside \paper obligatory - foo = \notes{ ...} top level illegal - foo = \translator{ } in \paper obligatory - -As far as I can tell, the sole accomplishment of this syntactic -irregularity is to keep the user as confused as possible. - - -I was trying to get interstaff beams to work and did this: - -\score{ -\type GrandStaff < -\type Staff=one \notes\relative c'{ - \stemup - [c8 c \translator Staff=two \stemup c c] - \translator Staff=one - \stemdown - [ b8 \translator Staff=two a8] - \translator Staff=one - c4 - } -\type Staff=two \notes{ \clef bass; s1 } -> -\paper{ - \translator{ - \GrandStaffContext - minVerticalAlign = 3.0*\staffheight; - maxVerticalAlign = 3.0*\staffheight; - } - linewidth = -1.; -} -} - -The beams are at the right angle, but they aren't in the right place. . * fractional chord durs. . * hang Item on Spanner -. * remove Interval dim_ from Dimension_cache and rename the struct. . * do --safe for PS output? . * convert-mudela --output . * Staff_margin (with a partial measure.) @@ -250,24 +166,16 @@ The beams are at the right angle, but they aren't in the right place. . * sharp /flat on trills (in MIDI ??) . * scm-ify \property values. . * move class Lookup {} into scm -. * collisions/voices \voiceone \voicetwo are broken; see . * msgfmt -o check? . * \breathmark TeX macro -. * catch GUILE errors? . * add new glyphs to font.ly . * formatting of input 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. . * space after bars? . * 'hinterfleisch' before bar (e.g. wtk1-fugue2)? -. * \type Voice \times 2/3 { [c8 c16 c16 c16 c16] } -. * repeat bars: need distance after ":|" and before "|:" . * Summary of minor spelling irregularities: . * capitalization/use of underscores in property names . * fix SkipBars -> skipBars - . * broken scripts: lbheel = \script { "bheel" 0 0 -1 0 0 } rbheel = \script { "bheel" 0 0 1 0 0 } @@ -281,9 +189,9 @@ The beams are at the right angle, but they aren't in the right place. portato= \script { "portato" 0 -1 0 1 0 } . * ly2dvi . * bottomnote for ly2dvi -. * cf'able ly2dvi tagline. . * deps for ly2dvi .* STUFF +. * compulsory hshift . * arrows on slurs. . * Align_element::padding ? . * uniformise property names... @@ -297,27 +205,15 @@ The beams are at the right angle, but they aren't in the right place. . * strip EXEs before installing . * zip target for binary windows dist (JBR) . * junking \skip req in lyrics -. * Language: -. * \type -> \context ? -. * \translator -> ? -. * fix \partial -. * \bla {} vs \bla ; -. * mix engraver hacking with music ? -. * \once\property KEY = VAL -. * \addtranslator, \removetranslator -. * junk ^ and _ for scripts -. * junk _ for lyrics. -. * abstract grammar. . * percussion note heads . * mi2mu empty staffs. . * horizontal centering of dynamics -. * gzip RH manpage -. * stable make/config stuff . * $DEPENDENCIES_OUTPUT support . * Xdvi zooming ?! Try to understand GS garbage collection. - gs: Error: /undefined in draw_beam - gs: Operand stack: +gs: Error: /undefined in draw_beam +gs: Operand stack: . * fix vertical alignment and stafflines +. * declaring Performers . * GrandStaff needs more work -- I want a single word `harpsichord' to the left of the grandstaff, not one on each stave. (Organ staff -- with separate pedal -- but common @@ -326,8 +222,6 @@ The beams are at the right angle, but they aren't in the right place. through, so the \property Voice.Instrument would be a stop, and \property GrandStaff.instrument would be PipeOrgan...) . * revise the Score_priority_align_engraver concept. It sucks. -. * make new VoiceOne, VoiceTwo, VoiceThree contexts with -ydirection and hshift preset . * *.yo: fix pod manpage layout legacy . * text-items clash with stems/beams . * --include, -I option for ly2dvi (pass on to lily) @@ -336,8 +230,7 @@ ydirection and hshift preset <{\voiceone cis4. cis8 cis4 | cis4 cis cis | r1 } {\voicetwo cis,4 r r | r2. | r1 }> | } -. * try to use template<Type> iso MACRO(Type) -. * Musical_pitch (analogous to Duration and Rhythmic_req) +. * Musical_pitch (analogous to Duration and Rhythmic_req) think about, analogous to pitch: * { a4 a16 } c <-- duration of c? * < a4 b8 > c <-- duration of c? @@ -348,7 +241,6 @@ ydirection and hshift preset . * split error/warning in error/warning/non_fatal_error . * add a Duration_convert member to Duration_iter to set parameters. Junk global duration settings. -. * minimum length second part broken tie . * en-,discouraged linebreaking: . * handle DISALLOW < penalty > FORCE . * discourage breaking of slurs @@ -357,7 +249,7 @@ ydirection and hshift preset . * <\voiceone c4. \voicetwo c4> . * add full cello suites to web site (kom op, Maarten!) . * Rethink Time_description - * \cadenza , \meter, \grouping should all be \properties +\cadenza , \meter, \grouping should all be \properties . * rename . * measure -> bar . * abbrev -> tremolo @@ -369,27 +261,52 @@ ydirection and hshift preset . * move paper vars into engraver properties . * check for groff / troff/ nroff et . * more intelligent file searching -. * make LilyPond RPM fully relocatable . * disable spaces in TeX stuff . * handle ^C for tmp/file creation. +. * make LilyPond RPM fully relocatable . * dots & rest collisions. . * documentation +. * remove links to non-free SW. +. * internal documentation +. * a general paper. +. * \properties +. * left/rightbeamcount +. * various other new properties. . * introduction? . * info? . * LaTeX? . * more manpages? -. * versioning for Feta . * the warning about the negative slur/tie length appears twice - which is irritating. -. * The `3' in the meter key is a one or two pixels too thin (at 600dpi) - in the middle: -. * the bracket is ugly (wings are too parabolic, should be more circular) +which is irritating. . * better hshift (dots, distance, head dependent) . * clefs (AG): The "8" should appear closer to the actual clef, touching it. . * put errorlevel in Input class . * junk nesting slurs . * integrate midi-elts from mi2mu and lily? + +.* FONT +. * the bracket is ugly (wings are too parabolic, should be more circular) +. * versioning for Feta +. * The `3' in the meter key is a one or two pixels too thin (at 600dpi) + in the middle: +. * design macro for penstroke with rounded endings +. * timesig C: fat yet less curved. Check out relations. +. * design decent macro for bulbed endings +. * printer dependencies. +. * y-refpoint for rests should be the 4th staffline (gclef: b') +. * clean-up eight+ rests +. * versioning +. * lo-res fixes. +. * work out sizes of character fonts. +. * more symbols +. * piano pedals: Ped/* +. * maxima notehead +. * coda signs: Segno, O+ +. * glissando, arpeggio +. * lengthened trill +. * 128th flags +. * include important spacing dims in fetalog .* 3RD PARTY BUGS . * GNU diff 2.7: diff -rN does not see a new directory with empty file . * check out GCC signatures? @@ -426,7 +343,6 @@ touching it. . * fontlock: \melodic \melodic . * use properties for: -. * Staff_sym size . * default tempo. . * cadenza mode? @@ -481,6 +397,72 @@ touching it. . * slurs . * accents . * dynamics + +> Would it be hard to add support for proper dynamics in MIDI output? I +> would really like to have this feature... + +To answer this, I have to give a little background. Please say so if +I am being obtuse. + +Both audio and notation elements are created decentrally, when +LilyPond says "Interpreting music ... [8][16] etc." After all +elements are created, they are processed again to calculate all +parameters. After that is done, they are dumped onto the output (the +MIDI stream or the TeX file). + +The audio and notation elements are created by objects called +performer and engraver respectively. They work by taking a chunk of +input (a so-called request), and using the request to create an audio +or notation element. + +After some processing, the engraver sends the created elements to +its enclosing notation/performance context. + +In the case of notation, engravers can also modify existing elements +created by sibling engravers. Eg. the beam-engraver will modify stems +when it creates a beam over a couple of stems. This is done in +Engraver::do_acknowledge_element () and +Engraver::do_process_acknowledged (). + +In the case of audio, there are no mechanisms to modify existing audio +elements. After the audio elements are created, they are sent directly +to the enclosing context (an instance of Performer_group_performer), +through the method Performer::play () + +Concretely spoken, for dynamics you have to write a performer +(Dynamics_performer), that will take the input requests. If I +understand correctly, every MIDI note played must have its dynamic +strength set separately. That means the the Dynamics_performer must +set the strength of every Audio_note it finds. This means that one +has to modify existing Audio items. The best way of doing this is +with a broadcast/acknowledge process. + +So the best way of handling this, is + +* supporting dynamic settings in Audio_note + +* mimicking the broadcast/acknowledge mechanism of the Engravers in + the Performers + +* using that mechanism to write a Dynamics_performer that will modify + any notes it finds to set appropriate strengths. + +You could also kludge this by deriving from Performer_group_performer +a performer that also sets dynamics within notes, but that is not the +elegant way to do it. + +I'd say that the work involved is not hard, but you have to be fluent +with C++ and need some insight into the working of Notation Contexts +and friends. I guess I could do it in a day or so, but if you are not +so fluent with the inner workings of LilyPond, it could take you some +more time (A few more days?). + +Please note, that I am *not* going to code this myself: my days are +valuable, and I think I have more interesting things to do than fixing +the MIDI output (I don't even have a soundcard). But I *do* want to help +you or other people with implementing this, so if you need help, don't +hesitate to ask. + . * account for rhythmic position in measure . * etc. @@ -552,7 +534,18 @@ touching it. . * specify number of lines .* INPUTLANGUAGE - +. * Language: +. * \type -> \context ? +. * \translator -> ? +. * fix \partial +. * \bla {} vs \bla ; +. * mix engraver hacking with music ? +. * \once\property KEY = VAL +. * \addtranslator, \removetranslator +. * junk ^ and _ for scripts +. * junk _ for lyrics. +. * abstract grammar. +. * Figure out semicolons. . * c4 4 4 4 for c4 c4 c4 c4? . * <c f a>4 ? . * Viola mode? @@ -608,8 +601,6 @@ touching it. . * Text_crescendo -. * clean solution for staffsize in items. - . * revise calcideal .* IDEAS @@ -625,19 +616,6 @@ touching it. .* SMOBS Han-Wen Nienhuys <hanwen@cs.uu.nl> writes: -> mcmanus@IDT.NET writes: -> > > I want different C++ objects (with scheme embedded) to be linked by -> > > C++ pointers. I want to access these other objects from the Scheme -> > > code, and I want access to these pointers from C++. -> > -> > You can do this with a combination of smob's and primitive functions, -> > though it may not be be exactly what you wanted. You would have one -> > smob for each class in your application, and then you would write a -> > primitive function that would return the objects that are linked to a -> > base object. -> -> And the smob and the C++ class are interlinked? Like -> > class Foo_class { > Foo_smob *smob_ptr_; > } @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=1 -PATCH_LEVEL=34 -MY_PATCH_LEVEL=jcn1 +PATCH_LEVEL=35 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/flower/hash.cc b/flower/hash.cc index c2fd954a8f..c33e7ed53d 100644 --- a/flower/hash.cc +++ b/flower/hash.cc @@ -1,3 +1,11 @@ +/* + hash.cc -- implement various functions for hash tables. + + source file of the Flower Library + + (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl> + + */ #include "string.hh" #include "array.hh" #include "dictionary.hh" @@ -6,6 +14,7 @@ // Note: assumes long is at least 32 bits. const unsigned long my_prime_list[] = { + 5, 11, 23, // be a bit careful for short lists: we want reasonable mem usage. 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157, 98317, 196613, 393241, 786433, @@ -14,12 +23,14 @@ const unsigned long my_prime_list[] = 1610612741u, 3221225473u, 4294967291u }; -unsigned long prime_list (int idx) +unsigned long +prime_list (int idx) { return my_prime_list [idx]; } -unsigned int string_hash (String s) +unsigned int +string_hash (String s) { const char* str = s.ch_C (); unsigned int result = 0; @@ -32,14 +43,15 @@ unsigned int string_hash (String s) } -unsigned int hash (unsigned int i) +unsigned int +hash (unsigned int i) { return i; } -unsigned int int_hash (int i) +unsigned int +int_hash (int i) { return (unsigned) i; } -unsigned int hash ( ); diff --git a/flower/include/unionfind.hh b/flower/include/unionfind.hh index 4f98d8801d..9f360be400 100644 --- a/flower/include/unionfind.hh +++ b/flower/include/unionfind.hh @@ -2,7 +2,7 @@ #define UNIONFIND_HH #include "array.hh" -/* +/** which points of a graph are connected?. Union find, a standard algorithm: @@ -19,7 +19,9 @@ struct Union_find { Union_find (int sz); private: - Array<int> classes; - + /** + This array provides the representing point for each node in the graph. + */ + Array<int> classes_; }; #endif diff --git a/flower/unionfind.cc b/flower/unionfind.cc index 1bbf1f409c..cb5afce6e4 100644 --- a/flower/unionfind.cc +++ b/flower/unionfind.cc @@ -5,11 +5,11 @@ Union_find::Union_find (int n) { - classes.set_size (n); + classes_.set_size (n); for (int i=0; i < n; i++) { - classes[i] = i; + classes_[i] = i; } } @@ -17,13 +17,13 @@ int Union_find::find (int i) { int rep = i; - while (classes[rep] != rep) - rep = classes[rep]; - while (classes[i] != rep) + while (classes_[rep] != rep) + rep = classes_[rep]; + while (classes_[i] != rep) { - int next =classes[i]; - classes[i] = rep; - i = next; + int next =classes_[i]; + classes_[i] = rep; + i = next; } return rep; } @@ -33,5 +33,5 @@ Union_find::connect (int i, int j) { i = find (i); j = find (j); - classes[i] = j; + classes_[i] = j; } diff --git a/input/test/bar-number.ly b/input/test/bar-number.ly new file mode 100644 index 0000000000..aa8dd849eb --- /dev/null +++ b/input/test/bar-number.ly @@ -0,0 +1,8 @@ + \score { \notes { + + c1 c1 c1 c1\break + c1 c1 c1 c1\break + \property Score.currentBarNumber = "25" + c1 c1 c1 c1 +} + \paper{ \translator {\BarNumberingStaffContext }}} diff --git a/input/test/number-staff-lines.fly b/input/test/number-staff-lines.fly new file mode 100644 index 0000000000..50e188e55b --- /dev/null +++ b/input/test/number-staff-lines.fly @@ -0,0 +1,2 @@ + +c c c \property Staff . numberOfStaffLines = 3 diff --git a/input/test/staff-size.fly b/input/test/staff-size.fly new file mode 100644 index 0000000000..a9f063dc26 --- /dev/null +++ b/input/test/staff-size.fly @@ -0,0 +1,10 @@ +< \type Staff = VA { + \property Staff.staffLineLeading = "4" \property Staff.fontsize = "-2" + \property Voice . dynamicDir = \up \stemdown +\key gis; + c8 d [e f g a] b c \ff + } + +\type Staff = VB { \property Voice . dynamicDir = \down c,,4 \ff} + +> diff --git a/lib/template.cc b/lib/template.cc index 6d91b48095..3f6b91c9d0 100644 --- a/lib/template.cc +++ b/lib/template.cc @@ -13,11 +13,8 @@ #include "cursor.tcc" #include "list.tcc" -#if defined NEED_EXPLICIT_INSTANTIATION || __CYGWIN__ -// huh? -//LIST_INSTANTIATE (void *); -template class List<void*>; -template class Cursor<void*>; +#ifdef NEED_EXPLICIT_INSTANTIATION +LIST_INSTANTIATE (void *); #endif POINTERLIST_INSTANTIATE (Source_file); diff --git a/lily/abbrev.cc b/lily/abbrev.cc index d476552f27..b2ff4b8e75 100644 --- a/lily/abbrev.cc +++ b/lily/abbrev.cc @@ -30,13 +30,15 @@ Abbreviation::do_print () const Molecule* Abbreviation::do_brew_molecule_p () const { - Real interbeam_f = paper ()->interbeam_f (stem_l_->mult_i_); + Real interbeam_f = paper_l ()->interbeam_f (stem_l_->mult_i_); Real w = 1.5 * lookup_l ()->ball (2).dim_.x ().length (); - Real internote_f = paper ()->internote_f (); - Real beam_f = paper ()->beam_thickness_f (); + Real space = stem_l_->staff_line_leading_f (); + Real internote_f = space/2; + + Real beam_f = paper_l ()->beam_thickness_f (); int beams_i = 0; - Real slope_f = internote_f / 4 / internote_f; + Real slope_f = internote_f / 4 / internote_f; // HUH? if (stem_l_ && stem_l_->beam_l_) { slope_f = stem_l_->beam_l_->slope_f_; @@ -66,7 +68,6 @@ Abbreviation::do_brew_molecule_p () const stem_l_->beam_l_->dir_ * beams_i * interbeam_f)); } else -#if 1 { /* Beams should intersect one beamthickness below staff end @@ -76,45 +77,14 @@ Abbreviation::do_brew_molecule_p () const dy += stem_l_->stem_end_f (); dy *= internote_f; // urg: can't: stem should be stetched first -// dy -= paper ()->beam_thickness_f () * stem_l_->dir_; +// dy -= paper_l ()->beam_thickness_f () * stem_l_->dir_; beams->translate (Offset(stem_l_->hpos_f () - hpos_f (), dy)); } -#else - { - /* - urg: this is wrong, even if coded correctly - - Try to be in the middle of the open part of the stem and - between on the staff. - - (urgh) - */ - Direction sd = stem_l_->dir_; - // watch out: chord_start_f is (the only one) not in dim(internote) - Interval empty_stem (stem_l_->chord_start_f () / internote_f * sd - + interline_f, (stem_l_->stem_end_f ()* sd)); - empty_stem *= sd; - - Interval instaff = empty_stem; - /* - huh? i don't understand, hw - what about: - .fly= \stemup d'''2:16 - instaff.intersect (Interval (-4,4)); - */ - // hmm, let's try - if (stem_l_->get_default_dir () == stem_l_->dir_) - instaff.intersect (Interval (-4,4)); - if (instaff.empty_b ()) - instaff = empty_stem; - - instaff.print (); - instaff *= internote_f; - beams->translate (Offset(stem_l_->hpos_f () - hpos_f (), - instaff.center ())); - } -#endif + /* + there used to be half a page of code that was long commented out. + Removed in 1.1.35 + */ } return beams; diff --git a/lily/abbreviation-beam.cc b/lily/abbreviation-beam.cc index df5e16be99..3bf92b841b 100644 --- a/lily/abbreviation-beam.cc +++ b/lily/abbreviation-beam.cc @@ -32,30 +32,7 @@ Abbreviation_beam::Abbreviation_beam () Molecule* Abbreviation_beam::do_brew_molecule_p () const { - /* - todo - */ return Beam::do_brew_molecule_p (); -#if 0 - Molecule *mol_p = new Molecule; - // huh? inter-what - // Real inter_f = paper ()->interbeam_f (); - Real inter_f = paper ()->internote_f (); - Real x0 = stems[0]->hpos_f (); - for (int j=0; j <stems.size (); j++) - { - Stem *i = stems[j]; - Stem * prev = (j > 0)? stems[j-1] : 0; - Stem * next = (j < stems.size ()-1) ? stems[j+1] :0; - - Molecule sb = stem_beams (i, next, prev); - Real x = i->hpos_f ()-x0; - sb.translate (Offset (x, (x * slope_f + left_y)* inter_f)); - mol_p->add (sb); - } - mol_p->translate_axis (x0 - spanned_drul_[LEFT]->absolute_coordinate (X_AXIS), X_AXIS); - return mol_p; -#endif } void diff --git a/lily/align-element.cc b/lily/align-element.cc index c10392cda4..b637ebd5d0 100644 --- a/lily/align-element.cc +++ b/lily/align-element.cc @@ -9,7 +9,7 @@ #include "align-element.hh" #include "interval.hh" #include "direction.hh" - +#include "debug.hh" struct Align_element_content { Score_element * elem_l_; @@ -17,14 +17,14 @@ struct Align_element_content { static int compare (Align_element_content const &h1, Align_element_content const &h2) - { - return h1.priority_i_ - h2.priority_i_; - } + { + return h1.priority_i_ - h2.priority_i_; + } Align_element_content (Score_element *elem_l, int p) - { - priority_i_ = p; - elem_l_ = elem_l; - } + { + priority_i_ = p; + elem_l_ = elem_l; + } Align_element_content () { elem_l_ = 0; priority_i_ = 0; @@ -51,7 +51,7 @@ Align_element::add_element_priority (Score_element *el, int p) void Align_element::do_substitute_element_pointer (Score_element*o, - Score_element*n) + Score_element*n) { int i; while ((i = elem_l_arr_.find_i (o))>=0) @@ -66,14 +66,6 @@ Align_element::do_substitute_element_pointer (Score_element*o, } } -/** - Align elements top to bottom. - The first element has its top at y = 0.0 afterwards - - TODO configurable, like Horizontal_align_item - - TODO should parametrise in direction and coordinate. - */ void Align_element::do_post_processing() { @@ -124,8 +116,6 @@ Align_element::do_side_processing () center_f = where_f; where_f += stacking_dir_ * dy; - - elem_l_arr_[i]->translate_axis (where_f, axis_); } @@ -140,7 +130,7 @@ Align_element::do_side_processing () Align_element::Align_element() { threshold_interval_ = Interval (0, Interval::infinity ()); - transparent_b_ = true; + set_elt_property (transparent_scm_sym, SCM_BOOL_T); set_empty (true); stacking_dir_ = DOWN; align_dir_ = LEFT; @@ -155,9 +145,6 @@ Align_element::contains_b (Score_element const *e) const return elem_l_arr_.find_l (e); } - - - void Align_element::sort_elements () { @@ -179,9 +166,20 @@ Align_element::sort_elements () void Align_element::do_print () const { -#if 0 +#ifndef NPRINT DOUT << "contains: "; - for (int i=0 ; i < item_l_arr_.size(); i++) - DOUT << classname (item_l_arr_[i]) << ", "; + for (int i=0 ; i < elem_l_arr_.size(); i++) + DOUT << classname (elem_l_arr_[i]) << ", "; #endif } + +Score_element* +Align_element::get_elt_by_priority (int p) const +{ + for (int i=0; i < priority_i_arr_.size (); i++) + { + if (priority_i_arr_[i] == p) + return elem_l_arr_[i]; + } + return 0; +} diff --git a/lily/audio-column.cc b/lily/audio-column.cc index 85f88c84f9..7a90fa2562 100644 --- a/lily/audio-column.cc +++ b/lily/audio-column.cc @@ -21,7 +21,7 @@ Audio_column::Audio_column (Moment at_mom) void Audio_column::add_audio_item (Audio_item* l) { - audio_item_l_list_.bottom().add (l); + audio_item_l_arr_.push (l); l->audio_column_l_ = this; } @@ -37,8 +37,8 @@ Audio_column::print() const #ifndef NPRINT DOUT << "Audio_column {"; DOUT << "at: " << at_mom_ << ". Contains:"; - for (PCursor<Audio_item*> i (audio_item_l_list_.top ()); i.ok (); i++) - DOUT << classname (i.ptr ()) << ", "; + for (int i =0; i < audio_item_l_arr_.size (); i++) + DOUT << classname (audio_item_l_arr_[i]) << ", "; DOUT << "\n}\n"; #endif } diff --git a/lily/audio-staff.cc b/lily/audio-staff.cc index ae2afceaf4..a8d7682ce9 100644 --- a/lily/audio-staff.cc +++ b/lily/audio-staff.cc @@ -15,9 +15,10 @@ void Audio_staff::add_audio_item (Audio_item* l) { - audio_item_l_list_.bottom().add (l); + audio_item_l_arr_.push (l); } + void Audio_staff::output (Midi_stream& midi_stream_r, int track_i) { diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 8055b73a52..1fd4be9440 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -326,7 +326,9 @@ Auto_beam_engraver::acknowledge_element (Score_element_info info) consider_end_and_begin (); } grouping_p_->add_child (start, rhythmic_req->length_mom ()); - stem_l->flag_i_ = rhythmic_req->duration_.durlog_i_; + + //stem_l->flag_i_ = rhythmic_req->duration_.durlog_i_; + stem_l_arr_p_->push (stem_l); Moment now = now_mom (); last_add_mom_ = now; @@ -339,8 +341,9 @@ void Auto_beam_engraver::junk_beam () { assert (stem_l_arr_p_); - for (int i = 0; i < stem_l_arr_p_->size (); i++) - (*stem_l_arr_p_)[i]->flag_i_ = 0; + /* for (int i = 0; i < stem_l_arr_p_->size (); i++) + (*stem_l_arr_p_)[i]->flag_i_ = 0;*/ + delete stem_l_arr_p_; stem_l_arr_p_ = 0; delete grouping_p_; diff --git a/lily/axis-group-element.cc b/lily/axis-group-element.cc index 5b42c70e8a..0bce567aca 100644 --- a/lily/axis-group-element.cc +++ b/lily/axis-group-element.cc @@ -56,13 +56,13 @@ Axis_group_element::do_print() const Axis_group_element::Axis_group_element(Axis a1, Axis a2) : Graphical_axis_group (a1,a2) { - transparent_b_ = true; + set_elt_property (transparent_scm_sym, SCM_BOOL_T); } Axis_group_element::Axis_group_element () : Graphical_axis_group (X_AXIS, Y_AXIS) { - transparent_b_ = true; + set_elt_property (transparent_scm_sym, SCM_BOOL_T); } diff --git a/lily/axis-group-item.cc b/lily/axis-group-item.cc index 1559e5dda3..65570d0623 100644 --- a/lily/axis-group-item.cc +++ b/lily/axis-group-item.cc @@ -38,9 +38,10 @@ Axis_group_item::do_breakable_col_processing() Direction j=LEFT; do { - Item *new_l = - it_l->find_prebroken_piece (broken_to_drul_[j]->break_status_dir_); - (dynamic_cast<Axis_group_item*> (broken_to_drul_[j]))->add_element (new_l); + Axis_group_item * my_brok + = dynamic_cast<Axis_group_item*> (find_prebroken_piece(j)); + Item *new_l = it_l->find_prebroken_piece (j); + my_brok->add_element (new_l); } while (flip(&j)!=LEFT); } diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc index b78887ef6c..c78cac0e11 100644 --- a/lily/axis-group-spanner.cc +++ b/lily/axis-group-spanner.cc @@ -26,7 +26,7 @@ Axis_group_spanner::do_break_processing_if_unbroken() { Item * item_l = dynamic_cast<Item*> (elems[i]); if (item_l - && item_l->breakable_b_ + && item_l->breakable_b () && item_l->break_status_dir() == 0) { // last two checks are paranoia @@ -83,25 +83,25 @@ Axis_group_spanner::do_break_processing() my_broken_l->add_element (broken_span_l); } } - else if (it && it->breakable_b_ && it->break_status_dir () == 0) + else if (it && it->broken_original_b ()) { // broken items Direction j=LEFT; do { - Item * my_item = it->broken_to_drul_[j]; - Line_of_score * item_line_l = my_item->line_l() ; + Item * broken_item = it->find_prebroken_piece (j); + Line_of_score * item_line_l = broken_item->line_l() ; if (! item_line_l) continue; Axis_group_spanner * v = dynamic_cast<Axis_group_spanner*>(find_broken_piece (item_line_l)); if (v) - v->add_element (my_item); + v->add_element (broken_item); else { - my_item->transparent_b_ = true; - my_item->set_empty (true); + broken_item->set_elt_property (transparent_scm_sym, SCM_BOOL_T); + broken_item->set_empty (true); } } diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index e7bdb019ac..71655de8e1 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -8,7 +8,7 @@ */ #include "bar-engraver.hh" -#include "bar.hh" +#include "staff-bar.hh" #include "musical-request.hh" #include "multi-measure-rest.hh" #include "command-request.hh" @@ -53,14 +53,19 @@ Bar_engraver::create_bar () { if (!bar_p_) { - bar_p_ = new Bar; - bar_p_->break_priority_i_ = 0; + bar_p_ = new Staff_bar; + bar_p_->set_elt_property (break_priority_scm_sym, gh_int2scm (0)); + // urg: "" != empty... String default_type = get_property ("defaultBarType", 0); if (default_type.length_i ()) { bar_p_->type_str_ = default_type; } + + /* + urg. Why did I implement this? + */ Scalar prop = get_property ("barAtLineStart", 0); if (prop.to_bool ()) { diff --git a/lily/bar-script-engraver.cc b/lily/bar-script-engraver.cc index 7262b1fc08..bf462f3e9d 100644 --- a/lily/bar-script-engraver.cc +++ b/lily/bar-script-engraver.cc @@ -114,11 +114,11 @@ Bar_script_engraver::create_items (Request *rq) staff_side_p_ = new G_staff_side_item; staff_side_p_->axis_ = axis_; - staff_side_p_->breakable_b_ = true; // ugh + staff_side_p_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); // ugh text_p_ = new G_text_item; - text_p_->breakable_b_ = true; // ugh + text_p_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); // ugh Scalar prop = get_property (type_ + "Direction", 0); if (prop.isnum_b ()) @@ -139,9 +139,9 @@ Bar_script_engraver::create_items (Request *rq) } - staff_side_p_->set_elt_property (ly_symbol ("visibility_lambda"), + staff_side_p_->set_elt_property (visibility_lambda_scm_sym, visibility_lambda_); - text_p_->set_elt_property (ly_symbol ("visibility_lambda"), + text_p_->set_elt_property (visibility_lambda_scm_sym, visibility_lambda_); announce_element (Score_element_info (text_p_, rq)); diff --git a/lily/bar.cc b/lily/bar.cc index 60941be60a..7fb6d30530 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -16,7 +16,7 @@ Bar::Bar () { - breakable_b_ = true; + set_elt_property (breakable_scm_sym, SCM_BOOL_T); type_str_ = "|"; at_line_start_b_ = false; } @@ -29,18 +29,24 @@ Bar::do_print () const #endif } +Real +Bar::get_bar_size () const +{ + return paper_l ()->get_var ("barsize"); +} + + Molecule* Bar::do_brew_molecule_p () const { - Paper_def *p = paper (); - Molecule *output = new Molecule (lookup_l ()->bar (type_str_, p->get_var ("barsize"))); + Molecule *output = new Molecule (lookup_l ()->bar (type_str_, get_bar_size ())); return output; } /** Prescriptions for splitting bars. - TODO: parametrise this (input-settable) + TODO: put this in SCM. */ static char const *bar_breaks[][3] ={ {":|", ":|:", "|:"}, @@ -65,18 +71,11 @@ Bar::do_pre_processing () if (bar_breaks[i][1] == type_str_) { type_str_ = bar_breaks[i][break_status_dir ()+1]; - if (at_line_start_b_ && (break_status_dir_ == 1) && (type_str_ == "")) + if (at_line_start_b_ && (break_status_dir () == RIGHT) && (type_str_ == "")) { type_str_ = "|"; } } } - - /* - span_score_bar needs dims, so don't do - - transparent_b_ = empty_b_ = (!type_str_); - - */ } diff --git a/lily/base-span-bar-engraver.cc b/lily/base-span-bar-engraver.cc index 92fe5ee248..e0716f15f2 100644 --- a/lily/base-span-bar-engraver.cc +++ b/lily/base-span-bar-engraver.cc @@ -53,12 +53,13 @@ Base_span_bar_engraver::acknowledge_element (Score_element_info i) spanbar_p_ = get_span_bar_p(); String visnam = String(name()) + "_visibility"; - spanbar_p_->set_elt_property (ly_symbol ("visibility_lambda"), + spanbar_p_->set_elt_property (visibility_lambda_scm_sym, gh_eval_str (visnam.ch_C())); if (use_priority_b_) { - spanbar_p_->break_priority_i_ = break_priority_i_; + spanbar_p_->set_elt_property (break_priority_scm_sym, + gh_int2scm (break_priority_i_)); } else { diff --git a/lily/beam.cc b/lily/beam.cc index be8f73b1e1..752f23e10b 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -62,8 +62,6 @@ Molecule* Beam::do_brew_molecule_p () const { Molecule *mol_p = new Molecule; - Real internote_f = paper ()->internote_f (); - Real x0 = stems_[0]->hpos_f (); for (int j=0; j <stems_.size (); j++) { @@ -73,7 +71,8 @@ Beam::do_brew_molecule_p () const Molecule sb = stem_beams (i, next, prev); Real x = i->hpos_f ()-x0; - sb.translate (Offset (x, (x * slope_f_ + left_y_) * internote_f)); + sb.translate (Offset (x, (x * slope_f_ + left_y_) * + i->staff_line_leading_f ()/2 )); mol_p->add_molecule (sb); } mol_p->translate_axis (x0 @@ -81,7 +80,9 @@ Beam::do_brew_molecule_p () const // correct if last note (and therefore reference point of beam) // is on different staff - mol_p->translate_axis (- sinfo_.top ().interstaff_f_ * internote_f, Y_AXIS); + Stem_info si = sinfo_.top (); + mol_p->translate_axis (-si.interstaff_f_ * si.stem_l_->staff_line_leading_f ()/2, + Y_AXIS); return mol_p; } @@ -89,8 +90,11 @@ Beam::do_brew_molecule_p () const Offset Beam::center () const { - Real w= (paper ()->note_width () + extent (X_AXIS).length ())/2.0; - return Offset (w, (left_y_ + w* slope_f_)*paper ()->internote_f ()); + Stem_info si = sinfo_[0]; + + Real w= (si.stem_l_->note_delta_f () + extent (X_AXIS).length ())/2.0; + return Offset (w, (left_y_ + w* slope_f_) * + si.stem_l_->staff_line_leading_f ()/2); } void @@ -115,7 +119,7 @@ Beam::do_post_processing () if (stems_.size () < 2) { warning (_ ("beam with less than two stems")); - transparent_b_ = true; + set_elt_property (transparent_scm_sym, SCM_BOOL_T); return ; } calculate_slope (); @@ -171,7 +175,7 @@ Beam::set_default_dir () We have our doubts, so we simply provide all sensible alternatives. */ - Dir_algorithm a = (Dir_algorithm)rint(paper ()->get_var ("beam_dir_algorithm")); + Dir_algorithm a = (Dir_algorithm)rint(paper_l ()->get_var ("beam_dir_algorithm")); switch (a) { case MAJORITY: @@ -226,10 +230,10 @@ Beam::solve_slope () Real Beam::check_stemlengths_f (bool set_b) { - Real interbeam_f = paper ()->interbeam_f (multiple_i_); - Real internote_f = paper ()->internote_f (); - Real beam_f = paper ()->beam_thickness_f (); - Real staffline_f = paper ()->rule_thickness (); + Real interbeam_f = paper_l ()->interbeam_f (multiple_i_); + + Real beam_f = paper_l ()->beam_thickness_f (); + Real staffline_f = paper_l ()->rule_thickness (); Real epsilon_f = staffline_f / 8; Real dy_f = 0.0; for (int i=0; i < sinfo_.size (); i++) @@ -239,10 +243,11 @@ Beam::check_stemlengths_f (bool set_b) // correct for knee if (dir_ != sinfo_[i].dir_) { + Real internote_f = sinfo_[i].stem_l_->staff_line_leading_f ()/2; y -= dir_ * (beam_f / 2 + (sinfo_[i].mult_i_ - 1) * interbeam_f) / internote_f; - if (!i && sinfo_[i].stem_l_->staff_sym_l_ != - sinfo_.top ().stem_l_->staff_sym_l_) + if (!i && sinfo_[i].stem_l_->staff_symbol_l () != + sinfo_.top ().stem_l_->staff_symbol_l ()) y += dir_ * (multiple_i_ - (sinfo_[i].stem_l_->flag_i_ - 2) >? 0) * interbeam_f / internote_f; } @@ -267,6 +272,9 @@ Beam::check_stemlengths_f (bool set_b) void Beam::set_steminfo () { + if(!stems_.size ()) + return; + assert (multiple_i_); int total_count_i = 0; int forced_count_i = 0; @@ -282,9 +290,9 @@ Beam::set_steminfo () total_count_i++; } - Real internote_f = paper ()->internote_f (); - int stem_max = (int)rint(paper ()->get_var ("stem_max")); - Real shorten_f = paper ()->get_var (String ("forced_stem_shorten" + Real internote_f = stems_[0]->staff_line_leading_f ()/2; + int stem_max = (int)rint(paper_l ()->get_var ("stem_max")); + Real shorten_f = paper_l ()->get_var (String ("forced_stem_shorten" + to_str (multiple_i_ <? stem_max))) / internote_f; @@ -333,9 +341,10 @@ Beam::calculate_slope () Real dx_f = stems_.top ()->hpos_f () - stems_[0]->hpos_f (); // urg, these y internote-y-dimensions - Real internote_f = paper ()->internote_f (); - Real lengthened = paper ()->get_var ("beam_lengthened") / internote_f; - Real steep = paper ()->get_var ("beam_steep_slope") / internote_f; + Real internote_f = stems_[0]->staff_line_leading_f ()/2; + + Real lengthened = paper_l ()->get_var ("beam_lengthened") / internote_f; + Real steep = paper_l ()->get_var ("beam_steep_slope") / internote_f; if (((left_y_ - sinfo_[0].idealy_f_ > lengthened) && (slope_f_ > steep)) || ((left_y_ + slope_f_ * dx_f - sinfo_.top ().idealy_f_ > lengthened) @@ -377,10 +386,10 @@ Beam::quantise_dy () if (quantisation_ <= NONE) return; - Real interline_f = paper ()->interline_f (); + Real interline_f = stems_[0]->staff_line_leading_f (); Real internote_f = interline_f / 2; - Real staffline_f = paper ()->rule_thickness (); - Real beam_f = paper ()->beam_thickness_f (); + Real staffline_f = paper_l ()->rule_thickness (); + Real beam_f = paper_l ()->beam_thickness_f (); Real dx_f = stems_.top ()->hpos_f () - stems_[0]->hpos_f (); @@ -435,10 +444,10 @@ Beam::quantise_left_y (bool extend_b) hang straddle sit inter hang */ - Real interline_f = paper ()->interline_f (); - Real internote_f = paper ()->internote_f (); - Real staffline_f = paper ()->rule_thickness (); - Real beam_f = paper ()->beam_thickness_f (); + Real space = stems_[0]->staff_line_leading_f (); + Real internote_f = space /2; + Real staffline_f = paper_l ()->rule_thickness (); + Real beam_f = paper_l ()->beam_thickness_f (); /* [TODO] @@ -448,8 +457,8 @@ Beam::quantise_left_y (bool extend_b) Real straddle = 0; Real sit = beam_f / 2 - staffline_f / 2; - Real inter = interline_f / 2; - Real hang = interline_f - beam_f / 2 + staffline_f / 2; + Real inter = space / 2; + Real hang = space - beam_f / 2 + staffline_f / 2; /* Put all allowed positions into an array. @@ -512,7 +521,7 @@ Beam::quantise_left_y (bool extend_b) } } - Interval iv = quantise_iv (allowed_position, interline_f, dy_f); + Interval iv = quantise_iv (allowed_position, space, dy_f); Real quanty_f = dy_f - iv.min () <= iv.max () - dy_f ? iv.min () : iv.max (); if (extend_b) @@ -525,7 +534,7 @@ Beam::quantise_left_y (bool extend_b) void Beam::set_stemlens () { - Real staffline_f = paper ()->rule_thickness (); + Real staffline_f = paper_l ()->rule_thickness (); // enge floots Real epsilon_f = staffline_f / 8; @@ -602,10 +611,11 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const assert (!next || next->hpos_f () > here->hpos_f ()); assert (!prev || prev->hpos_f () < here->hpos_f ()); - Real staffline_f = paper ()->rule_thickness (); - Real interbeam_f = paper ()->interbeam_f (multiple_i_); - Real internote_f = paper ()->internote_f (); - Real beam_f = paper ()->beam_thickness_f (); + Real staffline_f = paper_l ()->rule_thickness (); + Real interbeam_f = paper_l ()->interbeam_f (multiple_i_); + + Real internote_f = here->staff_line_leading_f ()/2; + Real beam_f = paper_l ()->beam_thickness_f (); Real dy = interbeam_f; Real stemdx = staffline_f; @@ -616,7 +626,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const Molecule rightbeams; // UGH - Real nw_f = paper ()->note_width () * 0.8; + Real nw_f = paper_l ()->note_width () * 0.8; /* half beams extending to the left. */ if (prev) diff --git a/lily/bezier.cc b/lily/bezier.cc index d516ff1c8d..69c172200a 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -157,7 +157,7 @@ Bezier_bow::blow_fit () return; #ifndef STANDALONE - Real internote_f = paper_l_->internote_f (); + Real internote_f = paper_l_->get_realvar (interline_scm_sym)/2.0; #else Real internote_f = STAFFHEIGHT / 8; #endif @@ -204,7 +204,7 @@ Bezier_bow::calc_bezier () Real s = sqrt (control_[3].x () * control_[3].x () + control_[1].y () * control_[2].y ()); #ifndef STANDALONE - Real internote = paper_l_->internote_f (); + Real internote = paper_l_->get_realvar (interline_scm_sym)/2.0; #else Real internote = STAFFHEIGHT / 8; #endif @@ -446,7 +446,7 @@ Bezier_bow::calc_tangent_controls () // emperic computer science: // * tangents somewhat steeper than minimal line #ifndef STANDALONE - Real internote = paper_l_->internote_f (); + Real internote = paper_l_->get_realvar (interline_scm_sym)/2.0; Real rc_correct = paper_l_->get_var ("slur_rc_factor"); #else Real internote = STAFFHEIGHT / 8; diff --git a/lily/bow.cc b/lily/bow.cc index db08356b32..c634746b1f 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -30,7 +30,7 @@ Bow::Bow () Molecule* Bow::do_brew_molecule_p () const { - Real thick = paper ()->get_var ("slur_thickness"); + Real thick = paper_l ()->get_var ("slur_thickness"); Array<Offset> c = get_controls (); Real dy = c[3].y () - c[0].y (); Molecule a; @@ -93,7 +93,7 @@ Bow::do_height () const Array<Offset> Bow::get_controls () const { - Bezier_bow b (paper ()); + Bezier_bow b (paper_l ()); b.set (get_encompass_offset_arr (), dir_); b.calc (); Array<Offset> controls; diff --git a/lily/break.cc b/lily/break.cc index a836d62da3..131294f200 100644 --- a/lily/break.cc +++ b/lily/break.cc @@ -55,7 +55,7 @@ Break_algorithm::find_break_indices () const Array<int> retval; for (int i=0; i < all.size (); i++) - if (all[i]->breakable_b_) + if (all[i]->breakable_b ()) retval.push (i); if (linelength <=0) @@ -73,7 +73,7 @@ Break_algorithm::find_breaks () const Line_of_cols retval; for (int i=0; i < all.size (); i++) - if (all[i]->breakable_b_) + if (all[i]->breakable_b ()) retval.push (all[i]); @@ -152,15 +152,6 @@ Break_algorithm::problem_OK () const void Break_algorithm::OK () const { -#ifndef NDEBUG - #if 0 - iter_top (pscore_l_->col_p_list_,start); - PCursor<Paper_column *> end (pscore_l_->col_p_list_.bottom ()); - - assert (start->breakable_b_); - assert (end->breakable_b_); - #endif -#endif } Array<Column_x_positions> diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 66aa91b587..bdd816430c 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -137,7 +137,7 @@ Clef_engraver::acknowledge_element (Score_element_info info) if (Note_head * h = dynamic_cast<Note_head*>(it_l)) { // h->position_i_ += c0_position_i_; - h->position_i_ = h->steps_i_ + c0_position_i_; + h->position_i_ += c0_position_i_; } else if (Local_key_item *i = dynamic_cast<Local_key_item*> (it_l)) { @@ -187,11 +187,10 @@ Clef_engraver::create_clef() if (!clef_p_) { Clef_item *c= new Clef_item; - c->break_priority_i_ = -2; // ugh + c->set_elt_property (break_priority_scm_sym, gh_int2scm (-2)); // ugh announce_element (Score_element_info (c, clef_req_l_)); clef_p_ = c; } - clef_p_->symbol_ = clef_type_str_; clef_p_->y_position_i_ = clef_position_i_; diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 08eb9ea4c4..f10fbb17b9 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -18,7 +18,7 @@ void Clef_item::do_pre_processing() { - dim_cache_[Y_AXIS].translate (paper()->internote_f () * y_position_i_); + dim_cache_[Y_AXIS].translate (y_position_i_ * staff_line_leading_f () / 2.0); change_b_ = (break_status_dir() != RIGHT); } @@ -27,7 +27,7 @@ Clef_item::do_pre_processing() */ Clef_item::Clef_item() { - breakable_b_ =true; + set_elt_property (breakable_scm_sym, SCM_BOOL_T); default_b_ = false; change_b_ = true; octave_dir_ = CENTER; @@ -38,7 +38,7 @@ Clef_item::Clef_item() void Clef_item::do_add_processing () { - if (!break_status_dir_) // broken stuff takes care of their own texts + if (!break_status_dir ()) // broken stuff takes care of their own texts { SCM defvis = gh_eval_str ("(lambda (d) (if (= d 1) '(#f . #f) '(#t . #t)))"); G_text_item *g =0; @@ -59,11 +59,11 @@ Clef_item::do_add_processing () if (default_b_) { - set_elt_property (ly_symbol ("visibility_lambda"), + set_elt_property (visibility_lambda_scm_sym, defvis); if (g) - g->set_elt_property (ly_symbol ("visibility_lambda"), + g->set_elt_property (visibility_lambda_scm_sym, defvis); } } diff --git a/lily/collision.cc b/lily/collision.cc index 5da7436713..b995639eda 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -65,7 +65,9 @@ Collision::do_pre_processing() } int d = (c_l->dir_); - clash_group_arr_a[idx (d, c_l->h_shift_b_)].push (c_l); + SCM shift = c_l->remove_elt_property (horizontal_shift_scm_sym); + bool shift_b = (shift != SCM_BOOL_F); + clash_group_arr_a[idx (d, shift_b)].push (c_l); } @@ -92,7 +94,6 @@ Collision::do_pre_processing() Interval_t<int> y_extent[4]; Note_column * col_l_a[4]; Real x_off [4]; - int y_off[4]; for (int j =0 ; j < 4; j++) { @@ -108,7 +109,6 @@ Collision::do_pre_processing() x_off [j] = 0.0; - y_off[j] = 0; } do @@ -144,8 +144,8 @@ Collision::do_pre_processing() } } - Real inter_f = paper()->internote_f (); - Real wid_f = paper()->note_width (); + + Real wid_f = paper_l ()->note_width (); for (int j=0; j < 4; j++) { if (col_l_a[j]) @@ -154,7 +154,7 @@ Collision::do_pre_processing() (shaddup) */ - Offset o (x_off[j] * wid_f, y_off[j] * inter_f); + Offset o (x_off[j] * wid_f, 0); col_l_a[j]->translate (o); // ((Score_element*)col_l_a[j])->translate (o); } diff --git a/lily/dimension-cache.cc b/lily/dimension-cache.cc index 6fb7842dcf..c78fe6e8e8 100644 --- a/lily/dimension-cache.cc +++ b/lily/dimension-cache.cc @@ -12,6 +12,7 @@ Dimension_cache::Dimension_cache (Dimension_cache const &d) { init(); + callback_l_ = d.callback_l_; empty_b_ = d.empty_b_; offset_ = d.offset_; //let's hope others will copy the refpoint appropriately. } @@ -24,6 +25,7 @@ Dimension_cache::Dimension_cache () void Dimension_cache::init() { + callback_l_ =0; offset_ =0.0; elt_l_ = 0; dim_.set_empty (); @@ -145,7 +147,12 @@ Dimension_cache::get_dim () const return r; } - assert (valid_b_); + if (!valid_b_) + { + Dimension_cache *nc = ((Dimension_cache*)this); + nc->dim_= (*callback_l_ ) (nc); + nc->valid_b_ = true; + } r=dim_; if (!r.empty_b()) // float exception on DEC Alpha @@ -154,4 +161,8 @@ Dimension_cache::get_dim () const return r; } - +void +Dimension_cache::set_callback (Dim_cache_callback c) +{ + callback_l_ =c; +} diff --git a/lily/dots.cc b/lily/dots.cc index c84e3d7ab0..6d9af00dd2 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -24,7 +24,7 @@ Dots::do_post_processing () position_i_ ++; if (!no_dots_i_) { - transparent_b_ = true; + set_elt_property (transparent_scm_sym, SCM_BOOL_T); set_empty (true); } } @@ -46,8 +46,7 @@ Dots::do_brew_molecule_p () const d.translate_axis (2*dw,X_AXIS); out->add_molecule (d); } - Real inter_f = paper ()->internote_f (); - out->translate_axis (inter_f * position_i_, Y_AXIS); + out->translate_axis (staff_line_leading_f () * position_i_ /2., Y_AXIS); return out; } diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 45d73e7c37..f3e72a2df3 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -12,7 +12,7 @@ #include "lookup.hh" #include "paper-def.hh" #include "score-column.hh" -#include "staff-sym.hh" +#include "staff-symbol.hh" #include "note-column.hh" #include "g-text-item.hh" #include "g-staff-side.hh" @@ -158,7 +158,7 @@ Dynamic_engraver::do_process_requests() } cresc_p_ = new_cresc_p; - cresc_p_->set_bounds(LEFT,get_staff_info().musical_l ()); + cresc_p_->set_bounds(LEFT,get_staff_info().musical_pcol_l ()); if (text_p_) { cresc_p_->dyn_b_drul_[LEFT] = true; @@ -171,15 +171,6 @@ Dynamic_engraver::do_process_requests() void Dynamic_engraver::do_pre_move_processing() { - Staff_symbol* s_l = get_staff_info().staff_sym_l_; - if (to_end_cresc_p_) - to_end_cresc_p_->add_support (s_l); - if (staff_side_p_) - { - staff_side_p_->add_support (s_l); - // staff_side_p_->dim_cache_[Y_AXIS].parent_l_ = &s_l->dim_cache_[Y_AXIS]; - } - typeset_all (); } @@ -205,7 +196,7 @@ Dynamic_engraver::typeset_all () { if (to_end_cresc_p_) { - to_end_cresc_p_->set_bounds(RIGHT,get_staff_info().musical_l ()); + to_end_cresc_p_->set_bounds(RIGHT,get_staff_info().musical_pcol_l ()); typeset_element (to_end_cresc_p_); to_end_cresc_p_ =0; } diff --git a/lily/encompass-info.cc b/lily/encompass-info.cc index 99b9ccb8fc..02f5b28686 100644 --- a/lily/encompass-info.cc +++ b/lily/encompass-info.cc @@ -13,7 +13,7 @@ #include "paper-def.hh" #include "encompass-info.hh" #include "slur.hh" -#include "staff-sym.hh" +#include "staff-symbol.hh" #include "note-head.hh" #include "debug.hh" @@ -22,17 +22,19 @@ Encompass_info::Encompass_info () assert (0); } -Encompass_info::Encompass_info (Note_column const* note, Direction dir) +Encompass_info::Encompass_info (Note_column const* note, Direction dir, Slur const* slur_l) { interstaff_f_ = 0; - Paper_def* paper = note->paper (); - Real interline = paper->interline_f (); + Paper_def* paper = note->paper_l (); + // UGH Real notewidth = paper->note_width () * 0.8; - Real internote = interline / 2; + Stem* stem_l = note->stem_l_; + Real internote = stem_l-> staff_line_leading_f ()/2.; + /* set o_.x () to middle of notehead or on the exact position of stem, according to slur direction @@ -60,33 +62,21 @@ Encompass_info::Encompass_info (Note_column const* note, Direction dir) if (stem_l->dir_ != dir) o_.y () += 1.0 * internote * dir; - Slur* slur_l = stem_l->slur_l_; if (slur_l->encompass_arr_.size () - && stem_l->staff_sym_l_ != slur_l->encompass_arr_[0]->stem_l_->staff_sym_l_) + && stem_l->staff_symbol_l () != slur_l->encompass_arr_[0]->stem_l_->staff_symbol_l ()) { -#if 0 // this is nonsense..., don't issue warning - if (stem_l->staff_sym_l_->dim_cache_[Y_AXIS].valid_b ()) - { - interstaff_f_ = stem_l->staff_sym_l_->absolute_coordinate (Y_AXIS) - - slur_l->encompass_arr_[0]->stem_l_->staff_sym_l_->absolute_coordinate (Y_AXIS); - } - else -#endif - { - // warning (_ ("invalid dimension cache: guessing staff position")); - if (slur_l->vertical_align_drul_[MIN] != - slur_l->vertical_align_drul_[MAX]) - warning (_ ("minVerticalAlign != maxVerticalAlign: interstaff slurs may be broken")); - interstaff_f_ = slur_l->vertical_align_drul_[MIN]; - /* urg, guess staff order */ - int d = note->head_l_arr_.top ()->steps_i_ - - slur_l->encompass_arr_[0]->head_l_arr_[0]->steps_i_; - if (abs (d > 3)) - interstaff_f_ *= sign (d); - else if (stem_l->chord_start_f () > - slur_l->encompass_arr_[0]->stem_l_->chord_start_f ()) - interstaff_f_ *= -1; - } + if (slur_l->vertical_align_drul_[MIN] != + slur_l->vertical_align_drul_[MAX]) + warning (_ ("minVerticalAlign != maxVerticalAlign: interstaff slurs may be broken")); + interstaff_f_ = slur_l->vertical_align_drul_[MIN]; + /* urg, guess staff order */ + int d = note->head_l_arr_.top ()->position_i_ + - slur_l->encompass_arr_[0]->head_l_arr_[0]->position_i_; + if (abs (d > 3)) + interstaff_f_ *= sign (d); + else if (stem_l->chord_start_f () > + slur_l->encompass_arr_[0]->stem_l_->chord_start_f ()) + interstaff_f_ *= -1; o_.y () += interstaff_f_; } } diff --git a/lily/engraver.cc b/lily/engraver.cc index 6f2413ffdc..fde31b7593 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -35,7 +35,7 @@ Engraver::typeset_element (Score_element*p) Paper_def* -Engraver::paper() const +Engraver::paper_l () const { return dynamic_cast<Paper_def*>(output_def_l_); } diff --git a/lily/extender-engraver.cc b/lily/extender-engraver.cc index 427faffcaa..f0478bebe2 100644 --- a/lily/extender-engraver.cc +++ b/lily/extender-engraver.cc @@ -63,7 +63,7 @@ Extender_engraver::do_removal_processing () if (extender_spanner_p_) { req_l_->warning (_ ("unterminated extender")); - extender_spanner_p_->set_bounds(RIGHT, get_staff_info ().command_l ()); + extender_spanner_p_->set_bounds(RIGHT, get_staff_info ().command_pcol_l ()); } } diff --git a/lily/extender-spanner.cc b/lily/extender-spanner.cc index 764d42c77a..3b97b29c65 100644 --- a/lily/extender-spanner.cc +++ b/lily/extender-spanner.cc @@ -51,7 +51,7 @@ Extender_spanner::do_brew_molecule_p () const Real w = extent (X_AXIS).length (); w += (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]); - Real h = paper ()->get_realvar (ly_symbol ("extender_height")); + Real h = paper_l ()->get_realvar (extender_height_scm_sym); Molecule a = lookup_l ()->filledbox ( Box (Interval (0,w), Interval (0,h))); a.translate (Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT])); @@ -84,7 +84,7 @@ Extender_spanner::do_post_processing () assert (item_l_drul_[LEFT] || item_l_drul_[RIGHT]); // UGH - Real nw_f = paper ()->note_width () * 0.8; + Real nw_f = paper_l ()->note_width () * 0.8; Direction d = LEFT; do diff --git a/lily/font-size-engraver.cc b/lily/font-size-engraver.cc index 22436f0aba..cc4da24fec 100644 --- a/lily/font-size-engraver.cc +++ b/lily/font-size-engraver.cc @@ -30,7 +30,7 @@ Font_size_engraver::do_process_requests () void Font_size_engraver::acknowledge_element (Score_element_info e) { - e.elem_l_->set_elt_property (ly_symbol ("fontsize"), + e.elem_l_->set_elt_property (fontsize_scm_sym, gh_int2scm (size_i_)); } diff --git a/lily/g-staff-side.cc b/lily/g-staff-side.cc index 660e9fefc2..4c3920dca1 100644 --- a/lily/g-staff-side.cc +++ b/lily/g-staff-side.cc @@ -8,12 +8,13 @@ */ #include "g-staff-side.hh" +#include "staff-symbol.hh" G_staff_side_item::G_staff_side_item () { dir_ = CENTER; to_position_l_ = 0; - transparent_b_ = true; + set_elt_property (transparent_scm_sym, SCM_BOOL_T); padding_f_ = 0; axis_ = Y_AXIS; } @@ -55,6 +56,7 @@ G_staff_side_item::add_support (Score_element*e) void G_staff_side_item::do_substitute_element_pointer (Score_element*o, Score_element*n) { + Staff_symbol_referencer::do_substitute_element_pointer (o,n); if (o == to_position_l_) to_position_l_ = n; else @@ -96,3 +98,12 @@ G_staff_side_item::do_post_processing () position_self (); } + +void +G_staff_side_item::do_add_processing () +{ + if (axis_ == Y_AXIS && staff_symbol_l ()) + { + add_support (staff_symbol_l ()); + } +} diff --git a/lily/g-text-item.cc b/lily/g-text-item.cc index dc10b240f1..1854e96c5b 100644 --- a/lily/g-text-item.cc +++ b/lily/g-text-item.cc @@ -16,7 +16,8 @@ Molecule* G_text_item::do_brew_molecule_p () const { - Molecule a= paper ()->lookup_l(0)->text (style_str_,text_str_); + Molecule a= paper_l ()->lookup_l(0)->text (style_str_,text_str_); + return new Molecule (a); } diff --git a/lily/graphical-axis-group.cc b/lily/graphical-axis-group.cc index b1497be9d5..c6a6137d3c 100644 --- a/lily/graphical-axis-group.cc +++ b/lily/graphical-axis-group.cc @@ -37,6 +37,8 @@ Graphical_axis_group::extent (Axis axis) const void Graphical_axis_group::add_element (Graphical_element*e) { + used_b_ =true; + e->used_b_ = true; for (int i = 0; i < 2; i++) { Axis a = axes_[i]; diff --git a/lily/graphical-element.cc b/lily/graphical-element.cc index 98c3c02b62..975b1ffe7a 100644 --- a/lily/graphical-element.cc +++ b/lily/graphical-element.cc @@ -10,20 +10,16 @@ #include "graphical-axis-group.hh" #include "debug.hh" -bool -Graphical_element::empty_b () const -{ - return dim_cache_[X_AXIS].empty_b () && dim_cache_[Y_AXIS].empty_b (); -} - Graphical_element::Graphical_element () { + used_b_ = false; init (); } Graphical_element::Graphical_element (Graphical_element const &s) : dim_cache_ (s.dim_cache_) { + used_b_ = true; init (); } @@ -89,10 +85,6 @@ Graphical_element::extent (Axis a) const if (d->empty_b ()) return Interval (); - if (!d->valid_b ()) - ((Dimension_cache*)d)->set_dim ((a == X_AXIS)? do_width(): do_height ()); - - return d->get_dim (); } diff --git a/lily/hara-kiri-vertical-group-spanner.cc b/lily/hara-kiri-vertical-group-spanner.cc index 70a7f57ccb..84872173a4 100644 --- a/lily/hara-kiri-vertical-group-spanner.cc +++ b/lily/hara-kiri-vertical-group-spanner.cc @@ -32,7 +32,7 @@ Hara_kiri_vertical_group_spanner::do_post_processing () Link_array<Score_element> childs = get_children (); for (int i = 0; i < childs.size (); i++) { - childs[i]->transparent_b_ = true; + childs[i]->set_elt_property (transparent_scm_sym, SCM_BOOL_T); childs[i]->set_empty (true); } set_empty (true); diff --git a/lily/heads-engraver.cc b/lily/heads-engraver.cc index 8e554a8428..ee5c040c3c 100644 --- a/lily/heads-engraver.cc +++ b/lily/heads-engraver.cc @@ -50,8 +50,8 @@ Note_heads_engraver::do_process_requests() dot_p_arr_.push (d); } - note_p->steps_i_ = note_req_l->pitch_.steps (); - // note_p->position_i_ = note_req_l->pitch_.steps (); + // note_p->steps_i_ = note_req_l->pitch_.steps (); + note_p->position_i_ = note_req_l->pitch_.steps (); String noteheadstyle = get_property ("noteheadStyle", 0); if (noteheadstyle.length_i ()) diff --git a/lily/include/align-element.hh b/lily/include/align-element.hh index 0a9f1e6958..fbb84f77d7 100644 --- a/lily/include/align-element.hh +++ b/lily/include/align-element.hh @@ -16,9 +16,9 @@ #include "axes.hh" /** - Order elements top to bottom. + Order elements top to bottom/left to right/right to left etc.. - TODO: merge with Horizontal_align_item + TODO: implement padding. */ class Align_element : virtual public Score_element { Link_array<Score_element> elem_l_arr_; @@ -47,7 +47,8 @@ public: void add_element (Score_element*); void add_element_priority (Score_element*, int); bool contains_b (Score_element const*) const; - + + Score_element *get_elt_by_priority (int) const; protected: virtual void do_print() const; virtual void do_substitute_element_pointer (Score_element*,Score_element*); diff --git a/lily/include/audio-column.hh b/lily/include/audio-column.hh index 42836a54b4..3cd36d94e8 100644 --- a/lily/include/audio-column.hh +++ b/lily/include/audio-column.hh @@ -8,10 +8,9 @@ #define AUDIO_COLUMN_HH #include "proto.hh" -#include "plist.hh" #include "lily-proto.hh" #include "moment.hh" -#include "pcursor.hh" +#include "parray.hh" #include "audio-element.hh" /** @@ -26,7 +25,7 @@ public: Moment at_mom() const; void print() const; - Link_list<Audio_item *> audio_item_l_list_; + Link_array<Audio_item> audio_item_l_arr_; Performance * performance_l_; private: diff --git a/lily/include/audio-staff.hh b/lily/include/audio-staff.hh index 2bcaf94c97..faf0eda841 100644 --- a/lily/include/audio-staff.hh +++ b/lily/include/audio-staff.hh @@ -8,7 +8,7 @@ #define AUDIO_STAFF_HH #include "proto.hh" -#include "plist.hh" +#include "parray.hh" #include "lily-proto.hh" #include "audio-element.hh" @@ -16,8 +16,7 @@ struct Audio_staff : public Audio_element { void add_audio_item (Audio_item* l); void output (Midi_stream& midi_stream_r, int track_i); - Link_list<Audio_item*> audio_item_l_list_; - + Link_array<Audio_item> audio_item_l_arr_; }; #endif // AUDIO_STAFF_HH diff --git a/lily/include/axis-group-element.hh b/lily/include/axis-group-element.hh index e272ffca0d..ed80677fae 100644 --- a/lily/include/axis-group-element.hh +++ b/lily/include/axis-group-element.hh @@ -28,8 +28,6 @@ public: Axis_group_element(Axis,Axis); Axis_group_element(); virtual Link_array<Score_element> get_children (); - - }; #endif // AXIS_GROUP_ELEMENT_HH diff --git a/lily/include/bar.hh b/lily/include/bar.hh index ee3ae12af8..08e48d2f6e 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -7,6 +7,7 @@ #ifndef BAR_HH #define BAR_HH #include "item.hh" + /** A vertical bar. */ @@ -22,7 +23,7 @@ public: protected: virtual void do_pre_processing (); virtual Molecule* do_brew_molecule_p () const; - + virtual Real get_bar_size () const; private: void do_print () const; }; diff --git a/lily/include/beam.hh b/lily/include/beam.hh index f30098a427..a8b6ca286a 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -10,13 +10,13 @@ #include "lily-proto.hh" #include "directional-spanner.hh" #include "stem-info.hh" -#include "plist.hh" + /** a beam connects multiple stems. Beam adjusts the stems its owns to make sure that they reach the beam and that point in the correct direction */ -class Beam: public Directional_spanner { +class Beam : public Directional_spanner { public: /** The beams should be prevented to conflict with the stafflines, diff --git a/lily/include/clef-item.hh b/lily/include/clef-item.hh index b1f454b836..232b57ef72 100644 --- a/lily/include/clef-item.hh +++ b/lily/include/clef-item.hh @@ -10,11 +10,11 @@ #include "text-def.hh" #include "direction.hh" #include "pointer.hh" - +#include "staff-symbol-referencer.hh" /** Set a clef in a staff. */ -class Clef_item : public Item { +class Clef_item : public Item, public Staff_symbol_referencer { protected: virtual void do_pre_processing(); virtual Molecule* do_brew_molecule_p() const; diff --git a/lily/include/cons.hh b/lily/include/cons.hh index d0ba58d9cf..7e2a995450 100644 --- a/lily/include/cons.hh +++ b/lily/include/cons.hh @@ -62,7 +62,8 @@ class Cons_list public: Cons<T> * head_; Cons<T> ** tail_; - Cons_list () { head_ =0; tail_ = &head_; } + Cons_list () { init_list (); } + void init_list () {head_ =0; tail_ = &head_; } void append (Cons<T> *c) { assert (!c->next_); @@ -92,6 +93,19 @@ template<class T> void clone_killing_cons_list (Cons_list<T>&, Cons<T> *src); +template<class T> int cons_list_size_i (Cons<T> *l) +{ + int i=0; + while (l) + { + l = l->next_; + i++; + } + return i; +} + + + #endif /* CONS_HH */ diff --git a/lily/include/dimension-cache.hh b/lily/include/dimension-cache.hh index 806ec2704e..b55d1c65a9 100644 --- a/lily/include/dimension-cache.hh +++ b/lily/include/dimension-cache.hh @@ -15,6 +15,8 @@ #include "lily-proto.hh" #include "parray.hh" +class Dimension_cache; +typedef Interval (*Dim_cache_callback)(Dimension_cache *); /** Adminstration of offset dimension info. @@ -32,10 +34,12 @@ class Dimension_cache */ Real offset_; Graphical_element *elt_l_; + Dim_cache_callback callback_l_; friend class Graphical_element; void init (); public: + void set_callback (Dim_cache_callback); /** The #offset_# is defined with regard to this graphical_element/ dimension_cache. */ diff --git a/lily/include/directional-spanner.hh b/lily/include/directional-spanner.hh index b93d830f32..c96676cbc7 100644 --- a/lily/include/directional-spanner.hh +++ b/lily/include/directional-spanner.hh @@ -9,19 +9,22 @@ #include "spanner.hh" -/// a spanner which can be pointing "up" or "down" +/** a spanner which can be pointing "up" or "down". + + JUNKME? + */ class Directional_spanner : public Spanner{ public: - /// -1 below heads, +1 above heads. - Direction dir_; - Directional_spanner(); + /// -1 below heads, +1 above heads. + Direction dir_; + Directional_spanner(); - /// offset of "center" relative to left-column/0-pos of staff - virtual Offset center() const; - virtual void set_default_dir(); + /// offset of "center" relative to left-column/0-pos of staff + virtual Offset center() const; + virtual void set_default_dir(); protected: - virtual void do_pre_processing(); + virtual void do_pre_processing(); }; #endif // DIRECTIONALSPANNER_HH diff --git a/lily/include/dots.hh b/lily/include/dots.hh index 8c6a32ca25..2ff6f06170 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -11,12 +11,12 @@ #define DOTS_HH #include "item.hh" - +#include "staff-symbol-referencer.hh" /** The dots to go with a notehead/rest. A separate class, since they are a party in collision resolution. */ -class Dots : public Item +class Dots : public Item, public Staff_symbol_referencer { protected: virtual Molecule * do_brew_molecule_p () const; diff --git a/lily/include/encompass-info.hh b/lily/include/encompass-info.hh index a6156e8f5d..91aab59569 100644 --- a/lily/include/encompass-info.hh +++ b/lily/include/encompass-info.hh @@ -17,7 +17,7 @@ struct Encompass_info { Encompass_info (); - Encompass_info (Note_column const*, Direction); + Encompass_info (Note_column const*, Direction, Slur const *); Offset o_; Real interstaff_f_; diff --git a/lily/include/engraver-group.hh b/lily/include/engraver-group.hh index e1f34ccfde..ec32684831 100644 --- a/lily/include/engraver-group.hh +++ b/lily/include/engraver-group.hh @@ -12,7 +12,6 @@ #include "lily-proto.hh" #include "parray.hh" -#include "plist.hh" #include "score-element-info.hh" #include "engraver.hh" #include "translator-group.hh" @@ -32,8 +31,6 @@ public: Engraver_group_engraver(); ~Engraver_group_engraver(); - - virtual Staff_info get_staff_info() const; virtual void do_announces(); virtual void announce_element (Score_element_info); diff --git a/lily/include/engraver.hh b/lily/include/engraver.hh index 60716cba53..a073d808ac 100644 --- a/lily/include/engraver.hh +++ b/lily/include/engraver.hh @@ -31,7 +31,7 @@ protected: /// utility - Paper_def * paper() const; + Paper_def * paper_l() const; /** Invoke walker method to typeset element. Default: pass on to daddy. */ diff --git a/lily/include/g-staff-side.hh b/lily/include/g-staff-side.hh index b489844e8f..6334233f11 100644 --- a/lily/include/g-staff-side.hh +++ b/lily/include/g-staff-side.hh @@ -11,8 +11,9 @@ #define G_STAFF_SIDE_HH #include "item.hh" +#include "staff-symbol-referencer.hh" -class G_staff_side_item : public Item +class G_staff_side_item : public Item, public Staff_symbol_referencer { void position_self (); public: @@ -29,6 +30,7 @@ public: virtual void set_default_direction (); VIRTUAL_COPY_CONS(Score_element); protected: + virtual void do_add_processing (); virtual void do_substitute_element_pointer (Score_element*,Score_element*); virtual void do_pre_processing (); virtual void do_post_processing (); diff --git a/lily/include/graphical-element.hh b/lily/include/graphical-element.hh index 70e0ea9c2f..bc60c0b41a 100644 --- a/lily/include/graphical-element.hh +++ b/lily/include/graphical-element.hh @@ -27,10 +27,13 @@ class Graphical_element public: Dimension_cache dim_cache_[NO_AXES]; + /** + Set this if anyone points to me, or if I point to anyone. + */ + bool used_b_; + char const * name () const; void set_empty (bool); - bool empty_b () const; - Graphical_element (); Graphical_element (Graphical_element const&); virtual ~Graphical_element (); @@ -60,9 +63,6 @@ public: Graphical_element *parent_l (Axis a) const; virtual void do_print () const; -protected: - virtual Interval do_height () const=0; - virtual Interval do_width () const=0; }; #endif // GRAPHICAL_ELEMENT_HH diff --git a/lily/include/item.hh b/lily/include/item.hh index db8e5c4cf9..ce08eb0b3f 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -39,23 +39,17 @@ class Item : public virtual Score_element { void do_break (); void try_visibility_lambda (); - -public: - Link_array<Spanner> attached_span_l_arr_; Drul_array<Item*> broken_to_drul_; - Item *unbroken_original_l_; - /// should be put in a breakable col. - bool breakable_b_; + +public: /// I am really to be broken? - virtual bool breakable_b () const; + bool breakable_b () const; + bool broken_original_b () const; - Direction break_status_dir_; - int break_priority_i_; + Direction break_status_dir () const; - /// nobreak = 0, pre = -1, post = 1 - Direction break_status_dir() const; Item * find_prebroken_piece (Direction) const; Item * find_prebroken_piece (Line_of_score*) const; @@ -72,8 +66,6 @@ protected: virtual void do_breakable_col_processing(); virtual void handle_prebroken_dependencies(); virtual void do_print() const; - virtual bool linked_b() const; - virtual void handle_prebroken_dependents (); void copy_breakable_items(); diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index 38fafe97ee..0833aca961 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -9,10 +9,12 @@ #include "item.hh" #include "array.hh" - +#include "staff-symbol-referencer.hh" /// An item which places accidentals at the start of the line -struct Key_item : Item { +class Key_item :public Item, public Staff_symbol_referencer { +public: + Array<int> pitch_arr_; Array<int> acc_arr_; Array<int> old_pitch_arr_; @@ -32,7 +34,7 @@ struct Key_item : Item { void add (int pitch, int acc); void add_old (int pitch, int acc); void set_c_position (int); - int Key_item::calculate_position(int p, int a) const; + int calculate_position(int p, int a) const; protected: virtual void do_pre_processing(); diff --git a/lily/include/killing-cons.tcc b/lily/include/killing-cons.tcc index 9135aae3d8..f6fcff7bd1 100644 --- a/lily/include/killing-cons.tcc +++ b/lily/include/killing-cons.tcc @@ -40,6 +40,5 @@ clone_killing_cons_list (Cons_list<T> & dest, Cons<T> *src) } } - #endif /* KILLING_CONS_TCC */ diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 512590c275..097a77af14 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -31,5 +31,7 @@ void ly_display_scm (SCM s); void read_lily_scm_file (String); +void init_symbols (); +#include "ly-symbols.hh" #endif // LILY_GUILE_HH diff --git a/lily/include/line-of-score.hh b/lily/include/line-of-score.hh index c98ae4dd50..187947afec 100644 --- a/lily/include/line-of-score.hh +++ b/lily/include/line-of-score.hh @@ -12,13 +12,10 @@ #include "super-element.hh" /// the columns of a score that form one line. -class Line_of_score : public Spanner , public Super_element +class Line_of_score : public Spanner, public Super_element { public: Link_array<Paper_column> cols_; - bool error_mark_b_; - - Line_of_score(); void add_element (Score_element *); @@ -31,8 +28,6 @@ public: protected: virtual Link_array<Score_element> get_extra_dependencies () const; - - virtual Interval do_width() const; virtual void do_print() const; VIRTUAL_COPY_CONS(Score_element); diff --git a/lily/include/local-key-item.hh b/lily/include/local-key-item.hh index 7bc71c2333..edba5ec7ca 100644 --- a/lily/include/local-key-item.hh +++ b/lily/include/local-key-item.hh @@ -9,6 +9,7 @@ #include "item.hh" #include "array.hh" #include "musical-pitch.hh" +#include "staff-symbol-referencer.hh" struct Local_key_cautionary_tuple { @@ -36,7 +37,7 @@ struct Local_key_cautionary_tuple figure out private/public */ -class Local_key_item : public Item { +class Local_key_item : public Item, public Staff_symbol_referencer { Array<Local_key_cautionary_tuple> accidental_arr_; Link_array<Item> support_items_; public: diff --git a/lily/include/ly-symbols.hh b/lily/include/ly-symbols.hh new file mode 100644 index 0000000000..99ba650faf --- /dev/null +++ b/lily/include/ly-symbols.hh @@ -0,0 +1,50 @@ +/* + ly-symbols.hh -- declare SCM symbols. + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl> + + */ + +#ifndef LY_SYMBOLS_HH +#define LY_SYMBOLS_HH + +#ifndef DECLARE_LY_SYMBOL +#define DECLARE_LY_SYMBOL(a) extern SCM a ## _scm_sym +#endif + +DECLARE_LY_SYMBOL(beam); +DECLARE_LY_SYMBOL(beam_thickness); +DECLARE_LY_SYMBOL(bracket); +DECLARE_LY_SYMBOL(break_helper_only); +DECLARE_LY_SYMBOL(break_priority); +DECLARE_LY_SYMBOL(breakable); +DECLARE_LY_SYMBOL(char); +DECLARE_LY_SYMBOL(extender_height); +DECLARE_LY_SYMBOL(filledbox); +DECLARE_LY_SYMBOL(fontsize); +DECLARE_LY_SYMBOL(header); +DECLARE_LY_SYMBOL(horizontal_shift); +DECLARE_LY_SYMBOL(interbeam); +DECLARE_LY_SYMBOL(interbeam4); +DECLARE_LY_SYMBOL(interline); +DECLARE_LY_SYMBOL(linewidth); +DECLARE_LY_SYMBOL(notewidth); +DECLARE_LY_SYMBOL(output); +DECLARE_LY_SYMBOL(pianobrace); +DECLARE_LY_SYMBOL(placebox); +DECLARE_LY_SYMBOL(rulesym); +DECLARE_LY_SYMBOL(rulethickness); +DECLARE_LY_SYMBOL(staffheight); +DECLARE_LY_SYMBOL(text); +DECLARE_LY_SYMBOL(transparent); +DECLARE_LY_SYMBOL(tuplet); +DECLARE_LY_SYMBOL(tuplet_thick); +DECLARE_LY_SYMBOL(visibility_lambda); +DECLARE_LY_SYMBOL(volta); +DECLARE_LY_SYMBOL(volta_thick); + + +#endif /* LY_SYMBOLS_HH */ + diff --git a/lily/include/midi-walker.hh b/lily/include/midi-walker.hh index ad2d6db6fd..30ec476420 100644 --- a/lily/include/midi-walker.hh +++ b/lily/include/midi-walker.hh @@ -17,8 +17,8 @@ struct Midi_note_event : PQueue_ent<Moment, Midi_note_off*> { - bool ignore_b_; - Midi_note_event(); + bool ignore_b_; + Midi_note_event(); }; int compare (Midi_note_event const& left, Midi_note_event const& right); @@ -26,22 +26,26 @@ int compare (Midi_note_event const& left, Midi_note_event const& right); /** walk audio and output midi */ -class Midi_walker : public PCursor<Audio_item*> +class Midi_walker// : public PCursor<Audio_item*> { public: - Midi_walker (Audio_staff* audio_staff_l, Midi_track* midi_track_l); - ~Midi_walker(); - - void process(); + Midi_walker (Audio_staff* audio_staff_l, Midi_track* midi_track_l); + ~Midi_walker(); + void process(); + void operator ++(int); + bool ok () const; private: - void do_start_note (Midi_note* note_p); - void do_stop_notes (Moment now_mom); - void output_event (Moment now_mom, Midi_item* l); - - Midi_track* track_l_; - PQueue<Midi_note_event> stop_note_queue; - Moment last_mom_; + void do_start_note (Midi_note* note_p); + void do_stop_notes (Moment now_mom); + void output_event (Moment now_mom, Midi_item* l); + + Midi_track* track_l_; + Audio_staff* staff_l_; + int index_; + Link_array<Audio_item> * item_l_arr_l_; + PQueue<Midi_note_event> stop_note_queue; + Moment last_mom_; }; diff --git a/lily/include/molecule.hh b/lily/include/molecule.hh index a95c3bff5c..8390326add 100644 --- a/lily/include/molecule.hh +++ b/lily/include/molecule.hh @@ -9,7 +9,6 @@ #define MOLECULE_HH #include "lily-proto.hh" -#include "plist.hh" #include "box.hh" #include "axes.hh" #include "direction.hh" diff --git a/lily/include/multi-measure-rest.hh b/lily/include/multi-measure-rest.hh index 2682d500a0..45fc8dddce 100644 --- a/lily/include/multi-measure-rest.hh +++ b/lily/include/multi-measure-rest.hh @@ -11,8 +11,9 @@ #define MULTI_MEASURE_REST_HH #include "spanner.hh" +#include "staff-symbol-referencer.hh" -class Multi_measure_rest : public Spanner +class Multi_measure_rest : public Spanner, public Staff_symbol_referencer { public: Multi_measure_rest (); diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index 7060c70576..7980affacf 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -11,7 +11,6 @@ #define MUSIC_ITERATOR_HH #include "lily-proto.hh" -#include "plist.hh" #include "array.hh" #include "moment.hh" #include "virtual-methods.hh" diff --git a/lily/include/music-list-iterator.hh b/lily/include/music-list-iterator.hh index 24f3e59077..341b103608 100644 --- a/lily/include/music-list-iterator.hh +++ b/lily/include/music-list-iterator.hh @@ -11,8 +11,7 @@ #define MUSIC_LIST_ITERATOR_HH #include "music-iterator.hh" -#include "pcursor.hh" -#include "plist.hh" + class Music_list_iterator : public Music_iterator { diff --git a/lily/include/music-list.hh b/lily/include/music-list.hh index f9bcfb7880..df6222af78 100644 --- a/lily/include/music-list.hh +++ b/lily/include/music-list.hh @@ -11,10 +11,10 @@ #define Music_sequence_HH #include "music.hh" -#include "plist.hh" +#include "cons.hh" -class Music_list : public Pointer_list<Music*> +class Music_list : public Cons_list<Music> { public: Musical_pitch do_relative_octave (Musical_pitch, bool); diff --git a/lily/include/music-output-def.hh b/lily/include/music-output-def.hh index d770befd2c..9007903714 100644 --- a/lily/include/music-output-def.hh +++ b/lily/include/music-output-def.hh @@ -13,7 +13,6 @@ #include "string.hh" #include "lily-proto.hh" #include "virtual-methods.hh" -#include "plist.hh" #include "dictionary.hh" /** diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index 88417f162d..8fd5af02b1 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -23,10 +23,11 @@ protected: public: /** The relative position of the "voice" containing this chord. Normally this would be the same as the stem direction, - but rests do not have stems. + but rests do not have stems. + + JUNKME.v */ Direction dir_; - bool h_shift_b_; Stem* stem_l_; diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index d70be4d9d1..a48792349d 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -23,9 +23,6 @@ public: /// position of top line (5 linestaff: 8) int position_i_; - /// pitch in steps - int steps_i_; - /// -1 = lowest, 0 = inside, 1 = top int extremal_i_; @@ -35,7 +32,6 @@ public: Note_head (); static int compare (Note_head * const &a, Note_head *const &b) ; - protected: virtual Interval do_width () const; virtual void do_pre_processing(); diff --git a/lily/include/p-col.hh b/lily/include/p-col.hh index e618fdc269..3f3f35e517 100644 --- a/lily/include/p-col.hh +++ b/lily/include/p-col.hh @@ -11,7 +11,6 @@ #define P_COL_HH #include "horizontal-group-item.hh" -#include "plist.hh" #include "rod.hh" @@ -29,12 +28,9 @@ */ class Paper_column : public Horizontal_group_item { -protected: - virtual bool breakable_b () const; public: - VIRTUAL_COPY_CONS(Score_element); - Drul_array< Array<Column_rod> > minimal_dists_arr_drul_; + Drul_array<Array<Column_rod> > minimal_dists_arr_drul_; void preprocess (); /// set a minimum distance @@ -54,17 +50,11 @@ public: Line_of_score *line_l_; virtual Line_of_score *line_l () const; - bool error_mark_b_; - bool used_b_ ; // manual override.. - /// which one (left =0) int rank_i() const; - /// does this column have items - bool used_b() const; bool breakpoint_b() const; - void add_item (Item *i); Paper_column(); diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index c3fa180538..77942e8027 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -30,9 +30,19 @@ add support for multiple fontsizes + + + add support for other len->wid conversions. Input_engraver should be in here. + + + Interesting variables: + + /// The distance between lines + interline + */ class Paper_def : public Music_output_def { @@ -49,6 +59,9 @@ public: Array<Interval> shape_int_a_; Real get_realvar (SCM symbol) const; Real get_var (String id) const; + + SCM get_scm_var (SCM sym) const; + void reinit (); Paper_def (); void set_lookup (int, Lookup*); @@ -60,11 +73,6 @@ public: /// The thickness of a beam Real beam_thickness_f () const; - /// The distance between lines - Real interline_f () const; - /// half the distance between lines - Real internote_f () const; - /// thickness of the standard line Real rule_thickness () const; diff --git a/lily/include/performance.hh b/lily/include/performance.hh index 3e34dc7cf5..55e9b44052 100644 --- a/lily/include/performance.hh +++ b/lily/include/performance.hh @@ -21,10 +21,7 @@ public: Performance (); ~Performance (); - void add_column (Audio_column*); - void add_staff (Audio_staff* l); void add_element (Audio_element*p); - void output (Midi_stream& midi_stream_r); void output_header_track (Midi_stream& midi_stream_r); diff --git a/lily/include/performer-group-performer.hh b/lily/include/performer-group-performer.hh index b98f2cd61a..b8c03cccef 100644 --- a/lily/include/performer-group-performer.hh +++ b/lily/include/performer-group-performer.hh @@ -10,7 +10,6 @@ #include "lily-proto.hh" #include "parray.hh" -#include "plist.hh" #include "performer.hh" #include "translator-group.hh" diff --git a/lily/include/rhythmic-head.hh b/lily/include/rhythmic-head.hh index 6187a2f645..a9cfca3355 100644 --- a/lily/include/rhythmic-head.hh +++ b/lily/include/rhythmic-head.hh @@ -11,8 +11,9 @@ #define RHYTHMIC_HEAD_HH #include "item.hh" +#include "staff-symbol-referencer.hh" -class Rhythmic_head : public Item +class Rhythmic_head : public Item, public Staff_symbol_referencer { public: diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index a3cfd50f69..eaaaf1482b 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -12,6 +12,7 @@ #include "directed-graph.hh" #include "graphical-element.hh" #include "protected-scm.hh" +#include "lily-guile.hh" typedef void (Score_element::*Score_element_method_pointer) (void); @@ -23,24 +24,52 @@ typedef void (Score_element::*Score_element_method_pointer) (void); which are implemented in the Directed_graph_node class: all elements form an acyclic graph. - (elem) */ + (elem) + + +Element Properties: + +Boolean (true iff defined) + + break_helper_only -- if defined try to junk this after calcing breakpoints. + + transparent -- do not calc. output + +*/ class Score_element : public virtual Graphical_element { Protected_scm element_property_alist_; Link_array<Score_element> dependency_arr_; - + Lookup * lookup_l_; public: - /// delete after linebreak calculation. - bool break_helper_only_b_; - Paper_score *pscore_l_; + Score_element *original_l_; + + /** + Administration: Where are we?. This is mainly used by Super_element and + Score_element::calcalute_dependencies () + + 0 means ORPHAN, + -1 means deleted + + */ + int status_i_; + + Paper_score *pscore_l_; Molecule * output_p_; Score_element (); Score_element (Score_element const&); virtual void print () const; - SCM get_elt_property (SCM sym); + /* + properties + */ + SCM get_elt_property (SCM sym) const; void set_elt_property (SCM sym, SCM val); - - Paper_def *paper () const; + SCM remove_elt_property (SCM key); + + /* + related classes. + */ + Paper_def *paper_l () const; Lookup const *lookup_l () const; virtual ~Score_element (); @@ -52,28 +81,13 @@ public: add a dependency. It may be the 0 pointer, in which case, it is ignored. */ void add_dependency (Score_element*); - virtual Line_of_score * line_l () const; - virtual bool linked_b () const; + bool linked_b () const; VIRTUAL_COPY_CONS(Score_element); - /// do not print anything black - bool transparent_b_; - // ugh: no protection. Denk na, Vrij Veilig void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr); -public: - /** - Administration: Where are we?. This is mainly used by Super_element and - Score_element::calcalute_dependencies () - - 0 means ORPHAN, - -1 means deleted - - */ - int status_i_; - protected: Score_element* dependency (int) const; int dependency_size () const; @@ -104,6 +118,8 @@ protected: virtual void handle_prebroken_dependencies (); virtual void handle_prebroken_dependents (); virtual Link_array<Score_element> get_extra_dependencies () const; + + static Interval dim_cache_callback (Dimension_cache*); }; diff --git a/lily/include/score-priority-engraver.hh b/lily/include/score-priority-engraver.hh index 66faa1edb9..b84174780b 100644 --- a/lily/include/score-priority-engraver.hh +++ b/lily/include/score-priority-engraver.hh @@ -13,11 +13,20 @@ #include "engraver.hh" /** - Group a number of items across staffs - */ + Group a number of items across staffs: + + Acknowledge items, put each priority in a separate column. Put all + columns in a horizontal align engraver. We manufacture two types of + elements: the alignment element and the columns. This is probably + more convenient, and I question the use having one without the + other. +*/ class Score_priority_engraver : public Engraver { - Hash_table<int, Horizontal_group_item *> align_p_tab_; + Break_align_item * halign_p_; + Link_array<Item> column_p_arr_; + + void add_horizontal_group (Item* , int p); public: VIRTUAL_COPY_CONS(Translator); Score_priority_engraver (); diff --git a/lily/include/score.hh b/lily/include/score.hh index e7c0f80647..bc89e7ae8a 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -12,7 +12,6 @@ #include "array.hh" #include "lily-proto.hh" -#include "plist.hh" #include "string.hh" #include "input.hh" #include "lily-proto.hh" diff --git a/lily/include/script.hh b/lily/include/script.hh index 3f596c963a..a09eb7b0f3 100644 --- a/lily/include/script.hh +++ b/lily/include/script.hh @@ -29,15 +29,13 @@ private: void set_default_dir(); public: General_script_def *specs_p_; - bool postbreak_only_b_; - + static int compare (Script *const&, Script *const&) ; Script(); ~Script (); Script (Script const&); void set_stem (Stem*); - }; diff --git a/lily/include/separating-group-spanner.hh b/lily/include/separating-group-spanner.hh index cb644e0729..5f4f7e9d02 100644 --- a/lily/include/separating-group-spanner.hh +++ b/lily/include/separating-group-spanner.hh @@ -17,6 +17,10 @@ class Separating_group_spanner : public Spanner { Link_array<Single_malt_grouping_item> spacing_unit_l_arr_; public: + /** + extra space to add after postbreak. (FIXME). + */ + Real padding_f_ ; Separating_group_spanner (); void add_spacing_unit (Single_malt_grouping_item*); protected: diff --git a/lily/include/sequential-music-iterator.hh b/lily/include/sequential-music-iterator.hh index eb473c354d..a027ad2fe5 100644 --- a/lily/include/sequential-music-iterator.hh +++ b/lily/include/sequential-music-iterator.hh @@ -31,7 +31,7 @@ protected: private: Moment here_mom_; - PCursor<Music*> *cursor_p_; + Cons<Music> *cursor_; Music_iterator * iter_p_; /* diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index 0c7bf2a5f5..91c75a7aca 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -69,8 +69,6 @@ protected: Array<Breaking_information> broken_info_; friend Axis_group_spanner; // UGH - Spanner * unbroken_original_l_; - virtual void output_processing (); virtual void do_space_processing (); virtual void do_break_processing (); diff --git a/lily/include/staff-bar.hh b/lily/include/staff-bar.hh new file mode 100644 index 0000000000..4f604ad080 --- /dev/null +++ b/lily/include/staff-bar.hh @@ -0,0 +1,28 @@ +/* + staff-bar.hh -- declare Staff_bar + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl> + + */ + +#ifndef STAFF_BAR_HH +#define STAFF_BAR_HH + +#include "bar.hh" +#include "staff-symbol-referencer.hh" + +/** + A bar that is on a staff. + Ugh. Entita non multiplicandum ... + */ +class Staff_bar : public Bar , public Staff_symbol_referencer +{ +public: + VIRTUAL_COPY_CONS(Score_element); + virtual Real get_bar_size () const; +}; + +#endif /* STAFF_BAR_HH */ + diff --git a/lily/include/staff-info.hh b/lily/include/staff-info.hh index d4d755547b..cbedf848ed 100644 --- a/lily/include/staff-info.hh +++ b/lily/include/staff-info.hh @@ -12,20 +12,17 @@ #include "lily-proto.hh" -/// struct to pass staff info along a Engraver hierarchy. +/** struct to pass staff info along a Engraver hierarchy. + + JUNKME. + */ struct Staff_info { - Staff_symbol*staff_sym_l_; - Time_description const *time_C_; Rhythmic_grouping const *rhythmic_C_; Score_column *musical_l_; Score_column *command_l_; - Score * score_l_; - Score *score_l(); Paper_column * command_pcol_l(); - Score_column* musical_l(); - Score_column *command_l(); Paper_column * musical_pcol_l(); Staff_info(); }; diff --git a/lily/include/staff-side.hh b/lily/include/staff-side.hh index d8ec57bd05..da73a3c84c 100644 --- a/lily/include/staff-side.hh +++ b/lily/include/staff-side.hh @@ -13,6 +13,7 @@ #include "score-element.hh" #include "interval.hh" #include "direction.hh" +#include "staff-symbol-referencer.hh" /** @@ -20,7 +21,7 @@ staff). */ -class Staff_side : virtual Score_element +class Staff_side : public Staff_symbol_referencer { public: @@ -49,8 +50,8 @@ protected: virtual void do_substitute_element_pointer (Score_element *, Score_element*); virtual void do_pre_processing (); virtual void do_post_processing (); + virtual void do_add_processing (); Interval support_extent () const; - private: void do_side_processing (); Link_array<Score_element> support_l_arr_; diff --git a/lily/include/staff-sym-engraver.hh b/lily/include/staff-sym-engraver.hh index 58877137ef..3c016b07df 100644 --- a/lily/include/staff-sym-engraver.hh +++ b/lily/include/staff-sym-engraver.hh @@ -23,7 +23,8 @@ public: protected: virtual ~Staff_symbol_engraver(); - virtual void fill_staff_info (Staff_info&); + + virtual void acknowledge_element (Score_element_info); virtual void do_removal_processing(); virtual void do_creation_processing(); diff --git a/lily/include/staff-symbol-referencer.hh b/lily/include/staff-symbol-referencer.hh new file mode 100644 index 0000000000..8203954c63 --- /dev/null +++ b/lily/include/staff-symbol-referencer.hh @@ -0,0 +1,35 @@ +/* + staff-sym-referencer.hh -- declare Staff_sym_referencer + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl> + + */ + +#ifndef STAFF_SYM_REFERENCER_HH +#define STAFF_SYM_REFERENCER_HH + +#include "score-element.hh" + +/** + A notation object that needs access to variables of the staff (no + lines, leading). + + */ +class Staff_symbol_referencer : public virtual Score_element +{ +protected: + Staff_symbol * staff_sym_l_; + +public: + Staff_symbol_referencer (); + void set_staff_symbol (Staff_symbol*); + Real staff_line_leading_f () const; + Staff_symbol * staff_symbol_l () const; + int lines_i () const; + virtual void do_substitute_element_pointer (Score_element*,Score_element*); +}; + +#endif /* STAFF_SYM_REFERENCER_HH */ + diff --git a/lily/include/staff-sym.hh b/lily/include/staff-symbol.hh index eeafd6d678..c15a1df10b 100644 --- a/lily/include/staff-sym.hh +++ b/lily/include/staff-symbol.hh @@ -20,11 +20,9 @@ class Staff_symbol : public Spanner public: /// this many lines. int no_lines_i_; - Real interline_f_; - + Real staff_line_leading_f_; Staff_symbol (); - Real inter_note_f() const; int steps_i() const; protected: VIRTUAL_COPY_CONS(Score_element); diff --git a/lily/include/stem.hh b/lily/include/stem.hh index eb31f3a9f2..a3f0921a45 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -10,7 +10,7 @@ #include "array.hh" #include "moment.hh" #include "molecule.hh" - +#include "staff-symbol-referencer.hh" /**the rule attached to the ball. takes care of: @@ -27,11 +27,8 @@ Stem size depends on flag. */ -class Stem : public Item { +class Stem : public Item, public Staff_symbol_referencer { Drul_array<Real> yextent_drul_; - - /// needed for determining direction/length - int staff_size_i_; /**extent of the stem (positions). fractional, since Beam has to adapt them. @@ -60,9 +57,6 @@ public: */ Beam* beam_l_; - /// our slur (urg) - Slur* slur_l_; - Drul_array<int> beams_i_drul_; /// maximum number of beams @@ -76,10 +70,6 @@ public: /// direction of the beam Direction beam_dir_; - - /// what staff am i on? - Staff_symbol* staff_sym_l_; - Stem (); /// ensure that this Stem also encompasses the Notehead #n# diff --git a/lily/include/symbols.hh b/lily/include/symbols.hh new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/lily/include/symbols.hh @@ -0,0 +1 @@ + diff --git a/lily/include/text-spanner.hh b/lily/include/text-spanner.hh index b63dc5a52d..0cc7b4f9e4 100644 --- a/lily/include/text-spanner.hh +++ b/lily/include/text-spanner.hh @@ -12,7 +12,10 @@ #include "text-def.hh" /** a spanner which puts texts on top of other spanners. Use for - triplets, volta, ottava, etc. */ + triplets, volta, ottava, etc. + + (does anyone use this? Junkme?) +*/ class Text_spanner : public Spanner { public: Directional_spanner * support_span_l_; diff --git a/lily/item.cc b/lily/item.cc index 9a8d10aea4..c1a8812ce8 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -15,27 +15,22 @@ Item::Item () { - unbroken_original_l_ =0; - break_priority_i_ = 0; - breakable_b_ = false; - break_status_dir_ = CENTER; broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0; } bool Item::breakable_b () const { - return !unbroken_original_l_ - && dynamic_cast<Item*> (parent_l (X_AXIS))->breakable_b (); + if (original_l_ ) + return false; + + Item * i =dynamic_cast<Item*> (parent_l (X_AXIS)); + return (i) ? i->breakable_b () : get_elt_property( breakable_scm_sym) != SCM_BOOL_F; } void Item::do_print() const { -#ifndef NPRINT - DOUT << "breakable_b_: " << breakable_b_ << - " break_status_dir_: " << break_status_dir_; -#endif } @@ -54,11 +49,6 @@ Item::line_l() const return dynamic_cast<Score_element *> (g)-> line_l (); } -Direction -Item::break_status_dir() const -{ - return break_status_dir_; -} void Item::copy_breakable_items() @@ -73,8 +63,6 @@ Item::copy_breakable_items() { Score_element * dolly = clone(); Item * item_p = dynamic_cast<Item*>(dolly); - item_p->unbroken_original_l_ = this; - item_p->break_status_dir_ = i; pscore_l_->typeset_element (item_p); new_copies[i] =item_p; } @@ -93,10 +81,10 @@ Item::copy_breakable_items() void Item::try_visibility_lambda () { - SCM vis = get_elt_property (ly_symbol ("visibility_lambda")); + SCM vis = remove_elt_property (visibility_lambda_scm_sym); if (vis != SCM_BOOL_F) { - SCM args = scm_listify (gh_int2scm (break_status_dir_), SCM_UNDEFINED); + SCM args = scm_listify (gh_int2scm (break_status_dir ()), SCM_UNDEFINED); SCM result = gh_apply ( SCM_CDR(vis), args); int trans = gh_scm2bool (gh_car (result)); int empty = gh_scm2bool (gh_cdr (result)); @@ -104,7 +92,7 @@ Item::try_visibility_lambda () if (empty) set_empty (true); if (trans) - transparent_b_ = true; + set_elt_property (transparent_scm_sym, SCM_BOOL_T); } } @@ -153,10 +141,16 @@ Item::find_prebroken_piece (Direction d) const void Item::handle_prebroken_dependencies() { - if (breakable_b_) + if (original_l_) Score_element::handle_prebroken_dependencies(); } +bool +Item::broken_original_b () const +{ + return broken_to_drul_[LEFT] || broken_to_drul_[RIGHT]; +} + int Item::left_right_compare(Item const *l, Item const *r) { @@ -165,15 +159,6 @@ Item::left_right_compare(Item const *l, Item const *r) return p1->rank_i () - p2->rank_i (); } - -bool -Item::linked_b() const -{ - return Score_element::linked_b() || attached_span_l_arr_.size(); -} - - - Paper_column * Item::column_l () const { @@ -183,12 +168,7 @@ Item::column_l () const Item::Item (Item const &s) : Score_element (s) { - unbroken_original_l_ = 0; - /* do not copy attached_span_l_arr_ */ - breakable_b_ = s.breakable_b_; broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] =0; - break_status_dir_ = s.break_status_dir_; - break_priority_i_ = s.break_priority_i_; } @@ -204,11 +184,25 @@ Item::handle_prebroken_dependents () Direction d = LEFT; do { - broken_to_drul_[d]->dim_cache_[X_AXIS].parent_l_ = - &parent->broken_to_drul_[d]->dim_cache_[X_AXIS]; - parent->broken_to_drul_[d]->add_dependency (broken_to_drul_[d]); + Item * broken_self = find_prebroken_piece (d); + Item * broken_parent = parent->find_prebroken_piece (d); + + broken_self->dim_cache_[X_AXIS].parent_l_ = + &broken_parent->dim_cache_[X_AXIS]; } while ((flip (&d))!=LEFT); } } +Direction +Item::break_status_dir () const +{ + if (original_l_) + { + Item * i = dynamic_cast<Item*> (original_l_); + + return (i->broken_to_drul_[LEFT] == this) ? LEFT : RIGHT; + } + else + return CENTER; +} diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index d64e90e812..248dca07c5 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -27,7 +27,7 @@ Key_engraver::create_key () if (!kit_p_) { kit_p_ = new Key_item; - kit_p_->break_priority_i_ = -1; // ugh + kit_p_->set_elt_property (break_priority_scm_sym, gh_int2scm(-1)); // ugh kit_p_->multi_octave_b_ = key_.multi_octave_b_; announce_element (Score_element_info (kit_p_,keyreq_l_)); diff --git a/lily/key-item.cc b/lily/key-item.cc index 695de425af..34061b6383 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -22,7 +22,7 @@ const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */ Key_item::Key_item () { multi_octave_b_ = false; - breakable_b_ =true; + set_elt_property (breakable_scm_sym, SCM_BOOL_T); default_b_ = false; set_c_position (0); } @@ -81,10 +81,10 @@ Molecule* Key_item::do_brew_molecule_p() const { Molecule*output = new Molecule; - Real inter = paper()->internote_f (); + Real inter = staff_line_leading_f ()/2.0; int j; - if ((break_status_dir_ == LEFT || break_status_dir_ == CENTER) + if ((break_status_dir () == LEFT || break_status_dir () == CENTER) || old_pitch_arr_.size ()) { for (int i =0; i < old_pitch_arr_.size(); i++) @@ -123,7 +123,7 @@ Key_item::do_brew_molecule_p() const if (pitch_arr_.size()) { Molecule m (lookup_l ()->fill (Box ( - Interval (0, paper()->note_width ()), + Interval (0, paper_l ()->note_width ()), Interval (0,0)))); output->add_at_edge (X_AXIS, RIGHT, m,0 ); @@ -138,7 +138,10 @@ Key_item::do_pre_processing() { if (default_b_) { - transparent_b_ = (break_status_dir() != RIGHT); - set_empty (transparent_b_); + bool transparent = (break_status_dir() != RIGHT); + set_empty (transparent); + + if (transparent) + set_elt_property (transparent_scm_sym, SCM_BOOL_T); } } diff --git a/lily/line-group-group-engraver.cc b/lily/line-group-group-engraver.cc index ef82282d55..4779cbfa13 100644 --- a/lily/line-group-group-engraver.cc +++ b/lily/line-group-group-engraver.cc @@ -6,7 +6,7 @@ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl> */ -#include "staff-sym.hh" +#include "staff-symbol.hh" #include "vertical-group-spanner.hh" #include "command-request.hh" #include "bar.hh" diff --git a/lily/line-of-score.cc b/lily/line-of-score.cc index ac6c0a10bb..d7fdfed7b6 100644 --- a/lily/line-of-score.cc +++ b/lily/line-of-score.cc @@ -13,15 +13,10 @@ #include "p-col.hh" #include "p-score.hh" - Line_of_score::Line_of_score() { - error_mark_b_ = 0; } - - - void Line_of_score::add_element (Score_element*e) { @@ -40,12 +35,9 @@ Line_of_score* Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) const { const Link_array<Paper_column> &curline (breaking[j].cols); - const Link_array<Paper_column> &errors (breaking[j].error_col_l_arr_); + const Array<Real> &config (breaking[j].config); - for (int i=0; i < errors.size(); i++) - errors[i]->error_mark_b_ = true; - Line_of_score *line_l=0; if (breaking.size() >1) diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index d035e5aa4d..4f64886489 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -51,9 +51,10 @@ Molecule* Local_key_item::do_brew_molecule_p() const { Molecule*output = new Molecule; - + Real note_distance = staff_line_leading_f ()/2; Molecule *octave_mol_p = 0; int lastoct = -100; + for (int i = 0; i < accidental_arr_.size(); i++) { Musical_pitch p (accidental_arr_[i].pitch_); @@ -62,7 +63,7 @@ Local_key_item::do_brew_molecule_p() const { if (octave_mol_p) { - Real dy =lastoct*7*paper()->internote_f (); + Real dy =lastoct*7* note_distance; octave_mol_p->translate_axis (dy, Y_AXIS); output->add_molecule (*octave_mol_p); delete octave_mol_p; @@ -73,7 +74,7 @@ Local_key_item::do_brew_molecule_p() const lastoct = p.octave_i_; Real dy = (c0_position_i_ + p.notename_i_) - * paper()->internote_f (); + * note_distance; Molecule m (lookup_l ()->accidental (p.accidental_i_, accidental_arr_[i].cautionary_b_)); @@ -83,7 +84,7 @@ Local_key_item::do_brew_molecule_p() const if (octave_mol_p) { - Real dy =lastoct*7*paper()->internote_f (); + Real dy =lastoct*7*note_distance; octave_mol_p->translate_axis (dy, Y_AXIS); output->add_molecule (*octave_mol_p); delete octave_mol_p; @@ -91,7 +92,7 @@ Local_key_item::do_brew_molecule_p() const if (accidental_arr_.size()) { - Box b(Interval (0, paper()->internote_f ()), Interval (0,0)); + Box b(Interval (0, note_distance), Interval (0,0)); Molecule m (lookup_l ()->fill (b)); output->add_at_edge (X_AXIS, RIGHT, m, 0); } diff --git a/lily/lookup.cc b/lily/lookup.cc index 07b57f0b9b..5bffa992cf 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -110,7 +110,7 @@ Lookup::afm_find (String s, bool warn) const if (cm.code () < 0) return m; - Atom at (gh_list (ly_symbol ("char"), + Atom at (gh_list (char_scm_sym, gh_int2scm (cm.code ()), SCM_UNDEFINED)); at.font_ = ly_symbol (font_name_.ch_C()); @@ -219,7 +219,7 @@ Lookup::beam (Real slope, Real width, Real thick) const Molecule m; Atom at - (gh_list (ly_symbol ("beam"), + (gh_list (beam_scm_sym, gh_double2scm (width), gh_double2scm (slope), gh_double2scm (thick), @@ -309,7 +309,7 @@ Lookup::rest (int j, bool o) const Molecule Lookup::rule_symbol (Real height, Real width) const { - Atom at (gh_list (ly_symbol ("rulesym"), + Atom at (gh_list (rulesym_scm_sym, gh_double2scm (height), gh_double2scm (width), SCM_UNDEFINED)); @@ -353,7 +353,7 @@ Lookup::filledbox (Box b ) const { Molecule m; - Atom at (gh_list (ly_symbol ("filledbox"), + Atom at (gh_list (filledbox_scm_sym, gh_double2scm (-b[X_AXIS][LEFT]), gh_double2scm (b[X_AXIS][RIGHT]), gh_double2scm (-b[Y_AXIS][DOWN]), @@ -447,7 +447,7 @@ Lookup::text (String style, String text) const m.dim_.y () = ydims; - Atom at (gh_list (ly_symbol ("text"), + Atom at (gh_list (text_scm_sym, gh_str02scm (text.ch_C()), SCM_UNDEFINED)); at.font_ = ly_symbol (style); @@ -486,7 +486,7 @@ Lookup::staff_brace (Real y) const { Molecule m; - Atom at (gh_list (ly_symbol ("pianobrace"), + Atom at (gh_list (pianobrace_scm_sym, gh_double2scm (y), SCM_UNDEFINED )); @@ -520,14 +520,14 @@ Molecule Lookup::plet (Real dy , Real dx, Direction dir) const { Molecule m; - SCM thick = ly_symbol ("tuplet_thick"); + SCM thick = tuplet_thick_scm_sym; Real t = 0.1 PT; if (paper_l_->scope_p_->elem_b (thick)) { t = paper_l_->get_realvar (thick); } - Atom at (gh_list(ly_symbol ("tuplet"), + Atom at (gh_list(tuplet_scm_sym, gh_double2scm (dx), gh_double2scm (dy), gh_double2scm (t), @@ -568,7 +568,7 @@ Molecule Lookup::staff_bracket (Real y) const { Molecule m; - Atom at ( gh_list (ly_symbol ("bracket"), + Atom at ( gh_list (bracket_scm_sym, gh_double2scm (y), SCM_UNDEFINED)); m.add_atom (&at); @@ -583,19 +583,19 @@ Molecule Lookup::volta (Real w, bool last_b) const { Molecule m; - SCM thick = ly_symbol ("volta_thick"); + SCM thick = volta_thick_scm_sym; Real t = 0.1 PT; if (paper_l_->scope_p_->elem_b (thick)) { t = paper_l_->get_realvar (thick); } - Atom at (gh_list (ly_symbol ("volta"), + Atom at (gh_list (volta_scm_sym, gh_double2scm (w), gh_double2scm (t), gh_int2scm (last_b), SCM_UNDEFINED)); - Real interline_f = paper_l_->interline_f (); + Real interline_f = paper_l_->get_realvar (interline_scm_sym); m.dim_[Y_AXIS] = Interval (-interline_f, interline_f); m.dim_[X_AXIS] = Interval (0, w); diff --git a/lily/ly-symbols.cc b/lily/ly-symbols.cc new file mode 100644 index 0000000000..719bf6dfba --- /dev/null +++ b/lily/ly-symbols.cc @@ -0,0 +1,31 @@ +/* + ly-symbols.cc -- implement scheme symbols + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl> + + */ +#include "lily-guile.hh" + +/* + storage + */ +#undef LY_SYMBOLS_HH +#define extern +#include "ly-symbols.hh" + +#undef DECLARE_LY_SYMBOL +#undef LY_SYMBOLS_HH +#define DECLARE_LY_SYMBOL(a) a ## _scm_sym = ly_symbol (#a); scm_permanent_object(a ## _scm_sym) + +/* + initialisations. + */ +void +init_symbols () +{ +#include "ly-symbols.hh" +} + + diff --git a/lily/main.cc b/lily/main.cc index 763c5e15b2..80dddad0d7 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -70,7 +70,7 @@ Long_option_init theopts[] = { {1, "include", 'I'}, {0, "no-paper", 'M'}, {0, "dependencies", 'd'}, - {0, "no-timestamps", 'T'}, + {0, "no-timestamps", 'T'}, // why do we have this option? {0, "find-old-relative", 'Q'}, {0, "ignore-version", 'V'}, {1, "output-format", 'f'}, @@ -251,6 +251,7 @@ main_prog (int argc, char **argv) /* need to do this first. Engravers use lily.scm contents. */ + init_symbols (); read_lily_scm_file ( "lily.scm"); cout << endl; diff --git a/lily/midi-item.cc b/lily/midi-item.cc index a753b7cc9f..9d09226f7e 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -425,11 +425,7 @@ Midi_note::str () const String str = to_str ((char)status_byte); str += to_str ((char) (pitch_i () + c0_pitch_i_c_)); -#if 0 - // poor man's staff dynamics: - str += to_str ((char) (dynamic_byte_ - 0x10 * channel_i_)); -#endif - + str += to_str ((char)dynamic_byte_); return str; } diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc index 3eb33c4e94..acbde20646 100644 --- a/lily/midi-walker.cc +++ b/lily/midi-walker.cc @@ -27,9 +27,10 @@ compare (Midi_note_event const& left, Midi_note_event const& right) } Midi_walker::Midi_walker (Audio_staff* audio_staff_l, Midi_track* track_l) - : PCursor<Audio_item*>(audio_staff_l->audio_item_l_list_) { track_l_ = track_l; + index_= 0; + item_l_arr_l_ = &audio_staff_l->audio_item_l_arr_; last_mom_ = 0; } @@ -45,7 +46,8 @@ Midi_walker::~Midi_walker() void Midi_walker::do_start_note (Midi_note* note_p) { - Moment stop_mom = note_p->length_mom () + ptr ()->audio_column_l_->at_mom (); + Audio_item* ptr = (*item_l_arr_l_)[index_]; + Moment stop_mom = note_p->length_mom () + ptr->audio_column_l_->at_mom (); for (int i=0; i < stop_note_queue.size(); i++) { if (stop_note_queue[i].val->pitch_i() == note_p->pitch_i ()) @@ -65,7 +67,7 @@ Midi_walker::do_start_note (Midi_note* note_p) e.key = stop_mom; stop_note_queue.insert (e); - output_event (ptr()->audio_column_l_->at_mom (), note_p); + output_event (ptr->audio_column_l_->at_mom (), note_p); } /** @@ -104,9 +106,10 @@ Midi_walker::output_event (Moment now_mom, Midi_item* l) void Midi_walker::process() { - do_stop_notes (ptr()->audio_column_l_->at_mom ()); + Audio_item* ptr = (*item_l_arr_l_)[index_]; + do_stop_notes (ptr->audio_column_l_->at_mom ()); - Midi_item* p = ptr()->midi_item_p (); + Midi_item* p = ptr->midi_item_p (); if (!p) return; p->channel_i_ = track_l_->number_i_; @@ -114,6 +117,16 @@ Midi_walker::process() if (Midi_note *mi = dynamic_cast<Midi_note*>(p)) do_start_note (mi); else - output_event (ptr()->audio_column_l_->at_mom (), p); + output_event (ptr->audio_column_l_->at_mom (), p); +} +bool +Midi_walker::ok () const +{ + return index_ <item_l_arr_l_->size (); +} +void +Midi_walker::operator ++(int) +{ + assert (ok()); + index_++; } - diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index 132f7f2b9b..37e3baa7ac 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -22,6 +22,8 @@ Multi_measure_rest_engraver::Multi_measure_rest_engraver () rest_moments_[START] = rest_moments_[STOP] =0; multi_measure_req_l_ = 0; + + lastrest_p_ =0; mmrest_p_ = 0; } diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 4c23334b7d..d161819a54 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -55,7 +55,7 @@ Multi_measure_rest::do_brew_molecule_p () const s = (lookup_l ()->rest (-4, 0)); } mol_p->add_molecule (s); - Real interline_f = paper ()->interline_f (); + Real interline_f = staff_line_leading_f (); if (measures_i_ == 1) { mol_p->translate_axis (interline_f, Y_AXIS); @@ -67,7 +67,7 @@ Multi_measure_rest::do_brew_molecule_p () const text.text_str_ = to_str (measures_i_); text.style_str_ = "number"; text.align_dir_ = CENTER; - Molecule s = text.get_molecule (paper (), UP); + Molecule s = text.get_molecule (paper_l (), UP); s.translate_axis (3.0 * interline_f, Y_AXIS); mol_p->add_molecule (s); } @@ -95,6 +95,7 @@ Multi_measure_rest::do_post_processing () void Multi_measure_rest::do_substitute_element_pointer (Score_element* o, Score_element* n) { + Staff_symbol_referencer::do_substitute_element_pointer (o,n); if (Item* c = dynamic_cast <Item*> (o)) column_arr_.substitute (c, dynamic_cast<Item*> (n)); } @@ -113,7 +114,7 @@ Multi_measure_rest::get_rods () const Array<Rod> a; Rod r; r.item_l_drul_ = spanned_drul_; - r.distance_f_ = paper ()->get_var ("mmrest_x_minimum"); + r.distance_f_ = paper_l ()->get_var ("mmrest_x_minimum"); a.push (r); return a; } diff --git a/lily/music-list.cc b/lily/music-list.cc index f836fb4485..0324d8af6c 100644 --- a/lily/music-list.cc +++ b/lily/music-list.cc @@ -11,13 +11,14 @@ #include "request.hh" #include "musical-request.hh" #include "main.hh" +#include "killing-cons.tcc" Moment Simultaneous_music::length_mom () const { Moment dur = 0; - for (iter (music_p_list_p_->top(), i); i.ok (); i++) - dur = dur >? i->length_mom (); + for (Cons<Music> *i = music_p_list_p_->head_; i; i = i->next_) + dur = dur >? i->car_->length_mom (); return dur; } @@ -25,8 +26,9 @@ Simultaneous_music::length_mom () const void Music_sequence::compress (Moment m) { - for (PCursor<Music*> i(music_p_list_p_->top()); i.ok (); i++) - i->compress (m); + + for (Cons<Music> *i = music_p_list_p_->head_; i; i = i->next_) + i->car_->compress (m); } Simultaneous_music::Simultaneous_music(Music_list *p) @@ -44,9 +46,9 @@ Moment Sequential_music::length_mom () const { Moment last=0; - for (iter (music_p_list_p_->top(), i); i.ok (); i++) + for (Cons<Music> *i = music_p_list_p_->head_; i; i = i->next_) { - last += i->length_mom (); + last += i->car_->length_mom (); } return last; } @@ -74,30 +76,13 @@ Music_list::do_relative_octave (Musical_pitch last, bool ret_first) { Musical_pitch retval; int count=0; - for (PCursor<Music*> i (top ()); i.ok (); i++) + for (Cons<Music> *i = head_; i ; i = i->next_) { - last = i->to_relative_octave (last); + last = i->car_->to_relative_octave (last); if (!count ++ ) retval = last; } - // hmmm -#if 0 - if (!ret_first && find_old_relative_b) - { - PCursor<Music*> b (bottom ()); - - if (b.ok ()) - { - String w = _("\\relative mode changed here, old value: "); - w += last.str (); - - b->warning (w); - retval = last; - } - } - -#endif if (!ret_first) retval = last; @@ -106,25 +91,22 @@ Music_list::do_relative_octave (Musical_pitch last, bool ret_first) Music_list::Music_list (Music_list const &s) - : Pointer_list<Music*> () + : Cons_list<Music> (s) { - for (PCursor<Music*> i(s.top()); i.ok (); i++) - add_music (i->clone()); + init_list (); + clone_killing_cons_list (*this, s.head_); } + void Music_list::add_music (Music*m_p) { if (!m_p) return; - bottom().add (m_p); + append (new Killing_cons<Music> (m_p, 0)); } - - - - Request_chord::Request_chord() : Simultaneous_music (new Music_list) { @@ -134,9 +116,9 @@ Request_chord::Request_chord() Musical_pitch Request_chord::to_relative_octave (Musical_pitch last) { - for (iter (music_p_list_p_->top(),i); i.ok (); i++) + for (Cons<Music> *i = music_p_list_p_->head_; i ; i = i->next_) { - if (Melodic_req *m= dynamic_cast <Melodic_req *> (i.ptr ())) + if (Melodic_req *m= dynamic_cast <Melodic_req *> (i->car_)) { Musical_pitch &pit = m->pitch_; pit.to_relative_octave (last); @@ -148,6 +130,5 @@ Request_chord::to_relative_octave (Musical_pitch last) Music_list::Music_list () - : Pointer_list<Music*> () { } diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index b4a63d39f4..394ca287b3 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -51,6 +51,10 @@ void Music_output_def::assign_translator (Translator*tp) { String s =tp->type_str_; + if (s.empty_b ()) + { + tp->warning (_("Interpretation context with empty type")); + } if (translator_p_dict_p_->elem_b (s)) delete translator_p_dict_p_->elem (s); @@ -98,7 +102,7 @@ Music_output_def::get_default_output () const { static SCM output_sym; if (!output_sym) - output_sym = scm_protect_object (ly_symbol ("output")); + output_sym = scm_protect_object (output_scm_sym); if (safe_global_b || !scope_p_->elem_b (output_sym)) return ""; Identifier * id = scope_p_->elem (output_sym); diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index 56f456723b..6f50bd56b7 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -26,16 +26,16 @@ Music_sequence::Music_sequence(Music_list *mlist_p) void Music_sequence::transpose (Musical_pitch rq) { - for (iter (music_p_list_p_->top(),i); i.ok (); i++) - i->transpose (rq); + for (Cons<Music> *i = music_p_list_p_->head_; i; i = i->next_) + i->car_->transpose (rq); } void Music_sequence::do_print() const { #ifndef NPRINT - for (iter (music_p_list_p_->top(),i); i.ok (); i++) - i->print(); + for (Cons<Music> *i = music_p_list_p_->head_; i; i = i->next_) + i->car_->print(); #endif } diff --git a/lily/note-column.cc b/lily/note-column.cc index 770157d073..28e4c011af 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -22,7 +22,6 @@ Note_column::rest_b () const Note_column::Note_column() { stem_l_ = 0; - h_shift_b_ = false; dir_ =CENTER; } diff --git a/lily/note-head.cc b/lily/note-head.cc index b779d0e8a6..9b53dc498e 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -19,8 +19,6 @@ Note_head::Note_head () { x_dir_ = CENTER; - staff_size_i_= 8; // UGH - steps_i_ = 0; position_i_ = 0; extremal_i_ = 0; } @@ -35,9 +33,6 @@ Note_head::do_pre_processing () dots_l_->position_i_ = position_i_; } - - - int Note_head::compare (Note_head *const &a, Note_head * const &b) { @@ -57,13 +52,13 @@ Molecule* Note_head::do_brew_molecule_p() const { Molecule*out = 0; - Paper_def *p = paper(); - Real inter_f = p->internote_f (); - + Paper_def *p = paper_l (); + Real inter_f = staff_line_leading_f ()/2; + int sz = lines_i ()-1; // ugh - int streepjes_i = abs (position_i_) < staff_size_i_/2 + int streepjes_i = abs (position_i_) < sz ? 0 - : (abs(position_i_) - staff_size_i_/2) /2; + : (abs(position_i_) - sz) /2; Molecule head; diff --git a/lily/p-col.cc b/lily/p-col.cc index 8edb8d4c91..4981cac342 100644 --- a/lily/p-col.cc +++ b/lily/p-col.cc @@ -59,9 +59,9 @@ Paper_column::do_print() const DOUT << "post: "; postbreak_l()->print(); } - if (break_status_dir_) + if (break_status_dir ()) { - DOUT << '\n' << ((break_status_dir_ == LEFT) ? "prebreak" : "postbreak"); + DOUT << '\n' << ((break_status_dir () == LEFT) ? "prebreak" : "postbreak"); DOUT << '\n'; } @@ -87,14 +87,15 @@ Paper_column::compare (Paper_column const &c1, Paper_column const &c2) Paper_column* Paper_column::prebreak_l() const { - return dynamic_cast<Paper_column*>(broken_to_drul_[LEFT]); + return dynamic_cast<Paper_column*>(find_prebroken_piece (LEFT)); } Paper_column* Paper_column::postbreak_l() const { - return dynamic_cast<Paper_column*>( broken_to_drul_[RIGHT]); + return dynamic_cast<Paper_column*>( find_prebroken_piece (RIGHT)); } + bool Paper_column::breakpoint_b() const { @@ -103,8 +104,6 @@ Paper_column::breakpoint_b() const Paper_column::Paper_column() { - used_b_ = false; - error_mark_b_ = false; line_l_=0; rank_i_ = -1; } @@ -115,11 +114,6 @@ Paper_column::line_l() const return line_l_; } -bool -Paper_column::used_b() const -{ - return linked_b(); -} @@ -136,9 +130,3 @@ Paper_column::preprocess () minimal_dists_arr_drul_[LEFT].sort (Column_rod::compare); minimal_dists_arr_drul_[RIGHT].sort (Column_rod::compare); } - -bool -Paper_column::breakable_b () const -{ - return breakable_b_; -} diff --git a/lily/p-score.cc b/lily/p-score.cc index 3d25f61739..0e12201fc5 100644 --- a/lily/p-score.cc +++ b/lily/p-score.cc @@ -153,10 +153,12 @@ Paper_score::remove_break_helpers () { Link_array<Score_element> to_remove; Link_array<Score_element> keep; + SCM help_sym = break_helper_only_scm_sym; for (int i=0; i < elem_p_arr_.size (); i++) { Score_element*e = elem_p_arr_[i]; - if (e->break_helper_only_b_) + SCM p = e->get_elt_property (help_sym); + if (p != SCM_BOOL_F) to_remove.push (e); else keep.push (e); @@ -168,7 +170,8 @@ Paper_score::remove_break_helpers () { Spanner *s = span_p_arr_[i]; Score_element *e = s; - if (e->break_helper_only_b_) + SCM p = e->get_elt_property (break_helper_only_scm_sym); + if (p != SCM_BOOL_F) to_remove.push (e); else keeps.push (s); @@ -305,7 +308,7 @@ Paper_score::broken_col_range (Item const*l, Item const*r) const while (start < stop) { Paper_column *c = col_l_arr_[start]; - if (c->breakable_b_ && !c->line_l_) + if (c->breakable_b () && !c->line_l_) ret.push (c); start++; } diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 68d95c238b..1b6c36fecd 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -23,12 +23,6 @@ #include "paper-stream.hh" -#define SCMVAR(s) { static SCM sym; \ - if (!sym)\ - sym = scm_protect_object (ly_symbol (#s));\ - return get_realvar (sym); } - - Paper_def::Paper_def () { lookup_p_tab_p_ = new Hash_table<int, Lookup*>; @@ -60,6 +54,34 @@ Paper_def::Paper_def (Paper_def const&s) } } +SCM +Paper_def::get_scm_var (SCM s) const +{ + if (!scope_p_->elem_b (s)) + return SCM_BOOL_F; + + Identifier * id = scope_p_->elem (s); + + SCM z; + SCM_NEWCELL (z); + SCM_SETCAR(z, s); + + SCM val; + + if (dynamic_cast<Real_identifier*> (id)) + { + Real r = *id->access_content_Real (false); + val = gh_double2scm (r); + } + else + { + return SCM_BOOL_F; + } + + SCM_SETCDR(z,val); + return z; +} + Real Paper_def::get_var (String s) const { @@ -99,13 +121,13 @@ Paper_def::line_dimensions_int (int n) const Real Paper_def::beam_thickness_f () const { -SCMVAR(beam_thickness); + return get_realvar (beam_thickness_scm_sym); } Real Paper_def::linewidth_f () const { -SCMVAR(linewidth); + return get_realvar (linewidth_scm_sym); } Real @@ -149,49 +171,37 @@ Paper_def::set_lookup (int i, Lookup*l) Real -Paper_def::interline_f () const -{ - SCMVAR(interline) -} - -Real Paper_def::rule_thickness () const { - SCMVAR(rulethickness); + return get_realvar (rulethickness_scm_sym); } Real Paper_def::staffline_f () const { - SCMVAR(rulethickness) -} + return get_realvar (rulethickness_scm_sym); + } Real Paper_def::staffheight_f () const { - SCMVAR(staffheight) -} + return get_realvar (staffheight_scm_sym); + } Real Paper_def::interbeam_f (int multiplicity_i) const { if (multiplicity_i <= 3) - SCMVAR(interbeam) - else - SCMVAR(interbeam4) -} - -Real -Paper_def::internote_f () const -{ - return interline_f () /2.0 ; -} + return get_realvar (interbeam_scm_sym); + else + return get_realvar (interbeam4_scm_sym); + } Real Paper_def::note_width () const { -SCMVAR(notewidth) -} + return get_realvar (notewidth_scm_sym); + } void Paper_def::print () const @@ -248,12 +258,6 @@ Paper_def::paper_outputter_p (Paper_stream* os_p, Header* header_l, String origi if (scope_p_) p->output_scope (scope_p_, "mudelapaper"); -#if 0 - if (output_global_ch == String("tex")) - { - *p->outstream_l_ << *scope_p_->elem ("texsetting")->access_content_String (false); - } -#endif *p->outstream_l_ << *scope_p_->elem (String (output_global_ch) + "setting")->access_content_String (false); diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index c221cbb2dd..9e46701ceb 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -41,18 +41,6 @@ Paper_outputter::~Paper_outputter () void Paper_outputter::output_header () { -#if 0 - int gobble = 10000; - {// alloc big chunk of memory. - SCM beg = SCM_EOL; - String bigstr = String_convert::char_str (' ', 50); - for (int i = gobble; i--; ) - { - beg = gh_cons (gh_str02scm (bigstr.ch_C()), beg); - } - } -#endif - if (safe_global_b) { ly_set_scm ("security-paranoia", SCM_BOOL_T); @@ -90,7 +78,7 @@ Paper_outputter::output_header () } #endif - SCM scm = gh_cons (ly_symbol ("header"), args_scm); + SCM scm = gh_cons (header_scm_sym, args_scm); output_scheme (scm); } @@ -131,7 +119,7 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm) } SCM box_scm - = gh_list (ly_symbol ("placebox"), + = gh_list (placebox_scm_sym, gh_double2scm (a_off.x ()), gh_double2scm (a_off.y ()), SCM(i->func_), @@ -223,7 +211,9 @@ Paper_outputter::output_version () id_str += "."; else id_str += String (", ") + version_str (); - output_String_def ( "LilyIdString", id_str); + + output_String_def ( "mudelatagline", id_str); + output_String_def ( "LilyPondVersion", version_str ()); } void diff --git a/lily/parser.yy b/lily/parser.yy index 0e94082cc2..7e53b2ac00 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -444,7 +444,9 @@ identifier_init: translator_spec_block: TRANSLATOR '{' translator_spec_body '}' - { $$ = $3; } + { + $$ = $3; + } ; translator_spec_body: @@ -1282,8 +1284,8 @@ mudela_script: script_dir: '_' { $$ = DOWN; } - | '^' { $$ = CENTER; } - | '-' { $$ = UP; } + | '^' { $$ = UP; } + | '-' { $$ = CENTER; } ; pre_requests: diff --git a/lily/performance.cc b/lily/performance.cc index e10a51c229..130cd4a2ec 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -29,12 +29,6 @@ Performance::Performance () audio_elem_p_list_ = 0; } -void -Performance::add_column (Audio_column* p) -{ - p->performance_l_ = this; - add_element (p); -} Performance::~Performance() { @@ -51,18 +45,19 @@ Performance::output (Midi_stream& midi_stream) midi_stream << Midi_header (1, tracks_i, clocks_per_4_i); output_header_track (midi_stream); - int n = 1; + int channel = 1; for (int i =0; i < audio_staff_l_arr_.size (); i++) { Audio_staff *s = audio_staff_l_arr_[i]; + /* Aargh, let's hear it for the MIDI standard. MIDI players tend to ignore instrument settings on channel 10, the percussion channel by default. */ - if (n == 10) - n++; - s->output (midi_stream, n++); + if (channel == 10) + channel++; + s->output (midi_stream, channel++); } } @@ -111,14 +106,16 @@ Performance::output_header_track (Midi_stream& midi_stream) } void -Performance::add_staff (Audio_staff* l) -{ - audio_staff_l_arr_.push (l); -} - -void Performance::add_element (Audio_element *p) { + if (Audio_staff*s=dynamic_cast<Audio_staff *> (p)) + { + audio_staff_l_arr_.push (s); + } + else if (Audio_column *c = dynamic_cast<Audio_column*>(p)) + { + c->performance_l_ = this; + } audio_elem_p_list_ = new Killing_cons<Audio_element> (p, audio_elem_p_list_); } diff --git a/lily/priority-halign-engraver.cc b/lily/priority-halign-engraver.cc deleted file mode 100644 index 3f19e66551..0000000000 --- a/lily/priority-halign-engraver.cc +++ /dev/null @@ -1,50 +0,0 @@ -/* - score-halign-reg.cc -- implement Priority_horizontal_align_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl> -*/ - -#include "bar.hh" -#include "break-align-item.hh" -#include "priority-halign-engraver.hh" -#include "score-priority-engraver.hh" - -Priority_horizontal_align_engraver::Priority_horizontal_align_engraver() -{ - halign_p_ =0; -} - -void -Priority_horizontal_align_engraver::do_pre_move_processing() -{ - if (halign_p_) - { - typeset_element (halign_p_); - halign_p_ =0; - } -} - -void -Priority_horizontal_align_engraver::acknowledge_element (Score_element_info i) -{ - Engraver* reg = i.origin_grav_l_arr_[0]; - if (dynamic_cast<Score_priority_engraver *> (reg)) - { - if (!halign_p_) - { - halign_p_ = new Break_align_item; - halign_p_->breakable_b_ = true; - announce_element (Score_element_info (halign_p_,0)); - } - Item * it = dynamic_cast <Item *> (i.elem_l_); - if (it->break_priority_i_ == 0) - halign_p_->center_l_ = it; - - halign_p_->add_item (it, it->break_priority_i_); - } -} - - -ADD_THIS_TRANSLATOR(Priority_horizontal_align_engraver); diff --git a/lily/repeat-engraver.cc b/lily/repeat-engraver.cc index 774c2d3533..174737d34f 100644 --- a/lily/repeat-engraver.cc +++ b/lily/repeat-engraver.cc @@ -20,12 +20,16 @@ #include "note-column.hh" #include "paper-def.hh" + ADD_THIS_TRANSLATOR (Repeat_engraver); Repeat_engraver::Repeat_engraver () { } +/* + urg. Way too complicated. needs redesign. + */ bool Repeat_engraver::do_try_music (Music* m) { @@ -41,9 +45,9 @@ Repeat_engraver::do_try_music (Music* m) Moment alt_mom = now_mom () + repeat_length_mom; if (repeat_length_mom) { - for (PCursor<Music*> i (alt->music_p_list_p_->top ()); i.ok () && (i != alt->music_p_list_p_->bottom ()); i++) + for (Cons<Music> *i (alt->music_p_list_p_->head_); i && i->next_; i = i->next_) { - stop_mom += i->length_mom (); + stop_mom += i->car_->length_mom (); if (dynamic_cast<Simultaneous_music *> (alt)) break; } @@ -66,23 +70,24 @@ Repeat_engraver::do_try_music (Music* m) Scalar prop = get_property ("voltaSpannerDuration", 0); if (prop.length_i ()) span_mom = prop.to_rat (); - int alt_i = r->repeats_i_ + 1 - alt->music_p_list_p_->size () >? 1; - for (PCursor<Music*> i (alt->music_p_list_p_->top ()); i.ok (); i++) + + int alt_i = r->repeats_i_ + 1 - cons_list_size_i (alt->music_p_list_p_->head_ ) >? 1; + for (Cons<Music> *i = alt->music_p_list_p_->head_; i ; i = i->next_) { - alternative_music_arr_.push (i.ptr ()); + alternative_music_arr_.push (i->car_); alternative_start_mom_arr_.push (alt_mom); if (span_mom) alternative_stop_mom_arr_.push (alt_mom + span_mom); else - alternative_stop_mom_arr_.push (alt_mom + i->length_mom ()); + alternative_stop_mom_arr_.push (alt_mom + i->car_->length_mom ()); String str; - if ((alt_i != 1) && (alt_i != r->repeats_i_) && (i == alt->music_p_list_p_->top ())) + if ((alt_i != 1) && (alt_i != r->repeats_i_) && (i == alt->music_p_list_p_->head_)) str = "1.-"; str += to_str (alt_i) + "."; alt_i++; alternative_str_arr_.push (str); if (!dynamic_cast<Simultaneous_music *> (alt)) - alt_mom += i->length_mom (); + alt_mom += i->car_->length_mom (); } return true; } diff --git a/lily/request-iterator.cc b/lily/request-iterator.cc index d982503dfe..ca103ee062 100644 --- a/lily/request-iterator.cc +++ b/lily/request-iterator.cc @@ -63,17 +63,17 @@ Request_chord_iterator::do_process_and_next (Moment mom) { if (first_b_) { - for (PCursor<Music*> i (elt_l ()->music_p_list_p_->top ()); i.ok(); i++) + for (Cons<Music> *i = elt_l ()->music_p_list_p_->head_; i; i = i->next_) { - if (Request * req_l = dynamic_cast<Request*> (i.ptr())) + if (Request * req_l = dynamic_cast<Request*> (i->car_)) { bool gotcha = report_to_l()->try_music (req_l); if (!gotcha) req_l->warning (_f ("junking request: `%s\'", classname( req_l))); } else - i.ptr ()->warning (_f ("Huh? Not a Request: `%s\'", - classname (i.ptr()))); + i->car_->warning (_f ("Huh? Not a Request: `%s\'", + classname (i->car_))); } first_b_ = false; } diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 4db7d52d67..cd64e140c6 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -77,7 +77,9 @@ Rest_collision::do_pre_processing() // UGH Should get dims from table! int size_i = 6; - Real internote_f = paper ()->internote_f (); + + // staff ref'd? + Real internote_f = paper_l ()->get_realvar (interline_scm_sym)/2.0; int sep_i = 3 + size_i / 2; for (int i = 0; i < ncol_l_arr_.size(); i++) { @@ -116,6 +118,6 @@ Rest_collision::do_substitute_element_pointer (Score_element*o,Score_element*n) Rest_collision::Rest_collision() { - transparent_b_ = true; + set_elt_property (transparent_scm_sym, SCM_BOOL_T); set_empty (true); } diff --git a/lily/rest.cc b/lily/rest.cc index 58ad47a062..50eed01303 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -37,13 +37,12 @@ Rest::Rest () Molecule * Rest::do_brew_molecule_p () const { - int staff_size_i_ = 8; - bool streepjes_b = abs(position_i_) > staff_size_i_ /2 && + bool streepjes_b = abs(position_i_) > lines_i () / 2 && (balltype_i_ == 0 || balltype_i_ == 1); Molecule s(lookup_l ()->rest (balltype_i_, streepjes_b)); Molecule * m = new Molecule ( Molecule (s)); - m->translate_axis (position_i_ * paper ()->internote_f (), Y_AXIS); + m->translate_axis (position_i_ * staff_line_leading_f ()/2.0, Y_AXIS); return m; } diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index 49acc59c38..ec90bcfdb4 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -96,9 +96,12 @@ Rhythmic_column_engraver::do_pre_move_processing() { if (ncol_p_) { - if (! ncol_p_->h_shift_b_) - // egcs - ncol_p_->h_shift_b_ = get_property ("hshift", 0).operator bool (); + // egcs + if (get_property ("hshift", 0).operator bool ()) + { + ncol_p_->set_elt_property (horizontal_shift_scm_sym, SCM_BOOL_T); + } + if (! ncol_p_->dir_) ncol_p_->dir_ =(Direction) int(get_property ("ydirection", 0)); diff --git a/lily/score-element.cc b/lily/score-element.cc index 1cd16cdfbd..21989d59a3 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -23,32 +23,39 @@ #include "misc.hh" #include "paper-outputter.hh" +Interval +Score_element::dim_cache_callback (Dimension_cache*c) +{ + Score_element * e =dynamic_cast<Score_element*>( c->element_l()); + if(&e->dim_cache_[X_AXIS] == c) + return e->do_width (); + else + return e->do_height (); +} + Score_element::Score_element() { output_p_ =0; - break_helper_only_b_ = false; - transparent_b_ = false; + dim_cache_[X_AXIS].set_callback (dim_cache_callback); + dim_cache_[Y_AXIS].set_callback (dim_cache_callback); + used_b_ = false; pscore_l_=0; + lookup_l_ =0; status_i_ = 0; + original_l_ = 0; element_property_alist_ = SCM_EOL; } Score_element::Score_element (Score_element const&s) - : Graphical_element (s) + : Graphical_element (s) { - /* called from derived ctor, so most info points to the same deps - as (Directed_graph_node&)s. Nobody points to us, so don't copy - dependents. - */ - - - // deep copy ? - element_property_alist_ = s.element_property_alist_; + used_b_ = true; + original_l_ =(Score_element*) &s; + element_property_alist_ = scm_list_copy (s.element_property_alist_); dependency_arr_ = s.dependency_arr_; output_p_ =0; - break_helper_only_b_ = s.break_helper_only_b_; - transparent_b_ = s.transparent_b_; status_i_ = s.status_i_; + lookup_l_ = s.lookup_l_; pscore_l_ = s.pscore_l_; } @@ -74,10 +81,24 @@ Score_element::dependency_size () const SCM -Score_element::get_elt_property (SCM s) +Score_element::get_elt_property (SCM sym) const { - return scm_assq(s, element_property_alist_); + SCM s = scm_assq(sym, element_property_alist_); + // is this a good idea? + if (s == SCM_BOOL_F && pscore_l_) + s = pscore_l_->paper_l_->get_scm_var (sym); + + return s; +} + +SCM +Score_element::remove_elt_property (SCM key) +{ + SCM s = get_elt_property (key); + element_property_alist_ = scm_assq_remove_x (element_property_alist_, key); + return s; } + void Score_element::set_elt_property (SCM s, SCM v) { @@ -131,20 +152,27 @@ Score_element::print() const Paper_def* -Score_element::paper() const +Score_element::paper_l () const { - return pscore_l_->paper_l_; + return pscore_l_->paper_l_; } Lookup const * Score_element::lookup_l () const { - SCM sz = scm_assq (ly_symbol ("fontsize"), element_property_alist_); - if (sz != SCM_BOOL_F) - return pscore_l_->paper_l_->lookup_l (gh_scm2int (SCM_CDR (sz))); - else - return pscore_l_->paper_l_->lookup_l (0); + if (!lookup_l_) + { + Score_element * me = (Score_element*)this; + SCM sz = me->remove_elt_property (fontsize_scm_sym); + int i = (sz != SCM_BOOL_F) + ? gh_scm2int (SCM_CDR (sz)) + : 0; + + + me->lookup_l_ = pscore_l_->paper_l_->lookup_l (i); + } + return lookup_l_; } void @@ -170,8 +198,8 @@ Score_element::calculate_dependencies (int final, int busy, assert (status_i_!= busy); status_i_= busy; - for (int i=0; i < dependency_size(); i++) - dependency (i)->calculate_dependencies (final, busy, funcptr); + for (int i=0; i < dependency_arr_.size(); i++) + dependency_arr_[i]->calculate_dependencies (final, busy, funcptr); Link_array<Score_element> extra (get_extra_dependencies()); for (int i=0; i < extra.size(); i++) @@ -186,8 +214,9 @@ Score_element::calculate_dependencies (int final, int busy, void Score_element::output_processing () { - if (transparent_b_) + if (get_elt_property (transparent_scm_sym) != SCM_BOOL_F) return; + if (output_p_) delete output_p_; @@ -197,6 +226,7 @@ Score_element::output_processing () classname(this)); } + /* VIRTUAL STUBS @@ -275,7 +305,10 @@ void Score_element::add_dependency (Score_element*e) { if (e) - dependency_arr_.push (e); + { + dependency_arr_.push (e); + e->used_b_ = true; + } else warning("Null dependency added"); @@ -305,7 +338,8 @@ Score_element::handle_broken_dependencies() Spanner * broken = sp->find_broken_piece (line); substitute_dependency (sp, broken); - add_dependency (broken); + if (broken) + add_dependency (broken); } else if (Item *original = dynamic_cast <Item *> (elt)) { @@ -341,16 +375,20 @@ Score_element::handle_broken_dependencies() void Score_element::handle_prebroken_dependencies() { + /* dynamic_cast<Item*> (this) && + if (!break_status_dir ()) + return; + */ Link_array<Score_element> old_arr, new_arr; for (int i=0; i < dependency_size(); i++) { Score_element * elt = dependency (i); Item *it_l = dynamic_cast <Item *> (elt); - if (it_l && it_l->breakable_b_) + if (it_l && it_l->broken_original_b ()) if (Item *me = dynamic_cast<Item*> (this) ) { - Score_element *new_l = it_l->find_prebroken_piece (me->break_status_dir_); + Score_element *new_l = it_l->find_prebroken_piece (me->break_status_dir ()); if (new_l != elt) { new_arr.push (new_l); @@ -359,10 +397,11 @@ Score_element::handle_prebroken_dependencies() } else { - new_arr.push (it_l->broken_to_drul_[LEFT]); - old_arr.push (0); - old_arr.push (0); - new_arr.push (it_l->broken_to_drul_[RIGHT]); + Direction d = LEFT; + do { + old_arr.push (0); + new_arr.push (it_l->find_prebroken_piece (d)); + } while (flip(&d)!= LEFT); } } @@ -388,9 +427,9 @@ Score_element::get_extra_dependencies() const bool Score_element::linked_b() const { - return get_extra_dependencies().size() || - dependency_size(); + return used_b_; } + void Score_element::do_print () const { diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 6ea06ff8f2..12f762e36a 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -53,8 +53,8 @@ void Score_engraver::do_creation_processing() { scoreline_l_ = pscore_p_->line_l_; - scoreline_l_->set_bounds(LEFT,get_staff_info().command_pcol_l ()); - command_column_l_->breakable_b_ = true; + scoreline_l_->set_bounds(LEFT,command_column_l_); + command_column_l_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); Engraver_group_engraver::do_creation_processing(); } @@ -62,8 +62,8 @@ void Score_engraver::do_removal_processing() { Engraver_group_engraver::do_removal_processing(); - scoreline_l_->set_bounds(RIGHT,get_staff_info().command_pcol_l ()); - command_column_l_->breakable_b_ = true; + scoreline_l_->set_bounds(RIGHT,command_column_l_); + command_column_l_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); typeset_all (); set_columns (0,0); @@ -150,7 +150,8 @@ Score_engraver::typeset_all() pscore_p_->typeset_element (item_p); if (!item_p->parent_l (X_AXIS)) { - if (item_p->breakable_b_) + bool br = (item_p->remove_elt_property (breakable_scm_sym) != SCM_BOOL_F); + if (br) command_column_l_->add_element(item_p); else musical_column_l_->add_element(item_p); @@ -166,7 +167,7 @@ Score_engraver::do_pre_move_processing() { if (break_penalty_i_ > Break_req::DISALLOW) { - get_staff_info().command_pcol_l ()-> breakable_b_ = true; + command_column_l_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); breaks_i_ ++; if (! (breaks_i_%8)) *mlog << "[" << breaks_i_ << "]" << flush; diff --git a/lily/score-performer.cc b/lily/score-performer.cc index b06e4286e2..4729fc302e 100644 --- a/lily/score-performer.cc +++ b/lily/score-performer.cc @@ -39,10 +39,6 @@ Score_performer::play (Audio_element * p) { audio_column_l_->add_audio_item (i); } - else if (Audio_staff*s=dynamic_cast<Audio_staff *> (p)) - { - performance_p_->add_staff (s); - } performance_p_->add_element (p); } @@ -51,7 +47,7 @@ Score_performer::prepare (Moment m) { Global_translator::prepare (m); audio_column_l_ = new Audio_column (m); - performance_p_->add_column (audio_column_l_); + play (audio_column_l_); post_move_processing (); } diff --git a/lily/score-priority-engraver.cc b/lily/score-priority-engraver.cc index 8dccfb524b..0ed5caee1d 100644 --- a/lily/score-priority-engraver.cc +++ b/lily/score-priority-engraver.cc @@ -16,30 +16,61 @@ Score_priority_engraver::Score_priority_engraver() { - align_p_tab_.hash_func_ = int_hash; + halign_p_ = 0; } void Score_priority_engraver::do_pre_move_processing() { - for (Hash_table_iter<int, Horizontal_group_item*> i(align_p_tab_); - i.ok() ; i++) + for (int i=0; i < column_p_arr_.size ();i++) + typeset_element (column_p_arr_[i]); + column_p_arr_.clear (); + + if (halign_p_) { - if (i.val ()) - { - typeset_element (i.val ()); - i.val_ref () = 0; - } + typeset_element (halign_p_); + halign_p_ =0; } - align_p_tab_.clear (); + +} + +void +Score_priority_engraver::add_horizontal_group (Item* it, int priority) +{ + if (!halign_p_) + { + halign_p_ = new Break_align_item; + halign_p_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); + announce_element (Score_element_info (halign_p_,0)); + } + + if (priority == 0) + halign_p_->center_l_ = it; + + halign_p_->add_item (it, priority); + + column_p_arr_.push (it); } void Score_priority_engraver::acknowledge_element (Score_element_info inf) { - Item * item_l = dynamic_cast <Item *> (inf.elem_l_); - if (item_l && item_l->breakable_b_ && !item_l->empty_b ()) + if (Item * item_l = dynamic_cast <Item *> (inf.elem_l_)) { + Dimension_cache * c = &item_l->dim_cache_[X_AXIS]; + if (c->empty_b () || c->parent_l_) + return; + + SCM pr = item_l->remove_elt_property (break_priority_scm_sym); + + if (pr == SCM_BOOL_F) + return; + + bool breakable = (item_l->remove_elt_property (breakable_scm_sym) != SCM_BOOL_F); + if (!breakable) + return ; + + int priority = SCM_CDR (pr); /* Don't try to eat up our (probable) parent. */ @@ -48,38 +79,25 @@ Score_priority_engraver::acknowledge_element (Score_element_info inf) return; - int priority =item_l->break_priority_i_; - Horizontal_group_item * hg =0; - if (!align_p_tab_.elem_b(priority)) + Score_element * column_l = 0; + if (halign_p_) + column_l = halign_p_->get_elt_by_priority (priority); + Horizontal_group_item * hg; + if (column_l) { - hg = new Horizontal_group_item; - announce_element (Score_element_info (hg,0)); - align_p_tab_[priority] = hg; - hg->break_priority_i_ = priority; - hg->breakable_b_ = true; + hg = dynamic_cast<Horizontal_group_item*> (column_l); } else - hg = align_p_tab_[priority]; - - Score_element * unbound_elem = inf.elem_l_; - - /* - ugh - */ - while (unbound_elem->parent_l (X_AXIS)) { - /* We might have added inf.elem_l_ earlier because we added one - of its children. We don't want to add ourselves to ourself - */ - Graphical_element * e = unbound_elem->parent_l (X_AXIS); - if (e == hg) - return; - unbound_elem = dynamic_cast<Score_element*> (e); + hg = new Horizontal_group_item; + announce_element (Score_element_info (hg,0)); + add_horizontal_group (hg, priority); + hg->set_elt_property (breakable_scm_sym, SCM_BOOL_T); } + - hg->add_element (unbound_elem); + hg->add_element (item_l); } } - ADD_THIS_TRANSLATOR(Score_priority_engraver); diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 921b43c0e7..247eea7516 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -8,7 +8,7 @@ #include "script.hh" #include "musical-request.hh" #include "stem.hh" -#include "staff-sym.hh" +#include "staff-symbol.hh" #include "general-script-def.hh" #include "text-def.hh" @@ -54,13 +54,17 @@ Script_engraver::do_process_requests() void Script_engraver::do_pre_move_processing() { - Staff_symbol* s_l = get_staff_info().staff_sym_l_; for (int i=0; i < script_p_arr_.size(); i++) { Script*script_p = script_p_arr_[i]; + + /* + UGH. inside_b () for scripts broken for now. + if (!script_p->specs_p_->inside_b()) script_p->add_support (s_l); - + */ + if (Text_def*td_l = dynamic_cast<Text_def *> (script_p->specs_p_)) // UGH { if (!td_l->style_str_.length_i ()) @@ -69,6 +73,7 @@ Script_engraver::do_pre_move_processing() if (style.to_bool ()) td_l->style_str_= style; } + // urg, what if this is already set? in-band signaling... Scalar alignment = get_property ("textalignment", 0); if (alignment.isnum_b()) diff --git a/lily/script.cc b/lily/script.cc index 82393d9ff4..576a9fdb9b 100644 --- a/lily/script.cc +++ b/lily/script.cc @@ -44,7 +44,6 @@ Script::Script () axis_ = Y_AXIS; specs_p_ = 0; stem_l_ = 0; - postbreak_only_b_ = true; dir_ = CENTER; } @@ -73,19 +72,13 @@ Script::set_default_dir () Interval Script::do_width () const { - return specs_p_->get_molecule (paper (), dir_).extent ().x (); + return specs_p_->get_molecule (paper_l (), dir_).extent ().x (); } void Script::do_pre_processing () { Staff_side::do_pre_processing (); - if (breakable_b_ && postbreak_only_b_ && (break_status_dir () != RIGHT)) - { - transparent_b_ = true; - set_empty (true); - } - if (axis_ == Y_AXIS && !dir_) set_default_dir (); } @@ -93,7 +86,7 @@ Script::do_pre_processing () Interval Script::symbol_height () const { - return specs_p_->get_molecule (paper (), dir_).extent ().y (); + return specs_p_->get_molecule (paper_l (), dir_).extent ().y (); } @@ -102,14 +95,14 @@ Script::do_brew_molecule_p () const { Real dx =0.; - Molecule*mol_p = new Molecule (specs_p_->get_molecule (paper (), dir_)); + Molecule*mol_p = new Molecule (specs_p_->get_molecule (paper_l (), dir_)); /* ugh, staccato dots are not centred between stafflines (how?)? */ Real correct =0.0; if (axis_ == Y_AXIS){ - dx = paper ()->note_width ()/2; - correct = - (Real)dir_ * 2.0 * paper ()->rule_thickness (); + dx = paper_l ()->note_width ()/2; + correct = - (Real)dir_ * 2.0 * paper_l ()->rule_thickness (); mol_p->translate_axis (dx, X_AXIS); // FIXME! ugh } @@ -137,6 +130,5 @@ Script::Script (Script const&s) { specs_p_ = s.specs_p_ ? s.specs_p_->clone (): 0; stem_l_ =s.stem_l_; - postbreak_only_b_ = s.postbreak_only_b_; } diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index 185ba95e20..ccd114f55f 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -30,7 +30,7 @@ Separating_group_spanner::get_rods () const if (lb) { Rod rod(lb, r); - rod.distance_f_ += paper ()->interline_f () *1.5; + rod.distance_f_ += padding_f_; a.push (rod); } @@ -38,10 +38,11 @@ Separating_group_spanner::get_rods () const { a.push (Rod (l, rb)); } + if (lb && rb) { Rod rod(lb, rb); - rod.distance_f_ += paper ()->interline_f () *1.5; + rod.distance_f_ += padding_f_; a.push (rod); } } @@ -68,5 +69,6 @@ Separating_group_spanner::do_substitute_element_pointer (Score_element*o, Score_ Separating_group_spanner::Separating_group_spanner() { - break_helper_only_b_ = true; + set_elt_property (break_helper_only_scm_sym, SCM_BOOL_T); + padding_f_ =0.0; } diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index 86b5590e61..be02dcf102 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -11,6 +11,7 @@ #include "separating-group-spanner.hh" #include "single-malt-grouping-item.hh" #include "p-col.hh" +#include "paper-def.hh" Separating_line_group_engraver::Separating_line_group_engraver () { @@ -30,6 +31,16 @@ Separating_line_group_engraver::do_creation_processing () void Separating_line_group_engraver::do_removal_processing () { + Scalar sz (get_property ("postBreakPadding", 0)); + if (!sz.empty_b () && sz.isnum_b ()) + { + sep_span_p_->padding_f_ = Real(sz); + } + else + { + sep_span_p_->padding_f_ = 1.5 * paper_l ()->get_realvar (interline_scm_sym); + } + sep_span_p_->set_bounds (RIGHT, get_staff_info ().command_pcol_l ()); typeset_element (sep_span_p_); sep_span_p_ =0; @@ -41,13 +52,15 @@ Separating_line_group_engraver::acknowledge_element (Score_element_info i) Item * it = dynamic_cast <Item *> (i.elem_l_); if (it && !it->parent_l (X_AXIS)) { - Single_malt_grouping_item *&p_ref_ (it->breakable_b_ - ? break_malt_p_ : nobreak_malt_p_); + bool ib =it->breakable_b (); + Single_malt_grouping_item *&p_ref_ (ib ? break_malt_p_ + : nobreak_malt_p_); if (!p_ref_) { p_ref_ = new Single_malt_grouping_item; - p_ref_->breakable_b_ = it->breakable_b_; + if (ib) + p_ref_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); announce_element (Score_element_info (p_ref_, 0)); } p_ref_->add_item (it); diff --git a/lily/sequential-music-iterator.cc b/lily/sequential-music-iterator.cc index 093ab6cf0a..b1a9ab6198 100644 --- a/lily/sequential-music-iterator.cc +++ b/lily/sequential-music-iterator.cc @@ -20,7 +20,7 @@ Sequential_music_iterator::do_print() const Sequential_music_iterator::Sequential_music_iterator () { - cursor_p_ = 0; + cursor_ = 0; here_mom_ = 0; iter_p_ =0; } @@ -28,9 +28,9 @@ Sequential_music_iterator::Sequential_music_iterator () void Sequential_music_iterator::construct_children() { - cursor_p_ = new PCursor<Music*> (dynamic_cast<Sequential_music const*> (music_l_)->music_p_list_p_->top ()); + cursor_ = dynamic_cast<Sequential_music const*> (music_l_)->music_p_list_p_->head_; - while (cursor_p_->ok()) + while (cursor_) { start_next_element(); if (!iter_p_->ok()) @@ -50,16 +50,16 @@ Sequential_music_iterator::leave_element() { delete iter_p_; iter_p_ =0; - Moment elt_time = cursor_p_->ptr()->length_mom (); + Moment elt_time = cursor_->car_->length_mom (); here_mom_ += elt_time; - cursor_p_->next(); + cursor_ =cursor_->next_; } void Sequential_music_iterator::start_next_element() { assert (!iter_p_); - iter_p_ = get_iterator_p ( cursor_p_->ptr()); + iter_p_ = get_iterator_p (cursor_->car_); } void @@ -71,7 +71,6 @@ Sequential_music_iterator::set_Sequential_music_translator() Sequential_music_iterator::~Sequential_music_iterator() { - delete cursor_p_; assert (! iter_p_); } @@ -97,7 +96,7 @@ Sequential_music_iterator::do_process_and_next (Moment until) { leave_element(); - if (cursor_p_->ok()) + if (cursor_) { start_next_element(); set_Sequential_music_translator(); diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc index 9da14dadb1..b83e5eaee8 100644 --- a/lily/simultaneous-music-iterator.cc +++ b/lily/simultaneous-music-iterator.cc @@ -26,10 +26,10 @@ Simultaneous_music_iterator::construct_children() { int j = 0; Simultaneous_music const *sim = dynamic_cast<Simultaneous_music const*> (music_l_); - for (PCursor<Music*> i (sim->music_p_list_p_->top()); - i.ok(); j++, i++) + + for (Cons<Music> *i = sim->music_p_list_p_->head_; i; i = i->next_, j++) { - Music_iterator * mi = get_iterator_p (i.ptr()); + Music_iterator * mi = get_iterator_p (i->car_); if (mi->ok()) { if (sim->translator_type_str_.empty_b ()) diff --git a/lily/single-malt-grouping-item.cc b/lily/single-malt-grouping-item.cc index d0396e9a9a..b11993efff 100644 --- a/lily/single-malt-grouping-item.cc +++ b/lily/single-malt-grouping-item.cc @@ -13,8 +13,10 @@ Single_malt_grouping_item ::Single_malt_grouping_item() { - break_helper_only_b_ = true; - transparent_b_ = true; + set_elt_property (break_helper_only_scm_sym, SCM_BOOL_T); + set_elt_property (transparent_scm_sym, SCM_BOOL_T); + + // this is weird! , but needed! set_empty (true); } diff --git a/lily/slur.cc b/lily/slur.cc index dc9dc15406..f4d58d9b75 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -40,7 +40,7 @@ Slur::add_column (Note_column*n) if (!n->head_l_arr_.size ()) warning (_ ("Putting slur over rest.")); encompass_arr_.push (n); - n->stem_l_->slur_l_ = this; + // n->stem_l_->slur_l_ = this; add_dependency (n); } @@ -100,10 +100,11 @@ broken_edge_b (Slur*s, Drul_array<Note_column*>& extrema, Direction dir) static bool normal_edge_b (Slur*s, Drul_array<Note_column*>& extrema, Direction dir) { + Note_column *n = extrema[dir]; return !broken_edge_b (s, extrema, dir) - && extrema[dir]->stem_l_ - && !extrema[dir]->stem_l_->transparent_b_ - && extrema[dir]->head_l_arr_.size (); + && n->stem_l_ + && n->stem_l_->get_elt_property (transparent_scm_sym) == SCM_BOOL_F + && n->head_l_arr_.size (); } void @@ -113,10 +114,10 @@ Slur::do_post_processing () if (!dir_) set_default_dir (); - Real interline_f = paper ()->interline_f (); + Real interline_f = paper_l ()->get_realvar (interline_scm_sym); Real internote_f = interline_f / 2; // URG - Real notewidth_f = paper ()->note_width () * 0.8; + Real notewidth_f = paper_l ()->note_width () * 0.8; /* [OSU]: slur and tie placement @@ -129,7 +130,7 @@ Slur::do_post_processing () --> height <= 5 length ?? we use <= 3 length, now... */ - Real gap_f = paper ()->get_var ("slur_x_gap"); + Real gap_f = paper_l ()->get_var ("slur_x_gap"); Drul_array<Note_column*> extrema; extrema[LEFT] = encompass_arr_[0]; @@ -218,7 +219,7 @@ Slur::do_post_processing () */ if (sign (dy) != sign (note_dy)) { - Real damp_f = paper ()->get_var ("slur_slope_follow_music_factor"); + Real damp_f = paper_l ()->get_var ("slur_slope_follow_music_factor"); Real realdy = note_dy * damp_f; Direction adjust_dir = (Direction)(- dir_ * sign (realdy)); if (!adjust_dir) @@ -243,7 +244,7 @@ Slur::do_post_processing () /* Avoid too steep slurs. */ - Real damp_f = paper ()->get_var ("slur_slope_damping"); + Real damp_f = paper_l ()->get_var ("slur_slope_damping"); Offset d_off = Offset (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT], dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]); d_off[X_AXIS] += extent (X_AXIS).length (); @@ -257,12 +258,12 @@ Slur::do_post_processing () Array<Offset> Slur::get_encompass_offset_arr () const { - Real notewidth = paper ()->note_width () * 0.8; - Real gap = paper ()->get_var ("slur_x_gap"); - Real internote = paper ()->internote_f (); + Real notewidth = paper_l ()->note_width () * 0.8; + Real gap = paper_l ()->get_var ("slur_x_gap"); Offset left = Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT]); left[X_AXIS] += encompass_arr_[0]->stem_l_->hpos_f (); + Real internote = encompass_arr_[0]->stem_l_->staff_line_leading_f ()/2.0; /* <URG> @@ -307,10 +308,10 @@ Slur::get_encompass_offset_arr () const for (int i = first; i < last; i++) { - Encompass_info info (encompass_arr_[i], dir_); + Encompass_info info (encompass_arr_[i], dir_, this); notes.push (info.o_ - left); } - Encompass_info info (encompass_arr_.top (), dir_); + Encompass_info info (encompass_arr_.top (), dir_, this); // [encompass_arr_.size () - 1] // urg: @@ -322,7 +323,7 @@ Slur::get_encompass_offset_arr () const // prebreak if (interstaff_f_ && (encompass_arr_.top () != spanned_drul_[RIGHT])) { - Encompass_info info (encompass_arr_[encompass_arr_.size () - 1], dir_); + Encompass_info info (encompass_arr_[encompass_arr_.size () - 1], dir_, this); d[Y_AXIS] -= info.o_[Y_AXIS] - interstaff_f_; } @@ -338,7 +339,7 @@ Slur::get_rods () const Array<Rod> a; Rod r; r.item_l_drul_ = spanned_drul_; - r.distance_f_ = paper ()->get_var ("slur_x_minimum"); + r.distance_f_ = paper_l ()->get_var ("slur_x_minimum"); a.push (r); return a; diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 67d1e2ea92..73944e140c 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -63,12 +63,12 @@ Span_bar::evaluate_empty () { if (spanning_l_arr_.size () < 1) { - transparent_b_ = true; + set_elt_property (transparent_scm_sym, SCM_BOOL_T); set_empty (true); } if (type_str_.empty_b ()) { - transparent_b_=true; + set_elt_property (transparent_scm_sym, SCM_BOOL_T); set_empty (true); } else if (type_str_ == "|:") diff --git a/lily/span-score-bar-engraver.cc b/lily/span-score-bar-engraver.cc index bcf62430b8..4ed52a8924 100644 --- a/lily/span-score-bar-engraver.cc +++ b/lily/span-score-bar-engraver.cc @@ -52,7 +52,7 @@ Staff_group_bar_engraver::acknowledge_element (Score_element_info i) if (Span_bar * b = dynamic_cast<Span_bar *> (i.elem_l_)) { if (b->type_str_ == "{") - b->extra_x_off_ -= paper ()->interline_f (); // ugh + b->extra_x_off_ -= paper_l ()->get_realvar (interline_scm_sym); // ugh } } diff --git a/lily/spanner.cc b/lily/spanner.cc index f829026a6c..6428a80667 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -93,13 +93,12 @@ Spanner::set_my_columns() void Spanner::set_bounds(Direction d, Item*i) { - if (spanned_drul_[d]) - spanned_drul_[d]->attached_span_l_arr_.substitute(this,0); - spanned_drul_[d] =i; if (i) - i->attached_span_l_arr_.push(this); - + { + i->used_b_ = true; + } + if (spanned_drul_[Direction(-d)] == spanned_drul_[d] && i) warning (_f ("Spanner `%s\' with equal left and right spanpoints", classname (this))); @@ -116,7 +115,6 @@ Spanner::do_break_processing() Spanner::Spanner () { - unbroken_original_l_ =0; spanned_drul_[LEFT]=0; spanned_drul_[RIGHT]=0; } @@ -125,14 +123,14 @@ Spanner::Spanner (Spanner const &s) :Score_element (s) { spanned_drul_[LEFT] = spanned_drul_[RIGHT] =0; - unbroken_original_l_ = 0; } void Spanner::output_processing () { - if (transparent_b_) - return ; + if (get_elt_property (transparent_scm_sym) != SCM_BOOL_F) + return; + output_p_ = do_brew_molecule_p (); Offset left_off (spanned_drul_[LEFT]->absolute_coordinate(X_AXIS), 0); Offset o = absolute_offset() + left_off; @@ -174,7 +172,6 @@ Spanner::find_broken_piece (Line_of_score*l) const if (!info.broken_spanner_l_) { Spanner *span_p = dynamic_cast<Spanner*>(clone ()); - span_p -> unbroken_original_l_ =(Spanner*)this; span_p->set_bounds(LEFT,info.bounds_[LEFT]); span_p->set_bounds(RIGHT,info.bounds_[RIGHT]); pscore_l_->typeset_element (span_p); diff --git a/lily/spring-spacer.cc b/lily/spring-spacer.cc index b5cf85577f..bd12477582 100644 --- a/lily/spring-spacer.cc +++ b/lily/spring-spacer.cc @@ -516,20 +516,21 @@ Spring_spacer::get_ruling_durations(Array<Moment> &shortest_playing_arr, for (int i=0; i < cols_.size(); i++) { + Score_column * sc = scol_l(i); Moment now = scol_l (i)->when(); Moment shortest_playing; shortest_playing.set_infinite (1); - if (scol_l (i)->breakable_b_) + if (!sc->musical_b ()) { for (int ji=i; ji >= start_context_i; ji--) context_shortest_arr[ji] = context_shortest; start_context_i = i; context_shortest.set_infinite (1); } - if (scol_l (i)->durations.size()) + if (sc->durations.size()) { - context_shortest = context_shortest <? scol_l(i)->durations[0]; + context_shortest = context_shortest <? sc->durations[0]; } // ji was j, but triggered ICE @@ -588,8 +589,7 @@ Spring_spacer::calc_idealspacing() Array<Moment> context_shortest_arr; get_ruling_durations(shortest_playing_arr, context_shortest_arr); - Real interline_f = paper_l ()->interline_f (); - + Real interline_f = paper_l ()->get_realvar (interline_scm_sym); Array<Real> ideal_arr; Array<Real> hooke_arr; @@ -682,7 +682,7 @@ Spring_spacer::calc_idealspacing() /* first musical column of bar */ - if (i && scol_l (i - 1)->breakable_b_) + if (i && !scol_l (i - 1)->musical_b ()) { // one interline minimum at start of bar @@ -696,7 +696,7 @@ Spring_spacer::calc_idealspacing() /* last musical column of bar */ - if (i + 1 < cols_.size () && scol_l(i+1)->breakable_b_) + if (i + 1 < cols_.size () && !scol_l(i+1)->musical_b ()) { // two interline minimum ok for last column? dist = dist >? 2 * interline_f; diff --git a/lily/staff-bar.cc b/lily/staff-bar.cc new file mode 100644 index 0000000000..44be80a76a --- /dev/null +++ b/lily/staff-bar.cc @@ -0,0 +1,16 @@ +/* + staff-bar.cc -- implement Staff_bar + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl> + + */ + +#include "staff-bar.hh" + +Real +Staff_bar::get_bar_size () const +{ + return 4 * staff_line_leading_f (); +} diff --git a/lily/staff-info.cc b/lily/staff-info.cc index 7725cad81b..1331e96d2e 100644 --- a/lily/staff-info.cc +++ b/lily/staff-info.cc @@ -7,45 +7,26 @@ */ #include "proto.hh" -#include "plist.hh" + #include "staff-info.hh" #include "score-column.hh" -Score* -Staff_info::score_l() -{ - return score_l_; -} - Staff_info::Staff_info() { - score_l_ =0; time_C_ = 0; rhythmic_C_ =0; - staff_sym_l_=0; } -Score_column* -Staff_info::musical_l() -{ - return musical_l_; -} - -Score_column* -Staff_info::command_l() -{ - return command_l_; -} Paper_column* Staff_info::command_pcol_l() { - return command_l(); + return command_l_; } Paper_column* Staff_info::musical_pcol_l() { - return musical_l(); + return musical_l_; } diff --git a/lily/staff-side.cc b/lily/staff-side.cc index b98ca8aac2..d223a7387f 100644 --- a/lily/staff-side.cc +++ b/lily/staff-side.cc @@ -9,7 +9,7 @@ #include "interval.hh" #include "paper-def.hh" #include "staff-side.hh" -#include "staff-sym.hh" +#include "staff-symbol.hh" #include "debug.hh" #include "dimensions.hh" @@ -65,7 +65,7 @@ Staff_side::get_position_f () const Real y = 0; - Real inter_f = paper()-> internote_f (); + Real inter_f = staff_line_leading_f () /2; Interval v = support_extent(); @@ -73,8 +73,7 @@ Staff_side::get_position_f () const y = v[dir_] + 1 * dir_ * inter_f; int coordinate_offset_f_i = (int)rint (y / inter_f); - // ugh: 5 -> staff_lines - if (axis_ == Y_AXIS && abs (coordinate_offset_f_i) < 5) + if (axis_ == Y_AXIS && abs (coordinate_offset_f_i) < lines_i ()) { if (!(abs (coordinate_offset_f_i) % 2)) y += (Real)dir_ * inter_f; @@ -131,8 +130,14 @@ Staff_side::do_post_processing() void Staff_side::do_substitute_element_pointer (Score_element*o, Score_element*n) { + Staff_symbol_referencer::do_substitute_element_pointer (o,n); support_l_arr_.unordered_substitute (o,n); } - +void +Staff_side::do_add_processing () +{ + if (axis_ == Y_AXIS && staff_symbol_l ()) + add_support (staff_symbol_l ()); +} diff --git a/lily/staff-sym-engraver.cc b/lily/staff-sym-engraver.cc index ebd56ebb23..ba0431f4e3 100644 --- a/lily/staff-sym-engraver.cc +++ b/lily/staff-sym-engraver.cc @@ -7,16 +7,11 @@ */ #include "staff-sym-engraver.hh" -#include "staff-sym.hh" +#include "staff-symbol.hh" #include "score.hh" #include "p-col.hh" - - -void -Staff_symbol_engraver::fill_staff_info (Staff_info&i) -{ - i.staff_sym_l_ = span_p_; -} +#include "staff-symbol-referencer.hh" +#include "paper-def.hh" Staff_symbol_engraver::~Staff_symbol_engraver() { @@ -45,12 +40,28 @@ Staff_symbol_engraver::do_removal_processing() span_p_->no_lines_i_ = l; } + Scalar sz (get_property ("staffLineLeading", 0)); + if (!sz.empty_b () && sz.isnum_b ()) + { + span_p_->staff_line_leading_f_ = Real(sz); + } + else + { + span_p_->staff_line_leading_f_ = paper_l ()->get_realvar (interline_scm_sym); + } span_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ()); typeset_element (span_p_); span_p_ =0; } - +void +Staff_symbol_engraver::acknowledge_element (Score_element_info s) +{ + if (Staff_symbol_referencer * st = dynamic_cast<Staff_symbol_referencer*> (s.elem_l_)) + { + st->set_staff_symbol (span_p_); + } +} ADD_THIS_TRANSLATOR(Staff_symbol_engraver); diff --git a/lily/staff-sym.cc b/lily/staff-sym.cc index abd1addd33..351b747dee 100644 --- a/lily/staff-sym.cc +++ b/lily/staff-sym.cc @@ -5,7 +5,7 @@ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl> */ -#include "staff-sym.hh" +#include "staff-symbol.hh" #include "lookup.hh" #include "dimensions.hh" #include "paper-def.hh" @@ -17,12 +17,9 @@ Staff_symbol::Staff_symbol () { no_lines_i_ = 5; - interline_f_ = 0 PT; + staff_line_leading_f_ = 5.0 PT; } - - - void Staff_symbol::do_print() const { @@ -35,38 +32,30 @@ Staff_symbol::do_print() const Interval Staff_symbol::do_height() const { - int n = no_lines_i_ -1; -// return 2* inter_note_f () * Interval (-n, n); - return inter_note_f () * Interval (-n, n); + Interval i =Interval (0, staff_line_leading_f_ * (no_lines_i_-1)); + i += - i.center (); + return i; } Molecule* Staff_symbol::do_brew_molecule_p() const { Real w = extent (X_AXIS).length (); - Paper_def * p = paper(); + Paper_def * p = paper_l (); Molecule rule = lookup_l ()->rule_symbol (p->get_var ("rulethickness"), w); - Real height = (no_lines_i_-1) * inter_note_f(); + Real height = (no_lines_i_-1) * staff_line_leading_f_ /2; Molecule * m = new Molecule; for (int i=0; i < no_lines_i_; i++) { Molecule a (rule); - a.translate_axis (height - i * inter_note_f()*2, Y_AXIS); + a.translate_axis (height - i * staff_line_leading_f_, Y_AXIS); m->add_molecule (a); } return m; } -Real -Staff_symbol::inter_note_f() const -{ - if (interline_f_) - return interline_f_/2; - - return paper()->internote_f (); -} int Staff_symbol::steps_i() const diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc new file mode 100644 index 0000000000..2b07b49a5e --- /dev/null +++ b/lily/staff-symbol-referencer.cc @@ -0,0 +1,50 @@ +/* + staff-symbol-referencer.cc -- implement Staff_symbol_referencer + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl> + */ + +#include "staff-symbol-referencer.hh" +#include "staff-symbol.hh" +#include "paper-def.hh" + +Staff_symbol_referencer::Staff_symbol_referencer () +{ + staff_sym_l_ =0; +} + +void +Staff_symbol_referencer::do_substitute_element_pointer (Score_element *o, Score_element*n) +{ + if (staff_sym_l_ == o) + { + staff_sym_l_ = dynamic_cast<Staff_symbol*> (n); + } +} + +int +Staff_symbol_referencer::lines_i () const +{ + return (staff_sym_l_) ? staff_sym_l_->no_lines_i_ : 5; +} + +void +Staff_symbol_referencer::set_staff_symbol (Staff_symbol*s) +{ + staff_sym_l_ =s; + add_dependency (s); +} + +Staff_symbol* +Staff_symbol_referencer::staff_symbol_l () const +{ + return staff_sym_l_; +} + +Real +Staff_symbol_referencer::staff_line_leading_f () const +{ + return (staff_sym_l_) ? staff_sym_l_->staff_line_leading_f_ : paper_l ()->get_realvar (interline_scm_sym); +} diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index 13e9ea88d9..8bc446ee85 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -47,13 +47,11 @@ Stem_engraver::acknowledge_element(Score_element_info i) int durlog_i = r->duration_.durlog_i_; stem_p_->flag_i_ = durlog_i; - stem_p_->staff_sym_l_ = get_staff_info ().staff_sym_l_; - if (abbrev_req_l_) { /* suggests typing of: - c8:16 c: c: c: + c8:16 c: c: c: hmm, which isn't so bad? */ int t = abbrev_req_l_->type_i_; @@ -111,7 +109,6 @@ Stem_engraver::do_pre_move_processing() ((Translator_group*)which)->set_property ("stemRightBeamCount", ""); } - typeset_element(stem_p_); stem_p_ = 0; } diff --git a/lily/stem-info.cc b/lily/stem-info.cc index e3dfdfba05..cd9be5dd1d 100644 --- a/lily/stem-info.cc +++ b/lily/stem-info.cc @@ -16,7 +16,7 @@ #include "lookup.hh" #include "stem-info.hh" #include "beam.hh" -#include "staff-sym.hh" +#include "staff-symbol.hh" Stem_info::Stem_info () { @@ -31,8 +31,8 @@ Stem_info::Stem_info (Stem*s) mult_i_ = stem_l_->mult_i_; interstaff_f_ = 0; - Paper_def* paper_l = stem_l_->paper (); - Real internote_f = paper_l->internote_f (); + Paper_def* paper_l = stem_l_->paper_l (); + Real internote_f = stem_l_->staff_line_leading_f ()/2; Real interbeam_f = paper_l->interbeam_f (mult_i_); Real beam_f = paper_l->beam_thickness_f (); @@ -106,16 +106,8 @@ Stem_info::Stem_info (Stem*s) // interstaff beam Beam* beam_l_ = stem_l_->beam_l_; if (beam_l_->sinfo_.size () - && stem_l_->staff_sym_l_ != beam_l_->sinfo_[0].stem_l_->staff_sym_l_) + && stem_l_->staff_symbol_l () != beam_l_->sinfo_[0].stem_l_->staff_symbol_l ()) { -#if 0 // this is nonsense..., don't issue warning - if (stem_l_->staff_sym_l_->dim_cache_[Y_AXIS].valid_b ()) - { - interstaff_f_ = stem_l_->staff_sym_l_->absolute_coordinate (Y_AXIS) - - beam_l_->sinfo_[0].stem_l_->staff_sym_l_->absolute_coordinate (Y_AXIS) / internote_f; - } - else -#endif { // warning (_ ("invalid dimension cache: guessing staff position")); if (beam_l_->vertical_align_drul_[MIN] != diff --git a/lily/stem.cc b/lily/stem.cc index a0600e8636..e88166ae58 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -40,7 +40,6 @@ Stem::Stem () beam_dir_ = CENTER; dir_forced_b_ = false; stem_xdir_ = LEFT; - staff_size_i_ = 8; beam_gap_i_ = 0; beam_l_ = 0; @@ -94,7 +93,7 @@ Stem::stem_begin_f () const Real Stem::chord_start_f () const { - return head_positions()[dir_] * paper ()->internote_f (); + return head_positions()[dir_] * staff_line_leading_f ()/2.0; } Real @@ -174,9 +173,9 @@ Stem::set_default_dir () void Stem::set_default_stemlen () { - Real internote_f = paper ()->internote_f (); - Real length_f = paper ()->get_var ("stem_length0") / internote_f; - Real shorten_f = paper ()->get_var ("forced_stem_shorten0") / internote_f; + Real internote_f = staff_line_leading_f ()/2.0; + Real length_f = paper_l ()->get_var ("stem_length0") / internote_f; + Real shorten_f = paper_l ()->get_var ("forced_stem_shorten0") / internote_f; if (!dir_) set_default_dir (); @@ -256,7 +255,10 @@ Stem::do_pre_processing () set_default_extents (); set_noteheads (); flag_i_ = flag_i_; - transparent_b_ = invisible_b (); + if (invisible_b ()) + { + set_elt_property (transparent_scm_sym, SCM_BOOL_T); + } set_empty (invisible_b ()); } @@ -285,7 +287,7 @@ Stem::do_brew_molecule_p () const { Molecule *mol_p =new Molecule; Drul_array<Real> stem_y = yextent_drul_; - Real dy = paper ()->internote_f (); + Real dy = staff_line_leading_f ()/2.0; Real head_wid = 0; if (head_l_arr_.size ()) @@ -320,7 +322,7 @@ Stem::note_delta_f () const if (head_l_arr_.size()) { Interval head_wid(0, head_l_arr_[0]->extent (X_AXIS).length ()); - Real rule_thick(paper ()->rule_thickness ()); + Real rule_thick(paper_l ()->rule_thickness ()); Interval stem_wid(-rule_thick/2, rule_thick/2); if (stem_xdir_ == CENTER) r = head_wid.center (); @@ -359,4 +361,6 @@ Stem::do_substitute_element_pointer (Score_element*o,Score_element*n) } } } + Staff_symbol_referencer::do_substitute_element_pointer (o,n); + } diff --git a/lily/template7.cc b/lily/template7.cc deleted file mode 100644 index d7d57405e2..0000000000 --- a/lily/template7.cc +++ /dev/null @@ -1,18 +0,0 @@ -#/* - template7.cc -- instantiate Request_column - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl> -*/ - -#include "proto.hh" -#include "cursor.tcc" -#include "pcursor.tcc" -#include "plist.hh" -#include "plist.tcc" - -#include "music-list.hh" - -POINTERLIST_INSTANTIATE(Music); - diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index d33a5d8fff..cf67bc47b2 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -13,7 +13,7 @@ #include "text-def.hh" #include "note-head.hh" #include "stem.hh" -#include "staff-sym.hh" +#include "staff-symbol.hh" class Text_engraver : public Engraver { @@ -80,6 +80,7 @@ Text_engraver::do_process_requests () G_text_item *text = new G_text_item; G_staff_side_item *ss = new G_staff_side_item; + ss->set_victim (text); ss->dir_ = r->dir_; Scalar p (get_property ("textstyle", 0)); // textStyle? @@ -93,6 +94,12 @@ Text_engraver::do_process_requests () ss->padding_f_ = Real(padding); } + Scalar empty = get_property ("textEmptyDimension", 0); + if (empty.to_bool ()) + { + text->dim_cache_[X_AXIS].set_empty (true); + } + announce_element (Score_element_info (text, r)); announce_element (Score_element_info (ss, r)); @@ -104,14 +111,8 @@ Text_engraver::do_process_requests () void Text_engraver::do_pre_move_processing () { - Staff_symbol* s_l = get_staff_info().staff_sym_l_; for (int i=0; i < texts_.size (); i++) { - if (s_l != 0) - { - positionings_[i]->add_support (s_l); - } - typeset_element (texts_[i]); typeset_element (positionings_[i]); } diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index 8ad44ce683..18e9105614 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -38,9 +38,6 @@ Text_spanner::Text_spanner() support_span_l_ = 0; } - - - void Text_spanner::do_print() const { @@ -51,13 +48,13 @@ void Text_spanner::do_post_processing() { text_off_ = support_span_l_->center() + - Offset (0,support_span_l_->dir_ * paper()->internote_f () * 4); // todo + Offset (0,support_span_l_->dir_ * paper_l ()->get_realvar(interline_scm_sym)*2.0); // todo } Molecule* Text_spanner::do_brew_molecule_p() const { - Molecule tsym (spec_p_->get_molecule (paper(),CENTER)); + Molecule tsym (spec_p_->get_molecule (paper_l (),CENTER)); tsym.translate (text_off_); Molecule*output = new Molecule; diff --git a/lily/tie.cc b/lily/tie.cc index 5aa2d11446..83ba2c92b1 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -65,8 +65,8 @@ Tie::do_post_processing() assert (head_l_drul_[LEFT] || head_l_drul_[RIGHT]); // URG - Real notewidth = paper ()->note_width () * 0.8; - Real interline_f = paper ()->interline_f (); + Real notewidth = paper_l ()->note_width () * 0.8; + Real interline_f = paper_l ()->get_realvar (interline_scm_sym); /* [OSU]: slur and tie placement @@ -79,7 +79,7 @@ Tie::do_post_processing() --> height <= 5 length ?? we use <= 3 length, now... */ - Real gap_f = paper ()->get_var ("slur_x_gap"); + Real gap_f = paper_l ()->get_var ("slur_x_gap"); Direction d = LEFT; do @@ -130,7 +130,7 @@ Tie::do_post_processing() Avoid too steep ties * slur from notehead to stemend: c''()b'' */ - Real damp_f = paper ()->get_var ("tie_slope_damping"); + Real damp_f = paper_l ()->get_var ("tie_slope_damping"); Offset d_off = Offset (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT], dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]); d_off.x () += extent (X_AXIS).length (); @@ -151,15 +151,6 @@ Tie::do_substitute_element_pointer (Score_element*o, Score_element*n) head_l_drul_[RIGHT] = new_l; } -#if 0 -Interval -Tie::do_width () const -{ - Real min_f = - Interval width_int = Bow::do_width (); - return width_int.length () < min_f ? Interval (0, min_f) : width_int; -} -#endif Array<Rod> Tie::get_rods () const @@ -167,7 +158,7 @@ Tie::get_rods () const Array<Rod> a; Rod r; r.item_l_drul_ = spanned_drul_; - r.distance_f_ = paper ()->get_var ("tie_x_minimum"); + r.distance_f_ = paper_l ()->get_var ("tie_x_minimum"); a.push (r); return a; } diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index fd74d44dea..54c6278e97 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -41,7 +41,7 @@ Time_signature_engraver::do_process_requests() time_signature_p_ = new Time_signature (); time_signature_p_->args_ = args; - time_signature_p_->break_priority_i_ = 1; // ugh + time_signature_p_->set_elt_property (break_priority_scm_sym, gh_int2scm (1)); // 1 } diff --git a/lily/time-signature.cc b/lily/time-signature.cc index b6190fa95a..d5a2b727d8 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -15,7 +15,7 @@ Time_signature::Time_signature () { - breakable_b_ = true; + set_elt_property (breakable_scm_sym, SCM_BOOL_T); } Molecule* diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 0d29fa5ce1..fa974f7bfa 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -106,6 +106,17 @@ Timing_translator::do_process_requests() } } + + Translator_group * tr=0; + + Scalar barn = get_property ("currentBarNumber", &tr); + if (!barn.empty_b () && barn.isnum_b ()) + { + time_.bars_i_ = int(barn); + tr->set_property ("currentBarNumber", ""); + } + + } @@ -138,6 +149,8 @@ void Timing_translator::do_post_move_processing() { time_.add (now_mom () - time_.when_); + + } void diff --git a/lily/tuplet-spanner.cc b/lily/tuplet-spanner.cc index 1e45ef97ec..f9fe680112 100644 --- a/lily/tuplet-spanner.cc +++ b/lily/tuplet-spanner.cc @@ -39,7 +39,7 @@ Tuplet_spanner::do_brew_molecule_p () const if (column_arr_.size ()){ Real ncw = column_arr_.top ()->extent (X_AXIS).length (); - Molecule num (tdef_p_->get_molecule (paper (), CENTER)); + Molecule num (tdef_p_->get_molecule (paper_l (), CENTER)); if (beam_l_ && !bracket_visibility_b_) { diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index f85a817ad4..77afc20378 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -41,12 +41,13 @@ Volta_spanner::do_brew_molecule_p () const if (!visible_b_) return mol_p; - Real internote_f = paper ()->internote_f (); + Real internote_f = paper_l ()->get_realvar (interline_scm_sym)/2.0; + Real dx = internote_f; Real w = extent (X_AXIS).length () - dx; Molecule volta (lookup_l ()->volta (w, last_b_)); Real h = volta.dim_.y ().length (); - Molecule num (number_p_->get_molecule (paper (), LEFT)); + Molecule num (number_p_->get_molecule (paper_l (), LEFT)); Real dy = column_arr_.top ()->extent (Y_AXIS) [UP] > column_arr_[0]->extent (Y_AXIS) [UP]; dy += 2 * h; @@ -61,7 +62,7 @@ Volta_spanner::do_brew_molecule_p () const Text_def two_text; two_text.text_str_ = "2"; two_text.style_str_ = number_p_->style_str_; - Molecule two (two_text.get_molecule (paper (), LEFT)); + Molecule two (two_text.get_molecule (paper_l (), LEFT)); Real gap = two.dim_.x ().length () / 2; Offset off (num.dim_.x ().length () + gap, h / internote_f - gap); diff --git a/ly/engraver.ly b/ly/engraver.ly index 59946daa72..7f6d4bc796 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -138,7 +138,7 @@ GrandStaffContext=\translator{ } -\translator { +StaffGroupContext= \translator { \type "Hara_kiri_line_group_engraver"; % \type "Line_group_engraver_group"; \consists "Span_bar_engraver"; @@ -152,7 +152,8 @@ GrandStaffContext=\translator{ \accepts "Lyrics"; \accepts "ChordNames"; -} +}; +\translator { \StaffGroupContext } \translator{ \type "Line_group_engraver_group"; @@ -196,7 +197,7 @@ ScoreContext = \translator { \consists "Span_score_bar_engraver"; \consists "Score_priority_engraver"; - \consists "Priority_horizontal_align_engraver"; +% \consists "Priority_horizontal_align_engraver"; \consists "Vertical_align_engraver"; @@ -280,7 +281,7 @@ OrchestralScoreContext= \translator { \consists "Mark_engraver"; \consists "Span_score_bar_engraver"; \consists "Score_priority_engraver"; - \consists "Priority_horizontal_align_engraver"; + \consists "Vertical_align_engraver"; \accepts "ChoirStaff"; diff --git a/ly/performer.ly b/ly/performer.ly index 105243f5c5..78f8b443a5 100644 --- a/ly/performer.ly +++ b/ly/performer.ly @@ -4,6 +4,11 @@ \translator { \type "Staff_performer"; \accepts Voice; + \accepts VoiceOne; % ugh. + \accepts VoiceTwo; + \accepts VoiceThree; + \accepts VoiceFour; + \name Staff; \consists "Key_performer"; \consists "Time_signature_performer"; @@ -12,21 +17,44 @@ \translator { \type "Performer_group_performer"; - \name Thread ; \consists "Note_performer"; + \name VoiceFour; +} + +\translator +{ + \type "Performer_group_performer"; + \consists "Note_performer"; +\name VoiceThree; +} +\translator +{ + \type "Performer_group_performer"; + \consists "Note_performer"; + \name VoiceOne; } \translator { \type "Performer_group_performer"; - \accepts Thread; + \consists "Note_performer"; \name Voice; } \translator { \type "Performer_group_performer"; + \name VoiceTwo;\consists "Note_performer"; + +} + +\translator +{ + \type "Performer_group_performer"; \accepts Staff; + \name GrandStaff; +} -\name GrandStaff;} +\translator {\type "Performer_group_performer"; + \accepts Staff; \name "PianoStaff";} \translator { \type "Performer_group_performer"; @@ -60,6 +88,7 @@ instrument = piano; \accepts Staff; \accepts GrandStaff; + \accepts PianoStaff; \accepts Lyrics; \accepts StaffGroup; \accepts ChoirStaff; diff --git a/make/out/lelievijver.lsm b/make/out/lelievijver.lsm index 6568fc7b3c..c9d187ae58 100644 --- a/make/out/lelievijver.lsm +++ b/make/out/lelievijver.lsm @@ -1,15 +1,15 @@ Begin3 Titel: LilyPond -Versie: 1.1.34 -Inschrijf datum: 10MAR99 +Versie: 1.1.35 +Inschrijf datum: 15MAR99 Beschrijving: @FLAPTEKST@ Trefwoorden: muziek typezetten midi notatie Auteur: hanwen@stack.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Onderhouden door: hanwen@cs.ruu.nl (Han-Wen Nienhuys) Voornaamste plek: sunsite.unc.edu /pub/Linux/apps - 770k lilypond-1.1.34.tar.gz + 770k lilypond-1.1.35.tar.gz Oorspronkelijke plek: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 770k lilypond-1.1.34.tar.gz + 770k lilypond-1.1.35.tar.gz Copi-eer voorwaarden: GPL End diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 1bf9cb3ac9..1bae4f1cab 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,7 +1,7 @@ Begin3 Title: LilyPond -Version: 1.1.34 -Entered-date: 10MAR99 +Version: 1.1.35 +Entered-date: 15MAR99 Description: LilyPond is the GNU Project music typesetter. This program can print beautiful sheet music from a music definition file. It can also play @@ -14,8 +14,8 @@ Author: hanwen@cs.ruu.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert - 770k lilypond-1.1.34.tar.gz + 770k lilypond-1.1.35.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 770k lilypond-1.1.34.tar.gz + 770k lilypond-1.1.35.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index 1e2a3b8617..a05db63f49 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 1.1.34 +Version: 1.1.35 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.34.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.35.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond Packager: Han-Wen Nienhuys <hanwen@cs.uu.nl> diff --git a/make/toplevel.make.in b/make/toplevel.make.in index acdbfffb97..cd3d50d71d 100644 --- a/make/toplevel.make.in +++ b/make/toplevel.make.in @@ -14,7 +14,7 @@ SUBDIRS = scripts buildscripts flower lib lily mf mi2mu po debian \ # SCRIPTS = configure aclocal.m4 -README_FILES = BUGS DEDICATION ANNOUNCE-0.1 ANNOUNCEMENT \ +README_FILES = BUGS DEDICATION ANNOUNCE-0.1 ANNOUNCEMENT-1.0 \ COPYING NEWS-0.1 NEWS-1.0 NEWS-0.0 NEWS TODO README_TXT_FILES = README.txt AUTHORS.txt INSTALL.txt PATCHES.txt IN_FILES := $(wildcard *.in) @@ -1,17 +1 @@ - - design macro for penstroke with rounded endings - - timesig C: fat yet less curved. Check out relations. - - design decent macro for bulbed endings - - printer dependencies. - - y-refpoint for rests should be the 4th staffline (gclef: b') - - clean-up eight+ rests - - versioning - - lo-res fixes. - - work out sizes of character fonts. - - more symbols - * piano pedals: Ped/* - * maxima notehead - * coda signs: Segno, O+ - * glissando, arpeggio - * lengthened trill - - 128th flags - - include important spacing dims in fetalog + diff --git a/scm/lily.scm b/scm/lily.scm index d473805efe..59af7371a9 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -58,13 +58,16 @@ ;; See documentation of Item::visibility_lambda_ (define (postbreak_only_visibility d) (if (= d 1) '(#f . #f) '(#t . #t))) -(define (non_postbreak_visibility d) (if (= d -1) '(#t . #t) '(#f . #f))) (define (spanbar_non_postbreak_visibility d) (if (= d -1) '(#t . #t) '(#f . #f))) +(define (non_postbreak_visibility d) (if (= d 1) '(#t . #t) '(#f . #f))) + + ;; Score_span_bars are only visible at start of line ;; i.e. if break_dir == RIGHT == 1 -(define Span_score_bar_engraver_visibility postbreak_only_visibility) (define Span_bar_engraver_visibility non_postbreak_visibility) + +(define Span_score_bar_engraver_visibility postbreak_only_visibility) (define Piano_bar_engraver_visibility postbreak_only_visibility) (define Staff_group_bar_engraver_visibility postbreak_only_visibility) diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index c0c07f6408..78d3e0e833 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -319,7 +319,7 @@ class TeXOutput: outfile = os.path.join(Props.get('output'), outfile ) this.write("""\ -\\vfill\\hfill{\\LilyIdString} +\\vfill\\hfill{\\mudelatagline} \\end{document} """) this.__fd.close() diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index b3ac3e4207..6ef9ca21b8 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -19,8 +19,8 @@ \ifundefined{mudelacopyright} \def\mudelacopyright{\copyright\ \number\year} \fi -\ifundefined{LilyIdString} - \def\LilyIdString{Lily was here} +\ifundefined{mudelatagline} + \def\mudelatagline{Lily was here} \fi \ifundefined{documentclass} \input lilypond-plaintex |