2 music-constructor.cc -- implement Music_constructor
4 source file of the GNU LilyPond music typesetter
6 (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "music-constructor.hh"
11 #include <map> // UGH.
16 static std::map<String, Music_ctor> *ctors_map_;
19 add_music_ctor (String s, Music_ctor c)
22 ctors_map_ = new std::map<String, Music_ctor>;
28 get_music_ctor (String s)
30 if (ctors_map_->find (s) == ctors_map_->end ())
33 return (*ctors_map_)[s];
37 make_music (String s, SCM init)
39 Music_ctor c = get_music_ctor (s);
41 programming_error (String ("No constructor for music: ") + s);