- automatic marks.
- */
-
- SCM m = mark_req_->get_mus_property ("label");
- if (Text_item::markup_p (m))
- {
- text_->set_grob_property ("text",m);
- }
- else
- {
- if (!gh_string_p (m) && !gh_number_p (m))
- m = get_property ("rehearsalMark");
-
- if (gh_number_p (m))
- {
- int mark_count = gh_scm2int (m);
- t = to_string (mark_count);
- mark_count ++;
- m = gh_int2scm (mark_count);
- }
- else if (gh_string_p (m))
- {
- t = ly_scm2string (m);
- String next;
- if (t.length ())
- {
- char c = t[0];
- c++;
- next = to_string (c);
- }
- m = scm_makfrom0str (next.to_str0 ());
- }
- else
- {
- m = gh_int2scm (1);
- }
-
- daddy_trans_->set_property ("rehearsalMark", m);
-
- text_->set_grob_property ("text",
- scm_makfrom0str (t.to_str0 ()));
-
- SCM series = SCM_EOL;
- SCM family = ly_symbol2scm ("number");
- for (int i=0; i < t.length (); i++)
- {
- if (!isdigit (t[i]))
- {
- series = ly_symbol2scm ("bold");
- family = ly_symbol2scm ("roman");
- break;
- }
- }
- if (gh_symbol_p (series))
- text_->set_grob_property ("font-series", series);
- if (gh_symbol_p (family))
- text_->set_grob_property ("font-family", family);
- }
+ automatic marks.
+ */
+
+ SCM m = mark_ev_->get_property ("label");
+ SCM proc = get_property ("markFormatter");
+ if (!Text_interface::is_markup (m)
+ && ly_is_procedure (proc))
+ {
+ if (!scm_is_number (m))
+ m = get_property ("rehearsalMark");
+
+ if (scm_integer_p (m) == SCM_BOOL_T
+ && scm_exact_p (m) == SCM_BOOL_T)
+ {
+ int mark_count = scm_to_int (m);
+ mark_count++;
+ context ()->set_property ("rehearsalMark",
+ scm_from_int (mark_count));
+ }
+
+ if (scm_is_number (m))
+ m = scm_call_2 (proc, m, context ()->self_scm ());
+ else
+ /* FIXME: constant error message. */
+ warning (_ ("rehearsalMark must have integer value"));
+ }
+
+ if (Text_interface::is_markup (m))
+ text_->set_property ("text", m);
+ else
+ warning (_ ("mark label must be a markup object"));