-Music *
-property_op_to_music (SCM op)
-{
- Music *m = 0;
- SCM tag = scm_car (op);
- SCM symbol = scm_cadr (op);
- SCM args = scm_cddr (op);
- SCM grob_val = SCM_UNDEFINED;
- SCM grob_path = SCM_UNDEFINED;
- SCM val = SCM_UNDEFINED;
-
- if (tag == ly_symbol2scm ("assign"))
- {
- m = MY_MAKE_MUSIC ("PropertySet");
- val = scm_car (args);
- }
- else if (tag == ly_symbol2scm ("unset"))
- m = MY_MAKE_MUSIC ("PropertyUnset");
- else if (tag == ly_symbol2scm ("push"))
- {
- m = MY_MAKE_MUSIC ("OverrideProperty");
- grob_val = scm_car (args);
- grob_path = scm_cdr (args);
- m->set_property ("pop-first", SCM_BOOL_T);
- }
- else if (tag == ly_symbol2scm ("pop")) {
- m = MY_MAKE_MUSIC ("RevertProperty");
- grob_path = args;
- }
-
- m->set_property ("symbol", symbol);
-
- if (val != SCM_UNDEFINED)
- m->set_property ("value", val);
- if (grob_val != SCM_UNDEFINED)
- m->set_property ("grob-value", grob_val);
- if (grob_path != SCM_UNDEFINED)
- m->set_property ("grob-property-path", grob_path);
-
- return m;
-}
-
-Music*
-context_spec_music (SCM type, SCM id, Music *m, SCM ops)
-{
- Music *csm = MY_MAKE_MUSIC ("ContextSpeccedMusic");
-
- csm->set_property ("element", m->self_scm ());
- m->unprotect ();
-
- csm->set_property ("context-type",
- scm_is_symbol (type) ? type : scm_string_to_symbol (type));
- csm->set_property ("property-operations", ops);
-
- if (scm_is_string (id))
- csm->set_property ("context-id", id);
- return csm;
-}
-