X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fslur-configuration.hh;h=be30352676bd072e8690369134340df854def5d2;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=a1ba3d109a4adf4ae6b1ba4c3faec5a9f9da8413;hpb=e18531db1f79fb685fbd16d6a2a67bf4b6c09915;p=lilypond.git diff --git a/lily/include/slur-configuration.hh b/lily/include/slur-configuration.hh index a1ba3d109a..be30352676 100644 --- a/lily/include/slur-configuration.hh +++ b/lily/include/slur-configuration.hh @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2004--2010 Han-Wen Nienhuys + Copyright (C) 2004--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,17 +24,6 @@ #include "lily-proto.hh" #include "std-vector.hh" - -enum Configuration_tag - { - SLUR_STEM = 0x01, - SLUR_HEAD = 0x02, - SLUR_FREE = 0x04, - SLUR_FREE_HEAD = 0x08, - SLUR_FREE_STEM = 0x10, - SLUR_STEM_TIP = 0x10, - }; - class Slur_configuration { Real score_; @@ -44,23 +33,50 @@ public: Drul_array attachment_; Bezier curve_; Real height_; - unsigned tags_; int index_; + enum Slur_scorers + { + INITIAL_SCORE, + SLOPE, + EDGES, + EXTRA_ENCOMPASS, + ENCOMPASS, + NUM_SCORERS, + }; + + int next_scorer_todo; + Slur_configuration (); Real score () const { return score_; } - string card () const { return score_card_; } - void add_score (Real, string); - + string card () const { return score_card_; } + void add_score (Real, const string&); + void generate_curve (Slur_score_state const &state, Real r0, Real h_inf, - vector const &); - void calculate_score (Slur_score_state const &); + vector const &); + void run_next_scorer (Slur_score_state const &); + bool done () const; + static Slur_configuration *new_config (Drul_array const &offs, int idx); + protected: void score_extra_encompass (Slur_score_state const &); void score_slopes (Slur_score_state const &); void score_edges (Slur_score_state const &); void score_encompass (Slur_score_state const &); + + friend class Slur_configuration_less; +}; + +// Comparator for a queue of Beam_configuration*. +class Slur_configuration_less +{ +public: + bool operator () (Slur_configuration *const &l, Slur_configuration *const &r) + { + // Invert + return l->score_ > r->score_; + } }; #endif /* SLUR_CONFIGURATION_HH */