Index: lily/left-bar-stub-engraver.cc |
diff --git a/lily/left-bar-stub-engraver.cc b/lily/left-bar-stub-engraver.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2a2fd3e8cd3c1a9b21e295ef1a9a4c33ea7c1213 |
--- /dev/null |
+++ b/lily/left-bar-stub-engraver.cc |
@@ -0,0 +1,72 @@ |
+/* |
+ This file is part of LilyPond, the GNU music typesetter. |
+ |
+ Copyright (C) 2011 Mike Solomon <mike@apollinemike.com> |
+ |
+ LilyPond is free software: you can redistribute it and/or modify |
+ it under the terms of the GNU General Public License as published by |
+ the Free Software Foundation, either version 3 of the License, or |
+ (at your option) any later version. |
+ |
+ LilyPond is distributed in the hope that it will be useful, |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+ GNU General Public License for more details. |
+ |
+ You should have received a copy of the GNU General Public License |
+ along with LilyPond. If not, see <http://www.gnu.org/licenses/>. |
+*/ |
+ |
+#include "engraver.hh" |
+ |
+#include "stream-event.hh" |
+#include "item.hh" |
+ |
+#include "translator.icc" |
+ |
+class Left_bar_stub_engraver : public Engraver |
+{ |
+ TRANSLATOR_DECLARATIONS (Left_bar_stub_engraver); |
+ bool bar_; |
+ bool first_; |
+ |
+ void process_acknowledged (); |
+ void stop_translation_timestep (); |
+}; |
+ |
+void |
+Left_bar_stub_engraver::stop_translation_timestep () |
+{ |
+ bar_ = false; |
+} |
+ |
+void |
+Left_bar_stub_engraver::process_acknowledged () |
+{ |
+ if (first_ || (!bar_ && scm_is_string (get_property ("whichBar")))) |
+ { |
+ bar_ = true; |
+ first_ = false; |
+ make_item ("LeftBarStub", SCM_EOL); |
+ } |
+} |
+ |
+Left_bar_stub_engraver::Left_bar_stub_engraver () |
+{ |
+ bar_ = false; |
+ first_ = true; |
+} |
+ |
+ADD_TRANSLATOR (Left_bar_stub_engraver, |
+ /* doc */ |
+ "Create left bar stubs.", |
+ |
+ /* create */ |
+ "LeftBarStub ", |
+ |
+ /*read*/ |
+ "whichBar ", |
+ |
+ /*write*/ |
+ "" |
+ ); |