source file of the GNU LilyPond music typesetter
- (c) 1998--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "engraver.hh"
#include "side-position-interface.hh"
#include "item.hh"
-#include "musical-request.hh"
+#include "event.hh"
#include "stem.hh"
#include "rhythmic-head.hh"
+#include "text-item.hh"
/**
*/
class Text_engraver : public Engraver
{
- Link_array<Text_script_req> reqs_;
+ Link_array<Music> reqs_;
Link_array<Item> texts_;
public:
TRANSLATOR_DECLARATIONS(Text_engraver);
bool
Text_engraver::try_music (Music *m)
{
- if (dynamic_cast<Text_script_req*> (m)
- && m->get_mus_property ("text-type") != ly_symbol2scm ("finger")
- && m->get_mus_property ("text-type") != ly_symbol2scm ("dynamic"))
+ if (m->is_mus_type ("text-script-event"))
{
- reqs_.push (dynamic_cast<Text_script_req*> (m));
+ reqs_.push (m);
return true;
}
return false;
return;
for (int i=0; i < reqs_.size (); i++)
{
- Text_script_req * r = reqs_[i];
+ Music * r = reqs_[i];
// URG: Text vs TextScript
String basic = "TextScript";
if (gh_number_p (s))
priority = gh_scm2int (s);
- /* Make sure they're in order of user input by adding index i. */
- priority += i * (r->get_direction () ? r->get_direction () : 1);
+ /* see script-engraver.cc */
+ priority += i;
text->set_grob_property ("script-priority", gh_int2scm (priority));
- if (r->get_direction ())
- Side_position_interface::set_direction (text, r->get_direction ());
+ Direction dir = to_dir (r->get_mus_property ("direction"));
+ if (dir)
+ Side_position_interface::set_direction (text, dir);
+
+
+ SCM mark = r->get_mus_property ("text");
+
+ if (new_markup_p (mark))
+ text->set_grob_property ("molecule-callback", new_markup_brewer());
- text->set_grob_property ("text", r->get_mus_property ("text"));
+ text->set_grob_property ("text", mark);
announce_grob (text, r->self_scm ());
texts_.push (text);
}
ENTER_DESCRIPTION(Text_engraver,
/* descr */ "Create text-scripts",
/* creats*/ "TextScript",
-/* acks */ "rhythmic-head-interface stem-interface",
+/* accepts */ "text-script-event",
+/* acks */ "rhythmic-head-interface stem-interface",
/* reads */ "scriptHorizontal",
/* write */ "");