LEFT | RIGHT |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 2011 Mike Solomon <mike@apollinemike.com> | 4 Copyright (C) 2011 Mike Solomon <mike@apollinemike.com> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 #include "stream-event.hh" | 22 #include "stream-event.hh" |
23 #include "item.hh" | 23 #include "item.hh" |
24 | 24 |
25 #include "translator.icc" | 25 #include "translator.icc" |
26 | 26 |
27 class Left_bar_stub_engraver : public Engraver | 27 class Left_bar_stub_engraver : public Engraver |
28 { | 28 { |
29 TRANSLATOR_DECLARATIONS (Left_bar_stub_engraver); | 29 TRANSLATOR_DECLARATIONS (Left_bar_stub_engraver); |
30 bool bar_; | 30 bool bar_; |
| 31 bool first_; |
31 | 32 |
32 void process_acknowledged (); | 33 void process_acknowledged (); |
33 void stop_translation_timestep (); | 34 void stop_translation_timestep (); |
34 }; | 35 }; |
35 | 36 |
36 void | 37 void |
37 Left_bar_stub_engraver::stop_translation_timestep () | 38 Left_bar_stub_engraver::stop_translation_timestep () |
38 { | 39 { |
39 bar_ = false; | 40 bar_ = false; |
40 } | 41 } |
41 | 42 |
42 void | 43 void |
43 Left_bar_stub_engraver::process_acknowledged () | 44 Left_bar_stub_engraver::process_acknowledged () |
44 { | 45 { |
45 if (!bar_ && scm_is_string (get_property ("whichBar"))) | 46 if (first_ || (!bar_ && scm_is_string (get_property ("whichBar")))) |
46 { | 47 { |
47 bar_ = true; | 48 bar_ = true; |
| 49 first_ = false; |
48 make_item ("LeftBarStub", SCM_EOL); | 50 make_item ("LeftBarStub", SCM_EOL); |
49 } | 51 } |
50 } | 52 } |
51 | 53 |
52 Left_bar_stub_engraver::Left_bar_stub_engraver () | 54 Left_bar_stub_engraver::Left_bar_stub_engraver () |
53 { | 55 { |
54 bar_ = false; | 56 bar_ = false; |
| 57 first_ = true; |
55 } | 58 } |
56 | 59 |
57 ADD_TRANSLATOR (Left_bar_stub_engraver, | 60 ADD_TRANSLATOR (Left_bar_stub_engraver, |
58 /* doc */ | 61 /* doc */ |
59 "Create left bar stubs.", | 62 "Create left bar stubs.", |
60 | 63 |
61 /* create */ | 64 /* create */ |
62 "LeftBarStub ", | 65 "LeftBarStub ", |
63 | 66 |
64 /*read*/ | 67 /*read*/ |
65 "whichBar ", | 68 "whichBar ", |
66 | 69 |
67 /*write*/ | 70 /*write*/ |
68 "" | 71 "" |
69 ); | 72 ); |
LEFT | RIGHT |