From: fred Date: Tue, 26 Mar 2002 22:42:39 +0000 (+0000) Subject: lilypond-1.3.0 X-Git-Tag: release/1.5.59~2027 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=af860762bdbcabc387088ef597ae1b46690ecd37;p=lilypond.git lilypond-1.3.0 --- diff --git a/flower/include/string.hh b/flower/include/string.hh index 24b975949a..b0bf9f8952 100644 --- a/flower/include/string.hh +++ b/flower/include/string.hh @@ -90,16 +90,7 @@ public: void operator += (String s); bool empty_b () const; -#if 0 - /** is the string empty? - Ugh-ugh-thank-you-cygnus. W32 barfs on this - */ - operator bool () const; - { - return length_i (); - } -#endif void append (String); void prepend (String); diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index 927285702b..853af03f63 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -96,21 +96,17 @@ String Staff_performer::new_instrument_str () { // mustn't ask Score for instrument: it will return piano! - String str = get_property ("midiInstrument", 0); - if (!str.length_i ()) - str = get_property ("instrument", 0); - if (str == instrument_str_) + SCM minstr = get_property ("midiInstrument", 0); + + if (!gh_string_p(minstr)) + minstr = get_property ("instrument", 0); + + if (ly_scm2string (minstr) == instrument_str_) return ""; - instrument_str_ = str; + instrument_str_ = ly_scm2string (minstr); return instrument_str_; - -/* ugh, but can 't - if (properties_dict_.elem_b ("instrument")) - return properties_dict_["instrument"]; - return ""; -*/ } void diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index 4d3c8ca01c..946f8e9367 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -26,7 +26,9 @@ Tie_engraver::do_try_music (Music *m) if (Tie_req * c = dynamic_cast (m)) { req_l_ = c; - if (get_property ("automaticMelismata",0).to_bool ()) + SCM m = get_property ("automaticMelismata",0); + bool am = gh_boolean_p (m) &&gh_scm2bool (m); + if (am) { set_melisma (true); } @@ -43,7 +45,7 @@ Tie_engraver::set_melisma (bool m) if (!where) where = daddy_trans_l_; - daddy_trans_l_->set_property ("tieMelismaBusy", m ? "1" :"0"); + daddy_trans_l_->set_property ("tieMelismaBusy", m ? SCM_BOOL_T : SCM_BOOL_F); } void @@ -76,89 +78,55 @@ Tie_engraver::do_process_requests () void Tie_engraver::process_acknowledged () { - bool old_behavior = get_property ("oldTieBehavior", 0).to_bool (); - if (req_l_) { - - /* - JUNKME! - */ - if (old_behavior) + now_heads_.sort (CHead_melodic_tuple::pitch_compare); + stopped_heads_.sort(CHead_melodic_tuple::pitch_compare); + int i=0; + int j=0; + int tie_count=0; + while ( i < now_heads_.size () && j < stopped_heads_.size ()) { - if (now_heads_.size () != stopped_heads_.size ()) - { - req_l_->warning (_ ("unequal number of note heads for tie")); - } - int sz = now_heads_.size () pitch_ , + stopped_heads_[j].req_l_->pitch_); - now_heads_.sort (CHead_melodic_tuple::pitch_compare); - stopped_heads_.sort(CHead_melodic_tuple::pitch_compare); - - for (int i=0; i < sz; i++) + if (comp) { - Tie * p = new Tie; - p->set_head (LEFT, stopped_heads_[i].head_l_); - p->set_head (RIGHT, now_heads_[i].head_l_); - tie_p_arr_.push (p); - announce_element (Score_element_info (p, req_l_)); + (comp < 0) ? i ++ : j++; + continue; } - } - else - { - now_heads_.sort (CHead_melodic_tuple::pitch_compare); - stopped_heads_.sort(CHead_melodic_tuple::pitch_compare); - int i=0; - int j=0; - int tie_count=0; - while ( i < now_heads_.size () && j < stopped_heads_.size ()) + else { - int comp - = Musical_pitch::compare (now_heads_[i].req_l_->pitch_ , - stopped_heads_[j].req_l_->pitch_); + tie_count ++; - if (comp) + /* don't go around recreating ties that were already + made. Not infallible. Due to reordering in sort (), + we will make the wrong ties when noteheads are + added. */ + if (tie_count > tie_p_arr_.size ()) { - (comp < 0) ? i ++ : j++; - continue; + Tie * p = new Tie; + p->set_head (LEFT, stopped_heads_[j].head_l_); + p->set_head (RIGHT, now_heads_[i].head_l_); + tie_p_arr_.push (p); + announce_element (Score_element_info (p, req_l_)); } - else - { - tie_count ++; - - /* don't go around recreating ties that were already - made. Not infallible. Due to reordering in sort (), - we will make the wrong ties when noteheads are - added. */ - if (tie_count > tie_p_arr_.size ()) - { - Tie * p = new Tie; - p->set_head (LEFT, stopped_heads_[j].head_l_); - p->set_head (RIGHT, now_heads_[i].head_l_); - tie_p_arr_.push (p); - announce_element (Score_element_info (p, req_l_)); - } - i++; - j++; + i++; + j++; - } } + } - if (!tie_p_arr_.size ()) - { - req_l_->warning (_ ("No ties were created!")); - } - + if (!tie_p_arr_.size ()) + { + req_l_->warning (_ ("No ties were created!")); } + } } + void Tie_engraver::do_pre_move_processing () { @@ -168,14 +136,14 @@ Tie_engraver::do_pre_move_processing () } now_heads_.clear (); - Scalar dir (get_property ("tieVerticalDirection", 0)); - Scalar dir2 (get_property ("verticalDirection", 0)); + SCM dir (get_property ("tieVerticalDirection", 0)); + SCM dir2 (get_property ("verticalDirection", 0)); Direction tie_dir = CENTER; - if (dir.length_i () && dir.isnum_b ()) - tie_dir = (Direction) sign (int(dir)); - else if (dir2.length_i () && dir2.isnum_b ()) - tie_dir = (Direction) sign (int (dir2)); + if (SCM_NUMBERP(dir)) + tie_dir = to_dir (dir); + else if (isdir_b (dir2)) + tie_dir = to_dir (dir2); for (int i=0; i< tie_p_arr_.size (); i++) { @@ -188,7 +156,8 @@ Tie_engraver::do_pre_move_processing () void Tie_engraver::do_post_move_processing () { - if (get_property ("automaticMelismata",0).to_bool ()) + SCM m = get_property ("automaticMelismata",0); + if (gh_boolean_p (m) && gh_scm2bool (m)) { set_melisma (false); } diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index a71769709f..d9051d59ae 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -54,10 +54,10 @@ Time_signature_engraver::do_pre_move_processing() { if (time_signature_p_) { - Scalar sigstyle = get_property ("timeSignatureStyle", 0); - if (sigstyle.length_i ()) + SCM sigstyle = get_property ("timeSignatureStyle", 0); + if (gh_string_p (sigstyle)) { - time_signature_p_->time_sig_type_str_ = sigstyle; + time_signature_p_->time_sig_type_str_ = ly_scm2string (sigstyle); } typeset_element (time_signature_p_); diff --git a/lily/timing-engraver.cc b/lily/timing-engraver.cc index 3fa208f15d..29ee1d6d8c 100644 --- a/lily/timing-engraver.cc +++ b/lily/timing-engraver.cc @@ -53,12 +53,15 @@ Timing_engraver::which_bar () if (!now_mom ()) return "|"; - Scalar nonauto = get_property ("barNonAuto", 0); - if (!nonauto.to_bool ()) + SCM nonauto = get_property ("barNonAuto", 0); + if (!gh_boolean_p (nonauto) && gh_scm2bool (nonauto)) { - Scalar always = get_property ("barAlways", 0); - if (!time_.whole_in_measure_ || always.to_bool ()) - return get_property ("defaultBarType" ,0); + SCM always = get_property ("barAlways", 0); + if (!time_.whole_in_measure_ || gh_boolean_p (always) && gh_scm2bool (always)) + { + SCM def=get_property ("defaultBarType" ,0); + return (gh_string_p (def))? ly_scm2string (def) : ""; + } } return ""; } diff --git a/lily/translator-group.cc b/lily/translator-group.cc index fc4ca2a44d..cffdaf8905 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -10,7 +10,7 @@ #include "translator-group.hh" #include "translator.hh" #include "debug.hh" -#include "rational.hh" +#include "moment.hh" #include "dictionary-iter.hh" #include "killing-cons.tcc" @@ -373,10 +373,8 @@ Translator_group::do_print() const #ifndef NPRINT if (!flower_dstream) return ; - for (Dictionary_iter i (properties_dict_); i.ok (); i++) - { - DEBUG_OUT << i.key () << "=" << i.val () << '\n'; - } + + gh_display (properties_dict_.self_scm_); if (status == ORPHAN) { DEBUG_OUT << "consists of: "; @@ -449,29 +447,29 @@ Translator_group::do_add_processing () } } -Scalar +SCM Translator_group::get_property (String id, Translator_group **where_l) const { - if (properties_dict_.elem_b (id)) + SCM sym = ly_symbol (id); + if (properties_dict_.elem_b (sym)) { if (where_l) *where_l = (Translator_group*) this; // ugh - return properties_dict_[id]; + return properties_dict_[sym]; } -#if 1 if (daddy_trans_l_) return daddy_trans_l_->get_property (id, where_l); -#endif if (where_l) *where_l = 0; - return ""; + + return SCM_UNDEFINED; } void -Translator_group::set_property (String id, Scalar val) +Translator_group::set_property (String id, SCM val) { - properties_dict_[id] = val; + properties_dict_[ly_symbol (id)] = val; } diff --git a/lily/translator.cc b/lily/translator.cc index a5a3b68d51..218a8c1423 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -11,7 +11,7 @@ #include "debug.hh" #include "translator-group.hh" -#include "rational.hh" +#include "moment.hh" char const* Translator::name() const @@ -163,7 +163,7 @@ Translator::output_def_l () const return output_def_l_; } -Scalar +SCM Translator::get_property (String id, Translator_group **where_l) const { return daddy_trans_l_->get_property (id, where_l); diff --git a/po/GNUmakefile b/po/GNUmakefile index c6540da3b1..fb421f7890 100644 --- a/po/GNUmakefile +++ b/po/GNUmakefile @@ -15,7 +15,6 @@ EXTRA_DIST_FILES = TODO $(PO_FILES) $(POT_FILES) STEPMAKE_TEMPLATES=podir include $(depth)/make/stepmake.make -include $(stepdir)/po-rules.make default: $(MO_FILES)