X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpaper-book.cc;h=f1787e99550f2bb09eb001188b69384c69e5f004;hb=dcb458c225534895f69f4c05137809d20d6a79b9;hp=b79041bb7b44eb30c55d433267a46d2718bc9b11;hpb=0c14539bc83d6bb405141b6f21430b33d1e8fcf0;p=lilypond.git diff --git a/lily/paper-book.cc b/lily/paper-book.cc index b79041bb7b..f1787e9955 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -30,6 +30,8 @@ #include "warn.hh" #include "program-option.hh" #include "page-marker.hh" +#include "ly-module.hh" +#include "lily-imports.hh" Paper_book::Paper_book () @@ -51,10 +53,10 @@ Paper_book::~Paper_book () { } -const char Paper_book::type_p_name_[] = "ly:paper-book?"; +const char * const Paper_book::type_p_name_ = "ly:paper-book?"; SCM -Paper_book::mark_smob () +Paper_book::mark_smob () const { if (paper_) scm_gc_mark (paper_->self_scm ()); @@ -116,12 +118,9 @@ Paper_book::output_aux (SCM output_channel, long page_nb = 0; if (scm_is_pair (performances_)) { - SCM proc = ly_lily_module_constant ("write-performances-midis"); - - scm_call_3 (proc, - performances (), - output_channel, - scm_from_long (*first_performance_number)); + Lily::write_performances_midis (performances (), + output_channel, + scm_from_long (*first_performance_number)); *first_performance_number += scm_ilength (performances_); } @@ -220,6 +219,25 @@ Paper_book::output (SCM output_channel) warning (_f ("program option -dpreview not supported by backend `%s'", get_output_backend_name ())); } + + if (get_program_option ("crop")) + { + SCM framework + = ly_module_lookup (mod, ly_symbol2scm ("output-crop-framework")); + + if (scm_is_true (framework)) + { + SCM func = scm_variable_ref (framework); + scm_call_4 (func, + output_channel, + self_scm (), + scopes, + dump_fields ()); + } + else + warning (_f ("program option -dcrop not supported by backend `%s'", + get_output_backend_name ())); + } } void @@ -228,11 +246,9 @@ Paper_book::classic_output_aux (SCM output, { if (scm_is_pair (performances_)) { - SCM proc = ly_lily_module_constant ("write-performances-midis"); - scm_call_3 (proc, - performances (), - output, - scm_from_long (*first_performance_number)); + Lily::write_performances_midis (performances (), + output, + scm_from_long (*first_performance_number)); *first_performance_number += scm_ilength (performances_); } @@ -433,10 +449,8 @@ Paper_book::get_system_specs () } SCM page_properties - = scm_call_1 (ly_lily_module_constant ("layout-extract-page-properties"), - paper_->self_scm ()); + = Lily::layout_extract_page_properties (paper_->self_scm ()); - SCM interpret_markup_list = ly_lily_module_constant ("interpret-markup-list"); SCM header = SCM_EOL; SCM labels = SCM_EOL; for (SCM s = scm_reverse (scores_); scm_is_pair (s); s = scm_cdr (s)) @@ -497,10 +511,9 @@ Paper_book::get_system_specs () } else if (Text_interface::is_markup_list (scm_car (s))) { - SCM texts = scm_call_3 (interpret_markup_list, - paper_->self_scm (), - page_properties, - scm_car (s)); + SCM texts = Lily::interpret_markup_list (paper_->self_scm (), + page_properties, + scm_car (s)); Prob *first = 0; Prob *last = 0; for (SCM list = texts; scm_is_pair (list); list = scm_cdr (list)) @@ -520,7 +533,7 @@ Paper_book::get_system_specs () SCM footnotes = get_footnotes (unsmob (t)->expr ()); ps->set_property ("footnotes", footnotes); ps->set_property ("is-title", SCM_BOOL_T); - if (list == texts) + if (scm_is_eq (list, texts)) first = ps; else {