+2004-08-11 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * lily/dynamic-engraver.cc (typeset_all):
+ * lily/script-engraver.cc (stop_translation_timestep): Handle
+ collisions with new-slur.
+
+2004-08-10 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * scm/define-grobs.scm (all-grob-descriptions): Add
+ new-slur-interface.
+
+2004-08-03 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * elisp/lilypond-mode.el (LilyPond-command-alist): LilyPond now
+ produces .PS
+
2004-08-09 Carl Sorensen <carldsorensen@comcast.net>
* scm/define-grob-properties.scm (all-user-grob-properties): fix
;; Should expand this to include possible keyboard shortcuts which
;; could then be mapped to define-key and menu.
`(
- ("LilyPond" . ("lilypond-bin %s" "%s" "%l" "LaTeX"))
+ ("LilyPond" . ("lilypond %s" "%s" "%l" "ViewPS"))
("TeX" . ("tex '\\nonstopmode\\input %t'" "%t" "%d" "View"))
- ("2Dvi" . ("lilypond %s" "%s" "%d" "View"))
- ("2PS" . ("lilypond -P %s" "%s" "%p" "ViewPS"))
+ ("2Dvi" . ("lilypond -f tex %s" "%s" "%d" "LaTeX"))
+ ("2PS" . ("lilypond -f ps %s" "%s" "%p" "ViewPS"))
("2Midi" . ("lilypond -m %s" "%s" "%m" "Midi"))
("Book" . ("lilypond-book %x" "%x" "%l" "LaTeX"))
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "warn.hh"
+
+#include "axis-group-interface.hh"
+#include "context.hh"
#include "dimensions.hh"
-#include "hairpin.hh"
-#include "event.hh"
-#include "paper-column.hh"
-#include "note-column.hh"
-#include "item.hh"
-#include "side-position-interface.hh"
+#include "directional-element-interface.hh"
#include "engraver.hh"
+#include "event.hh"
#include "group-interface.hh"
-#include "directional-element-interface.hh"
-#include "context.hh"
-#include "axis-group-interface.hh"
+#include "hairpin.hh"
+#include "item.hh"
+#include "new-slur.hh"
+#include "note-column.hh"
+#include "paper-column.hh"
#include "script-interface.hh"
+#include "side-position-interface.hh"
+#include "staff-symbol-referencer.hh"
+#include "warn.hh"
/*
TODO:
*/
class Dynamic_engraver : public Engraver
{
- Item * script_;
+ Item *script_;
Spanner *line_spanner_;
+ Grob *slur_;
Spanner *cresc_;
Spanner *finished_line_spanner_;
Dynamic_engraver::Dynamic_engraver ()
{
script_ = 0;
+ slur_ = 0;
finished_cresc_ = 0;
line_spanner_ = 0;
finished_line_spanner_ = 0;
typeset_all ();
if (!current_cresc_ev_)
{
+
finished_line_spanner_ = line_spanner_;
- line_spanner_ =0;
+ line_spanner_ = 0;
typeset_all ();
+ slur_ = 0;
}
script_ev_ = 0;
void
Dynamic_engraver::typeset_all ()
-{
+{
+ if (finished_line_spanner_ && slur_
+ && get_slur_dir (slur_) == get_grob_direction (finished_line_spanner_))
+ {
+ Real ss = Staff_symbol_referencer::staff_space (finished_line_spanner_);
+ Real pad = robust_scm2double (finished_line_spanner_->get_property ("padding"), 0);
+ /* FIXME: 1ss padding hardcoded */
+ finished_line_spanner_->set_property ("padding",
+ scm_make_real (pad + ss));
+ }
+
if (finished_cresc_)
{
if (!finished_cresc_->get_bound (RIGHT))
finished_cresc_->set_bound (RIGHT, script_
? script_
: unsmob_grob (get_property ("currentMusicalColumn")));
-
+
if (finished_line_spanner_)
add_bound_item (finished_line_spanner_,
finished_cresc_->get_bound (RIGHT));
Dynamic_engraver::acknowledge_grob (Grob_info i)
{
if (!line_spanner_)
- return ;
-
+ return;
+
if (Note_column::has_interface (i.grob_))
{
if (line_spanner_
if (ly_c_pair_p (head))
script_->set_parent (unsmob_grob (ly_car (head)), X_AXIS);
}
-
}
else if (Script_interface::has_interface (i.grob_) && script_)
{
DynamicText doesn't really have a script-priority field.
*/
if (ly_c_number_p (p)
- && ly_scm2int (p) < ly_scm2int (script_->get_property ("script-priority")))
- {
- Side_position_interface::add_support (line_spanner_, i.grob_);
-
- }
+ && ly_scm2int (p)
+ < ly_scm2int (script_->get_property ("script-priority")))
+ Side_position_interface::add_support (line_spanner_, i.grob_);
}
+ else if (New_slur::has_interface (i.grob_) && line_spanner_)
+ slur_ = i.grob_;
}
ENTER_DESCRIPTION (Dynamic_engraver,
/* creats*/ "DynamicLineSpanner DynamicText Hairpin TextSpanner",
/* accepts */ "absolute-dynamic-event crescendo-event decrescendo-event",
-/* acks */ "note-column-interface script-interface",
+/* acks */ "note-column-interface script-interface new-slur-interface",
/* reads */ "",
/* write */ "");
#include "grob.hh"
+// what is the advantage not having these two as STATICs of GROB -- jcn
void set_grob_direction (Grob*, Direction);
Direction get_grob_direction (Grob*);
DECLARE_SCHEME_CALLBACK (height, (SCM,SCM));
static void set_interface (Grob *);
- static bool has_interface (Grob *);
+ static bool has_interface (Grob *);
static Bezier get_curve (Grob*me);
};
-
+// zught
+Direction get_slur_dir (Grob *slur);
#endif /* NEW_SLUR_HH */
*/
#include "context.hh"
+#include "directional-element-interface.hh"
#include "engraver.hh"
#include "event.hh"
+#include "new-slur.hh"
#include "note-column.hh"
#include "rhythmic-head.hh"
#include "script-interface.hh"
#include "side-position-interface.hh"
+#include "staff-symbol-referencer.hh"
#include "stem.hh"
#include "warn.hh"
class Script_engraver : public Engraver
{
Array<Script_tuple> scripts_;
+ Grob *slur_;
protected:
virtual bool try_music (Music*);
Script_engraver::Script_engraver ()
{
+ slur_ = 0;
}
bool
e->set_parent (inf.grob_, X_AXIS);
}
}
+ else if (New_slur::has_interface (inf.grob_) && script_count)
+ slur_ = inf.grob_;
}
void
::quantised_position_proc, Y_AXIS);
sc->set_property ("staff-padding", SCM_EOL);
}
+ SCM priority = sc->get_property ("script-priority");
+ if (robust_scm2int (priority, 0) >= 0
+ && slur_
+ && get_grob_direction (sc) == get_slur_dir (slur_))
+ {
+ Real ss = Staff_symbol_referencer::staff_space (sc);
+ Real pad = robust_scm2double (sc->get_property ("padding"), 0);
+
+ /* FIXME: 1ss padding hardcoded */
+ sc->set_property ("padding", scm_make_real (pad + ss));
+ }
}
+ slur_ = 0;
scripts_.clear ();
}
/* descr */ "Handles note scripted articulations.",
/* creats*/ "Script",
/* accepts */ "script-event articulation-event",
-/* acks */ "stem-interface rhythmic-head-interface note-column-interface",
+/* acks */ "stem-interface rhythmic-head-interface\
+ new-slur-interface note-column-interface",
/* reads */ "scriptDefinitions",
/* write */ "");
}
else if (d == START)
{
- // push a new slur onto stack.
- // (use temp. array to wait for all slur STOPs)
- Grob* slur = make_spanner ("Slur", slur_ev->self_scm ());
+ /* push a new slur onto stack.
+ (use temp. array to wait for all slur STOPs) */
+ Grob *slur = make_spanner ("Slur", slur_ev->self_scm ());
if (Direction updown = to_dir (slur_ev->get_property ("direction")))
- {
- slur->set_property ("direction", scm_int2num (updown));
- }
-
+ slur->set_property ("direction", scm_int2num (updown));
+
start_slurs.push (slur);
events_.push (slur_ev);
}
return d;
}
+Direction
+get_slur_dir (Grob *slur)
+{
+ Direction d = get_grob_direction (slur);
+ if (d == CENTER)
+ d = get_default_dir (slur);
+ return d;
+}
+
MAKE_SCHEME_CALLBACK (New_slur, after_line_breaking,1);
SCM
New_slur::after_line_breaking (SCM smob)
\consists "Melisma_translator"
\consists "Part_combine_engraver"
-%{
- Must come before text_engraver, but after note_column engraver.
-
-%}
\consists "Text_engraver"
\consists "Dynamic_engraver"
\consists "Fingering_engraver"
(append
all-internal-grob-properties
all-user-grob-properties))
-
(Y-extent-callback . ,New_slur::height)
(height-limit . 2.0)
(ratio . 0.333)
- (meta . ((interfaces . (slur-interface spanner-interface))))
+ (meta . ((interfaces . (slur-interface new-slur-interface spanner-interface))))
))
(NonMusicalPaperColumn
; Slur::height)
(height-limit . 2.0)
(ratio . 0.25)
- (meta . ((interfaces . (slur-interface spanner-interface))))
+ (meta . ((interfaces . (slur-interface new-slur-interface spanner-interface))))
))
(SpacingSpanner
;; aliases
("T1" . "tex256.enc")
("adobe" . "8a.enc")
- ("latin1" . "latin1.enc")
+ ;;("latin1" . "latin1.enc")
+ ("latin1" . "cork.enc")
("ec" . "EC.enc")
;; LilyPond.