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 "proto.hh"
#include "engraver.hh"
#include "debug.hh"
#include "p-score.hh"
-#include "score-elem.hh"
+#include "score-element.hh"
IMPLEMENT_IS_TYPE_B2(Engraver_group_engraver,Engraver, Translator_group);
ADD_THIS_TRANSLATOR(Engraver_group_engraver);
void
-Engraver_group_engraver::announce_element (Score_elem_info info)
+Engraver_group_engraver::announce_element (Score_element_info info)
{
announce_info_arr_.push (info);
Engraver::announce_element (info);
{
for (int j =0; j < announce_info_arr_.size(); j++)
{
- Score_elem_info info = announce_info_arr_[j];
+ Score_element_info info = announce_info_arr_[j];
if (!info.req_l_)
info.req_l_ = &dummy_req;
--- /dev/null
+/*
+ font-size-grav.cc -- implement Font_size_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "font-size-engraver.hh"
+#include "score-element.hh"
+
+Font_size_engraver::Font_size_engraver ()
+{
+ size_i_ = 0;
+}
+
+void
+Font_size_engraver::do_process_requests ()
+{
+ Scalar s (get_property ("fontsize"));
+
+ if (s.length_i () && s.isnum_b ())
+ {
+ size_i_ = int (s);
+ }
+}
+
+void
+Font_size_engraver::acknowledge_element (Score_element_info e)
+{
+ e.elem_l_->size_i_ = size_i_;
+}
+
+ADD_THIS_TRANSLATOR (Font_size_engraver);
+IMPLEMENT_IS_TYPE_B1(Font_size_engraver,Engraver);
-
-#include "horizontal-group-elem.hh"
+#include "horizontal-group-element.hh"
#include "interval.hh"
#include "item.hh"
#include "debug.hh"
IMPLEMENT_IS_TYPE_B1(Horizontal_group_element, Axis_group_element);
-void
-Horizontal_group_element::remove_all()
-{
- axis_admin_.remove_all (X_AXIS,X_AXIS);
-}
-
-void
-Horizontal_group_element::add_element (Graphical_element*e)
+Horizontal_group_element::Horizontal_group_element ()
+ : Axis_group_element (X_AXIS,X_AXIS)
{
- axis_admin_.add_element (e,this, X_AXIS,X_AXIS);
}
-void
-Horizontal_group_element::remove_element (Graphical_element*e)
-{
- axis_admin_.remove_element (e,X_AXIS,X_AXIS);
-}
-
-
Interval
Horizontal_group_element::do_width() const
{
- return axis_admin_.extent (X_AXIS);
+ return Graphical_axis_group::extent (X_AXIS);
}
-#include "horizontal-vertical-group-elem.hh"
+#include "horizontal-vertical-group-element.hh"
#include "interval.hh"
#include "item.hh"
#include "debug.hh"
-void
-Horizontal_vertical_group_element::remove_all()
+Horizontal_vertical_group_element::Horizontal_vertical_group_element()
{
- axis_admin_.remove_all (X_AXIS,Y_AXIS);
-}
-void
-Horizontal_vertical_group_element::add_element (Graphical_element *e)
-{
- axis_admin_.add_element (e, this, X_AXIS, Y_AXIS);
-}
-
-void
-Horizontal_vertical_group_element::remove_element (Graphical_element*e)
-{
- axis_admin_.remove_element (e, X_AXIS, Y_AXIS);
+ axis1_ = X_AXIS;
+ axis2_ = Y_AXIS;
}
--- /dev/null
+/*
+ align-item.hh -- declare Align_elem
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef VERTICAL_ALIGN_ITEM_HH
+#define VERTICAL_ALIGN_ITEM_HH
+
+#include "score-element.hh"
+#include "interval.hh"
+#include "direction.hh"
+#include "axes.hh"
+
+/**
+ Order elements top to bottom.
+
+ TODO: merge with Horizontal_align_item
+ */
+class Align_element : virtual public Score_element {
+ Link_array<Score_element> elem_l_arr_;
+ Array<int> priority_i_arr_;
+ void sort_elements ();
+public:
+ Interval threshold_interval_ ;
+
+ /**
+ Should high priorities be first or last?
+ */
+
+ Direction stacking_dir_;
+
+ /**
+ Which side to align?
+ -1: left side, 0: centered (around center_l_ if not nil), 1: right side
+ */
+
+ Direction align_dir_;
+
+ Axis axis_;
+ Score_element * center_l_;
+
+ Align_element ();
+ void add_element (Score_element*);
+ void add_element_priority (Score_element*, int);
+ bool contains_b (Score_element const*) const;
+ DECLARE_MY_RUNTIME_TYPEINFO;
+protected:
+ virtual void do_print() const;
+ virtual void do_substitute_dependency (Score_element*,Score_element*);
+ virtual void do_post_processing() ;
+ virtual void do_pre_processing ();
+ virtual void do_side_processing ();
+};
+#endif // VERTICAL_ALIGN_ITEM_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>
*/
#ifndef AXIS_GROUP_ELEMENT_HH
#define AXIS_GROUP_ELEMENT_HH
-#include "score-elem.hh"
-#include "axis-group-administration.hh"
+#include "score-element.hh"
+#include "graphical-axis-group.hh"
+
/**
Treat a group of elements a unity in either or both axis sense .
This is a wrapper around Axis_group_administration
*/
-class Axis_group_element : public virtual Score_elem {
+class Axis_group_element : public virtual Score_element,
+ public Graphical_axis_group {
protected:
- Axis_group_administration axis_admin_;
virtual void do_print() const;
- virtual Link_array<Score_elem> get_extra_dependencies() const;
+ virtual Link_array<Score_element> get_extra_dependencies() const;
virtual void do_unlink();
virtual void do_junk_links();
+ virtual Axis_group_element * access_Axis_group_element ();
public:
- virtual Link_array<Score_elem> elem_l_arr() const;
- Axis_group_element();
- virtual void remove_all()=0;
- virtual void add_element (Graphical_element*)=0;
- virtual void remove_element (Graphical_element*)=0;
- virtual bool contains_b (Graphical_element const *) const;
+ virtual Link_array<Score_element> elem_l_arr() const;
+ Axis_group_element(Axis,Axis);
+ Axis_group_element();
+ virtual Link_array<Score_element> get_children ();
+
DECLARE_MY_RUNTIME_TYPEINFO;
};
/*
bar.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef BAR_HH
String type_str_;
DECLARE_MY_RUNTIME_TYPEINFO;
- SCORE_ELEM_CLONE(Bar);
- Bar();
-private:
- void do_print() const;
+ SCORE_ELEMENT_CLONE (Bar);
+ Bar ();
+
protected:
- virtual void do_pre_processing();
- Molecule*brew_molecule_p() const;
+ virtual void do_pre_processing ();
+ Molecule* brew_molecule_p () const;
+
+private:
+ void do_print () const;
};
#endif // BAR_HH
/*
beam.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef BEAM_HH
especially at small slopes.
*/
enum Quantisation { NONE, NORMAL, TRADITIONAL, TEST };
+ enum Dir_algorithm { /* DOWN=-1, UP=1, */ MAJORITY=2, MEAN, MEDIAN };
Link_array<Stem> stems_;
/// the slope of the beam in posns / point (dimension)
DECLARE_MY_RUNTIME_TYPEINFO;
Beam();
- void add (Stem*);
+ void add_stem (Stem*);
void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
void set_stemlens ();
- SCORE_ELEM_CLONE (Beam);
+ SCORE_ELEMENT_CLONE (Beam);
protected:
virtual Interval do_width () const;
void set_default_dir ();
virtual void do_pre_processing ();
virtual void do_post_processing ();
- virtual void do_substitute_dependent (Score_elem*, Score_elem*);
+ virtual void do_substitute_dependent (Score_element*, Score_element*);
virtual void do_print() const;
/*
clef-item.hh -- declare Clef_item
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef CLEFITEM_HH
#include "item.hh"
#include "text-def.hh"
#include "direction.hh"
+#include "pointer.hh"
/**
Set a clef in a staff.
*/
class Clef_item : public Item {
protected:
- virtual void do_pre_processing();
- Molecule* brew_molecule_p() const;
+ virtual void do_pre_processing();
+ virtual Molecule* brew_molecule_p() const;
public:
- String symbol_;
- int y_position_i_;
+ String symbol_;
+ int y_position_i_;
- /// is this a change clef (smaller size)?
- bool change_b_;
+ /// is this a change clef (smaller size)?
+ bool change_b_;
- /// set because of existence of a bar
- bool default_b_;
-
- /// should we print an octave symbol (8), and where? (up=1, down=1)?
- Direction octave_dir_;
-
- /// text def to put above/below clef (ugh: should be const)
- Text_def * octave_marker_td_p_;
-
- /* *************** */
- DECLARE_MY_RUNTIME_TYPEINFO;
- SCORE_ELEM_CLONE(Clef_item);
- Clef_item();
- void read (Clef_engraver const&);
- void read (String);
+ /// set because of existence of a bar
+ bool default_b_;
+
+ /// should we print an octave symbol (8), and where? (up=1, down=-1)?
+ Direction octave_dir_;
+
+ /// text def to put above/below clef?
+ P<Text_def> octave_marker_td_p_;
+
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ SCORE_ELEMENT_CLONE(Clef_item);
+ Clef_item();
+ void read (Clef_engraver const&);
};
#endif // CLEFITEM_HH
/*
directional-spanner.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef DIRECTIONALSPANNER_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>
*/
#ifndef ELEM_GROUP_HH
#define ELEM_GROUP_HH
-#include "score-elem.hh"
+#include "score-element.hh"
#include "axis-group-element.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>
*/
#include "lily-proto.hh"
#include "parray.hh"
#include "plist.hh"
-#include "score-elem-info.hh"
+#include "score-element-info.hh"
#include "engraver.hh"
#include "translator-group.hh"
public virtual Translator_group
{
protected:
- Array<Score_elem_info> announce_info_arr_;
+ Array<Score_element_info> announce_info_arr_;
public:
TRANSLATOR_CLONE(Engraver_group_engraver);
Engraver_group_engraver();
virtual Staff_info get_staff_info() const;
virtual void do_announces();
- virtual void announce_element (Score_elem_info);
+ virtual void announce_element (Score_element_info);
};
#endif // ENGRAVERGROUP_HH
source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1996, 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#define ENGRAVER_HH
#include "lily-proto.hh"
-#include "varray.hh"
+#include "array.hh"
#include "request.hh"
-#include "score-elem-info.hh"
+#include "score-element-info.hh"
#include "staff-info.hh"
#include "translator.hh"
/**
- a struct which processes requests, and creates the #Score_elem#s.
+ a struct which processes requests, and creates the #Score_element#s.
It may use derived classes. Hungarian postfix: grav
*/
/**
Invoke walker method to typeset element. Default: pass on to daddy.
*/
- virtual void typeset_element (Score_elem*elem_p);
+ virtual void typeset_element (Score_element*elem_p);
/**
take note of item/spanner
Default: ignore the info
*/
- virtual void acknowledge_element (Score_elem_info) {}
+ virtual void acknowledge_element (Score_element_info) {}
/** Do things with stuff found in acknowledge_element. Ugh. Should
be looped with acknowledge_element.
/**
Announce element. Default: pass on to daddy. Utility
*/
- virtual void announce_element (Score_elem_info);
+ virtual void announce_element (Score_element_info);
/**
Get information on the staff. Default: ask daddy.
/*
grouping.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef GROUPING_HH
#define GROUPING_HH
#include "minterval.hh"
-#include "varray.hh"
+#include "array.hh"
/** data structure which represents rhythmic units this is a tree. It groupes notes according to rules
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>
*/
#define HORIZONTAL_ALIGN_ITEM_HH
#include "item.hh"
+#include "align-element.hh"
/**
Order elems left to right.
-
-
TODO: insert (order, elem)
*/
-class Horizontal_align_item : public Item {
-protected:
- Link_array<Item> item_l_arr_;
- Array<int> priority_i_arr_;
-
+class Horizontal_align_item : public Item , public Align_element {
public:
- Item * center_l_;
- /**
- Which side to align?
- -1: left side, 0: centered (around center_l_ if not nil), 1: right side
- */
- int align_i_;
-
- DECLARE_MY_RUNTIME_TYPEINFO;
- SCORE_ELEM_CLONE(Horizontal_align_item);
- void add (Item*, int p);
- Horizontal_align_item();
-protected:
-
- virtual void do_substitute_dependency (Score_elem * , Score_elem *);
- /// do calculations before determining horizontal spacing
- virtual void do_pre_processing();
- virtual void do_print() const;
- virtual Interval do_width() const;
- bool contains_b (Item*) const;
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ SCORE_ELEMENT_CLONE(Horizontal_align_item);
+ void add_item (Item*, int p);
+ Horizontal_align_item();
+ virtual void do_print() const;
+
};
#endif // HORIZONTAL_ALIGN_ITEM_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>
*/
#ifndef HORIZONTAL_GROUP_ITEM_HH
#define HORIZONTAL_GROUP_ITEM_HH
-#include "horizontal-group-elem.hh"
+#include "horizontal-group-element.hh"
#include "axis-group-item.hh"
/**
*/
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_unlink () {
Axis_group_item::do_unlink ();
}
}
virtual void do_print() const;
public:
- virtual void add_element (Graphical_element*e) { Horizontal_group_element::add_element (e); }
- virtual void remove_element (Graphical_element*e) { Horizontal_group_element::remove_element (e); }
+ Horizontal_group_item ();
DECLARE_MY_RUNTIME_TYPEINFO;
- SCORE_ELEM_CLONE(Horizontal_group_item);
+ SCORE_ELEMENT_CLONE(Horizontal_group_item);
};
#endif // HORIZONTAL_GROUP_ITEM_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>
*/
#define HORIZONTAL_VERTICAL_GROUP_ITEM_HH
#include "axis-group-item.hh"
-#include "horizontal-vertical-group-elem.hh"
+#include "horizontal-vertical-group-element.hh"
/**
class Horizontal_vertical_group_item : public Axis_group_item, public Horizontal_vertical_group_element {
protected:
virtual void do_print() const;
- virtual void remove_all() { Horizontal_vertical_group_element::remove_all (); }
virtual void do_unlink () { Horizontal_vertical_group_element::do_unlink (); }
- SCORE_HORIZONTAL_VERTICAL_CLONE(Horizontal_vertical_group_item);
+ SCORE_ELEMENT_CLONE(Horizontal_vertical_group_item);
public:
- virtual void add_element (Graphical_element*e) { Horizontal_vertical_group_element::add_element (e); }
- virtual void remove_element (Graphical_element*e) { Horizontal_vertical_group_element::remove_element (e); }
+ Horizontal_vertical_group_item ();
DECLARE_MY_RUNTIME_TYPEINFO;
};
/*
idealspacing.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef IDEALSPACING_HH
/*
identifier.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef IDENTIFIER_HH
#include "input.hh"
#include "virtual-methods.hh"
-#define IDACCESSOR(Class, accessor)\
-virtual Class * accessor () const { error (#Class + String ("_identifier")); return 0; }
+#define IDACCESSOR(Class)\
+virtual Class * access_ ## Class (bool=true) const { error (#Class + String ("_identifier")); return 0; }
/**
A declarable data structure in mudela.
DECLARE_MY_RUNTIME_TYPEINFO;
void error (String) const;
String str () const;
- IDACCESSOR(Translator, translator)
- IDACCESSOR(Music, music)
- IDACCESSOR(General_script_def, script)
- IDACCESSOR(Symtables, symtables)
- IDACCESSOR(Midi_def, mididef)
- IDACCESSOR(Paper_def, paperdef)
- IDACCESSOR(Lookup,lookup)
- IDACCESSOR(Real,real)
- IDACCESSOR(String,string)
- IDACCESSOR(Request, request)
- IDACCESSOR(Score, score)
- IDACCESSOR(int, intid)
- IDACCESSOR(Duration, duration)
+ IDACCESSOR(Translator)
+ IDACCESSOR(Music)
+ IDACCESSOR(General_script_def)
+ IDACCESSOR(Symtables)
+ IDACCESSOR(Midi_def)
+ IDACCESSOR(Paper_def)
+ IDACCESSOR(Lookup)
+ IDACCESSOR(Real)
+ IDACCESSOR(String)
+ IDACCESSOR(Request)
+ IDACCESSOR(Score)
+ IDACCESSOR(int)
+ IDACCESSOR(Duration)
VIRTUAL_COPY_CONS (Identifier, Identifier);
protected:
virtual String do_str () const;
};
-#define DECLARE_ID_CLASS(Class, accessor) \
+#define DECLARE_ID_CLASS(Class) \
struct Class ## _identifier : Identifier {\
Class *data_p_; \
DECLARE_MY_RUNTIME_TYPEINFO; \
Class ## _identifier (Class ## _identifier const&);\
Class ## _identifier (Class*st, int code);\
VIRTUAL_COPY_CONS (Class ## _identifier, Identifier);\
- virtual Class* accessor () const;\
+ virtual Class* access_ ## Class (bool copy_b = true) const;\
~Class ## _identifier();\
virtual void do_print () const; \
virtual String do_str () const; \
}\
-DECLARE_ID_CLASS(Translator, translator);
-DECLARE_ID_CLASS(Duration, duration);
-DECLARE_ID_CLASS(Real, real);
-DECLARE_ID_CLASS(String, string);
-DECLARE_ID_CLASS(General_script_def, script);
-DECLARE_ID_CLASS(Lookup, lookup);
-DECLARE_ID_CLASS(Symtables, symtables);
-DECLARE_ID_CLASS(Music, music);
-DECLARE_ID_CLASS(int, intid);
-DECLARE_ID_CLASS(Score, score);
-DECLARE_ID_CLASS(Request, request);
-DECLARE_ID_CLASS(Paper_def, paperdef);
-DECLARE_ID_CLASS(Midi_def, mididef);
+DECLARE_ID_CLASS(Translator);
+DECLARE_ID_CLASS(Duration);
+DECLARE_ID_CLASS(Real);
+DECLARE_ID_CLASS(String);
+DECLARE_ID_CLASS(General_script_def);
+DECLARE_ID_CLASS(Lookup);
+DECLARE_ID_CLASS(Symtables);
+DECLARE_ID_CLASS(Music);
+DECLARE_ID_CLASS(int);
+DECLARE_ID_CLASS(Score);
+DECLARE_ID_CLASS(Request);
+DECLARE_ID_CLASS(Paper_def);
+DECLARE_ID_CLASS(Midi_def);
#endif // IDENTIFIER_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>
*/
#ifndef ITEM_HH
#define ITEM_HH
-#include "boxes.hh"
+#include "box.hh"
#include "string.hh"
-#include "score-elem.hh"
+#include "score-element.hh"
#include "drul-array.hh"
/**
spacing calculation.
*/
-class Item : public virtual Score_elem {
+class Item : public virtual Score_element {
public:
Link_array<Spanner> attached_span_l_arr_;
Drul_array<Item*> broken_to_drul_;
/// should be put in a breakable col.
bool breakable_b_;
- Direction break_status_i_;
+ Direction break_status_dir_;
int break_priority_i_;
/// nobreak = 0, pre = -1, post = 1
- int break_status_i() const;
+ Direction break_status_dir() const;
Item * find_prebroken_piece (Direction) const;
Item * find_prebroken_piece (Line_of_score*) const;
- virtual Item *item() { return this; }
+ virtual Item *access_Item() ;
Item();
Real hpos_f() const;
DECLARE_MY_RUNTIME_TYPEINFO;
virtual Paper_column * column_l () const;
static int left_right_compare (Item const *, Item const*);
+
+ Item (Item const &);
protected:
virtual void do_unlink ();
virtual void do_junk_links();
/*
key.hh -- declare Key, Octave_key
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef KEY_HH
#define KEY_HH
-#include "varray.hh"
+#include "array.hh"
#include "scalar.hh"
#include "lily-proto.hh"
/*
keyword.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef KEYWORD_HH
/*
leastsquare.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef LEASTSQUARE_HH
#define LEASTSQUARE_HH
-#include "varray.hh"
+#include "array.hh"
#include "offset.hh"
--- /dev/null
+/*
+ scoreline.hh -- part of GNU LilyPond
+
+ (c) 1996--1998 Han-Wen Nienhuys
+*/
+
+#ifndef SCORELINE_HH
+#define SCORELINE_HH
+
+#include "colhpos.hh"
+#include "spanner.hh"
+
+/// the columns of a score that form one line.
+class Line_of_score : public Spanner
+{
+public:
+ Link_array<Paper_column> cols;
+ bool error_mark_b_;
+
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Line_of_score();
+
+ void add_element (Score_element *);
+
+ /// is #c# contained in #*this#?
+ bool contains_b (Paper_column const *c) const;
+
+ Link_array<Line_of_score> get_lines() const;
+ void set_breaking (Array<Column_x_positions> const&);
+
+protected:
+ virtual Link_array<Score_element> get_extra_dependencies () const;
+
+ virtual void do_unlink ();
+ virtual void do_junk_links ();
+ virtual void break_into_pieces (bool);
+ virtual Interval do_width() const;
+ virtual void do_print() const;
+ SCORE_ELEMENT_CLONE(Line_of_score);
+};
+
+#endif
+
/*
local-key-item.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef LOCALKEYITEM_HH
#define LOCALKEYITEM_HH
#include "item.hh"
-#include "varray.hh"
+#include "array.hh"
#include "musical-pitch.hh"
/**
DECLARE_MY_RUNTIME_TYPEINFO;
Array<Musical_pitch> accs;
Link_array<Item> support_items_;
- int c0_position;
-
-
+ int c0_position_i_;
- Local_key_item (int c0position);
+ Local_key_item ();
void add_support (Item*);
void add (Musical_pitch);
protected:
virtual void do_pre_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;
};
#endif // LOCALKEYITEM_HH
/*
note-head.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef NOTEHEAD_HH
/*
notename.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef NOTENAME_HH
/*
parseconstruct.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef PARSECONSTRUCT_HH
/*
script-def.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef SCRIPTDEF_HH
/*
script.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef SCRIPT_HH
Accents that are put over a note-group.
*/
class Script : public Item, public Staff_side {
-
- Stem *stem_l_;
+ Stem *stem_l_;
protected:
- Molecule *brew_molecule_p() const;
- virtual void do_substitute_dependency (Score_elem*,Score_elem*);
- virtual void do_print() const;
- virtual Interval symbol_height() const;
- virtual void do_pre_processing();
- virtual Interval do_width() const;
- SCORE_ELEM_CLONE(Script);
+ Molecule *brew_molecule_p() const;
+ virtual void do_substitute_dependency (Score_element*,Score_element*);
+ virtual void do_print() const;
+ virtual Interval symbol_height() const;
+ virtual Interval symbol_width () const;
+ virtual void do_pre_processing();
+ virtual Interval do_width() const;
+ SCORE_ELEMENT_CLONE(Script);
private:
- void set_default_dir();
+ void set_default_dir();
public:
- General_script_def *specs_l_;
+ General_script_def *specs_p_;
+ bool postbreak_only_b_;
- static int compare (Script *const&, Script *const&) ;
- Script();
- void set_stem (Stem*);
- DECLARE_MY_RUNTIME_TYPEINFO;
-
+ static int compare (Script *const&, Script *const&) ;
+ Script();
+ ~Script ();
+ Script (Script const&);
+
+ void set_stem (Stem*);
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
/*
slur.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef SLUR_HH
{
public:
Link_array<Note_column> encompass_arr_;
- void add (Note_column*);
+ void add_column (Note_column*);
Slur ();
- SCORE_ELEM_CLONE(Slur);
+ SCORE_ELEMENT_CLONE(Slur);
DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual void do_post_processing ();
virtual void do_add_processing ();
virtual void do_pre_processing ();
- virtual void do_substitute_dependency (Score_elem*, Score_elem*);
+ virtual void do_substitute_dependency (Score_element*, Score_element*);
};
#endif // SLUR_HH
/*
spanner.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef SPANNER_HH
#define SPANNER_HH
#include "lily-proto.hh"
-#include "score-elem.hh"
+#include "score-element.hh"
#include "drul-array.hh"
#include "rod.hh"
length of stems of notes they encompass.
*/
-class Spanner : public virtual Score_elem {
+class Spanner : public virtual Score_element {
public:
Drul_array<Item*> spanned_drul_;
- void set_bounds(Direction d, Item*);
+ void set_bounds (Direction d, Item*);
DECLARE_MY_RUNTIME_TYPEINFO;
- virtual Spanner* spanner() { return this; }
- Spanner();
- bool broken_b() const;
+ virtual Spanner* access_Spanner ();
+ Spanner ();
+ bool broken_b () const;
virtual Array<Rod> get_rods () const;
Spanner* find_broken_piece (Line_of_score*) const;
protected:
- void set_my_columns();
- SCORE_ELEM_CLONE(Spanner);
+ void set_my_columns ();
+ SCORE_ELEMENT_CLONE (Spanner);
/**
this is virtual; for instance, Line_of_score overrides it.
Link_array<Spanner> broken_into_l_arr_;
- virtual void do_unlink();
- virtual void do_junk_links();
+ virtual void do_unlink ();
+ virtual void do_junk_links ();
virtual void do_brew_molecule ();
virtual void do_space_processing ();
- virtual void do_break_processing();
- virtual Interval do_width() const;
- virtual void do_print() const;
- virtual Line_of_score*line_l() const;
+ virtual void do_break_processing ();
+ virtual Interval do_width () const;
+ virtual void do_print () const;
+ virtual Line_of_score*line_l () const;
};
#endif
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>
*/
#ifndef STAFF_SIDE_HH
#define STAFF_SIDE_HH
-#include "score-elem.hh"
+#include "score-element.hh"
#include "interval.hh"
#include "direction.hh"
-/** A symbol which sits along a staff.
+/**
- */
-class Staff_side : virtual Score_elem
+ A symbol which sits either below or above "something" (usually, a
+ staff).
+
+*/
+class Staff_side : virtual Score_element
{
public:
Vertical dir of symbol relative to staff. -1 = below staff?
*/
Direction dir_;
+ Axis axis_;
Interval sym_int_;
- Real y_;
+ Real coordinate_offset_f_;
+ /**
+ Add extra vertical space to the support symbols.
+ */
+ Real padding_f_;
- void set_staffsym (Staff_symbol * );
Staff_side ();
- void add_support (Score_elem*);
+ void add_support (Score_element*);
DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual Interval symbol_height () const;
+ virtual Interval symbol_width () const;
+ Interval symbol_extent () const;
virtual Real get_position_f () const;
- virtual void do_substitute_dependency (Score_elem *, Score_elem*);
+ virtual void do_substitute_dependency (Score_element *, Score_element*);
+ virtual void do_pre_processing ();
virtual void do_post_processing ();
- Interval support_height () const;
+ Interval support_extent () const;
private:
- Link_array<Score_elem> support_l_arr_;
-// Interval support_height () const;
+ void do_side_processing ();
+ Link_array<Score_element> support_l_arr_;
};
+
#endif // STAFF_SIDE_HH
/*
stem.hh -- declare Stem
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef STEM_HH
#define STEM_HH
#include "item.hh"
-#include "varray.hh"
+#include "array.hh"
#include "moment.hh"
#include "molecule.hh"
Stem ();
/// ensure that this Stem also encompasses the Notehead #n#
- void add (Rhythmic_head*n);
+ void add_head (Rhythmic_head*n);
DECLARE_MY_RUNTIME_TYPEINFO;
void do_print() const;
void set_stemend (Real);
- Direction get_default_dir();
- Direction get_dir ();
+ Direction get_default_dir() const;
+ Direction get_dir () const;
- int get_center_distance(Direction);
+ int get_center_distance(Direction) const;
void set_default_dir();
void set_default_stemlen();
void set_default_extents();
/// heads that the stem encompasses (positions)
Interval_t<int> head_positions() const;
+ virtual ~Stem ();
protected:
- virtual void do_substitute_dependency (Score_elem*,Score_elem*);
+ virtual void do_substitute_dependency (Score_element*,Score_element*);
virtual void do_pre_processing();
virtual Interval do_width() const;
Molecule* brew_molecule_p() const;
/*
text-item.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef TEXT_ITEM_HH
/*
textspanner.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef TEXTSPANNER_HH
Text_spanner();
Text_spanner (Text_spanner const&);
protected:
- SCORE_ELEM_CLONE(Text_spanner);
+ SCORE_ELEMENT_CLONE(Text_spanner);
~Text_spanner();
virtual void do_add_processing ();
- virtual void do_substitute_dependency (Score_elem*,Score_elem*);
+ virtual void do_substitute_dependency (Score_element*,Score_element*);
virtual void do_pre_processing();
virtual void do_post_processing();
virtual Interval height() const ;
/*
moment.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef tdes_HH
#include "moment.hh"
#include "lily-proto.hh"
-#include "varray.hh"
+#include "array.hh"
/// full info on where we are
struct Time_description {
void OK() const;
Time_description();
void add (Moment dt);
- bool allow_meter_change_b();
+ bool allow_time_signature_change_b();
String str() const;
void print() const;
void setpartial (Moment p);
String try_set_partial_str (Moment) const;
Moment barleft() const;
Moment next_bar_moment() const;
- void set_meter (int,int);
+ void set_time_signature (int,int);
static int compare (const Time_description&, const Time_description&);
};
--- /dev/null
+/*
+ time_signature.hh -- declare Time_signature
+
+ (c) 1996--1998 Han-Wen Nienhuys
+*/
+
+#ifndef METER_HH
+#define METER_HH
+#include "item.hh"
+#include "array.hh"
+#include "scalar.hh"
+
+/**
+ Print a time_signature sign.
+ TODO:
+
+ C style time_signatures, 2+3+2/8 time_signatures, alla breve.
+
+ */
+class Time_signature: public Item {
+ Array<Scalar> args;
+
+protected:
+ virtual Molecule*brew_molecule_p() const;
+public:
+ Time_signature (Array<Scalar> args) ;
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ SCORE_ELEMENT_CLONE(Time_signature);
+};
+#endif // METER_HH
+