From 1036b837e5c947284f1b64029b912793edab3dad Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 15 Feb 2003 21:28:07 +0000 Subject: [PATCH] string() -> to_string() --- ChangeLog | 2 + flower/file-path.cc | 14 +++--- flower/getopt-long.cc | 10 ++-- flower/include/file-path.hh | 4 +- flower/include/getopt-long.hh | 2 +- flower/include/interval.hh | 2 +- flower/include/interval.tcc | 2 +- flower/include/offset.hh | 2 +- flower/include/rational.hh | 2 +- flower/interval.cc | 4 +- flower/offset.cc | 6 +-- flower/rational.cc | 7 +-- flower/string-convert.cc | 2 +- lily/all-font-metrics.cc | 2 +- lily/bar-check-iterator.cc | 2 +- lily/chord.cc | 4 +- lily/duration.cc | 12 ++--- lily/event.cc | 2 +- lily/global-translator.cc | 2 +- lily/includable-lexer.cc | 2 +- lily/include/afm.hh | 2 +- lily/include/duration.hh | 2 +- lily/include/lilypond-input-version.hh | 2 +- lily/include/midi-item.hh | 26 +++++----- lily/include/moment.hh | 2 +- lily/include/pitch.hh | 2 +- lily/include/tfm.hh | 6 +-- lily/input-file-results.cc | 4 +- lily/lexer.ll | 2 +- lily/lily-guile.cc | 2 +- lily/lilypond-version.cc | 4 +- lily/main.cc | 14 +++--- lily/midi-item.cc | 64 ++++++++++++------------- lily/midi-stream.cc | 2 +- lily/molecule.cc | 2 +- lily/moment.cc | 10 ++-- lily/music-output-def.cc | 2 +- lily/note-collision.cc | 9 ++-- lily/note-name-engraver.cc | 2 +- lily/paper-def.cc | 2 +- lily/performance.cc | 4 +- lily/pitch.cc | 8 ++-- lily/spaceable-grob.cc | 8 ++-- lily/spacing-spanner.cc | 4 +- lily/span-bar-engraver.cc | 4 +- lily/staff-symbol.cc | 7 ++- lily/system.cc | 14 +++--- lily/template5.cc | 2 +- lily/tfm.cc | 8 ++-- scm/chord-name.scm | 66 ++++++++++---------------- scm/midi.scm | 3 +- 51 files changed, 179 insertions(+), 195 deletions(-) diff --git a/ChangeLog b/ChangeLog index fdacb804fe..023168325a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2003-02-15 Han-Wen Nienhuys + * lily/include/*.hh: string() -> to_string() + * scm/chords-ignatzek.scm: new file. * ly/chord-modifiers-init.ly (ignatzekExceptionMusic): define diff --git a/flower/file-path.cc b/flower/file-path.cc index cf9ad32f96..14babc23ec 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -72,16 +72,16 @@ dos_to_posix_list (String path) /* Join components to full path. */ String -Path::string () const +Path::to_string () const { String s; if (!root.empty_b ()) - s = root + to_string (ROOTSEP); + s = root + ::to_string (ROOTSEP); if (!dir.empty_b ()) - s += dir + to_string (DIRSEP); + s += dir + ::to_string (DIRSEP); s += base; if (!ext.empty_b ()) - s += to_string (EXTSEP) + ext; + s += ::to_string (EXTSEP) + ext; return s; } @@ -164,10 +164,10 @@ File_path::find (String nm) const for (int i=0; i < size (); i++) { String path = elem (i); - String sep = to_string (DIRSEP); + String sep = ::to_string (DIRSEP); String right (path.right_string (1)); if (path.length () && right != sep) - path += to_string (DIRSEP); + path += ::to_string (DIRSEP); path += nm; @@ -232,7 +232,7 @@ File_path::add (String s) } String -File_path::string () const +File_path::to_string () const { String s; for (int i=0; i< size (); i++) diff --git a/flower/getopt-long.cc b/flower/getopt-long.cc index 59cb97161a..e3da98695f 100644 --- a/flower/getopt-long.cc +++ b/flower/getopt-long.cc @@ -92,7 +92,7 @@ Getopt_long::parselong () } String -Long_option_init::string () const +Long_option_init::to_string () const { String str; if (shortname_char_) @@ -109,7 +109,7 @@ Long_option_init::str_for_help () const { String s; if (shortname_char_) - s = "-" + to_string (shortname_char_); + s = "-" + ::to_string (shortname_char_); else s = " "; @@ -144,11 +144,11 @@ Getopt_long::report (Errorcod c) { case E_ARGEXPECT: str += _f ("option `%s' requires an argument", - found_option_->string ()); + found_option_->to_string ()); break; case E_NOARGEXPECT: str += _f ("option `%s' doesn't allow an argument", - found_option_->string ()); + found_option_->to_string ()); break; case E_UNKNOWNOPTION: str += _f ("unrecognized option: `%s'", @@ -159,7 +159,7 @@ Getopt_long::report (Errorcod c) break; case E_ILLEGALARG: str += _f ("invalid argument `%s' to option `%s'", - optional_argument_str0_, found_option_->string ()); + optional_argument_str0_, found_option_->to_string ()); break; default: assert (false); diff --git a/flower/include/file-path.hh b/flower/include/file-path.hh index 2055d08f01..b5c93d6fff 100644 --- a/flower/include/file-path.hh +++ b/flower/include/file-path.hh @@ -30,7 +30,7 @@ public: String base; String ext; - String string () const; + String to_string () const; }; class File_path : private Array @@ -40,7 +40,7 @@ public: Array::push; void prepend (String str) { Array::insert (str, 0); } - String string ()const; + String to_string ()const; bool try_add (String str); void add (String); void parse_path (String); diff --git a/flower/include/getopt-long.hh b/flower/include/getopt-long.hh index 35720d8a68..a909326d4c 100644 --- a/flower/include/getopt-long.hh +++ b/flower/include/getopt-long.hh @@ -14,7 +14,7 @@ struct Long_option_init { char const * help_str0_; - String string () const; + String to_string () const; String str_for_help () const; // NO constructor! diff --git a/flower/include/interval.hh b/flower/include/interval.hh index d5158f415e..cbee57fbc9 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -86,7 +86,7 @@ struct Interval_t : public Drul_array { Real linear_combination (Real x) const { return ((1.0 - x) * Real (elem (LEFT)) + (x + 1.0) * Real (elem (RIGHT))) * 0.5; } - String string () const; + String to_string () const; bool elem_b (T r); void negate () { diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index ad531418d3..9a94f154b8 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -127,7 +127,7 @@ intersect (Interval_t x, Interval_t const &y) template String -Interval_t::string () const +Interval_t::to_string () const { if (empty_b ()) return "[empty]"; diff --git a/flower/include/offset.hh b/flower/include/offset.hh index cc22f84da6..a69acb02ce 100644 --- a/flower/include/offset.hh +++ b/flower/include/offset.hh @@ -74,7 +74,7 @@ public: 0.0; } - String string () const; + String to_string () const; void mirror (Axis); Real arg () const; diff --git a/flower/include/rational.hh b/flower/include/rational.hh index 427eab9bf6..8ac788f886 100644 --- a/flower/include/rational.hh +++ b/flower/include/rational.hh @@ -70,7 +70,7 @@ public: Rational &operator %= (Rational); static int compare (Rational const&, Rational const&); int sign () const; - String string () const; + String to_string () const; }; IMPLEMENT_ARITHMETIC_OPERATOR (Rational, / ); diff --git a/flower/interval.cc b/flower/interval.cc index e3873147fc..97dd9c323d 100644 --- a/flower/interval.cc +++ b/flower/interval.cc @@ -20,7 +20,7 @@ Interval_t::infinity () String Interval_t::T_to_string (Real r) { - return to_string (r); + return ::to_string (r); } @@ -33,7 +33,7 @@ Interval_t::infinity () String Interval_t::T_to_string (int i) { - return to_string (i); + return ::to_string (i); } template INTERVAL__INSTANTIATE (int); diff --git a/flower/offset.cc b/flower/offset.cc index 92d2937b0a..e9a6d7394a 100644 --- a/flower/offset.cc +++ b/flower/offset.cc @@ -15,11 +15,11 @@ #ifndef STANDALONE String -Offset::string () const +Offset::to_string () const { String s; - s = String (" (") + to_string (coordinate_a_[X_AXIS]) + ", " - + to_string (coordinate_a_[Y_AXIS]) + ")"; + s = String (" (") + ::to_string (coordinate_a_[X_AXIS]) + ", " + + ::to_string (coordinate_a_[Y_AXIS]) + ")"; return s; } #endif diff --git a/flower/rational.cc b/flower/rational.cc index 4719582cb7..0b0e3d524f 100644 --- a/flower/rational.cc +++ b/flower/rational.cc @@ -277,16 +277,17 @@ Rational::operator -= (Rational r) } String -Rational::string () const +Rational::to_string () const { if (infty_b ()) { String s (sign_ > 0 ? "" : "-" ); return String (s + "infinity"); } - String s = to_string (num ()); + + String s = ::to_string (num ()); if (den () != 1 && num ()) - s += "/" + to_string (den ()); + s += "/" + ::to_string (den ()); return s; } diff --git a/flower/string-convert.cc b/flower/string-convert.cc index 6981551d30..74b6c23277 100644 --- a/flower/string-convert.cc +++ b/flower/string-convert.cc @@ -268,7 +268,7 @@ String_convert::char_string (char c, int n) String String_convert::rational_string (Rational r) { - return r.string (); + return r.to_string (); } String diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 28b687c9ea..f0c377c034 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -182,7 +182,7 @@ All_font_metrics::find_font (String name) return f; error (_f ("can't find default font: `%s'", def_name.to_str0 ())); - error (_f ("(search path: `%s')", search_path_.string ())); + error (_f ("(search path: `%s')", search_path_.to_string ())); error (_ ("Giving up")); return 0; diff --git a/lily/bar-check-iterator.cc b/lily/bar-check-iterator.cc index f7513b9f6d..c95c064a45 100644 --- a/lily/bar-check-iterator.cc +++ b/lily/bar-check-iterator.cc @@ -49,7 +49,7 @@ Bar_check_iterator::process (Moment m) if (where->main_part_) { get_music ()->origin ()->warning (_f ("barcheck failed at: %s", - where->string ())); + where->to_string ())); if (to_boolean (sync)) { tr = tr->where_defined (ly_symbol2scm("measurePosition")); diff --git a/lily/chord.cc b/lily/chord.cc index 9248bad895..169b155713 100644 --- a/lily/chord.cc +++ b/lily/chord.cc @@ -314,7 +314,7 @@ Chord::tonic_add_sub_to_pitches (SCM tonic, SCM add, SCM sub) for (SCM i = sub; gh_pair_p (i); i = ly_cdr (i)) warning (_f ("invalid subtraction: not part of chord: %s", - unsmob_pitch (ly_car (i))->string ())); + unsmob_pitch (ly_car (i))->to_string ())); return pitches; } @@ -343,7 +343,7 @@ Chord::get_chord (SCM tonic, SCM add, SCM sub, SCM inversion, SCM bass, SCM dur) } else warning (_f ("invalid inversion pitch: not part of chord: %s", - unsmob_pitch (inversion)->string ())); + unsmob_pitch (inversion)->to_string ())); } /* Bass is easy, just add if requested */ diff --git a/lily/duration.cc b/lily/duration.cc index 87c6dcfd0c..3847353d26 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -69,19 +69,19 @@ Duration::get_length () const String -Duration::string () const +Duration::to_string () const { String s; if (durlog_ < 0 ) - s = "log = " + to_string (durlog_); + s = "log = " + ::to_string (durlog_); else - s = to_string (1 << durlog_); + s = ::to_string (1 << durlog_); - s += to_string ('.', dots_); + s += ::to_string ('.', dots_); if (factor_ != Moment (Rational (1,1))) { - s += "*" + factor_.string (); + s += "*" + factor_.to_string (); } return s; } @@ -102,7 +102,7 @@ Duration::print_smob (SCM s, SCM port, scm_print_state *) Duration *r = (Duration *) ly_cdr (s); scm_puts ("#string ().to_str0 ()), port); + scm_display (scm_makfrom0str (r->to_string ().to_str0 ()), port); scm_puts (" >", port); return 1; diff --git a/lily/event.cc b/lily/event.cc index 199c85eb45..944aa5417f 100644 --- a/lily/event.cc +++ b/lily/event.cc @@ -42,7 +42,7 @@ Event::transpose (Pitch delta) if (abs (np.get_alteration ()) > 2) { warning (_f ("Transposition by %s makes alteration larger than two", - delta.string ())); + delta.to_string ())); } set_mus_property ("pitch", np.smobbed_copy ()); diff --git a/lily/global-translator.cc b/lily/global-translator.cc index f43c5486c0..ce30c74db6 100644 --- a/lily/global-translator.cc +++ b/lily/global-translator.cc @@ -100,7 +100,7 @@ Global_translator::run_iterator_on_me (Music_iterator * iter) w = sneaky_insert_extra_moment (w); - // printf ("proccing %s\n ", w.string ().to_str0 ()); + // printf ("proccing %s\n ", w.to_string ().to_str0 ()); if (first) { first = false; diff --git a/lily/includable-lexer.cc b/lily/includable-lexer.cc index e2bd367808..6d5207a084 100644 --- a/lily/includable-lexer.cc +++ b/lily/includable-lexer.cc @@ -48,7 +48,7 @@ Includable_lexer::new_input (String s, Sources * global_sources) { String msg = _f ("can't find file: `%s'", s); msg += "\n"; - msg += _f ("(search path: `%s')", global_sources->path_C_->string ().to_str0 ()); + msg += _f ("(search path: `%s')", global_sources->path_C_->to_string ().to_str0 ()); msg += "\n"; LexerError (msg.to_str0 ()); diff --git a/lily/include/afm.hh b/lily/include/afm.hh index e60686d837..a82eaeffcf 100644 --- a/lily/include/afm.hh +++ b/lily/include/afm.hh @@ -27,7 +27,7 @@ struct Adobe_font_metric : Font_metric AFM_CharMetricInfo const *find_char_metric (String name, bool warn=true) const; AFM_CharMetricInfo const *find_ascii_metric (int, bool warn=true) const; - String string () const; + String to_string () const; ~Adobe_font_metric (); static SCM make_afm (AFM_Font_info*, unsigned); diff --git a/lily/include/duration.hh b/lily/include/duration.hh index c6c194d226..771f5a99eb 100644 --- a/lily/include/duration.hh +++ b/lily/include/duration.hh @@ -22,7 +22,7 @@ public: Duration (); Duration (int, int); - String string () const; + String to_string () const; Duration compressed (Rational) const; Rational get_length () const ; diff --git a/lily/include/lilypond-input-version.hh b/lily/include/lilypond-input-version.hh index aaa23d6871..000e74d541 100644 --- a/lily/include/lilypond-input-version.hh +++ b/lily/include/lilypond-input-version.hh @@ -17,7 +17,7 @@ struct Lilypond_version Lilypond_version (int major, int minor, int patch); Lilypond_version (String str); - String string () const; + String to_string () const; operator int () const; int major_; diff --git a/lily/include/midi-item.hh b/lily/include/midi-item.hh index 0e52ccf004..0fbe2eb217 100644 --- a/lily/include/midi-item.hh +++ b/lily/include/midi-item.hh @@ -29,7 +29,7 @@ public: static String i2varint_string (int i); - virtual String string () const = 0; + virtual String to_string () const = 0; int channel_; }; @@ -44,7 +44,7 @@ public: Moment delta_mom_; Midi_item* midi_; - String string () const; + String to_string () const; }; /** @@ -54,7 +54,7 @@ class Midi_chunk : public Midi_item { public: void set (String header_string, String data_string, String footer_string); - virtual String string () const; + virtual String to_string () const; virtual String data_string () const; private: @@ -68,7 +68,7 @@ class Midi_duration : public Midi_item public: Midi_duration (Real seconds_f); - virtual String string () const; + virtual String to_string () const; Real seconds_; }; @@ -86,7 +86,7 @@ class Midi_instrument : public Midi_item public: Midi_instrument (Audio_instrument*); - virtual String string () const; + virtual String to_string () const; Audio_instrument* audio_; }; @@ -97,7 +97,7 @@ class Midi_key : public Midi_item public: Midi_key (Audio_key*); - virtual String string () const; + virtual String to_string () const; Audio_key* audio_; }; @@ -107,7 +107,7 @@ class Midi_time_signature : public Midi_item public: Midi_time_signature (Audio_time_signature*); - virtual String string () const; + virtual String to_string () const; Audio_time_signature* audio_; int clocks_per_1_; @@ -123,7 +123,7 @@ public: Moment get_length () const; int get_pitch () const; - virtual String string () const; + virtual String to_string () const; Audio_note* audio_; @@ -139,7 +139,7 @@ class Midi_note_off : public Midi_note public: Midi_note_off (Midi_note*); - virtual String string () const; + virtual String to_string () const; Midi_note* on_; Byte aftertouch_byte_; @@ -155,7 +155,7 @@ public: Midi_text (Audio_text*); - virtual String string () const; + virtual String to_string () const; Audio_text* audio_; }; @@ -165,7 +165,7 @@ class Midi_dynamic : public Midi_item public: Midi_dynamic (Audio_dynamic*); - virtual String string () const; + virtual String to_string () const; Audio_dynamic* audio_; }; @@ -175,7 +175,7 @@ class Midi_piano_pedal : public Midi_item public: Midi_piano_pedal (Audio_piano_pedal*); - virtual String string () const; + virtual String to_string () const; Audio_piano_pedal* audio_; }; @@ -185,7 +185,7 @@ class Midi_tempo : public Midi_item public: Midi_tempo (Audio_tempo*); - virtual String string () const; + virtual String to_string () const; Audio_tempo* audio_; }; diff --git a/lily/include/moment.hh b/lily/include/moment.hh index 65f42149d3..5d876f7b11 100644 --- a/lily/include/moment.hh +++ b/lily/include/moment.hh @@ -47,7 +47,7 @@ public: Deliver a copy of THIS as a smobified SCM */ SCM smobbed_copy () const; - String string () const; + String to_string () const; static int compare (Moment const&, Moment const&); }; diff --git a/lily/include/pitch.hh b/lily/include/pitch.hh index a3c63fb25b..ff03ec2826 100644 --- a/lily/include/pitch.hh +++ b/lily/include/pitch.hh @@ -66,7 +66,7 @@ public: int steps () const; /// return pitch from central c (in halfnotes) int semitone_pitch () const; - String string () const; + String to_string () const; SCM smobbed_copy () const; DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b)); diff --git a/lily/include/tfm.hh b/lily/include/tfm.hh index 53cfa1c140..24e2d85b2c 100644 --- a/lily/include/tfm.hh +++ b/lily/include/tfm.hh @@ -138,7 +138,7 @@ struct Tex_font_char_metric Array kerns_; Array ligatures_; - String string () const; + String to_string () const; Tex_font_char_metric (); Box dimensions () const; @@ -154,9 +154,7 @@ public: virtual Box get_char (int) const; Tex_font_char_metric const *find_ascii (int ascii, bool warn=true) const; - String string () const; - - + String to_string () const; Tfm_info info_; Tfm_header header_; diff --git a/lily/input-file-results.cc b/lily/input-file-results.cc index 281c345ee7..37e0a3a639 100644 --- a/lily/input-file-results.cc +++ b/lily/input-file-results.cc @@ -109,7 +109,7 @@ Input_file_results::do_deps () { Path p = split_path (output_name_global); p.ext = "dep"; - write_dependency_file (p.string (), + write_dependency_file (p.to_string (), target_strings_, inclusion_names_); } @@ -189,7 +189,7 @@ do_one_file (String init_string, String file_string) if (init_string.length () && global_path.find (init_string).empty_b ()) { warning (_f ("can't find file: `%s'", init_string)); - warning (_f ("(search path: `%s')", global_path.string ().to_str0 ())); + warning (_f ("(search path: `%s')", global_path.to_string ().to_str0 ())); return; } if ((file_string != "-") && global_path.find (file_string).empty_b ()) diff --git a/lily/lexer.ll b/lily/lexer.ll index c3f469a6b8..01e4eeb665 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -731,7 +731,7 @@ valid_version_b (String s) Lilypond_version ver (s); if (! ((ver >= oldest_version) && (ver <= current))) { - non_fatal_error (_f ("Incorrect lilypond version: %s (%s, %s)", ver.string (), oldest_version.string (), current.string ())); + non_fatal_error (_f ("Incorrect lilypond version: %s (%s, %s)", ver.to_string (), oldest_version.to_string (), current.to_string ())); non_fatal_error (_ ("Consider updating the input with the convert-ly script")); return false; } diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index c49923bbf9..cab31a2124 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -85,7 +85,7 @@ gulp_file_to_string (String fn) { String e = _f ("can't find file: `%s'", fn); e += " "; - e += _f ("(load path: `%s')", global_path.string ()); + e += _f ("(load path: `%s')", global_path.to_string ()); error (e); } else if (verbose_global_b) diff --git a/lily/lilypond-version.cc b/lily/lilypond-version.cc index 309420e660..ca293c9a78 100644 --- a/lily/lilypond-version.cc +++ b/lily/lilypond-version.cc @@ -34,9 +34,9 @@ Lilypond_version::Lilypond_version (String str) } String -Lilypond_version::string () const +Lilypond_version::to_string () const { - return to_string (major_) + "." + to_string (minor_) + "." + to_string (patch_); + return ::to_string (major_) + "." + ::to_string (minor_) + "." + ::to_string (patch_); } Lilypond_version::operator int () const diff --git a/lily/main.cc b/lily/main.cc index b104b89991..e8952d2908 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -286,11 +286,11 @@ distill_inname (String str) if (*extensions[i] && !p.ext.empty_b ()) p.ext += "."; p.ext += extensions[i]; - if (!global_path.find (p.string ()).empty_b ()) + if (!global_path.find (p.to_string ()).empty_b ()) break; } /* Reshuffle extension */ - p = split_path (p.string ()); + p = split_path (p.to_string ()); } return p; } @@ -335,7 +335,7 @@ main_prog (void *, int, char **) progress_indication ("\n"); - all_fonts_global = new All_font_metrics (global_path.string ()); + all_fonts_global = new All_font_metrics (global_path.to_string ()); init_scheme_code_string += ")"; gh_eval_str ((char *)init_scheme_code_string.to_str0 ()); @@ -363,7 +363,7 @@ main_prog (void *, int, char **) /* By default, use base name of input file for output file name */ Path outpath = inpath; - if (inpath.string () != "-") + if (inpath.to_string () != "-") outpath.ext = format_to_ext (output_format_global); /* By default, write output to cwd; do not copy directory part @@ -382,8 +382,8 @@ main_prog (void *, int, char **) /* Burp: output name communication goes through _global */ String save_output_name_global = output_name_global; - output_name_global = outpath.string (); - do_one_file (init, inpath.string ()); + output_name_global = outpath.to_string (); + do_one_file (init, inpath.to_string ()); output_name_global = save_output_name_global; p++; @@ -441,7 +441,7 @@ main (int argc, char **argv) Path p = split_path (s); if (s != "-" && p.ext.empty_b ()) p.ext = format_to_ext (output_format_global); - output_name_global = p.string (); + output_name_global = p.to_string (); } break; case 'e': diff --git a/lily/midi-item.cc b/lily/midi-item.cc index 1dbb35768e..1f7cbea2d6 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -61,7 +61,7 @@ Midi_chunk::data_string () const } String -Midi_chunk::string () const +Midi_chunk::to_string () const { String str = header_string_; String dat = data_string (); @@ -80,9 +80,9 @@ Midi_duration::Midi_duration (Real seconds_f) } String -Midi_duration::string () const +Midi_duration::to_string () const { - return String (""; + return String (""; } Midi_event::Midi_event (Moment delta_mom, Midi_item* midi) @@ -95,14 +95,14 @@ Midi_event::Midi_event (Moment delta_mom, Midi_item* midi) ugh. midi output badly broken since grace note hackage. */ String -Midi_event::string () const +Midi_event::to_string () const { Rational rat_dt = (delta_mom_.main_part_ * Rational (384) + delta_mom_.grace_part_ * Rational (100))*Rational (4); int delta_i = int (rat_dt); String delta_string = Midi_item::i2varint_string (delta_i); - String midi_string = midi_->string (); + String midi_string = midi_->to_string (); assert (midi_string.length ()); return delta_string + midi_string; } @@ -131,7 +131,7 @@ Midi_instrument::Midi_instrument (Audio_instrument* a) } String -Midi_instrument::string () const +Midi_instrument::to_string () const { Byte program_byte = 0; bool found = false; @@ -147,8 +147,8 @@ Midi_instrument::string () const else warning (_f ("no such instrument: `%s'", audio_->str_.to_str0 ())); - String str = to_string ((char) (0xc0 + channel_)); //YIKES! FIXME: Should be track. -rz - str += to_string ((char)program_byte); + String str = ::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME: Should be track. -rz + str += ::to_string ((char)program_byte); return str; } @@ -175,7 +175,7 @@ Midi_item::i2varint_string (int i) String str; while (1) { - str += to_string ((char)buffer_i); + str += ::to_string ((char)buffer_i); if (buffer_i & 0x80) buffer_i >>= 8; else @@ -190,7 +190,7 @@ Midi_key::Midi_key (Audio_key*a) } String -Midi_key::string () const +Midi_key::to_string () const { String str = "ff5902"; str += String_convert::int2hex (audio_->accidentals_, 2, '0'); @@ -208,7 +208,7 @@ Midi_time_signature::Midi_time_signature (Audio_time_signature* a) } String -Midi_time_signature::string () const +Midi_time_signature::to_string () const { int num = audio_->beats_; int den = audio_->one_beat_; @@ -255,14 +255,14 @@ Midi_note::get_pitch () const } String -Midi_note::string () const +Midi_note::to_string () const { Byte status_byte = (char) (0x90 + channel_); - String str = to_string ((char)status_byte); - str += to_string ((char) (get_pitch () + c0_pitch_i_)); + String str = ::to_string ((char)status_byte); + str += ::to_string ((char) (get_pitch () + c0_pitch_i_)); - str += to_string ((char)dynamic_byte_); + str += ::to_string ((char)dynamic_byte_); return str; } @@ -280,13 +280,13 @@ Midi_note_off::Midi_note_off (Midi_note* n) } String -Midi_note_off::string () const +Midi_note_off::to_string () const { Byte status_byte = (char) (0x80 + channel_); - String str = to_string ((char)status_byte); - str += to_string ((char) (get_pitch () + Midi_note::c0_pitch_i_)); - str += to_string ((char)aftertouch_byte_); + String str = ::to_string ((char)status_byte); + str += ::to_string ((char) (get_pitch () + Midi_note::c0_pitch_i_)); + str += ::to_string ((char)aftertouch_byte_); return str; } @@ -296,10 +296,10 @@ Midi_dynamic::Midi_dynamic (Audio_dynamic* a) } String -Midi_dynamic::string () const +Midi_dynamic::to_string () const { Byte status_byte = (char) (0xB0 + channel_); - String str = to_string ((char)status_byte); + String str = ::to_string ((char)status_byte); /* Main volume controller (per channel): @@ -314,8 +314,8 @@ Midi_dynamic::string () const if (volume > full_scale) volume = (int)full_scale; - str += to_string ((char)0x07); - str += to_string ((char)volume); + str += ::to_string ((char)0x07); + str += ::to_string ((char)volume); return str; } @@ -325,20 +325,20 @@ Midi_piano_pedal::Midi_piano_pedal (Audio_piano_pedal* a) } String -Midi_piano_pedal::string () const +Midi_piano_pedal::to_string () const { Byte status_byte = (char) (0xB0 + channel_); - String str = to_string ((char)status_byte); + String str = ::to_string ((char)status_byte); if (audio_->type_string_ == "Sostenuto") - str += to_string ((char)0x42); + str += ::to_string ((char)0x42); else if (audio_->type_string_ == "Sustain") - str += to_string ((char)0x40); + str += ::to_string ((char)0x40); else if (audio_->type_string_ == "UnaCorda") - str += to_string ((char)0x43); + str += ::to_string ((char)0x43); int pedal = ((1 - audio_->dir_) / 2) * 0x7f; - str += to_string ((char)pedal); + str += ::to_string ((char)pedal); return str; } @@ -348,7 +348,7 @@ Midi_tempo::Midi_tempo (Audio_tempo* a) } String -Midi_tempo::string () const +Midi_tempo::to_string () const { int useconds_per_4_i = 60 * (int)1e6 / audio_->per_minute_4_; String str = "ff5103"; @@ -362,7 +362,7 @@ Midi_text::Midi_text (Audio_text* a) } String -Midi_text::string () const +Midi_text::to_string () const { String str = "ff" + String_convert::int2hex (audio_->type_, 2, '0'); str = String_convert::hex2bin (str); @@ -427,7 +427,7 @@ Midi_track::data_string () const str += "\n"; for (Cons *i=event_p_list_.head_; i; i = i->next_) { - str += i->car_->string (); + str += i->car_->to_string (); if (midi_debug_global_b) str += "\n"; } diff --git a/lily/midi-stream.cc b/lily/midi-stream.cc index 1bd6b7ddb3..1013a5068a 100644 --- a/lily/midi-stream.cc +++ b/lily/midi-stream.cc @@ -43,7 +43,7 @@ Midi_stream::operator << (String str) Midi_stream& Midi_stream::operator << (Midi_item const& midi_c_r) { - String str = midi_c_r.string (); + String str = midi_c_r.to_string (); if (midi_debug_global_b) diff --git a/lily/molecule.cc b/lily/molecule.cc index 29af894151..af60d58ab4 100644 --- a/lily/molecule.cc +++ b/lily/molecule.cc @@ -176,7 +176,7 @@ Molecule::print_smob (SCM , SCM port, scm_print_state *) scm_puts ("#string ()); + String string (r->to_string ()); scm_puts ((char *)str.to_str0 (), port); #endif scm_puts (" >", port); diff --git a/lily/moment.cc b/lily/moment.cc index f8e32be86f..43c3e0bf18 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -37,7 +37,7 @@ Moment::print_smob (SCM s, SCM port, scm_print_state *) Moment *r = (Moment *) ly_cdr (s); scm_puts ("#string (); + String str = r->to_string (); scm_puts ((char *)str.to_str0 (), port); scm_puts (" >", port); @@ -215,12 +215,12 @@ Moment::set_infinite (int k) String -Moment::string () const +Moment::to_string () const { - String s = main_part_.string (); + String s = main_part_.to_string (); if (grace_part_) { - s += "G" + grace_part_.string (); + s += "G" + grace_part_.to_string (); } return s; } @@ -239,7 +239,7 @@ Moment::operator - () const std::ostream & operator << (std::ostream &os, Moment const &m) { - os << m.string (); + os << m.to_string (); return os; } #endif diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index 6dd6c09581..082270c0b6 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -143,7 +143,7 @@ Music_output_def::outname_string () { Path p = split_path (out); p.base += "-" + to_string (def); - out = p.string (); + out = p.to_string (); } return out; } diff --git a/lily/note-collision.cc b/lily/note-collision.cc index f252d029aa..989a9265a9 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -431,9 +431,8 @@ Note_collision_interface::add_column (Grob*me,Grob* ncol) ADD_INTERFACE (Note_collision_interface, "note-collision-interface", - "An object that handles collisions between notes with different stem -directions and horizontal shifts. Most of the interesting properties -are to be set in @ref{note-column-interface}: these are -@code{force-hshift} and @code{horizontal-shift}. -", + "An object that handles collisions between notes with different stem " +"directions and horizontal shifts. Most of the interesting properties " +"are to be set in @ref{note-column-interface}: these are " +"@code{force-hshift} and @code{horizontal-shift}. ", "merge-differently-dotted merge-differently-headed collision-done"); diff --git a/lily/note-name-engraver.cc b/lily/note-name-engraver.cc index 9644f93734..25031239a8 100644 --- a/lily/note-name-engraver.cc +++ b/lily/note-name-engraver.cc @@ -44,7 +44,7 @@ Note_name_engraver::process_acknowledged_grobs () { if (i) s += " "; - s += unsmob_pitch (reqs_[i]->get_mus_property ("pitch"))->string (); + s += unsmob_pitch (reqs_[i]->get_mus_property ("pitch"))->to_string (); } if (s.length ()) { diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 9eeab12ffc..e96afc33d1 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -100,7 +100,7 @@ Paper_def::get_paper_outputter () Paper_outputter * po = new Paper_outputter (outname); Path p = split_path (outname); p.ext = ""; - po->basename_ = p.string (); + po->basename_ = p.to_string (); return po; } diff --git a/lily/performance.cc b/lily/performance.cc index 257e901647..23be820ad0 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -157,13 +157,13 @@ Performance::process () { Path p = split_path (out); p.base += "-" + to_string (def); - out = p.string (); + out = p.to_string (); } /* Maybe a bit crude, but we had this before */ Path p = split_path (out); p.ext = "midi"; - out = p.string (); + out = p.to_string (); Midi_stream midi_stream (out); progress_indication (_f ("MIDI output to `%s'...", out)); diff --git a/lily/pitch.cc b/lily/pitch.cc index c3e2471c6c..895f18ef62 100644 --- a/lily/pitch.cc +++ b/lily/pitch.cc @@ -145,10 +145,10 @@ interval (Pitch const & from , Pitch const & to ) char const *accname[] = {"eses", "es", "", "is" , "isis"}; String -Pitch::string () const +Pitch::to_string () const { int n = (notename_ + 2) % 7; - String s = to_string (char (n + 'a')); + String s = ::to_string (char (n + 'a')); if (alteration_) s += String (accname[alteration_ + 2]); @@ -162,7 +162,7 @@ Pitch::string () const { int o = (-octave_) - 1; while (o--) - s += to_string (','); + s += ::to_string (','); } return s; @@ -248,7 +248,7 @@ Pitch::print_smob (SCM s, SCM port, scm_print_state *) Pitch *r = (Pitch *) ly_cdr (s); scm_puts ("#string ().to_str0 ()), port); + scm_display (scm_makfrom0str (r->to_string ().to_str0 ()), port); scm_puts (" >", port); return 1; diff --git a/lily/spaceable-grob.cc b/lily/spaceable-grob.cc index 435f91ebd8..96aa5f52bd 100644 --- a/lily/spaceable-grob.cc +++ b/lily/spaceable-grob.cc @@ -102,8 +102,8 @@ Spaceable_grob::remove_interface (Grob*me) ADD_INTERFACE (Spaceable_grob,"spaceable-grob-interface", - "A grob (a Paper_column) that takes part in the -spacing problem. ", - "measure-length spacing-wishes penalty minimum-distances ideal-distances -left-neighbors right-neighbors"); + "A grob (a Paper_column) that takes part in the \n" + "spacing problem. ", + "measure-length spacing-wishes penalty minimum-distances ideal-distances " +"left-neighbors right-neighbors"); diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 091dd1ce68..89cf829cfc 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -376,7 +376,7 @@ Spacing_spanner::set_springs (SCM smob) global_shortest = find_shortest (me, all); if (verbose_global_b) { - progress_indication (_f("Global shortest duration is %s\n", global_shortest.string ())); + progress_indication (_f("Global shortest duration is %s\n", global_shortest.to_string ())); } } prune_loose_colunms (me, &all, global_shortest); @@ -845,7 +845,7 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc, if (! shortest_playing_len.to_bool ()) { - programming_error ("can't find a ruling note at " + Paper_column::when_mom (lc).string ()); + programming_error ("can't find a ruling note at " + Paper_column::when_mom (lc).to_string ()); shortest_playing_len = 1; } diff --git a/lily/span-bar-engraver.cc b/lily/span-bar-engraver.cc index beaf99f6d4..342e8801cb 100644 --- a/lily/span-bar-engraver.cc +++ b/lily/span-bar-engraver.cc @@ -90,8 +90,8 @@ Span_bar_engraver::stop_translation_timestep () ENTER_DESCRIPTION(Span_bar_engraver, -/* descr */ "This engraver makes cross-staff barlines: It catches all normal -bar lines, and draws a single span-bar across them.", +/* descr */ "This engraver makes cross-staff barlines: It catches all normal " +"bar lines, and draws a single span-bar across them.", /* creats*/ "SpanBar", /* accepts */ "", /* acks */ "bar-line-interface", diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 503bd49a59..4d1f6e88ea 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -115,10 +115,9 @@ Staff_symbol::staff_space (Grob*me) ADD_INTERFACE (Staff_symbol,"staff-symbol-interface", - "This spanner draws the lines of a staff. The center (i.e. middle line -or space) is position 0. The length of the symbol may be set by hand -through the @code{width} property. -", + "This spanner draws the lines of a staff. The center (i.e. middle line " +"or space) is position 0. The length of the symbol may be set by hand " +"through the @code{width} property. ", "width staff-space thickness line-count"); diff --git a/lily/system.cc b/lily/system.cc index 1527ac9978..2d62e26df9 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -557,11 +557,11 @@ System::columns ()const ADD_INTERFACE (System,"system-interface", - "Super grob, parent of all: - -The columns of a score that form one line. The toplevel grob. Any -grob has a Line_of_score as both X and Y reference point. The -Paper_score contains one grob of this type. Control enters the -Grob dependency calculation from this single Line_of_score -object.", + "Super grob, parent of all: " +"\n\n" +"The columns of a score that form one line. The toplevel grob. Any " +"grob has a Line_of_score as both X and Y reference point. The " +"Paper_score contains one grob of this type. Control enters the " +"Grob dependency calculation from this single Line_of_score " +"object.", "between-system-string all-elements columns"); diff --git a/lily/template5.cc b/lily/template5.cc index 19e75a3874..33d9b32f18 100644 --- a/lily/template5.cc +++ b/lily/template5.cc @@ -24,7 +24,7 @@ Interval_t::infinity () String Interval_t::T_to_string (Rational a) { - return a.string (); + return a.to_string (); } diff --git a/lily/tfm.cc b/lily/tfm.cc index 2219b191ff..df8d2d0dbc 100644 --- a/lily/tfm.cc +++ b/lily/tfm.cc @@ -49,10 +49,10 @@ Tex_font_char_metric::Tex_font_char_metric () italic_correction_fix_ = 0; } -#define APPEND_CHAR_METRIC_ELT(k) outstr += to_string (#k) + " " + to_string (k ## _) + "; " +#define APPEND_CHAR_METRIC_ELT(k) outstr += ::to_string (#k) + " " + ::to_string (k ## _) + "; " String -Tex_font_char_metric::string () const +Tex_font_char_metric::to_string () const { String outstr ; @@ -109,11 +109,11 @@ Tex_font_metric::get_char (int a) const String -Tex_font_metric::string () const +Tex_font_metric::to_string () const { String outstr; for (int i=0; i < char_metrics_.size (); i++) - outstr += char_metrics_[i].string (); + outstr += char_metrics_[i].to_string (); return outstr; } diff --git a/scm/chord-name.scm b/scm/chord-name.scm index dc07f195ff..b576c9e8d2 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -113,7 +113,7 @@ dump reinterpret the markup as a molecule. (define (pitch->note-name pitch) (cons (cadr pitch) (caddr pitch))) -(define (accidental->markup acc) +(define (old-accidental->markup acc) "ACC is an int, return a markup making an accidental." (if (= acc 0) (make-line-markup (list empty-markup)) @@ -121,28 +121,12 @@ dump reinterpret the markup as a molecule. (string-append "accidentals-" (number->string acc)))))) -; unused. -(define (accidental->markupp acc pos) - - (if (= acc 0) - empty-markup - (let ((acc-markup (make-musicglyph-markup - (string-append "accidentals-" - (number->string acc))))) - - (if (equal? pos 'columns) - (make-line-markup (list (make-smaller-markup acc-markup))) - (if (equal? pos 'super) - (make-line-markup (list (make-super-markup acc-markup))) - ;; not 'super or 'columns must be 'sub... - (make-line-markup (list (make-sub-markup acc-markup)))))))) - ; unused. ;; FIXME: possibly to be used for american/jazz style ;; However, only pos == columns is used, which seems to do -;; exactly what accidental->markup does... +;; exactly what old-accidental->markup does... (define (amy-accidental->text acc) (accidental->textp acc 'columns)) @@ -161,7 +145,7 @@ dump reinterpret the markup as a molecule. (make-simple-markup (vector-ref #("C" "D" "E" "F" "G" "A" "B") (cadr pitch))) (make-normal-size-super-markup - (accidental->markup (caddr pitch)))))) + (old-accidental->markup (caddr pitch)))))) ;;; Hooks to override chord names and note names, ;;; see input/tricks/german-chords.ly @@ -199,7 +183,7 @@ dump reinterpret the markup as a molecule. (define (step->markup-previously-alternate-jazz pitch) (make-line-markup (list - (accidental->markup (caddr pitch)) + (old-accidental->markup (caddr pitch)) (make-simple-markup (number->string (+ (cadr pitch) (if (= (car pitch) 0) 1 8))))))) @@ -209,7 +193,7 @@ dump reinterpret the markup as a molecule. ;; sharp 7 only included for completeness? ((-2) (make-line-markup (list - (accidental->markup -1) + (old-accidental->markup -1) (make-simple-markup "7")))) ((-1) (make-simple-markup "7")) ((0) (make-simple-markup "maj7")) @@ -217,9 +201,9 @@ dump reinterpret the markup as a molecule. ;; (list (make-simple-markup "maj7")))) ((1) (make-line-markup (list - (accidental->markup 1) (make-simple-markup "7")))) + (old-accidental->markup 1) (make-simple-markup "7")))) ((2) (make-line-markup - (list (accidental->markup 1) + (list (old-accidental->markup 1) (make-simple-markup "7"))))) (step->markup-previously-alternate-jazz pitch))) @@ -512,11 +496,11 @@ dump reinterpret the markup as a molecule. (make-line-markup (list (case (caddr pitch) - ((-2) (accidental->markup -2)) - ((-1) (accidental->markup -1)) + ((-2) (old-accidental->markup -2)) + ((-1) (old-accidental->markup -1)) ((0) empty-markup) - ((1) (accidental->markup 1)) - ((2) (accidental->markup 2))) + ((1) (old-accidental->markup 1)) + ((2) (old-accidental->markup 2))) (make-simple-markup (number->string (+ (cadr pitch) (if (= (car pitch) 0) 1 8))))))) (define-public chord::exception-alist-american @@ -539,22 +523,22 @@ dump reinterpret the markup as a molecule. (define (step->markup-american pitch) (case (cadr pitch) ((6) (case (caddr pitch) - ((-2) (make-line-markup (list (accidental->markup -1) (make-simple-markup "7")))) + ((-2) (make-line-markup (list (old-accidental->markup -1) (make-simple-markup "7")))) ((-1) (make-simple-markup "7")) ((0) (make-simple-markup "maj7")) - ((1) (make-line-markup (list (accidental->markup 1) (make-simple-markup "7")))) - ((2) (make-line-markup (list (accidental->markup 2) (make-simple-markup "7")))))) + ((1) (make-line-markup (list (old-accidental->markup 1) (make-simple-markup "7")))) + ((2) (make-line-markup (list (old-accidental->markup 2) (make-simple-markup "7")))))) ((4) (case (caddr pitch) - ((-2) (make-line-markup (list (accidental->markup -2) (make-simple-markup "5")))) + ((-2) (make-line-markup (list (old-accidental->markup -2) (make-simple-markup "5")))) ;;choose your symbol for the diminished fifth ((-1) (make-simple-markup "-5")) - ;;((-1) (make-line-markup (list (accidental->markup -1) (make-simple-markup "5"))))) + ;;((-1) (make-line-markup (list (old-accidental->markup -1) (make-simple-markup "5"))))) ((0) empty-markup) ;;choose your symbol for the augmented fifth ;;((1) (make-simple-markup "aug")) - ;;((1) (make-line-markup (list (accidental->markup 1) (make-simple-markup "5"))))) + ;;((1) (make-line-markup (list (old-accidental->markup 1) (make-simple-markup "5"))))) ((1) (make-simple-markup "+5")) - ((2) (make-line-markup (list (accidental->markup 2) (make-simple-markup "5")))))) + ((2) (make-line-markup (list (old-accidental->markup 2) (make-simple-markup "5")))))) (else (if (and (= (car pitch) 0) (= (cadr pitch) 3) (= (caddr pitch) 0)) @@ -715,25 +699,25 @@ dump reinterpret the markup as a molecule. (define (step->markup-jazz pitch) (case (cadr pitch) ((6) (case (caddr pitch) - ((-2) (make-line-markup (list (accidental->markup -1) (make-simple-markup "7")))) + ((-2) (make-line-markup (list (old-accidental->markup -1) (make-simple-markup "7")))) ((-1) (make-simple-markup "7")) ;;Pick your favorite maj7 ((0) mathm-markup-object) ;;a white triangle ;;((0) mathn-markup-object) ;;a black triangle ;;((0) (make-simple-markup "maj7")) ;;good old maj7 - ((1) (make-line-markup (list (accidental->markup 1) (make-simple-markup "7")))) - ((2) (make-line-markup (list (accidental->markup 2) (make-simple-markup "7")))))) + ((1) (make-line-markup (list (old-accidental->markup 1) (make-simple-markup "7")))) + ((2) (make-line-markup (list (old-accidental->markup 2) (make-simple-markup "7")))))) ((4) (case (caddr pitch) - ((-2) (make-line-markup (list (accidental->markup -2) (make-simple-markup "5")))) + ((-2) (make-line-markup (list (old-accidental->markup -2) (make-simple-markup "5")))) ;;choose your symbol for the diminished fifth ;;((-1) (make-simple-markup "-5")) - ((-1) (make-line-markup (list (accidental->markup -1) (make-simple-markup "5")))) + ((-1) (make-line-markup (list (old-accidental->markup -1) (make-simple-markup "5")))) ((0) empty-markup) ;;choose your symbol for the augmented fifth ;;((1) (make-simple-markup "aug")) - ((1) (make-line-markup (list (accidental->markup 1) (make-simple-markup "5")))) + ((1) (make-line-markup (list (old-accidental->markup 1) (make-simple-markup "5")))) ;;((1) (make-simple-markup "+5")) - ((2) (make-line-markup (list (accidental->markup 2) (make-simple-markup "5")))))) + ((2) (make-line-markup (list (old-accidental->markup 2) (make-simple-markup "5")))))) (else (if (and (= (car pitch) 0) (= (cadr pitch) 3) (= (caddr pitch) 0)) diff --git a/scm/midi.scm b/scm/midi.scm index 79ffe5846a..7167df899c 100644 --- a/scm/midi.scm +++ b/scm/midi.scm @@ -291,4 +291,5 @@ Note: MIDI cannot handle other tonalities than major/minor. (begin (ly:warn "Attempt to determine tonality of transposed scale") #t) - (eq? (cdr (list-ref pitch-list 4)) (cdr (list-ref pitch-list 6))))) + (eq? (cdr (list-ref pitch-list 4)) (cdr (list-ref pitch-list 6)))) + ) -- 2.39.2