]> git.donarmstrong.com Git - lilypond.git/blob - lily/grace-iterator.cc
18a7a62bf6c776e235faa1eeabd5bee881cae30d
[lilypond.git] / lily / grace-iterator.cc
1 /*   
2   grace-iterator.cc --  implement Grace_iterator
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #include "grace-iterator.hh"
11 #include "global-translator.hh"
12 #include "warn.hh"
13
14 Grace_iterator::~Grace_iterator () 
15 {
16   //  child_iter_p_ = 0;
17 }
18
19 void
20 Grace_iterator::construct_children () 
21 {
22   Translator_group * t = report_to_l ()->find_create_translator_l ("Grace", ""); // umgh.
23
24   if (t)
25     set_translator (t);
26   Music_wrapper_iterator::construct_children ();
27 }
28
29 void
30 Grace_iterator::process (Moment)
31 {
32   Global_translator * t = dynamic_cast<Global_translator*> (report_to_l ());
33   if (t)
34     {
35       t->start ();
36       t->run_iterator_on_me (child_iter_p_);
37       delete child_iter_p_;
38       child_iter_p_ = 0;
39       t->finish ();
40     }
41   else
42     {
43       warning (_ ("no Grace context available")); 
44     }
45 }
46
47 Moment
48 Grace_iterator::pending_moment () const
49 {
50   return 0;
51 }
52
53
54 IMPLEMENT_CTOR_CALLBACK (Grace_iterator);