+2006-08-20 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+ * scm/define-music-types.scm (music-descriptions): use
+ apply-output-event for ApplyOutputEvent
+
+ * lily/output-property-engraver.cc (listen_apply_output): rename
+ from listen_layout_instruction.
+
+ * lily/piano-pedal-engraver.cc (struct Pedal_type_info): new
+ function protect()
+
2006-08-19 Han-Wen Nienhuys <hanwen@lilypond.org>
* scm/lily.scm (lilypond-all): option read-file-list: substitute
#include "music.hh"
#include "simple-music-iterator.hh"
-/**
- Iterate a property.
-*/
class Apply_context_iterator : public Simple_music_iterator
{
public:
TRANSLATOR_DECLARATIONS (Output_property_engraver);
protected:
vector<Stream_event*> props_;
+
DECLARE_ACKNOWLEDGER (grob);
- DECLARE_TRANSLATOR_LISTENER (layout_instruction);
+ DECLARE_TRANSLATOR_LISTENER (apply_output);
void stop_translation_timestep ();
};
-IMPLEMENT_TRANSLATOR_LISTENER (Output_property_engraver, layout_instruction);
+IMPLEMENT_TRANSLATOR_LISTENER (Output_property_engraver, apply_output);
void
-Output_property_engraver::listen_layout_instruction (Stream_event *ev)
+Output_property_engraver::listen_apply_output (Stream_event *ev)
{
/*
UGH. Only swallow the output property event in the context
"",
/* accept */
- "layout-instruction-event",
+ "apply-output-event",
/* read */
"",
struct Pedal_type_info
{
string base_name_;
- Protected_scm event_class_sym_;
- Protected_scm style_sym_;
- Protected_scm strings_sym_;
+ SCM event_class_sym_;
+ SCM style_sym_;
+ SCM strings_sym_;
const char *pedal_line_spanner_c_str_;
const char *pedal_c_str_;
+
+ Pedal_type_info ()
+ {
+ event_class_sym_ = SCM_EOL;
+ style_sym_ = SCM_EOL;
+ strings_sym_ = SCM_EOL;
+ pedal_line_spanner_c_str_ = 0;
+ pedal_c_str_ = 0;
+ }
+ void protect ()
+ {
+ scm_gc_protect_object (event_class_sym_);
+ scm_gc_protect_object (style_sym_);
+ scm_gc_protect_object (strings_sym_);
+ }
};
struct Pedal_info
}
base_ident += String_convert::to_lower (string (name, prev_pos, cur_pos - prev_pos));
- Pedal_type_info *tbl = &pedal_types_[i];
- tbl->base_name_ = name;
- tbl->event_class_sym_ = scm_str2symbol ((base_ident + "-event").c_str ());
- tbl->pedal_line_spanner_c_str_ = strdup ((base_name + "PedalLineSpanner").c_str ());
- tbl->style_sym_ = scm_str2symbol (("pedal" + base_name + "Style").c_str ());
- tbl->strings_sym_ = scm_str2symbol (("pedal" + base_name + "Strings").c_str ());
- tbl->pedal_c_str_ = strdup ((base_name + "Pedal").c_str ());
+ /*
+ be careful, as we don't want to loose references to the _sym_ members.
+ */
+ Pedal_type_info info;
+ info.event_class_sym_ = scm_str2symbol ((base_ident + "-event").c_str ());
+ info.style_sym_ = scm_str2symbol (("pedal" + base_name + "Style").c_str ());
+ info.strings_sym_ = scm_str2symbol (("pedal" + base_name + "Strings").c_str ());
+
+ info.pedal_line_spanner_c_str_ = strdup ((base_name + "PedalLineSpanner").c_str ());
+ info.base_name_ = name;
+ info.pedal_c_str_ = strdup ((base_name + "Pedal").c_str ());
+
+ info.protect ();
+
+ pedal_types_[i] = info;
}
}
ADD_SCM_INIT_FUNC (Piano_pedal_engraver_init_pedal_types_, init_pedal_types);
multi-measure-text-event note-grouping-event
pes-or-flexa-event repeat-tie-event spacing-section-event
layout-instruction-event))
+ (layout-instruction-event . (apply-output-event))
(script-event . (articulation-event text-script-event))
(part-combine-event . (solo1-event solo2-event unisono-event))
(break-event . (line-break-event page-break-event page-turn-event))
3. context where FUNC is called.
")
- (types . (general-music event layout-instruction-event))
+ (types . (general-music event apply-output-event))
))
(ArpeggioEvent
. (
@code{\\override [ @var{Ctxt} . ] @var{Obj} @var{prop} = @var{val}}
")
- (types . (general-music layout-instruction-event))
+ (types . (general-music layout-instruction-event override-property-event))
(iterator-ctor . ,ly:push-property-iterator::constructor)
))
(PageBreakEvent