---- ../lilypond-1.3.54.hwn1/CHANGES Thu May 25 19:52:28 2000
-++ b/CHANGES Fri May 26 01:15:04 2000
-@@ -1,5 +1,4 @@
--1.3.1.3.54.hwn1
--===========
-* Experimental property collapse for clef and staff-symbol.
-
- * Massive search replace patch: store pointers and properties
- separately, in preparation of property collapse.--- ../lilypond-1.3.54/CHANGES Thu May 25 00:20:46 2000
-++ b/CHANGES Thu May 25 23:22:02 2000
-@@ -1,3 +1,11 @@
-1.3.54.jcn1
+1.3.54.hwn2
===========
-* Fixed compile bug.
+* Experimental property collapse for most score-elements. (notable
+exceptions: Scripts, pedals). Change all Score_element constructors to
+take a basic-property list. The suffix of a property list may be
+shared by several score-elements, for instance all default G-clefs in
+a score share the following settings
+
+ (breakable . #t)
+ (break-align-symbol . Clef_item)
+ (visibility-lambda . ,begin-of-line-visible)
+
+This should reduce memory usage further.
-* Added scripts/linux-time.py: simple utility to monitor memory (and later
- maybe other) resource usage from Linux's proc fs.
+* Magically fixed the disappearing Lyrics problem.
- 1.3.53.uu1
- ==========
- 1.3.1.3.54.hwn1
-===========
+* Removed used_b_ field from Score_element.
-* Massive search replace patch: store pointers and properties
+* Massive search-replace patch: store pointers and properties
separately, in preparation of property collapse.
-1.3.53.uu1
-==========
+
+1.3.54
+======
* Bugfix: don't crash on tuplet spanners that don't contain any notes.
-* Small cleanup of Dimension_cache: removed a few redundant
-fields. Slightly lower memory usage. Dimension_cache is now a `dumb'
-struct again.
+* Cleanup of Dimension_cache: removed a few redundant
+fields. Slightly lower memory usage (32 bytes per
+score-element). Dimension_cache is now a `dumb' struct again.
* Add array index to priority field of text scripts to ensure that
order is unique, and sensible.
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=54
-MY_PATCH_LEVEL=hwn2
+PATCH_LEVEL=55
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
showln -sf $LILYPOND_SOURCEDIR/scripts/out/ly2dvi $prefix/bin/ly2dvi
showln -sf $LILYPOND_SOURCEDIR/scripts/out/mudela-book $prefix/bin/mudela-book
showln -sf $LILYPOND_SOURCEDIR/buildscripts/out/genheader $prefix/bin/genheader
-showln -sf $LILYPOND_SOURCEDIR/scripts/out/linux-time $prefix/bin/linux-time
showln -sf $LILYPOND_SOURCEDIR/scripts/out/as2text $prefix/bin/as2text
% 13 -- how to type -- where to split -- this more neatly?
\context Staff <
\context Voice = I \relative c'' { \stemup r4 dis4 e4. e8 ~ |
- \shifton e4 [d8 fis8] \shiftoff gis4 ~ [gis8 fis16 e ] |
+ \shifton e4-.-^^\f [d8 fis8] \shiftoff gis4 ~ [gis8 fis16 e ] |
fis4 ~ [fis8 e16 dis] e4 r8 e8 }
\context Voice = III \relative c'' { \stemup \shifton r4 bis cis \shiftoff cis |
a' ~ [a16 gis a b] \shifton dis,4 cis ~ |
b!-\lheel ais-\rtoe gis-\ltoe ~ ] |
gis8 r4.
)
- c2
+ c2^^^-^\f
\time 3/4;
\fugaIIPedal }
void
Align_note_column_engraver::do_creation_processing ()
{
- align_item_p_ = new Grace_align_item;
+ align_item_p_ = new Grace_align_item (SCM_EOL);
Side_position_interface (align_item_p_).set_axis (X_AXIS);
Side_position_interface (align_item_p_).set_direction (LEFT);
Beam*
Auto_beam_engraver::create_beam_p ()
{
- Beam* beam_p = new Beam;
+ Beam* beam_p = new Beam (get_property ("basicBeamProperties"));
for (int i = 0; i < stem_l_arr_p_->size (); i++)
{
Spanner*
Axis_group_engraver::get_spanner_p () const
{
- return new Spanner;
+ return new Spanner (SCM_EOL);
}
void
void
Axis_group_interface::add_element (Score_element *e)
{
-
- // ugh. used_b_ should be junked.
- elt_l_->used_b_ = true;
- e->used_b_ = true;
-
for (SCM ax = elt_l_->get_elt_property ("axes"); ax != SCM_EOL ; ax = gh_cdr (ax))
{
Axis a = (Axis) gh_scm2int (gh_car (ax));
{
elt_l_->set_elt_pointer ("elements", SCM_EOL);
elt_l_->set_elt_property ("transparent", SCM_BOOL_T); // junk this?
- elt_l_->set_elt_property ("axes" , SCM_EOL);
+
Group_interface (elt_l_, "interfaces").add_thing (ly_symbol2scm ("Axis_group"));
}
}
void
Axis_group_interface::set_axes (Axis a1, Axis a2)
{
- // set_interface () ?
-
- SCM ax = gh_cons (gh_int2scm (a1), SCM_EOL);
- if (a1 != a2)
- ax= gh_cons (gh_int2scm (a2), ax);
+ // set_interface () ?
+ SCM sa1= gh_int2scm (a1);
+ SCM sa2 = gh_int2scm (a2);
+ SCM prop = elt_l_->get_elt_property ("axes");
- elt_l_->set_elt_property ("axes", ax);
+ if (prop == SCM_UNDEFINED
+ || scm_memq (sa1, prop) == SCM_BOOL_F
+ || scm_memq (sa2, prop) == SCM_BOOL_F)
+ {
+ SCM ax = gh_cons (sa1, SCM_EOL);
+ if (a1 != a2)
+ ax= gh_cons (sa2, ax);
+ elt_l_->set_elt_property ("axes", ax);
+ }
if (a1 != X_AXIS && a2 != X_AXIS)
elt_l_->set_extent_callback (0, X_AXIS);
{
if (!bar_p_)
{
- bar_p_ = new Staff_bar;
- bar_p_->property_alist_ = get_property ("basicBarlineProperties");
+ bar_p_ = new Staff_bar (get_property ("basicBarlineProperties"));
+
// urg: "" != empty...
/*
{
protected:
Text_item* text_p_;
- Protected_scm visibility_lambda_;
+
Protected_scm staffs_;
protected:
void
Bar_number_engraver::do_creation_processing ()
{
- String t = "barNumberVisibilityFunction";
- SCM proc = get_property (t);
-
- if (gh_procedure_p (proc))
- visibility_lambda_ = proc;
}
{
if (text_p_)
return;
-
- text_p_ = new Text_item;
- text_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh
+
+ SCM b = get_property ("basicBarNumberProperties");
+ text_p_ = new Text_item (b);
Side_position_interface staffside(text_p_);
staffside.set_axis (Y_AXIS);
gh_double2scm(paper_l ()->get_var ("interline")));
}
- if (gh_procedure_p (visibility_lambda_))
- text_p_->set_elt_property ("visibility-lambda",
- visibility_lambda_);
announce_element (Score_element_info (text_p_, 0));
}
#include "debug.hh"
#include "all-font-metrics.hh"
-Bar::Bar ()
+Bar::Bar (SCM s)
+ : Item (s)
{
}
Bar::before_line_breaking ()
{
SCM g = get_elt_property ("glyph");
+ SCM orig = g;
Direction bsd = break_status_dir ();
if (gh_string_p (g))
{
set_elt_property ("transparent", SCM_BOOL_T);
set_extent_callback (0, X_AXIS);
}
- else
+ else if (! gh_equal_p (g, orig))
set_elt_property ("glyph", g);
}
}
prev_start_req_ = reqs_drul_[START];
- beam_p_ = new Beam;
+ beam_p_ = new Beam (get_property ("basicBeamProperties"));
SCM smp = get_property ("measurePosition");
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
#include "staff-symbol-referencer.hh"
#include "cross-staff.hh"
-Beam::Beam ()
+Beam::Beam (SCM s)
+ : Spanner (s)
{
Pointer_group_interface g (this, "stems");
g.set_interface ();
Beam::calc_stem_y_f (Stem* s, Real y, Real dy) const
{
Real thick = gh_scm2double (get_elt_property ("beam-thickness"));
+ thick *= paper_l ()->get_var ("staffspace");
+
int beam_multiplicity = get_multiplicity ();
int stem_multiplicity = (s->flag_i () - 2) >? 0;
programming_error ("Beams are not left-to-right");
Real staffline_f = paper_l ()->get_var ("stafflinethickness");
- int multiplicity = get_multiplicity ();
+ int multiplicity = get_multiplicity ();
Real interbeam_f = paper_l ()->interbeam_f (multiplicity);
Real thick = gh_scm2double (get_elt_property ("beam-thickness"));
-
+ thick *= paper_l ()->get_var ("staffspace");
+
Real bdy = interbeam_f;
Real stemdx = staffline_f;
if (item_l->empty_b (X_AXIS) || item_l->parent_l (X_AXIS))
return;
- SCM bp=item_l->remove_elt_property ("breakable");
+ SCM bp=item_l->get_elt_property ("breakable");
bool breakable = (to_boolean (bp));
if (!breakable)
return ;
- SCM align_name = item_l->remove_elt_property ("break-align-symbol");
+ SCM align_name = item_l->get_elt_property ("break-align-symbol");
if (!gh_symbol_p (align_name))
return ;
if (!align_l_)
{
- align_l_ = new Break_align_item;
- align_l_->set_elt_property ("breakable", SCM_BOOL_T);
+ align_l_ = new Break_align_item (get_property ("basicBreakAlignProperties"));
announce_element (Score_element_info (align_l_,0));
-
- Item * edge = new Item;
SCM edge_sym = ly_symbol2scm ("Left_edge_item");
- edge->set_elt_property ("break-align-symbol", edge_sym);
+ Item * edge = new Item (get_property ("leftEdgeBasicProperties"));
/*
If the element is empty, it will be ignored in the break
}
else
{
- group = new Item;
+ group = new Item (SCM_EOL);
Axis_group_interface (group).set_interface ();
Axis_group_interface (group).set_axes (X_AXIS,X_AXIS);
}
-Break_align_item::Break_align_item ()
+Break_align_item::Break_align_item (SCM s)
+ : Item (s)
{
set_elt_property ("stacking-dir" , gh_int2scm (RIGHT));
{
if(breathing_sign_req_l_)
{
- breathing_sign_p_ = new Breathing_sign;
- breathing_sign_p_->set_elt_property ("break-align-symbol",
- ly_symbol2scm ("Breathing_sign"));
+ SCM b = get_property ("basicBreathingSignProperties");
+ breathing_sign_p_ = new Breathing_sign (b);
Staff_symbol_referencer_interface st (breathing_sign_p_);
st.set_interface ();
#include "direction.hh"
-Breathing_sign::Breathing_sign ()
+Breathing_sign::Breathing_sign (SCM s)
+ : Item (s)
{
- set_elt_property ("breakable", SCM_BOOL_T);
}
Molecule
if (gh_boolean_p (chord_inversion))
find_inversion_b = gh_scm2bool (chord_inversion);
- chord_name_p_ = new Chord_name;
+ chord_name_p_ = new Chord_name (SCM_EOL);
Chord chord = to_chord (pitch_arr_, tonic_req_, inversion_req_, bass_req_,
find_inversion_b);
return ly_text2molecule (text);
}
+
+Chord_name::Chord_name (SCM s)
+ : Item (s)
+{
+}
{
if (repeat_ && !beam_p_)
{
- beam_p_ = new Beam;
+ beam_p_ = new Beam (SCM_EOL);
beam_p_->set_elt_property ("chord-tremolo", SCM_BOOL_T);
{
if (!clef_p_)
{
- Clef_item *c= new Clef_item;
- c-> property_alist_ = current_settings_;
+ Clef_item *c= new Clef_item ( current_settings_);
announce_element (Score_element_info (c, clef_req_l_));
Staff_symbol_referencer_interface si(c);
si.set_position (clef_position_i_);
if (octave_dir_)
{
- Text_item * g = new Text_item;
+ Text_item * g = new Text_item (get_property ("basicOctavateEightProperties"));
Side_position_interface spi (g);
spi.set_axis (Y_AXIS);
spi.add_support (clef_p_);
- g->set_elt_property ("text", ly_str02scm ( "8"));
- g->set_elt_property ("style", gh_str02scm ("italic"));
g->set_parent (clef_p_, Y_AXIS);
g->set_parent (clef_p_, X_AXIS);
-
- g->set_elt_property ("self-alignment-X", gh_int2scm (0));
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", gh_int2scm (octave_dir_));
#include "molecule.hh"
#include "text-item.hh"
+Clef_item::Clef_item (SCM s)
+ : Item (s)
+{}
+
void
Clef_item::before_line_breaking ()
{
style = ly_scm2string (style_sym);
SCM glyph = get_elt_property ("glyph");
+
+ /*
+ FIXME: should use symbol.
+ */
if (gh_string_p (glyph))
{
String s = ly_scm2string (glyph);
-
+
+ /*
+ FIXME: should use fontsize property to set clef changes.
+ */
if (break_status_dir() != RIGHT && style != "fullSizeChanges")
{
s += "_change";
return ;
if (!col_p_)
{
- col_p_ = new Collision;
+ col_p_ = new Collision (get_property ("basicCollisionProperties"));
announce_element (Score_element_info (col_p_,0));
}
for (int i=0; i< note_column_l_arr_.size (); i++)
#include "axis-group-interface.hh"
-Collision::Collision()
+Collision::Collision(SCM s )
+ : Item (s)
{
Axis_group_interface (this).set_interface ();
Axis_group_interface (this).set_axes (X_AXIS, Y_AXIS);
#include "paper-column.hh"
-Crescendo::Crescendo ()
+Crescendo::Crescendo (SCM s)
+ : Spanner (s)
{
set_elt_property ("dynamic-drul", gh_cons (SCM_BOOL_F, SCM_BOOL_F));
}
if (!dotcol_p_)
{
- dotcol_p_ = new Dot_column;
+ dotcol_p_ = new Dot_column( SCM_EOL);
Side_position_interface (dotcol_p_).set_axis (X_AXIS);
Side_position_interface (dotcol_p_).set_direction (RIGHT);
announce_element (Score_element_info (dotcol_p_, 0));
}
-Dot_column::Dot_column ()
+Dot_column::Dot_column (SCM s)
+ : Item (s)
{
Pointer_group_interface gi (this, "dots");
gi.set_interface ();
#include "staff-symbol-referencer.hh"
#include "directional-element-interface.hh"
-Dots::Dots ()
+Dots::Dots (SCM s)
+ : Item (s)
{
set_elt_property ("dot-count", gh_int2scm (0));
}
class Dynamic_line_spanner : public Spanner
{
public:
- Dynamic_line_spanner ();
+ Dynamic_line_spanner (SCM);
VIRTUAL_COPY_CONS(Score_element);
void add_column (Note_column*);
void add_element (Score_element*);
};
-Dynamic_line_spanner::Dynamic_line_spanner ()
+Dynamic_line_spanner::Dynamic_line_spanner (SCM s)
+ : Spanner (s)
{
set_elt_property ("transparent", SCM_BOOL_T);
Side_position_interface (this).set_axis (Y_AXIS);
&& !line_spanner_
&& pending_element_arr_.size ())
{
- line_spanner_ = new Dynamic_line_spanner;
+ line_spanner_ = new Dynamic_line_spanner (get_property ("basicDynamicLineSpannerProperties"));
for (int i = 0; i < pending_column_arr_.size (); i++)
line_spanner_->add_column (pending_column_arr_[i]);
pending_column_arr_.clear ();
{
String loud = text_req_l_->text_str_;
- text_p_ = new Text_item;
- text_p_->set_elt_property ("text",
- ly_str02scm (loud.ch_C ()));
- text_p_->set_elt_property ("style", gh_str02scm ("dynamic"));
- text_p_->set_elt_property ("script-priority",
- gh_int2scm (100));
+ text_p_ = new Text_item (get_property ("basicDynamicTextProperties"));
+ text_p_->set_elt_property ("text", ly_str02scm (loud.ch_C ()));
if (Direction d=text_req_l_->get_direction ())
directional_element (text_p_).set (d);
pending_element_arr_.push (text_p_);
- text_p_->set_elt_property ("self-alignment-Y", gh_int2scm (0));
+
text_p_->add_offset_callback (Side_position_interface::aligned_on_self,
Y_AXIS);
announce_element (Score_element_info (text_p_, text_req_l_));
else
{
span_start_req_l_ = span_req_l_drul_[START];
- cresc_p_ = new Crescendo;
+ cresc_p_ = new Crescendo (SCM_EOL);
cresc_p_->set_elt_property
("grow-direction",
gh_int2scm ((span_req_l_drul_[START]->span_type_str_ == "crescendo")
return;
}
- extender_spanner_p_ = new Extender_spanner;
+ extender_spanner_p_ = new Extender_spanner (SCM_EOL);
extender_spanner_p_->set_textitem (LEFT, last_lyric_l_);
announce_element (Score_element_info (extender_spanner_p_, req_l_));
}
#include "paper-def.hh"
#include "extender-spanner.hh"
-Extender_spanner::Extender_spanner ()
- : Spanner ()
+Extender_spanner::Extender_spanner (SCM s)
+ : Spanner (s)
+
{
dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
set_extent_callback (Score_element::point_dimension_callback, Y_AXIS);
#include "paper-column.hh"
#include "paper-def.hh"
-Grace_align_item::Grace_align_item ()
+Grace_align_item::Grace_align_item (SCM s)
+ : Item (s)
{
set_elt_property ("stacking-dir", gh_int2scm (RIGHT));
Align_interface (this).set_interface();
Spanner*
Hara_kiri_engraver::get_spanner_p () const
{
- return new Hara_kiri_group_spanner;
+ return new Hara_kiri_group_spanner (SCM_EOL);
}
void
#include "debug.hh"
#include "item.hh"
-Hara_kiri_group_spanner::Hara_kiri_group_spanner()
+Hara_kiri_group_spanner::Hara_kiri_group_spanner(SCM s)
+ : Spanner (s)
{
set_elt_pointer ("items-worth-living", SCM_EOL);
}
return;
}
- hyphen_spanner_p_ = new Hyphen_spanner;
+ hyphen_spanner_p_ = new Hyphen_spanner (SCM_EOL);
hyphen_spanner_p_->set_textitem (LEFT, last_lyric_l_);
announce_element (Score_element_info (hyphen_spanner_p_, req_l_));
}
#include "hyphen-spanner.hh"
#include "dimension-cache.hh"
-Hyphen_spanner::Hyphen_spanner ()
- : Spanner ()
+Hyphen_spanner::Hyphen_spanner (SCM s)
+ : Spanner (s)
{
dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
class Bar:public Item {
public:
VIRTUAL_COPY_CONS(Score_element);
- Bar();
+ Bar(SCM);
Molecule compound_barline (String, Real height) const;
Molecule simple_barline (Real wid, Real height) const;
Stem* first_visible_stem () const;
Stem* last_visible_stem () const;
- Beam ();
+ Beam (SCM);
void add_stem (Stem*);
void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
void set_beaming (Beaming_info_list *);
protected:
virtual void before_line_breaking ();
public:
- Break_align_item ();
+ Break_align_item (SCM s);
VIRTUAL_COPY_CONS(Score_element);
};
#endif // BREAK_ALIGN_ITEM_HH
{
public:
VIRTUAL_COPY_CONS(Score_element);
- Breathing_sign ();
+ Breathing_sign (SCM s);
protected:
virtual void after_line_breaking ();
virtual Molecule do_brew_molecule () const;
VIRTUAL_COPY_CONS (Score_element);
Molecule ly_word2molecule (SCM scm) const;
Molecule ly_text2molecule (SCM scm) const;
-
+ Chord_name(SCM s);
protected:
virtual Molecule do_brew_molecule () const;
+
};
#endif // CHORD_NAME_HH
virtual void before_line_breaking ();
public:
VIRTUAL_COPY_CONS(Score_element);
+ Clef_item (SCM);
};
#endif // CLEFITEM_HH
public:
void add_column (Note_column*ncol_l);
- Collision();
+ Collision(SCM);
};
#endif // COLLISION_HH
*/
class Crescendo : public Spanner {
public:
- Crescendo();
+ Crescendo(SCM);
protected:
VIRTUAL_COPY_CONS(Score_element);
virtual Molecule do_brew_molecule() const;
public:
VIRTUAL_COPY_CONS (Score_element);
void add_head (Rhythmic_head*);
- Dot_column ();
+ Dot_column (SCM);
protected:
virtual void after_line_breaking ();
virtual void after_line_breaking ();
public:
- Dots ();
+ Dots (SCM);
};
#endif // DOTS_HH
class Extender_spanner : public Spanner
{
public:
- Extender_spanner ();
+ Extender_spanner (SCM);
void set_textitem (Direction, Item*);
protected:
{
public:
VIRTUAL_COPY_CONS (Score_element);
- Grace_align_item ();
+ Grace_align_item (SCM);
protected:
virtual void do_add_processing ();
virtual void before_line_breaking ();
class Hara_kiri_group_spanner : public Spanner
{
public:
- Hara_kiri_group_spanner ();
+ Hara_kiri_group_spanner (SCM);
virtual void after_line_breaking ();
void add_interesting_item (Item* n);
protected:
class Hyphen_spanner : public Spanner
{
public:
-Hyphen_spanner ();
+ Hyphen_spanner (SCM);
void set_textitem (Direction, Item*);
protected:
public:
VIRTUAL_COPY_CONS(Score_element);
- Item();
+ Item (SCM);
Item (Item const &);
bool breakable_b () const;
Universal key definition (Should rename class Key to 'Accidentals'?)
FIXME: merge key.hh and key-def.hh classes.
+
+ FIXME: use Scheme data structs for this.
*/
class Key_def
{
public:
VIRTUAL_COPY_CONS(Score_element);
- Key_item ();
+ Key_item (SCM);
void add (int pitch, int acc);
void add_old (int pitch, int acc);
#include "array.hh"
#include "lily-proto.hh"
+/*
+ JUNKME JUNKME JUNKME
+ */
+
/// administration of current key in one octave.
class Octave_key {
Molecule accidental (int,bool,bool) const;
public:
-
+ Local_key_item (SCM );
void add_pitch (Musical_pitch, bool cautionary, bool natural);
protected:
virtual void before_line_breaking ();
virtual Molecule do_brew_molecule() const;
+
+
};
#endif // LOCALKEYITEM_HH
class Multi_measure_rest : public Spanner
{
public:
- Multi_measure_rest ();
+ Multi_measure_rest (SCM);
void add_column (Item*);
Molecule compound_rest (int)const;
Scope *scope_p_;
Array<String> filename_str_arr_;
- Scheme_hash_table default_properties_;
Music_output_def (Music_output_def const&);
Music_output_def ();
void translate_rests(int dy);
Note_head * first_head ()const;
Interval rest_dim ()const ;
- Note_column ();
+ Note_column (SCM);
void set_stem (Stem*);
void set_dotcol (Dot_column*);
void add_head (Rhythmic_head*);
static int compare (Note_head * const &a, Note_head *const &b) ;
Molecule ledger_line (Interval) const;
+ Note_head (SCM);
protected:
-
virtual void before_line_breaking ();
virtual Molecule do_brew_molecule() const;
};
void add_column (Note_column*);
Interval rest_dim () const;
- Rest_collision();
+ Rest_collision(SCM);
protected:
virtual void before_line_breaking ();
};
protected:
virtual void after_line_breaking ();
virtual Molecule do_brew_molecule () const;
+public:
+ Rest (SCM s);
};
#endif // REST_HH
int dot_count () const;
protected:
virtual void after_line_breaking ();
+ Rhythmic_head (SCM s);
};
#endif // RHYTHMIC_HEAD_HH
typedef Interval (*Extent_callback)(Score_element const *,Axis);
typedef Real (*Offset_callback)(Score_element const *,Axis);
+#define READONLY_PROPS // FIXME.
+
/**
for administration of what was done already
public: // ugh.
SCM property_alist_;
SCM pointer_alist_;
+#ifndef READONLY_PROPS
+ SCM basic_property_list_;
+#endif
public:
Score_element *original_l_;
0 means ORPHAN,
*/
char status_i_;
- /**
- Set this if anyone points to me, or if I point to anyone.
-
- JUNKME.
- */
- bool used_b_;
-
char const * name () const;
/*
*/
Paper_score *pscore_l_;
- Score_element ();
+ Score_element (SCM basic_props);
Score_element (Score_element const&);
/*
class Script_column : public Item
{
public:
- Script_column();
+ Script_column(SCM);
void add_staff_sided (Item*);
protected:
virtual void before_line_breaking ();
{
Molecule get_molecule (Direction d) const;
public:
+ Script (SCM);
protected:
virtual void before_line_breaking ();
{
public:
void add_spacing_unit (Single_malt_grouping_item*);
- Separating_group_spanner();
+ Separating_group_spanner(SCM);
protected:
VIRTUAL_COPY_CONS(Score_element);
virtual Array<Rod> get_rods () const;
{
VIRTUAL_COPY_CONS(Score_element);
public:
- Single_malt_grouping_item ();
+ Single_malt_grouping_item (SCM);
Interval my_width () const;
void add_item (Item*);
};
class Slur : public Spanner
{
public:
- Slur ();
+ Slur (SCM);
VIRTUAL_COPY_CONS(Score_element);
void add_column (Note_column*);
class Spacing_spanner : public Spanner
{
public:
- Spacing_spanner ();
+ Spacing_spanner (SCM);
VIRTUAL_COPY_CONS(Score_element);
Array<Spring> do_measure (Link_array<Paper_column>) const;
{
Interval get_spanned_interval () const;
public:
- Span_bar();
+ Span_bar (SCM);
VIRTUAL_COPY_CONS(Score_element);
void add_bar (Score_element*);
void set_bound (Direction d, Item*);
Item *get_bound (Direction d) const;
- Spanner ();
+ Spanner (SCM);
Spanner (Spanner const &);
bool broken_b () const;
void do_break ();
public:
VIRTUAL_COPY_CONS(Score_element);
virtual Real get_bar_size () const;
+ Staff_bar (SCM);
};
#endif /* STAFF_BAR_HH */
Real staff_space () const;
int steps_i() const;
int line_count () const;
+ Staff_symbol (SCM s);
+
protected:
VIRTUAL_COPY_CONS(Score_element);
virtual Molecule do_brew_molecule() const;
+
};
#endif // STAFFSYM_HH
static Interval dim_callback (Score_element*, Axis);
public:
- Stem_tremolo ();
+ Stem_tremolo (SCM);
void set_stem (Stem *);
};
Drul_array<Note_head*> extremal_heads () const;
Score_element * support_head () const;
- Stem ();
+ Stem (SCM);
/// ensure that this Stem also encompasses the Notehead #n#
void add_head (Rhythmic_head*n);
{
public:
VIRTUAL_COPY_CONS (Score_element);
-
+ Sustain_pedal (SCM);
protected:
virtual Molecule do_brew_molecule () const;
virtual void after_line_breaking ();
class System_start_delimiter : public Spanner
{
public:
- System_start_delimiter ();
+ System_start_delimiter (SCM);
VIRTUAL_COPY_CONS (Score_element);
protected:
virtual void after_line_breaking();
{
public:
VIRTUAL_COPY_CONS (Score_element);
+ Text_item (SCM s);
protected:
virtual Molecule do_brew_molecule () const;
};
public:
VIRTUAL_COPY_CONS (Score_element);
void add_tie (Tie*);
- Tie_column ();
+ Tie_column (SCM s);
protected:
virtual void after_line_breaking ();
void set_directions ();
-
};
#endif /* TIE_COLUMN_HH */
class Tie : public Spanner
{
public:
- Tie ();
+ Tie (SCM);
void set_head (Direction, Item*head_l);
VIRTUAL_COPY_CONS(Score_element);
protected:
virtual Molecule do_brew_molecule() const;
public:
- Time_signature () ;
+ Time_signature (SCM);
/*
TODO: make this SCM!
class Tuplet_spanner : public Spanner
{
public:
- Tuplet_spanner ();
+ Tuplet_spanner (SCM);
void add_column (Note_column*);
void add_beam (Beam*);
class Volta_spanner : public Spanner
{
public:
- Volta_spanner ();
+ Volta_spanner (SCM);
void add_column (Note_column*);
void add_bar (Bar*);
{
if(!text_)
{
- text_ = new Text_item;
+ text_ = new Text_item (get_property ("basicInstrumentNameProperties"));
text_->set_elt_property ("text", txt);
- text_->set_elt_property ("breakable", SCM_BOOL_T);
/*
TODO: use more lispish names for break-align-symbols
*/
- text_->set_elt_property ("break-align-symbol", ly_symbol2scm ("Instrument_name"));
- text_->set_elt_property ("visibility-lambda",
- scm_eval (ly_symbol2scm ("begin-of-line-visible")));
-
if (delim_)
text_->set_parent (delim_, Y_AXIS);
#include "lily-guile.hh"
#include "line-of-score.hh"
-Item::Item ()
+Item::Item (SCM s)
+ : Score_element (s)
+
{
broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0;
}
(c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-// clean me up
+
#include "key-engraver.hh"
#include "key-item.hh"
#include "command-request.hh"
#include "timing-translator.hh"
#include "staff-symbol-referencer.hh"
+/*
+ this is a large mess. Please clean this to use Basic properties and
+ Scheme data structs.
+ */
+
Key_engraver::Key_engraver ()
{
item_p_ = 0;
{
if (!item_p_)
{
- item_p_ = new Key_item;
- item_p_->property_alist_ = get_property ("basicKeyProperties");
-
+ item_p_ = new Key_item ( get_property ("basicKeyProperties"));
item_p_->set_elt_property ("c0-position", gh_int2scm (0));
+
+ // todo: put this in basic props.
item_p_->set_elt_property ("old-accidentals", SCM_EOL);
item_p_->set_elt_property ("new-accidentals", SCM_EOL);
const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */
const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */
-Key_item::Key_item ()
+Key_item::Key_item (SCM s)
+ : Item (s)
{
- set_elt_property ("breakable", SCM_BOOL_T);
set_elt_property ("c0-position", gh_int2scm (0));
}
void
Line_group_engraver_group::create_line_spanner ()
{
- staffline_p_ = new Spanner ;
+ staffline_p_ = new Spanner (SCM_EOL);
Axis_group_interface (staffline_p_).set_interface ();
Axis_group_interface (staffline_p_).set_axes (Y_AXIS,Y_AXIS);
}
{
if (!text_item_p_ && interesting_.size ())
{
- text_item_p_ = new Text_item;
+ text_item_p_ = new Text_item (SCM_EOL);
Side_position_interface si (text_item_p_);
si.set_axis (Y_AXIS);
text_item_p_->set_parent (interesting_[0].elem_l_, Y_AXIS);
#include "all-font-metrics.hh"
Line_of_score::Line_of_score()
+ : Spanner (SCM_EOL)
{
set_elt_pointer ("columns", SCM_EOL);
set_elt_pointer ("all-elements", SCM_EOL);
{
if (!key_item_p_)
{
- key_item_p_ = new Local_key_item;
+ key_item_p_ = new Local_key_item (SCM_EOL);
Side_position_interface (key_item_p_).set_axis (X_AXIS);
Side_position_interface (key_item_p_).set_direction (LEFT);
staff_symbol_referencer(key_item_p_).set_interface ();
return mol;
}
+Local_key_item::Local_key_item (SCM s)
+ : Item (s)
+{
+
+}
{
if (req_l_)
{
- text_p_= new Text_item;
+ text_p_= new Text_item (get_property ("basicLyricTextProperties"));
text_p_->set_elt_property ("text",
ly_str02scm ((req_l_->text_str_ + " ").ch_C ()));
- text_p_->set_elt_property ("non-rhythmic", SCM_BOOL_T);
+
announce_element (Score_element_info (text_p_, req_l_));
}
}
Mark_engraver ();
protected:
Text_item* text_p_;
- Protected_scm visibility_lambda_;
Protected_scm staffs_;
protected:
void
Mark_engraver::do_creation_processing ()
{
- String t = "markVisibilityFunction";
- SCM proc = get_property (t);
-
- if (gh_procedure_p (proc))
- visibility_lambda_ = proc;
}
-
void
Mark_engraver::acknowledge_element (Score_element_info inf)
{
{
if (text_p_)
return;
-
- text_p_ = new Text_item;
- text_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh
+
+ SCM s = get_property ("basicMarkProperties");
+ text_p_ = new Text_item (s);
+
Group_interface (text_p_, "interfaces").add_thing (ly_symbol2scm ("Mark"));
Side_position_interface staffside(text_p_);
staffside.set_axis (Y_AXIS);
+ /*
+ -> Generic props.
+ */
SCM prop = get_property ("markDirection");
if (!isdir_b (prop))
{
gh_double2scm(paper_l ()->get_var ("interline")));
}
- if (gh_procedure_p (visibility_lambda_))
- text_p_->set_elt_property ("visibility-lambda",
- visibility_lambda_);
announce_element (Score_element_info (text_p_, rq));
}
if (busy_span_req_l_ && !mmrest_p_)
{
- mmrest_p_ = new Multi_measure_rest;
+ mmrest_p_ = new Multi_measure_rest (SCM_EOL);
Staff_symbol_referencer_interface si (mmrest_p_);
si.set_interface ();
#include "stem.hh"
#include "staff-symbol-referencer.hh"
-Multi_measure_rest::Multi_measure_rest ()
+Multi_measure_rest::Multi_measure_rest (SCM s)
+ : Spanner (s)
{
set_elt_pointer ("columns", SCM_EOL);
}
{
scope_p_ = new Scope (*s.scope_p_);
translator_p_dict_p_ = new Scope (*s.translator_p_dict_p_);
- default_properties_ = s.default_properties_;
+ // default_properties_ = s.default_properties_;
for (Scope_iter i (*translator_p_dict_p_); i.ok (); i++)
{
return h1 - h2;
}
-Note_column::Note_column()
+Note_column::Note_column( SCM s)
+ : Item (s)
{
set_elt_pointer ("rests", SCM_EOL);
set_elt_pointer ("note-heads", SCM_EOL);
return out;
}
+
+Note_head::Note_head (SCM s)
+ : Rhythmic_head (s)
+{
+
+}
for (int i=0; i < note_req_l_arr_.size (); i++)
{
- Note_head *note_p = new Note_head;
+ Note_head *note_p = new Note_head (SCM_EOL);
Staff_symbol_referencer_interface si (note_p);
si.set_interface ();
if (note_req_l->duration_.dots_i_)
{
- Dots * d = new Dots;
+ Dots * d = new Dots (SCM_EOL);
Staff_symbol_referencer_interface sd (d);
sd.set_interface ();
}
if (s.length_i())
{
- Text_item * t = new Text_item;
+ Text_item * t = new Text_item (SCM_EOL);
t->set_elt_property ("text", ly_str02scm ( s.ch_C()));
announce_element (Score_element_info (t, req_l_arr_[0]));
texts_.push (t);
}
Paper_column::Paper_column (Moment w)
+ : Item (SCM_EOL)
{
SCM when = (new Moment (w))->smobify_self ();
scm_unprotect_object (when);
return *p;
}
-
+/*
+ FIXME. This is broken until we have a generic way of
+ putting lists inside the \paper block.
+ */
Interval
Paper_def::line_dimensions_int (int n) const
{
- SCM s = default_properties_.get (ly_symbol2scm ("margin-shape"));
- if (!gh_pair_p (s))
- {
- Real lw = get_var ("linewidth");
- Real ind = n? 0.0:get_var ("indent");
+ Real lw = get_var ("linewidth");
+ Real ind = n? 0.0:get_var ("indent");
- return Interval (ind, lw);
- }
-
-
- SCM last = SCM_EOL;
- while (gh_pair_p (s) && n --)
- {
- last = s;
- s = gh_cdr (s);
- }
-
- if (s == SCM_EOL)
- {
- s = last;
- }
-
- SCM pair = gh_car (s);
-
- return Interval (gh_scm2double (gh_car (pair)),
- gh_scm2double (gh_cdr (pair)));
+ return Interval (ind, lw);
}
void
}
| paper_def_body assignment semicolon {
- }
- | paper_def_body SCM_T '=' SCM_T {
- if (!gh_symbol_p ($2))
- THIS->parser_error ("expect a symbol as lvalue");
- else
- $$->default_properties_.set ($2, $4);
- }
- | paper_def_body SCM_T '=' real semicolon {
- if (!gh_symbol_p ($2))
- THIS->parser_error ("expect a symbol as lvalue");
- else
- $$->default_properties_.set ($2, gh_double2scm ($4));
}
| paper_def_body translator_spec_block {
$$->assign_translator ($2);
{
if (p->name_ == String ("Sustain"))
{
- p->item_p_ = new Sustain_pedal;
+ p->item_p_ = new Sustain_pedal (SCM_EOL);
p->item_p_->set_elt_property ("text", s);
}
else
{
- p->item_p_ = new Text_item;
+ p->item_p_ = new Text_item (SCM_EOL);
p->item_p_->set_elt_property ("text", s);
// guh
p->item_p_->set_elt_property ("style", ly_str02scm ("italic"));
Side_position_interface si (p->item_p_);
si.set_axis (Y_AXIS);
+ // todo: init with basic props.
p->item_p_->set_elt_property ("no-spacing-rods" , SCM_BOOL_T);
p->item_p_->set_elt_property ("self-alignment-X", gh_int2scm (0));
p->item_p_->add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS);
void
Pointer_group_interface::add_element (Score_element*p)
{
- p->used_b_ = true;
- elt_l_->used_b_ = true;
-
elt_l_->set_elt_pointer (name_.ch_C(),
gh_cons (p->self_scm_,
elt_l_->get_elt_pointer (name_.ch_C())));
else
{
assert (!volta_span_p_);
- volta_span_p_ = new Volta_spanner;
+ volta_span_p_ = new Volta_spanner (SCM_EOL);
announce_element (Score_element_info (volta_span_p_,0));
volta_span_p_->set_elt_property ("text",
ly_str02scm (t.ch_C()));
if (rest_collision_p_ || note_column_l_arr_.size () < 2)
return;
- rest_collision_p_ = new Rest_collision;
+ rest_collision_p_ = new Rest_collision (get_property ("basicRestCollisionProperties"));
announce_element (Score_element_info (rest_collision_p_, 0));
for (int i=0; i< note_column_l_arr_.size (); i++)
}
-Rest_collision::Rest_collision()
+Rest_collision::Rest_collision(SCM s)
+ : Item (s)
{
set_elt_pointer ("rests", SCM_EOL);
set_elt_pointer ("notes", SCM_EOL);
- set_elt_property ("transparent", SCM_BOOL_T);
set_extent_callback (0, X_AXIS);
set_extent_callback (0, Y_AXIS);
}
{
if (rest_req_l_ && !rest_p_)
{
- rest_p_ = new Rest;
+ rest_p_ = new Rest (SCM_EOL);
Staff_symbol_referencer_interface si (rest_p_);
si.set_interface ();
if (rest_req_l_->duration_.dots_i_)
{
- dot_p_ = new Dots;
+ dot_p_ = new Dots (SCM_EOL);
Staff_symbol_referencer_interface si (dot_p_);
si.set_interface ();
+Rest::Rest (SCM s)
+ : Rhythmic_head (s)
+{
+}
+
{
if (!ncol_p_)
{
- ncol_p_ = new Note_column;
+ ncol_p_ = new Note_column (SCM_EOL);
announce_element (Score_element_info (ncol_p_, 0));
}
}
+Rhythmic_head::Rhythmic_head (SCM s)
+ : Item (s)
+{
+}
subclass.
*/
-Score_element::Score_element()
+
+
+Score_element::Score_element(SCM basicprops)
{
- // junkme.
- used_b_ = false;
set_extent_callback (molecule_extent, X_AXIS);
set_extent_callback (molecule_extent, Y_AXIS);
- used_b_ = false;
pscore_l_=0;
lookup_l_ =0;
status_i_ = 0;
self_scm_ = SCM_EOL;
original_l_ = 0;
- property_alist_ = SCM_EOL;
+#ifndef READONLY_PROPS
+ basic_property_list_ = basicprops;
+#endif READONLY_PROPS
+ property_alist_ = basicprops;
pointer_alist_ = SCM_EOL;
smobify_self ();
: dim_cache_ (s.dim_cache_)
{
self_scm_ = SCM_EOL;
- used_b_ = true;
original_l_ =(Score_element*) &s;
- property_alist_ = s.property_alist_;
+ property_alist_ = s.property_alist_;
+#ifndef READONLY_PROPS
+ basic_property_list_ = s.basic_property_list_;
+ /*
+ TODO: should copy the private part of the list.
+ */
+ SCM y ;
+ for (SCM *sp = &s.property_alist_; *sp != basic_property_list_; sp = &SCM_CDR(*sp))
+ {
+ *sp = gh_cons (
+ }
+#endif
pointer_alist_ = SCM_EOL;
status_i_ = s.status_i_;
{
}
+
+SCM
+Score_element::get_elt_pointer (const char *nm) const
+{
+ SCM sym = ly_symbol2scm (nm);
+ SCM s = scm_assq(sym, pointer_alist_);
+
+ return (s == SCM_BOOL_F) ? SCM_UNDEFINED : gh_cdr (s);
+}
+
// should also have one that takes SCM arg.
SCM
Score_element::get_elt_property (String nm) const
if (s != SCM_BOOL_F)
return gh_cdr (s);
- /*
- JUNKME
- */
- if (pscore_l_)
- {
- SCM sym2 = ly_symbol2scm ((name () + ("::" + nm)).ch_C());
- SCM val;
-
- // should probably check for Type::sym as well.
- Paper_def * p= pscore_l_->paper_l_;
- if (p->default_properties_.try_retrieve (sym2, &val))
- return val;
- else if (p->default_properties_.try_retrieve (sym, &val))
- return val;
- }
-
return SCM_UNDEFINED;
}
-SCM
-Score_element::get_elt_pointer (const char *nm) const
-{
- SCM sym = ly_symbol2scm (nm);
- SCM s = scm_assq(sym, pointer_alist_);
-
- return (s == SCM_BOOL_F) ? SCM_UNDEFINED : gh_cdr (s);
-}
-
+/*
+ Remove the value associated with KEY, and return it. The result is
+ that a next call will yield SCM_UNDEFINED (and not the underlying
+ `basic' property.
+*/
SCM
Score_element::remove_elt_property (const char* key)
{
- SCM s = get_elt_property (key);
- SCM sym = ly_symbol2scm (key);
-
- property_alist_ = gh_cons (gh_cons (sym, SCM_UNDEFINED), property_alist_);
-
- return s;
+ SCM val = get_elt_property (key);
+ if (val != SCM_UNDEFINED)
+ set_elt_property (key, SCM_UNDEFINED);
+ return val;
}
void
-Score_element::set_elt_property (String k, SCM v)
+Score_element::set_elt_property (String k, SCM val)
{
- SCM s = ly_symbol2scm (k.ch_C ());
- // non destructive
- property_alist_ = gh_cons (gh_cons (s, v),property_alist_);
+ SCM sym = ly_symbol2scm (k.ch_C ());
+#ifndef READONLY_PROPS
+ /*
+ destructive if found in my part of the list.
+ */
+ for (SCM s = property_alist_; s != basic_property_list_; s =gh_cdr (s))
+ {
+ if (gh_caar (s)== sym)
+ {
+ gh_set_cdr_x (gh_car (s), val);
+ return;
+ }
+ }
+/*
+ not found in private list. Override in private list.
+ */
+
+#endif
+
+ property_alist_ = gh_cons (gh_cons (sym, val), property_alist_);
}
+
void
Score_element::set_elt_pointer (const char* k, SCM v)
{
}
-bool
-Score_element::linked_b() const
-{
- return used_b_;
-}
-
Score_element*
Score_element::find_broken_piece (Line_of_score*) const
{
{
if (!elem_p->parent_l (X_AXIS))
{
- bool br = to_boolean (elem_p->remove_elt_property ("breakable"));
+ bool br = to_boolean (elem_p->get_elt_property ("breakable"));
Axis_group_interface gi ((br) ? command_column_l_ : musical_column_l_) ;
gi.add_element(elem_p);
}
if (*current[i])
{
if ((*current[i])->used_b())
- // if ((*current[i])->linked_b())
+
{
scoreline_l_->add_column ((*current[i]));
}
{
if (!scol_p_ && script_l_arr_.size () > 1)
{
- scol_p_ = new Script_column;
+ scol_p_ = new Script_column (SCM_EOL);
announce_element (Score_element_info (scol_p_, 0));
}
add_dependency (i);
}
-Script_column::Script_column ()
+Script_column::Script_column (SCM s)
+ : Item (s)
{
- set_elt_property ("scripts", SCM_EOL);
+ set_elt_pointer ("scripts", SCM_EOL);
}
static int
l->articulation_str_.ch_C ()));
continue;
}
- Script *p =new Script;
+ // todo -> use result of articulation-to-scriptdef directly as basic prop list.
+ Script *p =new Script (SCM_EOL);
Side_position_interface stafy (p);
#include "paper-def.hh"
#include "dimension-cache.hh"
+Script ::Script (SCM s)
+ : Item (s)
+{
+}
Molecule
Script::get_molecule(Direction d) const
}
-Separating_group_spanner::Separating_group_spanner ()
+Separating_group_spanner::Separating_group_spanner (SCM s)
+ : Spanner (s)
{
set_elt_pointer ("elements", SCM_EOL);
}
void
Separating_line_group_engraver::do_creation_processing ()
{
- sep_span_p_ = new Separating_group_spanner;
+ sep_span_p_ = new Separating_group_spanner (SCM_EOL);
announce_element (Score_element_info (sep_span_p_, 0));
sep_span_p_->set_bound (LEFT, get_staff_info ().command_pcol_l ());
}
if (!p_ref_)
{
- p_ref_ = new Single_malt_grouping_item;
+ p_ref_
+ = new Single_malt_grouping_item
+ (get_property ("basicSingleMaltGroupingItemProperties"));
+
if (ib)
p_ref_->set_elt_property ("breakable", SCM_BOOL_T);
announce_element (Score_element_info (p_ref_, 0));
#include "debug.hh"
#include "group-interface.hh"
-Single_malt_grouping_item ::Single_malt_grouping_item()
+Single_malt_grouping_item ::Single_malt_grouping_item(SCM s)
+ : Item (s)
{
- set_elt_property ("transparent", SCM_BOOL_T);
set_elt_pointer ("elements", SCM_EOL);
// this is weird! , but needed!
{
// push a new slur onto stack.
//(use temp. array to wait for all slur STOPs)
- Slur * s_p =new Slur;
+ Slur * s_p =new Slur (SCM_EOL);
requests_arr_.push (slur_req_l);
start_slur_l_arr_.push (s_p);
Slur
*/
-Slur::Slur ()
+Slur::Slur (SCM s)
+ : Spanner (s)
{
// URG
dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0;
void
Spacing_engraver::do_creation_processing ()
{
- spacing_p_ =new Spacing_spanner;
+ spacing_p_ =new Spacing_spanner (SCM_EOL);
spacing_p_->set_bound (LEFT, get_staff_info ().command_pcol_l ());
announce_element (Score_element_info (spacing_p_, 0));
}
#include "line-of-score.hh"
#include "misc.hh"
-Spacing_spanner::Spacing_spanner ()
+Spacing_spanner::Spacing_spanner (SCM s)
+ : Spanner (s)
{
set_extent_callback (0, X_AXIS);
set_extent_callback (0, Y_AXIS);
protected:
virtual void acknowledge_element (Score_element_info);
virtual void do_pre_move_processing();
- virtual Span_bar* get_span_bar_p() const;
+ virtual Span_bar* get_span_bar_p(SCM) const;
};
}
Span_bar*
-Span_bar_engraver::get_span_bar_p() const
+Span_bar_engraver::get_span_bar_p(SCM s) const
{
- Span_bar * sp= new Span_bar;
+ Span_bar * sp= new Span_bar (s);
return sp;
}
if (bar_l_arr_.size() >= 2 && !spanbar_p_)
{
- spanbar_p_ = get_span_bar_p();
- spanbar_p_-> property_alist_ = bar_l_arr_[0]->property_alist_;
+ spanbar_p_ = get_span_bar_p( bar_l_arr_[0]->property_alist_);
spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS);
spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS);
void
Span_bar::evaluate_empty ()
{
- if (!gh_pair_p (get_elt_property ("elements")))
+ if (!gh_pair_p (get_elt_pointer ("elements")))
{
set_elt_property ("transparent", SCM_BOOL_T);
set_extent_callback (0, X_AXIS);
}
else {
String type_str = ly_scm2string (gl);
+ String orig = type_str;
if (type_str == "|:")
{
type_str= ".|";
{
type_str= ".|.";
}
-
- set_elt_property ("glyph", ly_str02scm (type_str.ch_C()));
+ if (orig != type_str)
+ set_elt_property ("glyph", ly_str02scm (type_str.ch_C()));
}
}
return iv.length ();
}
-Span_bar::Span_bar ()
+Span_bar::Span_bar (SCM s)
+ : Bar (s)
{
Pointer_group_interface(this).set_interface ();
set_extent_callback (width_callback, X_AXIS);
Spanner::set_bound(Direction d, Item*i)
{
spanned_drul_[d] =i;
- if (i)
- {
- i->used_b_ = true;
- }
/**
We check for Line_of_score to prevent the column -> line_of_score
}
-Spanner::Spanner ()
+Spanner::Spanner (SCM s)
+ : Score_element (s)
{
spanned_drul_[LEFT]=0;
spanned_drul_[RIGHT]=0;
}
}
+
+Staff_bar::Staff_bar (SCM s)
+ : Bar (s)
+{
+
+}
/*
- staff-sym-reg.cc -- implement Staff_symbol_engraver
+ staff-symbol-engraver.cc -- implement Staff_symbol_engraver
source file of the GNU LilyPond music typesetter
void
Staff_symbol_engraver::do_creation_processing()
{
- span_p_ = new Staff_symbol;
+ span_p_ = new Staff_symbol (get_property ("staffSymbolBasicProperties"));
span_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
-
- // ugh, should do generic
- span_p_->property_alist_ = get_property ("staffSymbolBasicProperties");
announce_element (Score_element_info (span_p_, 0));
}
Real
Staff_symbol_referencer_interface::callback (Score_element const* sc,Axis )
{
+ Score_element* me = (Score_element*)sc; // UGH.
+
SCM pos = sc->get_elt_property ("staff-position");
Real off =0.0;
if (gh_number_p (pos))
Real space = staff_symbol_referencer (sc).staff_space ();
off = gh_scm2double (pos) * space/2.0;
}
- Score_element* urg = (Score_element*)sc;
- urg->set_elt_property ("staff-position", gh_double2scm (0.0));
+
+ me->set_elt_property ("staff-position", gh_double2scm (0.0));
return off;
}
return gh_scm2double (get_elt_property ("staff-space")) *
paper_l ()->get_var ("staffspace");
}
+
+Staff_symbol::Staff_symbol( SCM s)
+ : Spanner (s)
+{
+}
int duration_log = r->duration_.durlog_i_;
if (!stem_p_)
{
- stem_p_ = new Stem;
+ stem_p_ = new Stem (SCM_EOL);
Staff_symbol_referencer_interface st(stem_p_);
st.set_interface ();
if (requested_type)
{
- tremolo_p_ = new Stem_tremolo;
+ tremolo_p_ = new Stem_tremolo (get_property ("basicStemTremoloProperties"));
announce_element (Score_element_info (tremolo_p_, tremolo_req_l_));
/*
The number of tremolo flags is the number of flags of
lengthen stem if necessary
*/
-Stem_tremolo::Stem_tremolo ()
+Stem_tremolo::Stem_tremolo (SCM s)
+ : Item (s)
{
set_elt_pointer ("stem", SCM_EOL);
}
}
Interval
-Stem_tremolo::dim_callback (Score_element * se, Axis a)
+Stem_tremolo::dim_callback (Score_element * se, Axis )
{
Stem_tremolo * s = dynamic_cast<Stem_tremolo*> (se);
Real space = Staff_symbol_referencer_interface (s->stem_l ())
// urg
dydx = 0.25;
+ Real ss = Staff_symbol_referencer_interface (stem).staff_space ();
Real thick = gh_scm2double (get_elt_property ("beam-thickness"));
Real width = gh_scm2double (get_elt_property ("beam-width"));
+ width *= ss;
+ thick *= ss;
+
Molecule a (lookup_l ()->beam (dydx, width, thick));
a.translate (Offset (-width/2, width / 2 * dydx));
}
if (tremolo_flags)
mol.translate_axis (-mol.extent (Y_AXIS).center (), Y_AXIS);
-
- Real half_space = Staff_symbol_referencer_interface (stem).staff_space ()
- / 2;
if (beam)
{
// ugh, rather calc from Stem_tremolo_req
int beams_i = stem->beam_count(RIGHT) >? stem->beam_count (LEFT);
mol.translate (Offset(stem->relative_coordinate (0, X_AXIS) - relative_coordinate (0, X_AXIS),
- stem->stem_end_position () * half_space -
+ stem->stem_end_position () * ss / 2 -
directional_element (beam).get () * beams_i * interbeam_f));
}
else
/*
Beams should intersect one beamthickness below stem end
*/
- Real dy = stem->stem_end_position () * half_space;
+ Real dy = stem->stem_end_position () * ss / 2;
dy -= mol.extent (Y_AXIS).length () / 2 * stem->get_direction ();
/*
gi.add_element (n);
}
-Stem::Stem ()
+Stem::Stem (SCM s)
+ : Item (s)
{
set_elt_pointer ("heads", SCM_EOL);
set_elt_pointer ("rests", SCM_EOL);
}
+
+Sustain_pedal ::Sustain_pedal(SCM s )
+ : Item (s)
+{}
void
System_start_delimiter_engraver::do_creation_processing()
{
- delim_ = new System_start_delimiter;
+ delim_ = new System_start_delimiter (get_property ("basicSystemStartDelimiterProperties"));
delim_->set_bound (LEFT, get_staff_info ().command_pcol_l ());
/*
SCM collapse = get_property ("bracketCollapseHeight");
if (gh_number_p (collapse))
delim_->set_elt_property ("collapse-height", collapse);
- else
- delim_->set_elt_property ("collapse-height", gh_double2scm (1));
delim_->set_bound (RIGHT, get_staff_info ().command_pcol_l ());
typeset_element (delim_);
return mol;
}
-System_start_delimiter::System_start_delimiter ()
+System_start_delimiter::System_start_delimiter (SCM s)
+ : Spanner (s)
{
set_extent_callback (0, Y_AXIS);
Pointer_group_interface (this).set_interface();
{
Text_script_req * r = reqs_[i];
- Text_item *text = new Text_item;
+ Text_item *text = new Text_item (SCM_EOL);
Side_position_interface stafy (text);
SCM axisprop = get_property ("scriptHorizontal");
#include "lookup.hh"
#include "staff-symbol-referencer.hh"
+Text_item::Text_item (SCM s)
+ : Item (s)
+{
+
+}
+
Molecule
Text_item::do_brew_molecule () const
{
#include "directional-element-interface.hh"
#include "note-head.hh"
-Tie_column::Tie_column ()
+Tie_column::Tie_column (SCM s)
+ : Spanner (s)
{
set_elt_pointer ("ties", SCM_EOL);
set_extent_callback (0, X_AXIS);
SCM pair = gh_list_ref (head_list, gh_int2scm (i/2));
- Tie * p = new Tie;
+ Tie * p = new Tie (SCM_EOL);
p->set_head (LEFT, dynamic_cast<Item*> (unsmob_element (gh_car (pair))));
p->set_head (RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdr (pair))));
}
else for (SCM s = head_list; gh_pair_p (s); s = gh_cdr (s))
{
- Tie * p = new Tie;
+ Tie * p = new Tie (SCM_EOL);
p->set_head (LEFT, dynamic_cast<Item*> (unsmob_element (gh_caar (s))));
p->set_head (RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdar (s))));
}
else if (tie_p_arr_.size () > 1 && !tie_column_p_)
{
- tie_column_p_ = new Tie_column;
+ tie_column_p_ = new Tie_column (SCM_EOL);
for (int i = tie_p_arr_.size (); i--; )
tie_column_p_->add_tie (tie_p_arr_ [i]);
announce_element (Score_element_info (tie_column_p_, 0));
add_dependency (head_l);
}
-Tie::Tie()
+Tie::Tie(SCM s)
+ : Spanner (s)
{
set_elt_pointer ("heads", gh_cons (SCM_EOL, SCM_EOL));
dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0;
Time_signature_change_req *req = timing_grav_l->time_signature_req_l();
if (req)
{
- time_signature_p_ = new Time_signature;
- time_signature_p_->property_alist_ = get_property ("basicTimeSignatureProperties");
+ time_signature_p_ = new Time_signature (get_property ("basicTimeSignatureProperties"));
+
time_signature_p_->set_elt_property ("fraction",
gh_cons (gh_int2scm (req->beats_i_),
gh_int2scm (req->one_beat_i_)));
#include "paper-def.hh"
#include "lookup.hh"
-Time_signature::Time_signature ()
+Time_signature::Time_signature (SCM s)
+ : Item (s)
{
}
if (i < started_span_p_arr_.size () && started_span_p_arr_[i])
continue;
- Tuplet_spanner* glep = new Tuplet_spanner;
+ Tuplet_spanner* glep = new Tuplet_spanner (SCM_EOL);
if (i >= started_span_p_arr_.size ())
started_span_p_arr_.push (glep);
else
#include "directional-element-interface.hh"
-Tuplet_spanner::Tuplet_spanner ()
+Tuplet_spanner::Tuplet_spanner (SCM s)
+ : Spanner (s)
{
set_elt_pointer ("beams", SCM_EOL);
set_elt_pointer ("columns", SCM_EOL);
void
Vertical_align_engraver::do_creation_processing()
{
- valign_p_ =new Spanner; //Axis_align_spanner
+ valign_p_ =new Spanner (SCM_EOL); // todo -> basic props
Align_interface (valign_p_).set_interface ();
Align_interface (valign_p_).set_axis (Y_AXIS);
valign_p_->set_elt_property ("stacking-dir",
#include "side-position-interface.hh"
#include "directional-element-interface.hh"
-Volta_spanner::Volta_spanner ()
+Volta_spanner::Volta_spanner (SCM s)
+ : Spanner (s)
{
set_elt_pointer ("bars", SCM_EOL);
Side_position_interface (this).set_axis (Y_AXIS);
\consists "Repeat_engraver";
- staffSymbolBasicProperties = #'(
- (staff-space . 1.0 )
- (line-count . 5 )
- )
- basicTimeSignatureProperties = #`(
- (break-align-symbol . Time_signature)
- (visibility-lambda . ,all-visible)
- (breakable . #t)
- )
- basicBarlineProperties = #`(
- (break-align-symbol . Staff_bar)
- (visibility-lambda . `begin-of-line-invisible)
- (breakable . #t)
- )
-
- basicKeyProperties = #`(
- (break-align-symbol . Key_item)
- (visibility-lambda . ,begin-of-line-visible)
- (breakable . #t)
- )
- basicClefItemProperties = #`(
- (breakable . #t)
- (break-align-symbol . Clef_item)
- (visibility-lambda . ,begin-of-line-visible)
- )
% name, glyph id, c0 position
supportedClefTypes = #'(
textScriptPadding = #3.0
\consists "Text_engraver";
+
startSustain = #"Ped."
stopSustain = #"*"
stopStartSustain = #"*Ped."
defaultBarType = #"|"
systemStartDelimiterGlyph = #'bar-line
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ % default settings, mainly for breakable items
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ basicBarNumberProperties = #`(
+ (breakable . #t)
+ (visibility-lambda . ,begin-of-line-visible)
+ )
+ basicMarkProperties = #'(
+ (breakable . #t)
+ (visibility-lambda . end-of-line-invisible)
+ )
+ leftEdgeBasicProperties = #'(
+ (break-align-symbol . Left_edge_item)
+ (breakable . #t)
+ )
+
+ staffSymbolBasicProperties = #'(
+ (staff-space . 1.0 )
+ (line-count . 5 )
+ )
+ basicTimeSignatureProperties = #`(
+ (break-align-symbol . Time_signature)
+ (visibility-lambda . ,all-visible)
+ (breakable . #t)
+ )
+ basicBarlineProperties = #`(
+ (break-align-symbol . Staff_bar)
+ (visibility-lambda . ,begin-of-line-invisible)
+ (breakable . #t)
+ )
+ basicSystemStartDelimiterProperties = #'(
+ (collapse-height . 1.0)
+ )
+ basicKeyProperties = #`(
+ (break-align-symbol . Key_item)
+ (visibility-lambda . ,begin-of-line-visible)
+ (breakable . #t)
+ )
+ basicClefItemProperties = #`(
+ (breakable . #t)
+ (break-align-symbol . Clef_item)
+ (visibility-lambda . ,begin-of-line-visible)
+ )
+
+ basicBeamProperties = #`(
+ (beam-thickness . 0.42) ; interline!
+ )
+ basicStemTremoloProperties = #'(
+ (beam-width . 4.0) ; interline!
+ )
+
+ basicBreathingSignProperties = #'(
+ (break-align-symbol . Breathing_sign)
+ (breakable . #t )
+ (visibility-lambda . ,begin-of-line-invisible)
+ )
+ basicOctavateEightProperties = #'(
+ (self-alignment-X . 0)
+ (text . "8")
+ (style . "italic")
+ )
+ basicDynamicLineSpannerProperties = #`(
+ (transparent . #t)
+ )
+ basicDynamicTextProperties = # `(
+ (style . "dynamic")
+ (script-priority . 100)
+ (self-alignment-Y . 0)
+ )
+ basicLyricTextProperties = #`(
+ (non-rhythmic . #t)
+ )
+ basicRestCollisionProperties = #`(
+ (transparent . #t)
+ )
+ basicCollisionProperties = #`(
+ (transparent . #t)
+ (axes 0 1)
+ )
+ basicSingleMaltGroupingItemProperties = #'(
+ (transparent . #t)
+ )
+ basicBreakAlignProperties = #'(
+ (breakable . #t)
+ )
+ basicInstrumentNameProperties = #`(
+ (breakable . #t)
+ (break-align-symbol . Instrument_name)
+ (visibility-lambda . ,begin-of-line-visible)
+ )
+ basicLocalKeyProperties = #`(
+ (left-padding . 0.2)
+ (right-padding . 0.4)
+ )
+
\accepts "Staff";
\accepts "StaffGroup";
\accepts "RhythmicStaff";
markVisibilityFunction = #end-of-line-invisible
- barNumberVisibilityFunction = #begin-of-line-visible
};
\translator { \ScoreContext }
\include "engraver.ly";
-#'margin-shape = #'()
-#'Local_key_item::left-padding = #'0.2
-#'Local_key_item::right-padding = #'0.4
-#'staff-height = \staffheight;
-#'beam-thickness = \beam_thickness; %% UGR
-#'Stem_tremolo::beam-width = 1.5 * \quartwidth ;
-#'Breathing_sign::visibility-lambda = #begin-of-line-invisible
-#'Left_edge_item::visibility-lambda = #begin-of-line-visible
+
Begin3
Title: LilyPond
-Version: 1.3.54
-Entered-date: 25MAY00
+Version: 1.3.55
+Entered-date: 26MAY00
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.54.tar.gz
+ 1000k lilypond-1.3.55.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.54.tar.gz
+ 1000k lilypond-1.3.55.tar.gz
Copying-policy: GPL
End
Name: lilypond
-Version: 1.3.54
+Version: 1.3.55
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.54.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.55.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
# Icon: lilypond-icon.gif
+++ /dev/null
-#!@PYTHON@
-# linux-time.py -- Print resourse usage of a command executing on GNU/Linux
-#
-# awaiting PC's linux-mm patch for getrusage
-#
-# source file of the GNU LilyPond music typesetter
-#
-# (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
-#
-
-name = 'linux-time'
-version = '@TOPLEVEL_VERSION@'
-if version == '@' + 'TOPLEVEL_VERSION' + '@':
- version = '(unknown version)' # uGUHGUHGHGUGH
-
-import string
-import getopt
-import sys
-import os
-import time
-import posix
-import signal
-
-def identify():
- sys.stderr.write ("%s from LilyPond %s\n" % (name, version))
-
-def help ():
- print (r"""
-Usage: %s [OPTION]... COMMAND
-
-Print resourse usage of a command executing on GNU/Linux.
-
-Options:
- -h, --help this help
- -v, --version version information
-""" % name)
-
-def print_version ():
- print (r"""%s (GNU LilyPond) %s""" % (name, version))
-
-(options, files) = getopt.getopt (sys.argv[1:], 'vh', ['help','version'])
-
-for opt in options:
- o = opt[0]
- a = opt[1]
- if o== '--help' or o == '-h':
- help ()
- sys.exit (0)
- if o == '--version' or o == '-v':
- print_version ()
- sys.exit (0)
- else:
- print o
- raise getopt.error
-
-# identify ()
-
-if len (files) < 1:
- help ()
- sys.exit (2)
-
-#command = files[0]
-#sys.system ("/usr/bin/time %s" % command)
-pid = 0
-status = 0
-t = 0
-avg_size = 0
-max_size = 0
-avg_rss = 0
-max_rss = 0
-INTERVAL = 0.1
-
-# why doesn't it work when put in a function?
-#def time ():
-# global status, t;
-# #child_pid = os.fork ()
-# child_pid = forkit ()
-# if child_pid:
-# #Parent
-# while 1:
-# try:
-# # AARg, wait takes only 1 argument,
-# # but this still compiled
-# #(pid, status) = os.wait (child_pid, os.WNOHANG)
-# (pid, status) = os.waitpid (child_pid, os.WNOHANG)
-# if not pid:
-# time.sleep (INTERVAL)
-# t = t + 1
-# print ("s: %d" % t)
-# except:
-# break
-# else:
-# # Child
-# status = os.system ("/usr/bin/time %s" % string.join (files, " "))
-# sys.exit (status)
-
-
-if 0:
- # cute, but this doesn't work: we get resources of /usr/bin/time
- command = "/usr/bin/time"
- args = files
-else:
- # we should do 'time' ourselves:
- # man 5 proc
- command = files[0]
- args = files[1:]
-
-
-child_pid = os.fork ()
-if child_pid:
- #Parent
- statm = "/proc/%d/statm" % child_pid
- while 1:
- try:
- # AARg, wait takes only 1 argument,
- # but this still compiled
- #(pid, status) = os.wait (child_pid, os.WNOHANG)
- (pid, status) = os.waitpid (child_pid, os.WNOHANG)
- except:
- break
- if pid:
- break
-
- time.sleep (INTERVAL)
- f = open (statm, "r")
- stats = f.readline ()
- f.close ()
- (size, rss, drie, vier, vijf, zes, zeven) = string.split (stats, " ")
- t = t + 1
- size = string.atoi (size)
- max_size = max (size, max_size)
- avg_size = avg_size + size
- rss = string.atoi (rss)
- max_rss = max (rss, max_rss)
- avg_rss = avg_rss + rss
-else:
- # Child
- #status = os.system ("/usr/bin/time %s" % string.join (files, " "))
- #sys.exit (status)
- os.execvp (command, (command,) + tuple (args))
-
-
-ms = max_size * 4.0/1024
-mr = max_size * 4.0/1024
-avg_size = avg_size / t
-avg_rss = avg_rss / t
-as = avg_size * 4.0/1024
-ar = avg_rss * 4.0/1024
-print ("MAXSIZE: %6.3fM(%d), MAXRSS: %6.3fM(%d)" % (ms, max_size, mr, max_rss))
-print ("AVGSIZE: %6.3fM(%d), AVGRSS: %6.3fM(%d)" % (as, avg_size, ar, avg_rss))
-sys.exit (status)