@cindex properties!GrandStaff
@table @samp
- @item @code{alignmentReference}@indexcode{alignmentReference}
-@propertytype{direction}
- Set to @code{\center} for vertical alignment reference point to be
- in the center of the vertical group. Set to @code{\up} to put the
- reference point at the top of the group.
-
@item @code{maxVerticalAlign}@indexcode{maxVerticalAlign} @propertytype{number}
Set the maximum vertical distance between staffs.
global = \notes {
s1 | \mark "A";
- s1*2 | \mark "'12";
+ s1 | \mark ;
+ s1 | \mark "12";
+ s1
}
-one = \notes\relative c{
- c'' c c c
- c c c c
- c c c c
+one = \notes \relative c {
+ c''1 c c c
}
-two = \notes\relative c{
- b' b b b
- b b b b
- b b b b
-}
\score{
- < \global \one \two >
+\context Staff < \global \one >
\paper {
\translator { \OrchestralPartStaffContext
- markScriptPadding = "4.0";
- markHangOn = "Bar";
- markHangDepth = "1";
-% markDirection = \down;
}
}
}
void
Align_element::do_side_processing ()
{
+ 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;
}
Real where_f=0;
- Real center_f = 0.0;
- SCM scenter = get_elt_property ("center-element");
- Score_element *center_elt = unsmob_element (scenter);
-
for (int i=0 ; i < elems.size(); i++)
{
- Real dy = - stacking_dir_ * dims[i][-stacking_dir_];
+ Real dy = - stacking_dir * dims[i][-stacking_dir];
if (i)
- dy += stacking_dir_ * dims[i-1][stacking_dir_];
+ dy += stacking_dir * dims[i-1][stacking_dir];
if (i)
{
<? threshold_interval_[BIGGER];
}
- if (!i && align_dir_ == LEFT)
- center_f = where_f;
- else if (align_dir_ == CENTER && elems[i] == center_elt)
- center_f = where_f;
- where_f += stacking_dir_ * dy;
+ where_f += stacking_dir * dy;
elems[i]->translate_axis (where_f, axis ());
}
-
- if (dims.size ())
- where_f += dims.top ()[stacking_dir_];
- if (align_dir_ == RIGHT)
- center_f = where_f;
- else if (align_dir_ == CENTER && !center_elt)
- center_f = where_f / 2;
-
- if (center_f)
- translate_axis ( - center_f, axis ());
}
Align_element::Align_element()
{
threshold_interval_ = Interval (0, Interval::infinity ());
- stacking_dir_ = DOWN;
- align_dir_ = CENTER;
}
int
void
Align_note_column_engraver::do_removal_processing ()
{
- SCM al = get_property ("graceAlignPosition", 0);
+ SCM al = get_property ("graceAlignPosition");
if (isdir_b (al))
{
- directional_element (align_item_p_).set (to_dir (al));
+ 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_);
B. it has no pscore_l_ field.
*/
- SCM grsp = get_property ("graceAccidentalSpace", 0);
+ SCM grsp = get_property ("graceAccidentalSpace");
if (gh_number_p(grsp))
{
/*
/*
first guess: end beam at end of beat
*/
- SCM one (get_property ("beatLength", 0));
+ SCM one (get_property ("beatLength"));
Moment end_mom;
if (SMOB_IS_TYPE_B(Moment, one))
/*
second guess: property generic time exception
*/
- SCM begin = get_property (time_str + "beamAutoBegin", 0);
+ SCM begin = get_property (time_str + "beamAutoBegin");
if (SMOB_IS_TYPE_B(Moment, begin))
begin_mom = * SMOB_TO_TYPE(Moment, begin);
- SCM end = get_property (time_str + "beamAutoEnd", 0);
+ SCM end = get_property (time_str + "beamAutoEnd");
if (SMOB_IS_TYPE_B (Moment, end))
end_mom = * SMOB_TO_TYPE(Moment,end);
*/
if (type_str.length_i ())
{
- SCM end_mult = get_property (time_str + "beamAutoEnd" + type_str, 0);
+ SCM end_mult = get_property ( time_str + "beamAutoEnd" + type_str);
if (SMOB_IS_TYPE_B (Moment, end_mult))
end_mom = * SMOB_TO_TYPE (Moment,end_mult);
- SCM begin_mult = get_property (time_str + "beamAutoBegin" + type_str, 0);
+ SCM begin_mult = get_property (time_str + "beamAutoBegin" + type_str);
if (SMOB_IS_TYPE_B (Moment, begin_mult))
begin_mom = * SMOB_TO_TYPE (Moment,begin_mult);
}
/*
fourth guess [user override]: property plain generic
*/
- begin = get_property ("beamAutoBegin", 0);
+ begin = get_property ("beamAutoBegin");
if (SMOB_IS_TYPE_B(Moment, begin))
begin_mom = * SMOB_TO_TYPE(Moment, begin);
- end = get_property ("beamAutoEnd", 0);
+ end = get_property ("beamAutoEnd");
if (SMOB_IS_TYPE_B (Moment, end))
end_mom = * SMOB_TO_TYPE (Moment,end);
*/
if (type_str.length_i ())
{
- SCM end_mult = get_property (String ("beamAutoEnd") + type_str, 0);
+ SCM end_mult = get_property (String ("beamAutoEnd") + type_str);
if (SMOB_IS_TYPE_B (Moment, end_mult))
end_mom = * SMOB_TO_TYPE (Moment,end_mult);
- SCM begin_mult = get_property (String ("beamAutoBegin") + type_str, 0);
+ SCM begin_mult = get_property (String ("beamAutoBegin") + type_str);
if (SMOB_IS_TYPE_B (Moment, begin_mult))
begin_mom = * SMOB_TO_TYPE (Moment,begin_mult);
}
/*
Allow already started autobeam to end
*/
- SCM on = get_property ("noAutoBeaming", 0);
+ SCM on = get_property ("noAutoBeaming");
if (to_boolean (on))
return;
Auto_beam_engraver::same_grace_state_b (Score_element* e)
{
bool gr = e->get_elt_property ("grace") == SCM_BOOL_T;
- SCM wg =get_property ("weAreGraceContext",0);
+ SCM wg =get_property ("weAreGraceContext");
return (to_boolean (wg)) == gr;
}
bar_p_->set_elt_property ("break-aligned", SCM_BOOL_T);
// urg: "" != empty...
- SCM default_type = get_property ("defaultBarType", 0);
+ SCM default_type = get_property ("defaultBarType");
if (gh_string_p (default_type))
{
bar_p_->set_elt_property ("glyph", default_type); // gu.h
/*
urg. Why did I implement this? And did I implement this so
clumsily? */
- SCM prop = get_property ("barAtLineStart", 0);
+ SCM prop = get_property ("barAtLineStart");
if (to_boolean (prop))
{
bar_p_->set_elt_property ("at-line-start", SCM_BOOL_T);
{
if (!now_mom ())
{
- SCM prop = get_property ("barAtLineStart", 0);
+ SCM prop = get_property ("barAtLineStart");
if (!to_boolean (prop))
return;
}
Timing_translator *time = dynamic_cast<Timing_translator*>(tr);
// todo include (&&!time->cadenza_b_ )
- SCM bn = get_property("currentBarNumber",0);
+ SCM bn = get_property("currentBarNumber");
if (gh_number_p (bn) &&
!time->measure_position () && now_mom () > Moment (0))
Bar_script_engraver::do_creation_processing ()
{
String t = type_ + "VisibilityFunction";
- SCM proc = get_property (t, 0);
+ SCM proc = get_property (t);
if (gh_procedure_p (proc))
visibility_lambda_ = proc;
Side_position_interface staffside(text_p_);
staffside.set_axis (axis_);
- SCM prop = get_property (type_ + "Direction", 0);
+ SCM prop = get_property (type_ + "Direction");
if (!isdir_b (prop))
{
prop = gh_int2scm (UP);
}
text_p_->set_elt_property ("direction", prop);
- SCM padding = get_property (type_ + "ScriptPadding", 0);
+ SCM padding = get_property (type_ + "ScriptPadding");
if (gh_number_p(padding))
{
text_p_->set_elt_property ("padding", padding);
/*
- use a property? get_property ("singleStaffBracket", 0) ?
+ use a property? get_property ("singleStaffBracket"); ?
--hwn
*/
bool stem_grace = stem_l->get_elt_property ("grace") == SCM_BOOL_T;
- SCM wg =get_property ("weAreGraceContext",0);
+ SCM wg =get_property ("weAreGraceContext");
bool wgb= to_boolean (wg);
if (wgb!= stem_grace)
Real interbeam_f = paper_l ()->interbeam_f (multiplicity);
- Real thick = gh_scm2double (get_elt_property ("beam-thickness"));;
+ Real thick = gh_scm2double (get_elt_property ("beam-thickness"));
Real bdy = interbeam_f;
Real stemdx = staffline_f;
void
Break_align_engraver::do_pre_move_processing ()
{
- SCM order = get_property ("breakAlignOrder", 0);
+ SCM order = get_property ("breakAlignOrder");
for (; gh_pair_p (order); order = gh_cdr (order))
{
SCM p = scm_assoc ( gh_car (order), column_alist_);
*/
#include <math.h>
+#include "side-position-interface.hh"
#include "warn.hh"
#include "dimension-cache.hh"
#include "lily-guile.hh"
void
Break_align_item::do_pre_processing()
{
- if (break_status_dir() == LEFT)
- align_dir_ = LEFT;
- else
- align_dir_ = RIGHT;
-
- flip (&align_dir_);
-
+ Direction ad = (break_status_dir() == LEFT) ? RIGHT : LEFT;
Real interline= paper_l ()->get_var ("interline");
-
+
+ set_elt_property ("self-alignment-X", gh_int2scm (ad));
+
+
Link_array<Score_element> elems;
Link_array<Score_element> all_elems (elem_l_arr ());
Break_align_item::Break_align_item ()
{
- stacking_dir_ = RIGHT;
+ 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);
}
return;
bool find_inversion_b = false;
- SCM chord_inversion = get_property ("chordInversion", 0);
+ SCM chord_inversion = get_property ("chordInversion");
if (gh_boolean_p (chord_inversion))
find_inversion_b = gh_scm2bool (chord_inversion);
else
octave_dir_ = CENTER;
- SCM c = get_property ("supportedClefTypes",0);
- SCM p = get_property ("clefPitches", 0);
+ SCM c = get_property ("supportedClefTypes");
+ SCM p = get_property ("clefPitches");
if (gh_list_p (c))
{
void
Clef_engraver::do_creation_processing()
{
- SCM def = get_property ("defaultClef", 0);
+ SCM def = get_property ("defaultClef");
if (gh_string_p (def))
{
set_type (ly_scm2string (def));
}
-void
-Mark_req::do_print () const
-{
- DEBUG_OUT << str_;
-}
bool
Mark_req::do_equal_b (Request const * r) const
{
Mark_req const * other = dynamic_cast<Mark_req const*> (r);
- return other && other->str_ == str_;
+ return other && scm_equal_p (other->mark_label_, mark_label_);
}
void
/*
UGH UGH
*/
- SCM prop = get_property ("dynamicDirection", 0);
+ SCM prop = get_property ("dynamicDirection");
if (!isdir_b (prop))
{
- prop = get_property ("verticalDirection", 0);
+ prop = get_property ("verticalDirection");
}
if (isdir_b (prop) && to_dir (prop))
text_p_->set_elt_property ("direction", prop);
- prop = get_property ("dynamicPadding", 0);
+ prop = get_property ("dynamicPadding");
if (gh_number_p(prop))
{
text_p_->set_elt_property ("padding", prop);
Grace_align_item::Grace_align_item ()
{
- stacking_dir_ = RIGHT;
+ set_elt_property ("stacking-dir", gh_int2scm (RIGHT));
set_axis (X_AXIS);
}
Axis_align_item::do_pre_processing ();
- translate_axis (-0.5* nhw, X_AXIS); // ugh.
+ // translate_axis (-0.5* nhw, X_AXIS); // ugh.
}
return;
warning (_("Unattached grace notes. Attaching to last musical column."));
- /* if (ae)
- ae->remove_element (align_l_);
- else if (elt)*/
-
align_l_->set_parent (0, X_AXIS);
last_musical_col_l_->add_element (align_l_);
shortest_mom = shortest_mom <? notes_[i]->length_mom_;
Rational grace_fraction_rat (1, 2);
- SCM prop = get_property ("graceFraction", 0);
+ SCM prop = get_property ("graceFraction");
if (SMOB_IS_TYPE_B(Moment, prop))
grace_fraction_rat = *SMOB_TO_TYPE (Moment,prop);
TODO: implement padding.
document usage of this.
- */
-class Align_element : public virtual Axis_group_element {
-public:
- Interval threshold_interval_ ;
- /**
- Should high priorities be first or last?
- */
-
- Direction stacking_dir_;
- /**
- Which side to align? -1: left side, 0: centered (around
+
+ *******
+
+ 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
- URG. Unintuitive if stacking_dir_ == -1
- */
+ *****
- Direction align_dir_;
+ 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 ();
#include "duration.hh"
#include "musical-pitch.hh"
#include "key-def.hh"
+#include "protected-scm.hh"
class Break_req : public Request {
public:
class Mark_req : public Request {
public:
- String str_;
+ Protected_scm mark_label_;
protected:
virtual bool do_equal_b (Request const*) const;
- virtual void do_print () const;
VIRTUAL_COPY_CONS(Music);
};
#ifndef MARK_ENGRAVER_HH
#define MARK_ENGRAVER_HH
-#include "bar-script-engraver.hh"
+#error
-/**Print rehearsal marks.
- */
-class Mark_engraver : public Bar_script_engraver
-{
-public:
- Mark_engraver ();
- VIRTUAL_COPY_CONS(Translator);
-protected:
- virtual bool do_try_music (Music *req_l);
- virtual void do_process_requests ();
- virtual void do_post_move_processing ();
-private:
- Mark_req * mark_req_l_;
-};
-#endif // MARK_ENGRAVER_HH
+dendif // MARK_ENGRAVER_HH
Cons_list<Translator> trans_p_list_;
public:
- SCM get_property (SCM name_sym, Translator_group **where_found_l) const;
+ SCM get_property (SCM name_sym) const;
void set_property (String var_name, SCM value);
*/
Music_output_def *output_def_l () const;
- SCM get_property (String, Translator_group **) const;
- SCM get_property (SCM symbol, Translator_group **) const;
+ SCM get_property (String) const;
+ SCM get_property (SCM symbol) const;
virtual Moment now_mom () const;
{
if (dynamic_cast <Clef_change_req *> (info.req_l_))
{
- SCM c = get_property ("createKeyOnClefChange", 0);
+ SCM c = get_property ("createKeyOnClefChange");
if (to_boolean (c))
create_key ();
}
{
old_accidental_idx_arr_ = accidental_idx_arr_;
key_.clear ();
- SCM prop = get_property ("keyOctaviation", 0);
+ SCM prop = get_property ("keyOctaviation");
key_.multi_octave_b_ = to_boolean (prop);
{
if (!key_item_p_ && mel_l_arr_.size())
{
- SCM f = get_property ("forgetAccidentals",0);
+ SCM f = get_property ("forgetAccidentals");
bool forget = to_boolean (f);
for (int i=0; i < mel_l_arr_.size(); i++)
{
void
Local_key_engraver::acknowledge_element (Score_element_info info)
{
- SCM wg= get_property ("weAreGraceContext", 0);
+ SCM wg= get_property ("weAreGraceContext");
bool selfgr = gh_boolean_p (wg) &&gh_scm2bool (wg);
bool he_gr = to_boolean (info.elem_l_->get_elt_property ("grace"));
{
if (time_trans_l_ && !time_trans_l_->measure_position ())
{
- if (!to_boolean (get_property ("noResetKey",0)) && key_grav_l_)
+ if (!to_boolean (get_property ("noResetKey")) && key_grav_l_)
local_key_= key_grav_l_->key_;
}
else if (key_grav_l_ && key_grav_l_->key_changed_b ())
(c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
+
#include "command-request.hh"
-#include "mark-engraver.hh"
+#include "bar-script-engraver.hh"
#include "engraver-group-engraver.hh"
#include "text-item.hh"
+/**Print rehearsal marks.
+ */
+class Mark_engraver : public Bar_script_engraver
+{
+public:
+ Mark_engraver ();
+ VIRTUAL_COPY_CONS(Translator);
+protected:
+ virtual bool do_try_music (Music *req_l);
+ virtual void do_process_requests ();
+ virtual void do_post_move_processing ();
+private:
+ Mark_req * mark_req_l_;
+};
+
ADD_THIS_TRANSLATOR (Mark_engraver);
{
if (Mark_req *mr = dynamic_cast <Mark_req *> (r_l))
{
-
if (mark_req_l_ && mr->equal_b (mark_req_l_))
return true;
if (mark_req_l_)
{
create_items (mark_req_l_);
- String t = mark_req_l_->str_;
+ String t;
+
+ SCM m = (mark_req_l_->mark_label_ == SCM_UNDEFINED)
+ ? get_property ("rehearsalMark")
+ : SCM(mark_req_l_->mark_label_);
+
+ if (gh_number_p (m))
+ {
+ int mark_count = gh_scm2int (m);
+ t = to_str (mark_count);
+ mark_count ++;
+ m = gh_int2scm (mark_count);
+ }
+ else if (gh_string_p (m))
+ {
+ t = ly_scm2string (m);
+ String next;
+ if (t.length_i ())
+ {
+ char c = t[0];
+ c++;
+ next = to_str (c);
+ }
+ m = ly_str02scm (next.ch_C());
+ }
+ else
+ {
+ m = gh_int2scm (1);
+ }
+
+ daddy_trans_l_->set_property ("rehearsalMark", m);
+
+
text_p_->set_elt_property ("text",
ly_str02scm ( t.ch_C()));
SCM st = ly_str02scm ((t.index_any_i ("0123456789") >= 0 )
{
if (dynamic_cast<Melisma_playing_req*>(m))
{
- SCM plain (get_property ("melismaBusy", 0));
- SCM slur (get_property ("slurMelismaBusy", 0));
- SCM tie (get_property ("tieMelismaBusy", 0));
+ SCM plain (get_property ("melismaBusy"));
+ SCM slur (get_property ("slurMelismaBusy"));
+ SCM tie (get_property ("tieMelismaBusy"));
return (to_boolean (plain))
|| (to_boolean (slur))
|| (to_boolean (tie));
announce_element (Score_element_info (mmrest_p_, busy_span_req_l_));
start_measure_i_
- = gh_scm2int (time->get_property ("currentBarNumber", 0));
+ = gh_scm2int (time->get_property ("currentBarNumber"));
}
}
if (mmrest_p_ && !time->measure_position ())
{
lastrest_p_ = mmrest_p_;
- int cur = gh_scm2int (time->get_property ("currentBarNumber", 0));
+ int cur = gh_scm2int (time->get_property ("currentBarNumber"));
lastrest_p_->set_elt_property ("measure-count",
gh_int2scm (cur - start_measure_i_));
mmrest_p_ = 0;
if (note_p_arr_.size ())
return ;
- SCM noteheadstyle = get_property ("noteHeadStyle", 0);
+ SCM noteheadstyle = get_property ("noteHeadStyle");
for (int i=0; i < note_req_l_arr_.size (); i++)
{
Note_head *note_p = new Note_head;
{
int transposing_i = 0;
//urg
- SCM prop = get_property ("transposing", 0);
+ SCM prop = get_property ("transposing");
if (gh_number_p(prop))
transposing_i = gh_scm2int (prop);
Paper_column::Paper_column (Moment w)
{
- SCM when = (new Moment (w))->smobify_self ();;
+ SCM when = (new Moment (w))->smobify_self ();
scm_unprotect_object (when);
set_elt_property ("when", when);
sp_p->span_type_str_ = ly_scm2string ($3);
sp_p->set_spot (THIS->here_input ());
$$ = sp_p;
- }
+ }
+ | MARK {
+ Mark_req * m = new Mark_req;
+ $$ = m;
+ }
| MARK STRING {
Mark_req *m = new Mark_req;
- m->str_ = ly_scm2string ($2);
+ m->mark_label_ = $2;
$$ = m;
}
| MARK unsigned {
Mark_req *m = new Mark_req;
- m->str_ = to_str ($2);
+ m->mark_label_ = gh_int2scm ($2);
$$ = m;
}
+
| TIME_T unsigned '/' unsigned {
Time_signature_change_req *m = new Time_signature_change_req;
m->beats_i_ = $2;
Protected_scm::Protected_scm ()
{
- object_ = 0;
+ object_ = SCM_UNDEFINED;
}
Protected_scm::Protected_scm (SCM s)
{
- object_ = s ? scm_protect_object (s): 0;
+ object_ = SCM_NIMP(s) ? scm_protect_object (s): s;
}
Protected_scm::Protected_scm (Protected_scm const &s)
{
- object_ = s.object_ ? scm_protect_object (s.object_) : 0;
+ object_ = SCM_NIMP(s.object_) ? scm_protect_object (s.object_) : s.object_;
}
Protected_scm &
{
if (object_ == s)
return *this;
- if (object_)
+
+ if (SCM_NIMP (object_))
scm_unprotect_object(object_);
- object_ = s ? scm_protect_object (s): 0;
+ object_ = SCM_NIMP (s) ? scm_protect_object (s): s;
return *this;
}
Protected_scm::~Protected_scm ()
{
- if (object_)
+ if (SCM_NIMP (object_))
{
scm_unprotect_object (object_);
}
Music_sequence* alt = repeated_music_l_->alternatives_p_;
Moment walk_mom = now_mom () + repeated_music_l_->repeat_body_p_->length_mom ();
- SCM novolta = get_property ("noVoltaBraces",0);
+ SCM novolta = get_property ("noVoltaBraces");
bool create_volta = !to_boolean (novolta);
Cons_list<Bar_create_event> becel;
becel.append (c);
last_number = volta_number;
volta_number ++;
- SCM l (get_property ("voltaSpannerDuration", 0));
+ SCM l (get_property ("voltaSpannerDuration"));
if (SMOB_IS_TYPE_B (Moment, l))
{
Moment vSD_mom = *SMOB_TO_TYPE (Moment,l);
stem_l_ = 0;
}
- SCM wg = get_property ("weAreGraceContext",0);
+ SCM wg = get_property ("weAreGraceContext");
bool wegrace = to_boolean (wg);
if (!wegrace)
void
Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
{
- SCM wg = get_property ("weAreGraceContext",0);
+ SCM wg = get_property ("weAreGraceContext");
bool wegrace = to_boolean (wg);
if ((wegrace !=
(i.elem_l_->get_elt_property ("grace") != SCM_UNDEFINED))
{
return r1.other_l_->rank_i() - r2.other_l_->rank_i();
}
+
void
Rod::add_to_cols ()
{
Direction d = LEFT;
+ Drul_array<Paper_column*> cols;
+ Real extra_dist = 0.0;
do {
- item_l_drul_[-d]->column_l ()->add_rod
- (item_l_drul_[d]->column_l (), distance_f_);
- }while ((flip (&d))!=LEFT);
+ cols[d] = item_l_drul_[d]->column_l ();
+ extra_dist += item_l_drul_[d]->relative_coordinate (cols[d], X_AXIS);
+ } while ((flip (&d))!=LEFT);
+
+ if (cols[LEFT] != cols[RIGHT])
+ do
+ {
+ cols[-d]->add_rod(cols[d], distance_f_ + extra_dist);
+ }
+ while ((flip (&d))!=LEFT);
}
if (l->get_direction ())
stafy.set_direction (l->get_direction ());
- SCM axisprop = get_property ("scriptHorizontal",0);
+ SCM axisprop = get_property ("scriptHorizontal");
bool xaxis = to_boolean (axisprop);
if (xaxis)
stafy.set_axis (X_AXIS);
Script_engraver::acknowledge_element (Score_element_info inf)
{
bool them_grace = to_boolean (inf.elem_l_->get_elt_property ("grace"));
- bool us_grace = to_boolean (get_property ("weAreGraceContext",0));
+ bool us_grace = to_boolean (get_property ("weAreGraceContext"));
if (us_grace != them_grace)
return;
return total_off;
}
-/*
+/**
callback that centers the element on itself
*/
Real
void
Slur_engraver::set_melisma (bool m)
{
- Translator_group *where = daddy_trans_l_;
- get_property ("slurMelismaBusy", &where);
- if (!where)
- where = daddy_trans_l_;
-
daddy_trans_l_->set_property ("slurMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
}
typeset_element (slur_l_stack_[i]);
}
slur_l_stack_.clear ();
- SCM wg = get_property ("weAreGraceContext",0);
+ SCM wg = get_property ("weAreGraceContext");
bool wgb = to_boolean (wg);
if (!wgb)
for (int i=0; i < requests_arr_.size(); i++)
Slur_engraver::do_post_move_processing()
{
new_slur_req_l_arr_.clear();
- SCM m = get_property ("automaticMelismata",0);
+ SCM m = get_property ("automaticMelismata");
if (to_boolean (m))
{
set_melisma (slur_l_stack_.size ());
return;
- SCM long_name = get_property ("instrument", 0);
- SCM short_name = get_property ("instr", 0);
+ SCM long_name = get_property ("instrument");
+ SCM short_name = get_property ("instr");
if (now_mom () > Moment (0))
long_name = short_name;
Staff_performer::new_instrument_str ()
{
// mustn't ask Score for instrument: it will return piano!
- SCM minstr = get_property (ly_symbol2scm ("midiInstrument"), 0);
+ SCM minstr = get_property (ly_symbol2scm ("midiInstrument"));
if (!gh_string_p(minstr))
- minstr = get_property (ly_symbol2scm ("instrument"), 0);
+ minstr = get_property (ly_symbol2scm ("instrument"));
if (!gh_string_p (minstr)
|| ly_scm2string (minstr) == instrument_str_)
void
Staff_symbol_engraver::do_removal_processing()
{
- SCM n = get_property ("numberOfStaffLines",0);
- SCM ss = get_property ("staffSpace", 0);
+ SCM n = get_property ("numberOfStaffLines");
+ SCM ss = get_property ("staffSpace");
if (gh_number_p (ss))
span_p_->set_elt_property ("staff-space", ss);
void
Stem_engraver::do_creation_processing ()
{
- SCM prop = get_property ("abbrev", 0);
+ SCM prop = get_property ("abbrev");
if (gh_number_p(prop))
{
default_abbrev_i_ = gh_scm2int (prop);
if (stem_p_)
{
- Translator_group* which;
- SCM prop = get_property ("stemLeftBeamCount", &which);
+ SCM prop = get_property ("stemLeftBeamCount");
if (gh_number_p(prop))
{
stem_p_->set_beaming (gh_scm2int (prop),LEFT);
- ((Translator_group*)which)->set_property ("stemLeftBeamCount", SCM_UNDEFINED);
+ daddy_trans_l_->set_property ("stemLeftBeamCount", SCM_UNDEFINED);
}
- prop = get_property ("stemRightBeamCount", &which);
+ prop = get_property ("stemRightBeamCount");
if (gh_number_p(prop))
{
stem_p_->set_beaming (gh_scm2int (prop), RIGHT);
- ((Translator_group*)which)->set_property ("stemRightBeamCount", SCM_UNDEFINED);
+ daddy_trans_l_->set_property ("stemRightBeamCount", SCM_UNDEFINED);
}
// UGH. Should mark non-forced instead.
Text_item *text = new Text_item;
Side_position_interface stafy (text);
- SCM axisprop = get_property ("scriptHorizontal",0);
+ SCM axisprop = get_property ("scriptHorizontal");
if (to_boolean (axisprop))
{
stafy.set_axis (X_AXIS);
if (r->style_str_.length_i ())
text->set_elt_property ("style", ly_str02scm (r->style_str_.ch_C()));
- SCM empty = get_property ("textEmptyDimension", 0);
+ SCM empty = get_property ("textEmptyDimension");
if (to_boolean (empty))
{
text->set_empty (X_AXIS);
if (Tie_req * c = dynamic_cast<Tie_req*> (m))
{
req_l_ = c;
- SCM m = get_property ("automaticMelismata",0);
+ SCM m = get_property ("automaticMelismata");
bool am = gh_boolean_p (m) &&gh_scm2bool (m);
if (am)
{
void
Tie_engraver::set_melisma (bool m)
{
- Translator_group *where = daddy_trans_l_;
- get_property ("tieMelismaBusy", &where);
- if (!where)
- where = daddy_trans_l_;
-
daddy_trans_l_->set_property ("tieMelismaBusy", m ? SCM_BOOL_T : SCM_BOOL_F);
}
}
- SCM sparse = get_property ("sparseTies", 0);
+ SCM sparse = get_property ("sparseTies");
if (to_boolean (sparse))
{
int i = scm_ilength (head_list);
void
Tie_engraver::do_post_move_processing ()
{
- SCM m = get_property ("automaticMelismata",0);
+ SCM m = get_property ("automaticMelismata");
if (to_boolean (m))
{
set_melisma (false);
if (!now_mom ())
return "|";
- SCM nonauto = get_property ("barNonAuto", 0);
+ SCM nonauto = get_property ("barNonAuto");
if (!to_boolean (nonauto))
{
- SCM always = get_property ("barAlways", 0);
+ SCM always = get_property ("barAlways");
if (!measure_position ()
|| (to_boolean (always)))
{
- SCM def=get_property ("defaultBarType" ,0);
+ SCM def=get_property ("defaultBarType" );
return (gh_string_p (def))? ly_scm2string (def) : "";
}
}
while (!global_l);
/* allbars == ! skipbars */
- SCM sb = get_property ("skipBars", 0);
+ SCM sb = get_property ("skipBars");
bool allbars = !to_boolean (sb);
// urg: multi bar rests: should always process whole of first bar?
- SCM tim = get_property ("timing", 0);
+ SCM tim = get_property ("timing");
bool timb = to_boolean (tim);
if (timb && allbars)
{
Moment
Timing_translator::measure_length () const
{
- SCM l = get_property("measureLength",0);
+ SCM l = get_property("measureLength");
if (SMOB_IS_TYPE_B(Moment, l))
return *SMOB_TO_TYPE (Moment, l);
else
Timing_translator::get_time_signature (int *n, int *d) const
{
Moment one_beat (1,4);
- SCM one = get_property ("beatLength",0);
+ SCM one = get_property ("beatLength");
if (SMOB_IS_TYPE_B (Moment, one))
one_beat = *SMOB_TO_TYPE (Moment, one);
*n = measure_length () / one_beat;
Moment
Timing_translator::measure_position () const
{
- SCM sm = get_property ("measurePosition",0);
+ SCM sm = get_property ("measurePosition");
Moment m =0;
if (SMOB_IS_TYPE_B (Moment, sm))
Moment * measposp =0;
- SCM s = get_property ("measurePosition", 0);
+ SCM s = get_property ("measurePosition");
if (SMOB_IS_TYPE_B (Moment, s))
{
measposp = SMOB_TO_TYPE (Moment,s);
*measposp += dt;
// don't need to set_property
- Translator_group * tr =daddy_trans_l_;
- SCM barn = get_property ("currentBarNumber", &tr);
+ SCM barn = get_property ("currentBarNumber");
int b = 0;
if (gh_number_p(barn))
{
b = gh_scm2int (barn);
}
- SCM cad = get_property ("timing", 0);
+ SCM cad = get_property ("timing");
bool c= to_boolean (cad );
Moment len = measure_length ();
b ++;
}
- tr->set_property ("currentBarNumber", gh_int2scm (b));
+ daddy_trans_l_->set_property ("currentBarNumber", gh_int2scm (b));
}
}
SCM
-Translator_group::get_property (SCM sym, Translator_group **where_l) const
+Translator_group::get_property (SCM sym) const
{
if (properties_dict_.elem_b (sym))
{
- if (where_l)
- *where_l = (Translator_group*) this; // ugh
return properties_dict_.get (sym);
}
if (daddy_trans_l_)
- return daddy_trans_l_->get_property (sym, where_l);
+ return daddy_trans_l_->get_property (sym);
- if (where_l)
- *where_l = 0;
return SCM_UNDEFINED;
}
}
SCM
-Translator::get_property (String id, Translator_group **where_l) const
+Translator::get_property (String id) const
{
- return daddy_trans_l_->get_property (ly_symbol2scm (id.ch_C()), where_l);
+ return daddy_trans_l_->get_property (ly_symbol2scm (id.ch_C()));
}
SCM
-Translator::get_property (SCM sym,
- Translator_group **where_l) const
+Translator::get_property (SCM sym) const
{
- return daddy_trans_l_->get_property (sym, where_l);
+ return daddy_trans_l_->get_property (sym);
}
Moment m = now_mom () + c->length_mom ();
stop_moments_.push (m);
- SCM s = get_property ("tupletSpannerDuration",0);
+ SCM s = get_property ("tupletSpannerDuration");
if (SMOB_IS_TYPE_B(Moment, s))
m = m <? (now_mom () + *SMOB_TO_TYPE(Moment,s));
void
Tuplet_engraver::do_process_requests ()
{
- SCM v = get_property ("tupletInvisible", 0);
+ SCM v = get_property ("tupletInvisible");
if (to_boolean (v))
return;
Tuplet_engraver::acknowledge_element (Score_element_info i)
{
bool grace= to_boolean (i.elem_l_->get_elt_property ("grace"));
- SCM wg = get_property ("weAreGraceContext",0);
+ SCM wg = get_property ("weAreGraceContext");
bool wgb = to_boolean (wg);
if (grace != wgb)
return;
Moment now = now_mom ();
Moment tsd;
- SCM s = get_property ("tupletSpannerDuration",0);
+ SCM s = get_property ("tupletSpannerDuration");
if (SMOB_IS_TYPE_B(Moment, s))
tsd = *SMOB_TO_TYPE(Moment,s);
{
valign_p_ =new Axis_align_spanner;
valign_p_->set_axis (Y_AXIS);
- valign_p_->stacking_dir_ = DOWN;
+ valign_p_->set_elt_property ("stacking-dir", gh_int2scm (DOWN));
valign_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
announce_element (Score_element_info (valign_p_ , 0));
void
Vertical_align_engraver::do_removal_processing()
{
- SCM dist (get_property ("maxVerticalAlign", 0));
+ SCM dist (get_property ("maxVerticalAlign"));
if (gh_number_p(dist))
{
valign_p_->threshold_interval_[BIGGER] = gh_scm2double (dist);
}
- dist = get_property ("minVerticalAlign", 0);
+ dist = get_property ("minVerticalAlign");
if (gh_number_p(dist))
{
valign_p_->threshold_interval_[SMALLER] = gh_scm2double (dist);
}
- dist = get_property ("alignmentReference",0);
- if (isdir_b (dist))
- {
- valign_p_->align_dir_ = to_dir (dist);
- }
valign_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
typeset_element (valign_p_);
valign_p_ =0;
\type "Engraver_group_engraver";
\consists "Span_bar_engraver";
\consists "Output_property_engraver";
-
\consists "Staff_group_bar_engraver";
+
\name StaffGroup;
\accepts "Staff";
\accepts "RhythmicStaff";
\name Lyrics;
\consists Vertical_align_engraver;%need this for getting folded repeats right.
+ \consists "Property_engraver";
\consistsend "Axis_group_engraver";
\accepts "LyricVoice";
\accepts "NoteNames";
markVisibilityFunction = #end-of-line-invisible
- barNumberVisibilityFunction = #end-of-line-invisible
+ barNumberVisibilityFunction = #begin-of-line-visible
marginVisibilityFunction = #begin-of-line-visible
};
\consists "Bar_number_engraver";
\consists "Mark_engraver";
-
- \accepts "HaraKiriStaff";
};
\translator {
)
+(define generic-lyrics-properties
+ (list generic-text-properties
+ )
+
+)