2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2013--2015 Mike Solomon <mike@mikesolomon.org>
5 Copyright (C) 2016 David Kastrup <dak@gnu.org>
7 LilyPond is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 LilyPond is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef SLUR_ENGRAVER_HH
22 #define SLUR_ENGRAVER_HH
24 #include "engraver.hh"
27 class Slur_engraver : public Engraver
31 Stream_event *slur_, *note_;
32 Event_info (Stream_event *slur, Stream_event *note)
33 : slur_ (slur), note_ (note)
36 // protected so that subclasses can see them
37 vector<Event_info> start_events_;
38 vector<Event_info> stop_events_;
40 typedef std::multimap<Stream_event *, Spanner *> Note_slurs;
41 Drul_array<Note_slurs> note_slurs_;
42 vector<Grob *> slurs_;
43 vector<Grob *> end_slurs_;
44 vector<Grob_info> objects_to_acknowledge_;
46 virtual SCM event_symbol () const;
47 virtual bool double_property () const;
48 virtual SCM grob_symbol () const;
49 virtual const char* object_name () const;
51 void acknowledge_note_column (Grob_info);
52 void acknowledge_script (Grob_info);
54 void listen_note (Stream_event *ev);
55 // A slur on an in-chord note is not actually announced as an event
56 // but rather produced by the note listener.
57 void listen_note_slur (Stream_event *ev, Stream_event *note);
58 void listen_slur (Stream_event *ev) { listen_note_slur (ev, 0); }
59 void acknowledge_extra_object (Grob_info);
60 void stop_translation_timestep ();
61 void process_music ();
63 bool can_create_slur (SCM, vsize, vsize *, Stream_event *);
64 void create_slur (SCM spanner_id, Event_info evi, Grob *g_cause, Direction dir, bool left_broken);
65 bool try_to_end (Event_info evi);
67 virtual void set_melisma (bool);
68 virtual void finalize ();
69 virtual void derived_mark () const;
72 TRANSLATOR_DECLARATIONS (Slur_engraver);
75 #endif // SLUR_ENGRAVER_HH