Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(489)

Unified Diff: lily/left-bar-stub-engraver.cc

Issue 5201043: Creates a LeftBarStub that stops lyrics from bumping into the SystemStartBar.
Patch Set: Allows extremal LeftBarStubs to be flush with system start. Created 12 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lily/item-scheme.cc ('k') | ly/engraver-init.ly » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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*/
+ ""
+ );
« no previous file with comments | « lily/item-scheme.cc ('k') | ly/engraver-init.ly » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b