X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fslur-configuration.hh;h=be30352676bd072e8690369134340df854def5d2;hb=98b662a091d78893004ee5f7cf4f7e9a6d811f57;hp=0a59c053da871c1ba1ddde4d84382b2568f3adbc;hpb=2ed0044bc7425734a1e44356b9afd68d46bb72e7;p=lilypond.git diff --git a/lily/include/slur-configuration.hh b/lily/include/slur-configuration.hh index 0a59c053da..be30352676 100644 --- a/lily/include/slur-configuration.hh +++ b/lily/include/slur-configuration.hh @@ -1,42 +1,82 @@ -/* - slur-configuration.hh -- declare Slur_configuration - - source file of the GNU LilyPond music typesetter - - (c) 2004 Han-Wen Nienhuys - +/* + This file is part of LilyPond, the GNU music typesetter. + + 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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #ifndef SLUR_CONFIGURATION_HH #define SLUR_CONFIGURATION_HH -#include "drul-array.hh" #include "bezier.hh" #include "lily-proto.hh" -#include "parray.hh" -#include "main.hh" +#include "std-vector.hh" class Slur_configuration { + Real score_; + string score_card_; + public: Drul_array attachment_; - Real score_; Bezier curve_; + Real height_; + int index_; -#if DEBUG_SLUR_SCORING - String score_card_; -#endif + enum Slur_scorers + { + INITIAL_SCORE, + SLOPE, + EDGES, + EXTRA_ENCOMPASS, + ENCOMPASS, + NUM_SCORERS, + }; + + int next_scorer_todo; Slur_configuration (); - void generate_curve (Slur_score_state const &state, Real r0, Real h_inf); - void score (Slur_score_state const&); + Real score () const { return score_; } + 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 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&); + 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 */