-1.3.36.jcn4
+
+1.3.36.hwn1
===========
-* Added instrument-equaliser for MIDI output, see scm/midi.scm, and
- properties midiMinimumVolume, midiMaximumVolume, ranges [0,1].
+* Abstract Align_element into Align_interface. Removed
+Axis_align_{item,spanner}, Align_element, Super_element, all multiple
+inheritance in the backend.
-* Changed absolute midi volume settings into factor of full scale.
+* new Gade score, INSTALL.texi fixes (thanks, Mats)
-* Fixed another dynamic-line-spanner bug, it gets hairy.
+* Removed Item::hpos_f (), Score_element::{get,set}_real ()
-* Added warning for spanners with dubiously narrow parents.
+* comments detailing properties for Axis_group_interface,
+Side_position_interface, Score_element, Item and Spanner
1.3.36.jcn3
===========
* Bugfix: line-spanner lasts always full duration of (de)crescendi.
-1.3.36.jcn2
-===========
-
* Bugfix: broken (de)crescendi on a dynamic-line-spanner.
* Bugfix: compilation dynamic-engraver.
-1.3.36.jcn1
-===========
-
* Added and updated a faq about postscript and ghostscript.
* Fixed order of slurVerticalDirection verticalDirection in
* Bugfix: volume effect of (de)crescendi was sometimes wrong way round.
-.3.35.hwn1
+1.3.36
+======
+1.3.35.hwn1
===========
* textEmptyDimension changed into textNonEmpty, default: off,
Although we recommend to use Unix, LilyPond is known to run on Windows
NT/95/98 as well. See Section Windows NT/95,es.
-@item EGCS 1.1 or newer. Check out @uref{ftp://ftp.gnu.org/pub/gcc/}.
+@item EGCS 1.1 or newer. Check out @uref{ftp://ftp.gnu.org/gnu/gcc/}.
@item Python 1.5,
Check out
@item GUILE 1.3.4, check out @uref{http://www.gnu.org/software/guile/guile.html,http://www.gnu.org/software/guile/guile.html}.
@item GNU make.
-Check out @uref{ftp://ftp.gnu.org/make/,ftp://ftp.gnu.org/make/}.
+Check out @uref{ftp://ftp.gnu.org/gnu/make/,ftp://ftp.gnu.org/gnu/make/}.
@item Flex (version 2.5.4 or newer).
-Check out @uref{ftp://ftp.gnu.org/flex/,ftp://ftp.gnu.org/flex/}.
+Check out @uref{ftp://ftp.gnu.org/gnu/flex/,ftp://ftp.gnu.org/gnu/flex/}.
@item Bison (version 1.25 or newer).
-Check out @uref{ftp://ftp.gnu.org/bison/,ftp://ftp.gnu.org/bison/}.
+Check out @uref{ftp://ftp.gnu.org/gnu/bison/,ftp://ftp.gnu.org/gnu/bison/}.
@item Texinfo (version 4.0 or newer).
-Check out @uref{ftp://ftp.gnu.org/pub/texinfo/,ftp://ftp.gnu.org/pub/texinfo/}.
+Check out @uref{ftp://ftp.gnu.org/gnu/texinfo/,ftp://ftp.gnu.org/gnu/texinfo/}.
Most documentation is in texinfo.
@item The geometry package for LaTeX is needed to use ly2dvi.
automatic collision resolution. The value is the shift amount
expressed in @code{note_width}, as set in the paper section.
+@item @code{collisionMergeDotted}@indexcode{collisionMergeDotted} @propertytype{boolean}
+
+Merge noteheads in collisions, even if they have a different number of
+dots. This normal notation for polyphonic guitar music.
+
@mudelafile[verbatim]{force-hshift.sly}
* Although we recommend to use Unix, LilyPond is known to run on
Windows NT/95/98 as well. See Section Windows NT/95,es.
- * EGCS 1.1 or newer. Check out `ftp://ftp.gnu.org/pub/gcc/'.
+ * EGCS 1.1 or newer. Check out `ftp://ftp.gnu.org/gnu/gcc/'.
* Python 1.5, Check out `ftp://ftp.python.org' or
`ftp://ftp.cwi.nl/pub/python'.
http://www.gnu.org/software/guile/guile.html
(http://www.gnu.org/software/guile/guile.html).
- * GNU make. Check out ftp://ftp.gnu.org/make/
- (ftp://ftp.gnu.org/make/).
+ * GNU make. Check out ftp://ftp.gnu.org/gnu/make/
+ (ftp://ftp.gnu.org/gnu/make/).
- * Flex (version 2.5.4 or newer). Check out ftp://ftp.gnu.org/flex/
- (ftp://ftp.gnu.org/flex/).
+ * Flex (version 2.5.4 or newer). Check out
+ ftp://ftp.gnu.org/gnu/flex/ (ftp://ftp.gnu.org/gnu/flex/).
- * Bison (version 1.25 or newer). Check out ftp://ftp.gnu.org/bison/
- (ftp://ftp.gnu.org/bison/).
+ * Bison (version 1.25 or newer). Check out
+ ftp://ftp.gnu.org/gnu/bison/ (ftp://ftp.gnu.org/gnu/bison/).
* Texinfo (version 4.0 or newer). Check out
- ftp://ftp.gnu.org/pub/texinfo/ (ftp://ftp.gnu.org/pub/texinfo/).
+ ftp://ftp.gnu.org/gnu/texinfo/ (ftp://ftp.gnu.org/gnu/texinfo/).
Most documentation is in texinfo.
* The geometry package for LaTeX is needed to use ly2dvi. Available
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=36
-MY_PATCH_LEVEL=jcn4
+PATCH_LEVEL=37
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
+++ /dev/null
-/*
- align-elem.cc -- implement Align_elem
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "align-element.hh"
-#include "interval.hh"
-#include "direction.hh"
-#include "debug.hh"
-#include "dimension-cache.hh"
-#include "axis-group-interface.hh"
-
-/*
- This callback is set in the children of the align element. It does
- not compute anything, but a side effect of a->do_side_processing ()
- is that the elements are placed correctly. */
-Real
-Align_element::alignment_callback (Dimension_cache const *c)
-{
- Axis ax = c->axis ();
- Score_element * sc = c->element_l ()->parent_l (ax);
- Align_element * a = dynamic_cast<Align_element*> (sc);
- if (a && a->get_elt_property ("alignment-done") == SCM_UNDEFINED)
- {
- a->do_side_processing (ax);
- }
- return 0.0;
-}
-
-void
-Align_element::add_element (Score_element* s)
-{
- s->add_offset_callback (alignment_callback, axis ());
- axis_group (this).add_element (s);
-}
-
-/*
- Hairy function to put elements where they should be. Can be tweaked
- from the outside by setting minimum-space and extra-space in its
- children */
-void
-Align_element::do_side_processing (Axis a)
-{
- set_elt_property ("alignment-done", SCM_BOOL_T);
-
- SCM d = get_elt_property ("stacking-dir");
- Direction stacking_dir = gh_number_p(d) ? to_dir (d) : CENTER;
- if (!stacking_dir)
- stacking_dir = DOWN;
-
-
- Array<Interval> dims;
-
- Link_array<Score_element> elems;
- Link_array<Score_element> all_elts
- = Group_interface__extract_elements (this, (Score_element*) 0, "elements");
- for (int i=0; i < all_elts.size(); i++)
- {
- Interval y = all_elts[i]->extent(a) + all_elts[i]->relative_coordinate (this, a);
- if (!y.empty_b())
- {
- Score_element *e =dynamic_cast<Score_element*>(all_elts[i]);
-
- // todo: fucks up if item both in Halign & Valign.
- SCM min_dims = e->remove_elt_property ("minimum-space");
- if (gh_pair_p (min_dims) &&
- gh_number_p (gh_car (min_dims))
- && gh_number_p (gh_cdr (min_dims)))
- {
- y.unite (Interval (gh_scm2double (gh_car (min_dims)),
- gh_scm2double (gh_cdr (min_dims))));
- }
-
- SCM extra_dims = e->remove_elt_property ("extra-space");
- if (gh_pair_p (extra_dims) &&
- gh_number_p (gh_car (extra_dims))
- && gh_number_p (gh_cdr (extra_dims)))
- {
- y[LEFT] += gh_scm2double (gh_car (extra_dims));
- y[RIGHT] += gh_scm2double (gh_cdr (extra_dims));
- }
-
- elems.push (e);
- dims.push (y);
- }
- }
-
-
- Interval threshold = Interval (0, Interval::infinity ());
- SCM thr = get_elt_property ("threshold");
- if (gh_pair_p (thr))
- {
- threshold[SMALLER] = gh_scm2double (gh_car (thr));
- threshold[BIGGER] = gh_scm2double (gh_cdr (thr));
- }
-
- Real where_f=0;
- for (int i=0 ; i < elems.size(); i++)
- {
- Real dy = - stacking_dir * dims[i][-stacking_dir];
- if (i)
- dy += stacking_dir * dims[i-1][stacking_dir];
-
- if (i)
- {
- dy = (dy >? threshold[SMALLER] )
- <? threshold[BIGGER];
- }
-
- where_f += stacking_dir * dy;
- elems[i]->translate_axis (where_f, a);
- }
-}
-
-
-int
-Align_element::get_count (Score_element*s)const
-{
- SCM e = get_elt_property ("elements");
- int c =0;
- while (gh_pair_p (e))
- {
- if (gh_car (e) == s->self_scm_)
- break;
- c++;
- e = gh_cdr (e);
- }
- return c;
-}
-
-Axis
-Align_element::axis () const
-{
- return Axis (gh_scm2int (gh_car (get_elt_property ("axes"))));
-}
-
-void
-Align_element::set_axis (Axis a)
-{
- axis_group (this).set_axes (a, a);
-}
-
-Align_element::Align_element ()
-{
- axis_group (this).set_interface ();
-}
--- /dev/null
+/*
+ align-interface.cc -- implement Align_interface
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "align-interface.hh"
+#include "dimension-cache.hh"
+#include "score-element.hh"
+#include "group-interface.hh"
+#include "axis-group-interface.hh"
+
+/*
+ This callback is set in the children of the align element. It does
+ not compute anything, but a side effect of a->do_side_processing ()
+ is that the elements are placed correctly. */
+Real
+Align_interface::alignment_callback (Dimension_cache const *c)
+{
+ Axis ax = c->axis ();
+ Score_element * sc = c->element_l ()->parent_l (ax);
+
+ if (sc && sc->get_elt_property ("alignment-done") == SCM_UNDEFINED)
+ {
+ Align_interface (sc).do_side_processing (ax);
+ }
+ return 0.0;
+}
+
+/*
+ Hairy function to put elements where they should be. Can be tweaked
+ from the outside by setting minimum-space and extra-space in its
+ children */
+void
+Align_interface::do_side_processing (Axis a)
+{
+ elt_l_->set_elt_property ("alignment-done", SCM_BOOL_T);
+
+ SCM d = elt_l_->get_elt_property ("stacking-dir");
+ Direction stacking_dir = gh_number_p(d) ? to_dir (d) : CENTER;
+ if (!stacking_dir)
+ stacking_dir = DOWN;
+
+
+ Array<Interval> dims;
+
+ Link_array<Score_element> elems;
+ Link_array<Score_element> all_elts
+ = Group_interface__extract_elements ( elt_l_, (Score_element*) 0, "elements");
+ for (int i=0; i < all_elts.size(); i++)
+ {
+ Interval y = all_elts[i]->extent(a) + all_elts[i]->relative_coordinate (elt_l_, a);
+ if (!y.empty_b())
+ {
+ Score_element *e =dynamic_cast<Score_element*>(all_elts[i]);
+
+ // todo: fucks up if item both in Halign & Valign.
+ SCM min_dims = e->remove_elt_property ("minimum-space");
+ if (gh_pair_p (min_dims) &&
+ gh_number_p (gh_car (min_dims))
+ && gh_number_p (gh_cdr (min_dims)))
+ {
+ y.unite (Interval (gh_scm2double (gh_car (min_dims)),
+ gh_scm2double (gh_cdr (min_dims))));
+ }
+
+ SCM extra_dims = e->remove_elt_property ("extra-space");
+ if (gh_pair_p (extra_dims) &&
+ gh_number_p (gh_car (extra_dims))
+ && gh_number_p (gh_cdr (extra_dims)))
+ {
+ y[LEFT] += gh_scm2double (gh_car (extra_dims));
+ y[RIGHT] += gh_scm2double (gh_cdr (extra_dims));
+ }
+
+ elems.push (e);
+ dims.push (y);
+ }
+ }
+
+
+ Interval threshold = Interval (0, Interval::infinity ());
+ SCM thr = elt_l_->get_elt_property ("threshold");
+ if (gh_pair_p (thr))
+ {
+ threshold[SMALLER] = gh_scm2double (gh_car (thr));
+ threshold[BIGGER] = gh_scm2double (gh_cdr (thr));
+ }
+
+ Real where_f=0;
+ for (int i=0 ; i < elems.size(); i++)
+ {
+ Real dy = - stacking_dir * dims[i][-stacking_dir];
+ if (i)
+ dy += stacking_dir * dims[i-1][stacking_dir];
+
+ if (i)
+ {
+ dy = (dy >? threshold[SMALLER] )
+ <? threshold[BIGGER];
+ }
+
+ where_f += stacking_dir * dy;
+ elems[i]->translate_axis (where_f, a);
+ }
+}
+
+
+Axis
+Align_interface::axis ()const
+{
+ return Axis (gh_scm2int (gh_car (elt_l_->get_elt_property ("axes"))));
+}
+
+
+/*
+ should use generic Scm funcs.
+ */
+int
+Align_interface::get_count (Score_element*s)const
+{
+ SCM e = elt_l_->get_elt_property ("elements");
+ int c =0;
+ while (gh_pair_p (e))
+ {
+ if (gh_car (e) == s->self_scm_)
+ break;
+ c++;
+ e = gh_cdr (e);
+ }
+ return c;
+}
+
+void
+Align_interface::add_element (Score_element* s)
+{
+ s->add_offset_callback (alignment_callback, axis ());
+ Axis_group_interface (elt_l_).add_element (s);
+
+}
+
+Align_interface::Align_interface (Score_element const*s)
+{
+ elt_l_ = (Score_element*)s;
+}
+
+void
+Align_interface::set_interface ()
+{
+ Axis_group_interface (elt_l_).set_interface ();
+
+ Group_interface (elt_l_, "interfaces").add_thing (ly_symbol2scm ("Alignment"));
+}
+
+void
+Align_interface::set_axis (Axis a)
+{
+ Axis_group_interface (elt_l_).set_axes (a,a );
+}
+
+bool
+Align_interface::has_interface_b ()
+{
+ SCM memq = scm_memq (ly_symbol2scm ("Alignment"),
+ elt_l_->get_elt_property ("interfaces"));
+
+ return (memq != SCM_BOOL_F);
+}
+
#include "engraver.hh"
#include "grace-align-item.hh"
+#include "align-interface.hh"
#include "note-column.hh"
#include "local-key-item.hh"
#include "warn.hh"
if (now_column_l_)
{
- align_item_p_->add_element (now_column_l_);
+ Align_interface (align_item_p_).add_element (now_column_l_);
now_column_l_ =0;
}
}
key_ = k;
}
-Audio_dynamic::Audio_dynamic (Real volume)
+Audio_dynamic::Audio_dynamic (int volume)
{
- volume_ = volume;
+ volume_i_ = volume;
}
Audio_tempo::Audio_tempo (int per_minute_4_i)
+++ /dev/null
-/*
- axis-align-item.cc -- implement Axis_align_item
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#include "axis-align-item.hh"
-
-Axis_align_item::Axis_align_item ()
-{
-}
-
-void
-Axis_align_item::do_print () const
-{
- Axis_group_item::do_print ();
-}
+++ /dev/null
-/*
- axis-align-spanner.cc -- implement Axis_align_spanner
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-#include "axis-align-spanner.hh"
-
-Axis_align_spanner::Axis_align_spanner()
-{
-}
*/
#include "axis-group-engraver.hh"
-#include "axis-group-spanner.hh"
+#include "spanner.hh"
#include "paper-column.hh"
#include "axis-group-interface.hh"
Axis_group_engraver::do_creation_processing ()
{
staffline_p_ = get_spanner_p ();
- axis_group (staffline_p_).set_axes (Y_AXIS, Y_AXIS);
+ Axis_group_interface (staffline_p_).set_interface ();
+ Axis_group_interface (staffline_p_).set_axes (Y_AXIS, Y_AXIS);
staffline_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
announce_element (Score_element_info (staffline_p_, 0));
}
-Axis_group_spanner*
+Spanner*
Axis_group_engraver::get_spanner_p () const
{
- return new Axis_group_spanner;
+ return new Spanner;
}
+
void
Axis_group_engraver::do_removal_processing ()
{
for (int i=0; i < elts_.size (); i++)
{
Score_element *par = elts_[i]->parent_l (Y_AXIS);
- if (!par || !axis_group (par).has_interface_b ())
- axis_group (staffline_p_).add_element (elts_[i]);
+ if (!par || !Axis_group_interface (par).has_interface_b ())
+ Axis_group_interface (staffline_p_).add_element (elts_[i]);
}
elts_.clear ();
}
#include "dimension-cache.hh"
Axis_group_interface::Axis_group_interface (Score_element*s)
- : Group_interface (s)
{
elt_l_ = s;
}
Axis_group_interface
-axis_group (Score_element*s)
+Axis_group_interface (Score_element*s)
{
return Axis_group_interface (s);
}
e->set_parent (elt_l_, a);
}
- Group_interface::add_element (e);
+ Group_interface (elt_l_).add_element (e);
elt_l_->add_dependency (e);
}
{
Score_element* e = unsmob_element (gh_car (ep));
if (e)
- childs.concat (axis_group (e).get_children ());
+ childs.concat (Axis_group_interface (e).get_children ());
}
return childs;
+++ /dev/null
-/*
- axis-group-item.cc -- implement Axis_group_interface
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#include "axis-group-item.hh"
-#include "axis-group-interface.hh"
-
-Axis_group_item ::Axis_group_item ()
-{
- axis_group (this).set_interface ();
-}
+++ /dev/null
-/*
- axis-group-spanner.cc -- implement Axis_group_spanner
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#include "axis-group-spanner.hh"
-#include "axis-group-interface.hh"
-
-Axis_group_spanner::Axis_group_spanner()
-{
- axis_group (this).set_interface ();
-}
#include "lily-guile.hh"
#include "span-bar.hh"
#include "base-span-bar-engraver.hh"
-#include "axis-align-spanner.hh"
Base_span_bar_engraver::Base_span_bar_engraver()
{
}
Array<Offset> ideals;
- Real x0 = first_visible_stem ()->hpos_f ();
+ Real x0 = first_visible_stem ()->relative_coordinate (0, X_AXIS);
for (int i=0; i < stem_count (); i++)
{
Stem* s = stem (i);
if (s->invisible_b ())
continue;
- ideals.push (Offset (s->hpos_f () - x0,
+ ideals.push (Offset (s->relative_coordinate (0, X_AXIS) - x0,
s->calc_stem_info ().idealy_f_));
}
Real dydx;
minimise_least_squares (&dydx, y, ideals); // duh, takes references
- Real dx = last_visible_stem ()->hpos_f () - x0;
+ Real dx = last_visible_stem ()->relative_coordinate (0, X_AXIS) - x0;
*dy = dydx * dx;
}
Real lengthened = paper_l ()->get_var ("beam_lengthened");
Real steep = paper_l ()->get_var ("beam_steep_slope");
- Real dx = last_visible_stem ()->hpos_f () - first_visible_stem ()->hpos_f ();
+ Real dx = last_visible_stem ()->relative_coordinate (0, X_AXIS) - first_visible_stem ()->relative_coordinate (0, X_AXIS);
Real dydx = dy && dx ? dy/dx : 0;
if (((y - first_ideal > lengthened) && (dydx > steep))
if (damping)
{
- Real dx = last_visible_stem ()->hpos_f ()
- - first_visible_stem ()->hpos_f ();
+ Real dx = last_visible_stem ()->relative_coordinate (0, X_AXIS)
+ - first_visible_stem ()->relative_coordinate (0, X_AXIS);
Real dydx = dy && dx ? dy/dx : 0;
dydx = 0.6 * tanh (dydx) / damping;
return dydx * dx;
int stem_multiplicity = (s->flag_i () - 2) >? 0;
Real interbeam_f = paper_l ()->interbeam_f (beam_multiplicity);
- Real x0 = first_visible_stem ()->hpos_f ();
- Real dx = last_visible_stem ()->hpos_f () - x0;
- Real stem_y = (dy && dx ? (s->hpos_f () - x0) / dx * dy : 0) + y;
+ Real x0 = first_visible_stem ()->relative_coordinate (0, X_AXIS);
+ Real dx = last_visible_stem ()->relative_coordinate (0, X_AXIS) - x0;
+ Real stem_y = (dy && dx ? (s->relative_coordinate (0, X_AXIS) - x0) / dx * dy : 0) + y;
/* knee */
Direction dir = directional_element(this).get ();
Molecule
Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
{
- if ((next && !(next->hpos_f () > here->hpos_f ())) ||
- (prev && !(prev->hpos_f () < here->hpos_f ())))
+ if ((next && !(next->relative_coordinate (0, X_AXIS) > here->relative_coordinate (0, X_AXIS))) ||
+ (prev && !(prev->relative_coordinate (0, X_AXIS) < here->relative_coordinate (0, X_AXIS))))
programming_error ("Beams are not left-to-right");
Real staffline_f = paper_l ()->get_var ("stafflinethickness");
Real stemdx = staffline_f;
Real dx = visible_stem_count () ?
- last_visible_stem ()->hpos_f () - first_visible_stem ()->hpos_f ()
+ last_visible_stem ()->relative_coordinate (0, X_AXIS) - first_visible_stem ()->relative_coordinate (0, X_AXIS)
: 0.0;
- Real dy = get_real ("height");
+ Real dy = gh_scm2double (get_elt_property ("height"));
Real dydx = dy && dx ? dy/dx : 0;
Molecule leftbeams;
Half beam should be one note-width,
but let's make sure two half-beams never touch
*/
- Real w = here->hpos_f () - prev->hpos_f ();
+ Real w = here->relative_coordinate (0, X_AXIS) - prev->relative_coordinate (0, X_AXIS);
w = w/2 <? nw_f;
Molecule a;
if (lhalfs) // generates warnings if not
int rhalfs = here->beam_count (RIGHT) - next->beam_count (LEFT);
int rwholebeams= here->beam_count (RIGHT) <? next->beam_count (LEFT) ;
- Real w = next->hpos_f () - here->hpos_f ();
+ Real w = next->relative_coordinate (0, X_AXIS) - here->relative_coordinate (0, X_AXIS);
Molecule a = lookup_l ()->beam (dydx, w + stemdx, thick);
a.translate_axis( - stemdx/2, X_AXIS);
int j = 0;
Real x0,dx;
if (visible_stem_count ())
{
- x0 = first_visible_stem ()->hpos_f ();
- dx = last_visible_stem ()->hpos_f () - x0;
+ x0 = first_visible_stem ()->relative_coordinate (0, X_AXIS);
+ dx = last_visible_stem ()->relative_coordinate (0, X_AXIS) - x0;
}
else
{
- x0 = stem (0)->hpos_f ();
- dx = stem_top ()->hpos_f () - x0;
+ x0 = stem (0)->relative_coordinate (0, X_AXIS);
+ dx = stem_top ()->relative_coordinate (0, X_AXIS) - x0;
}
- Real dy = get_real ("height");
+ Real dy = gh_scm2double (get_elt_property ("height"));
Real dydx = dy && dx ? dy/dx : 0;
- Real y = get_real ("y-position");
+ Real y = gh_scm2double (get_elt_property ("y-position"));
for (int j=0; j <stem_count (); j++)
{
Stem *i = stem (j);
Stem * next = (j < stem_count ()-1) ? stem (j+1) :0;
Molecule sb = stem_beams (i, next, prev);
- Real x = i->hpos_f ()-x0;
+ Real x = i->relative_coordinate (0, X_AXIS)-x0;
sb.translate (Offset (x, x * dydx + y));
mol.add_molecule (sb);
}
#include "engraver.hh"
#include "protected-scm.hh"
#include "break-align-item.hh"
-#include "axis-group-item.hh"
+#include "align-interface.hh"
#include "axis-group-interface.hh"
class Break_align_engraver : public Engraver
Break_align_engraver::add_column (SCM smob)
{
Score_element * e = unsmob_element (smob);
- align_l_->add_element (e);
+ Align_interface (align_l_).add_element (e);
typeset_element (e);
}
SCM name = ly_str02scm (inf.elem_l_->name());
SCM s = scm_assoc (name, column_alist_);
- Axis_group_item * group = 0;
+ Item * group = 0;
+
if (s != SCM_BOOL_F)
{
Score_element *e = unsmob_element (gh_cdr(s));
- group = dynamic_cast<Axis_group_item*> (e);
+ group = dynamic_cast<Item*> (e);
}
else
{
- group = new Axis_group_item;
- axis_group(group).set_axes (X_AXIS,X_AXIS);
+ group = new Item;
+
+ Axis_group_interface (group).set_interface ();
+ Axis_group_interface (group).set_axes (X_AXIS,X_AXIS);
+
group->set_elt_property ("origin", name);
group->set_parent (align_l_, Y_AXIS);
announce_element (Score_element_info (group, 0));
column_alist_ = scm_assoc_set_x (column_alist_, name, group->self_scm_);
}
- axis_group (group).add_element (item_l);
+ Axis_group_interface (group).add_element (item_l);
}
}
#include "paper-def.hh"
#include "paper-column.hh"
#include "group-interface.hh"
-
-/*
- Handle spacing for prefatory matter.
-
- TODO: rewrite this. It is kludgy
-*/
+#include "align-interface.hh"
void
Break_align_item::before_line_breaking ()
for (int i=0; i < all_elems.size(); i++)
{
- Interval y = all_elems[i]->extent(axis ());
+ Interval y = all_elems[i]->extent(X_AXIS);
if (!y.empty_b())
elems.push (dynamic_cast<Score_element*> (all_elems[i]));
}
scm_set_car_x (first_pair, gh_double2scm (-dists[0]));
elems[0]->set_elt_property ("minimum-space", first_pair);
-
- Axis_align_item::before_line_breaking ();
+ /*
+ Force callbacks for alignment to be called
+ */
+ Real unused = elems[0]->relative_coordinate (this, X_AXIS);
Real pre_space = elems[0]->relative_coordinate (column_l (), X_AXIS);
Real xl = elems[0]->extent (X_AXIS)[LEFT];
Break_align_item::Break_align_item ()
{
set_elt_property ("stacking-dir" , gh_int2scm (RIGHT));
- set_axis (X_AXIS);
+
+ Align_interface (this).set_interface ();
+ Align_interface (this).set_axis (X_AXIS);
add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS);
}
Collision::Collision()
{
- axis_group (this).set_axes (X_AXIS, Y_AXIS);
+ Axis_group_interface (this).set_interface ();
+ Axis_group_interface (this).set_axes (X_AXIS, Y_AXIS);
}
void
Collision::add_column (Note_column* ncol_l)
{
- axis_group (this).add_element (ncol_l);
+ Axis_group_interface (this).add_element (ncol_l);
add_dependency (ncol_l);
}
#include "cross-staff.hh"
#include "item.hh"
-#include "align-element.hh"
+#include "align-interface.hh"
#include "spanner.hh"
#include "warn.hh"
{
Real interstaff = 0.0;
Score_element *common = item->common_refpoint (span, Y_AXIS);
- Align_element * align = dynamic_cast<Align_element*> (common);
- if (align && align->axis() == Y_AXIS)
+ Align_interface align(common);
+
+ if (align.has_interface_b () && align.axis() == Y_AXIS)
{
- SCM threshold = align->get_elt_property ("threshold");
+ SCM threshold = common->get_elt_property ("threshold");
if (!gh_pair_p (threshold)
|| !scm_equal_p (gh_car (threshold), gh_cdr (threshold)))
warning (_ ("minVerticalAlign != maxVerticalAlign: cross staff spanners may be broken"));
note_refpoint = note_refpoint->parent_l (Y_AXIS);
int span_prio =
- align->get_count ((Score_element*) dynamic_cast<Score_element const*> (span_refpoint));
+ align.get_count ((Score_element*) dynamic_cast<Score_element const*> (span_refpoint));
int item_prio =
- align->get_count ((Score_element*) dynamic_cast<Score_element const *> (note_refpoint));
+ align.get_count ((Score_element*) dynamic_cast<Score_element const *> (note_refpoint));
/*
our staff is lower -> interstaff *= -1
#include "axis-group-interface.hh"
+// todo: dots and elements duplicate each other.
void
Dot_column::add_dots (Dots *d)
{
gi.add_element (d);
add_dependency (d);
- axis_group (this).add_element (d);
+ Axis_group_interface (this).add_element (d);
}
void
{
Group_interface gi (this, "dots");
gi.set_interface ();
-
directional_element (this).set (RIGHT);
- axis_group (this).set_axes(X_AXIS,X_AXIS);
+
+ Axis_group_interface (this).set_interface ();
+ Axis_group_interface (this).set_axes(X_AXIS,X_AXIS);
}
/*
* direction of text-dynamic-request if not equalt to direction
of line-spanner
-
- * FIXME: this has gotten a bit too hairy.
*/
class Dynamic_line_spanner : public Spanner
{
set_elt_property ("transparent", SCM_BOOL_T);
side_position (this).set_axis (Y_AXIS);
- axis_group (this).set_interface ();
- axis_group (this).set_axes (X_AXIS, Y_AXIS);
+ Axis_group_interface (this).set_interface ();
+ Axis_group_interface (this).set_axes (X_AXIS, Y_AXIS);
}
void
Dynamic_line_spanner::add_element (Score_element* e)
{
e->set_parent (this, Y_AXIS);
- axis_group (this).add_element (e);
+ Axis_group_interface (this).add_element (e);
}
/**
Dynamic_line_spanner* finished_line_spanner_;
Moment last_request_mom_;
- Array<Note_column*> pending_column_arr_;
+ Note_column* pending_column_;
Link_array<Score_element> pending_element_arr_;
void typeset_all ();
finished_line_spanner_ = 0;
span_start_req_l_ = 0;
cresc_p_ =0;
+ pending_column_ = 0;
text_req_l_ = 0;
span_req_l_drul_[START] = 0;
text_req_l_ = 0;
span_req_l_drul_[START] = 0;
span_req_l_drul_[STOP] = 0;
+
+ /* ugr; we must attach the Dynamic_line_spanner to something
+ to be sure that the linebreaker will not be confused
+ */
+ // if (line_spanner_)
+ // line_spanner_->add_column (LEFT, get_staff_info ().command_pcol_l ());
}
bool
&& pending_element_arr_.size ())
{
line_spanner_ = new Dynamic_line_spanner;
- for (int i = 0; i < pending_column_arr_.size (); i++)
- line_spanner_->add_column (pending_column_arr_[i]);
- pending_column_arr_.clear ();
+ assert (pending_column_);
+ line_spanner_->add_column (pending_column_);
announce_element (Score_element_info
(line_spanner_,
text_req_l_ ? text_req_l_ : span_req_l_drul_[START]));
}
if (span_req_l_drul_[START] || span_req_l_drul_[STOP] || text_req_l_)
- {
- last_request_mom_ = now_mom ();
- }
- /*
- TODO: This should be optionised:
- * break when group of dynamic requests ends
- * break now (only if no cresc. in progress)
- * continue through piece */
+ last_request_mom_ = now_mom ();
else
{
- /*
- During a (de)crescendo, pending request will not be cleared,
- and a line-spanner will always be created, as \< \! are already
- two requests.
+#if 0
+ /*
Maybe always creating a line-spanner for a (de)crescendo (see
below) is not a good idea:
Urg, but line-spanner must always have at least same duration
as (de)crecsendo, b.o. line-breaking.
*/
+ if (now_mom () > last_request_mom_)
+#else
+ /*
+ During a (de)crescendo, pending request will not be cleared,
+ and a line-spanner will always be created, as \< \! are already
+ two requests.
+ */
if (now_mom () > last_request_mom_ && !span_start_req_l_)
+#endif
{
for (int i = 0; i < pending_element_arr_.size (); i++)
{
e->set_elt_property ("minimum-space", s);
}
pending_element_arr_.clear ();
- if (line_spanner_)
- {
- for (int i = 0; i < pending_column_arr_.size (); i++)
- line_spanner_->add_column (pending_column_arr_[i]);
- pending_column_arr_.clear ();
- finished_line_spanner_ = line_spanner_;
- line_spanner_ = 0;
- }
+ finished_line_spanner_ = line_spanner_;
+ line_spanner_ = 0;
}
}
else
{
assert (!finished_cresc_p_);
- cresc_p_->set_bound (RIGHT, get_staff_info ().musical_pcol_l ());
+ cresc_p_->set_bound(RIGHT, get_staff_info ().musical_pcol_l ());
finished_cresc_p_ = cresc_p_;
cresc_p_ = 0;
span_start_req_l_ = 0;
+ "Spanner", SCM_UNDEFINED);
}
- cresc_p_->set_bound (LEFT, get_staff_info ().musical_pcol_l ());
+ cresc_p_->set_bound(LEFT, get_staff_info ().musical_pcol_l ());
/*
typeset_element (text_p_);
text_p_ = 0;
}
+
+ /*
+ TODO: This should be optionised:
+ * break when group of dynamic requests ends
+ * break now
+ * continue through piece */
+ // if (line_spanner_ && last_request_mom_ < now_mom ())
if (finished_line_spanner_)
{
side_position (finished_line_spanner_).add_staff_support ();
}
else
{
- pending_column_arr_.push (n);
+ pending_column_ = n;
}
}
}
(ly_symbol2scm ("dynamic-absolute-volume"),
ly_quote_scm (ly_str02scm (text_script_req_l_->text_str_.ch_C ())),
SCM_UNDEFINED));
- Real volume = gh_scm2double (ly_eval_str ("dynamic-default-volume"));
+ int volume = gh_scm2int (ly_eval_str ("dynamic-default-volume"));
if (gh_number_p (s))
- volume = gh_scm2double (s);
-
- /*
- urg, code duplication:: staff_performer
- */
- s = get_property ("midiInstrument");
-
- if (!gh_string_p(s))
- s = get_property ("instrument");
-
- if (!gh_string_p(s))
- s = ly_str02scm ("piano");
+ volume = gh_scm2int (s);
-
- /*
- properties override default equaliser setting
- */
- SCM min = get_property ("midiMinimumVolume");
- SCM max = get_property ("midiMaximumVolume");
- if (gh_number_p (min) || gh_number_p (max))
- {
- Interval iv (0, 1);
- if (gh_number_p (min))
- iv[MIN] = gh_scm2double (min);
- if (gh_number_p (max))
- iv[MAX] = gh_scm2double (max);
- volume = iv[MIN] + iv.length () * volume;
- }
- else
- {
- s = scm_eval (gh_list (ly_symbol2scm ("instrument-equaliser"),
- s, SCM_UNDEFINED));
- if (gh_pair_p (s))
- {
- Interval iv;
- iv[MIN] = gh_scm2double (gh_car (s));
- iv[MAX] = gh_scm2double (gh_cdr (s));
- volume = iv[MIN] + iv.length () * volume;
- }
- }
-
audio_p_ = new Audio_dynamic (volume);
Audio_element_info info (audio_p_, text_script_req_l_);
announce_element (info);
*/
#include "grace-align-item.hh"
+#include "align-interface.hh"
#include "lookup.hh"
#include "paper-column.hh"
#include "paper-def.hh"
Grace_align_item::Grace_align_item ()
{
set_elt_property ("stacking-dir", gh_int2scm (RIGHT));
- set_axis (X_AXIS);
+ Align_interface (this).set_interface();
+ Align_interface (this).set_axis (X_AXIS);
}
void
gh_cons (gh_double2scm (nhw* 1.5),
gh_double2scm (infinity_f)));
column_l ()->set_elt_property ("contains-grace", SCM_BOOL_T);
-
-
- Axis_align_item::before_line_breaking ();
- // translate_axis (-0.5* nhw, X_AXIS); // ugh.
}
warning (_("Unattached grace notes. Attaching to last musical column."));
align_l_->set_parent (0, X_AXIS);
- axis_group(last_musical_col_l_).add_element (align_l_);
+ Axis_group_interface (last_musical_col_l_).add_element (align_l_);
}
last_musical_col_l_ = get_staff_info ().musical_pcol_l ();
#include "hara-kiri-engraver.hh"
#include "rhythmic-head.hh"
-Axis_group_spanner*
+Spanner*
Hara_kiri_engraver::get_spanner_p () const
{
return new Hara_kiri_group_spanner;
Hara_kiri_group_spanner::Hara_kiri_group_spanner()
{
set_elt_property ("items-worth-living", SCM_EOL);
- axis_group (this).set_axes(Y_AXIS,Y_AXIS);
}
void
if (gh_pair_p (worth))
return;
- Link_array<Score_element> childs = axis_group (this).get_children ();
+ Link_array<Score_element> childs = Axis_group_interface (this).get_children ();
for (int i = 0; i < childs.size (); i++)
{
Score_element* s = childs[i];
+++ /dev/null
-/*
- align-item.hh -- declare Align_elem
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef VERTICAL_ALIGN_ITEM_HH
-#define VERTICAL_ALIGN_ITEM_HH
-
-#include "score-element.hh"
-
-/**
- Order elements top to bottom/left to right/right to left etc..
-
- TODO: implement padding.
-
- document usage of this.
-
-
-
- *******
-
- element properties
-
- stacking-dir
-
- Which side to align? -1: left side, 0: centered (around
- center_l_ if not nil, or around center of width), 1: right side
-
-
-*/
-class Align_element : public virtual Score_element {
-public:
- Axis axis () const;
-
- Align_element ();
- void set_axis (Axis);
- int get_count (Score_element*)const;
- void add_element (Score_element *);
- static Real alignment_callback (Dimension_cache const *);
-protected:
- virtual void do_side_processing (Axis);
-
-};
-#endif // VERTICAL_ALIGN_ITEM_HH
--- /dev/null
+/*
+ align-interface.hh -- declare Align_interface
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef ALIGN_INTERFACE_HH
+#define ALIGN_INTERFACE_HH
+
+#include "axes.hh"
+#include "lily-proto.hh"
+
+/*
+ TODO: rewrite this comment.
+
+
+ Order elements top to bottom/left to right/right to left etc..
+
+ TODO: implement padding.
+
+ document usage of this.
+
+
+
+ *******
+
+ element properties
+
+ stacking-dir
+
+ Which side to align? -1: left side, 0: centered (around
+ center_l_ if not nil, or around center of width), 1: right side
+ */
+struct Align_interface {
+ Score_element * elt_l_;
+
+ Align_interface (Score_element const*);
+ static Real alignment_callback (Dimension_cache const *);
+ void do_side_processing (Axis a);
+ void set_axis (Axis);
+ Axis axis () const;
+ void add_element (Score_element*);
+ int get_count (Score_element*)const;
+ void set_interface ();
+ bool has_interface_b ();
+};
+
+#endif /* ALIGN_INTERFACE_HH */
+
class Audio_dynamic : public Audio_item
{
public:
- Audio_dynamic (Real volume);
+ Audio_dynamic (int volume);
- Real volume_;
+ int volume_i_;
};
class Audio_key : public Audio_item
+++ /dev/null
-/*
- axis-align-item.hh -- declare Axis_align_item
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#ifndef AXIS_ALIGN_ITEM_HH
-#define AXIS_ALIGN_ITEM_HH
-
-#include "align-element.hh"
-#include "axis-group-item.hh"
-
-/*
- UGH. FIXME: multiple inheritance.
- */
-class Axis_align_item : public virtual Align_element, public virtual Axis_group_item
-{
-public:
- Axis_align_item ();
-protected:
- virtual void do_print ()const;
-
-};
-#endif /* AXIS_ALIGN_ITEM_HH */
-
+++ /dev/null
-/*
- vertical-align-spanner.hh -- declare Vertical_align_spanner
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef VERTICAL_ALIGN_SPANNER_HH
-#define VERTICAL_ALIGN_SPANNER_HH
-
-#include "spanner.hh"
-#include "align-element.hh"
-#include "axis-group-spanner.hh"
-
-/*
- FIXME: multiple inheritance
- */
-class Axis_align_spanner : public virtual Align_element, public virtual Axis_group_spanner
-{
-public:
- VIRTUAL_COPY_CONS(Score_element);
- Axis_align_spanner ();
- virtual void do_print() const {}
-};
-#endif // VERTICAL_ALIGN_SPANNER_HH
class Axis_group_engraver : public Engraver
{
protected:
- Axis_group_spanner *staffline_p_;
+ Spanner *staffline_p_;
Link_array<Score_element> elts_;
virtual void do_creation_processing();
virtual void do_removal_processing();
virtual void acknowledge_element (Score_element_info);
virtual void process_acknowledged ();
- virtual Axis_group_spanner* get_spanner_p () const;
+ virtual Spanner* get_spanner_p () const;
public:
VIRTUAL_COPY_CONS(Translator);
#include "group-interface.hh"
-struct Axis_group_interface : Group_interface
+/**
+ Treat a group of elements as a union. This sets the parent of any S
+ added to ELT_L_ to ELT_L_.
+
+ Properties:
+
+ axes -- list of axis (number) in which this group works
+
+ transparent -- an Axis_group is transparent by default
+
+ elements -- contains list of pointers to other elements
+
+ interfaces -- Axis_group is added to this list.
+*/
+struct Axis_group_interface
{
+ Score_element *elt_l_;
Axis_group_interface (Score_element*);
+
static Interval group_extent_callback (Dimension_cache const*);
+
void add_element (Score_element*);
void set_axes (Axis,Axis);
bool axis_b (Axis)const;
void set_interface ();
};
-Axis_group_interface
-axis_group (Score_element*);
-
#endif /* AXIS_GROUP_INTERFACE_HH */
-/*
- axis-item.hh -- declare Axis_group_item
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef AXIS_ITEM_HH
-#define AXIS_ITEM_HH
-
-#include "item.hh"
-
-class Axis_group_item : public virtual Item
-{
-public:
- Axis_group_item ();
- VIRTUAL_COPY_CONS(Score_element);
-};
-
-#endif // AXIS_ITEM_HH
+#error
-/*
- axis-group-spanner.hh -- declare Axis_group_spanner
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef AXIS_GROUP_SPANNER_HH
-#define AXIS_GROUP_SPANNER_HH
-
-#include "spanner.hh"
-
-/**
- An element which groups a line in a certain direction. The most
- useful example of this is the Vertical_group_spanner
-*/
-class Axis_group_spanner : public virtual Spanner
-
-{
-public:
- Axis_group_spanner ();
- VIRTUAL_COPY_CONS(Score_element);
-};
-
-#endif // SPAN_AXIS_GROUP_HH
+#error
#ifndef BREAK_ALIGN_ITEM_HH
#define BREAK_ALIGN_ITEM_HH
-#include "axis-align-item.hh"
+#include "item.hh"
/// align breakable items (clef, bar, etc.)
-class Break_align_item : public Axis_align_item {
-
-
+class Break_align_item : public Item
+{
protected:
virtual void before_line_breaking ();
public:
#ifndef COLLISION_HH
#define COLLISION_HH
#include "lily-proto.hh"
-#include "axis-group-item.hh"
+#include "item.hh"
#include "tuple.hh"
//junkme, use SCM conses.
multistaff support (see Chlapik: equal noteheads should be on the
same hpos.)
*/
-class Collision : public Axis_group_item {
+class Collision : public Item
+{
protected:
Array<Shift_tup> automatic_shift ();
Array<Shift_tup> forced_shift ();
class Context_specced_music : public Music_wrapper
{
public:
- /** The kind of translation needed for this music. This doesn't
- make sense for simple (ie non-list) music, but it does no harm
- here. Yes, it did harm Music_sequence: you can forget to copy it.
-
- */
+ /// The kind of translation needed for this music.
String translator_type_str_;
/// what identification for the translation unit
#ifndef DOT_COLUMN_HH
#define DOT_COLUMN_HH
-#include "axis-group-item.hh"
+#include "item.hh"
/**
Group dots. This is needed because, the dots have to be aligned per voice
*/
-class Dot_column : public Axis_group_item
+class Dot_column : public Item
{
static int compare (Dots * const&,Dots * const&);
void add_dots (Dots*);
#define GRACE_ALIGN_ITEM_HH
-#include "axis-align-item.hh"
+#include "item.hh"
-class Grace_align_item : public Axis_align_item
+class Grace_align_item : public Item
{
public:
VIRTUAL_COPY_CONS (Score_element);
#include "lily-guile.hh"
#include "smobs.hh"
-/*
- rename to list interface?
- */
-
/**
Look at Score element ELT as thing which has a list property called
NAME_. Normally the list would contain Score_elements, but
sometimes it can be different things.
+
+ todo: reename as list_interface?
*/
+
struct Group_interface
{
Score_element * elt_l_;
class Hara_kiri_engraver : public Axis_group_engraver
{
protected:
- virtual Axis_group_spanner*get_spanner_p ()const;
+ virtual Spanner*get_spanner_p ()const;
virtual void acknowledge_element (Score_element_info);
public:
VIRTUAL_COPY_CONS(Translator);
#ifndef HARA_KIRI_VERTICAL_GROUP_SPANNER_HH
#define HARA_KIRI_VERTICAL_GROUP_SPANNER_HH
-#include "axis-group-spanner.hh"
+#include "spanner.hh"
/**
As Vertical_group_spanner, but keep track of interesting items. If
we don't contain any interesting items after linebreaking, then
gracefully commit suicide. Objective: don't disgrace Lily by
typesetting empty lines in orchestral scores. */
-class Hara_kiri_group_spanner : public Axis_group_spanner
+class Hara_kiri_group_spanner : public Spanner
{
public:
Hara_kiri_group_spanner ();
NB. This doesn't mean an Item has to initialize the output field before
spacing calculation.
-
- @signature
- visibility_lambda :: int -> (bool . bool)
-
- @in
- break direction
-
- @out
- (transparent, empty) cons
-
- */
-class Item : public virtual Score_element {
- void do_break ();
- void try_visibility_lambda ();
-public:
- /*
- ugh.
+ Element properties
+
+ visibility-lambda -- a function that takes the break
+ direction and returns a (transparent, empty) cons
+
+ breakable -- boolean indicating if this is a breakable item (clef,
+ barline, key sig, etc.)
+
*/
+class Item : public Score_element
+{
Drul_array<Item*> broken_to_drul_;
-
+ void do_break ();
+ void try_visibility_lambda ();
public:
+ VIRTUAL_COPY_CONS(Score_element);
+ Item();
+ Item (Item const &);
- /// I am really to be broken?
bool breakable_b () const;
bool broken_b () const;
Item * find_broken_piece (Direction) const;
Score_element * find_broken_piece (Line_of_score*) const;
- Item();
- Real hpos_f() const;
-
virtual Line_of_score * line_l() const;
virtual Paper_column * column_l () const;
-
- static int left_right_compare (Item const *, Item const*);
-
- Item (Item const &);
protected:
virtual void do_breakable_col_processing();
-
void copy_breakable_items();
};
struct Audio_time_signature;
struct Auto_beam_engraver;
struct Axis_align_item;
-struct Axis_group;
-struct Axis_group_element;
-struct Axis_group_item;
-struct Axis_group_spanner;
struct Bar;
struct Bar_column;
struct Bar_column_engraver;
struct Tuplet_spanner;
struct Unfolded_repeat_iterator;
struct Vertical_brace;
-struct Vertical_spanner;
struct Volta_spanner;
struct Moment;
*/
class Line_group_engraver_group : public Engraver_group_engraver {
protected:
- Axis_group_spanner *staffline_p_;
+ Spanner *staffline_p_;
virtual void create_line_spanner ();
virtual void do_creation_processing();
#define SCORELINE_HH
#include "column-x-positions.hh"
-#include "axis-group-spanner.hh"
-#include "super-element.hh"
+#include "spanner.hh"
/// the columns of a score that form one line. FIXME: multiple inheritance
-class Line_of_score : public Axis_group_spanner, public Super_element
+class Line_of_score : public Spanner
{
public:
+
+
+/*
+ imported the following from Super_element
+
+ The toplevel element. The Paper_score contains this element, and any
+ element shoud be a dependency for the super element.
+
+ It is the entry point for the "constraint solver"/ dependency
+ tracker. Every XXXX_processing () call traverses the entire
+ dependency graph, and calls the appropriate
+ Score_element::do_XXX_processing function on each Score_element it encounters.
+
+
+ FIXME: remove this class, to eliminate multiple inheritance. Merge
+ with Line_of_score ? */
+ void space_processing ();
+ void pre_processing();
+ void breakable_col_processing();
+ void post_processing();
+ void output_all ();
+
int rank_i_;
Line_of_score();
void add_column (Paper_column*);
protected:
- virtual void do_print() const;
VIRTUAL_COPY_CONS(Score_element);
};
#define NOTE_COLUMN_HH
#include "item.hh"
-#include "axis-group-item.hh"
/** a struct for treating a group of noteheads (noteheads, stem
- (chord) and scripts) as a single entity. */
-class Note_column : public Axis_group_item {
+ (chord) and scripts) as a single entity.
+*/
+class Note_column : public Item
+{
protected:
virtual void after_line_breaking () ;
public:
-
static int shift_compare (Note_column *const &, Note_column*const&);
/** The relative position of the "voice" containing this
#ifndef P_COL_HH
#define P_COL_HH
-#include "axis-group-item.hh"
+#include "item.hh"
#include "rod.hh"
#include "spring.hh"
\end{itemize}
*/
-class Paper_column : public Axis_group_item {
+class Paper_column : public Item
+{
public:
VIRTUAL_COPY_CONS(Score_element);
Drul_array<Array<Column_rod> > minimal_dists_arr_drul_;
-/*
- score-halign-engraver.hh -- declare Score_horizontal_align_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef FSCORE_HALIGN_GRAV_HH
-#define FSCORE_HALIGN_GRAV_HH
-
-#include "engraver.hh"
-
-class Priority_horizontal_align_engraver : public Engraver {
- Break_align_item * halign_p_;
-public:
- VIRTUAL_COPY_CONS(Translator);
-
- Priority_horizontal_align_engraver();
-protected:
- virtual void acknowledge_element (Score_element_info);
- virtual void do_pre_move_processing();
-};
-#endif // Priority_HALIGN_GRAV_HH
+#error
typedef void (Score_element::*Score_element_method_pointer) (void);
-/** Both Spanner and Item are Score_element's. Most Score_element's depend
- on other Score_element's, eg, Beam needs to know and set direction of
- Stem. So the Beam has to be calculated *before* Stem. This is
- accomplished with the dependencies fields of struct Score_element,
- which are implemented in the Directed_graph_node class: all elements
- form an acyclic graph.
+/**
+ Basic output object.
- (elem)
+ Element Properties:
+ transparent -- boolean: if true, do not print anything black.
-Element Properties:
+ dependencies -- list of score-element pointers that indicate who to
+ compute first.
-Boolean (true iff defined)
+ interfaces -- list of symbols indicating the interfaces supported
+ by this object.
- break_helper_only -- if defined try to junk this after calcing breakpoints.
-
- transparent -- do not calc. output
+ extra-offset -- pair of reals (a cons) forcing an extra offset
+ before outputting
+ glyph -- afm character name to output.
+
*/
class Score_element {
/**
/**
Set this if anyone points to me, or if I point to anyone.
+
+ JUNKME.
*/
bool used_b_;
#include "spanner.hh"
#include "item.hh"
+
+/**
+ Position victim object (ELT_L_) next to other objects (the support).
+
+ side-support -- list of score elements
+
+ direction -- where to put the victim object (left or right?)
+
+ side-relative-direction -- if set: get the direction from a different object, and multiply by this.
+
+ direction-source -- in case side-relative-direction is set, where
+ to get the direction
+
+ minimum-space -- minimum distance that the victim should move
+ (after padding)
+
+ padding -- add this much extra space between victim and support
+
+ TODO: move out unrelated callbacks.
+
+ */
struct Side_position_interface
{
Score_element * elt_l_;
VIRTUAL_COPY_CONS(Score_element);
void add_bar (Score_element*);
- void set_align (Align_element *);
protected:
void evaluate_empty ();
Examples
- \begin{itemize}
- \item (de)crescendo
- \item slur
- \item beam
- \item bracket
- \end{itemize}
-
+ * (de)crescendo
+ * slur
+ * beam
+ * bracket
Spanner should know about the items which it should consider:
e.g. slurs should be steep enough to "enclose" all those items. This
length of stems of notes they encompass.
*/
-class Spanner : public virtual Score_element {
+class Spanner : public Score_element {
Drul_array<Item*> spanned_drul_;
public:
#ifndef Super_element_HH
#define Super_element_HH
+#error
#include "score-element.hh"
-/** The toplevel element. The Paper_score contains this element, and any
- element shoud be a dependency for the super element.
-
- It is the entry point for the "constraint solver"/ dependency
- tracker. Every XXXX_processing () call traverses the entire
- dependency graph, and calls the appropriate
- Score_element::do_XXX_processing function on each Score_element it encounters.
-
-
- FIXME: remove this class, to eliminate multiple inheritance. Merge
- with Line_of_score ? */
-class Super_element : public virtual Score_element {
-public:
- void space_processing ();
- void pre_processing();
- void breakable_col_processing();
- void post_processing();
- void output_all ();
-};
#endif // Super_element_HH
+++ /dev/null
-/*
- vertical-align-engraver.hh -- declare Vertical_align_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef VERTICAL_ALIGN_GRAV_HH
-#define VERTICAL_ALIGN_GRAV_HH
-
-#include "engraver.hh"
-class Axis_align_spanner;
-class Vertical_align_engraver : public Engraver {
- Axis_align_spanner * valign_p_;
- bool qualifies_b (Score_element_info) const;
-public:
- VIRTUAL_COPY_CONS(Translator);
-
- Vertical_align_engraver();
-protected:
-
- virtual void acknowledge_element (Score_element_info);
- virtual void do_creation_processing();
- virtual void do_removal_processing();
-};
-
-#endif // VERTICAL_ALIGN_GRAV_HH
broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0;
}
+/**
+ Item copy ctor. Copy nothing: everything should be a elt property
+ or a special purpose poitner (such as broken_to_drul_[]) */
+Item::Item (Item const &s)
+ : Score_element (s)
+{
+ broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] =0;
+}
+
+
+
bool
Item::breakable_b () const
{
return (i) ? i->breakable_b () : to_boolean (get_elt_property( "breakable"));
}
-Real
-Item::hpos_f() const
-{
- return relative_coordinate (0, X_AXIS);
-}
-
Line_of_score *
Item::line_l() const
{
return dynamic_cast<Item*> (parent_l (X_AXIS))->column_l ();
}
-Item::Item (Item const &s)
- : Score_element (s)
-{
- broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] =0;
-}
-
Direction
Item::break_status_dir () const
{
*/
#include "staff-symbol.hh"
-#include "axis-group-spanner.hh"
#include "command-request.hh"
#include "bar.hh"
#include "debug.hh"
Line_group_engraver_group::typeset_element (Score_element *elem)
{
if (!elem->parent_l (Y_AXIS))
- axis_group (staffline_p_).add_element (elem);
+ Axis_group_interface (staffline_p_).add_element (elem);
Engraver_group_engraver::typeset_element (elem);
}
void
Line_group_engraver_group::create_line_spanner ()
{
- staffline_p_ = new Axis_group_spanner ;
- axis_group (staffline_p_).set_axes (Y_AXIS,Y_AXIS);
+ staffline_p_ = new Spanner ;
+ Axis_group_interface (staffline_p_).set_interface ();
+ Axis_group_interface (staffline_p_).set_axes (Y_AXIS,Y_AXIS);
}
(c) 1996--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include "axis-group-interface.hh"
+#include "debug.hh"
#include "line-of-score.hh"
+#include "main.hh"
+#include "paper-column.hh"
#include "paper-def.hh"
#include "paper-outputter.hh"
-#include "paper-column.hh"
#include "paper-score.hh"
+#include "string.hh"
#include "warn.hh"
-#include "main.hh"
-#include "debug.hh"
-#include "axis-group-interface.hh"
Line_of_score::Line_of_score()
{
set_elt_property ("columns", SCM_EOL);
- axis_group (this).set_axes (Y_AXIS,X_AXIS);
+ Axis_group_interface (this).set_interface ();
+ Axis_group_interface (this).set_axes (Y_AXIS,X_AXIS);
}
{
set_elt_property ("columns",
gh_cons (p->self_scm_, get_elt_property ("columns")));
- axis_group (this).add_element (p);
+ Axis_group_interface (this).add_element (p);
}
-void
-Line_of_score::do_print() const
-{
- Spanner::do_print();
- Axis_group_spanner::do_print ();
-}
void
Line_of_score::output_line (bool last_line)
translate_axis (- i[MAX], Y_AXIS);
pscore_l_->outputter_l_->start_line (i.length ());
- Super_element::output_all ();
+ output_all ();
if (last_line)
pscore_l_->outputter_l_->stop_last_line();
else
{
return p1->rank_i_ - p2->rank_i_;
}
+
+
+
+/**
+ for administration of what was done already
+ */
+enum Score_element_status {
+ ORPHAN=0, // not yet added to pstaff
+ VIRGIN, // added to pstaff
+ PREBROKEN,
+ PREBROKEN_SECOND,
+ PRECALCING,
+ PRECALCED, // calcs before spacing done
+ SPACING,
+ SPACED,
+ BROKEN,
+ BROKEN_SECOND,
+ POSTCALCING, // busy calculating. This is used to trap cyclic deps.
+ POSTCALCED, // after spacing calcs done
+ BREWING,
+ BREWED,
+};
+
+void
+Line_of_score::pre_processing ()
+{
+ calculate_dependencies (PRECALCED, PRECALCING, &Score_element::before_line_breaking);
+}
+
+void
+Line_of_score::space_processing ()
+{
+ calculate_dependencies (SPACED, SPACING, &Score_element::do_space_processing);
+}
+
+/* for break processing, use only one status, because copies have to
+ have correct status. (Previously,
+ Score_element::handle_[pre]broken_dependencies assigned to status_i_
+ */
+void
+Line_of_score::breakable_col_processing ()
+{
+ calculate_dependencies (PREBROKEN, PREBROKEN, &Score_element::do_breakable_col_processing);
+ // calculate_dependencies (PREBROKEN_SECOND, PREBROKEN_SECOND, &Score_element::handle_prebroken_dependents);
+}
+
+
+void
+Line_of_score::post_processing ()
+{
+ // calculate_dependencies (BROKEN_SECOND, BROKEN_SECOND,
+ // &Score_element::handle_broken_dependents);
+ calculate_dependencies (POSTCALCED, POSTCALCING, &Score_element::after_line_breaking);
+}
+
+void
+Line_of_score::output_all ()
+{
+ calculate_dependencies (BREWED, BREWING, &Score_element::output_processing);
+}
+
+
+
+
07 MSB
27 LSB
*/
- static Real const full_scale = 127;
-
str += to_str ((char)0x07);
- int volume = (int)(audio_l_->volume_*full_scale);
- str += to_str ((char)volume);
+ str += to_str ((char)audio_l_->volume_i_);
return str;
}
{
set_elt_property ("rests", SCM_EOL);
set_elt_property ("note-heads", SCM_EOL);
- axis_group (this).set_axes (X_AXIS, Y_AXIS);
+ Axis_group_interface (this).set_interface ();
+ Axis_group_interface (this).set_axes (X_AXIS, Y_AXIS);
}
Stem *
set_elt_property ("stem", stem_l->self_scm_);
add_dependency (stem_l);
- axis_group (this).add_element (stem_l);
+ Axis_group_interface (this).add_element (stem_l);
}
Group_interface gi (this, "note-heads");
gi.add_element (nh);
}
- axis_group (this).add_element (h);
+ Axis_group_interface (this).add_element (h);
}
/**
void
Note_column::set_dotcol (Dot_column *d)
{
- axis_group (this).add_element (d);
+ Axis_group_interface (this).add_element (d);
}
/*
beam_y = gh_scm2double (s);
- Real x0 = b->first_visible_stem ()->hpos_f ();
- Real dx = b->last_visible_stem ()->hpos_f () - x0;
+ Real x0 = b->first_visible_stem ()->relative_coordinate (0, X_AXIS);
+ Real dx = b->last_visible_stem ()->relative_coordinate (0, X_AXIS) - x0;
Real dydx = beam_dy && dx ? beam_dy/dx : 0;
Direction d = stem_l ()->get_direction ();
- Real beamy = (stem_l ()->hpos_f () - x0) * dydx + beam_y;
+ Real beamy = (stem_l ()->relative_coordinate (0, X_AXIS) - x0) * dydx + beam_y;
s = get_elt_property ("rests");
Score_element * se = unsmob_element (gh_car (s));
return line_l_;
}
-
-
-
Paper_column*
Paper_column::column_l () const
{
return (Paper_column*)(this);
}
-
-
-
Paper_column::Paper_column (Moment w)
{
SCM when = (new Moment (w))->smobify_self ();
scm_unprotect_object (when);
set_elt_property ("when", when);
-
- axis_group (this).set_axes (X_AXIS, X_AXIS);
+
+ Axis_group_interface (this).set_interface ();
+ Axis_group_interface (this).set_axes (X_AXIS, X_AXIS);
line_l_=0;
rank_i_ = -1;
}
return s != Moment(0);
}
+
delete dim_cache_[Y_AXIS];
}
-
-Real
-Score_element::get_real (String s) const
-{
- return gh_scm2double (get_elt_property (s));
-}
-
-void
-Score_element::set_real (String s, Real r)
-{
- set_elt_property (s, gh_double2scm (r));
-}
-
// should also have one that takes SCM arg.
SCM
Score_element::get_elt_property (String nm) const
{
Score_element * newparent = parent->find_broken_piece (line_l ());
set_parent (newparent, ax);
+ if (!newparent)
+ {
+ programming_error ("Orphaned score-element.");
+ }
}
if (Item * i = dynamic_cast<Item*> (this))
}
}
if (!elem_p->parent_l(Y_AXIS))
- axis_group (scoreline_l_).add_element (elem_p);
+ Axis_group_interface (scoreline_l_).add_element (elem_p);
}
elem_p_arr_.clear();
}
if (elt_l_->get_elt_property ("side-support") == SCM_UNDEFINED)
elt_l_->set_elt_property ("side-support" ,SCM_EOL);
- elt_l_->add_offset_callback (aligned_side, a);
+ if (!elt_l_->has_offset_callback_b (aligned_side, a))
+ elt_l_->add_offset_callback (aligned_side, a);
}
if (!stem_l)
{
warning (_ ("Slur over rest?"));
- o[X_AXIS] = col->hpos_f ();
+ o[X_AXIS] = col->relative_coordinate (0, X_AXIS);
o[Y_AXIS] = col->extent (Y_AXIS)[dir];
return o;
}
Direction stem_dir = directional_element (stem_l).get ();
- o[X_AXIS] = stem_l->hpos_f ();
+ o[X_AXIS] = stem_l->relative_coordinate (0, X_AXIS);
/*
Simply set x to middle of notehead
*/
else
{
- dx_f_drul_[d] = stem_l->hpos_f ()
+ dx_f_drul_[d] = stem_l->relative_coordinate (0, X_AXIS)
- get_bound (d)->relative_coordinate (0, X_AXIS);
/*
side attached to beamed stem
#include "dimensions.hh"
#include "paper-def.hh"
#include "molecule.hh"
-#include "align-element.hh"
#include "warn.hh"
#include "group-interface.hh"
Span_dynamic_performer::do_process_music ()
{
if (finished_dynamic_tuple_arr_.size () > 1
- && finished_dynamic_tuple_arr_.top ().audio_l_->volume_)
+ && finished_dynamic_tuple_arr_.top ().audio_l_->volume_i_)
{
- Real start_volume = finished_dynamic_tuple_arr_[0].audio_l_->volume_;
- Real dv = finished_dynamic_tuple_arr_.top ().audio_l_->volume_
+ Real start_volume = finished_dynamic_tuple_arr_[0].audio_l_->volume_i_;
+ Real dv = finished_dynamic_tuple_arr_.top ().audio_l_->volume_i_
- start_volume;
/*
urg.
*/
if (!dv || sign (dv) != finished_dir_)
{
- // urg. 10%: about one volume step
- dv = (Real)finished_dir_ * 0.1;
+ // urg. about one volume step
+ dv = (int)finished_dir_ * 13;
if (!start_volume)
start_volume = finished_dynamic_tuple_arr_.top
- ().audio_l_->volume_ - dv;
+ ().audio_l_->volume_i_ - dv;
}
Moment start_mom = finished_dynamic_tuple_arr_[0].mom_;
Moment dt = finished_dynamic_tuple_arr_.top ().mom_ - start_mom;
Audio_dynamic_tuple* a = &finished_dynamic_tuple_arr_[i];
Real volume = start_volume + dv * (Real)(a->mom_ - start_mom)
/ (Real)dt;
- a->audio_l_->volume_ = volume;
+ a->audio_l_->volume_i_ = (int)volume;
}
finished_dynamic_tuple_arr_.clear ();
}
#include "line-of-score.hh"
#include "break-align-item.hh"
-
void
-Spanner::do_break_processing ()
+Spanner::do_break_processing()
{
//break_into_pieces
- Item * left = spanned_drul_[LEFT];
- Item * right = spanned_drul_[RIGHT];
-
- if (left == right)
- {
- warning (_f ("Spanner `%s' has equal left and right spanpoints",
- classname (this)));
- }
-
- /*
- Check if our parent in X-direction spans equally wide
- or wider than we do.
- */
- for (int a = X_AXIS; a < NO_AXES; a ++)
- {
- if (Spanner* parent = dynamic_cast<Spanner*> (parent_l ((Axis)a)))
- {
-#if 1
- /*
- Urg, should use instantiate-compare, or maybe mysterious
- column_width/contains functions?
- */
- if (spanned_drul_[LEFT] && spanned_drul_[RIGHT]
- && parent->spanned_drul_[LEFT] && parent->spanned_drul_[RIGHT])
- {
- if (parent->spanned_drul_[LEFT]->column_l ()->rank_i ()
- > spanned_drul_[LEFT]->column_l ()->rank_i () > 0
- || parent->spanned_drul_[RIGHT]->column_l ()->rank_i ()
- < spanned_drul_[RIGHT]->column_l ()->rank_i ())
- {
- warning (_f ("Spanner `%s' is not fully contained in parent spanner `%s'.",
- classname (this), classname (parent)));
- }
- }
-#else
- /*
- column_width (), contains ()?
- */
- if (!parent->column_width ().contains (this->column_width ()))
- {
- warning (_f ("Spanner `%s' is not fully contained in parent spanner `%s'.",
- classname (this), classname (parent)));
- }
-#endif
- }
- }
if (line_l () || broken_b ())
return;
+
+ Item * left = spanned_drul_[LEFT];
+ Item * right = spanned_drul_[RIGHT];
if (left == right)
{
+ warning (_ ("Left spanpoint is right spanpoint"));
+
/*
FIXME: this is broken.
*/
if (spanned_drul_[Direction(-d)] == spanned_drul_[d]
&& i)
- warning (_f ("Spanner `%s' has equal left and right spanpoints",
- classname (this)));
+ warning (_f ("Spanner `%s' has equal left and right spanpoints", classname (this)));
}
SCM s = beam->get_elt_property ("height");
if (gh_number_p (s))
dy = gh_scm2double (s);
- Real dx = beam->last_visible_stem ()->hpos_f ()
- - beam->first_visible_stem ()->hpos_f ();
+ Real dx = beam->last_visible_stem ()->relative_coordinate (0, X_AXIS)
+ - beam->first_visible_stem ()->relative_coordinate (0, X_AXIS);
dydx = dx ? dy/dx : 0;
}
else
{
// ugh, rather calc from Stem_tremolo_req
int beams_i = stem->beam_count(RIGHT) >? stem->beam_count (LEFT);
- mol.translate (Offset(stem->hpos_f () - hpos_f (),
+ mol.translate (Offset(stem->relative_coordinate (0, X_AXIS) - relative_coordinate (0, X_AXIS),
stem->stem_end_position () * half_space -
directional_element (beam).get () * beams_i * interbeam_f));
}
else
whole_note_correction = 0;
- mol.translate (Offset (stem->hpos_f () - hpos_f () +
+ mol.translate (Offset (stem->relative_coordinate (0, X_AXIS) - relative_coordinate (0, X_AXIS) +
whole_note_correction, dy));
}
+++ /dev/null
-/*
- super-elem.cc -- implement Super_elem
-
- source file of the LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "super-element.hh"
-#include "line-of-score.hh"
-#include "paper-score.hh"
-#include "string.hh"
-#include "paper-outputter.hh"
-
-
-/**
- for administration of what was done already
- */
-enum Score_element_status {
- ORPHAN=0, // not yet added to pstaff
- VIRGIN, // added to pstaff
- PREBROKEN,
- PREBROKEN_SECOND,
- PRECALCING,
- PRECALCED, // calcs before spacing done
- SPACING,
- SPACED,
- BROKEN,
- BROKEN_SECOND,
- POSTCALCING, // busy calculating. This is used to trap cyclic deps.
- POSTCALCED, // after spacing calcs done
- BREWING,
- BREWED,
-};
-
-void
-Super_element::pre_processing ()
-{
- calculate_dependencies (PRECALCED, PRECALCING, &Score_element::before_line_breaking);
-}
-
-void
-Super_element::space_processing ()
-{
- calculate_dependencies (SPACED, SPACING, &Score_element::do_space_processing);
-}
-
-/* for break processing, use only one status, because copies have to
- have correct status. (Previously,
- Score_element::handle_[pre]broken_dependencies assigned to status_i_
- */
-void
-Super_element::breakable_col_processing ()
-{
- calculate_dependencies (PREBROKEN, PREBROKEN, &Score_element::do_breakable_col_processing);
- // calculate_dependencies (PREBROKEN_SECOND, PREBROKEN_SECOND, &Score_element::handle_prebroken_dependents);
-}
-
-
-void
-Super_element::post_processing ()
-{
- // calculate_dependencies (BROKEN_SECOND, BROKEN_SECOND,
- // &Score_element::handle_broken_dependents);
- calculate_dependencies (POSTCALCED, POSTCALCING, &Score_element::after_line_breaking);
-}
-
-void
-Super_element::output_all ()
-{
- calculate_dependencies (BREWED, BREWING, &Score_element::output_processing);
-}
-
-
-
-
*offset = - d * infinity_f;
- Real x0 = column_arr[0]->hpos_f ();
- Real x1 = column_arr.top ()->hpos_f ();
+ Real x0 = column_arr[0]->relative_coordinate (0, X_AXIS);
+ Real x1 = column_arr.top ()->relative_coordinate (0, X_AXIS);
Real factor = column_arr.size () > 1 ? 1/(x1 - x0) : 1.0;
for (int i = 0; i < column_arr.size (); i++)
{
Real notey = column_arr[i]->extent (Y_AXIS)[d];
- Real x = column_arr[i]->hpos_f () - x0;
+ Real x = column_arr[i]->relative_coordinate (0, X_AXIS) - x0;
Real tuplety = *dy * x * factor;
if (notey * d > (*offset + tuplety) * d)
#include "translator-group.hh"
#include "axis-group-engraver.hh"
#include "paper-column.hh"
-#include "vertical-align-engraver.hh"
-#include "axis-align-spanner.hh"
-#include "axis-group-spanner.hh"
+#include "align-interface.hh"
#include "span-bar.hh"
#include "axis-group-interface.hh"
+#include "engraver.hh"
+#include "spanner.hh"
+
+class Vertical_align_engraver : public Engraver {
+ Spanner * valign_p_;
+ bool qualifies_b (Score_element_info) const;
+public:
+ VIRTUAL_COPY_CONS(Translator);
+
+ Vertical_align_engraver();
+protected:
+
+ virtual void acknowledge_element (Score_element_info);
+ virtual void do_creation_processing();
+ virtual void do_removal_processing();
+};
+
Vertical_align_engraver::Vertical_align_engraver()
{
void
Vertical_align_engraver::do_creation_processing()
{
- valign_p_ =new Axis_align_spanner;
- valign_p_->set_axis (Y_AXIS);
- valign_p_->set_elt_property ("stacking-dir", gh_int2scm (DOWN));
+ valign_p_ =new Spanner; //Axis_align_spanner
+ Align_interface (valign_p_).set_interface ();
+ Align_interface (valign_p_).set_axis (Y_AXIS);
+ valign_p_->set_elt_property ("stacking-dir",
+ gh_int2scm (DOWN));
valign_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
announce_element (Score_element_info (valign_p_ , 0));
{
if (qualifies_b (i))
{
- valign_p_->add_element (i.elem_l_);
+ Align_interface(valign_p_).add_element (i.elem_l_);
}
/*
- ? huh
+ Add make sure spanbars (whose size depends on vertical alignment)
+ depend on the vertical alignment element
*/
else if (dynamic_cast<Span_bar*>(i.elem_l_) && i.origin_trans_l_arr (this).size ())
{
Begin3
Title: LilyPond
-Version: 1.3.36
-Entered-date: 17MAR00
+Version: 1.3.37
+Entered-date: 20MAR00
Description:
Keywords: music notation typesetting midi fonts engraving
Author: hanwen@cs.uu.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
- 1000k lilypond-1.3.36.tar.gz
+ 1000k lilypond-1.3.37.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.36.tar.gz
+ 1000k lilypond-1.3.37.tar.gz
Copying-policy: GPL
End
Name: lilypond
-Version: 1.3.36
+Version: 1.3.37
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.36.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.37.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
# get Packager from (undocumented?) ~/.rpmmacros!
}
\translator {
\ScoreContext
- %% URG: this changes dynamics too
- %%textStyle = #"italic"
+ %textEmptyDimension = ##t
+ textStyle = #"italic"
timeSignatureStyle = #"C"
}
\translator { \OrchestralScoreContext }
}
\translator {
\ScoreContext skipBars = ##t
- %% URG: this changes dynamics too
- %%textStyle = #"italic"
+ %textEmptyDimension = ##t
+ textStyle = #"italic"
timeSignatureStyle = #"C"
}
}
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-03-20 16:31+0100\n"
+"POT-Creation-Date: 2000-03-15 19:34+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "unknown clef type"
msgstr ""
-#: collision.cc:101
+#: collision.cc:99
msgid "Too many clashing notecolumns. Ignoring them."
msgstr ""
msgid "NaN"
msgstr ""
-#: dynamic-engraver.cc:285 span-dynamic-performer.cc:116
+#: dynamic-engraver.cc:244 span-dynamic-performer.cc:114
msgid "can't find start of (de)crescendo"
msgstr ""
-#: dynamic-engraver.cc:304
+#: dynamic-engraver.cc:263
msgid "already have a crescendo"
msgstr ""
-#: dynamic-engraver.cc:305
+#: dynamic-engraver.cc:264
msgid "already have a decrescendo"
msgstr ""
-#: dynamic-engraver.cc:380
+#: dynamic-engraver.cc:339
msgid "unterminated (de)crescendo"
msgstr ""
msgid "no Grace context available"
msgstr ""
-#: grace-position-engraver.cc:93
+#: grace-position-engraver.cc:91
msgid "Unattached grace notes. Attaching to last musical column."
msgstr ""
msgid "Braces don't match"
msgstr ""
-#: paper-column.cc:49
+#: paper-column.cc:48
msgid "Must set spring between differing columns"
msgstr ""
-#: paper-def.cc:70
+#: paper-def.cc:69
#, c-format
msgid "unknown paper variable: `%s'"
msgstr ""
-#: paper-def.cc:74
+#: paper-def.cc:73
msgid "not a real variable"
msgstr ""
-#: paper-def.cc:184
+#: paper-def.cc:180
#, c-format
msgid "paper output to %s..."
msgstr ""
msgid "too many notes for rest collision"
msgstr ""
-#: score-engraver.cc:141
+#: score-engraver.cc:139
#, c-format
msgid "unbound spanner `%s'"
msgstr ""
msgid "Slur over rest?"
msgstr ""
-#: spanner.cc:31 spanner.cc:170
-#, c-format
-msgid "Spanner `%s' has equal left and right spanpoints"
+#: spanner.cc:34
+msgid "Left spanpoint is right spanpoint"
msgstr ""
-#: spanner.cc:56 spanner.cc:66
+#: spanner.cc:128
#, c-format
-msgid "Spanner `%s' is not fully contained in parent spanner `%s'."
+msgid "Spanner `%s' has equal left and right spanpoints"
msgstr ""
#: stem-engraver.cc:124
#
msgid ""
msgstr ""
-"POT-Creation-Date: 2000-03-20 16:31+0100\n"
+"POT-Creation-Date: 2000-03-15 19:34+0100\n"
"Content-Type: text/plain; charset=\n"
"Date: 1998-05-26 11:26:28+0200\n"
"From: <janneke@gnu.org>\n"
msgid "unknown clef type"
msgstr "onbekend type sleutel"
-#: collision.cc:101
+#: collision.cc:99
msgid "Too many clashing notecolumns. Ignoring them."
msgstr "Te veel botsende nootkolommen. Negeer ze."
msgid "NaN"
msgstr "NaN"
-#: dynamic-engraver.cc:285 span-dynamic-performer.cc:116
+#: dynamic-engraver.cc:244 span-dynamic-performer.cc:114
msgid "can't find start of (de)crescendo"
msgstr "kan start van (de)crescendo niet vinden"
-#: dynamic-engraver.cc:304
+#: dynamic-engraver.cc:263
msgid "already have a crescendo"
msgstr "heb al een crescendo"
-#: dynamic-engraver.cc:305
+#: dynamic-engraver.cc:264
msgid "already have a decrescendo"
msgstr "heb al een decrescendo"
-#: dynamic-engraver.cc:380
+#: dynamic-engraver.cc:339
msgid "unterminated (de)crescendo"
msgstr "onbeëindigd (de)crescendo"
msgid "no Grace context available"
msgstr "geen Grace context voor handen"
-#: grace-position-engraver.cc:93
+#: grace-position-engraver.cc:91
msgid "Unattached grace notes. Attaching to last musical column."
msgstr "Losse grace noten. Maak ze vast aan vorige muziekale kolom."
#: local-key-engraver.cc:83 time-signature-engraver.cc:29
#: translator-group.cc:416 translator-group.cc:425
-#, c-format
msgid "can't find: `%s'"
msgstr "kan niet vinden: `%s'"
msgstr "Vertolk context met leeg type"
#: music-output-def.cc:84
-#, c-format
msgid "can't find `%s' context"
msgstr "kan `%s' context niet vinden"
msgid "Braces don't match"
msgstr "Haakjes paren niet"
-#: paper-column.cc:49
+#: paper-column.cc:48
msgid "Must set spring between differing columns"
msgstr "Moet veertje zetten tussen verschillende kolommen"
-#: paper-def.cc:70
+#: paper-def.cc:69
#, c-format
msgid "unknown paper variable: `%s'"
msgstr "onbekende papier veranderlijke: `%s'"
-#: paper-def.cc:74
+#: paper-def.cc:73
msgid "not a real variable"
msgstr "niet een reële veranderlijke"
-#: paper-def.cc:184
+#: paper-def.cc:180
#, c-format
msgid "paper output to %s..."
msgstr "papier uitvoer naar %s..."
msgstr "Huh? Geen Request: `%s'"
#: request-iterator.cc:20
-#, c-format
msgid "Junking music: `%s'"
msgstr "Schroot muziek: `%s'"
msgid "too many notes for rest collision"
msgstr "te veel noten voor bosting met rusten"
-#: score-engraver.cc:141
+#: score-engraver.cc:139
#, c-format
msgid "unbound spanner `%s'"
msgstr "ongebonden spanner `%s'"
msgstr "onbeëindigde bindingsboog"
#: slur-engraver.cc:77
-#, c-format
msgid "can't find both ends of %s"
msgstr "kan niet beide uiteinden vinden van %s"
msgid "Slur over rest?"
msgstr "Boogje over rust?"
-#: spanner.cc:31 spanner.cc:170
+#: spanner.cc:34
+msgid "Left spanpoint is right spanpoint"
+msgstr "Linker spanpunt is rechter spanpunt"
+
+#: spanner.cc:128
#, c-format
msgid "Spanner `%s' has equal left and right spanpoints"
msgstr "Spanner `%s' heeft gelijke linker en rechter spanpunten"
-#: spanner.cc:56 spanner.cc:66
-#, c-format
-msgid "Spanner `%s' is not fully contained in parent spanner `%s'."
-msgstr "Spanner `%s' is niet volledig opgenomen in parent spanner `%s'."
-
#: stem-engraver.cc:124
#, c-format
msgid "Adding note head to incompatible stem (type = %d)"
"%s: TFM bestand heeft %u parameters, wat meer is dan de %u die ik aan kan"
#: tfm.cc:70
-#, c-format
msgid "can't find ascii character: `%d'"
msgstr "kan teken niet vinden: `%s'"
msgstr "Bevat reeds: `%s'"
#: translator-group.cc:210
-#, c-format
msgid "can't find or create `%s' called `%s'"
msgstr "kan niet vinden of scheppen `%s' genaamd `%s'"
#: translator-group.cc:322
-#, c-format
msgid "can't find or create: `%s'"
msgstr "kan niet vinden of scheppen: `%s'"
msgid "% from input file: "
msgstr "% van invoerbestand: "
-#~ msgid "Left spanpoint is right spanpoint"
-#~ msgstr "Linker spanpunt is rechter spanpunt"
-
#~ msgid "(search path: `%s'"
#~ msgstr "(zoekpad: `%s')"
;;; (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
-
(define absolute-volume-alist '())
(set! absolute-volume-alist
(append
'(
- ("sf" . 1.00)
- ("ffff" . 0.91)
- ("fff" . 0.81)
- ("ff" . 0.71)
- ("f" . 0.61)
- ("mf" . 0.50)
- ("mp" . 0.40)
- ("p" . 0.30)
- ("pp" . 0.20)
- ("ppp" . 0.10)
+ ("sf" . 115)
+ ("fff" . 102)
+ ("ff" . 90)
+ ("f" . 77)
+ ("mf" . 64)
+ ("mp" . 51)
+ ("p" . 38)
+ ("pp" . 26)
+ ("ppp" . 13)
)
absolute-volume-alist))
(if entry
(cdr entry))))
-(define instrument-equaliser-alist '())
-(set! instrument-equaliser-alist
- (append
- '(
- ("flute" . (0 . 1))
- ("oboe" . (0 . 1))
- ("clarinet" . (0 . 1))
- ("bassoon" . (0 . 1))
- ("french horn" . (0 . 1))
- ("trumpet" . (0 . 1))
- ("timpani" . (0 . 1))
- ("violin" . (0 . 1))
- ("viola" . (0 . 1))
- ("cello" . (0 . 1))
- ("contrabass" . (0 . 1))
- )
- instrument-equaliser-alist))
-
-(define (instrument-equaliser s)
- (let ((entry (assoc s absolute-volume-alist)))
- (if entry
- (cdr entry))))
-
-(define instrument-equaliser-alist '())
-
-;; 90 == 90/127 == 0.71 is supposed to be the default value
+;; 90 is supposed to be the default value
;; urg: we should set this at start of track
-(define dynamic-default-volume 0.71)
+(define dynamic-default-volume 90)
def conv(str):
str = re.sub ('SkipBars','skipBars', str)
str = re.sub ('fontsize','fontSize', str)
- str = re.sub ('midi_instrument','midiInstrument', x)
+ str = re.sub ('midi_instrument','midiInstrument', str)
return str
def conv(str):
str = re.sub ('tieydirection','tieVerticalDirection', str)
str = re.sub ('slurydirection','slurVerticalDirection', str)
- str = re.sub ('ydirection','verticalDirection', x)
+ str = re.sub ('ydirection','verticalDirection', str)
return str