LEFT | RIGHT |
(no file at all) | |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 2013--2015 Mike Solomon <mike@mikesolomon.org> | 4 Copyright (C) 2013--2015 Mike Solomon <mike@mikesolomon.org> |
| 5 Copyright (C) 2016 David Kastrup <dak@gnu.org> |
5 | 6 |
6 LilyPond is free software: you can redistribute it and/or modify | 7 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 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 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 10 (at your option) any later version. |
10 | 11 |
11 LilyPond is distributed in the hope that it will be useful, | 12 LilyPond is distributed in the hope that it will be useful, |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 GNU General Public License for more details. | 15 GNU General Public License for more details. |
15 | 16 |
16 You should have received a copy of the GNU General Public License | 17 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 along with LilyPond. If not, see <http://www.gnu.org/licenses/>. |
18 */ | 19 */ |
19 | 20 |
20 #ifndef SLUR_PROTO_ENGRAVER_HH | 21 #ifndef SLUR_ENGRAVER_HH |
21 #define SLUR_PROTO_ENGRAVER_HH | 22 #define SLUR_ENGRAVER_HH |
22 | 23 |
23 #include "engraver.hh" | 24 #include "engraver.hh" |
24 #include "moment.hh" | |
25 #include <map> | 25 #include <map> |
26 | 26 |
27 class Slur_proto_engraver : public Engraver | 27 class Slur_engraver : public Engraver |
28 { | 28 { |
29 protected: | 29 protected: |
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) {} | |
35 | |
36 struct Event_info { | 30 struct Event_info { |
37 Stream_event *slur_, *note_; | 31 Stream_event *slur_, *note_; |
38 Event_info (Stream_event *slur, Stream_event *note) | 32 Event_info (Stream_event *slur, Stream_event *note) |
39 : slur_ (slur), note_ (note) | 33 : slur_ (slur), note_ (note) |
40 { } | 34 { } |
41 }; | 35 }; |
42 // protected so that subclasses can see them | 36 // protected so that subclasses can see them |
43 vector<Event_info> start_events_; | 37 vector<Event_info> start_events_; |
44 vector<Event_info> stop_events_; | 38 vector<Event_info> stop_events_; |
45 | 39 |
46 typedef std::multimap<Stream_event *, Spanner *> Note_slurs; | 40 typedef std::multimap<Stream_event *, Spanner *> Note_slurs; |
47 Drul_array<Note_slurs> note_slurs_; | 41 Drul_array<Note_slurs> note_slurs_; |
48 vector<Grob *> slurs_; | 42 vector<Grob *> slurs_; |
49 vector<Grob *> end_slurs_; | 43 vector<Grob *> end_slurs_; |
50 vector<Grob_info> objects_to_acknowledge_; | 44 vector<Grob_info> objects_to_acknowledge_; |
51 const char* double_property_name_; | 45 |
52 const char* grob_name_; | 46 virtual SCM event_symbol () const; |
53 const char* object_name_; | 47 virtual bool double_property () const; |
54 const char* event_name_; | 48 virtual SCM grob_symbol () const; |
55 virtual SCM event_symbol () = 0; | 49 virtual const char* object_name () const; |
56 | 50 |
57 void acknowledge_inline_accidental (Grob_info); | 51 void acknowledge_inline_accidental (Grob_info); |
58 void acknowledge_fingering (Grob_info); | 52 void acknowledge_fingering (Grob_info); |
59 void acknowledge_note_column (Grob_info); | 53 void acknowledge_note_column (Grob_info); |
60 void acknowledge_script (Grob_info); | 54 void acknowledge_script (Grob_info); |
61 void acknowledge_dots (Grob_info); | 55 void acknowledge_dots (Grob_info); |
62 void acknowledge_text_script (Grob_info); | 56 void acknowledge_text_script (Grob_info); |
63 void acknowledge_end_tie (Grob_info); | 57 void acknowledge_end_tie (Grob_info); |
64 void acknowledge_tuplet_number (Grob_info); | 58 void acknowledge_tuplet_number (Grob_info); |
65 | 59 |
66 void listen_note (Stream_event *ev); | 60 void listen_note (Stream_event *ev); |
67 void listen_slur (Stream_event *ev, Stream_event *note); | 61 void listen_slur (Stream_event *ev, Stream_event *note); |
68 // You'd think the following is the same as defaulting `note' to 0, | 62 // You'd think the following is the same as defaulting `note' to 0, |
69 // but template resolution for trampolines disagrees. Huh. | 63 // but template resolution for trampolines disagrees. Huh. |
70 void listen_slur (Stream_event *ev) { listen_slur (ev, 0); } | 64 void listen_slur (Stream_event *ev) { listen_slur (ev, 0); } |
71 void acknowledge_extra_object (Grob_info); | 65 void acknowledge_extra_object (Grob_info); |
72 void stop_translation_timestep (); | 66 void stop_translation_timestep (); |
73 void process_music (); | 67 void process_music (); |
74 | 68 |
75 bool can_create_slur (const string&, vsize, vsize *, Stream_event *); | 69 bool can_create_slur (const string&, vsize, vsize *, Stream_event *); |
76 void create_slur (const string &spanner_id, Event_info evi, Grob *g_cause, Dir
ection dir, bool left_broken); | 70 void create_slur (const string &spanner_id, Event_info evi, Grob *g_cause, Dir
ection dir, bool left_broken); |
77 bool try_to_end (Event_info evi); | 71 bool try_to_end (Event_info evi); |
78 | 72 |
79 virtual void set_melisma (bool); | 73 virtual void set_melisma (bool); |
80 virtual void finalize (); | 74 virtual void finalize (); |
81 virtual void derived_mark () const; | 75 virtual void derived_mark () const; |
82 | 76 |
83 public: | 77 public: |
84 // no TRANSLATOR_DECLARATIONS (Slur_proto_engraver) needed since this | 78 TRANSLATOR_DECLARATIONS (Slur_engraver); |
85 // class is abstract | |
86 DECLARE_TRANSLATOR_CALLBACKS (Slur_proto_engraver); | |
87 }; | 79 }; |
88 | 80 |
89 #endif // SLUR_PROTO_ENGRAVER_HH | 81 #endif // SLUR_ENGRAVER_HH |
LEFT | RIGHT |