From 9066eeede909ace56324c905217c5b585ba42f90 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 27 Jul 2014 15:21:22 +0200 Subject: [PATCH] Replace remaining uses of unsmob_xxx with Xxx::unsmob This runs sed -i 's/unsmob_\(engraver\|global_context\|input\|item\|music\|paper_score\|performance\|performer\|spanner\|stream_event\)\b/\u\1::unsmob/g' $(git grep -l unsmob_ lily) as the mechanical part of the conversion. A separate commit provides the required definitions. --- lily/accidental-placement.cc | 2 +- lily/articulations.cc | 2 +- lily/balloon-engraver.cc | 2 +- lily/balloon.cc | 2 +- lily/beam.cc | 4 +- lily/book.cc | 2 +- lily/chord-name.cc | 2 +- lily/clef.cc | 2 +- lily/context-def.cc | 2 +- lily/context.cc | 10 ++-- lily/dispatcher-scheme.cc | 2 +- lily/dispatcher.cc | 2 +- lily/drum-note-performer.cc | 2 +- lily/engraver-group.cc | 4 +- lily/engraver-scheme.cc | 8 +-- lily/engraver.cc | 8 +-- lily/event-chord-iterator.cc | 4 +- lily/footnote-engraver.cc | 2 +- lily/function-documentation.cc | 16 +++--- lily/global-context-scheme.cc | 8 +-- lily/global-context.cc | 4 +- lily/grob-info.cc | 4 +- lily/grob.cc | 8 +-- lily/hairpin.cc | 4 +- lily/horizontal-bracket.cc | 2 +- lily/include/engraver.hh | 2 +- lily/include/global-context.hh | 2 +- lily/include/grob.hh | 4 +- lily/include/input.hh | 2 +- lily/include/music-output.hh | 4 +- lily/include/music.hh | 2 +- lily/include/performer.hh | 2 +- lily/include/stream-event.hh | 2 +- lily/include/translator.icc | 2 +- lily/input-scheme.cc | 18 +++---- lily/input-smob.cc | 6 +-- lily/item-scheme.cc | 4 +- lily/item.cc | 2 +- lily/laissez-vibrer-engraver.cc | 8 +-- lily/lexer.ll | 14 ++--- lily/lily-lexer.cc | 4 +- lily/lily-parser-scheme.cc | 2 +- lily/line-spanner.cc | 6 +-- lily/lyric-combine-music-iterator.cc | 4 +- lily/lyric-combine-music.cc | 4 +- lily/lyric-extender.cc | 4 +- lily/lyric-hyphen.cc | 2 +- lily/midi-control-function-performer.cc | 2 +- lily/music-scheme.cc | 42 +++++++-------- lily/music-sequence.cc | 28 +++++----- lily/music-wrapper-iterator.cc | 2 +- lily/music-wrapper.cc | 8 +-- lily/music.cc | 16 +++--- lily/new-fingering-engraver.cc | 2 +- lily/note-column.cc | 4 +- lily/note-performer.cc | 2 +- lily/paper-score-scheme.cc | 2 +- lily/paper-score.cc | 2 +- lily/parser.yy | 72 ++++++++++++------------- lily/part-combine-iterator.cc | 6 +-- lily/percent-repeat-item.cc | 2 +- lily/performance-scheme.cc | 4 +- lily/performance.cc | 2 +- lily/performer.cc | 2 +- lily/piano-pedal-align-engraver.cc | 2 +- lily/piano-pedal-engraver.cc | 2 +- lily/prob.cc | 2 +- lily/property-iterator.cc | 4 +- lily/quote-iterator.cc | 2 +- lily/relative-octave-check.cc | 2 +- lily/repeat-tie-engraver.cc | 4 +- lily/repeated-music.cc | 20 +++---- lily/rhythmic-head.cc | 4 +- lily/rhythmic-music-iterator.cc | 4 +- lily/score-performer.cc | 2 +- lily/score.cc | 12 ++--- lily/separation-item.cc | 2 +- lily/sequential-iterator.cc | 8 +-- lily/simultaneous-music-iterator.cc | 2 +- lily/slur-proto-engraver.cc | 2 +- lily/slur-scoring.cc | 2 +- lily/spacing-determine-loose-columns.cc | 4 +- lily/spacing-spanner.cc | 4 +- lily/spanner-scheme.cc | 12 ++--- lily/spanner.cc | 8 +-- lily/stem-tremolo.cc | 10 ++-- lily/stream-event-scheme.cc | 8 +-- lily/stream-event.cc | 8 +-- lily/system-start-delimiter.cc | 2 +- lily/system.cc | 2 +- lily/tab-tie-follow-engraver.cc | 2 +- lily/tie-engraver.cc | 8 +-- lily/tie-formatting-problem.cc | 2 +- lily/translator-group.cc | 6 +-- lily/tuplet-bracket.cc | 8 +-- lily/tuplet-engraver.cc | 4 +- lily/tuplet-iterator.cc | 2 +- lily/tuplet-number.cc | 16 +++--- lily/unfolded-repeat-iterator.cc | 2 +- lily/volta-bracket.cc | 2 +- 100 files changed, 296 insertions(+), 296 deletions(-) diff --git a/lily/accidental-placement.cc b/lily/accidental-placement.cc index 6bf1a74b26..edc176a520 100644 --- a/lily/accidental-placement.cc +++ b/lily/accidental-placement.cc @@ -36,7 +36,7 @@ accidental_pitch (Grob *acc) { SCM cause = acc->get_parent (Y_AXIS)->get_property ("cause"); - Stream_event *mcause = unsmob_stream_event (cause); + Stream_event *mcause = Stream_event::unsmob (cause); if (!mcause) { programming_error ("note head has no event cause"); diff --git a/lily/articulations.cc b/lily/articulations.cc index 164e8e7fa2..7ffa7fb260 100644 --- a/lily/articulations.cc +++ b/lily/articulations.cc @@ -56,7 +56,7 @@ articulation_list (vector note_events, for (SCM s = event->get_property ("articulations"); !articulation_event && scm_is_pair (s); s = scm_cdr (s)) { - Stream_event *art = unsmob_stream_event (scm_car (s)); + Stream_event *art = Stream_event::unsmob (scm_car (s)); if (art->in_event_class (articulation_name)) articulation_event = art; diff --git a/lily/balloon-engraver.cc b/lily/balloon-engraver.cc index 8c50d2c0a4..fb3cd056fb 100644 --- a/lily/balloon-engraver.cc +++ b/lily/balloon-engraver.cc @@ -71,7 +71,7 @@ Balloon_engraver::acknowledge_grob (Grob_info info) SCM arts = cause ? cause->get_property ("articulations") : SCM_EOL; for (SCM s = arts; scm_is_pair (s); s = scm_cdr (s)) { - Stream_event *e = unsmob_stream_event (scm_car (s)); + Stream_event *e = Stream_event::unsmob (scm_car (s)); if (e->in_event_class ("annotate-output-event")) { balloonify (info.grob (), e); diff --git a/lily/balloon.cc b/lily/balloon.cc index 4740a7291c..859aa5f422 100644 --- a/lily/balloon.cc +++ b/lily/balloon.cc @@ -60,7 +60,7 @@ MAKE_SCHEME_CALLBACK (Balloon_interface, print_spanner, 1); SCM Balloon_interface::print_spanner (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); Spanner *orig = dynamic_cast (me->original ()); if (orig) diff --git a/lily/beam.cc b/lily/beam.cc index d217d555d3..3d9db72501 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -570,7 +570,7 @@ MAKE_SCHEME_CALLBACK (Beam, calc_x_positions, 1); SCM Beam::calc_x_positions (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); SCM segments = me->get_property ("beam-segments"); Interval x_positions; x_positions.set_empty (); @@ -611,7 +611,7 @@ MAKE_SCHEME_CALLBACK (Beam, print, 1); SCM Beam::print (SCM grob) { - Spanner *me = unsmob_spanner (grob); + Spanner *me = Spanner::unsmob (grob); /* TODO - mild code dup for all the commonx calls. Some use just common_refpoint_of_array, some (in print and diff --git a/lily/book.cc b/lily/book.cc index 502d4dd62a..a13a3ca51d 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -98,7 +98,7 @@ Book::Book (Book const &s) Input * Book::origin () const { - return unsmob_input (input_location_); + return Input::unsmob (input_location_); } Book::~Book () diff --git a/lily/chord-name.cc b/lily/chord-name.cc index 21cbcbf4c2..ea8c6c2f9a 100644 --- a/lily/chord-name.cc +++ b/lily/chord-name.cc @@ -30,7 +30,7 @@ MAKE_SCHEME_CALLBACK (Chord_name, after_line_breaking, 1); SCM Chord_name::after_line_breaking (SCM smob) { - Item *me = unsmob_item (smob); + Item *me = Item::unsmob (smob); assert (me); SCM s = me->get_property ("begin-of-line-visible"); diff --git a/lily/clef.cc b/lily/clef.cc index 6861fdf26e..7f914a19d1 100644 --- a/lily/clef.cc +++ b/lily/clef.cc @@ -28,7 +28,7 @@ MAKE_SCHEME_CALLBACK (Clef, calc_glyph_name, 1); SCM Clef::calc_glyph_name (SCM smob) { - Item *s = unsmob_item (smob); + Item *s = Item::unsmob (smob); SCM glyph = s->get_property ("glyph"); if (scm_is_string (glyph)) diff --git a/lily/context-def.cc b/lily/context-def.cc index 41f3b8eafb..4df8e5e159 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -50,7 +50,7 @@ Context_def::Context_def () Input * Context_def::origin () const { - return unsmob_input (input_location_); + return Input::unsmob (input_location_); } Context_def::Context_def (Context_def const &s) diff --git a/lily/context.cc b/lily/context.cc index f180a50f4a..7077014501 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -236,14 +236,14 @@ IMPLEMENT_LISTENER (Context, acknowledge_infant); void Context::acknowledge_infant (SCM sev) { - infant_event_ = unsmob_stream_event (sev); + infant_event_ = Stream_event::unsmob (sev); } IMPLEMENT_LISTENER (Context, set_property_from_event); void Context::set_property_from_event (SCM sev) { - Stream_event *ev = unsmob_stream_event (sev); + Stream_event *ev = Stream_event::unsmob (sev); SCM sym = ev->get_property ("symbol"); if (scm_is_symbol (sym)) @@ -267,7 +267,7 @@ IMPLEMENT_LISTENER (Context, unset_property_from_event); void Context::unset_property_from_event (SCM sev) { - Stream_event *ev = unsmob_stream_event (sev); + Stream_event *ev = Stream_event::unsmob (sev); SCM sym = ev->get_property ("symbol"); type_check_assignment (sym, SCM_EOL, ly_symbol2scm ("translation-type?")); @@ -282,7 +282,7 @@ IMPLEMENT_LISTENER (Context, create_context_from_event); void Context::create_context_from_event (SCM sev) { - Stream_event *ev = unsmob_stream_event (sev); + Stream_event *ev = Stream_event::unsmob (sev); string id = ly_scm2string (ev->get_property ("id")); SCM ops = ev->get_property ("ops"); @@ -548,7 +548,7 @@ IMPLEMENT_LISTENER (Context, change_parent); void Context::change_parent (SCM sev) { - Stream_event *ev = unsmob_stream_event (sev); + Stream_event *ev = Stream_event::unsmob (sev); Context *to = Context::unsmob (ev->get_property ("context")); disconnect_from_parent (); diff --git a/lily/dispatcher-scheme.cc b/lily/dispatcher-scheme.cc index 1a04b3c37c..ce58926eb7 100644 --- a/lily/dispatcher-scheme.cc +++ b/lily/dispatcher-scheme.cc @@ -97,7 +97,7 @@ LY_DEFINE (ly_broadcast, "ly:broadcast", "Send the stream event @var{ev} to the dispatcher @var{disp}.") { Dispatcher *d = Dispatcher::unsmob (disp); - Stream_event *e = unsmob_stream_event (ev); + Stream_event *e = Stream_event::unsmob (ev); LY_ASSERT_SMOB (Dispatcher, disp, 1); diff --git a/lily/dispatcher.cc b/lily/dispatcher.cc index 49536a0a8a..feee3f24a7 100644 --- a/lily/dispatcher.cc +++ b/lily/dispatcher.cc @@ -82,7 +82,7 @@ IMPLEMENT_LISTENER (Dispatcher, dispatch); void Dispatcher::dispatch (SCM sev) { - Stream_event *ev = unsmob_stream_event (sev); + Stream_event *ev = Stream_event::unsmob (sev); SCM class_list = ev->get_property ("class"); if (!scm_is_pair (class_list)) { diff --git a/lily/drum-note-performer.cc b/lily/drum-note-performer.cc index a06e206dea..44a624313b 100644 --- a/lily/drum-note-performer.cc +++ b/lily/drum-note-performer.cc @@ -66,7 +66,7 @@ Drum_note_performer::process_music () int velocity = 0; for (SCM s = articulations; scm_is_pair (s); s = scm_cdr (s)) { - Stream_event *ev = unsmob_stream_event (scm_car (s)); + Stream_event *ev = Stream_event::unsmob (scm_car (s)); if (!ev) continue; diff --git a/lily/engraver-group.cc b/lily/engraver-group.cc index 0eedd8a2ad..4a897c6092 100644 --- a/lily/engraver-group.cc +++ b/lily/engraver-group.cc @@ -29,7 +29,7 @@ IMPLEMENT_LISTENER (Engraver_group, override); void Engraver_group::override (SCM sev) { - Stream_event *ev = unsmob_stream_event (sev); + Stream_event *ev = Stream_event::unsmob (sev); sloppy_general_pushpop_property (context (), ev->get_property ("symbol"), @@ -41,7 +41,7 @@ IMPLEMENT_LISTENER (Engraver_group, revert); void Engraver_group::revert (SCM sev) { - Stream_event *ev = unsmob_stream_event (sev); + Stream_event *ev = Stream_event::unsmob (sev); sloppy_general_pushpop_property (context (), ev->get_property ("symbol"), diff --git a/lily/engraver-scheme.cc b/lily/engraver-scheme.cc index 2f911d8d1d..5596a2f2f8 100644 --- a/lily/engraver-scheme.cc +++ b/lily/engraver-scheme.cc @@ -27,11 +27,11 @@ LY_DEFINE (ly_engraver_make_grob, "ly:engraver-make-grob", " @var{cause} should either be another grob" " or a music event.") { - LY_ASSERT_TYPE (unsmob_engraver, engraver, 1); + LY_ASSERT_TYPE (Engraver::unsmob, engraver, 1); LY_ASSERT_TYPE (ly_is_symbol, grob_name, 2); LY_ASSERT_TYPE (ly_is_grob_cause, cause, 3); - Grob *g = unsmob_engraver (engraver)-> + Grob *g = Engraver::unsmob (engraver)-> internal_make_grob (grob_name, cause, ly_symbol2string (grob_name).c_str (), "scheme", 0, "scheme"); @@ -45,11 +45,11 @@ LY_DEFINE (ly_engraver_announce_end_grob, "ly:engraver-announce-end-grob", " @var{grob} being a grob. @var{cause} should either" " be another grob or a music event.") { - LY_ASSERT_TYPE (unsmob_engraver, engraver, 1); + LY_ASSERT_TYPE (Engraver::unsmob, engraver, 1); LY_ASSERT_SMOB (Grob, grob, 2); LY_ASSERT_TYPE (ly_is_grob_cause, cause, 3); - unsmob_engraver (engraver)-> + Engraver::unsmob (engraver)-> announce_end_grob (Grob::unsmob (grob), cause); return SCM_UNSPECIFIED; diff --git a/lily/engraver.cc b/lily/engraver.cc index e44b6776f2..74a6554e3a 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -51,12 +51,12 @@ Grob_info Engraver::make_grob_info (Grob *e, SCM cause) { /* TODO: Remove Music code when it's no longer needed */ - if (Music *m = unsmob_music (cause)) + if (Music *m = Music::unsmob (cause)) { cause = m->to_event ()->unprotect (); } if (e->get_property ("cause") == SCM_EOL - && (unsmob_stream_event (cause) || Grob::unsmob (cause))) + && (Stream_event::unsmob (cause) || Grob::unsmob (cause))) e->set_property ("cause", cause); return Grob_info (this, e); @@ -171,7 +171,7 @@ Engraver::internal_make_spanner (SCM x, SCM cause, char const *name, } Engraver * -unsmob_engraver (SCM eng) +Engraver::unsmob (SCM eng) { return dynamic_cast (Translator::unsmob (eng)); } @@ -179,7 +179,7 @@ unsmob_engraver (SCM eng) bool ly_is_grob_cause (SCM obj) { - return Grob::unsmob (obj) || unsmob_stream_event (obj) || (obj == SCM_EOL); + return Grob::unsmob (obj) || Stream_event::unsmob (obj) || (obj == SCM_EOL); } #include "translator.icc" diff --git a/lily/event-chord-iterator.cc b/lily/event-chord-iterator.cc index 55d43302c5..9b3e5dae14 100644 --- a/lily/event-chord-iterator.cc +++ b/lily/event-chord-iterator.cc @@ -46,13 +46,13 @@ Event_chord_iterator::process (Moment m) for (SCM s = get_music ()->get_property ("elements"); scm_is_pair (s); s = scm_cdr (s)) { - Music *mus = unsmob_music (scm_car (s)); + Music *mus = Music::unsmob (scm_car (s)); report_event (mus); } for (SCM s = get_music ()->get_property ("articulations"); scm_is_pair (s); s = scm_cdr (s)) { - Music *mus = unsmob_music (scm_car (s)); + Music *mus = Music::unsmob (scm_car (s)); report_event (mus); } } diff --git a/lily/footnote-engraver.cc b/lily/footnote-engraver.cc index a90556f18d..4cac194478 100644 --- a/lily/footnote-engraver.cc +++ b/lily/footnote-engraver.cc @@ -78,7 +78,7 @@ Footnote_engraver::footnotify (Grob *g, SCM cause) void Footnote_engraver::acknowledge_grob (Grob_info info) { - Music *mus = unsmob_music (info.grob ()->get_property ("footnote-music")); + Music *mus = Music::unsmob (info.grob ()->get_property ("footnote-music")); if (mus) { diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc index a43a3ca0fa..ddd1b0c872 100644 --- a/lily/function-documentation.cc +++ b/lily/function-documentation.cc @@ -106,11 +106,11 @@ init_func_doc () ly_add_type_predicate ((void *) &is_music_function, "Music_function"); ly_add_type_predicate ((void *) &ly_is_port, "port"); ly_add_type_predicate ((void *) &ly_cheap_is_list, "list"); - ly_add_type_predicate ((void *) &unsmob_global_context, "Global_context"); - ly_add_type_predicate ((void *) &unsmob_input, "Input"); + ly_add_type_predicate ((void *) &Global_context::unsmob, "Global_context"); + ly_add_type_predicate ((void *) &Input::unsmob, "Input"); ly_add_type_predicate ((void *) &Moment::unsmob, "Moment"); - ly_add_type_predicate ((void *) &unsmob_paper_score, "Paper_score"); - ly_add_type_predicate ((void *) &unsmob_performance, "Performance"); + ly_add_type_predicate ((void *) &Paper_score::unsmob, "Paper_score"); + ly_add_type_predicate ((void *) &Performance::unsmob, "Performance"); ly_add_type_predicate ((void *) &is_unpure_pure_container, "unpure pure container"); ly_add_type_predicate ((void *) &is_axis, "axis"); @@ -125,10 +125,10 @@ init_func_doc () ly_add_type_predicate ((void *) &scm_is_rational, "rational"); ly_add_type_predicate ((void *) &scm_is_string, "string"); ly_add_type_predicate ((void *) &scm_is_vector, "vector"); - ly_add_type_predicate ((void *) &unsmob_item, "Item"); - ly_add_type_predicate ((void *) &unsmob_music, "Music"); - ly_add_type_predicate ((void *) &unsmob_spanner, "Spanner"); - ly_add_type_predicate ((void *) &unsmob_stream_event, "Stream_event"); + ly_add_type_predicate ((void *) &Item::unsmob, "Item"); + ly_add_type_predicate ((void *) &Music::unsmob, "Music"); + ly_add_type_predicate ((void *) &Spanner::unsmob, "Spanner"); + ly_add_type_predicate ((void *) &Stream_event::unsmob, "Stream_event"); } ADD_SCM_INIT_FUNC (func_doc, init_func_doc); diff --git a/lily/global-context-scheme.cc b/lily/global-context-scheme.cc index 16f51e0ded..7af3e4ed57 100644 --- a/lily/global-context-scheme.cc +++ b/lily/global-context-scheme.cc @@ -36,7 +36,7 @@ LY_DEFINE (ly_format_output, "ly:format-output", { Global_context *g = dynamic_cast (Context::unsmob (context)); - LY_ASSERT_TYPE (unsmob_global_context, context, 1); + LY_ASSERT_TYPE (Global_context::unsmob, context, 1); SCM output = g->get_output (); progress_indication ("\n"); @@ -53,7 +53,7 @@ LY_DEFINE (ly_make_global_translator, "ly:make-global-translator", " @var{global}. The translator group is returned.") { Global_context *g = dynamic_cast (Context::unsmob (global)); - LY_ASSERT_TYPE (unsmob_global_context, global, 1); + LY_ASSERT_TYPE (Global_context::unsmob, global, 1); Translator_group *tg = new Translator_group (); tg->connect_to_context (g); @@ -87,9 +87,9 @@ LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression", " @var{ctx}. The context is returned in its final state.") { LY_ASSERT_SMOB (Music, mus, 1); - LY_ASSERT_TYPE (unsmob_global_context, ctx, 2); + LY_ASSERT_TYPE (Global_context::unsmob, ctx, 2); - Music *music = unsmob_music (mus); + Music *music = Music::unsmob (mus); if (!music) { warning (_ ("no music found in score")); diff --git a/lily/global-context.cc b/lily/global-context.cc index 3b45f1d6fe..94f8efa82f 100644 --- a/lily/global-context.cc +++ b/lily/global-context.cc @@ -92,7 +92,7 @@ IMPLEMENT_LISTENER (Global_context, prepare); void Global_context::prepare (SCM sev) { - Stream_event *ev = unsmob_stream_event (sev); + Stream_event *ev = Stream_event::unsmob (sev); Moment *mom = Moment::unsmob (ev->get_property ("moment")); assert (mom); @@ -209,7 +209,7 @@ Global_context::get_default_interpreter (const string &/* context_id */) } Global_context * -unsmob_global_context (SCM x) +Global_context::unsmob (SCM x) { return dynamic_cast (Context::unsmob (x)); } diff --git a/lily/grob-info.cc b/lily/grob-info.cc index 72c2829032..3a90b8c896 100644 --- a/lily/grob-info.cc +++ b/lily/grob-info.cc @@ -50,7 +50,7 @@ Stream_event * Grob_info::event_cause () const { SCM cause = grob_->get_property ("cause"); - return unsmob_stream_event (cause); + return Stream_event::unsmob (cause); } vector @@ -94,7 +94,7 @@ Grob_info::ultimate_event_cause () const { cause = Grob::unsmob (cause)->get_property ("cause"); } - return unsmob_stream_event (cause); + return Stream_event::unsmob (cause); } bool diff --git a/lily/grob.cc b/lily/grob.cc index 3221a94e22..90a7dbac20 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -731,9 +731,9 @@ Grob::programming_error (const string &s) const cause = g->get_property ("cause"); /* ES TODO: cause can't be Music*/ - if (Music *m = unsmob_music (cause)) + if (Music *m = Music::unsmob (cause)) m->origin ()->programming_error (s); - else if (Stream_event *ev = unsmob_stream_event (cause)) + else if (Stream_event *ev = Stream_event::unsmob (cause)) ev->origin ()->programming_error (s); else ::programming_error (s); @@ -747,9 +747,9 @@ Grob::warning (const string &s) const cause = g->get_property ("cause"); /* ES TODO: cause can't be Music*/ - if (Music *m = unsmob_music (cause)) + if (Music *m = Music::unsmob (cause)) m->origin ()->warning (s); - else if (Stream_event *ev = unsmob_stream_event (cause)) + else if (Stream_event *ev = Stream_event::unsmob (cause)) ev->origin ()->warning (s); else ::warning (s); diff --git a/lily/hairpin.cc b/lily/hairpin.cc index 281d50cf92..edf5c7cbf7 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -53,7 +53,7 @@ MAKE_SCHEME_CALLBACK (Hairpin, broken_bound_padding, 1); SCM Hairpin::broken_bound_padding (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); Item *r_bound = me->get_bound (RIGHT); if (r_bound->break_status_dir () != -1) { @@ -107,7 +107,7 @@ MAKE_SCHEME_CALLBACK (Hairpin, print, 1); SCM Hairpin::print (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); SCM s = me->get_property ("grow-direction"); if (!is_direction (s)) diff --git a/lily/horizontal-bracket.cc b/lily/horizontal-bracket.cc index 7beaef2820..003a375d52 100644 --- a/lily/horizontal-bracket.cc +++ b/lily/horizontal-bracket.cc @@ -101,7 +101,7 @@ MAKE_SCHEME_CALLBACK (Horizontal_bracket, print, 1); SCM Horizontal_bracket::print (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); extract_grob_set (me, "columns", gs); vector enclosed = gs; diff --git a/lily/include/engraver.hh b/lily/include/engraver.hh index 4a102aa265..76da2049a8 100644 --- a/lily/include/engraver.hh +++ b/lily/include/engraver.hh @@ -71,7 +71,7 @@ public: #define make_spanner(x, cause) internal_make_spanner (ly_symbol2scm (x), cause, x, __FILE__, __LINE__, __FUNCTION__) #define make_paper_column(x) internal_make_column (ly_symbol2scm (x), x, __FILE__, __LINE__, __FUNCTION__) -Engraver *unsmob_engraver (SCM eng); +Engraver *Engraver::unsmob (SCM eng); bool ly_is_grob_cause (SCM obj); #endif // ENGRAVER_HH diff --git a/lily/include/global-context.hh b/lily/include/global-context.hh index 8c1b8b66ab..28a89b25d3 100644 --- a/lily/include/global-context.hh +++ b/lily/include/global-context.hh @@ -55,6 +55,6 @@ protected: }; SCM ly_format_output (SCM); -Global_context *unsmob_global_context (SCM x); +Global_context *Global_context::unsmob (SCM x); #endif // GLOBAL_CONTEXT_HH diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 7455257b2f..bac9538a85 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -172,8 +172,8 @@ public: }; /* smob utilities */ -Spanner *unsmob_spanner (SCM); -Item *unsmob_item (SCM); +Spanner *Spanner::unsmob (SCM); +Item *Item::unsmob (SCM); /* unification */ void uniquify (vector &); diff --git a/lily/include/input.hh b/lily/include/input.hh index a6aa1698b4..5b0641ef6e 100644 --- a/lily/include/input.hh +++ b/lily/include/input.hh @@ -69,7 +69,7 @@ protected: #include "smobs.hh" SCM make_input (Input spot); -Input *unsmob_input (SCM); +Input *Input::unsmob (SCM); extern Input dummy_input_global; diff --git a/lily/include/music-output.hh b/lily/include/music-output.hh index 10817f3957..836233f7d1 100644 --- a/lily/include/music-output.hh +++ b/lily/include/music-output.hh @@ -38,6 +38,6 @@ public: virtual void process (); }; -Paper_score *unsmob_paper_score (SCM); -Performance *unsmob_performance (SCM); +Paper_score *Paper_score::unsmob (SCM); +Performance *Performance::unsmob (SCM); #endif /* MUSIC_OUTPUT_HH */ diff --git a/lily/include/music.hh b/lily/include/music.hh index 8d1ffc7128..0774fac255 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -69,7 +69,7 @@ protected: friend SCM ly_extended_make_music (SCM, SCM); }; -Music *unsmob_music (SCM); +Music *Music::unsmob (SCM); Music *make_music_by_name (SCM sym); SCM ly_music_deep_copy (SCM); SCM ly_camel_case_2_lisp_identifier (SCM name_sym); diff --git a/lily/include/performer.hh b/lily/include/performer.hh index fcd5a26b42..bf40ea0fa5 100644 --- a/lily/include/performer.hh +++ b/lily/include/performer.hh @@ -40,7 +40,7 @@ protected: virtual void create_audio_elements (); }; -Performer *unsmob_performer (SCM perf); +Performer *Performer::unsmob (SCM perf); #endif /* PERFORMER_HH */ diff --git a/lily/include/stream-event.hh b/lily/include/stream-event.hh index 3234c03d9f..cba4611c30 100644 --- a/lily/include/stream-event.hh +++ b/lily/include/stream-event.hh @@ -46,7 +46,7 @@ public: #define in_event_class(class_name) internal_in_event_class (ly_symbol2scm (class_name)) -Stream_event *unsmob_stream_event (SCM); +Stream_event *Stream_event::unsmob (SCM); SCM ly_event_deep_copy (SCM); #endif /* STREAM_EVENT_HH */ diff --git a/lily/include/translator.icc b/lily/include/translator.icc index 53697b38e6..eca9a78788 100644 --- a/lily/include/translator.icc +++ b/lily/include/translator.icc @@ -153,7 +153,7 @@ IMPLEMENT_LISTENER (cl, _listen_scm_ ## m) \ void \ cl::_listen_scm_ ## m (SCM sev) \ { \ - Stream_event *ev = unsmob_stream_event (sev); \ + Stream_event *ev = Stream_event::unsmob (sev); \ protect_event (sev); \ listen_ ## m (ev); \ } diff --git a/lily/input-scheme.cc b/lily/input-scheme.cc index 01cad8c9d7..814499c470 100644 --- a/lily/input-scheme.cc +++ b/lily/input-scheme.cc @@ -26,7 +26,7 @@ LY_DEFINE (ly_input_location_p, "ly:input-location?", 1, 0, 0, (SCM x), "Is @var{x} an @code{input-location}?") { - return unsmob_input (x) ? SCM_BOOL_T : SCM_BOOL_F; + return Input::unsmob (x) ? SCM_BOOL_T : SCM_BOOL_F; } LY_DEFINE (ly_input_warning, "ly:input-warning", 2, 0, 1, (SCM sip, SCM msg, SCM rest), @@ -34,9 +34,9 @@ LY_DEFINE (ly_input_warning, "ly:input-warning", 2, 0, 1, (SCM sip, SCM msg, SCM " to the location in @var{sip}. @var{msg} is interpreted" " similar to @code{format}'s argument, using @var{rest}.") { - Input *ip = unsmob_input (sip); + Input *ip = Input::unsmob (sip); - LY_ASSERT_TYPE (unsmob_input, sip, 1); + LY_ASSERT_TYPE (Input::unsmob, sip, 1); LY_ASSERT_TYPE (scm_is_string, msg, 2); msg = scm_simple_format (SCM_BOOL_F, msg, rest); @@ -52,9 +52,9 @@ LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 1, (SCM sip, SCM msg, SCM " to the location in @var{sip}. @var{msg} is interpreted" " similar to @code{format}'s argument, using @var{rest}.") { - Input *ip = unsmob_input (sip); + Input *ip = Input::unsmob (sip); - LY_ASSERT_TYPE (unsmob_input, sip, 1); + LY_ASSERT_TYPE (Input::unsmob, sip, 1); LY_ASSERT_TYPE (scm_is_string, msg, 2); msg = scm_simple_format (SCM_BOOL_F, msg, rest); @@ -71,8 +71,8 @@ LY_DEFINE (ly_input_file_line_char_column, "Return input location in @var{sip} as" " @code{(file-name line char column)}.") { - LY_ASSERT_TYPE (unsmob_input, sip, 1); - Input *ip = unsmob_input (sip); + LY_ASSERT_TYPE (Input::unsmob, sip, 1); + Input *ip = Input::unsmob (sip); int l, ch, col, offset = 0; ip->get_counts (&l, &ch, &col, &offset); @@ -89,8 +89,8 @@ LY_DEFINE (ly_input_both_locations, " @code{(file-name first-line first-column last-line last-column)}.") { - LY_ASSERT_TYPE (unsmob_input, sip, 1); - Input *ip = unsmob_input (sip); + LY_ASSERT_TYPE (Input::unsmob, sip, 1); + Input *ip = Input::unsmob (sip); return scm_list_5 (ly_string2scm (ip->file_string ()), scm_from_int (ip->line_number ()), diff --git a/lily/input-smob.cc b/lily/input-smob.cc index 4aef6f122d..07748ad48f 100644 --- a/lily/input-smob.cc +++ b/lily/input-smob.cc @@ -42,7 +42,7 @@ mark_smob (SCM s) static int print_smob (SCM s, SCM port, scm_print_state *) { - string str = "#location_string () + ">"; + string str = "#location_string () + ">"; scm_puts (str.c_str (), port); return 1; } @@ -50,7 +50,7 @@ print_smob (SCM s, SCM port, scm_print_state *) static size_t free_smob (SCM s) { - delete unsmob_input (s); + delete Input::unsmob (s); return 0; } @@ -88,7 +88,7 @@ make_input (Input ip) } Input * -unsmob_input (SCM s) +Input::unsmob (SCM s) { if (SCM_IMP (s)) return 0; diff --git a/lily/item-scheme.cc b/lily/item-scheme.cc index 0f9a29f9bd..0887ac3d9a 100644 --- a/lily/item-scheme.cc +++ b/lily/item-scheme.cc @@ -35,7 +35,7 @@ LY_DEFINE (ly_item_break_dir, "ly:item-break-dir", " end of line, @code{0}@tie{}unbroken, and" " @code{1}@tie{}beginning of line.") { - LY_ASSERT_TYPE (unsmob_item, it, 1); - Item *me = unsmob_item (it); + LY_ASSERT_TYPE (Item::unsmob, it, 1); + Item *me = Item::unsmob (it); return scm_from_int (me->break_status_dir ()); } diff --git a/lily/item.cc b/lily/item.cc index 4736a11f3d..f007670e7a 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -224,7 +224,7 @@ Item::derived_mark () const } Item * -unsmob_item (SCM s) +Item::unsmob (SCM s) { return dynamic_cast (Grob::unsmob (s)); } diff --git a/lily/laissez-vibrer-engraver.cc b/lily/laissez-vibrer-engraver.cc index f707964eb7..ba38cdae1e 100644 --- a/lily/laissez-vibrer-engraver.cc +++ b/lily/laissez-vibrer-engraver.cc @@ -67,13 +67,13 @@ Laissez_vibrer_engraver::acknowledge_note_head (Grob_info inf) * a single note head (attached as an articulation inside a chord) */ Stream_event *tie_ev = event_; Grob *head = inf.grob (); - Stream_event *note_ev = unsmob_stream_event (head->get_property ("cause")); + Stream_event *note_ev = Stream_event::unsmob (head->get_property ("cause")); if (!tie_ev && note_ev && note_ev->in_event_class ("note-event")) { SCM articulations = note_ev->get_property ("articulations"); for (SCM s = articulations; !tie_ev && scm_is_pair (s); s = scm_cdr (s)) { - Stream_event *ev = unsmob_stream_event (scm_car (s)); + Stream_event *ev = Stream_event::unsmob (scm_car (s)); if (ev && ev->in_event_class ("laissez-vibrer-event")) tie_ev = ev; } @@ -93,9 +93,9 @@ Laissez_vibrer_engraver::acknowledge_note_head (Grob_info inf) Pointer_group_interface::add_grob (lv_column_, ly_symbol2scm ("ties"), lv_tie); - if (is_direction (unsmob_stream_event (cause)->get_property ("direction"))) + if (is_direction (Stream_event::unsmob (cause)->get_property ("direction"))) { - Direction d = to_dir (unsmob_stream_event (cause)->get_property ("direction")); + Direction d = to_dir (Stream_event::unsmob (cause)->get_property ("direction")); lv_tie->set_property ("direction", scm_from_int (d)); } diff --git a/lily/lexer.ll b/lily/lexer.ll index caea441b0a..8b0859630e 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -827,7 +827,7 @@ Lily_lexer::pop_extra_token () return -1; /* produce requested token */ - yylloc = *unsmob_input (scm_caar (extra_tokens_)); + yylloc = *Input::unsmob (scm_caar (extra_tokens_)); int type = scm_to_int (scm_cadar (extra_tokens_)); yylval = scm_cddar (extra_tokens_); extra_tokens_ = scm_cdr (extra_tokens_); @@ -914,7 +914,7 @@ Lily_lexer::scan_escaped_word (const string &str) return i; SCM sid = lookup_identifier (str); - if (Music *m = unsmob_music (sid)) + if (Music *m = Music::unsmob (sid)) { m->set_spot (override_input (here_input ())); } @@ -934,7 +934,7 @@ int Lily_lexer::scan_shorthand (const string &str) { SCM sid = lookup_identifier (str); - if (Music *m = unsmob_music (sid)) + if (Music *m = Music::unsmob (sid)) { m->set_spot (override_input (here_input ())); } @@ -1096,9 +1096,9 @@ Lily_lexer::eval_scm (SCM readerdata, Input hi, char extra_token) p = scm_cdr (p)) { SCM v = scm_car (p); - if (Music *m = unsmob_music (v)) + if (Music *m = Music::unsmob (v)) { - if (!unsmob_input (m->get_property ("origin"))) + if (!Input::unsmob (m->get_property ("origin"))) m->set_spot (override_input (here_input ())); } @@ -1121,9 +1121,9 @@ Lily_lexer::eval_scm (SCM readerdata, Input hi, char extra_token) sval = SCM_UNSPECIFIED; } - if (Music *m = unsmob_music (sval)) + if (Music *m = Music::unsmob (sval)) { - if (!unsmob_input (m->get_property ("origin"))) + if (!Input::unsmob (m->get_property ("origin"))) m->set_spot (override_input (here_input ())); } diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index d2d57fdbd7..857aa6463f 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -123,8 +123,8 @@ Lily_lexer::Lily_lexer (Lily_lexer const &src, Lily_parser *parser, main_input_level_ = 0; extra_tokens_ = SCM_EOL; - if (unsmob_input (override_input)) - override_input_ = *unsmob_input (override_input); + if (Input::unsmob (override_input)) + override_input_ = *Input::unsmob (override_input); smobify_self (); diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index a09b90ddb1..5fdff0fef9 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -299,7 +299,7 @@ LY_DEFINE (ly_parser_error, "ly:parser-error", LY_ASSERT_TYPE (scm_is_string, msg, 2); string s = ly_scm2string (msg); - Input *i = unsmob_input (input); + Input *i = Input::unsmob (input); if (i) p->parser_error (*i, s); else diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index 99a1ed7edb..ddc4d7d178 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -56,7 +56,7 @@ Spanner *parent_spanner (Grob *g) SCM Line_spanner::calc_bound_info (SCM smob, Direction dir) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); Grob *commonx = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS); commonx = me->common_refpoint (commonx, X_AXIS); @@ -206,7 +206,7 @@ MAKE_SCHEME_CALLBACK (Line_spanner, calc_cross_staff, 1); SCM Line_spanner::calc_cross_staff (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); if (!me) return SCM_BOOL_F; @@ -237,7 +237,7 @@ SCM Line_spanner::calc_left_bound_info_and_text (SCM smob) { SCM alist = Line_spanner::calc_bound_info (smob, LEFT); - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); SCM text = me->get_property ("text"); if (Text_interface::is_markup (text) diff --git a/lily/lyric-combine-music-iterator.cc b/lily/lyric-combine-music-iterator.cc index 9db7b0a115..dfc616e0d5 100644 --- a/lily/lyric-combine-music-iterator.cc +++ b/lily/lyric-combine-music-iterator.cc @@ -94,7 +94,7 @@ IMPLEMENT_LISTENER (Lyric_combine_music_iterator, set_busy) void Lyric_combine_music_iterator::set_busy (SCM se) { - Stream_event *e = unsmob_stream_event (se); + Stream_event *e = Stream_event::unsmob (se); if ((e->in_event_class ("note-event") || e->in_event_class ("cluster-note-event")) && music_context_) @@ -187,7 +187,7 @@ Lyric_combine_music_iterator::derived_substitute (Context *f, Context *t) void Lyric_combine_music_iterator::construct_children () { - Music *m = unsmob_music (get_music ()->get_property ("element")); + Music *m = Music::unsmob (get_music ()->get_property ("element")); lyric_iter_ = Music_iterator::unsmob (get_iterator (m)); if (!lyric_iter_) return; diff --git a/lily/lyric-combine-music.cc b/lily/lyric-combine-music.cc index ec254e755a..de6e2d0493 100644 --- a/lily/lyric-combine-music.cc +++ b/lily/lyric-combine-music.cc @@ -29,7 +29,7 @@ MAKE_SCHEME_CALLBACK (Lyric_combine_music, length_callback, 1); SCM Lyric_combine_music::length_callback (SCM m) { - Music *me = unsmob_music (m); - Music *melody = unsmob_music (scm_car (me->get_property ("elements"))); + Music *me = Music::unsmob (m); + Music *melody = Music::unsmob (scm_car (me->get_property ("elements"))); return melody->get_length ().smobbed_copy (); } diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc index 1ed47703f8..9d4c443637 100644 --- a/lily/lyric-extender.cc +++ b/lily/lyric-extender.cc @@ -32,9 +32,9 @@ MAKE_SCHEME_CALLBACK (Lyric_extender, print, 1); SCM Lyric_extender::print (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); Item *left_edge = me->get_bound (LEFT); - Item *right_text = unsmob_item (me->get_object ("next")); + Item *right_text = Item::unsmob (me->get_object ("next")); Grob *common = left_edge; diff --git a/lily/lyric-hyphen.cc b/lily/lyric-hyphen.cc index f64a8a9cfc..584a0e7425 100644 --- a/lily/lyric-hyphen.cc +++ b/lily/lyric-hyphen.cc @@ -35,7 +35,7 @@ MAKE_SCHEME_CALLBACK (Lyric_hyphen, print, 1); SCM Lyric_hyphen::print (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); Drul_array bounds (me->get_bound (LEFT), me->get_bound (RIGHT)); diff --git a/lily/midi-control-function-performer.cc b/lily/midi-control-function-performer.cc index 36f2163776..4269baf7e2 100644 --- a/lily/midi-control-function-performer.cc +++ b/lily/midi-control-function-performer.cc @@ -75,7 +75,7 @@ IMPLEMENT_LISTENER (Midi_control_function_performer, void Midi_control_function_performer::announce_function_value_change (SCM sev) { - Stream_event *ev = unsmob_stream_event (sev); + Stream_event *ev = Stream_event::unsmob (sev); SCM sym = ev->get_property ("symbol"); if (!scm_is_symbol (sym)) return; diff --git a/lily/music-scheme.cc b/lily/music-scheme.cc index 7ba3fe2038..42b6b50950 100644 --- a/lily/music-scheme.cc +++ b/lily/music-scheme.cc @@ -28,8 +28,8 @@ LY_DEFINE (ly_music_length, "ly:music-length", "Get the length of music expression @var{mus} and return" " it as a @code{Moment} object.") { - LY_ASSERT_TYPE (unsmob_music, mus, 1); - Music *sc = unsmob_music (mus); + LY_ASSERT_TYPE (Music::unsmob, mus, 1); + Music *sc = Music::unsmob (mus); return sc->get_length ().smobbed_copy (); } @@ -39,7 +39,7 @@ LY_DEFINE (ly_music_property, "ly:music-property", " @var{mus}. If no value is found, return @var{val} or" " @code{'()} if @var{val} is not specified.") { - LY_ASSERT_TYPE (unsmob_music, mus, 1); + LY_ASSERT_TYPE (Music::unsmob, mus, 1); return ly_prob_property (mus, sym, val); } @@ -48,7 +48,7 @@ LY_DEFINE (ly_music_set_property_x, "ly:music-set-property!", "Set property @var{sym} in music expression @var{mus} to" " @var{val}.") { - LY_ASSERT_TYPE (unsmob_music, mus, 1); + LY_ASSERT_TYPE (Music::unsmob, mus, 1); return ly_prob_set_property_x (mus, sym, val); } @@ -71,14 +71,14 @@ LY_DEFINE (ly_music_p, "ly:music?", 1, 0, 0, (SCM obj), "Is @var{obj} a music object?") { - return scm_from_bool (unsmob_music (obj)); + return scm_from_bool (Music::unsmob (obj)); } LY_DEFINE (ly_event_p, "ly:event?", 1, 0, 0, (SCM obj), "Is @var{obj} a proper (non-rhythmic) event object?") { - if (Music *m = unsmob_music (obj)) + if (Music *m = Music::unsmob (obj)) { return scm_from_bool (m->is_mus_type ("post-event")); } @@ -92,8 +92,8 @@ LY_DEFINE (ly_music_mutable_properties, "ly:music-mutable-properties", " The immutable properties are not available, since they are" " constant and initialized by the @code{make-music} function.") { - LY_ASSERT_TYPE (unsmob_music, mus, 1); - Music *m = unsmob_music (mus); + LY_ASSERT_TYPE (Music::unsmob, mus, 1); + Music *m = Music::unsmob (mus); return m->get_property_alist (true); } @@ -106,7 +106,7 @@ LY_DEFINE (ly_music_list_p, "ly:music-list?", while (scm_is_pair (lst)) { - if (!unsmob_music (scm_car (lst))) + if (!Music::unsmob (scm_car (lst))) return SCM_BOOL_F; lst = scm_cdr (lst); } @@ -120,8 +120,8 @@ LY_DEFINE (ly_music_deep_copy, "ly:music-deep-copy", " @var{m} may be an arbitrary type; cons cells and music" " are copied recursively.") { - if (unsmob_music (m)) - return unsmob_music (m)->clone ()->unprotect (); + if (Music::unsmob (m)) + return Music::unsmob (m)->clone ()->unprotect (); if (scm_is_pair (m)) { SCM copy = SCM_EOL; @@ -147,10 +147,10 @@ LY_DEFINE (ly_music_transpose, "ly:music-transpose", "Transpose @var{m} such that central@tie{}C is mapped" " to@tie{}@var{p}. Return@tie{}@var{m}.") { - LY_ASSERT_TYPE (unsmob_music, m, 1); + LY_ASSERT_TYPE (Music::unsmob, m, 1); LY_ASSERT_SMOB (Pitch, p, 2); - Music *sc = unsmob_music (m); + Music *sc = Music::unsmob (m); Pitch *sp = Pitch::unsmob (p); sc->transpose (*sp); @@ -165,10 +165,10 @@ LY_DEFINE (ly_music_compress, "ly:music-compress", 2, 0, 0, (SCM m, SCM factor), "Compress music object@tie{}@var{m} by moment @var{factor}.") { - LY_ASSERT_TYPE (unsmob_music, m, 1); + LY_ASSERT_TYPE (Music::unsmob, m, 1); LY_ASSERT_TYPE (Moment::unsmob, factor, 2); - Music *sc = unsmob_music (m); + Music *sc = Music::unsmob (m); sc->compress (*Moment::unsmob (factor)); return sc->self_scm (); } @@ -178,11 +178,11 @@ LY_DEFINE (ly_make_music_relative_x, "ly:make-music-relative!", "Make @var{music} relative to @var{pitch}," " return final pitch.") { - LY_ASSERT_TYPE (unsmob_music, music, 1); + LY_ASSERT_TYPE (Music::unsmob, music, 1); LY_ASSERT_TYPE (Pitch::unsmob, pitch, 2); Pitch start = *Pitch::unsmob (pitch); - Music *m = unsmob_music (music); + Music *m = Music::unsmob (music); Pitch last = m->to_relative_octave (start); return last.smobbed_copy (); @@ -193,8 +193,8 @@ LY_DEFINE (ly_music_duration_length, "ly:music-duration-length", 1, 0, 0, "Extract the duration field from @var{mus} and return the" " length.") { - LY_ASSERT_TYPE (unsmob_music, mus, 1); - Music *m = unsmob_music (mus); + LY_ASSERT_TYPE (Music::unsmob, mus, 1); + Music *m = Music::unsmob (mus); Duration *d = Duration::unsmob (m->get_property ("duration")); Moment len; @@ -211,10 +211,10 @@ LY_DEFINE (ly_music_duration_compress, "ly:music-duration-compress", 2, 0, 0, "Compress @var{mus} by factor @var{fact}, which is a" " @code{Moment}.") { - LY_ASSERT_TYPE (unsmob_music, mus, 1); + LY_ASSERT_TYPE (Music::unsmob, mus, 1); LY_ASSERT_SMOB (Moment, fact, 2); - Music *m = unsmob_music (mus); + Music *m = Music::unsmob (mus); Moment *f = Moment::unsmob (fact); Duration *d = Duration::unsmob (m->get_property ("duration")); diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index 175119e097..ec700d3465 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -30,7 +30,7 @@ void transpose_music_list (SCM lst, Pitch rq) { for (SCM s = lst; scm_is_pair (s); s = scm_cdr (s)) - unsmob_music (scm_car (s))->transpose (rq); + Music::unsmob (scm_car (s))->transpose (rq); } Moment @@ -41,7 +41,7 @@ Music_sequence::cumulative_length (SCM l) for (SCM s = l; scm_is_pair (s); s = scm_cdr (s)) { - Moment l = unsmob_music (scm_car (s))->get_length (); + Moment l = Music::unsmob (scm_car (s))->get_length (); if (last_len.grace_part_ && l.main_part_) last_len.grace_part_ = Rational (0); cumulative += last_len; @@ -60,7 +60,7 @@ Music_sequence::maximum_length (SCM l) Moment dur = 0; for (SCM s = l; scm_is_pair (s); s = scm_cdr (s)) { - Music *m = unsmob_music (scm_car (s)); + Music *m = Music::unsmob (scm_car (s)); if (!m) programming_error ("Music sequence should have music elements"); else @@ -77,7 +77,7 @@ MAKE_SCHEME_CALLBACK (Music_sequence, maximum_length_callback, 1); SCM Music_sequence::maximum_length_callback (SCM m) { - Music *me = unsmob_music (m); + Music *me = Music::unsmob (m); return maximum_length (me->get_property ("elements")).smobbed_copy (); } @@ -85,7 +85,7 @@ MAKE_SCHEME_CALLBACK (Music_sequence, event_chord_length_callback, 1); SCM Music_sequence::event_chord_length_callback (SCM m) { - Music *me = unsmob_music (m); + Music *me = Music::unsmob (m); Duration *d = Duration::unsmob (me->get_property ("duration")); // Preset duration is used in chord repetitions. if (d) @@ -100,7 +100,7 @@ MAKE_SCHEME_CALLBACK (Music_sequence, cumulative_length_callback, 1); SCM Music_sequence::cumulative_length_callback (SCM m) { - Music *me = unsmob_music (m); + Music *me = Music::unsmob (m); return cumulative_length (me->get_property ("elements")).smobbed_copy (); } @@ -108,7 +108,7 @@ MAKE_SCHEME_CALLBACK (Music_sequence, minimum_start_callback, 1); SCM Music_sequence::minimum_start_callback (SCM m) { - Music *me = unsmob_music (m); + Music *me = Music::unsmob (m); return minimum_start (me->get_property ("elements")).smobbed_copy (); } @@ -116,7 +116,7 @@ MAKE_SCHEME_CALLBACK (Music_sequence, first_start_callback, 1); SCM Music_sequence::first_start_callback (SCM m) { - Music *me = unsmob_music (m); + Music *me = Music::unsmob (m); return first_start (me->get_property ("elements")).smobbed_copy (); } @@ -129,7 +129,7 @@ music_list_to_relative (SCM l, Pitch p, bool ret_first) Pitch last = p; for (SCM s = l; scm_is_pair (s); s = scm_cdr (s)) { - if (Music *m = unsmob_music (scm_car (s))) + if (Music *m = Music::unsmob (scm_car (s))) { last = m->to_relative_octave (last); if (!count++) @@ -144,7 +144,7 @@ void compress_music_list (SCM l, Moment m) { for (SCM s = l; scm_is_pair (s); s = scm_cdr (s)) - unsmob_music (scm_car (s))->compress (m); + Music::unsmob (scm_car (s))->compress (m); } Moment @@ -153,7 +153,7 @@ Music_sequence::minimum_start (SCM l) Moment m; for (SCM s = l; scm_is_pair (s); s = scm_cdr (s)) - m = min (m, unsmob_music (scm_car (s))->start_mom ()); + m = min (m, Music::unsmob (scm_car (s))->start_mom ()); return m; } @@ -163,7 +163,7 @@ Music_sequence::first_start (SCM l) for (SCM s = l; scm_is_pair (s); s = scm_cdr (s)) { - Music *mus = unsmob_music (scm_car (s)); + Music *mus = Music::unsmob (scm_car (s)); Moment start = mus->start_mom (); if (mus->get_length ().to_bool () || start.to_bool ()) return start; @@ -175,7 +175,7 @@ MAKE_SCHEME_CALLBACK (Music_sequence, simultaneous_relative_callback, 2); SCM Music_sequence::simultaneous_relative_callback (SCM music, SCM pitch) { - Music *me = unsmob_music (music); + Music *me = Music::unsmob (music); Pitch p = *Pitch::unsmob (pitch); return music_list_to_relative (me->get_property ("elements"), p, false).smobbed_copy (); @@ -185,7 +185,7 @@ MAKE_SCHEME_CALLBACK (Music_sequence, event_chord_relative_callback, 2); SCM Music_sequence::event_chord_relative_callback (SCM music, SCM pitch) { - Music *me = unsmob_music (music); + Music *me = Music::unsmob (music); Pitch p = *Pitch::unsmob (pitch); return music_list_to_relative (me->get_property ("elements"), p, true).smobbed_copy (); diff --git a/lily/music-wrapper-iterator.cc b/lily/music-wrapper-iterator.cc index 74e4cf3f64..46ad77c6da 100644 --- a/lily/music-wrapper-iterator.cc +++ b/lily/music-wrapper-iterator.cc @@ -51,7 +51,7 @@ void Music_wrapper_iterator::construct_children () { Music *my_music = get_music (); - Music *child = unsmob_music (my_music->get_property ("element")); + Music *child = Music::unsmob (my_music->get_property ("element")); child_iter_ = (child) ? Music_iterator::unsmob (get_iterator (child)) : 0; diff --git a/lily/music-wrapper.cc b/lily/music-wrapper.cc index babec206b7..c03f08b5c4 100644 --- a/lily/music-wrapper.cc +++ b/lily/music-wrapper.cc @@ -25,8 +25,8 @@ MAKE_SCHEME_CALLBACK (Music_wrapper, start_callback, 1); SCM Music_wrapper::start_callback (SCM m) { - Music *me = unsmob_music (m); - Music *elt = unsmob_music (me->get_property ("element")); + Music *me = Music::unsmob (m); + Music *elt = Music::unsmob (me->get_property ("element")); if (elt) return elt->start_mom ().smobbed_copy (); else @@ -37,8 +37,8 @@ MAKE_SCHEME_CALLBACK (Music_wrapper, length_callback, 1); SCM Music_wrapper::length_callback (SCM m) { - Music *me = unsmob_music (m); - Music *elt = unsmob_music (me->get_property ("element")); + Music *me = Music::unsmob (m); + Music *elt = Music::unsmob (me->get_property ("element")); if (elt) return elt->get_length ().smobbed_copy (); else diff --git a/lily/music.cc b/lily/music.cc index 32681956c2..31bda8a263 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -158,7 +158,7 @@ Music::generic_to_relative_octave (Pitch last) last = new_pit; } - if (Music *m = unsmob_music (elt)) + if (Music *m = Music::unsmob (elt)) last = m->to_relative_octave (last); (void) music_list_to_relative (get_property ("articulations"), last, true); @@ -185,7 +185,7 @@ Music::compress (Moment factor) { SCM elt = get_property ("element"); - if (Music *m = unsmob_music (elt)) + if (Music *m = Music::unsmob (elt)) m->compress (factor); compress_music_list (get_property ("elements"), factor); @@ -220,7 +220,7 @@ transpose_mutable (SCM alist, Pitch delta) } else if (prop == ly_symbol2scm ("element")) { - if (Music *m = unsmob_music (val)) + if (Music *m = Music::unsmob (val)) m->transpose (delta); } else if (prop == ly_symbol2scm ("elements") @@ -253,7 +253,7 @@ Music::set_spot (Input ip) Input * Music::origin () const { - Input *ip = unsmob_input (get_property ("origin")); + Input *ip = Input::unsmob (get_property ("origin")); return ip ? ip : &dummy_input_global; } @@ -283,7 +283,7 @@ Music::to_event () const SCM art_ev = SCM_EOL; for (; scm_is_pair (art_mus); art_mus = scm_cdr (art_mus)) { - Music *m = unsmob_music (scm_car (art_mus)); + Music *m = Music::unsmob (scm_car (art_mus)); art_ev = scm_cons (m->to_event ()->unprotect (), art_ev); } e->set_property ("articulations", scm_reverse_x (art_ev, SCM_EOL)); @@ -313,7 +313,7 @@ make_music_by_name (SCM sym) SCM rv = scm_call_1 (make_music_proc, sym); /* UGH. */ - Music *m = unsmob_music (rv); + Music *m = Music::unsmob (rv); m->protect (); return m; } @@ -322,7 +322,7 @@ MAKE_SCHEME_CALLBACK (Music, duration_length_callback, 1); SCM Music::duration_length_callback (SCM m) { - Music *me = unsmob_music (m); + Music *me = Music::unsmob (m); Duration *d = Duration::unsmob (me->get_property ("duration")); Moment mom; @@ -332,7 +332,7 @@ Music::duration_length_callback (SCM m) } Music * -unsmob_music (SCM m) +Music::unsmob (SCM m) { return dynamic_cast (Prob::unsmob (m)); } diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc index 9bccf3e70e..3db7d7010c 100644 --- a/lily/new-fingering-engraver.cc +++ b/lily/new-fingering-engraver.cc @@ -99,7 +99,7 @@ New_fingering_engraver::acknowledge_rhythmic_head (Grob_info inf) for (SCM s = arts; scm_is_pair (s); s = scm_cdr (s)) { - Stream_event *ev = unsmob_stream_event (scm_car (s)); + Stream_event *ev = Stream_event::unsmob (scm_car (s)); if (!ev) continue; diff --git a/lily/note-column.cc b/lily/note-column.cc index 28a0b13d77..c5d06cfb68 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -61,7 +61,7 @@ Item * Note_column::get_stem (Grob *me) { SCM s = me->get_object ("stem"); - return unsmob_item (s); + return Item::unsmob (s); } Item * @@ -71,7 +71,7 @@ Note_column::get_flag (Grob *me) if (stem) { SCM s = stem->get_object ("flag"); - return unsmob_item (s); + return Item::unsmob (s); } return 0; } diff --git a/lily/note-performer.cc b/lily/note-performer.cc index 8219810c8d..2ab1178472 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -70,7 +70,7 @@ Note_performer::process_music () int velocity = 0; for (SCM s = articulations; scm_is_pair (s); s = scm_cdr (s)) { - Stream_event *ev = unsmob_stream_event (scm_car (s)); + Stream_event *ev = Stream_event::unsmob (scm_car (s)); if (!ev) continue; diff --git a/lily/paper-score-scheme.cc b/lily/paper-score-scheme.cc index a15de7b40c..081ff686ae 100644 --- a/lily/paper-score-scheme.cc +++ b/lily/paper-score-scheme.cc @@ -25,7 +25,7 @@ LY_DEFINE (ly_paper_score_paper_systems, "ly:paper-score-paper-systems", "Return vector of @code{paper_system} objects from" " @var{paper-score}.") { - LY_ASSERT_TYPE (unsmob_paper_score, paper_score, 1); + LY_ASSERT_TYPE (Paper_score::unsmob, paper_score, 1); Paper_score *pscore = dynamic_cast (Music_output::unsmob (paper_score)); return pscore->get_paper_systems (); diff --git a/lily/paper-score.cc b/lily/paper-score.cc index e4163e024b..bcc6e12e87 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -167,7 +167,7 @@ Paper_score::get_paper_systems () } Paper_score * -unsmob_paper_score (SCM x) +Paper_score::unsmob (SCM x) { return dynamic_cast (Music_output::unsmob (x)); } diff --git a/lily/parser.yy b/lily/parser.yy index e8091ad2cf..c8365abf13 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -561,7 +561,7 @@ embedded_lilypond: | post_event post_events { $$ = scm_reverse_x ($2, SCM_EOL); - if (Music *m = unsmob_music ($1)) + if (Music *m = Music::unsmob ($1)) { if (m->is_mus_type ("post-event-wrapper")) $$ = scm_append @@ -583,9 +583,9 @@ embedded_lilypond: | multiplied_duration | music_embedded music_embedded music_list { $3 = scm_reverse_x ($3, SCM_EOL); - if (unsmob_music ($2)) + if (Music::unsmob ($2)) $3 = scm_cons ($2, $3); - if (unsmob_music ($1)) + if (Music::unsmob ($1)) $3 = scm_cons ($1, $3); $$ = MAKE_SYNTAX ("sequential-music", @$, $3); } @@ -647,7 +647,7 @@ identifier_init: | post_event_nofinger post_events { $$ = scm_reverse_x ($2, SCM_EOL); - if (Music *m = unsmob_music ($1)) + if (Music *m = Music::unsmob ($1)) { if (m->is_mus_type ("post-event-wrapper")) $$ = scm_append @@ -747,7 +747,7 @@ context_def_spec_body: $$ = Context_def::make_scm (); td = Context_def::unsmob ($$); } - if (unsmob_music ($2)) { + if (Music::unsmob ($2)) { SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler"); $2 = scm_call_2 (proc, parser->self_scm (), $2); } @@ -993,7 +993,7 @@ score_items: $2 = SCM_UNSPECIFIED; } } else if (!Score::unsmob ($$)) { - if (unsmob_music ($2)) { + if (Music::unsmob ($2)) { SCM scorify = ly_lily_module_constant ("scorify-music"); $2 = scm_call_2 (scorify, $2, parser->self_scm ()); } @@ -1140,7 +1140,7 @@ output_def_body: if (Context_def::unsmob ($2)) assign_context_def (Output_def::unsmob ($1), $2); // Seems unlikely, but let's be complete: - else if (unsmob_music ($2)) + else if (Music::unsmob ($2)) { SCM proc = parser->lexer_->lookup_identifier ("output-def-music-handler"); @@ -1201,7 +1201,7 @@ music_list: $$ = SCM_EOL; } | music_list music_embedded { - if (unsmob_music ($2)) + if (Music::unsmob ($2)) $$ = scm_cons ($2, $1); } | music_list error { @@ -1225,7 +1225,7 @@ music: music_assign | pitch_or_music { $$ = make_music_from_simple (parser, @1, $1); - if (!unsmob_music ($$)) + if (!Music::unsmob ($$)) { parser->parser_error (@1, _ ("music expected")); $$ = MAKE_SYNTAX ("void-music", @$); @@ -1236,7 +1236,7 @@ music: music_assign music_embedded: music { - if (unsmob_music ($1)->is_mus_type ("post-event")) { + if (Music::unsmob ($1)->is_mus_type ("post-event")) { parser->parser_error (@1, _ ("unexpected post-event")); $$ = SCM_UNSPECIFIED; } @@ -1268,7 +1268,7 @@ music_embedded_backup: { if (scm_is_eq ($1, SCM_UNSPECIFIED)) $$ = $1; - else if (Music *m = unsmob_music ($1)) { + else if (Music *m = Music::unsmob ($1)) { if (m->is_mus_type ("post-event")) { parser->parser_error (@1, _ ("unexpected post-event")); @@ -1347,7 +1347,7 @@ context_modification: } | WITH context_modification_arg { - if (unsmob_music ($2)) { + if (Music::unsmob ($2)) { SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler"); $2 = scm_call_2 (proc, parser->self_scm (), $2); } @@ -1391,7 +1391,7 @@ context_mod_list: | context_mod_list context_mod_arg { if (scm_is_eq ($2, SCM_UNSPECIFIED)) ; - else if (unsmob_music ($2)) { + else if (Music::unsmob ($2)) { SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler"); $2 = scm_call_2 (proc, parser->self_scm (), $2); } @@ -2597,7 +2597,7 @@ event_chord: simple_element post_events { // Let the rhythmic music iterator sort this mess out. if (scm_is_pair ($2)) { - unsmob_music ($$)->set_property ("articulations", + Music::unsmob ($$)->set_property ("articulations", scm_reverse_x ($2, SCM_EOL)); } } %prec ':' @@ -2621,13 +2621,13 @@ event_chord: note_chord_element: chord_body optional_notemode_duration post_events { - Music *m = unsmob_music ($1); + Music *m = Music::unsmob ($1); SCM dur = Duration::unsmob ($2)->smobbed_copy (); SCM es = m->get_property ("elements"); SCM postevs = scm_reverse_x ($3, SCM_EOL); for (SCM s = es; scm_is_pair (s); s = scm_cdr (s)) - unsmob_music (scm_car (s))->set_property ("duration", dur); + Music::unsmob (scm_car (s))->set_property ("duration", dur); es = ly_append2 (es, postevs); m-> set_property ("elements", es); @@ -2694,11 +2694,11 @@ chord_body_element: } | music_function_chord_body { - Music *m = unsmob_music ($1); + Music *m = Music::unsmob ($1); while (m && m->is_mus_type ("music-wrapper-music")) { $$ = m->get_property ("element"); - m = unsmob_music ($$); + m = Music::unsmob ($$); } if (!(m && m->is_mus_type ("rhythmic-event"))) { @@ -2727,7 +2727,7 @@ post_events: } | post_events post_event { $$ = $1; - if (Music *m = unsmob_music ($2)) + if (Music *m = Music::unsmob ($2)) { if (m->is_mus_type ("post-event-wrapper")) { @@ -2751,12 +2751,12 @@ post_event_nofinger: } | script_dir music_function_call { $$ = $2; - if (!unsmob_music ($2)->is_mus_type ("post-event")) { + if (!Music::unsmob ($2)->is_mus_type ("post-event")) { parser->parser_error (@2, _ ("post-event expected")); $$ = SCM_UNSPECIFIED; } else if (!SCM_UNBNDP ($1)) { - unsmob_music ($$)->set_property ("direction", $1); + Music::unsmob ($$)->set_property ("direction", $1); } } | HYPHEN { @@ -2772,7 +2772,7 @@ post_event_nofinger: | script_dir direction_reqd_event { if (!SCM_UNBNDP ($1)) { - Music *m = unsmob_music ($2); + Music *m = Music::unsmob ($2); m->set_property ("direction", $1); } $$ = $2; @@ -2780,7 +2780,7 @@ post_event_nofinger: | script_dir direction_less_event { if (!SCM_UNBNDP ($1)) { - Music *m = unsmob_music ($2); + Music *m = Music::unsmob ($2); m->set_property ("direction", $1); } $$ = $2; @@ -2788,12 +2788,12 @@ post_event_nofinger: | '^' fingering { $$ = $2; - unsmob_music ($$)->set_property ("direction", scm_from_int (UP)); + Music::unsmob ($$)->set_property ("direction", scm_from_int (UP)); } | '_' fingering { $$ = $2; - unsmob_music ($$)->set_property ("direction", scm_from_int (DOWN)); + Music::unsmob ($$)->set_property ("direction", scm_from_int (DOWN)); } ; @@ -2836,7 +2836,7 @@ direction_reqd_event: a->set_property ("articulation-type", s); $$ = a->unprotect (); } else { - Music *original = unsmob_music (s); + Music *original = Music::unsmob (s); if (original && original->is_mus_type ("post-event")) { Music *a = original->clone (); a->set_spot (parser->lexer_->override_input (@$)); @@ -2933,7 +2933,7 @@ gen_text_def: } | embedded_scm { - Music *m = unsmob_music ($1); + Music *m = Music::unsmob ($1); if (m && m->is_mus_type ("post-event")) $$ = $1; else if (Text_interface::is_markup ($1)) { @@ -3107,10 +3107,10 @@ bass_figure: } | bass_figure ']' { $$ = $1; - unsmob_music ($1)->set_property ("bracket-stop", SCM_BOOL_T); + Music::unsmob ($1)->set_property ("bracket-stop", SCM_BOOL_T); } | bass_figure figured_bass_alteration { - Music *m = unsmob_music ($1); + Music *m = Music::unsmob ($1); if (scm_to_double ($2)) { SCM salter = m->get_property ("alteration"); SCM alter = scm_is_number (salter) ? salter : scm_from_int (0); @@ -3121,7 +3121,7 @@ bass_figure: } } | bass_figure figured_bass_modification { - Music *m = unsmob_music ($1); + Music *m = Music::unsmob ($1); m->set_property ($2, SCM_BOOL_T); } ; @@ -3148,7 +3148,7 @@ br_bass_figure: } | '[' bass_figure { $$ = $2; - unsmob_music ($$)->set_property ("bracket-start", SCM_BOOL_T); + Music::unsmob ($$)->set_property ("bracket-start", SCM_BOOL_T); } ; @@ -3266,7 +3266,7 @@ lyric_element_music: lyric_element optional_notemode_duration post_events { $$ = MAKE_SYNTAX ("lyric-event", @$, $1, $2); if (scm_is_pair ($3)) - unsmob_music ($$)->set_property + Music::unsmob ($$)->set_property ("articulations", scm_reverse_x ($3, SCM_EOL)); } %prec ':' ; @@ -3678,7 +3678,7 @@ Lily_lexer::try_special_identifiers (SCM *destination, SCM sid) } else if (Context_mod::unsmob (sid)) { *destination = Context_mod::unsmob (sid)->smobbed_copy (); return CONTEXT_MOD_IDENTIFIER; - } else if (Music *mus = unsmob_music (sid)) { + } else if (Music *mus = Music::unsmob (sid)) { mus = mus->clone (); *destination = mus->self_scm (); bool is_event = mus->is_mus_type ("post-event"); @@ -3751,7 +3751,7 @@ SCM check_scheme_arg (Lily_parser *parser, Input loc, SCM loc_on_music (Input loc, SCM arg) { - if (Music *m = unsmob_music (arg)) + if (Music *m = Music::unsmob (arg)) { m = m->clone (); m->set_spot (loc); @@ -3830,7 +3830,7 @@ is_regular_identifier (SCM id, bool multiple) SCM make_music_from_simple (Lily_parser *parser, Input loc, SCM simple) { - if (unsmob_music (simple)) + if (Music::unsmob (simple)) return simple; if (parser->lexer_->is_note_state ()) { if (scm_is_symbol (simple)) { @@ -3908,7 +3908,7 @@ make_chord_elements (Input loc, SCM pitch, SCM dur, SCM modification_list) SCM res = scm_call_3 (chord_ctor, pitch, dur, modification_list); for (SCM s = res; scm_is_pair (s); s = scm_cdr (s)) { - unsmob_music (scm_car (s))->set_spot (loc); + Music::unsmob (scm_car (s))->set_spot (loc); } return res; } diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc index 78ecb21b9f..01039d66ab 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -390,10 +390,10 @@ Part_combine_iterator::construct_children () SCM lst = get_music ()->get_property ("elements"); Context *one = handles_[CONTEXT_ONE].get_context (); set_context (one); - first_iter_ = Music_iterator::unsmob (get_iterator (unsmob_music (scm_car (lst)))); + first_iter_ = Music_iterator::unsmob (get_iterator (Music::unsmob (scm_car (lst)))); Context *two = handles_[CONTEXT_TWO].get_context (); set_context (two); - second_iter_ = Music_iterator::unsmob (get_iterator (unsmob_music (scm_cadr (lst)))); + second_iter_ = Music_iterator::unsmob (get_iterator (Music::unsmob (scm_cadr (lst)))); Context *shared = handles_[CONTEXT_SHARED].get_context (); set_context (shared); @@ -443,7 +443,7 @@ Part_combine_iterator::set_busy (SCM se) if (!notice_busy_) return; - Stream_event *e = unsmob_stream_event (se); + Stream_event *e = Stream_event::unsmob (se); if (e->in_event_class ("note-event") || e->in_event_class ("cluster-note-event")) busy_ = true; diff --git a/lily/percent-repeat-item.cc b/lily/percent-repeat-item.cc index c4b9a70d36..f3509dd96a 100644 --- a/lily/percent-repeat-item.cc +++ b/lily/percent-repeat-item.cc @@ -80,7 +80,7 @@ SCM Percent_repeat_item_interface::beat_slash (SCM grob) { Grob *me = Grob::unsmob (grob); - Stream_event *cause = unsmob_stream_event (me->get_property ("cause")); + Stream_event *cause = Stream_event::unsmob (me->get_property ("cause")); int count = robust_scm2int (cause->get_property ("slash-count"), 1); Stencil m; diff --git a/lily/performance-scheme.cc b/lily/performance-scheme.cc index ab8e234b17..874f44038c 100644 --- a/lily/performance-scheme.cc +++ b/lily/performance-scheme.cc @@ -23,10 +23,10 @@ LY_DEFINE (ly_performance_write, "ly:performance-write", 2, 0, 0, (SCM performance, SCM filename), "Write @var{performance} to @var{filename}.") { - LY_ASSERT_TYPE (unsmob_performance, performance, 1); + LY_ASSERT_TYPE (Performance::unsmob, performance, 1); LY_ASSERT_TYPE (scm_is_string, filename, 2); - unsmob_performance (performance)->write_output (ly_scm2string (filename)); + Performance::unsmob (performance)->write_output (ly_scm2string (filename)); return SCM_UNSPECIFIED; } diff --git a/lily/performance.cc b/lily/performance.cc index 06f00338ea..f0b9c00192 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -99,7 +99,7 @@ Performance::process () } Performance * -unsmob_performance (SCM x) +Performance::unsmob (SCM x) { return dynamic_cast (Music_output::unsmob (x)); } diff --git a/lily/performer.cc b/lily/performer.cc index c0dff19f5f..fad7db5959 100644 --- a/lily/performer.cc +++ b/lily/performer.cc @@ -50,7 +50,7 @@ Performer::announce_element (Audio_element_info i) } Performer * -unsmob_performer (SCM perf) +Performer::unsmob (SCM perf) { return dynamic_cast (Translator::unsmob (perf)); } diff --git a/lily/piano-pedal-align-engraver.cc b/lily/piano-pedal-align-engraver.cc index e05cee9e05..4c984f253e 100644 --- a/lily/piano-pedal-align-engraver.cc +++ b/lily/piano-pedal-align-engraver.cc @@ -238,7 +238,7 @@ Piano_pedal_align_engraver::finalize () if (pedal_info_[i].line_spanner_) { SCM cc = get_property ("currentCommandColumn"); - Item *c = unsmob_item (cc); + Item *c = Item::unsmob (cc); pedal_info_[i].line_spanner_->set_bound (RIGHT, c); pedal_info_[i].clear (); diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index caf72c7987..250dfb458d 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -424,7 +424,7 @@ Piano_pedal_engraver::finalize () if (p->bracket_) { SCM cc = get_property ("currentCommandColumn"); - Item *c = unsmob_item (cc); + Item *c = Item::unsmob (cc); p->bracket_->set_bound (RIGHT, c); p->finished_bracket_ = p->bracket_; diff --git a/lily/prob.cc b/lily/prob.cc index 9d668b2969..8b14f73416 100644 --- a/lily/prob.cc +++ b/lily/prob.cc @@ -64,7 +64,7 @@ Prob::equal_p (SCM sa, SCM sb) SCM aval = scm_cdar (aprop); SCM bval = scm_cdar (bprop); if (scm_caar (aprop) != scm_caar (bprop) - || (!(unsmob_input (aval) && unsmob_input (bval)) + || (!(Input::unsmob (aval) && Input::unsmob (bval)) && !to_boolean (scm_equal_p (aval, bval)))) return SCM_BOOL_F; diff --git a/lily/property-iterator.cc b/lily/property-iterator.cc index f3036629a4..c7cb8108b0 100644 --- a/lily/property-iterator.cc +++ b/lily/property-iterator.cc @@ -93,7 +93,7 @@ MAKE_SCHEME_CALLBACK (Property_iterator, once_finalization, 3); SCM Property_iterator::once_finalization (SCM ctx, SCM music, SCM previous_value) { - Music *m = unsmob_music (music); + Music *m = Music::unsmob (music); Context *c = Context::unsmob (ctx); // Do not use UnsetProperty, which sets the default, but rather @@ -163,7 +163,7 @@ MAKE_SCHEME_CALLBACK (Push_property_iterator, once_finalization, 2); SCM Push_property_iterator::once_finalization (SCM ctx, SCM music) { - Music *mus = unsmob_music (music); + Music *mus = Music::unsmob (music); Context *c = Context::unsmob (ctx); SCM sym = mus->get_property ("symbol"); diff --git a/lily/quote-iterator.cc b/lily/quote-iterator.cc index dc347e2e20..17f7b71433 100644 --- a/lily/quote-iterator.cc +++ b/lily/quote-iterator.cc @@ -260,7 +260,7 @@ Quote_iterator::process (Moment m) { SCM ev_acc = scm_car (s); - Stream_event *ev = unsmob_stream_event (scm_car (ev_acc)); + Stream_event *ev = Stream_event::unsmob (scm_car (ev_acc)); if (!ev) programming_error ("no music found in quote"); else if (accept_music_type (ev, is_cue)) diff --git a/lily/relative-octave-check.cc b/lily/relative-octave-check.cc index 627173ea77..00973f79fc 100644 --- a/lily/relative-octave-check.cc +++ b/lily/relative-octave-check.cc @@ -32,7 +32,7 @@ SCM Relative_octave_check::relative_callback (SCM music, SCM last_pitch) { Pitch p = *Pitch::unsmob (last_pitch); - Music *m = unsmob_music (music); + Music *m = Music::unsmob (music); Pitch *check_p = Pitch::unsmob (m->get_property ("pitch")); int delta_oct = 0; diff --git a/lily/repeat-tie-engraver.cc b/lily/repeat-tie-engraver.cc index 8cb9334c47..14a08e5251 100644 --- a/lily/repeat-tie-engraver.cc +++ b/lily/repeat-tie-engraver.cc @@ -80,9 +80,9 @@ Repeat_tie_engraver::acknowledge_note_head (Grob_info inf) semi_tie->set_parent (semi_tie_column_, Y_AXIS); semi_ties_.push_back (semi_tie); - if (is_direction (unsmob_stream_event (cause)->get_property ("direction"))) + if (is_direction (Stream_event::unsmob (cause)->get_property ("direction"))) { - Direction d = to_dir (unsmob_stream_event (cause)->get_property ("direction")); + Direction d = to_dir (Stream_event::unsmob (cause)->get_property ("direction")); semi_tie->set_property ("direction", scm_from_int (d)); } diff --git a/lily/repeated-music.cc b/lily/repeated-music.cc index 57bf98e739..b56c61c648 100644 --- a/lily/repeated-music.cc +++ b/lily/repeated-music.cc @@ -26,7 +26,7 @@ Music * Repeated_music::body (Music *me) { - return unsmob_music (me->get_property ("element")); + return Music::unsmob (me->get_property ("element")); } SCM @@ -53,7 +53,7 @@ Repeated_music::alternatives_get_length (Music *me, bool fold) SCM p = alternative_list; while (scm_is_pair (p) && done < count) { - m = m + unsmob_music (scm_car (p))->get_length (); + m = m + Music::unsmob (scm_car (p))->get_length (); done++; if (count - done < len) p = scm_cdr (p); @@ -78,7 +78,7 @@ Moment Repeated_music::body_get_length (Music *me) { Moment m = 0; - if (Music *body = unsmob_music (me->get_property ("element"))) + if (Music *body = Music::unsmob (me->get_property ("element"))) m = body->get_length (); return m; } @@ -88,7 +88,7 @@ MAKE_SCHEME_CALLBACK (Repeated_music, unfolded_music_length, 1); SCM Repeated_music::unfolded_music_length (SCM m) { - Music *me = unsmob_music (m); + Music *me = Music::unsmob (m); Moment l = Moment (repeat_count (me)) * body_get_length (me) + alternatives_get_length (me, false); return l.smobbed_copy (); @@ -98,7 +98,7 @@ MAKE_SCHEME_CALLBACK (Repeated_music, folded_music_length, 1); SCM Repeated_music::folded_music_length (SCM m) { - Music *me = unsmob_music (m); + Music *me = Music::unsmob (m); Moment l = body_get_length (me) + alternatives_get_length (me, true); return l.smobbed_copy (); @@ -114,7 +114,7 @@ MAKE_SCHEME_CALLBACK (Repeated_music, volta_music_length, 1); SCM Repeated_music::volta_music_length (SCM m) { - Music *me = unsmob_music (m); + Music *me = Music::unsmob (m); Moment l = body_get_length (me) + alternatives_volta_get_length (me); return l.smobbed_copy (); } @@ -123,8 +123,8 @@ MAKE_SCHEME_CALLBACK (Repeated_music, minimum_start, 1); SCM Repeated_music::minimum_start (SCM m) { - Music *me = unsmob_music (m); - Music *body = unsmob_music (me->get_property ("element")); + Music *me = Music::unsmob (m); + Music *body = Music::unsmob (me->get_property ("element")); if (body) return body->start_mom ().smobbed_copy (); @@ -136,8 +136,8 @@ MAKE_SCHEME_CALLBACK (Repeated_music, first_start, 1); SCM Repeated_music::first_start (SCM m) { - Music *me = unsmob_music (m); - Music *body = unsmob_music (me->get_property ("element")); + Music *me = Music::unsmob (m); + Music *body = Music::unsmob (me->get_property ("element")); Moment rv = (body) ? body->start_mom () : Music_sequence::first_start (me->get_property ("elements")); diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index af410a2cf4..2c6b2bee5f 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -29,14 +29,14 @@ Item * Rhythmic_head::get_dots (Grob *me) { SCM s = me->get_object ("dot"); - return unsmob_item (s); + return Item::unsmob (s); } Item * Rhythmic_head::get_stem (Grob *me) { SCM s = me->get_object ("stem"); - return unsmob_item (s); + return Item::unsmob (s); } int diff --git a/lily/rhythmic-music-iterator.cc b/lily/rhythmic-music-iterator.cc index 64daa8ea5b..011d32cd01 100644 --- a/lily/rhythmic-music-iterator.cc +++ b/lily/rhythmic-music-iterator.cc @@ -62,7 +62,7 @@ Rhythmic_music_iterator::process (Moment m) SCM art = scm_car (arts); if (c->event_source ()->is_listened_class - (unsmob_stream_event (art)->get_property ("class"))) + (Stream_event::unsmob (art)->get_property ("class"))) listened = scm_cons (art, listened); else unlistened = scm_cons (art, unlistened); @@ -71,7 +71,7 @@ Rhythmic_music_iterator::process (Moment m) c->event_source ()->broadcast (ev); arts = scm_reverse_x (listened, SCM_EOL); for (; scm_is_pair (arts); arts = scm_cdr (arts)) - c->event_source ()->broadcast (unsmob_stream_event (scm_car (arts))); + c->event_source ()->broadcast (Stream_event::unsmob (scm_car (arts))); } else c->event_source ()->broadcast (ev); diff --git a/lily/score-performer.cc b/lily/score-performer.cc index ac8f656c48..e14fa62638 100644 --- a/lily/score-performer.cc +++ b/lily/score-performer.cc @@ -106,7 +106,7 @@ IMPLEMENT_LISTENER (Score_performer, prepare); void Score_performer::prepare (SCM sev) { - Stream_event *ev = unsmob_stream_event (sev); + Stream_event *ev = Stream_event::unsmob (sev); SCM sm = ev->get_property ("moment"); Moment *m = Moment::unsmob (sm); audio_column_ = new Audio_column (*m); diff --git a/lily/score.cc b/lily/score.cc index a1dc267ac1..81477a118a 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -41,7 +41,7 @@ using namespace std; Input * Score::origin () const { - return unsmob_input (input_location_); + return Input::unsmob (input_location_); } Score::Score () @@ -95,7 +95,7 @@ Score::Score (Score const &s) smobify_self (); input_location_ = make_input (*s.origin ()); - Music *m = unsmob_music (s.music_); + Music *m = Music::unsmob (s.music_); if (m) { Music *mclone = m->clone (); @@ -167,12 +167,12 @@ Score::book_rendering (Output_def *layoutbook, void Score::set_music (SCM music) { - if (unsmob_music (music_)) + if (Music::unsmob (music_)) { - unsmob_music (music)->origin ()->error (_ ("already have music in score")); - unsmob_music (music_)->origin ()->error (_ ("this is the previous music")); + Music::unsmob (music)->origin ()->error (_ ("already have music in score")); + Music::unsmob (music_)->origin ()->error (_ ("this is the previous music")); } - Music *m = unsmob_music (music); + Music *m = Music::unsmob (music); if (m && to_boolean (m->get_property ("error-found"))) { m->origin ()->error (_ ("errors found, ignoring music expression")); diff --git a/lily/separation-item.cc b/lily/separation-item.cc index f86e657f13..6b50b117ee 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -87,7 +87,7 @@ MAKE_SCHEME_CALLBACK (Separation_item, calc_skylines, 1); SCM Separation_item::calc_skylines (SCM smob) { - Item *me = unsmob_item (smob); + Item *me = Item::unsmob (smob); vector bs = boxes (me, 0); Skyline_pair sp (bs, Y_AXIS); /* diff --git a/lily/sequential-iterator.cc b/lily/sequential-iterator.cc index cdbba8e5ac..1429abd51e 100644 --- a/lily/sequential-iterator.cc +++ b/lily/sequential-iterator.cc @@ -33,7 +33,7 @@ if (scm_is_pair (cursor_)) - iter_->music_ == unsmob_music (scm_car (cursor_)) + iter_->music_ == Music::unsmob (scm_car (cursor_)) else iter_ == 0; @@ -96,7 +96,7 @@ create_grace_fixup_list (SCM cursor) for (; scm_is_pair (cursor); cursor = scm_cdr (cursor)) { - Music *mus = unsmob_music (scm_car (cursor)); + Music *mus = Music::unsmob (scm_car (cursor)); Moment s = mus->start_mom (); Moment l = mus->get_length () - s; @@ -134,7 +134,7 @@ Sequential_iterator::construct_children () iter_ = 0; if (scm_is_pair (cursor_)) { - Music *m = unsmob_music (scm_car (cursor_)); + Music *m = Music::unsmob (scm_car (cursor_)); iter_ = Music_iterator::unsmob (get_iterator (m)); } @@ -195,7 +195,7 @@ Sequential_iterator::next_element (bool) iter_->quit (); if (scm_is_pair (cursor_)) - iter_ = Music_iterator::unsmob (get_iterator (unsmob_music (scm_car (cursor_)))); + iter_ = Music_iterator::unsmob (get_iterator (Music::unsmob (scm_car (cursor_)))); else iter_ = 0; } diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc index 7f7dd0e38c..92bf91b25a 100644 --- a/lily/simultaneous-music-iterator.cc +++ b/lily/simultaneous-music-iterator.cc @@ -53,7 +53,7 @@ Simultaneous_music_iterator::construct_children () SCM *tail = &children_list_; for (; scm_is_pair (i); i = scm_cdr (i), j++) { - Music *mus = unsmob_music (scm_car (i)); + Music *mus = Music::unsmob (scm_car (i)); SCM scm_iter = get_static_get_iterator (mus); Music_iterator *mi = Music_iterator::unsmob (scm_iter); diff --git a/lily/slur-proto-engraver.cc b/lily/slur-proto-engraver.cc index b90d381412..a72bbbc5a9 100644 --- a/lily/slur-proto-engraver.cc +++ b/lily/slur-proto-engraver.cc @@ -176,7 +176,7 @@ Slur_proto_engraver::can_create_slur (const string &id, vsize old_slurs, vsize * if (!updown) return false; - Stream_event *c = unsmob_stream_event (slur->get_property ("cause")); + Stream_event *c = Stream_event::unsmob (slur->get_property ("cause")); if (!c) { diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 6986439481..7ffdacee0c 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -331,7 +331,7 @@ MAKE_SCHEME_CALLBACK (Slur, calc_control_points, 1) SCM Slur::calc_control_points (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); Slur_score_state state; state.fill (me); diff --git a/lily/spacing-determine-loose-columns.cc b/lily/spacing-determine-loose-columns.cc index 5c2c0b2a91..efefddba89 100644 --- a/lily/spacing-determine-loose-columns.cc +++ b/lily/spacing-determine-loose-columns.cc @@ -80,8 +80,8 @@ is_loose_column (Grob *l, Grob *col, Grob *r, Spacing_options const *options) */ - Item *r_neighbor = unsmob_item (col->get_object ("right-neighbor")); - Item *l_neighbor = unsmob_item (col->get_object ("left-neighbor")); + Item *r_neighbor = Item::unsmob (col->get_object ("right-neighbor")); + Item *l_neighbor = Item::unsmob (col->get_object ("left-neighbor")); if (!l_neighbor || !r_neighbor) return false; diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 880c0b921d..204893627d 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -58,7 +58,7 @@ MAKE_SCHEME_CALLBACK (Spacing_spanner, set_springs, 1); SCM Spacing_spanner::set_springs (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); /* can't use get_system () ? --hwn. @@ -89,7 +89,7 @@ MAKE_SCHEME_CALLBACK (Spacing_spanner, calc_common_shortest_duration, 1); SCM Spacing_spanner::calc_common_shortest_duration (SCM grob) { - Spanner *me = unsmob_spanner (grob); + Spanner *me = Spanner::unsmob (grob); vector cols (get_columns (me)); diff --git a/lily/spanner-scheme.cc b/lily/spanner-scheme.cc index 4298aac896..4c77ccc01a 100644 --- a/lily/spanner-scheme.cc +++ b/lily/spanner-scheme.cc @@ -26,9 +26,9 @@ LY_DEFINE (ly_spanner_bound, "ly:spanner-bound", "Get one of the bounds of @var{spanner}. @var{dir} is @w{@code{-1}}" " for left, and @code{1} for right.") { - LY_ASSERT_TYPE (unsmob_spanner, spanner, 1); + LY_ASSERT_TYPE (Spanner::unsmob, spanner, 1); LY_ASSERT_TYPE (is_direction, dir, 2); - Item *bound = unsmob_spanner (spanner)->get_bound (to_dir (dir)); + Item *bound = Spanner::unsmob (spanner)->get_bound (to_dir (dir)); return bound ? bound->self_scm () : SCM_EOL; } @@ -37,11 +37,11 @@ LY_DEFINE (ly_spanner_set_bound_x, "ly:spanner-set-bound!", "Set grob @var{item} as bound in direction @var{dir} for" " @var{spanner}.") { - LY_ASSERT_TYPE (unsmob_spanner, spanner, 1); + LY_ASSERT_TYPE (Spanner::unsmob, spanner, 1); LY_ASSERT_TYPE (is_direction, dir, 2); - LY_ASSERT_TYPE (unsmob_item, item, 3); + LY_ASSERT_TYPE (Item::unsmob, item, 3); - unsmob_spanner (spanner)->set_bound (to_dir (dir), unsmob_item (item)); + Spanner::unsmob (spanner)->set_bound (to_dir (dir), Item::unsmob (item)); return SCM_UNSPECIFIED; } @@ -51,7 +51,7 @@ LY_DEFINE (ly_spanner_broken_into, "ly:spanner-broken-into", 1, 0, 0, (SCM spanner), "Return broken-into list for @var{spanner}.") { - LY_ASSERT_TYPE (unsmob_spanner, spanner, 1); + LY_ASSERT_TYPE (Spanner::unsmob, spanner, 1); Spanner *me = dynamic_cast (Grob::unsmob (spanner)); SCM s = SCM_EOL; diff --git a/lily/spanner.cc b/lily/spanner.cc index 80741e4b95..52745136fc 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -422,7 +422,7 @@ MAKE_SCHEME_CALLBACK (Spanner, calc_normalized_endpoints, 1); SCM Spanner::calc_normalized_endpoints (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); SCM result = SCM_EOL; Spanner *orig = dynamic_cast (me->original ()); @@ -466,7 +466,7 @@ Spanner::calc_normalized_endpoints (SCM smob) } Spanner * -unsmob_spanner (SCM s) +Spanner::unsmob (SCM s) { return dynamic_cast (Grob::unsmob (s)); } @@ -475,7 +475,7 @@ MAKE_SCHEME_CALLBACK (Spanner, bounds_width, 1); SCM Spanner::bounds_width (SCM grob) { - Spanner *me = unsmob_spanner (grob); + Spanner *me = Spanner::unsmob (grob); Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS); @@ -491,7 +491,7 @@ MAKE_SCHEME_CALLBACK (Spanner, kill_zero_spanned_time, 1); SCM Spanner::kill_zero_spanned_time (SCM grob) { - Spanner *me = unsmob_spanner (grob); + Spanner *me = Spanner::unsmob (grob); /* Remove the line or hairpin at the start of the line. For piano voice indicators, it makes no sense to have them at diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 9d58275e76..b3bb3bec9e 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -149,13 +149,13 @@ MAKE_SCHEME_CALLBACK (Stem_tremolo, pure_height, 3); SCM Stem_tremolo::pure_height (SCM smob, SCM, SCM) { - Item *me = unsmob_item (smob); + Item *me = Item::unsmob (smob); /* Cannot use the real slope, since it looks at the Beam. */ Stencil s1 (untranslated_stencil (me, 0.35)); - Item *stem = unsmob_item (me->get_object ("stem")); + Item *stem = Item::unsmob (me->get_object ("stem")); if (!stem) return ly_interval2scm (s1.extent (Y_AXIS)); @@ -240,9 +240,9 @@ MAKE_SCHEME_CALLBACK (Stem_tremolo, calc_direction, 1); SCM Stem_tremolo::calc_direction (SCM smob) { - Item *me = unsmob_item (smob); + Item *me = Item::unsmob (smob); - Item *stem = unsmob_item (me->get_object ("stem")); + Item *stem = Item::unsmob (me->get_object ("stem")); if (!stem) return scm_from_int (CENTER); @@ -279,7 +279,7 @@ Stem_tremolo::calc_direction (SCM smob) Real Stem_tremolo::y_offset (Grob *me, bool pure) { - Item *stem = unsmob_item (me->get_object ("stem")); + Item *stem = Item::unsmob (me->get_object ("stem")); if (!stem) return 0.0; diff --git a/lily/stream-event-scheme.cc b/lily/stream-event-scheme.cc index 2a3dfa3cd1..7ac17dac40 100644 --- a/lily/stream-event-scheme.cc +++ b/lily/stream-event-scheme.cc @@ -23,7 +23,7 @@ LY_DEFINE (ly_stream_event_p, "ly:stream-event?", 1, 0, 0, (SCM obj), "Is @code{@var{obj}} a @code{Stream_event} object?") { - return scm_from_bool (unsmob_stream_event (obj)); + return scm_from_bool (Stream_event::unsmob (obj)); } LY_DEFINE (ly_make_stream_event, "ly:make-stream-event", @@ -49,7 +49,7 @@ LY_DEFINE (ly_event_property, "ly:event-property", " If @var{sym} is undefined, return @var{val} or" " @code{'()} if @var{val} is not specified.") { - LY_ASSERT_TYPE (unsmob_stream_event, sev, 1) + LY_ASSERT_TYPE (Stream_event::unsmob, sev, 1) return ly_prob_property (sev, sym, val); } @@ -57,7 +57,7 @@ LY_DEFINE (ly_event_set_property_x, "ly:event-set-property!", 3, 0, 0, (SCM ev, SCM sym, SCM val), "Set property @var{sym} in event @var{ev} to @var{val}.") { - LY_ASSERT_TYPE (unsmob_stream_event, ev, 1); + LY_ASSERT_TYPE (Stream_event::unsmob, ev, 1); LY_ASSERT_TYPE (ly_is_symbol, sym, 2); return ly_prob_set_property_x (ev, sym, val); @@ -68,7 +68,7 @@ LY_DEFINE (ly_event_deep_copy, "ly:event-deep-copy", "Copy @var{m} and all sub expressions of@tie{}@var{m}.") { SCM copy = m; - if (Stream_event *ev = unsmob_stream_event (m)) + if (Stream_event *ev = Stream_event::unsmob (m)) { ev = ev->clone (); copy = ev->unprotect (); diff --git a/lily/stream-event.cc b/lily/stream-event.cc index 91aacbdda3..f8c9f8fc8b 100644 --- a/lily/stream-event.cc +++ b/lily/stream-event.cc @@ -55,7 +55,7 @@ Stream_event::copy_mutable_properties () const Input * Stream_event::origin () const { - Input *i = unsmob_input (get_property ("origin")); + Input *i = Input::unsmob (get_property ("origin")); return i ? i : &dummy_input_global; } @@ -88,7 +88,7 @@ Stream_event::make_transposable () SCM val = scm_cdr (entry); if ((Pitch::unsmob (val) - || (prop == ly_symbol2scm ("element") && unsmob_music (val)) + || (prop == ly_symbol2scm ("element") && Music::unsmob (val)) || (prop == ly_symbol2scm ("elements") && scm_is_pair (val)) || (prop == ly_symbol2scm ("pitch-alist") && scm_is_pair (val))) && scm_is_false (scm_assq (prop, mutable_property_alist_))) @@ -100,7 +100,7 @@ Stream_event::make_transposable () SCM Stream_event::dump (SCM self) { - Stream_event *ev = unsmob_stream_event (self); + Stream_event *ev = Stream_event::unsmob (self); // Reversed alists look prettier. return scm_cons (scm_reverse (ev->immutable_property_alist_), scm_reverse (ev->mutable_property_alist_)); @@ -116,7 +116,7 @@ Stream_event::undump (SCM data) } Stream_event * -unsmob_stream_event (SCM m) +Stream_event::unsmob (SCM m) { return dynamic_cast (Prob::unsmob (m)); } diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index f96becff75..8987c44601 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -93,7 +93,7 @@ MAKE_SCHEME_CALLBACK (System_start_delimiter, print, 1); SCM System_start_delimiter::print (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); extract_grob_set (me, "elements", elts); Grob *common = common_refpoint_of_array (elts, me, Y_AXIS); diff --git a/lily/system.cc b/lily/system.cc index 157edcf958..959b85c46a 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -394,7 +394,7 @@ MAKE_SCHEME_CALLBACK (System, footnotes_after_line_breaking, 1); SCM System::footnotes_after_line_breaking (SCM smob) { - Spanner *sys_span = unsmob_spanner (smob); + Spanner *sys_span = Spanner::unsmob (smob); System *sys = dynamic_cast (sys_span); Interval_t sri = sys->spanned_rank_interval (); vector footnote_grobs = sys->get_footnote_grobs_in_range (sri[LEFT], sri[RIGHT]); diff --git a/lily/tab-tie-follow-engraver.cc b/lily/tab-tie-follow-engraver.cc index 9f80749e03..bbe5fca91e 100644 --- a/lily/tab-tie-follow-engraver.cc +++ b/lily/tab-tie-follow-engraver.cc @@ -85,7 +85,7 @@ Tab_tie_follow_engraver::stop_translation_timestep () if (left_item) { SCM left_cause = left_item->get_property ("cause"); - Item *slur_cause = unsmob_item (left_cause); + Item *slur_cause = Item::unsmob (left_cause); if (slur_cause == note_heads_[k]) { note_heads_[k]->set_property ("span-start", SCM_BOOL_T); diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index a099d9c7ab..fa1617612a 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -154,8 +154,8 @@ Tie_engraver::acknowledge_note_head (Grob_info i) for (vsize i = heads_to_tie_.size (); i--;) { Grob *th = heads_to_tie_[i].head_; - Stream_event *right_ev = unsmob_stream_event (h->get_property ("cause")); - Stream_event *left_ev = unsmob_stream_event (th->get_property ("cause")); + Stream_event *right_ev = Stream_event::unsmob (h->get_property ("cause")); + Stream_event *left_ev = Stream_event::unsmob (th->get_property ("cause")); /* maybe should check positions too. @@ -261,7 +261,7 @@ Tie_engraver::process_acknowledged () { Grob *head = now_heads_[i]; Stream_event *left_ev - = unsmob_stream_event (head->get_property ("cause")); + = Stream_event::unsmob (head->get_property ("cause")); if (!left_ev) { @@ -281,7 +281,7 @@ Tie_engraver::process_acknowledged () !tie_event && !tie_stream_event && scm_is_pair (s); s = scm_cdr (s)) { - Stream_event *ev = unsmob_stream_event (scm_car (s)); + Stream_event *ev = Stream_event::unsmob (scm_car (s)); if (!ev) continue; diff --git a/lily/tie-formatting-problem.cc b/lily/tie-formatting-problem.cc index e33f1677c3..d4755f1b9a 100644 --- a/lily/tie-formatting-problem.cc +++ b/lily/tie-formatting-problem.cc @@ -380,7 +380,7 @@ Tie_formatting_problem::from_semi_ties (vector const &semi_ties, Directi for (vsize i = 0; i < semi_ties.size (); i++) { Tie_specification spec; - Item *head = unsmob_item (semi_ties[i]->get_object ("note-head")); + Item *head = Item::unsmob (semi_ties[i]->get_object ("note-head")); if (!head) programming_error ("LV tie without head?!"); diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 8735fa9f26..3f7e129602 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -101,7 +101,7 @@ filter_performers (SCM ell) SCM *tail = ℓ for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p)) { - if (unsmob_performer (scm_car (*tail))) + if (Performer::unsmob (scm_car (*tail))) *tail = scm_cdr (*tail); else tail = SCM_CDRLOC (*tail); @@ -115,7 +115,7 @@ filter_engravers (SCM ell) SCM *tail = ℓ for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p)) { - if (unsmob_engraver (scm_car (*tail))) + if (Engraver::unsmob (scm_car (*tail))) *tail = scm_cdr (*tail); else tail = SCM_CDRLOC (*tail); @@ -149,7 +149,7 @@ IMPLEMENT_LISTENER (Translator_group, create_child_translator); void Translator_group::create_child_translator (SCM sev) { - Stream_event *ev = unsmob_stream_event (sev); + Stream_event *ev = Stream_event::unsmob (sev); // get from AnnounceNewContext SCM cs = ev->get_property ("context"); Context *new_context = Context::unsmob (cs); diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 66bc6db4a4..020f3939f6 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -133,7 +133,7 @@ MAKE_SCHEME_CALLBACK (Tuplet_bracket, calc_connect_to_neighbors, 1); SCM Tuplet_bracket::calc_connect_to_neighbors (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); Direction dir = get_grob_direction (me); Drul_array bounds (get_x_bound_item (me, LEFT, dir), @@ -184,7 +184,7 @@ MAKE_SCHEME_CALLBACK (Tuplet_bracket, calc_x_positions, 1) SCM Tuplet_bracket::calc_x_positions (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); extract_grob_set (me, "note-columns", columns); Grob *commonx = get_common_x (me); @@ -255,7 +255,7 @@ MAKE_SCHEME_CALLBACK (Tuplet_bracket, print, 1); SCM Tuplet_bracket::print (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); Stencil mol; extract_grob_set (me, "note-columns", columns); @@ -711,7 +711,7 @@ MAKE_SCHEME_CALLBACK (Tuplet_bracket, calc_positions, 1); SCM Tuplet_bracket::calc_positions (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); Real dy = 0.0; Real offset = 0.0; diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc index c3529de747..612f661d3b 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -138,7 +138,7 @@ Tuplet_engraver::process_music () if (stopped_tuplets_[i].full_length_) { Item *col - = unsmob_item (stopped_tuplets_[i].full_length_note_ + = Item::unsmob (stopped_tuplets_[i].full_length_note_ ? get_property ("currentMusicalColumn") : get_property ("currentCommandColumn")); @@ -263,7 +263,7 @@ Tuplet_engraver::finalize () if (to_boolean (get_property ("tupletFullLength"))) for (vsize i = 0; i < last_tuplets_.size (); i++) { - Item *col = unsmob_item (get_property ("currentCommandColumn")); + Item *col = Item::unsmob (get_property ("currentCommandColumn")); last_tuplets_[i]->set_bound (RIGHT, col); } } diff --git a/lily/tuplet-iterator.cc b/lily/tuplet-iterator.cc index 56973e8f2d..e04a0e9de8 100644 --- a/lily/tuplet-iterator.cc +++ b/lily/tuplet-iterator.cc @@ -68,7 +68,7 @@ Tuplet_iterator::create_event (Direction d) Music *mus = get_music (); - Music *ev = unsmob_music (ev_scm); + Music *ev = Music::unsmob (ev_scm); ev->set_spot (*mus->origin ()); if (d == START) { diff --git a/lily/tuplet-number.cc b/lily/tuplet-number.cc index e208df15f2..039dfaf530 100644 --- a/lily/tuplet-number.cc +++ b/lily/tuplet-number.cc @@ -109,7 +109,7 @@ Drul_array Tuplet_number::adjacent_note_columns (Grob *me_grob, Grob *ref_stem) { Spanner *me = dynamic_cast (me_grob); - Spanner *tuplet = unsmob_spanner (me->get_object ("bracket")); + Spanner *tuplet = Spanner::unsmob (me->get_object ("bracket")); extract_grob_set (tuplet, "note-columns", columns); Grob *ref_col = ref_stem->get_parent (X_AXIS); // X-parent of Stem = NoteColumn @@ -156,7 +156,7 @@ bool Tuplet_number::knee_position_against_beam (Grob *me_grob, Grob *ref_stem) { Spanner *me = dynamic_cast (me_grob); - Spanner *tuplet = unsmob_spanner (me->get_object ("bracket")); + Spanner *tuplet = Spanner::unsmob (me->get_object ("bracket")); bool bracket_visible = to_boolean (me->get_property ("bracket-visibility")) || !tuplet->extent (tuplet, Y_AXIS).is_empty (); @@ -213,8 +213,8 @@ MAKE_SCHEME_CALLBACK (Tuplet_number, print, 1); SCM Tuplet_number::print (SCM smob) { - Spanner *me = unsmob_spanner (smob); - Spanner *tuplet = unsmob_spanner (me->get_object ("bracket")); + Spanner *me = Spanner::unsmob (smob); + Spanner *tuplet = Spanner::unsmob (me->get_object ("bracket")); if (!tuplet || !tuplet->is_live ()) { @@ -257,13 +257,13 @@ MAKE_SCHEME_CALLBACK (Tuplet_number, calc_x_offset, 1); SCM Tuplet_number::calc_x_offset (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); Item *left_bound = me->get_bound (LEFT); Item *right_bound = me->get_bound (RIGHT); Drul_array bounds (left_bound, right_bound); - Spanner *tuplet = unsmob_spanner (me->get_object ("bracket")); + Spanner *tuplet = Spanner::unsmob (me->get_object ("bracket")); Grob *commonx = Tuplet_bracket::get_common_x (tuplet); commonx = commonx->common_refpoint (me, X_AXIS); @@ -347,8 +347,8 @@ MAKE_SCHEME_CALLBACK (Tuplet_number, calc_y_offset, 1); SCM Tuplet_number::calc_y_offset (SCM smob) { - Spanner *me = unsmob_spanner (smob); - Spanner *tuplet = unsmob_spanner (me->get_object ("bracket")); + Spanner *me = Spanner::unsmob (smob); + Spanner *tuplet = Spanner::unsmob (me->get_object ("bracket")); Drul_array positions = robust_scm2drul (tuplet->get_property ("positions"), Drul_array (0.0, 0.0)); SCM to_bracket = scm_from_double ((positions[LEFT] + positions[RIGHT]) / 2.0); diff --git a/lily/unfolded-repeat-iterator.cc b/lily/unfolded-repeat-iterator.cc index f29be92f12..7163027ede 100644 --- a/lily/unfolded-repeat-iterator.cc +++ b/lily/unfolded-repeat-iterator.cc @@ -42,7 +42,7 @@ Unfolded_repeat_iterator::get_music_list () const for (int i = 0; i < rep_count; i++) { - if (unsmob_music (body)) + if (Music::unsmob (body)) *tail = scm_cons (body, SCM_EOL); tail = SCM_CDRLOC (*tail); diff --git a/lily/volta-bracket.cc b/lily/volta-bracket.cc index d7931b5ae2..d6927b6c12 100644 --- a/lily/volta-bracket.cc +++ b/lily/volta-bracket.cc @@ -46,7 +46,7 @@ MAKE_SCHEME_CALLBACK (Volta_bracket_interface, print, 1); SCM Volta_bracket_interface::print (SCM smob) { - Spanner *me = unsmob_spanner (smob); + Spanner *me = Spanner::unsmob (smob); Spanner *orig_span = dynamic_cast (me->original ()); bool broken_first_bracket = orig_span && (orig_span->broken_intos_[0] == (Spanner *)me); -- 2.39.2