2 music-output-def.cc -- implement Music_output_def
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
10 #include "music-output-def.hh"
11 #include "global-translator.hh"
12 #include "dictionary-iter.hh"
15 Music_output_def::get_next_default_count () const
20 IMPLEMENT_IS_TYPE_B(Music_output_def
);
22 Music_output_def::Music_output_def ()
26 Music_output_def::~Music_output_def ()
28 for (Dictionary_iter
<Translator
*> i (translator_p_dict_
); i
.ok (); i
++)
32 Music_output_def::Music_output_def (Music_output_def
const &s
)
34 outfile_str_
= s
.outfile_str_
;
35 for (Dictionary_iter
<Translator
*> i (s
.translator_p_dict_
); i
.ok (); i
++)
36 assign_translator (i
.key (), i
.val ()->clone ());
40 Music_output_def::find_translator_l (String name
) const
42 if (translator_p_dict_
.elt_b (name
))
43 return translator_p_dict_
[name
];
45 if (global_translator_dict_p
->elt_b (name
))
46 return (*global_translator_dict_p
)[name
];
53 Music_output_def::get_global_translator_p ()
55 Translator
* t
= find_translator_l ("Score")->clone ();
56 Global_translator
*g
= t
->group_l ()->global_l ();
64 Music_output_def::assign_translator (String s
, Translator
*t
)
67 t
->output_def_l_
= this;
69 if (translator_p_dict_
.elt_b (s
))
70 delete translator_p_dict_
[s
];
71 translator_p_dict_
[s
] = t
;
75 Music_output_def::print () const
78 for (Dictionary_iter
<Translator
*> i (translator_p_dict_
); i
.ok (); i
++)
80 DOUT
<< i
.key () << " = ";
83 DOUT
<< "output: " << outfile_str_
;