]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/slur-proto-engraver.hh
e27c96a759db69d3eca94da7761f347fd1ee7581
[lilypond.git] / lily / include / slur-proto-engraver.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2013 Mike Solomon <mike@mikesolomon.org>
5
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.
10
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.
15
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/>.
18 */
19
20 #ifndef SLUR_PROTO_ENGRAVER_HH
21 #define SLUR_PROTO_ENGRAVER_HH
22
23 #include "engraver.hh"
24 #include "moment.hh"
25
26 class Slur_proto_engraver : public Engraver
27 {
28 protected:
29   Slur_proto_engraver (const char* double_property_name,
30     const char* grob_name, const char* object_name, const char* event_name) :
31       double_property_name_ (double_property_name),
32       grob_name_ (grob_name), object_name_ (object_name),
33       event_name_ (event_name) {}
34
35   // protected so that subclasses can see them
36   vector<Stream_event *> start_events_;
37   vector<Stream_event *> stop_events_;
38   vector<Grob *> slurs_;
39   vector<Grob *> end_slurs_;
40   vector<Grob_info> objects_to_acknowledge_;
41   const char* double_property_name_;
42   const char* grob_name_;
43   const char* object_name_;
44   const char* event_name_;
45
46   DECLARE_ACKNOWLEDGER (inline_accidental);
47   DECLARE_ACKNOWLEDGER (fingering);
48   DECLARE_ACKNOWLEDGER (note_column);
49   DECLARE_ACKNOWLEDGER (script);
50   DECLARE_ACKNOWLEDGER (dots);
51   DECLARE_ACKNOWLEDGER (text_script);
52   DECLARE_END_ACKNOWLEDGER (tie);
53   DECLARE_ACKNOWLEDGER (tuplet_number);
54
55   void internal_listen_slur (Stream_event *ev);
56   void acknowledge_extra_object (Grob_info);
57   void stop_translation_timestep ();
58   void process_music ();
59
60   bool can_create_slur (const string&, vsize, vsize *, Stream_event *);
61   void create_slur (const string &spanner_id, Stream_event *ev_cause, Grob *g_cause, Direction dir, bool left_broken);
62   bool try_to_end (Stream_event *ev);
63
64   virtual void set_melisma (bool);
65   virtual void finalize ();
66   virtual void derived_mark () const;
67
68 public:
69   // no TRANSLATOR_DECLARATIONS (Slur_proto_engraver) needed since this
70   // class is abstract
71 };
72
73 #endif // SLUR_PROTO_ENGRAVER_HH