#include "book.hh"
#include "context-def.hh"
#include "dimensions.hh"
-#include "event.hh"
+#include "music.hh"
#include "file-path.hh"
#include "input-smob.hh"
#include "input.hh"
#include "paper-book.hh"
#include "output-def.hh"
#include "scm-hash.hh"
-#include "scm-option.hh"
+#include "program-option.hh"
#include "score.hh"
-#include "text-item.hh"
+#include "text-interface.hh"
#include "warn.hh"
+#include "music.hh"
#define MY_MAKE_MUSIC(x) make_music_by_name (ly_symbol2scm (x))
SCM tags = m->get_property ("tags");
if (scm_is_symbol (tag))
tags = scm_cons (tag, tags);
- else if (ly_c_list_p (tag))
+ else if (ly_is_list (tag))
tags = ly_append2 (tag, tags);
else
ip.warning (_ ("tag must be symbol or list of symbols"));
bool
ly_input_procedure_p (SCM x)
{
- return ly_c_procedure_p (x)
- || (scm_is_pair (x) && ly_c_procedure_p (scm_car (x)));
+ return ly_is_procedure (x)
+ || (scm_is_pair (x) && ly_is_procedure (scm_car (x)));
}
Music*
;
score_body:
- /**/ {
- $$ = new Score;
+ Music {
+ SCM m = $1->self_scm ();
+ scm_gc_unprotect_object (m);
+ SCM scorify = ly_lily_module_constant ("scorify-music");
+ SCM score = scm_call_2 (scorify, m, THIS->self_scm ());
+
+ // pass ownernship to C++ again.
+ scm_gc_protect_object (score);
+ $$ = unsmob_score (score);
$$->set_spot (@$);
}
| SCORE_IDENTIFIER {
- $$ = new Score ( *unsmob_score ($1));
+ $$ = unsmob_score ($1);
$$->set_spot (@$);
}
| score_body object_id_setting {
$$->user_key_ = ly_scm2string ($2);
}
- | score_body Music {
- SCM m = $2->self_scm ();
- scm_gc_unprotect_object (m);
- $$->set_music (m, THIS->self_scm ());
- }
| score_body lilypond_header {
$$->header_ = $2;
}
r-> set_property ("element", beg->self_scm ());
scm_gc_unprotect_object (beg->self_scm ());
}
- r->set_property ("repeat-count", scm_int2num (times >? 1));
+ r->set_property ("repeat-count", scm_int2num (max (times, 1)));
r-> set_property ("elements",alts);
- if (ly_c_equal_p ($2, scm_makfrom0str ("tremolo"))) {
+ if (ly_is_equal ($2, scm_makfrom0str ("tremolo"))) {
/*
TODO: move this code to Scheme.
*/
}
| bare_number {
$$ = $1;
-/* if (scm_integer_p ($1) == SCM_BOOL_T)
- {
- int k = scm_to_int (scm_inexact_to_exact ($1));
- $$ = k;
- } else
- {
- THIS->parser_error (@1, _ ("need integer number arg"));
- $$ = 0;
- }*/
}
| embedded_scm {
$$ = $1;
{
Duration dd = THIS->default_duration_;
$$ = dd.smobbed_copy ();
-
- THIS->beam_check ($$);
}
| multiplied_duration {
$$ = $1;
THIS->default_duration_ = *unsmob_duration ($$);
-
- THIS->beam_check ($$);
}
;
}
-/* FIXME: Should make this optional? It will also complain at
-
- [s4]
-
-which is entirely legitimate.
-
-Or we can scrap it. Barchecks should detect wrong durations, and
-skipTypesetting speeds it up a lot. */
-
-void
-Lily_parser::beam_check (SCM dur)
-{
- Duration *d = unsmob_duration (dur);
- if (unsmob_music (last_beam_start_) && d->duration_log () <= 2)
- {
- Music *m = unsmob_music (last_beam_start_);
- m->origin ()->warning (_f ("suspect duration in beam: %s",
- d->to_string ()));
- }
- last_beam_start_ = SCM_EOL;
-}
-
*destination = mus->self_scm ();
unsmob_music (*destination)->
set_property ("origin", make_input (last_input_));
- return dynamic_cast<Event*> (mus)
- ? EVENT_IDENTIFIER : MUSIC_IDENTIFIER;
+
+ bool is_event = scm_memq (ly_symbol2scm ("event"), mus->get_property ("types"))
+ != SCM_BOOL_F;
+
+ return is_event ? EVENT_IDENTIFIER : MUSIC_IDENTIFIER;
} else if (unsmob_duration (sid)) {
*destination = unsmob_duration (sid)->smobbed_copy ();
return DURATION_IDENTIFIER;
bool itc = do_internal_type_checking_global;
/* UGH.
*/
- bool autobeam = ly_c_equal_p (symbol, ly_symbol2scm ("autoBeamSettings"));
+ bool autobeam = ly_is_equal (symbol, ly_symbol2scm ("autoBeamSettings"));
if (autobeam)
do_internal_type_checking_global = false;
m->set_property ("grob-property", grob_sym);