]> git.donarmstrong.com Git - lilypond.git/blob - lily/translator-group-ctors.cc
Web-ja: update introduction
[lilypond.git] / lily / translator-group-ctors.cc
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
6   LilyPond is free software: you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation, either version 3 of the License, or
9   (at your option) any later version.
10
11   LilyPond is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "score-engraver.hh"
21 #include "score-performer.hh"
22 #include "warn.hh"
23 #include "international.hh"
24
25 /*
26   Quick & dirty.
27 */
28 Translator_group *
29 get_translator_group (SCM sym)
30 {
31   if (scm_is_eq (sym, ly_symbol2scm ("Engraver_group")))
32     return new Engraver_group ();
33   else if (scm_is_eq (sym, ly_symbol2scm ("Performer_group")))
34     return new Performer_group ();
35   else if (scm_is_eq (sym, ly_symbol2scm ("Score_engraver")))
36     return new Score_engraver ();
37   else if (scm_is_eq (sym, ly_symbol2scm ("Score_performer")))
38     return new Score_performer ();
39
40   error (_f ("fatal error.  Couldn't find type: %s",
41              ly_symbol2string (sym).c_str ()));
42   scm_flush (scm_current_error_port ());
43   scm_display (sym, scm_current_error_port ());
44   scm_flush (scm_current_error_port ());
45
46   exit (2);
47
48   return 0;
49 }