]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/notename-table.cc
release: 1.0.17
[lilypond.git] / lily / notename-table.cc
index 46838b96f8b9a6d391d9579cc17a6cb3801b15a7..bf32cb7ee2919031c77f9eb147421e4ad86b7c70 100644 (file)
@@ -3,26 +3,22 @@
 
   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. 
 }
-