+1.3.34
+======
+1.3.33.hwn2
+===========
+
+* Print key without setting key, syntax "\key ;". General cleanups of
+key-item.
+
+* Add paragraph tags in HTML output of mudela-book. Music fragment
+don't run into the text anymore.
+
+* Bugfix: don't align the first line of text. (Lookup::text ()).
+
+* Abstract away data members of Axis_group_element, Align_element
+
+
1.3.33.jcn3
===========
moving in case of a collision) more than maximumRestCount similar rests.
WIP!
-1.3.33.jcn1
-===========
-
* Rewrote Staff_margin_engraver. Staff margin texts now hang on a new
breakable item: Left_edge_item.
(not supported by a Dynamic_line_spanner) still collide with Staff,
although they now have staff support, which was supposed to fix this.
-1.3.32.jcn4
-===========
-
* Fixed Staff_margin_engraver for "instrument", "instr" is still broken.
* Dynamic elements are only put in a Dynamic_line_spanner if there
actually is more than one adjacent note-column with a dynamic.
This breaks the fine looks of all dynamics, again :-)
+
1.3.33
======
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=33
-MY_PATCH_LEVEL=jcn3
+PATCH_LEVEL=34
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
--- /dev/null
+
+\score {
+\notes < \context Staff { \clef "G^8"; s1 s1 s1 }
+ \context Staff = CC { c1 c c } >
+
+\paper {
+\translator {
+ \HaraKiriStaffContext
+}}
+}
--- /dev/null
+
+\key e; c2 \clef "treble";\key es; c \break c1
#include "hash-table-iter.hh"
#include "dimension-cache.hh"
-void
-Align_element::after_line_breaking()
+/*
+ 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)
{
- if (axis () == Y_AXIS)
- do_side_processing ();
+ 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::before_line_breaking ()
+Align_element::add_element (Score_element* s)
{
- if (axis () == X_AXIS)
- do_side_processing ();
+ s->add_offset_callback (alignment_callback, axis ());
+ Axis_group_element::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 ()
+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)
Link_array<Score_element> all_elts (elem_l_arr ());
for (int i=0; i < all_elts.size(); i++)
{
- Interval y = all_elts[i]->extent(axis ()) + all_elts[i]->relative_coordinate (this, axis ());
+ 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]);
}
}
+
+ 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++)
{
if (i)
{
- dy = (dy >? threshold_interval_[SMALLER] )
- <? threshold_interval_[BIGGER];
+ dy = (dy >? threshold[SMALLER] )
+ <? threshold[BIGGER];
}
-
where_f += stacking_dir * dy;
- elems[i]->translate_axis (where_f, axis ());
+ elems[i]->translate_axis (where_f, a);
}
}
-Align_element::Align_element()
-{
- threshold_interval_ = Interval (0, Interval::infinity ());
-}
int
Align_element::get_count (Score_element*s)const
Axis
Align_element::axis () const
{
- return axes_[0];
+ return Axis (gh_scm2int (gh_car (get_elt_property ("axes"))));
}
void
Align_element::set_axis (Axis a)
{
- set_axes (a,a);
+ set_axes (a, a);
}
{
Direction d = to_dir (al);
directional_element (align_item_p_).set (d);
- align_item_p_->set_elt_property ("align-dir", to_dir (-d));
}
typeset_element (align_item_p_);
#include "dimension-cache.hh"
#include "group-interface.hh"
-Link_array<Score_element>
-Axis_group_element::get_extra_dependencies() const
-{
- Link_array<Score_element> e(elem_l_arr ());
- return e;
-}
-
Link_array<Score_element>
Axis_group_element::elem_l_arr () const
{
Axis_group_element::Axis_group_element()
{
- axes_[0] = (Axis)-1 ;
- axes_[1] = (Axis)-1 ;
-
set_elt_property ("elements", SCM_EOL);
set_elt_property ("transparent", SCM_BOOL_T);
}
void
Axis_group_element::set_axes (Axis a1, Axis a2)
{
- axes_[0] = a1 ;
- axes_[1] = a2 ;
+ SCM ax = gh_cons (gh_int2scm (a1), SCM_EOL);
+ if (a1 != a2)
+ ax= gh_cons (gh_int2scm (a2), ax);
+
+
+ set_elt_property ("axes", ax);
+
if (a1 != X_AXIS && a2 != X_AXIS)
set_empty (X_AXIS);
if (a1 != Y_AXIS && a2 != Y_AXIS)
}
+bool
+Axis_group_element::axis_b (Axis a )const
+{
+ return dim_cache_[a]->extent_callback_l_ == extent_callback;
+}
+
void
Axis_group_element::add_element (Score_element *e)
{
used_b_ =true;
e->used_b_ = true;
-
- for (int i = 0; i < 2; i++)
+
+ for (SCM ax = get_elt_property ("axes"); ax != SCM_EOL ; ax = gh_cdr (ax))
{
- if (!e->parent_l (axes_[i]))
- e->set_parent (this, axes_[i]);
+ Axis a = (Axis) gh_scm2int (gh_car (ax));
+
+ if (!e->parent_l (a))
+ e->set_parent (this, a);
}
Group_interface gi (this);
gi.add_element (e);
+
+ add_dependency (e);
}
set_elt_property ("stacking-dir" , gh_int2scm (RIGHT));
set_axis (X_AXIS);
- dim_cache_[X_AXIS]->off_callbacks_.push (Side_position_interface::aligned_on_self);
+ add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS);
}
}
else if (Key_item *k = dynamic_cast<Key_item*>(it_l))
{
- k-> set_c_position (c0_position_i_);
+ k->set_elt_property ("c0-position", gh_int2scm (c0_position_i_));
}
}
}
g->set_parent (this, X_AXIS);
g->set_elt_property ("self-alignment-X", gh_int2scm (0));
- g->dim_cache_[X_AXIS]->off_callbacks_.push (Side_position_interface::aligned_on_self);
- g->dim_cache_[X_AXIS]->off_callbacks_.push (Side_position_interface::centered_on_parent);
-
+ g->add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS);
+ g->add_offset_callback (Side_position_interface::centered_on_parent, X_AXIS);
+
g->set_elt_property ("direction", octave_dir);
add_dependency (g); // just to be sure.
void
Key_change_req::do_print () const
{
-#ifndef NPRINT
- for (int i=0; i < key_.pitch_arr_.size (); i++)
- {
- key_.pitch_arr_[i].print ();
- }
+#if 0
+ key_->print();
#endif
}
Key_change_req::Key_change_req ()
{
+ key_ = 0;
+}
+Key_change_req::Key_change_req (Key_change_req const&s)
+ : Request (s)
+{
+ key_ = new Key_def (*s.key_);
}
+Key_change_req::~Key_change_req ()
+{
+ delete key_;
+}
+
Break_req::Break_req ()
{
void
Key_change_req::transpose (Musical_pitch p)
{
- key_.transpose (p);
+ key_->transpose (p);
}
-
-
Align_element * align = dynamic_cast<Align_element*> (common);
if (align && align->axis() == Y_AXIS)
{
- if (align->threshold_interval_[MIN] !=
- align->threshold_interval_[MAX])
+ SCM threshold = align->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"));
- interstaff = align->threshold_interval_[MIN];
+ interstaff = 0.0;
+ if (gh_pair_p (threshold))
+ interstaff = gh_scm2double (gh_car (threshold));
Score_element const * span_refpoint = span;
while (span_refpoint->parent_l (Y_AXIS) != common)
Dimension_cache::Dimension_cache (Dimension_cache const &d)
{
init();
- callback_l_ = d.callback_l_;
+ extent_callback_l_ = d.extent_callback_l_;
basic_offset_ = d.basic_offset_;
extra_offset_ = d.extra_offset_;
off_valid_b_ = d.off_valid_b_;
void
Dimension_cache::init()
{
- callback_l_ =0;
+ extent_callback_l_ =0;
basic_offset_ =0.0;
extra_offset_ =0.0;
{
Interval r;
Dimension_cache *nc = ((Dimension_cache*)this);
- if (!callback_l_)
+ if (!extent_callback_l_)
{
nc->dim_.set_empty ();
}
else if (!valid_b_)
{
- nc->dim_= (*callback_l_ ) (nc);
+ nc->dim_= (*extent_callback_l_ ) (nc);
nc->valid_b_ = true;
}
void
Dimension_cache::set_callback (Dim_cache_callback c)
{
- callback_l_ =c;
+ extent_callback_l_ =c;
}
gh_int2scm (100));
pending_element_arr_.push (text_p_);
text_p_->set_elt_property ("self-alignment-Y", gh_int2scm (0));
- text_p_->dim_cache_[Y_AXIS]->off_callbacks_.push
- (Side_position_interface::aligned_on_self);
- /*
- Don't crash into staff
- */
-#if 0
- // nogo
- text_p_->dim_cache_[Y_AXIS]->off_callbacks_.push
- (Side_position_interface::aligned_side);
-#else
- // doet't ook niet, maar breekt wel alignment op line-spanner
- //side_position (text_p_).set_axis (Y_AXIS);
-#endif
+ text_p_->add_offset_callback (Side_position_interface::aligned_on_self,
+ Y_AXIS);
announce_element (Score_element_info (text_p_, text_req_l_));
}
}
pending_element_arr_.push (cresc_p_);
cresc_p_->set_elt_property ("self-alignment-Y", gh_int2scm (0));
- cresc_p_->dim_cache_[Y_AXIS]->off_callbacks_.push
- (Side_position_interface::aligned_on_self);
- /*
- Don't crash into staff
- */
-#if 0
- // nogo
- cresc_p_->dim_cache_[Y_AXIS]->off_callbacks_.push
- (Side_position_interface::aligned_side);
-#else
- // doet't ook niet, maar breekt wel alignment op line-spanner
- //side_position (cresc_p_).set_axis (Y_AXIS);
-#endif
+ cresc_p_->add_offset_callback
+ (Side_position_interface::aligned_on_self, Y_AXIS);
announce_element (Score_element_info (cresc_p_, span_req_l_drul_[START]));
}
}
Engraver::announce_element (Score_element_info i)
{
Score_element * e = i.elem_l_;
- group (e, "interfaces").add_thing (ly_symbol2scm (e->name()));
+
+ if (e->get_elt_property ("interfaces") == SCM_EOL)
+ group (e, "interfaces").add_thing (ly_symbol2scm (e->name()));
if (!i.origin_trans_l_)
i.origin_trans_l_ = this;
Real nhw = // lookup_l ()->notehead (2, "").dim_[X_AXIS].length();
paper_l ()->get_var ("quartwidth");
- threshold_interval_[MIN] = nhw* 1.5;
+ set_elt_property ("threshold",
+ gh_cons (gh_double2scm (nhw* 1.5),
+ gh_double2scm (infinity_f)));
column_l ()->set_elt_property ("contains-grace", SCM_BOOL_T);
Which side to align? -1: left side, 0: centered (around
center_l_ if not nil, or around center of width), 1: right side
- *****
-
- align-dir: deprecate! Use Side_pos_interface::self_align
-
*/
class Align_element : public virtual Axis_group_element {
public:
- Interval threshold_interval_ ;
-
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 after_line_breaking () ;
- virtual void before_line_breaking ();
- virtual void do_side_processing ();
+ virtual void do_side_processing (Axis);
+
};
#endif // VERTICAL_ALIGN_ITEM_HH
*/
class Axis_group_element : public virtual Score_element
{
- /// modify fields of E for removal.
- void do_remove (Score_element*e);
-
protected:
- virtual Link_array<Score_element> get_extra_dependencies() const;
virtual Link_array<Score_element> elem_l_arr() const;
static Interval extent_callback (Dimension_cache const*);
public:
- Axis axes_[2];
-
void add_element (Score_element*);
-
+ bool axis_b (Axis) const;
Axis_group_element ();
void set_axes (Axis,Axis);
{
public:
Key_change_req ();
- Key_def key_;
+ ~Key_change_req();
+ Key_change_req(Key_change_req const &);
+ Key_def *key_;
protected:
VIRTUAL_COPY_CONS(Music);
--- /dev/null
+/*
+ dimension-cache-callback.hh -- declare
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef DIMENSION_CACHE_CALLBACK_HH
+#define DIMENSION_CACHE_CALLBACK_HH
+
+class Dimension_cache;
+typedef Interval (*Dim_cache_callback)(Dimension_cache const *);
+typedef Real (*Offset_cache_callback)(Dimension_cache const *);
+
+#endif /* DIMENSION_CACHE_CALLBACK_HH */
+
#include "real.hh"
#include "lily-proto.hh"
#include "parray.hh"
+#include "dimension-cache-callback.hh"
-class Dimension_cache;
-typedef Interval (*Dim_cache_callback)(Dimension_cache const *);
-typedef Real (*Offset_cache_callback)(Dimension_cache const *);
/**
Adminstration of offset dimension info.
friend class Score_element;
void init ();
-public:
Array<Offset_cache_callback> off_callbacks_;
/**
What to call to find extent. Nil means empty.
*/
- Dim_cache_callback callback_l_;
+public:
+ Dim_cache_callback extent_callback_l_;
static Interval point_dimension_callback (Dimension_cache const* );
Axis axis () const;
Real get_offset () const;
/**
Universal key definition (Should rename class Key to 'Accidentals'?)
+
+ FIXME: merge key.hh and key-def.hh classes.
*/
class Key_def
{
#include "array.hh"
-/// An item which places accidentals at the start of the line
+/** An item which places accidentals at the start of the line
+
+ TODO: Schemify me.
+ */
class Key_item :public Item
{
Array<int> pitch_arr_;
Array<int> acc_arr_;
Array<int> old_pitch_arr_;
Array<int> old_acc_arr_;
- int c0_position_;
-
public:
- bool multi_octave_b_;
-
- int get_c_position () const;
-
-
VIRTUAL_COPY_CONS(Score_element);
-
Key_item ();
void add (int pitch, int acc);
void add_old (int pitch, int acc);
- void set_c_position (int);
+
int calculate_position(int p, int a) const;
protected:
#include "lily-guile.hh"
#include "lily-proto.hh"
#include "smobs.hh"
+#include "dimension-cache-callback.hh"
+
typedef void (Score_element::*Score_element_method_pointer) (void);
/// do calculations after determining horizontal spacing
virtual void after_line_breaking ();
- virtual Link_array<Score_element> get_extra_dependencies () const;
-
static Interval dim_cache_callback (Dimension_cache const*);
public:
static SCM ly_set_elt_property (SCM, SCM,SCM);
Score_element*common_refpoint (Score_element const* s, Axis a) const;
Score_element*common_refpoint (Link_array<Score_element> elems, Axis a) const;
+
+ bool has_offset_callback_b (Offset_cache_callback, Axis)const;
+ void add_offset_callback (Offset_cache_callback, Axis);
/**
Set the parent refpoint of THIS to E
*/
void
Key_engraver::read_req (Key_change_req const * r)
{
+ if (!r->key_)
+ return;
+
old_accidental_idx_arr_ = accidental_idx_arr_;
key_.clear ();
SCM prop = get_property ("keyOctaviation");
accidental_idx_arr_.clear ();
- if (r->key_.ordinary_key_b_)
+ if (r->key_->ordinary_key_b_)
{
- int no_of_acc = r->key_.ordinary_accidentals_i ();
+ int no_of_acc = r->key_->ordinary_accidentals_i ();
// Hmm, can't these be handled/constructed by Key_change_req?
if (no_of_acc < 0)
}
else // Special key
{
- for (int i = 0; i < r->key_.pitch_arr_.size (); i ++)
+ for (int i = 0; i < r->key_->pitch_arr_.size (); i ++)
{
- Musical_pitch m_l =r->key_.pitch_arr_[i];
+ Musical_pitch m_l =r->key_->pitch_arr_[i];
if (key_.multi_octave_b_)
key_.set (m_l);
else
Key_item::Key_item ()
{
set_elt_property ("breakable", SCM_BOOL_T);
- set_c_position (0);
+ set_elt_property ("c0-position", gh_int2scm (0));
}
-int
-Key_item::get_c_position () const
-{
- // Find the c in the range -4 through 2
- int from_bottom_pos = c0_position_ + 4;
- from_bottom_pos = from_bottom_pos%7;
- from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive.
- return from_bottom_pos - 4;
-}
-
-
-void
-Key_item::set_c_position (int c0)
-{
- c0_position_ = c0;
-}
-
-
void
Key_item::add (int p, int a)
{
{
if (to_boolean (get_elt_property ("multi-octave")))
{
- return p + c0_position_;
+ return p + gh_scm2int (get_elt_property ("c0-position"));
}
else {
- if ((a<0 && ((p>FLAT_TOP_PITCH) || (p+get_c_position ()>4)) && (p+get_c_position ()>1))
+ // Find the c in the range -4 through 2
+ int from_bottom_pos = gh_scm2int (get_elt_property ("c0-position")) + 4;
+ from_bottom_pos = from_bottom_pos%7;
+ from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive.
+ int c0 = from_bottom_pos - 4;
+
+
+ if ((a<0 && ((p>FLAT_TOP_PITCH) || (p+c0>4)) && (p+c0>1))
||
- (a>0 && ((p>SHARP_TOP_PITCH) || (p+get_c_position ()>5)) && (p+get_c_position ()>2)))
+ (a>0 && ((p>SHARP_TOP_PITCH) || (p+c0>5)) && (p+c0>2)))
{
p -= 7; /* Typeset below c_position */
}
/* Provide for the four cases in which there's a glitch */
/* it's a hack, but probably not worth */
/* the effort of finding a nicer solution. dl. */
- if (get_c_position ()==2 && a>0 && p==3)
+ if (c0==2 && a>0 && p==3)
p -= 7;
- if (get_c_position ()==-3 && a>0 && p==-1)
+ if (c0==-3 && a>0 && p==-1)
p += 7;
- if (get_c_position ()==-4 && a<0 && p==-1)
+ if (c0==-4 && a<0 && p==-1)
p += 7;
- if (get_c_position ()==-2 && a<0 && p==-3)
+ if (c0==-2 && a<0 && p==-3)
p += 7;
- return p + get_c_position ();
+
+ return p + c0;
}
}
void
Key_performer::do_process_music ()
{
- if (key_req_l_)
+ if (key_req_l_ && key_req_l_->key_)
{
- audio_p_ = new Audio_key (key_req_l_->key_);
+ audio_p_ = new Audio_key (*key_req_l_->key_);
Audio_element_info info (audio_p_, key_req_l_);
announce_element (info);
key_req_l_ = 0;
Array<String> lines = String_convert::split_arr (text, '\n');
- Molecule mol;
-
Real kern = paper_l->get_var ("line_kern");
- for (i = 0; i< lines.size (); i++)
+ for (int i=0; i < lines.size (); i++)
{
- /*
- Huh? This way we'll still see \foo sequences in ps output.
- */
- String str = lines[i];
+ String str (lines[i]);
if (output_global_ch == "tex")
str = sanitise_TeX_string (str);
else if (output_global_ch == "ps")
str = sanitise_PS_string (str);
+ lines[i] = str;
+ }
+
+
+ SCM first = gh_list (ly_symbol2scm ("text"),
+ ly_str02scm (lines[0].ch_C()),
+ SCM_UNDEFINED);
+ first = fontify_atom (metric_l, first);
+
+
+ Molecule mol (metric_l->text_dimension (lines[0]), first);
+
+ for (i = 1; i < lines.size (); i++)
+ {
SCM line = (gh_list (ly_symbol2scm ("text"),
- ly_str02scm (str.ch_C ()),
+ ly_str02scm (lines[i].ch_C ()),
SCM_UNDEFINED));
line = fontify_atom (metric_l, line);
mol.add_at_edge (Y_AXIS, DOWN,
- Molecule (metric_l->text_dimension (str), line),
+ Molecule (metric_l->text_dimension (lines[i]), line),
kern);
}
$$ = new Clef_change_req (ly_scm2string ($2));
}
+ | KEY {
+ Key_change_req *key_p= new Key_change_req;
+ key_p->key_ = 0;
+ $$ = key_p;
+ }
/* UGH. optional. */
+
| KEY NOTENAME_PITCH optional_modality {
Key_change_req *key_p= new Key_change_req;
- key_p->key_.pitch_arr_.push (*$2);
- key_p->key_.ordinary_key_b_ = true;
- key_p->key_.modality_i_ = $3;
+ Key_def d;
+ d.pitch_arr_.push (*$2);
+ d.ordinary_key_b_ = true;
+ d.modality_i_ = $3;
+
+ key_p->key_ = new Key_def (d);
$$ = key_p;
delete $2;
}
| KEYSIGNATURE pitch_list {
Key_change_req *key_p= new Key_change_req;
- key_p->key_.pitch_arr_ = *$2;
- key_p->key_.ordinary_key_b_ = false;
+ Key_def d;
+ d.pitch_arr_ = *$2;
+ d.ordinary_key_b_ = false;
+
+ key_p->key_ = new Key_def(d);
$$ = key_p;
delete $2;
}
if (get_elt_property ("self-alignment-X") != SCM_UNDEFINED
&& !dim_cache_[X_AXIS]->off_callback_l_)
{
- dim_cache_[X_AXIS]->off_callbacks_.push (Side_position_interface::aligned_on_self);
+ add_offset_callback (Side_position_interface::aligned_on_self,X_AXIS);
}
if (get_elt_property ("self-alignment-Y") != SCM_UNDEFINED
&& !dim_cache_[X_AXIS]->off_callback_l_)
{
- dim_cache_[Y_AXIS]->set_offset_callback (Side_position_interface::aligned_on_self);
+ add_offset_callback (Side_position_interface::aligned_on_self, Y_AXIS);
}
#endif
assert (status_i_!= busy);
status_i_= busy;
- Link_array<Score_element> dependency_arr =
- Group_interface__extract_elements (this, (Score_element*)0, "dependencies");
-
- for (int i=0; i < dependency_arr.size(); i++)
- dependency_arr[i]->calculate_dependencies (final, busy, funcptr);
+ for (SCM d= get_elt_property ("dependencies"); d != SCM_EOL; d = gh_cdr (d))
+ {
+ unsmob_element (gh_car (d))
+ ->calculate_dependencies (final, busy, funcptr);
+ }
- Link_array<Score_element> extra (get_extra_dependencies());
- for (int i=0; i < extra.size(); i++)
- extra[i]->calculate_dependencies (final, busy, funcptr);
-
(this->*funcptr)();
status_i_= final;
}
}
}
-Link_array<Score_element>
-Score_element::get_extra_dependencies() const
-{
- Link_array<Score_element> empty;
- return empty;
-}
-
bool
Score_element::linked_b() const
{
void
Score_element::set_empty (Axis a)
{
- dim_cache_[a]->callback_l_ =0;
+ dim_cache_[a]->extent_callback_l_ =0;
}
bool
Score_element::empty_b (Axis a)const
{
- return !dim_cache_[a]->callback_l_;
+ return !dim_cache_[a]->extent_callback_l_;
}
Interval
return classname (this);
}
+void
+Score_element::add_offset_callback (Offset_cache_callback cb, Axis a)
+{
+ dim_cache_[a]->off_callbacks_.push (cb);
+}
+
+bool
+Score_element::has_offset_callback_b (Offset_cache_callback cb, Axis a)const
+{
+ for (int i= dim_cache_[a]->off_callbacks_.size (); i--;)
+ {
+ if (dim_cache_[a]->off_callbacks_[i] == cb)
+ return true;
+ }
+ return false;
+}
void
Score_element::set_parent (Score_element *g, Axis a)
if (elt_l_->get_elt_property ("side-support") == SCM_UNDEFINED)
elt_l_->set_elt_property ("side-support" ,SCM_EOL);
- elt_l_->dim_cache_[a]->off_callbacks_.push (aligned_side);
+ elt_l_->add_offset_callback (aligned_side, a);
}
void
Side_position_interface::set_quantised (Axis a)
{
- Dimension_cache * c = elt_l_->dim_cache_[a];
-
- c->off_callbacks_.push (quantised_position);
+ elt_l_->add_offset_callback (quantised_position, a);
}
Axis
Side_position_interface::get_axis () const
{
- Dimension_cache * c = elt_l_->dim_cache_[X_AXIS];
- for (int i=0 ; i < c->off_callbacks_.size();i ++)
- if (c->off_callbacks_[i] == side_position
- ||c->off_callbacks_[i] == aligned_side)
- return X_AXIS;
+ if (elt_l_->has_offset_callback_b (&side_position, X_AXIS)
+ || elt_l_->has_offset_callback_b (&aligned_side , X_AXIS))
+ return X_AXIS;
return Y_AXIS;
Text_item* t = new Text_item;
t->set_elt_property ("self-alignment-Y", gh_int2scm (0));
- t->dim_cache_[Y_AXIS]->off_callbacks_.push
- (Side_position_interface::aligned_on_self);
+ t->add_offset_callback (Side_position_interface::aligned_on_self, Y_AXIS);
t->set_parent (l, X_AXIS);
t->set_parent (l, Y_AXIS);
Staff_symbol_referencer_interface::set_interface ()
{
elt_l_->set_elt_property ("staff-position", gh_double2scm (0.0));
- elt_l_->dim_cache_[Y_AXIS]->off_callbacks_.push (callback);
+ elt_l_->add_offset_callback (callback, Y_AXIS);
+
}
}
- Array<Offset_cache_callback> &callbacks (elt_l_->dim_cache_[Y_AXIS]->off_callbacks_);
- for (int i=0; i < callbacks.size ();i++)
- if (callbacks[i] == callback)
- return ;
+ if (elt_l_->has_offset_callback_b (callback, Y_AXIS))
+ return ;
- callbacks.push (callback);
+ elt_l_->add_offset_callback (callback, Y_AXIS);
}
Staff_symbol_referencer_interface
set_elt_property ("heads", SCM_EOL);
set_elt_property ("rests", SCM_EOL);
- dim_cache_[X_AXIS]->off_callbacks_.push ( &Stem::off_callback);
+ add_offset_callback ( &Stem::off_callback, X_AXIS);
}
bool
void
Vertical_align_engraver::do_removal_processing()
{
- SCM dist (get_property ("maxVerticalAlign"));
- if (gh_number_p(dist))
- {
- valign_p_->threshold_interval_[BIGGER] = gh_scm2double (dist);
- }
-
- dist = get_property ("minVerticalAlign");
- if (gh_number_p(dist))
- {
- valign_p_->threshold_interval_[SMALLER] = gh_scm2double (dist);
- }
+ SCM min = get_property ("maxVerticalAlign");
+ SCM max = get_property ("minVerticalAlign");
+ if (gh_number_p (min) || gh_number_p (max))
+ {
+ min = gh_number_p (min) ? min : gh_double2scm (0.0);
+ max = gh_number_p (max) ? max : gh_double2scm (infinity_f);
+
+ valign_p_->set_elt_property ("threshold",
+ gh_cons (min,max));
+ }
valign_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
typeset_element (valign_p_);
valign_p_ =0;
Axis_group_element * elt = dynamic_cast<Axis_group_element *> (i.elem_l_);
- return sz > 1 && elt && elt->axes_[0] == Y_AXIS && !elt->parent_l (Y_AXIS);
+ return sz > 1 && elt && !elt->parent_l (Y_AXIS) && elt->axis_b (Y_AXIS);
}
void
Begin3
Title: LilyPond
-Version: 1.3.33
-Entered-date: 14MAR00
+Version: 1.3.34
+Entered-date: 15MAR00
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.33.tar.gz
+ 1000k lilypond-1.3.34.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.33.tar.gz
+ 1000k lilypond-1.3.34.tar.gz
Copying-policy: GPL
End
Name: lilypond
-Version: 1.3.33
+Version: 1.3.34
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.33.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.34.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
# get Packager from (undocumented?) ~/.rpmmacros!
# override EndLilyPondOutput, since @tex is done
# in a sandbox, you can't do \input lilyponddefs at the
# top of the document.
+
+# should also support fragment in
+
'output-all': r"""@tex
\catcode`\@=12
\input lilyponddefs
\catcode`\@=0
@end tex
@html
+<p>
<img src=%s.png>
@end html
""",