]> git.donarmstrong.com Git - lilypond.git/blob - lily/translator-group-ctors.cc
8225f03176c5fd978163f4392f2c5514343b1a15
[lilypond.git] / lily / translator-group-ctors.cc
1 /*
2   translator-group-ctors.cc -- implement Translator_group factory.
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "score-engraver.hh"
10 #include "score-performer.hh"
11 #include "warn.hh"
12 #include "international.hh"
13
14 /*
15   Quick & dirty.
16 */
17 Translator_group *
18 get_translator_group (SCM sym)
19 {
20   if (sym == ly_symbol2scm ("Engraver_group"))
21     return new Engraver_group ();
22   else if (sym == ly_symbol2scm ("Performer_group"))
23     return new Performer_group ();
24   else if (sym == ly_symbol2scm ("Score_engraver"))
25     return new Score_engraver ();
26   else if (sym == ly_symbol2scm ("Score_performer"))
27     return new Score_performer ();
28
29   error (_f ("fatal error. Couldn't find type: %s",
30              ly_symbol2string (sym).c_str ()));
31   scm_flush (scm_current_error_port ());
32   scm_display (sym, scm_current_error_port ());
33   scm_flush (scm_current_error_port ());
34   
35   exit (2);
36   
37   return 0;
38 }