From 03e797f6e8a38e9c8c640f5a30e9fb3a1ca99454 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:43:29 +0000 Subject: [PATCH] lilypond-0.0.64 --- lib/include/proto.hh | 2 -- lily/bar-reg.cc | 2 +- lily/clef-reg.cc | 4 +-- lily/collision-reg.cc | 4 +-- lily/complex-walker.cc | 2 +- lily/dynamic-reg.cc | 6 ++-- lily/head-reg.cc | 2 +- lily/include/clef-reg.hh | 2 +- lily/include/collision-reg.hh | 2 +- lily/include/complex-walker.hh | 4 +-- lily/include/dynamic-reg.hh | 2 +- lily/include/item.hh | 2 +- lily/include/key-reg.hh | 2 +- lily/include/lily-proto.hh | 4 +++ lily/include/local-key-reg.hh | 2 +- lily/include/note-column-reg.hh | 4 +-- lily/include/register-group.hh | 2 +- lily/include/register.hh | 8 ++--- lily/include/rest-collision-reg.hh | 2 +- lily/include/script-reg.hh | 4 +-- lily/include/slur-reg.hh | 2 +- lily/include/spanner.hh | 2 +- lily/include/staff-elem.hh | 28 +++++++++------- lily/include/staff-regs.hh | 2 +- lily/include/staff-side.hh | 8 ++--- lily/include/staffeleminfo.hh | 10 +++--- lily/include/stem-beam-reg.hh | 2 +- lily/include/text-reg.hh | 2 +- lily/include/tie-reg.hh | 2 +- lily/include/vertical-spanner.hh | 24 ++++++++++++++ lily/include/voice-regs.hh | 2 +- lily/include/walk-regs.hh | 10 +++--- lily/key-reg.cc | 4 +-- lily/meter-reg.cc | 2 +- lily/note-column-reg.cc | 14 ++++---- lily/register-group.cc | 2 +- lily/register.cc | 4 +-- lily/rest-collision-reg.cc | 6 ++-- lily/script-reg.cc | 10 +++--- lily/slur-reg.cc | 6 ++-- lily/spanner.cc | 2 +- lily/staff-elem-info.cc | 6 ++-- lily/staff-elem.cc | 52 ++++++++++++++++-------------- lily/staff-regs.cc | 4 +-- lily/staff-side.cc | 4 +-- lily/staff-sym-reg.cc | 2 +- lily/stem.cc | 2 +- lily/text-reg.cc | 4 +-- lily/voice-regs.cc | 2 +- lily/walk-regs.cc | 10 +++--- 50 files changed, 163 insertions(+), 129 deletions(-) create mode 100644 lily/include/vertical-spanner.hh diff --git a/lib/include/proto.hh b/lib/include/proto.hh index 19273d0ab1..ab93a5472f 100644 --- a/lib/include/proto.hh +++ b/lib/include/proto.hh @@ -143,8 +143,6 @@ struct Spanner; struct Subtle_req; struct Staff; struct Staff_column; -struct Staff_elem; -struct Staff_elem_info; struct Staff_symbol; struct Staff_walker; struct Stem; diff --git a/lily/bar-reg.cc b/lily/bar-reg.cc index 8450b6bf7e..4dd6199ce1 100644 --- a/lily/bar-reg.cc +++ b/lily/bar-reg.cc @@ -42,7 +42,7 @@ Bar_register::process_requests() } if (bar_p_){ - announce_element(Staff_elem_info(bar_p_, bar_req_l_) ); + announce_element(Score_elem_info(bar_p_, bar_req_l_) ); } } diff --git a/lily/clef-reg.cc b/lily/clef-reg.cc index f5687a1665..63e4a505fc 100644 --- a/lily/clef-reg.cc +++ b/lily/clef-reg.cc @@ -48,7 +48,7 @@ Clef_register::read_req(Clef_change_req*c_l) c_l->error("unknown clef type "); } void -Clef_register::acknowledge_element(Staff_elem_info info) +Clef_register::acknowledge_element(Score_elem_info info) { if (info.elem_l_->name() == Bar::static_name()) { if (!clef_p_){ @@ -76,7 +76,7 @@ Clef_register::create_clef() { clef_p_ = new Clef_item; clef_p_->read(*this); - announce_element(Staff_elem_info(clef_p_, + announce_element(Score_elem_info(clef_p_, clef_req_l_)); } diff --git a/lily/collision-reg.cc b/lily/collision-reg.cc index 954b999a24..6b9da77062 100644 --- a/lily/collision-reg.cc +++ b/lily/collision-reg.cc @@ -11,7 +11,7 @@ #include "collision.hh" void -Collision_register::acknowledge_element(Staff_elem_info i) +Collision_register::acknowledge_element(Score_elem_info i) { if (!(i.elem_l_->name() == Note_column::static_name())) return; @@ -19,7 +19,7 @@ Collision_register::acknowledge_element(Staff_elem_info i) if (!col_p_) col_p_ = new Collision; - col_p_->add((Note_column*)i.elem_l_); + col_p_->add((Note_column*)i.elem_l_->item()); } void diff --git a/lily/complex-walker.cc b/lily/complex-walker.cc index 134a4705a7..1e1ac452d7 100644 --- a/lily/complex-walker.cc +++ b/lily/complex-walker.cc @@ -68,7 +68,7 @@ Complex_walker::regs_process_requests() } void -Complex_walker::typeset_element(Staff_elem *elem_p) +Complex_walker::typeset_element(Score_elem *elem_p) { if (!elem_p) return; diff --git a/lily/dynamic-reg.cc b/lily/dynamic-reg.cc index 11a74756a7..20ffe5cfe3 100644 --- a/lily/dynamic-reg.cc +++ b/lily/dynamic-reg.cc @@ -58,7 +58,7 @@ Dynamic_register::process_requests() assert (!dynamic_p_) ; // TODO dynamic_p_ = new Text_item(td_p); - announce_element(Staff_elem_info(dynamic_p_, dreq_l)); + announce_element(Score_elem_info(dynamic_p_, dreq_l)); } else if (dreq_l->span_dynamic()) { Span_dynamic_req* span_l = dreq_l->span_dynamic(); @@ -75,7 +75,7 @@ Dynamic_register::process_requests() assert(!new_cresc_p); new_cresc_p = new Crescendo; new_cresc_p->grow_dir_i_ = span_l->dynamic_dir_i_; - announce_element(Staff_elem_info(new_cresc_p, span_l)); + announce_element(Score_elem_info(new_cresc_p, span_l)); } } } @@ -136,7 +136,7 @@ Dynamic_register::~Dynamic_register() delete cresc_p_; } void -Dynamic_register::acknowledge_element(Staff_elem_info i) +Dynamic_register::acknowledge_element(Score_elem_info i) { if (i.elem_l_->name() == Note_column::static_name()) { if (dynamic_p_) dynamic_p_->add_support(i.elem_l_); diff --git a/lily/head-reg.cc b/lily/head-reg.cc index 5b1557ea78..562dbea654 100644 --- a/lily/head-reg.cc +++ b/lily/head-reg.cc @@ -48,7 +48,7 @@ Notehead_register::process_requests() 6 * paper()->internote())); } - Staff_elem_info itinf(note_p_,note_req_l_); + Score_elem_info itinf(note_p_,note_req_l_); announce_element(itinf); } diff --git a/lily/include/clef-reg.hh b/lily/include/clef-reg.hh index 434ffcd958..a9f3426a12 100644 --- a/lily/include/clef-reg.hh +++ b/lily/include/clef-reg.hh @@ -23,7 +23,7 @@ protected: virtual void pre_move_processing(); virtual void post_move_processing(); virtual bool try_request(Request*); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); public: int c0_position_i_; String clef_type_str_; diff --git a/lily/include/collision-reg.hh b/lily/include/collision-reg.hh index 31de018f46..0dd8a66fca 100644 --- a/lily/include/collision-reg.hh +++ b/lily/include/collision-reg.hh @@ -16,7 +16,7 @@ class Collision_register : public Request_register { Collision* col_p_; protected: - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); public: Collision_register(); diff --git a/lily/include/complex-walker.hh b/lily/include/complex-walker.hh index a23371abea..44f445f069 100644 --- a/lily/include/complex-walker.hh +++ b/lily/include/complex-walker.hh @@ -27,8 +27,8 @@ public: /* *************** */ void regs_process_requests(); - void typeset_element(Staff_elem *elem_p); - void announce_element(Staff_elem_info); + void typeset_element(Score_elem *elem_p); + void announce_element(Score_elem_info); virtual void process_requests(); virtual void do_post_move(); virtual void do_pre_move(); diff --git a/lily/include/dynamic-reg.hh b/lily/include/dynamic-reg.hh index c56805d07d..cf23d007c3 100644 --- a/lily/include/dynamic-reg.hh +++ b/lily/include/dynamic-reg.hh @@ -25,7 +25,7 @@ public: ~Dynamic_register(); NAME_MEMBERS(Dynamic_register); protected: - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual bool try_request(Request *req_l); virtual void process_requests(); virtual void pre_move_processing(); diff --git a/lily/include/item.hh b/lily/include/item.hh index 622f0f0dea..f61a2f2765 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -23,7 +23,7 @@ spacing calculation. */ -class Item : public Staff_elem { +class Item : public virtual Score_elem { public: /// indirection to the column it is in PCol * pcol_l_; diff --git a/lily/include/key-reg.hh b/lily/include/key-reg.hh index a907434bf2..c674ca55a2 100644 --- a/lily/include/key-reg.hh +++ b/lily/include/key-reg.hh @@ -25,7 +25,7 @@ struct Key_register : Request_register { virtual void process_requests(); virtual void pre_move_processing(); virtual void post_move_processing(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); Key_register(); NAME_MEMBERS(Key_register); private: diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index d40e1616e6..7cffaced16 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -47,6 +47,8 @@ struct Request_column; struct Rest_req; struct Rhythmic_grouping_req; struct Rhythmic_req; +struct Score_elem; +struct Score_elem_info; struct Script_req; struct Skip_req; struct Slur_req; @@ -69,4 +71,6 @@ struct Script_column; struct Rest_column; struct Rest_collision_register; struct Rest_collision; +struct Vertical_spanner; +struct Vertical_brace; #endif // LILY_PROTO_HH diff --git a/lily/include/local-key-reg.hh b/lily/include/local-key-reg.hh index 19e11b9d4e..b7197d2743 100644 --- a/lily/include/local-key-reg.hh +++ b/lily/include/local-key-reg.hh @@ -21,7 +21,7 @@ struct Local_key_register : Request_register { Link_array tied_l_arr_; /* *************** */ virtual void process_requests(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); Local_key_register(); NAME_MEMBERS(Local_key_register); diff --git a/lily/include/note-column-reg.hh b/lily/include/note-column-reg.hh index d052d04983..d33dddf962 100644 --- a/lily/include/note-column-reg.hh +++ b/lily/include/note-column-reg.hh @@ -24,10 +24,10 @@ class Note_column_register :public Request_register { int dir_i_; /* *************** */ - bool acceptable_elem_b(Staff_elem const*)const; + bool acceptable_elem_b(Score_elem const*)const; protected: virtual void set_feature(Feature); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); virtual void post_move_processing(); public: diff --git a/lily/include/register-group.hh b/lily/include/register-group.hh index 2156dbec80..2e13b51248 100644 --- a/lily/include/register-group.hh +++ b/lily/include/register-group.hh @@ -44,7 +44,7 @@ public: virtual void sync_features() ; virtual void pre_move_processing(); virtual void post_move_processing(); - virtual void acknowledge_element(Staff_elem_info info); + virtual void acknowledge_element(Score_elem_info info); virtual bool try_request(Request*); virtual void process_requests(); virtual ~Register_group_register(); diff --git a/lily/include/register.hh b/lily/include/register.hh index 5ba28600ad..dee7c512c8 100644 --- a/lily/include/register.hh +++ b/lily/include/register.hh @@ -17,7 +17,7 @@ #include "staff-info.hh" /** - a struct which processes requests, and creates the #Staff_elem#s. + a struct which processes requests, and creates the #Score_elem#s. It may use derived classes. Hungarian postfix: register */ class Request_register { @@ -69,7 +69,7 @@ protected: /** Invoke walker method to typeset element. Default: pass on to daddy. */ - virtual void typeset_element(Staff_elem*elem_p); + virtual void typeset_element(Score_elem*elem_p); /** take note of item/spanner @@ -77,11 +77,11 @@ protected: Default: ignore the info */ - virtual void acknowledge_element(Staff_elem_info) {} + virtual void acknowledge_element(Score_elem_info) {} /** Announce element. Default: pass on to daddy. Utility */ - virtual void announce_element(Staff_elem_info); + virtual void announce_element(Score_elem_info); /** Set Feature of the register(s). Default: ignore Feature. */ diff --git a/lily/include/rest-collision-reg.hh b/lily/include/rest-collision-reg.hh index da2992b65c..a572ee6449 100644 --- a/lily/include/rest-collision-reg.hh +++ b/lily/include/rest-collision-reg.hh @@ -17,7 +17,7 @@ class Rest_collision_register : public Request_register { Rest_collision* rest_collision_p_; Array< Collision *> collision_l_arr_; protected: - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); public: Rest_collision_register(); diff --git a/lily/include/script-reg.hh b/lily/include/script-reg.hh index 67d1215b9a..f7fc05d9eb 100644 --- a/lily/include/script-reg.hh +++ b/lily/include/script-reg.hh @@ -16,14 +16,14 @@ class Script_register : public Request_register { Array script_req_l_arr_; /* *************** */ - bool acceptable_elem_b(Staff_elem*); + bool acceptable_elem_b(Score_elem*); public: NAME_MEMBERS(Script_register); Script_register(); protected: virtual bool try_request(Request*); virtual void process_requests(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); virtual void post_move_processing(); diff --git a/lily/include/slur-reg.hh b/lily/include/slur-reg.hh index cca97e0f13..9ac27e5916 100644 --- a/lily/include/slur-reg.hh +++ b/lily/include/slur-reg.hh @@ -23,7 +23,7 @@ protected: virtual void set_feature(Feature); virtual bool acceptable_request_b(Request*); virtual void process_requests(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); virtual void post_move_processing(); public: diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index d3ca04af5e..df5e9e58e9 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -31,7 +31,7 @@ length of stems of notes they encompass. */ -class Spanner:public Staff_elem { +class Spanner:public virtual Score_elem { public: PCol *left_col_l_, *right_col_l_; diff --git a/lily/include/staff-elem.hh b/lily/include/staff-elem.hh index a1524a1bd6..fa459f9e76 100644 --- a/lily/include/staff-elem.hh +++ b/lily/include/staff-elem.hh @@ -13,14 +13,14 @@ #include "class-name.hh" -/** Both Spanner and Item are Staff_elem's. Most Staff_elem's depend - on other Staff_elem's, eg, Beam needs to know and set direction of +/** Both Spanner and Item are Score_elem's. Most Score_elem's depend + on other Score_elem's, eg, Beam needs to know and set direction of Stem. So the Beam has to be calculated *before* Stem. This is - accomplished with the dependencies field of struct Staff_elem. + accomplished with the dependencies field of struct Score_elem. (elem) */ -class Staff_elem { +class Score_elem { /// member: the symbols Molecule *output; // should scrap, and use temp var? @@ -31,7 +31,7 @@ class Staff_elem { NULL. */ Offset offset_; - Array dependancy_l_arr_; + Array dependancy_l_arr_; public: enum Status { ORPHAN, // not yet added to pstaff @@ -40,6 +40,8 @@ public: PRECALCED, // calcs before spacing done POSTCALCING, // busy calculating. This is used to trap cyclic deps. POSTCALCED, // after spacing calcs done + VERTICALCING, // height determined + VERTICALCED, OUTPUT, // molecule has been output DELETED, // to catch malloc mistakes. } status; @@ -48,15 +50,15 @@ public: PStaff *pstaff_l_; /* *************** */ - Staff_elem(Staff_elem const&); + Score_elem(Score_elem const&); String TeXstring () const ; virtual void print() const; virtual Interval width() const; virtual Interval height() const; Paper_def *paper() const; - virtual ~Staff_elem(); - Staff_elem(); - NAME_MEMBERS(Staff_elem); + virtual ~Score_elem(); + Score_elem(); + NAME_MEMBERS(Score_elem); /** translate the symbol. The symbol does not have to be created yet. @@ -74,8 +76,8 @@ public: /** add a dependency. It may be the 0 pointer, in which case, it is ignored. */ - void add_dependency(Staff_elem* ); - void substitute_dependency(Staff_elem* old, Staff_elem * newdep); + void add_dependency(Score_elem* ); + void substitute_dependency(Score_elem* old, Score_elem * newdep); protected: virtual Interval do_height()const; @@ -92,7 +94,9 @@ protected: /// do calculations after determining horizontal spacing virtual void do_post_processing(); - Array dependant_l_arr_; + /// do calculations after height of spanners/items is determined. + virtual void do_verticalcing(); + Array dependant_l_arr_; }; diff --git a/lily/include/staff-regs.hh b/lily/include/staff-regs.hh index 88c41f8999..69f1f5356e 100644 --- a/lily/include/staff-regs.hh +++ b/lily/include/staff-regs.hh @@ -25,7 +25,7 @@ protected: virtual bool try_request(Request * r); virtual Staff_info get_staff_info(); virtual bool acceptable_request_b(Request*) const ; - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); public: /* *************** */ diff --git a/lily/include/staff-side.hh b/lily/include/staff-side.hh index 1300871023..c81353f0cb 100644 --- a/lily/include/staff-side.hh +++ b/lily/include/staff-side.hh @@ -14,9 +14,9 @@ /// A symbol which sits along the staff class Staff_side { - Array support_l_arr_; + Array support_l_arr_; int staff_size_i_; - Staff_elem * elem_l_; + Score_elem * elem_l_; Interval support_height()const; Staff_symbol* staff_sym_l_; void read_staff_sym(); @@ -32,8 +32,8 @@ public: void set_staffsym(Staff_symbol*); - Staff_side(Staff_elem*); - void add_support(Staff_elem*); + Staff_side(Score_elem*); + void add_support(Score_elem*); protected: int get_position_i()const; diff --git a/lily/include/staffeleminfo.hh b/lily/include/staffeleminfo.hh index 14652899d4..ef9f3c196f 100644 --- a/lily/include/staffeleminfo.hh +++ b/lily/include/staffeleminfo.hh @@ -1,5 +1,5 @@ /* - staffeleminfo.hh -- declare Staff_elem_info + staffeleminfo.hh -- declare Score_elem_info source file of the LilyPond music typesetter @@ -13,16 +13,16 @@ #include "proto.hh" /// data container. -struct Staff_elem_info { - Staff_elem * elem_p_; +struct Score_elem_info { + Score_elem * elem_p_; Request*req_l_; Voice const * voice_l_; Voice_group_registers * group_regs_l_; Request_register * origin_reg_l_; /* *** */ - Staff_elem_info(Staff_elem*, Request*, Request_register*); - Staff_elem_info(); + Score_elem_info(Score_elem*, Request*, Request_register*); + Score_elem_info(); }; #endif // STAFFELEMINFO_HH diff --git a/lily/include/stem-beam-reg.hh b/lily/include/stem-beam-reg.hh index f5a3c6452b..f63f1ad6de 100644 --- a/lily/include/stem-beam-reg.hh +++ b/lily/include/stem-beam-reg.hh @@ -33,7 +33,7 @@ protected: virtual void set_feature(Feature dir_i_); virtual bool try_request(Request*); virtual void process_requests(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); virtual void post_move_processing(); }; diff --git a/lily/include/text-reg.hh b/lily/include/text-reg.hh index f3544b3ec7..4b251aef97 100644 --- a/lily/include/text-reg.hh +++ b/lily/include/text-reg.hh @@ -20,7 +20,7 @@ protected: virtual void process_requests(); virtual void pre_move_processing(); virtual void post_move_processing(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); public: Text_register(); NAME_MEMBERS(Text_register); diff --git a/lily/include/tie-reg.hh b/lily/include/tie-reg.hh index 5a0028f83e..b0cd227625 100644 --- a/lily/include/tie-reg.hh +++ b/lily/include/tie-reg.hh @@ -24,7 +24,7 @@ class Tie_register : public Request_register { protected: virtual ~Tie_register(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual bool try_request(Request*); virtual bool acceptable_request_b(Request*); virtual void sync_features(); diff --git a/lily/include/vertical-spanner.hh b/lily/include/vertical-spanner.hh new file mode 100644 index 0000000000..be0aee63cc --- /dev/null +++ b/lily/include/vertical-spanner.hh @@ -0,0 +1,24 @@ +/* + vertical-spanner.hh -- declare Vertical_spanner + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef VERTICAL_SPANNER_HH +#define VERTICAL_SPANNER_HH + +#include "staff-elem.hh" + +class Vertical_spanner: virtual public Score_elem { +public: + PStaff *lower_pstaff_l_; + PStaff *upper_pstaff_l_; + NAME_MEMBERS(Vertical_spanner); + + Vertical_spanner(); + +}; +#endif // VERTICAL_SPANNER_HH diff --git a/lily/include/voice-regs.hh b/lily/include/voice-regs.hh index 818f32d71c..4586f40ab2 100644 --- a/lily/include/voice-regs.hh +++ b/lily/include/voice-regs.hh @@ -25,7 +25,7 @@ public: protected: virtual void pre_move_processing(); virtual bool acceptable_request_b(Request*); - virtual void acknowledge_element(Staff_elem_info info); + virtual void acknowledge_element(Score_elem_info info); virtual bool try_request(Request*); virtual void do_print() const; }; diff --git a/lily/include/walk-regs.hh b/lily/include/walk-regs.hh index 7739ed269b..3326daad80 100644 --- a/lily/include/walk-regs.hh +++ b/lily/include/walk-regs.hh @@ -22,22 +22,22 @@ struct Walker_registers : Register_group_register { Array prebreak_item_p_arr_; Array nobreak_item_p_arr_; Array postbreak_item_p_arr_; - Array announce_info_arr_; + Array announce_info_arr_; Complex_walker * walk_l_; /* *************** */ - void typeset_musical_item(Staff_elem * elem_p); + void typeset_musical_item(Score_elem * elem_p); Walker_registers(Complex_walker*); void do_announces(); virtual Staff_info get_staff_info(); - virtual void announce_element(Staff_elem_info); - virtual void acknowledge_element(Staff_elem_info); + virtual void announce_element(Score_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void typeset_breakable_item(Item * pre_p , Item * nobreak_p, Item * post_p); - virtual void typeset_element(Staff_elem*elem_p); + virtual void typeset_element(Score_elem*elem_p); virtual void pre_move_processing(); virtual void post_move_processing(); virtual Paper_def * paper() const; diff --git a/lily/key-reg.cc b/lily/key-reg.cc index c1268181ae..fe2371e349 100644 --- a/lily/key-reg.cc +++ b/lily/key-reg.cc @@ -39,7 +39,7 @@ Key_register::try_request(Request * req_l) } void -Key_register::acknowledge_element(Staff_elem_info info) +Key_register::acknowledge_element(Score_elem_info info) { Command_req * r_l = info.req_l_->command() ; if (r_l && r_l->clefchange()) { @@ -61,7 +61,7 @@ Key_register::process_requests() else kit_p_ = new Key_item(c0_i); kit_p_->read(*this); - announce_element(Staff_elem_info(kit_p_, keyreq_l_)); + announce_element(Score_elem_info(kit_p_, keyreq_l_)); } void diff --git a/lily/meter-reg.cc b/lily/meter-reg.cc index c4ef7b9bb1..338ea7e10f 100644 --- a/lily/meter-reg.cc +++ b/lily/meter-reg.cc @@ -41,7 +41,7 @@ Meter_register::process_requests() } if (meter_p_) - announce_element(Staff_elem_info(meter_p_, meter_req_l_) ); + announce_element(Score_elem_info(meter_p_, meter_req_l_) ); } void diff --git a/lily/note-column-reg.cc b/lily/note-column-reg.cc index cb8129d5bc..feee0c66b5 100644 --- a/lily/note-column-reg.cc +++ b/lily/note-column-reg.cc @@ -14,7 +14,7 @@ #include "rest-column.hh" bool -Note_column_register::acceptable_elem_b(Staff_elem const*elem_C)const +Note_column_register::acceptable_elem_b(Score_elem const*elem_C)const { char const*nC = elem_C->name(); return (nC == Script::static_name() || nC == Notehead::static_name() @@ -25,7 +25,7 @@ Note_column_register::note_col_l() { if (!ncol_p_){ ncol_p_ = new Note_column; - announce_element(Staff_elem_info(ncol_p_, 0)); + announce_element(Score_elem_info(ncol_p_, 0)); } return ncol_p_; } @@ -35,13 +35,13 @@ Note_column_register::rest_col_l() { if (!restcol_p_) { restcol_p_ = new Rest_column; - announce_element(Staff_elem_info(restcol_p_,0)); + announce_element(Score_elem_info(restcol_p_,0)); } return restcol_p_; } void -Note_column_register::acknowledge_element(Staff_elem_info i) +Note_column_register::acknowledge_element(Score_elem_info i) { if (!acceptable_elem_b(i.elem_l_)) return; @@ -50,16 +50,16 @@ Note_column_register::acknowledge_element(Staff_elem_info i) char const*nC = i.elem_l_->name(); if (nC == Script::static_name()) { - script_l_arr_.push((Script*)i.elem_l_); + script_l_arr_.push((Script*)i.elem_l_->item()); } else if (nC == Notehead::static_name()) { - Notehead * h_l = (Notehead*)i.elem_l_; + Notehead * h_l = (Notehead*)i.elem_l_->item(); if (h_l->rest_b_) rest_col_l()->add(h_l); else note_col_l()->add(h_l); } else if (nC == Stem::static_name()){ - stem_l_ = (Stem*)i.elem_l_; + stem_l_ = (Stem*)i.elem_l_->item(); } } diff --git a/lily/register-group.cc b/lily/register-group.cc index 6e516df21b..e80afd48e1 100644 --- a/lily/register-group.cc +++ b/lily/register-group.cc @@ -77,7 +77,7 @@ Register_group_register::post_move_processing() } void -Register_group_register::acknowledge_element(Staff_elem_info info) +Register_group_register::acknowledge_element(Score_elem_info info) { Request_register* origin = info.origin_reg_l_arr_[0]; if (!contains_b(origin) && !origin->contains_b(this)) // am i sure? diff --git a/lily/register.cc b/lily/register.cc index 08c3feaa00..7710ddf87d 100644 --- a/lily/register.cc +++ b/lily/register.cc @@ -34,14 +34,14 @@ Request_register::Request_register() } void -Request_register::announce_element(Staff_elem_info i) +Request_register::announce_element(Score_elem_info i) { i.origin_reg_l_arr_.push(this); daddy_reg_l_->announce_element(i); } void -Request_register::typeset_element(Staff_elem*p) +Request_register::typeset_element(Score_elem*p) { daddy_reg_l_->typeset_element(p); } diff --git a/lily/rest-collision-reg.cc b/lily/rest-collision-reg.cc index b5a286f284..a9ca851cd4 100644 --- a/lily/rest-collision-reg.cc +++ b/lily/rest-collision-reg.cc @@ -13,16 +13,16 @@ #include "note-column.hh" void -Rest_collision_register::acknowledge_element(Staff_elem_info i) +Rest_collision_register::acknowledge_element(Score_elem_info i) { char const * nC = i.elem_l_->name(); if (nC == Collision::static_name()) { - collision_l_arr_.push((Collision*)i.elem_l_); + collision_l_arr_.push((Collision*)i.elem_l_->item()); } else if (nC == Rest_column ::static_name()) { if (!rest_collision_p_) rest_collision_p_ = new Rest_collision; - rest_collision_p_->add((Rest_column*)i.elem_l_); + rest_collision_p_->add((Rest_column*)i.elem_l_->item()); } } diff --git a/lily/script-reg.cc b/lily/script-reg.cc index b68298d5de..be12028c17 100644 --- a/lily/script-reg.cc +++ b/lily/script-reg.cc @@ -38,28 +38,28 @@ Script_register::process_requests() Script_req* l=script_req_l_arr_[i]; Script *p =new Script( l); script_p_arr_.push(p); - announce_element(Staff_elem_info(p, l)); + announce_element(Score_elem_info(p, l)); } } bool -Script_register::acceptable_elem_b(Staff_elem*s_l) +Script_register::acceptable_elem_b(Score_elem*s_l) { char const *nC = s_l->name(); return (nC == Stem::static_name()); } void -Script_register::acknowledge_element(Staff_elem_info info) +Script_register::acknowledge_element(Score_elem_info info) { - Staff_elem *elem_l = info.elem_l_; + Score_elem *elem_l = info.elem_l_; if (!acceptable_elem_b(elem_l)) return; for (int i=0; i < script_p_arr_.size(); i++) { Script*script_l = script_p_arr_[i]; if (elem_l->name() == Stem::static_name()) - script_l->set_stem((Stem*)elem_l); + script_l->set_stem((Stem*)elem_l->item()); } } diff --git a/lily/slur-reg.cc b/lily/slur-reg.cc index 20a3c5415e..d08488e371 100644 --- a/lily/slur-reg.cc +++ b/lily/slur-reg.cc @@ -30,10 +30,10 @@ Slur_register::try_request(Request *req_l) } void -Slur_register::acknowledge_element(Staff_elem_info info) +Slur_register::acknowledge_element(Score_elem_info info) { if (info.elem_l_->name() == Note_column::static_name()) { - Note_column *col_l =(Note_column*) info.elem_l_ ;// ugh + Note_column *col_l =(Note_column*) info.elem_l_->item() ;// ugh for (int i = 0; i < slur_l_stack_.size(); i++) slur_l_stack_[i]->add(col_l ); for (int i = 0; i < end_slur_l_arr_.size(); i++) @@ -76,7 +76,7 @@ Slur_register::process_requests() Slur * s_p =new Slur; requests_arr_.push(slur_req_l); start_slur_l_arr_.push(s_p); - announce_element(Staff_elem_info(s_p, slur_req_l)); + announce_element(Score_elem_info(s_p, slur_req_l)); } } for (int i=0; i < start_slur_l_arr_.size(); i++) diff --git a/lily/spanner.cc b/lily/spanner.cc index 2df030dd5b..53d7bca6b1 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -19,7 +19,7 @@ Spanner::broken_at(PCol*c1, PCol *c2)const for (int i=0; i < dependant_l_arr_.size(); i++) { dependant_l_arr_[i]-> - substitute_dependency((Staff_elem*)this, span_p); + substitute_dependency((Score_elem*)this, span_p); } span_p->left_col_l_ = c1; diff --git a/lily/staff-elem-info.cc b/lily/staff-elem-info.cc index 0bef384db6..669c0244ce 100644 --- a/lily/staff-elem-info.cc +++ b/lily/staff-elem-info.cc @@ -1,5 +1,5 @@ /* - staff-elem-info.cc -- implement Staff_elem_info + staff-elem-info.cc -- implement Score_elem_info source file of the LilyPond music typesetter @@ -9,14 +9,14 @@ #include "staff-elem-info.hh" #include "request.hh" -Staff_elem_info::Staff_elem_info(Staff_elem*s_l, Request*r_l) +Score_elem_info::Score_elem_info(Score_elem*s_l, Request*r_l) { elem_l_ = s_l; voice_l_ = (r_l)?r_l->voice_l():0; req_l_ = r_l; } -Staff_elem_info::Staff_elem_info() +Score_elem_info::Score_elem_info() { elem_l_ = 0; voice_l_ = 0; diff --git a/lily/staff-elem.cc b/lily/staff-elem.cc index 331ffbe92f..ec4f851922 100644 --- a/lily/staff-elem.cc +++ b/lily/staff-elem.cc @@ -1,5 +1,5 @@ /* - staff-elem.cc -- implement Staff_elem + staff-elem.cc -- implement Score_elem source file of the LilyPond music typesetter @@ -16,14 +16,14 @@ #include "debug.hh" String -Staff_elem::TeXstring() const +Score_elem::TeXstring() const { Molecule m(*output); m.translate(offset_); // ugh? return m.TeXstring(); } -Staff_elem::Staff_elem(Staff_elem const&s) +Score_elem::Score_elem(Score_elem const&s) :dependancy_l_arr_(s.dependancy_l_arr_), dependant_l_arr_(s.dependant_l_arr_) { @@ -38,7 +38,7 @@ Staff_elem::Staff_elem(Staff_elem const&s) TODO: If deleted, then remove dependant_l_arr_ depency! */ -Staff_elem::~Staff_elem() +Score_elem::~Score_elem() { assert(status < DELETED); delete output; @@ -47,13 +47,13 @@ Staff_elem::~Staff_elem() } void -Staff_elem::translate(Offset O) +Score_elem::translate(Offset O) { offset_ += O; } Interval -Staff_elem::do_width() const +Score_elem::do_width() const { Interval r; @@ -67,7 +67,7 @@ Staff_elem::do_width() const } Interval -Staff_elem::width() const +Score_elem::width() const { Interval r=do_width(); @@ -77,7 +77,7 @@ Staff_elem::width() const return r; } Interval -Staff_elem::do_height() const +Score_elem::do_height() const { Interval r; if (!output){ @@ -90,7 +90,7 @@ Staff_elem::do_height() const } Interval -Staff_elem::height() const +Score_elem::height() const { Interval r=do_height(); @@ -102,7 +102,7 @@ Staff_elem::height() const } void -Staff_elem::print()const +Score_elem::print()const { #ifndef NPRINT mtor << name() << "{\n"; @@ -116,7 +116,7 @@ Staff_elem::print()const -Staff_elem::Staff_elem() +Score_elem::Score_elem() { pstaff_l_=0; offset_ = Offset(0,0); @@ -126,14 +126,14 @@ Staff_elem::Staff_elem() Paper_def* -Staff_elem::paper() const +Score_elem::paper() const { assert(pstaff_l_); return pstaff_l_->pscore_l_->paper_l_; } void -Staff_elem::add_processing() +Score_elem::add_processing() { if (status >= VIRGIN) return; @@ -142,7 +142,7 @@ Staff_elem::add_processing() } void -Staff_elem::pre_processing() +Score_elem::pre_processing() { if (status >= PRECALCED ) return; @@ -158,7 +158,7 @@ Staff_elem::pre_processing() status = PRECALCED; } void -Staff_elem::post_processing() +Score_elem::post_processing() { if (status >= POSTCALCED) return; @@ -173,7 +173,7 @@ Staff_elem::post_processing() } void -Staff_elem::molecule_processing() +Score_elem::molecule_processing() { if (status >= OUTPUT) return; @@ -186,22 +186,26 @@ Staff_elem::molecule_processing() } void -Staff_elem::do_post_processing() +Score_elem::do_post_processing() { } void -Staff_elem::do_pre_processing() +Score_elem::do_pre_processing() +{ +} +void +Score_elem::do_verticalcing() { } void -Staff_elem::do_add_processing() +Score_elem::do_add_processing() { } void -Staff_elem::substitute_dependency(Staff_elem * old, Staff_elem * newdep) +Score_elem::substitute_dependency(Score_elem * old, Score_elem * newdep) { bool hebbes_b=false; for (int i=0; i < dependancy_l_arr_.size(); i++) { @@ -217,7 +221,7 @@ Staff_elem::substitute_dependency(Staff_elem * old, Staff_elem * newdep) } void -Staff_elem::add_dependency(Staff_elem * p) +Score_elem::add_dependency(Score_elem * p) { for (int i=0; i < dependancy_l_arr_.size(); i ++) if (dependancy_l_arr_[i] == p) @@ -226,16 +230,16 @@ Staff_elem::add_dependency(Staff_elem * p) dependancy_l_arr_.push(p); p->dependant_l_arr_.push(p); } -IMPLEMENT_STATIC_NAME(Staff_elem); +IMPLEMENT_STATIC_NAME(Score_elem); Molecule* -Staff_elem::brew_molecule_p()const +Score_elem::brew_molecule_p()const { Atom a(paper()->lookup_l()->fill(Box(Interval(0,0), Interval(0,0)))); return new Molecule (a); } Offset -Staff_elem::offset() const +Score_elem::offset() const { return offset_; } diff --git a/lily/staff-regs.cc b/lily/staff-regs.cc index b6dc1165b7..7a0abadd96 100644 --- a/lily/staff-regs.cc +++ b/lily/staff-regs.cc @@ -121,9 +121,9 @@ Staff_registers::acceptable_request_b(Request*r)const } void -Staff_registers::acknowledge_element(Staff_elem_info i) +Staff_registers::acknowledge_element(Score_elem_info i) { Register_group_register::acknowledge_element(i); if ( i.elem_l_->name() == Staff_symbol::static_name()) - staff_sym_l_ = (Staff_symbol*)i.elem_l_; + staff_sym_l_ = (Staff_symbol*)i.elem_l_->item(); } diff --git a/lily/staff-side.cc b/lily/staff-side.cc index 29c584822f..1435f5daa9 100644 --- a/lily/staff-side.cc +++ b/lily/staff-side.cc @@ -17,7 +17,7 @@ Staff_side::set_staffsym(Staff_symbol* s_l) staff_sym_l_ = s_l; } -Staff_side::Staff_side(Staff_elem * elem_l) +Staff_side::Staff_side(Score_elem * elem_l) { inter_f_ = 2 PT; staff_size_i_ = 0; @@ -51,7 +51,7 @@ Staff_side::support_height() const } void -Staff_side::add_support(Staff_elem*i) +Staff_side::add_support(Score_elem*i) { support_l_arr_.push(i); elem_l_->add_dependency(i); diff --git a/lily/staff-sym-reg.cc b/lily/staff-sym-reg.cc index 60be9b0814..e8863369ac 100644 --- a/lily/staff-sym-reg.cc +++ b/lily/staff-sym-reg.cc @@ -35,7 +35,7 @@ Staff_sym_register::post_move_processing() void Staff_sym_register::process_requests() { - announce_element(Staff_elem_info(span_p_, 0)); + announce_element(Score_elem_info(span_p_, 0)); } void diff --git a/lily/stem.cc b/lily/stem.cc index 7fb36e3005..7c57aa80e6 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -203,7 +203,7 @@ Stem::brew_molecule_p()const { Molecule *out =0; if ( invisible_b() ) - return Staff_elem::brew_molecule_p(); + return Score_elem::brew_molecule_p(); Real bot = stem_bottom_f_; Real top = stem_top_f_; diff --git a/lily/text-reg.cc b/lily/text-reg.cc index a3231cec41..afbf035d22 100644 --- a/lily/text-reg.cc +++ b/lily/text-reg.cc @@ -29,7 +29,7 @@ Text_register::try_request(Request*req_l) return true; } void -Text_register::acknowledge_element(Staff_elem_info i) +Text_register::acknowledge_element(Score_elem_info i) { if (text_p_ && i.elem_l_->name() == Note_column::static_name()) { text_p_->add_support(i.elem_l_); @@ -40,7 +40,7 @@ Text_register::process_requests() { if (text_req_l_) { text_p_ = new Text_item(text_req_l_->tdef_p_, text_req_l_->dir_i_); // ugh - announce_element(Staff_elem_info(text_p_, text_req_l_)); + announce_element(Score_elem_info(text_p_, text_req_l_)); } } void diff --git a/lily/voice-regs.cc b/lily/voice-regs.cc index 7545442c6e..77fd724552 100644 --- a/lily/voice-regs.cc +++ b/lily/voice-regs.cc @@ -25,7 +25,7 @@ Voice_registers::Voice_registers(Voice *v_p, Input_register const*ireg_C) } void -Voice_registers::acknowledge_element(Staff_elem_info i) +Voice_registers::acknowledge_element(Score_elem_info i) { if (i.voice_l_ != voice_l_) return; diff --git a/lily/walk-regs.cc b/lily/walk-regs.cc index da852c79ac..404500dcee 100644 --- a/lily/walk-regs.cc +++ b/lily/walk-regs.cc @@ -28,7 +28,7 @@ Walker_registers::Walker_registers(Complex_walker *w) } void -Walker_registers::announce_element(Staff_elem_info info) +Walker_registers::announce_element(Score_elem_info info) { if (info.elem_l_->name() == Bar::static_name()) { walk_l_->allow_break(); @@ -37,7 +37,7 @@ Walker_registers::announce_element(Staff_elem_info info) } void -Walker_registers::acknowledge_element(Staff_elem_info ) +Walker_registers::acknowledge_element(Score_elem_info ) { assert(false); } @@ -47,7 +47,7 @@ Walker_registers::do_announces() { Request dummy_req; for (int i = 0; i < announce_info_arr_.size(); i++){ - Staff_elem_info info = announce_info_arr_[i]; + Score_elem_info info = announce_info_arr_[i]; mtor << "Announcing " << info.elem_l_->name()<<"\n"; if (!info.req_l_) @@ -58,13 +58,13 @@ Walker_registers::do_announces() } void -Walker_registers::typeset_element(Staff_elem *elem_p) +Walker_registers::typeset_element(Score_elem *elem_p) { typeset_musical_item(elem_p); } void -Walker_registers::typeset_musical_item(Staff_elem * elem_p) +Walker_registers::typeset_musical_item(Score_elem * elem_p) { walk_l_->typeset_element(elem_p); } -- 2.39.5