]> git.donarmstrong.com Git - lilypond.git/blob - lily/performer-group-performer.cc
tremolo fixes
[lilypond.git] / lily / performer-group-performer.cc
1 /*
2   performer-group-performer.cc -- implement Performer_group_performer
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1996--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7                Jan Nieuwenhuizen <janneke@gnu.org>
8  */
9
10 #include "performer-group-performer.hh"
11
12 #include "audio-element.hh"
13 #include "debug.hh"
14
15
16 ENTER_DESCRIPTION(Performer_group_performer,
17 /* descr */       "",
18 /* creats*/       "",
19 /* acks  */       "",
20 /* reads */       "",
21 /* write */       "");
22
23
24
25 void
26 Performer_group_performer::announce_element (Audio_element_info info)
27 {
28   announce_info_arr_.push (info);
29   Performer::announce_element (info);
30 }
31
32
33
34 void
35 Performer_group_performer::create_audio_elements ()
36 {
37   for (SCM p = simple_trans_list_; gh_pair_p (p); p = ly_cdr (p))
38     {
39       Translator * t = unsmob_translator (ly_car (p));
40       Performer * eng = dynamic_cast<Performer*> (t);
41       if (eng)
42         eng->create_audio_elements ();
43     }
44 }
45
46 void
47 Performer_group_performer::acknowledge_audio_elements ()
48 {
49   for (int j =0; j < announce_info_arr_.size (); j++)
50     {
51       Audio_element_info info = announce_info_arr_[j];
52
53       for (SCM p = simple_trans_list_; gh_pair_p (p); p = ly_cdr (p))
54         {
55           Translator * t = unsmob_translator (ly_car (p));
56           Performer * eng = dynamic_cast<Performer*> (t);
57           if (eng && eng!= info.origin_trans_l_)
58             eng->acknowledge_audio_element (info);
59         }
60     }
61 }
62
63 void
64 Performer_group_performer::do_announces ()
65 {
66   for (SCM p = trans_group_list_; gh_pair_p (p); p =ly_cdr (p))
67     {
68       Translator * t = unsmob_translator (ly_car (p));
69       dynamic_cast<Performer_group_performer*> (t)->do_announces ();
70     }
71
72   
73   create_audio_elements ();
74     
75   while (announce_info_arr_.size ())
76     {
77       acknowledge_audio_elements ();
78       announce_info_arr_.clear ();
79       create_audio_elements ();
80     }
81
82   if (announce_info_arr_.size ())
83     {
84 #if 0  //printf?  -> include <stdio.h>     
85       printf ("do_announces: elt: %s\n",
86               classname (announce_info_arr_[0].elem_l_));
87 #endif      
88       announce_info_arr_.clear ();
89     }
90 }
91
92 Performer_group_performer::Performer_group_performer(){}