]> git.donarmstrong.com Git - lilypond.git/blob - lily/compressed-music-iterator.cc
release: 1.0.15
[lilypond.git] / lily / compressed-music-iterator.cc
1 /*   
2   compressed-music-iterator.cc --  implement Compressed_music_iterator
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #include "compressed-music-iterator.hh"
11 #include "compressed-music.hh"
12 #include "musical-request.hh"
13 #include "translator-group.hh"
14 #include "command-request.hh"
15
16 IMPLEMENT_IS_TYPE_B1(Compressed_music_iterator, Music_wrapper_iterator);
17
18 Compressed_music_iterator::Compressed_music_iterator ()
19 {
20   Bracket_req pr;
21   pr.spantype = Span_req::START;
22   //  pr.plet_i_ = 1;
23   start_req_p_ = new Bracket_req (pr);
24   pr.spantype = Span_req::STOP;
25   stop_req_p_ =new Bracket_req (pr);
26 }
27
28 Compressed_music_iterator::~Compressed_music_iterator ()
29 {
30   delete start_req_p_;
31   delete stop_req_p_;
32 }
33
34 Compressed_music *
35 Compressed_music_iterator::compressed_l () const
36 {
37   return (Compressed_music*) music_l_;
38 }
39
40 void
41 Compressed_music_iterator::construct_children ()
42 {
43   /*
44     start_req_p_->plet_i_ = compressed_l ()->den_i_;
45     stop_req_p_->plet_i_ = compressed_l ()->den_i_;  
46   */
47   Music_wrapper_iterator::construct_children ();
48 }
49
50 void
51 Compressed_music_iterator::do_process_and_next (Moment m)
52 {
53   if (first_b_)
54     {
55       bool success = report_to_l ()->try_request (start_req_p_);
56       if (!success)
57         music_l_->warning ( _("No one to print a tuplet start bracket"));
58     }
59
60   Music_wrapper_iterator::do_process_and_next (m);
61   
62   if (!ok ())
63     {
64       bool success = report_to_l ()->try_request (stop_req_p_);
65       if (!success)
66           music_l_->warning ( _("No one to print a tuplet stop bracket"));
67     }
68 }