]> git.donarmstrong.com Git - lilypond.git/commitdiff
add Audio_note::to_string to aid debugging
authorAdam Spiers <lilypond@adamspiers.org>
Sun, 13 Jan 2013 17:10:58 +0000 (17:10 +0000)
committerAdam Spiers <lilypond@adamspiers.org>
Sun, 27 Jan 2013 14:25:11 +0000 (14:25 +0000)
lily/audio-item.cc
lily/include/audio-item.hh

index 201e8fd98e7cf4939c1de6b4a7e8ca64efc540d6..65ca70004d23149ac81aed6a7e46bdd589bb9460 100644 (file)
@@ -67,6 +67,25 @@ Audio_note::tie_to (Audio_note *t, Moment skip)
   length_mom_ = 0;
 }
 
+string
+Audio_note::to_string () const
+{
+  string s = "#<Audio_note pitch ";
+  s += pitch_.to_string();
+  s += " len ";
+  s += length_mom_.to_string();
+  if (tied_)
+    {
+      s += " tied to " + tied_->to_string();
+    }
+  if (tie_event_)
+    {
+      s += " tie_event";
+    }
+  s += ">";
+  return s;
+}
+
 Audio_key::Audio_key (int acc, bool major)
 {
   accidentals_ = acc;
index 45dcc7b7991f6b486fbd1f8c284cafa0f56bbf61..1b858cd8c4d7261321e064103cd967a678bdccc2 100644 (file)
@@ -86,6 +86,7 @@ public:
 
   // with tieWaitForNote, there might be a skip between the tied notes!
   void tie_to (Audio_note *, Moment skip = 0);
+  virtual string to_string () const;
 
   Pitch pitch_;
   Moment length_mom_;