--- /dev/null
+\score{
+ \type Staff \notes\relative c''{
+ \property Staff.instrument = "Toeters"
+ c c c c(\break
+ )c c c c ~\break
+ c c c c\break
+ }
+ \paper{
+ linewidth=60.0\mm;
+% \translator { \HaraKiriStaffContext }
+ \translator { \OrchestralScoreContext }
+ \translator {
+ \StaffContext
+ \consists "Staff_margin_engraver";
+ marginHangOnClef = 1;
+ }
+ }
+}
+
#include "bar-script-engraver.hh"
#include "bar.hh"
+#include "clef-item.hh"
#include "g-staff-side.hh"
#include "g-text-item.hh"
#include "lily-guile.hh"
axis_ = Y_AXIS;
staff_side_p_ = 0;
text_p_ =0;
+ hang_on_clef_b_ = false;
visibility_lambda_
= gh_eval_str ("non_postbreak_visibility");
}
void
-Bar_script_engraver::acknowledge_element (Score_element_info i)
+Bar_script_engraver::do_creation_processing ()
+{
+ Scalar prop = get_property (type_ + "HangOnClef", 0);
+ if (prop.to_bool ())
+ {
+ hang_on_clef_b_ = true;
+ }
+}
+
+void
+Bar_script_engraver::do_acknowledge_element (Item *i)
{
Axis other_axis = Axis((axis_ + 1)%2);
-
if (staff_side_p_ && !staff_side_p_->dim_cache_[other_axis].parent_l_)
{
- Bar * bar_l = dynamic_cast<Bar*> (i.elem_l_);
- if (!bar_l)
+ staff_side_p_->dim_cache_[other_axis].parent_l_
+ = &i->dim_cache_[other_axis];
+ staff_side_p_->dim_cache_[axis_].parent_l_
+ = &i->dim_cache_[axis_];
+
+ staff_side_p_->add_support (i);
+ i->add_dependency (staff_side_p_); // UGH.
+ }
+}
+
+
+Item*
+Bar_script_engraver::cast_to_interesting_item (Score_element *e)
+{
+ Item * i =0;
+ if (hang_on_clef_b_)
+ {
+ i = dynamic_cast<Clef_item*> (e);
+ }
+ else
+ {
+ i = dynamic_cast<Bar*> (e);
+ }
+ return i;
+}
+
+void
+Bar_script_engraver::acknowledge_element (Score_element_info inf)
+{
+ if (inf.origin_grav_l_arr_.size () == 1)
+ {
+ Item *i=cast_to_interesting_item (inf.elem_l_);
+ if (!i)
return;
-
+
/* Only put numbers on bars that are at our own level (don't put
numbers over the staffs of a GrandStaff, only over the GrandStaff
itself */
- if (i.origin_grav_l_arr_.size () == 1)
- {
- staff_side_p_->dim_cache_[other_axis].parent_l_ = &bar_l->dim_cache_[other_axis];
- // staff_side_p_->dim_cache_[axis_].parent_l_ = &bar_l->dim_cache_[axis_];
- staff_side_p_->add_support (i.elem_l_);
- bar_l->add_dependency (staff_side_p_); // UGH.
- }
+ if (inf.origin_grav_l_arr_.size () != 1)
+ return;
+
+ do_acknowledge_element (i);
}
}
return iv;
}
+#if 0
Interval
Bow::do_width () const
{
Real dx = i.length();
return Interval (0, dx);
}
+#endif
Array<Offset>
Bow::get_controls () const
return r;
}
+/*
+ what *should* these functions *do* anyway.
+ */
Real
Dimension_cache::relative_coordinate (Dimension_cache *d) const
{
Real r =0.0;
+ if (d == this) // UGH
+ return 0.0;
for (Dimension_cache* c = parent_l_;
c != d;
if (extender_spanner_p_)
{
span_reqs_drul_[LEFT]->warning (_ ("unterminated extender"));
- extender_spanner_p_->unlink ();
- delete extender_spanner_p_;
- extender_spanner_p_ = 0;
- span_reqs_drul_[RIGHT] = span_reqs_drul_[LEFT] = 0;
+ extender_spanner_p_->set_bounds(RIGHT, get_staff_info ().command_l ());
}
}
#include "protected-scm.hh"
/**
- put stuff over or next to bars
+ put stuff over or next to bars. Examples: bar numbers, marginal notes,
+ rehearsal marks.
*/
class Bar_script_engraver : public Engraver
{
Protected_scm visibility_lambda_;
String type_;
Axis axis_;
-
+ bool hang_on_clef_b_;
protected:
+ /**
+ Put the script on #it#
+ */
+ void do_acknowledge_element (Item *it);
+ /**
+ Return non-nil if we want to hang something on this.
+ */
+ Item *cast_to_interesting_item (Score_element*);
Bar_script_engraver ();
+ virtual void do_creation_processing ();
virtual void do_pre_move_processing ();
virtual void acknowledge_element (Score_element_info);
void create_items(Request*);
protected:
virtual Molecule* do_brew_molecule_p () const;
- virtual Interval do_width () const;
+ // virtual Interval do_width () const;
Array<Offset> get_controls () const;
virtual Array<Offset> get_encompass_offset_arr () const;
virtual Interval do_height () const;
/*
- cons.hh -- declare
+ cons.hh -- declare LISP like datatypes
source file of the GNU LilyPond music typesetter
#ifndef CONS_HH
#define CONS_HH
+#if 0
+template<class T, class U>
+class NCons
+{
+public:
+ T car_;
+ U cdr_;
+ NCons (T t, U u) : car_ (t), cdr_ (u) {}
+ virtual ~NCons () {}
+};
+
+template<class T>
+class Pointer_cons : public NCons<T, NCons*>
+{
+ Pointer_cons () : Cons<T, Cons*> (0,0){}
+ Pointer_cons (T t, Pointer_cons<T>*c)
+ : Cons<T, Cons*> (t,c)
+ {
+ car_ = t;
+ next_ = c;
+ }
+};
+#endif
+
template<class T>
class Cons
public:
T * car_;
Cons * next_;
- virtual ~Cons ();
Cons () {
car_=0;
next_ =0;
car_ = t;
next_ = c;
}
+ virtual ~Cons ()
+ {
+ delete next_;
+ }
};
template<class T>
virtual ~Killing_cons ();
};
+
+template<class T>
+class Cons_list
+{
+public:
+ Cons<T> * head_;
+ Cons<T> ** tail_;
+ Cons_list () { head_ =0; tail_ = &head_; }
+};
+
+
+template<class T>
+Cons_list<T> copy_killing_cons_list (Cons<T> *src);
+template<class T>
+Cons_list<T> clone_killing_cons_list (Cons<T> *src);
+
+
#endif /* CONS_HH */
#ifndef KILLING_CONS_TCC
#define KILLING_CONS_TCC
+
template<class T>
-Cons<T>::~Cons ()
+Killing_cons<T>::~Killing_cons ()
{
+ delete car_;
}
template<class T>
-Killing_cons<T>::~Killing_cons ()
+Cons_list<T>
+copy_killing_cons_list (Cons<T> *src)
{
- delete car_;
- delete next_;
+ Cons_list<T> kl;
+
+ for (; src; src = src->next_)
+ {
+ T *t = new T(*src->car_);
+ *kl.tail_ = new Killing_cons<T> (t, 0);
+ kl.tail_ = &(*kl.tail_)->next_;
+ }
+
+ return kl;
+}
+
+template<class T>
+Cons_list<T>
+clone_killing_cons_list (Cons<T> *src)
+{
+ Cons_list<T> kl;
+
+ for (; src; src = src->next_)
+ {
+ T *t = src->car_->clone ();
+ *kl.tail_ = new Killing_cons<T> (t, 0);
+ kl.tail_ = &(*kl.pp)->next_;
+ }
+
+ return kl;
}
#include "bar-script-engraver.hh"
-/**
+/**Print rehearsal marks.
*/
class Mark_engraver : public Bar_script_engraver
{
to the top, to the right, etc. */
class Molecule {
// Protected_scm atom_list_; // change to List<Atom>?
- Killing_cons<Atom> *atom_list_;
+ Cons<Atom> *atom_list_;
friend class Paper_outputter;
public:
Box dim_;
virtual void do_add_processing ();
virtual void do_pre_processing ();
virtual void do_substitute_dependency (Score_element*, Score_element*);
- virtual Interval do_width () const;
Array<Rod> get_rods () const;
};
public:
Tie ();
void set_head (Direction, Note_head*head_l);
-
-
VIRTUAL_COPY_CONS(Score_element);
bool same_pitch_b_;
virtual void do_post_processing ();
virtual void set_default_dir();
virtual void do_substitute_dependency (Score_element*,Score_element*);
- virtual Interval do_width () const;
- Array<Rod> get_rods () const;
+ virtual Array<Rod> get_rods () const;
Array<Offset> get_controls () const;
};
if (scope_p_)
p->output_scope (scope_p_, "mudelapaper");
+#if 0
if (output_global_ch == String("tex"))
{
*p->outstream_l_ << *scope_p_->elem ("texsetting")->access_content_String (false);
}
-
+#endif
+
+ *p->outstream_l_ << *scope_p_->elem (String (output_global_ch) + "setting")->access_content_String (false);
SCM scm = gh_list (ly_symbol ("experimental-on"), SCM_UNDEFINED);
p->output_scheme (scm);
Interval
Spanner::do_width() const
{
+
+
Real l = spanned_drul_[LEFT]->absolute_coordinate (X_AXIS);
Real r = spanned_drul_[RIGHT]->absolute_coordinate (X_AXIS);
}
-
/*
TODO
- fix alignment/support
should be able to set whole paragraph (multiple lines, centre) to
left (right?) of staff, e.g.:
|______________
*/
void
-Staff_margin_engraver::acknowledge_element (Score_element_info i)
+Staff_margin_engraver::acknowledge_element (Score_element_info inf)
{
- Bar * b =dynamic_cast<Bar *> (i.elem_l_);
- if (!b)
- return ;
-
- if (i.origin_grav_l_arr_.size() != 1)
+ Item *i = cast_to_interesting_item (inf.elem_l_);
+ if (!i || inf.origin_grav_l_arr_.size() != 1)
return;
create_items (0);
text_p_->text_str_ = long_str;
staff_side_p_->dir_ = LEFT;
- Bar_script_engraver::acknowledge_element(i);
+ Bar_script_engraver::do_acknowledge_element (i);
}
head_l_drul_[RIGHT] = new_l;
}
+#if 0
Interval
Tie::do_width () const
{
- Real min_f = paper ()->get_var ("tie_x_minimum");
+ Real min_f =
Interval width_int = Bow::do_width ();
return width_int.length () < min_f ? Interval (0, min_f) : width_int;
}
+#endif
Array<Rod>
Tie::get_rods () const
Array<Rod> a;
Rod r;
r.item_l_drul_ = spanned_drul_;
- r.distance_f_ = do_width ().length ();
+ r.distance_f_ = paper ()->get_var ("tie_x_minimum");
a.push (r);
return a;
}
set_bounds (RIGHT, column_arr_.top ());
}
- number_p_->style_str_ = "number";
+ // number_p_->style_str_ = "number-1";
+ number_p_->style_str_ = "volta";
}
Interval
font_large = 12.;
font_Large = 12.;
font_normal = 10.;
+
font_finger = 5.;
- "font_number-1" = 7.;
+ font_volta = 8.;
+ font_number = 10.;
+ font_mark = 12.;
+
+ % what about:
+ "font_number-1" = 8.;
+ %"font_number" = 10.;
+ "font_number+1" = 12.;
+
% ugh see table20 for sizes
quartwidth = 6.61\pt;
% round cappings
1 setlinecap
+% URG
+% staffheight 4 div /interline exch def
+% interline 3 div /bracket_b exch def
+% interline 2 mul /bracket_w exch def
+% stafflinethickness 2 mul /bracket_t exch def
+% interline 1.5 mul /bracket_v exch def
+% bracket_v /bracket_u exch def
+% 50 /bracket_alpha exch def
+
/draw_beam % width slope thick
{
2 div /beam_thick exch def
% hmm
/setgray { 1 add } bind def
+% urg
+1 /stafflinethickness exch def
+
/xoffset 30 def
/yoffset 700 def
/staffrulethickness 1 def