]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/slur-proto-engraver.hh
Revert "Issue 4550 (2/2) Avoid "using namespace std;" in included files"
[lilypond.git] / lily / include / slur-proto-engraver.hh
index 89801dfd8a68eb46bb42302477fddf2b4e891671..c11926b21a9bc8841b4b6e9ba5cdc115cdbbd412 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "engraver.hh"
 #include "moment.hh"
+#include <map>
 
 class Slur_proto_engraver : public Engraver
 {
@@ -32,16 +33,26 @@ protected:
       grob_name_ (grob_name), object_name_ (object_name),
       event_name_ (event_name) {}
 
+  struct Event_info {
+    Stream_event *slur_, *note_;
+    Event_info (Stream_event *slur, Stream_event *note)
+      : slur_ (slur), note_ (note)
+    { }
+  };
   // protected so that subclasses can see them
-  std::vector<Stream_event *> start_events_;
-  std::vector<Stream_event *> stop_events_;
-  std::vector<Grob *> slurs_;
-  std::vector<Grob *> end_slurs_;
-  std::vector<Grob_info> objects_to_acknowledge_;
+  vector<Event_info> start_events_;
+  vector<Event_info> stop_events_;
+
+  typedef std::multimap<Stream_event *, Spanner *> Note_slurs;
+  Drul_array<Note_slurs> note_slurs_;
+  vector<Grob *> slurs_;
+  vector<Grob *> end_slurs_;
+  vector<Grob_info> objects_to_acknowledge_;
   const char* double_property_name_;
   const char* grob_name_;
   const char* object_name_;
   const char* event_name_;
+  virtual SCM event_symbol () = 0;
 
   DECLARE_ACKNOWLEDGER (inline_accidental);
   DECLARE_ACKNOWLEDGER (fingering);
@@ -52,14 +63,15 @@ protected:
   DECLARE_END_ACKNOWLEDGER (tie);
   DECLARE_ACKNOWLEDGER (tuplet_number);
 
-  void listen_slur (Stream_event *ev);
+  void listen_note (Stream_event *ev);
+  void listen_slur (Stream_event *ev, Stream_event *note = 0);
   void acknowledge_extra_object (Grob_info);
   void stop_translation_timestep ();
   void process_music ();
 
-  bool can_create_slur (const std::string&, vsize, vsize *, Stream_event *);
-  void create_slur (const std::string &spanner_id, Stream_event *ev_cause, Grob *g_cause, Direction dir, bool left_broken);
-  bool try_to_end (Stream_event *ev);
+  bool can_create_slur (const string&, vsize, vsize *, Stream_event *);
+  void create_slur (const string &spanner_id, Event_info evi, Grob *g_cause, Direction dir, bool left_broken);
+  bool try_to_end (Event_info evi);
 
   virtual void set_melisma (bool);
   virtual void finalize ();