2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2013--2015 Mike Solomon <mike@mikesolomon.org>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef SLUR_PROTO_ENGRAVER_HH
21 #define SLUR_PROTO_ENGRAVER_HH
23 #include "engraver.hh"
27 class Slur_proto_engraver : public Engraver
30 Slur_proto_engraver (const char* double_property_name,
31 const char* grob_name, const char* object_name, const char* event_name) :
32 double_property_name_ (double_property_name),
33 grob_name_ (grob_name), object_name_ (object_name),
34 event_name_ (event_name) {}
37 Stream_event *slur_, *note_;
38 Event_info (Stream_event *slur, Stream_event *note)
39 : slur_ (slur), note_ (note)
42 // protected so that subclasses can see them
43 vector<Event_info> start_events_;
44 vector<Event_info> stop_events_;
46 typedef std::multimap<Stream_event *, Spanner *> Note_slurs;
47 Drul_array<Note_slurs> note_slurs_;
48 vector<Grob *> slurs_;
49 vector<Grob *> end_slurs_;
50 vector<Grob_info> objects_to_acknowledge_;
51 const char* double_property_name_;
52 const char* grob_name_;
53 const char* object_name_;
54 const char* event_name_;
55 virtual SCM event_symbol () = 0;
57 DECLARE_ACKNOWLEDGER (inline_accidental);
58 DECLARE_ACKNOWLEDGER (fingering);
59 DECLARE_ACKNOWLEDGER (note_column);
60 DECLARE_ACKNOWLEDGER (script);
61 DECLARE_ACKNOWLEDGER (dots);
62 DECLARE_ACKNOWLEDGER (text_script);
63 DECLARE_END_ACKNOWLEDGER (tie);
64 DECLARE_ACKNOWLEDGER (tuplet_number);
66 void listen_note (Stream_event *ev);
67 void listen_slur (Stream_event *ev, Stream_event *note = 0);
68 void acknowledge_extra_object (Grob_info);
69 void stop_translation_timestep ();
70 void process_music ();
72 bool can_create_slur (const string&, vsize, vsize *, Stream_event *);
73 void create_slur (const string &spanner_id, Event_info evi, Grob *g_cause, Direction dir, bool left_broken);
74 bool try_to_end (Event_info evi);
76 virtual void set_melisma (bool);
77 virtual void finalize ();
78 virtual void derived_mark () const;
81 // no TRANSLATOR_DECLARATIONS (Slur_proto_engraver) needed since this
85 #endif // SLUR_PROTO_ENGRAVER_HH