]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/slur-proto-engraver.hh
Issue 4625/3: Listen to and record in-chord slurs
[lilypond.git] / lily / include / slur-proto-engraver.hh
index 0b0861775c767f2558e9ad53520d0fdda44da4a9..dc7566bc8a34bf7e3c956dedf559aae1c2dc2a0d 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2013 Mike Solomon <mike@mikesolomon.org>
+  Copyright (C) 2013--2015 Mike Solomon <mike@mikesolomon.org>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -32,16 +32,23 @@ 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
-  vector<Stream_event *> start_events_;
-  vector<Stream_event *> stop_events_;
-  vector<Grob *> slurs_;
-  vector<Grob *> end_slurs_;
-  vector<Grob_info> objects_to_acknowledge_;
+  std::vector<Event_info> start_events_;
+  std::vector<Event_info> stop_events_;
+  std::vector<Grob *> slurs_;
+  std::vector<Grob *> end_slurs_;
+  std::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,13 +59,14 @@ protected:
   DECLARE_END_ACKNOWLEDGER (tie);
   DECLARE_ACKNOWLEDGER (tuplet_number);
 
-  void internal_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 (string, vsize, vsize *, Stream_event *);
-  void create_slur (string spanner_id, Stream_event *ev_cause, Grob *g_cause, Direction dir, bool left_broken);
+  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);
 
   virtual void set_melisma (bool);