source file of the GNU LilyPond music typesetter
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
protected:
virtual void do_pre_processing();
virtual void do_print () const;
- virtual void do_substitute_dependency (Score_elem*,Score_elem*);
+ virtual void do_substitute_dependency (Score_element*,Score_element*);
public:
/** The relative position of the "voice" containing this
chord. Normally this would be the same as the stem direction,
DECLARE_MY_RUNTIME_TYPEINFO;
Note_column ();
- void set (Stem*);
- void set (Dot_column*);
- void add (Rhythmic_head*);
+ void set_stem (Stem*);
+ void set_dotcol (Dot_column*);
+ void add_head (Rhythmic_head*);
bool rest_b () const;
- virtual void add (Script*s);
+ virtual void add_script (Script*s);
void sort ();
};
--- /dev/null
+/*
+ span-bar-engraver.hh -- declare Span_bar_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef SPAN_BAR_GRAV_HH
+#define SPAN_BAR_GRAV_HH
+
+#include "engraver.hh"
+
+/**
+
+ Make bars that span multiple "staffs". Catch bars, and span a
+ Span_bar over them if we find more than 2 bars
+
+ */
+class Span_bar_engraver : public Engraver
+{
+ Span_bar * spanbar_p_;
+ Array<Bar*> bar_l_arr_;
+ Vertical_align_spanner * valign_l_;
+public:
+ TRANSLATOR_CLONE(Span_bar_engraver);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+ Span_bar_engraver();
+protected:
+ virtual void do_creation_processing ();
+ virtual void do_removal_processing ();
+ virtual void acknowledge_element (Score_element_info);
+ virtual void do_pre_move_processing();
+ virtual Span_bar* get_span_bar_p() const;
+};
+
+#endif // SPAN_BAR_GRAV_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
class Span_bar : public virtual Bar
{
- Link_array<Score_elem> spanning_l_arr_;
+ Link_array<Score_element> spanning_l_arr_;
public:
Span_bar();
DECLARE_MY_RUNTIME_TYPEINFO;
- SCORE_ELEM_CLONE(Span_bar);
- void add (Bar*);
- void set (Vertical_align_element *);
+ SCORE_ELEMENT_CLONE(Span_bar);
+ virtual Span_bar* access_Span_bar ();
+ void add_bar (Bar*);
+ void set_align (Align_element *);
protected:
+ void evaluate_empty ();
virtual Interval do_width() const;
virtual void do_pre_processing();
+ virtual void do_post_processing();
- virtual void do_substitute_dependency (Score_elem*,Score_elem*);
+ virtual void do_substitute_dependency (Score_element*,Score_element*);
virtual Molecule * brew_molecule_p() const;
virtual Atom get_bar_sym (Real dy) const;
};
source file of the GNU LilyPond music typesetter
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dot-column.hh"
#include "note-column.hh"
void
-Note_column::set (Stem * stem_l)
+Note_column::set_stem (Stem * stem_l)
{
add_support (stem_l);
stem_l_ = stem_l;
/*
don't add stem to support; mostly invisible for rest-columns (and possibly taken . .)
*/
- Score_elem::add_dependency (stem_l);
+ Score_element::add_dependency (stem_l);
for (int i=0; i < script_l_arr_.size(); i++)
script_l_arr_[i]->set_stem (stem_l);
}
void
-Note_column::add (Script *script_l)
+Note_column::add_script (Script *script_l)
{
- Script_column::add (script_l) ;
+ Script_column::add_script (script_l) ;
if (stem_l_)
script_l->set_stem (stem_l_);
}
void
-Note_column::do_substitute_dependency (Score_elem*o, Score_elem*n)
+Note_column::do_substitute_dependency (Score_element*o, Score_element*n)
{
if (stem_l_ == o)
{
- stem_l_ = n ? (Stem*)n->item():0;
+ stem_l_ = n ? (Stem*)n->access_Item ():0;
}
if (o->is_type_b (Note_head::static_name ()))
{
- head_l_arr_.substitute ((Note_head*)o->item(),
- (n)? (Note_head*)n->item() : 0);
+ head_l_arr_.substitute ((Note_head*)o->access_Item (),
+ (n)? (Note_head*)n->access_Item () : 0);
}
Script_column::do_substitute_dependency (o,n);
if (o->is_type_b (Rest::static_name ()))
{
- rest_l_arr_.substitute ((Rest*)o->item(),
- (n)? (Rest*)n->item() : 0);
+ rest_l_arr_.substitute ((Rest*)o->access_Item (),
+ (n)? (Rest*)n->access_Item () : 0);
}
}
void
-Note_column::add (Rhythmic_head *h)
+Note_column::add_head (Rhythmic_head *h)
{
if (h->is_type_b (Rest::static_name ()))
{
}
void
-Note_column::set (Dot_column *d)
+Note_column::set_dotcol (Dot_column *d)
{
add_element (d);
}
--- /dev/null
+/*
+ rhythmic-column-grav.cc -- implement Rhythmic_column_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "rhythmic-column-engraver.hh"
+#include "note-head.hh"
+#include "stem.hh"
+#include "note-column.hh"
+#include "script.hh"
+#include "dot-column.hh"
+
+Rhythmic_column_engraver::Rhythmic_column_engraver()
+{
+ stem_l_ =0;
+ ncol_p_=0;
+ dotcol_l_ =0;
+}
+
+
+void
+Rhythmic_column_engraver::process_acknowledged ()
+{
+ if (rhead_l_arr_.size ())
+ {
+ if (!ncol_p_)
+ {
+ ncol_p_ = new Note_column;
+ announce_element (Score_element_info (ncol_p_, 0));
+ }
+
+ for (int i=0; i < rhead_l_arr_.size (); i++)
+ {
+ ncol_p_->add_head (rhead_l_arr_[i]);
+ }
+ rhead_l_arr_.set_size (0);
+ }
+
+
+ if (ncol_p_)
+ {
+ if (dotcol_l_)
+ {
+ ncol_p_->set_dotcol (dotcol_l_);
+ }
+
+ if (stem_l_)
+ {
+ ncol_p_->set_stem (stem_l_);
+ stem_l_ = 0;
+ }
+
+ for (int i=0; i < script_l_arr_.size(); i++)
+ {
+ if (ncol_p_)
+ ncol_p_->add_script (script_l_arr_[i]);
+ }
+
+ script_l_arr_.clear();
+ }
+}
+
+void
+Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
+{
+ Item * item = i.elem_l_->access_Item ();
+ if (!item)
+ return;
+ if (item->is_type_b (Script::static_name ())
+ && i.req_l_
+ && i.req_l_->access_Musical_req ())
+ {
+ script_l_arr_.push ((Script*)item);
+ }
+ else if (item->is_type_b (Stem::static_name()))
+ {
+ stem_l_ = (Stem*) item;
+ }
+ else if (item->is_type_b (Rhythmic_head::static_name ()))
+ {
+ rhead_l_arr_.push ((Rhythmic_head*)item);
+ }
+ else if (item->is_type_b (Dot_column::static_name ()))
+ {
+ dotcol_l_ = (Dot_column*) item;
+ }
+}
+
+void
+Rhythmic_column_engraver::do_pre_move_processing()
+{
+ if (ncol_p_)
+ {
+ if (! ncol_p_->h_shift_b_)
+ // egcs
+ ncol_p_->h_shift_b_ = get_property ("hshift").operator bool ();
+ if (! ncol_p_->dir_)
+ ncol_p_->dir_ =(Direction) int(get_property ("ydirection"));
+
+ typeset_element (ncol_p_);
+ ncol_p_ =0;
+ }
+}
+
+void
+Rhythmic_column_engraver::do_post_move_processing()
+{
+ script_l_arr_.clear();
+ dotcol_l_ =0;
+ stem_l_ =0;
+}
+
+
+
+
+IMPLEMENT_IS_TYPE_B1(Rhythmic_column_engraver,Engraver);
+ADD_THIS_TRANSLATOR(Rhythmic_column_engraver);
--- /dev/null
+/*
+ span-bar-grav.cc -- implement Span_bar_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "span-bar.hh"
+#include "span-bar-engraver.hh"
+#include "vertical-align-spanner.hh"
+
+Span_bar_engraver::Span_bar_engraver()
+{
+ spanbar_p_ =0;
+ valign_l_ =0;
+}
+
+Span_bar*
+Span_bar_engraver::get_span_bar_p() const
+{
+ return new Span_bar;
+}
+
+
+void
+Span_bar_engraver::do_creation_processing ()
+{
+}
+
+void
+Span_bar_engraver::do_removal_processing ()
+{
+}
+
+void
+Span_bar_engraver::acknowledge_element (Score_element_info i)
+{
+ int depth = i.origin_grav_l_arr_.size();
+ if (depth > 1
+ && i.elem_l_->is_type_b (Bar::static_name()))
+ {
+ bar_l_arr_.push ((Bar*)i.elem_l_->access_Item ());
+
+ if (bar_l_arr_.size() >= 2 && !spanbar_p_)
+ /*
+ hmm, i do want a bracket with one staff some times, but not always
+ if (bar_l_arr_.size() >= 1 && !spanbar_p_)
+
+ --jcn
+ */
+
+ /*
+
+ use a property? get_property ("singleStaffBracket") ?
+
+ --hwn
+ */
+ {
+ spanbar_p_ = get_span_bar_p();
+ announce_element (Score_element_info (spanbar_p_,0));
+ spanbar_p_-> type_str_ = bar_l_arr_[0]->type_str_;
+ }
+ }
+ else if (i.elem_l_->is_type_b (Vertical_align_spanner::static_name())
+ && i.origin_grav_l_arr_.size() <= 2)
+ {
+ valign_l_ = (Vertical_align_spanner*)i.elem_l_->access_Spanner ();
+ }
+}
+
+void
+Span_bar_engraver::do_pre_move_processing()
+{
+ if (spanbar_p_)
+ {
+ for (int i=0; i < bar_l_arr_.size() ; i++)
+ spanbar_p_->add_bar (bar_l_arr_[i]);
+ spanbar_p_->set_align (valign_l_);
+ typeset_element (spanbar_p_);
+ spanbar_p_ =0;
+ }
+ bar_l_arr_.set_size (0);
+}
+
+
+IMPLEMENT_IS_TYPE_B1(Span_bar_engraver,Engraver);
+ADD_THIS_TRANSLATOR(Span_bar_engraver);
source file of the GNU LilyPond music typesetter
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "vertical-align-spanner.hh"
-IMPLEMENT_IS_TYPE_B2(Vertical_align_spanner, Vertical_align_element, Spanner);
+IMPLEMENT_IS_TYPE_B2(Vertical_align_spanner, Align_element, Spanner);
+
+Vertical_align_spanner::Vertical_align_spanner ()
+{
+ axis_ = Y_AXIS;
+}
+
+void
+Vertical_align_spanner::do_print ()const
+{
+ Align_element::do_print () ;
+}