From: fred Date: Sun, 24 Mar 2002 19:56:03 +0000 (+0000) Subject: lilypond-0.1.11 X-Git-Tag: release/1.5.59~3986 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2abeddcb89f40e42a5ea1525f1878fc1db17d836;p=lilypond.git lilypond-0.1.11 --- diff --git a/lib/mapped-file-storage.cc b/lib/mapped-file-storage.cc new file mode 100644 index 0000000000..2267164ae7 --- /dev/null +++ b/lib/mapped-file-storage.cc @@ -0,0 +1,101 @@ +/* + file-storage.cc -- implement Mapped_file_storage + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys + Jan Nieuwenhuizen +*/ +#include // open, mmap +#include // open +#include // mmap +#include // INT_MAX +#include // open +#include // close, stat +#include // fdopen +#include // strerror +#include // errno + + + +#include "string.hh" +#include "proto.hh" +#include "warn.hh" +#include "file-storage.hh" + +Mapped_file_storage::Mapped_file_storage(String s) +{ + data_caddr_ = 0; + fildes_i_ = 0; + size_off_ = 0; + open(s); +} + +char const* +Mapped_file_storage::ch_C() const +{ + return (char const*)data_caddr_; +} + +void +Mapped_file_storage::map() +{ + if (fildes_i_ == -1) + return; + + data_caddr_ = (caddr_t)mmap((void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0); + + if ((int)data_caddr_ == -1) + warning(String("can't map: error no: ") + strerror(errno)); +} + + +void +Mapped_file_storage::open(String name_str) +{ + fildes_i_ = ::open(name_str, O_RDONLY); + + if (fildes_i_ == -1) + { + warning(String("can't open: ") + name_str + String(": ") + strerror(errno)); + return; + } + + struct stat file_stat; + fstat(fildes_i_, &file_stat); + size_off_ = file_stat.st_size; + map(); +} + +void +Mapped_file_storage::unmap() +{ + if (data_caddr_) + { + munmap(data_caddr_, size_off_); + data_caddr_ = 0; + size_off_ = 0; + } +} + +void +Mapped_file_storage::close() +{ + unmap(); + if (fildes_i_) + { + ::close(fildes_i_); + fildes_i_ = 0; + } +} + +int +Mapped_file_storage::length_i() const +{ + return size_off_; +} + +Mapped_file_storage::~Mapped_file_storage() +{ + close(); +} diff --git a/lib/simple-file-storage.cc b/lib/simple-file-storage.cc index d66c2c2d9b..ed1784ba63 100644 --- a/lib/simple-file-storage.cc +++ b/lib/simple-file-storage.cc @@ -17,48 +17,57 @@ Stupid but foolproof way of opening files. TODO - Should use obstack. Should check IO status + Should check IO status This is of course a build it yourself version of mmap, so we should have been using that... (see Mapped_file_storage) But we noticed some problems with this (unexplained lexer crashes) - */ + [Some versions later] The crashes aren't caused by the mmap + code. But no reason to take it out, is there? */ Simple_file_storage::Simple_file_storage(String s) { - data_p_ =0; - FILE * f = fopen ( s.ch_C(), "r"); - if ( !f ) - { - warning("can't open file\n"); - return ; - } + data_p_ =0; + /* + let's hope that "b" opens anything binary, and does not apply + CR/LF translation + */ + FILE * f = fopen (s.ch_C(), "rb"); + if (!f) + { + warning("can't open file\n"); + return ; + } - int ret = fseek( f, 0, SEEK_END); - len_i_ = ftell(f); - rewind(f); - data_p_ = new char[len_i_+1]; - data_p_[len_i_] = 0; - ret = fread(data_p_, sizeof(char), len_i_, f); - assert (ret==len_i_); - fclose(f); + int ret = fseek(f, 0, SEEK_END); + len_i_ = ftell(f); + rewind(f); + data_p_ = new char[len_i_+1]; + data_p_[len_i_] = 0; + ret = fread(data_p_, sizeof(char), len_i_, f); + + +#if 1 // ugh, \r\n -> \n translation + assert (ret==len_i_); +#endif + fclose(f); } char const* Simple_file_storage::ch_C() const { - return data_p_; + return data_p_; } int -Simple_file_storage::length_i()const +Simple_file_storage::length_i() const { - return len_i_; + return len_i_; } Simple_file_storage::~Simple_file_storage() { - delete []data_p_; + delete []data_p_; } diff --git a/lily/VERSION b/lily/VERSION index 7b9611af00..7ce3b25fba 100644 --- a/lily/VERSION +++ b/lily/VERSION @@ -1,6 +1,6 @@ MAJOR_VERSION = 0 MINOR_VERSION = 1 -PATCH_LEVEL = 9 +PATCH_LEVEL = 11 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/lily/bow.cc b/lily/bow.cc index 1ef733c61a..1bd0a00762 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -13,15 +13,15 @@ Bow::Bow() { - left_pos_i_ = right_pos_i_ = 0; - left_dx_f_ = right_dx_f_ = 0.0; + pos_i_drul_[LEFT] = pos_i_drul_[RIGHT] = 0; + dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0; } Offset Bow::center() const { - int dy = right_pos_i_-left_pos_i_; + int dy = pos_i_drul_[RIGHT]-pos_i_drul_[LEFT]; Real w = width().length (); @@ -35,22 +35,22 @@ Bow::brew_molecule_p() const Molecule*output = new Molecule; Real w = width().length (); - int dy = right_pos_i_ - left_pos_i_; + int dy = pos_i_drul_[RIGHT] - pos_i_drul_[LEFT]; Real nw_f = paper()->note_width (); Real nh_f = paper()->internote_f (); - w+= (right_dx_f_ - left_dx_f_) * nw_f ; + w+= (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]) * nw_f ; Real round_w = w; // slur lookup rounds the slurwidth . - Symbol sl = paper()->lookup_l ()->slur (dy , round_w, dir_i_); + Symbol sl = paper()->lookup_l ()->slur (dy , round_w, dir_); Real error = w-round_w; Atom a (sl); - a.translate (Offset ((left_dx_f_ + 0.5)*nw_f + error/2, - left_pos_i_ * nh_f)); + a.translate (Offset ((dx_f_drul_[LEFT] + 0.5)*nw_f + error/2, + pos_i_drul_[LEFT] * nh_f)); output->add (a); return output; } diff --git a/lily/collision.cc b/lily/collision.cc index a5fd6aee0b..881c561e95 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -30,7 +30,7 @@ int idx (int dir, bool h_shift_b) { assert (abs (dir) == 1); int j = dir > 0 ? 0 : 3; - if ( h_shift_b) + if (h_shift_b) j += dir; return j; } @@ -57,12 +57,12 @@ Collision::do_pre_processing() for (int i=0; i < clash_l_arr_.size(); i++) { Note_column* c_l = clash_l_arr_[i]; - if (! c_l->dir_i_) + if (! c_l->dir_) { warning ("No stem direction set. Ignoring column in clash. "); continue; } - int d = (c_l->dir_i_); + int d = (c_l->dir_); clash_group_arr_a[idx (d, c_l->h_shift_b_)].push (c_l); } diff --git a/lily/include/beam-grav.hh b/lily/include/beam-grav.hh new file mode 100644 index 0000000000..3db08fc073 --- /dev/null +++ b/lily/include/beam-grav.hh @@ -0,0 +1,36 @@ +/* + beam-grav.hh -- declare Beam_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef BEAM_GRAV_HH +#define BEAM_GRAV_HH + +#include "engraver.hh" +#include "drul-array.hh" + +/** + Generate a beam. Eats stems. + */ +class Beam_engraver : public Engraver +{ + Drul_array span_reqs_drul_; + Beam *beam_p_; + Rhythmic_grouping *current_grouping_p_; + +public: + DECLARE_MY_RUNTIME_TYPEINFO; + Beam_engraver(); +protected: + virtual void do_removal_processing(); + virtual void do_process_requests(); + virtual bool do_try_request (Request*); + virtual void acknowledge_element (Score_elem_info); + virtual void do_pre_move_processing(); +}; + +#endif // BEAM_GRAV_HH diff --git a/lily/include/crescendo.hh b/lily/include/crescendo.hh index 4539ac209c..99e0e287cc 100644 --- a/lily/include/crescendo.hh +++ b/lily/include/crescendo.hh @@ -17,23 +17,20 @@ */ class Crescendo : public Spanner , public Staff_side { public: - int grow_dir_i_; + int grow_dir_; -/// if there is a dynamic at the end, make the sign smaller. - bool right_dyn_b_; + /// if there is a dynamic at the end, make the sign smaller. + Drul_array dyn_b_drul_; - /// if there is a dynamic at the end, make the sign smaller. - bool left_dyn_b_; - Crescendo(); + Crescendo(); protected: - SCORE_ELEM_CLONE(Crescendo); - virtual Molecule*brew_molecule_p()const; - virtual Interval symbol_height()const; - DECLARE_MY_RUNTIME_TYPEINFO; + SCORE_ELEM_CLONE(Crescendo); + virtual Molecule*brew_molecule_p() const; + virtual Interval symbol_height() const; + DECLARE_MY_RUNTIME_TYPEINFO; private: - Symbol get_symbol()const; - + Symbol get_symbol() const; }; #endif // CRESCENDO_HH diff --git a/lily/include/directional-spanner.hh b/lily/include/directional-spanner.hh index abff328b59..7854a348ce 100644 --- a/lily/include/directional-spanner.hh +++ b/lily/include/directional-spanner.hh @@ -14,7 +14,7 @@ class Directional_spanner : public Spanner{ public: /// -1 below heads, +1 above heads. - int dir_i_; + Direction dir_; Directional_spanner(); /// offset of "center" relative to left-column/0-pos of staff diff --git a/lily/include/dynamic-grav.hh b/lily/include/dynamic-grav.hh index 26556edf9d..bf71902245 100644 --- a/lily/include/dynamic-grav.hh +++ b/lily/include/dynamic-grav.hh @@ -13,7 +13,7 @@ #include "engraver.hh" class Dynamic_engraver : public Engraver { - int dir_i_; + Direction dir_; Text_item * dynamic_p_; Crescendo * to_end_cresc_p_; Crescendo * cresc_p_; diff --git a/lily/include/head-column.hh b/lily/include/head-column.hh index 57c560b18b..ab38222b1a 100644 --- a/lily/include/head-column.hh +++ b/lily/include/head-column.hh @@ -18,27 +18,27 @@ class Head_column : public Script_column { public: - Link_array head_l_arr_; - /** The relative position of the "voice" containing this - chord. Normally this would be the same as the stem direction, - but rests do not have stems. - - Hmm. outdated.. Rests *do* have stems. - */ - - int dir_i_; - Stem* stem_l_; - - void add (Note_head*); - virtual void add (Script*s); - virtual void set (Stem*); - Head_column(); - DECLARE_MY_RUNTIME_TYPEINFO; + Link_array head_l_arr_; + /** The relative position of the "voice" containing this + chord. Normally this would be the same as the stem direction, + but rests do not have stems. + + Hmm. outdated.. Rests *do* have stems. + */ + + Direction dir_; + Stem* stem_l_; + + void add (Note_head*); + virtual void add (Script*s); + void set (Stem*); + Head_column(); + DECLARE_MY_RUNTIME_TYPEINFO; protected: - virtual void do_pre_processing(); - virtual void do_print()const; - virtual void do_substitute_dependency (Score_elem*,Score_elem*); + virtual void do_pre_processing(); + virtual void do_print() const; + virtual void do_substitute_dependency (Score_elem*,Score_elem*); }; #endif // HEAD_COLUMN_HH diff --git a/lily/include/horizontal-group-item.hh b/lily/include/horizontal-group-item.hh index b9045a4bdb..35918c9570 100644 --- a/lily/include/horizontal-group-item.hh +++ b/lily/include/horizontal-group-item.hh @@ -13,17 +13,24 @@ #include "elem-group.hh" #include "axis-group-item.hh" +/** + Group stuff in horizontal sense. Example: Paper_column + */ class Horizontal_group_item : public Axis_group_item, public Horizontal_group_element { protected: - virtual void remove_all() { Horizontal_group_element::remove_all (); } - virtual void do_print() const; + virtual void remove_all() { Horizontal_group_element::remove_all (); } + virtual void do_unlink () { + Axis_group_item::do_unlink (); + } + virtual void do_junk_links() { + Axis_group_item::do_junk_links(); + } + virtual void do_print() const; public: - virtual void add_element (Score_elem*e) { Horizontal_group_element::add_element (e); } - virtual void remove_element (Score_elem*e) { Horizontal_group_element::remove_element (e); } - DECLARE_MY_RUNTIME_TYPEINFO; - SCORE_ELEM_CLONE(Horizontal_group_item); - - + virtual void add_element (Score_elem*e) { Horizontal_group_element::add_element (e); } + virtual void remove_element (Score_elem*e) { Horizontal_group_element::remove_element (e); } + DECLARE_MY_RUNTIME_TYPEINFO; + SCORE_ELEM_CLONE(Horizontal_group_item); }; #endif // HORIZONTAL_GROUP_ITEM_HH diff --git a/lily/include/note-column-grav.hh b/lily/include/note-column-grav.hh index 43784776f9..9c68248eb1 100644 --- a/lily/include/note-column-grav.hh +++ b/lily/include/note-column-grav.hh @@ -21,10 +21,10 @@ class Note_column_engraver :public Engraver { Note_column *ncol_p_; Rest_column *restcol_p_; bool h_shift_b_; - int dir_i_; + Direction dir_; - bool acceptable_elem_b (Score_elem const*)const; + bool acceptable_elem_b (Score_elem const*) const; protected: virtual void set_feature (Feature); virtual void acknowledge_element (Score_elem_info); diff --git a/lily/include/request.hh b/lily/include/request.hh index 3dc1eb9ba2..e93f493176 100644 --- a/lily/include/request.hh +++ b/lily/include/request.hh @@ -15,6 +15,7 @@ #include "virtual-methods.hh" #include "input.hh" #include "music.hh" +#include "direction.hh" /** a voice element wants something printed. @@ -49,7 +50,7 @@ public: bool equal_b (Request*) const; protected: virtual bool do_equal_b (Request*) const; - virtual void do_print()const; + virtual void do_print() const; }; #define REQUESTMETHODS(T,accessor) \ @@ -65,11 +66,11 @@ virtual void do_print() const this also a request */ class Script_req : public virtual Request { public: - int dir_i_; + Direction dir_; General_script_def *scriptdef_p_; /* *************** */ - bool do_equal_b (Request*)const; + bool do_equal_b (Request*) const; Script_req(); REQUESTMETHODS(Script_req,script); diff --git a/lily/include/slur-grav.hh b/lily/include/slur-grav.hh index 35b2ca0df3..6662399cc7 100644 --- a/lily/include/slur-grav.hh +++ b/lily/include/slur-grav.hh @@ -15,7 +15,7 @@ class Slur_engraver :public Engraver { Array new_slur_req_l_arr_; Array slur_l_stack_; Array end_slur_l_arr_; - int dir_i_; + Direction dir_; /* *************** */ protected: virtual ~Slur_engraver(); diff --git a/lily/include/stem-grav.hh b/lily/include/stem-grav.hh new file mode 100644 index 0000000000..c5807f70be --- /dev/null +++ b/lily/include/stem-grav.hh @@ -0,0 +1,33 @@ +/* + stem-grav.hh -- declare Stem_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef STEM_GRAV_HH +#define STEM_GRAV_HH + +#include "engraver.hh" + +/** + Make stems upon receiving noteheads. + */ +class Stem_engraver : public Engraver +{ + Direction dir_; + Stem *stem_p_; + Rhythmic_req *rhythmic_req_l_; +protected: + virtual void acknowledge_element (Score_elem_info); + virtual void do_pre_move_processing (); + virtual void set_feature (Feature dir_i_); + +public: + Stem_engraver(); + DECLARE_MY_RUNTIME_TYPEINFO; +}; + +#endif // STEM_GRAV_HH diff --git a/lily/include/text-grav.hh b/lily/include/text-grav.hh index 80540bae26..8bc0bb44a9 100644 --- a/lily/include/text-grav.hh +++ b/lily/include/text-grav.hh @@ -12,7 +12,7 @@ class Text_engraver : public Engraver{ Text_item * text_p_; Text_req * text_req_l_; - int dir_i_; + Direction dir_; /* *************** */ protected: virtual void set_feature (Feature); diff --git a/lily/include/tie-grav.hh b/lily/include/tie-grav.hh index 63f472e3d8..ecdfd4fea7 100644 --- a/lily/include/tie-grav.hh +++ b/lily/include/tie-grav.hh @@ -17,7 +17,7 @@ class Tie_engraver : public Engraver { Tie * tie_p_; Moment end_mom_; Tie_req * req_l_; - int dir_i_; + Direction dir_; Tie_req *end_req_l_; Melodic_req * end_melodic_req_l_; Melodic_req * melodic_req_l_; diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 17088c668f..bfcf734e30 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -14,25 +14,29 @@ #include "lily-proto.hh" #include "virtual-methods.hh" +/** Make some kind of #Element#s from Requests. Elements are made by + hierarchically grouped #Translator#s + */ class Translator { public: - String id_str_; + String id_str_; - int iterator_count_; + int iterator_count_; - virtual Global_translator *global_l() { return 0; } - - /// Score_register = 0, Staff_registers = 1, etc) - virtual void print()const; - virtual int depth_i()const=0; - virtual bool is_bottom_engraver_b() const { return false; } - virtual bool try_request (Request*); - virtual Translator *find_get_translator_l (String name, String id)=0; - virtual Translator *ancestor_l (int l=1)=0; - virtual ~Translator(){} - DECLARE_MY_RUNTIME_TYPEINFO; - Translator(); - virtual Translator *get_default_interpreter()=0; + virtual Global_translator *global_l() { return 0; } + + virtual void print() const; + + /// Score_register = 0, Staff_registers = 1, etc) + virtual int depth_i() const=0; + virtual bool is_bottom_engraver_b() const { return false; } + virtual bool try_request (Request*); + virtual Translator *find_get_translator_l (String name, String id)=0; + virtual Translator *ancestor_l (int l=1)=0; + virtual ~Translator(){} + DECLARE_MY_RUNTIME_TYPEINFO; + Translator(); + virtual Translator *get_default_interpreter()=0; }; #endif // TRANSLATOR_HH diff --git a/lily/include/voice-group-gravs.hh b/lily/include/voice-group-gravs.hh index 38f57d574d..e6b9a3de84 100644 --- a/lily/include/voice-group-gravs.hh +++ b/lily/include/voice-group-gravs.hh @@ -17,7 +17,7 @@ */ class Voice_group_engravers : public Engraver_group_engraver { Moment termination_mom_; - int dir_i_; + Direction dir_; protected: virtual void do_print() const; diff --git a/lily/note.cc b/lily/note.cc index ec84dbba52..6bb466a5af 100644 --- a/lily/note.cc +++ b/lily/note.cc @@ -49,7 +49,7 @@ Request* get_script_req (int d , General_script_def*def) { Musical_script_req* script_req_p = new Musical_script_req; - script_req_p->dir_i_ =d; + script_req_p->dir_ =d; script_req_p->scriptdef_p_=def; return script_req_p; } diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index d5b4217f7e..3e66ec7513 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -56,13 +56,13 @@ Rest_collision::do_post_processing() if (!(stem_l->beams_left_i_ || stem_l->beams_right_i_)) return; - int dir_i = rest_l_arr_[0]->dir_i_; + int dir_i = rest_l_arr_[0]->dir_; int midpos = 4; #if 1 // ugh int stem_length_i = 7 - 2; // ugh, Stem::stem_start vs Stem::stem_end - int pos = (stem_l->stem_end_f() - midpos) - dir_i * stem_length_i; + int pos = (int)(stem_l->stem_end_f() - midpos) - dir_i * stem_length_i; #else // nogo: stem_start not set for rests? int pos = (stem_l->stem_start_f() - midpos) + dir_i * 2; #endif @@ -92,9 +92,9 @@ Rest_collision::do_pre_processing() { int dy = rest_l_arr_.size() > 2 ? 6 : 4; - rest_l_arr_[0]->translate_heads (rest_l_arr_[0]->dir_i_ *dy); + rest_l_arr_[0]->translate_heads (rest_l_arr_[0]->dir_ *dy); // top is last element... - rest_l_arr_.top()->translate_heads (rest_l_arr_.top ()->dir_i_* dy); + rest_l_arr_.top()->translate_heads (rest_l_arr_.top ()->dir_* dy); } // meisjes met jongetjes else @@ -104,8 +104,8 @@ Rest_collision::do_pre_processing() int dir_i = -1; rest_l_arr_[0]->translate_heads (dir_i * 3); #else - // int dir_i = - ncol_l_arr_[0]->dir_i_; - int dir_i = rest_l_arr_[0]->dir_i_; + // int dir_i = - ncol_l_arr_[0]->dir_; + int dir_i = rest_l_arr_[0]->dir_; // hope it's 4: if it works->doco int midpos = 4; @@ -121,7 +121,7 @@ Rest_collision::do_pre_processing() { // how to know whether to sort? ncol_l_arr_[i]->sort(); - for ( int j = 0; j < ncol_l_arr_[i]->head_l_arr_.size(); j++) + for (int j = 0; j < ncol_l_arr_[i]->head_l_arr_.size(); j++) minpos = minpos >? dir_i * (ncol_l_arr_[i]->head_l_arr_[j]->position_i_ -midpos) + sep_i; } diff --git a/lily/script-column.cc b/lily/script-column.cc index 836541ce16..6f9359aef7 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -26,7 +26,7 @@ Script_column::add (Script*s_l) void -Script_column::do_print()const +Script_column::do_print() const { #ifndef NPRINT DOUT << "scripts: " << script_l_arr_.size() << '\n'; @@ -37,8 +37,8 @@ static int idx (bool inside, int dir) { int j = (dir+1); - if ( !inside) - j ++; + if (!inside) + j ++; return j; } @@ -46,49 +46,49 @@ void Script_column::do_pre_processing() { if (!script_l_arr_.size()) - return; + return; /* up+inside, up+outside, down+inside, down+outside */ Array placed_l_arr_a[4]; for (int i=0; i < script_l_arr_.size(); i++) { - Script*s_l = script_l_arr_[i]; - placed_l_arr_a[idx (s_l->inside_staff_b_ , s_l->dir_i_) ].push (s_l); + Script*s_l = script_l_arr_[i]; + placed_l_arr_a[idx (s_l->inside_staff_b_ , s_l->dir_) ].push (s_l); } for (int j =0; j <4; j++) { - placed_l_arr_a[j].sort (Script::compare); + placed_l_arr_a[j].sort (Script::compare); } for (int j =0; j < 4; j++) { - if (placed_l_arr_a[j].size()) - for (int i=0; i < support_l_arr_.size(); i++) - placed_l_arr_a[j][0]->add_support (support_l_arr_[i]); + if (placed_l_arr_a[j].size()) + for (int i=0; i < support_l_arr_.size(); i++) + placed_l_arr_a[j][0]->add_support (support_l_arr_[i]); } Item * support_l=0; int j = 0; for (; j < 2; j++) { - for (int i=0; i < placed_l_arr_a[j].size(); i++) - { - if (support_l) - placed_l_arr_a[j][i]->add_support (support_l); - support_l = placed_l_arr_a[j][i]; - } + for (int i=0; i < placed_l_arr_a[j].size(); i++) + { + if (support_l) + placed_l_arr_a[j][i]->add_support (support_l); + support_l = placed_l_arr_a[j][i]; + } } support_l = 0; for (; j < 4; j++) { - for (int i=0; i < placed_l_arr_a[j].size(); i++) - { - if (support_l) - placed_l_arr_a[j][i]->add_support (support_l); - support_l = placed_l_arr_a[j][i]; - } + for (int i=0; i < placed_l_arr_a[j].size(); i++) + { + if (support_l) + placed_l_arr_a[j][i]->add_support (support_l); + support_l = placed_l_arr_a[j][i]; + } } } @@ -106,7 +106,7 @@ Script_column::do_substitute_dependency (Score_elem*o,Score_elem*n) { if (o->item()) { - script_l_arr_.substitute ((Script*)o->item(),(Script*) (n?n->item ():0)); - support_l_arr_.substitute (o->item(), (n?n->item ():0)); + script_l_arr_.substitute ((Script*)o->item(),(Script*) (n?n->item ():0)); + support_l_arr_.substitute (o->item(), (n?n->item ():0)); } } diff --git a/lily/script-grav.cc b/lily/script-grav.cc index f66b2eb3b1..c9c1585612 100644 --- a/lily/script-grav.cc +++ b/lily/script-grav.cc @@ -19,12 +19,12 @@ bool Script_engraver::do_try_request (Request *r_l) { if (!r_l->musical() || ! r_l->musical ()->musicalscript ()) - return false ; + return false ; for (int i=0; i < script_req_l_arr_.size(); i++) { - if ( r_l->equal_b (script_req_l_arr_[i])) - return true; + if (r_l->equal_b (script_req_l_arr_[i])) + return true; } script_req_l_arr_.push (r_l->script()); @@ -37,12 +37,12 @@ Script_engraver::do_process_requests() { for (int i=0; i < script_req_l_arr_.size(); i++) { - Script_req* l=script_req_l_arr_[i]; - Script *p =new Script; - p->dir_i_ = l->dir_i_; - p->specs_l_ = l->scriptdef_p_; - script_p_arr_.push (p); - announce_element (Score_elem_info (p, l)); + Script_req* l=script_req_l_arr_[i]; + Script *p =new Script; + p->dir_ = l->dir_; + p->specs_l_ = l->scriptdef_p_; + script_p_arr_.push (p); + announce_element (Score_elem_info (p, l)); } } @@ -52,9 +52,9 @@ Script_engraver::do_pre_move_processing() Staff_symbol* s_l = get_staff_info().staff_sym_l_; for (int i=0; i < script_p_arr_.size(); i++) { - Script*script_p = script_p_arr_[i]; - script_p->set_staffsym (s_l); - typeset_element (script_p); + Script*script_p = script_p_arr_[i]; + script_p->set_staffsym (s_l); + typeset_element (script_p); } script_p_arr_.clear(); }