+++ /dev/null
-[:16 c'1 d]
-[:8 c2 d]
-[:16 c4 d]
-[:32 c16 d]
-[:32 c16 d]
-[:16 c8 d]
+++ /dev/null
-/*
- abbreviation-beam-engraver.cc -- implement Abbreviation_beam_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#include "duration-convert.hh"
-#include "time-description.hh"
-#include "abbreviation-beam-engraver.hh"
-#include "stem.hh"
-#include "abbreviation-beam.hh"
-#include "musical-request.hh"
-#include "misc.hh"
-#include "warn.hh"
-#include "score-engraver.hh"
-
-ADD_THIS_TRANSLATOR (Abbreviation_beam_engraver);
-
-Abbreviation_beam_engraver::Abbreviation_beam_engraver ()
-{
- reqs_drul_[LEFT] = reqs_drul_[RIGHT] = 0;
- abeam_p_ = 0;
- finished_abeam_p_ = 0;
- prev_start_req_ = 0;
-}
-
-bool
-Abbreviation_beam_engraver::do_try_music (Music* m)
-{
- if (Abbreviation_beam_req* b = dynamic_cast <Abbreviation_beam_req *> (m))
- {
- Direction d = b->span_dir_;
- if (reqs_drul_[d] && !reqs_drul_[d]->equal_b (b))
- return false;
-
- if ((d == STOP) && !abeam_p_)
- {
- m->warning (_ ("No abbreviation beam to end"));
- return false;
- }
-
- reqs_drul_[d] = b;
- return true;
- }
-
- return false;
-}
-
-void
-Abbreviation_beam_engraver::do_process_requests ()
-{
- if (reqs_drul_[STOP])
- {
- if (!abeam_p_)
- reqs_drul_[STOP]->warning (_("No abbreviation beam to end"));
- prev_start_req_ = 0;
- finished_abeam_p_ = abeam_p_;
- abeam_p_ = 0;
- }
-
- if (abeam_p_)
- {
- Score_engraver * e = 0;
- Translator * t = daddy_grav_l ();
- for (; !e && t; t = t->daddy_trans_l_)
- {
- e = dynamic_cast<Score_engraver*> (t);
- }
-
- if (!e)
- programming_error ("No score engraver!");
- else
- e->forbid_breaks ();
- }
-
- if (reqs_drul_[START])
- {
- if (abeam_p_)
- {
- reqs_drul_[START]->warning (_ ("Already have an abbreviation beam"));
- return;
- }
-
- prev_start_req_ = reqs_drul_[START];
-
- abeam_p_ = new Abbreviation_beam;
- announce_element (Score_element_info (abeam_p_, reqs_drul_[LEFT]));
- }
-}
-
-void
-Abbreviation_beam_engraver::do_post_move_processing ()
-{
- reqs_drul_ [START] = 0;
-}
-
-void
-Abbreviation_beam_engraver::do_pre_move_processing ()
-{
- typeset_beam ();
-}
-
-void
-Abbreviation_beam_engraver::typeset_beam ()
-{
- if (finished_abeam_p_)
- {
- typeset_element (finished_abeam_p_);
- finished_abeam_p_ = 0;
-
- reqs_drul_[STOP] = 0;
- }
-}
-
-void
-Abbreviation_beam_engraver::do_removal_processing ()
-{
- typeset_beam ();
- if (abeam_p_)
- {
- prev_start_req_->warning (_ ("Unfinished abbreviation beam"));
- finished_abeam_p_ = abeam_p_;
- typeset_beam ();
- }
-}
-
-void
-Abbreviation_beam_engraver::acknowledge_element (Score_element_info i)
-{
- if (abeam_p_)
- {
- if (Stem* s = dynamic_cast<Stem *> (i.elem_l_))
- {
- int type_i = prev_start_req_->type_i_;
- s->flag_i_ = intlog2 (type_i) - 2;
-
- s->beams_i_drul_[LEFT] = s->flag_i_;
- s->beams_i_drul_[RIGHT] = s->flag_i_;
-
- abeam_p_->multiple_i_ = s->flag_i_;
- /*
- abbrev gaps on all but half note
- */
-#if 0
- if (s->type_i () != 1)
- {
- int gap_i =s->flag_i_ - ((s->type_i () >? 2) - 2);
- s->set_elt_property (beam_gap_scm_sym, gh_int2scm(gap_i));
- }
-#else
- if (s->type_i () != 1)
- {
- int gap_i =s->flag_i_ - ((s->type_i () >? 2) - 2);
- abeam_p_->set_elt_property (beam_gap_scm_sym, gh_int2scm(gap_i));
- }
-#endif
-
- abeam_p_->add_stem (s);
- }
- }
-}
+++ /dev/null
-/*
- abbreviation-beam.cc -- implement Abbreviation_beam
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#include "paper-column.hh"
-#include "array.hh"
-#include "proto.hh"
-#include "abbreviation-beam.hh"
-#include "misc.hh"
-#include "debug.hh"
-
-#include "molecule.hh"
-#include "leastsquares.hh"
-#include "stem.hh"
-#include "paper-def.hh"
-#include "lookup.hh"
-#include "stem-info.hh"
-
-
-
-
-Abbreviation_beam::Abbreviation_beam ()
- : Beam ()
-{
-}
-
-Molecule*
-Abbreviation_beam::do_brew_molecule_p () const
-{
- return Beam::do_brew_molecule_p ();
-}
-
-void
-Abbreviation_beam::do_print () const
-{
-#ifndef NPRINT
- Beam::do_print ();
- Spanner::do_print ();
-#endif
-}
-
-/*
- beams to go with one stem.
- */
-Molecule
-Abbreviation_beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
-{
- /*
- todo
- - shorter beams (not reaching outer "stems")
- for [:16 c4 c4] and [:16 c1 c1]
- - centered beam on [:16 c1 c1] heads, rather than "stems"
- */
- return Beam::stem_beams (here, next, prev);
-}
+++ /dev/null
-/*
- colhpos.cc -- implement Column_x_positions
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "colhpos.hh"
-#include "real.hh"
-#include "debug.hh"
-#include "vector.hh"
-#include "line-spacer.hh"
-
-Column_x_positions::Column_x_positions()
-{
- energy_f_ = infinity_f;
- satisfies_constraints_b_ = false;
- spacer_l_ =0;
-}
-
-Column_x_positions::~Column_x_positions()
-{
-
-}
-
-void
-Column_x_positions::add_paper_column (Paper_column*c)
-{
- cols_.push (c);
-}
-
-void
-Column_x_positions::print() const
-{
-#ifndef NPRINT
- DOUT << "energy : " << energy_f_ << '\n';
- DOUT << "line of " << config_.size() << " cols\n";
- Vector v (config_);
- DOUT << v;
-#endif
-}
-
-void
-Column_x_positions::OK() const
-{
-#ifndef NDEBUG
- assert (config_.size() == cols_.size ());
-#endif
-}
-
-void
-Column_x_positions::set_stupid_solution(Vector v)
-{
- energy_f_ = infinity_f;
- config_ = v;
-}
-
-void
-Column_x_positions::stupid_solution()
-{
- set_stupid_solution (spacer_l_->default_solution());
-}
-
-void
-Column_x_positions::solve_line()
-{
- spacer_l_->solve (this);
-}
-
-
-void
-Column_x_positions::approximate_solve_line()
-{
- spacer_l_->lower_bound_solution (this);
-}
-
-
+++ /dev/null
-/*
- abbreviation-beam-engraver.hh -- declare Abbreviation_beam_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-
-#ifndef ABBREVIATION_BEAM_ENGRAVER_HH
-#define ABBREVIATION_BEAM_ENGRAVER_HH
-
-#include "engraver.hh"
-#include "drul-array.hh"
-
-/**
- Generate an abbreviation beam. Eat stems.
- */
-class Abbreviation_beam_engraver : public Engraver
-{
-public:
- VIRTUAL_COPY_CONS(Translator);
-
-
- Abbreviation_beam_engraver();
-
-protected:
- virtual void do_removal_processing();
- virtual void do_process_requests();
- virtual bool do_try_music (Music*);
- virtual void acknowledge_element (Score_element_info);
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
-
-private:
- void typeset_beam ();
- Drul_array<Abbreviation_beam_req*> reqs_drul_;
- Abbreviation_beam_req* prev_start_req_;
- Abbreviation_beam* abeam_p_;
- Abbreviation_beam* finished_abeam_p_;
-};
-
-#endif // ABBREVIATION_BEAM_ENGRAVER_HH
+++ /dev/null
-/*
- abbreviation-beam-engraver.hh -- declare Abbreviation_beam_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#ifndef ABBREVIATION_BEAM_HH
-#define ABBREVIATION_BEAM_HH
-
-#include "beam.hh"
-
-/** a beam connects multiple stems Beam adjusts the stems its owns to
- make sure that they reach the beam and that point in the correct
- direction */
-class Abbreviation_beam : public Beam {
-public:
-
-
- Abbreviation_beam();
-
- VIRTUAL_COPY_CONS(Score_element);
-
-protected:
- virtual void do_print() const;
- virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
- virtual Molecule* do_brew_molecule_p() const;
-};
-
-#endif // ABBREVIATION_BEAM_HH
-
+++ /dev/null
-/*
- colhpos.hh -- part of GNU LilyPond
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#ifndef COLHPOS_HH
-#define COLHPOS_HH
-
-#include "parray.hh"
-#include "lily-proto.hh"
-
-typedef Link_array<Paper_column> Line_of_cols;
-
-struct Column_x_positions {
- Line_spacer * spacer_l_;
- Line_of_cols cols_;
- Array<Real> config_;
-
- Real energy_f_;
- bool satisfies_constraints_b_;
-
- void OK() const;
- ~Column_x_positions();
- void solve_line();
- void approximate_solve_line();
- /** generate a solution with no regard to idealspacings or
- constraints. should always work */
- void stupid_solution();
- void set_stupid_solution (Vector);
- Column_x_positions();
- void add_paper_column (Paper_column*c);
- void print() const;
-};
-
-
-#endif // COLHPOS_HH
-