]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/p-score.hh
release: 0.1.11
[lilypond.git] / lily / include / p-score.hh
index 33e066c3c707536e721e06c135ea3df543631de5..1ca1f30ac8971b7ffcc71fb5af1a4b927f7d275f 100644 (file)
@@ -1,7 +1,7 @@
 /*
-  p-score.hh -- declare PScore
+  p-score.hh -- declare Paper_score
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #define P_SCORE_HH
 
 #include "colhpos.hh"
-#include "varray.hh"
-#include "p-col.hh"
-#include "p-staff.hh"
+#include "parray.hh"
+#include "lily-proto.hh"
+#include "plist.hh"
+#include "music-output.hh"
 
-
-/** all stuff which goes onto paper. notes, signs, symbols in a score can be grouped in two ways:
-    horizontally (staffwise), and vertically (columns). #PScore#
-    contains the items, the columns and the staffs.
- */
-
-struct PScore {
-    Paper_def *paper_l_;
+/** all stuff which goes onto paper. notes, signs, symbols in a score
+     #Paper_score# contains the items, the columns.
     
-    /// the columns, ordered left to right
-    Pointer_list<PCol *> cols;
-
-    /// the idealspacings, no particular order
-    Pointer_list<Idealspacing*> suz;
-
-    /// the staffs ordered top to bottom
-    Pointer_list<PStaff*> staffs;
-
-    /// all symbols in score. No particular order.
-    Pointer_list<Item*> its;
+    */
 
-    /// if broken, the different lines
-    Pointer_list<Line_of_score*> lines;
+class Paper_score : public Music_output {
+public:
+  Paper_def *paper_l_;
 
-    /// crescs etc; no particular order
-    Pointer_list<Spanner *> spanners;
+  /// the columns, ordered left to right
+  Link_list<Paper_column *> col_p_list_;
 
-    /// broken spanners
-    Pointer_list<Spanner*> broken_spans;
+  /// crescs etc; no particular order
+  Pointer_list<Spanner *> span_p_list_;
 
-    /* *************** */
-    /* CONSTRUCTION */
+  /// other elements
+  Pointer_list<Score_elem*> elem_p_list_;
     
-    PScore(Paper_def*);
-    /// add a line to the broken stuff. Positions given in #config#
-    void set_breaking(Array<Col_hpositions> const &);
-
-    void add(PStaff *);
+  Super_elem *super_elem_l_;
     
+  Paper_score ();
+  /// add a line to the broken stuff. Positions given in #config#
+  void set_breaking (Array<Col_hpositions> const &);
 
-    /** add an item.
-       add the item in specified containers. If breakstatus is set
-       properly, add it to the {pre,post}break of the pcol.
-       */
-    void typeset_item(Item *item_p,  PCol *pcol_l,PStaff*pstaf_l,int breakstatus=1);
-
-    /// add a Spanner
-    void typeset_spanner(Spanner*, PStaff*);
-    ///    add to bottom of pcols
-    void add(PCol*);
-    void add_broken(Spanner*);
 
-    /* INSPECTION */
-    Array<Item*> select_items(PStaff*, PCol*);
+  /// add to bottom of pcols
+  void add_column (Paper_column*);
 
-     /**
-       @return argument as a cursor of the list
-       */
-    PCursor<PCol *> find_col(PCol const *)const;
+  /**
+    @return argument as a cursor of the list
+    */
+  PCursor<Paper_column *> find_col (Paper_column const *) const;
 
+  Link_array<Paper_column> col_range (Paper_column *left_l, Paper_column *right_l) const;
+  Link_array<Paper_column> breakable_col_range (Paper_column*,Paper_column*) const;
+  Link_array<Item> broken_col_range (Item const*,Item const*) const;
+    
+    
+  /* STANDARD ROUTINES */
+  void OK() const;
+  void print() const;
+  
+  void typeset_element (Score_elem*);
+  void typeset_broken_spanner (Spanner*);
+  /// add a Spanner
+  void typeset_unbroken_spanner (Spanner*);
+    
+protected:
     /* MAIN ROUTINES */
-    void process();
-
-    /// last deed of this struct
-    void output(Tex_stream &ts);
+  virtual void process();
+  virtual ~Paper_score();
 
-    /* UTILITY ROUTINES */
-
-    /// get the spacing between c1 and c2, create one if necessary.
-    Idealspacing* get_spacing(PCol *c1, PCol *c2);
-
-    /// connect c1 and c2
-    void do_connect(PCol *c1, PCol *c2, Real distance_f, Real strength_f);
-
-    /// connect c1 and c2 and any children of c1 and c2
-    void connect(PCol* c1, PCol *c2, Real distance_f,Real  strength_f= 1.0);
-    
-    /* STANDARD ROUTINES */
-    void OK()const;
-    void print() const;
 private:
-    /// before calc_breaking
-    void preprocess();
+  /// before calc_breaking
+  void preprocess();
 
-    /// calculate where the lines are to be broken, and use results
-    void calc_breaking();
+  void calc_idealspacing();
+  /// calculate where the lines are to be broken, and use results
+  void calc_breaking();
 
-    /// after calc_breaking
-    void postprocess();
+  /// after calc_breaking
+  void postprocess();
     
-    /// delete unused columns
-    void clean_cols();
+  /// delete unused columns
+  void clean_cols();
 };
 
 #endif