]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/notename-table.cc
release: 1.0.17
[lilypond.git] / lily / notename-table.cc
index b8753929a9fa91e60b11e2319cef466105356749..bf32cb7ee2919031c77f9eb147421e4ad86b7c70 100644 (file)
@@ -1,28 +1,24 @@
 /*
   notename-table.cc -- implement Notename_table
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "notename-table.hh"
 #include "pointer.tcc"
 #include "musical-request.hh"
+#include "dictionary-iter.hh"
 
-template class P<Melodic_req>;
-
-void
-Notename_table::add(String s, Melodic_req *m_p)
+String
+Notename_table::get_name (Musical_pitch m) const
 {
-    elem(s).set_p(m_p);
-}
 
-Melodic_req*
-Notename_table::get_l(String s)
-{
-    if (! elt_b(s))
-       return 0;
-    return elem(s);
+  for (Dictionary_iter<Musical_pitch> ai (*this); ai.ok (); ai++)
+    {
+      if (ai.val () == m)
+       return ai.key ();
+    }
+  return "r";                  // rest. 
 }
-