]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge remote branch 'origin/master' into release/unstable release/2.19.43-1
authorPhil Holmes <mail@philholmes.net>
Thu, 9 Jun 2016 11:06:07 +0000 (12:06 +0100)
committerPhil Holmes <mail@philholmes.net>
Thu, 9 Jun 2016 11:06:07 +0000 (12:06 +0100)
88 files changed:
lily/all-font-metrics.cc
lily/book-scheme.cc
lily/box.cc
lily/callback.cc [deleted file]
lily/context-def.cc
lily/context-mod.cc
lily/context-property.cc
lily/context.cc
lily/dispatcher.cc
lily/duration.cc
lily/font-metric.cc
lily/grob-array.cc
lily/grob-smob.cc
lily/include/all-font-metrics.hh
lily/include/book.hh
lily/include/box.hh
lily/include/callback.hh
lily/include/context-def.hh
lily/include/context-mod.hh
lily/include/context.hh
lily/include/dispatcher.hh
lily/include/duration.hh
lily/include/font-metric.hh
lily/include/grob-array.hh
lily/include/grob.hh
lily/include/input.hh
lily/include/lily-imports.hh
lily/include/lily-lexer.hh
lily/include/lily-parser.hh
lily/include/listener.hh
lily/include/moment.hh
lily/include/music-function.hh
lily/include/music-iterator.hh
lily/include/music-output.hh
lily/include/output-def.hh
lily/include/page-marker.hh
lily/include/paper-book.hh
lily/include/paper-outputter.hh
lily/include/pitch.hh
lily/include/prob.hh
lily/include/scale.hh
lily/include/scm-hash.hh
lily/include/score.hh
lily/include/skyline-pair.hh
lily/include/skyline.hh
lily/include/smobs.hh
lily/include/smobs.tcc
lily/include/source-file.hh
lily/include/spring.hh
lily/include/stencil.hh
lily/include/translator-dispatch-list.hh
lily/include/translator-group.hh
lily/include/translator.hh
lily/include/unpure-pure-container.hh
lily/input-smob.cc
lily/lily-imports.cc
lily/lily-lexer.cc
lily/lily-parser.cc
lily/listener.cc
lily/moment.cc
lily/music-function.cc
lily/music-iterator.cc
lily/music-output.cc
lily/note-performer.cc
lily/output-def-scheme.cc
lily/page-marker.cc
lily/paper-book.cc
lily/paper-outputter.cc
lily/parser.yy
lily/pitch.cc
lily/prob.cc
lily/scale.cc
lily/scm-hash.cc
lily/score.cc
lily/skyline-pair.cc
lily/skyline.cc
lily/source-file.cc
lily/spring-smob.cc
lily/stencil.cc
lily/translator-dispatch-list.cc
lily/translator-group.cc
lily/translator.cc
lily/undead.cc
lily/unpure-pure-container.cc
scm/chord-entry.scm
scm/define-music-display-methods.scm
scm/define-note-names.scm
scm/lily.scm

index a560a25940b5dbd065d50ed6ad8d81f6af6b6782..ab4f2a4ce4e3a09651b674a8f9598e2cdd6699f5 100644 (file)
@@ -27,8 +27,6 @@
 #include "scm-hash.hh"
 #include "warn.hh"
 
-const char * const All_font_metrics::type_p_name_ = 0;
-
 Index_to_charcode_map const *
 All_font_metrics::get_index_to_charcode_map (const string &filename,
                                              int face_index,
index cf35a7c1bdf0adcdc87a0eac3a68545c401c9b78..af0cb6263221e745f6b5d27d2dce49ba6fa9668c 100644 (file)
@@ -178,4 +178,4 @@ LY_DEFINE (ly_book_scores, "ly:book-scores",
 }
 
 
-const char Book::type_p_name_[] = "ly:book?";
+const char * const Book::type_p_name_ = "ly:book?";
index 629b8010fae6b2ab9b429399e463952d5ed2aa04..6569493419da6a66c44077feab15ea5297c46ee9 100644 (file)
@@ -133,4 +133,4 @@ Box::print ()
 /****************************************************************/
 
 
-const char Box::type_p_name_[] = "ly:box?";
+const char * const Box::type_p_name_ = "ly:box?";
diff --git a/lily/callback.cc b/lily/callback.cc
deleted file mode 100644 (file)
index baab7b0..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-  This file is part of LilyPond, the GNU music typesetter.
-
-  Copyright (C) 2016  David Kastrup <dak@gnu.org>
-
-  LilyPond is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation, either version 3 of the License, or
-  (at your option) any later version.
-
-  LilyPond is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "callback.hh"
-
-const char * const Callback_wrapper::type_p_name_ = 0;
-const char * const Callback2_wrapper::type_p_name_ = 0;
-const char * const Callback0_wrapper::type_p_name_ = 0;
-const char * const Method_instance::type_p_name_ = 0;
index 3258297b49539e2af7ed329eba280fc1b4192e6c..402bd80b6e8baf329b52b07c16275751f8c0b95b 100644 (file)
@@ -82,7 +82,7 @@ Context_def::~Context_def ()
 {
 }
 
-const char Context_def::type_p_name_[] = "ly:context-def?";
+const char * const Context_def::type_p_name_ = "ly:context-def?";
 
 int
 Context_def::print_smob (SCM port, scm_print_state *) const
index a533da2cbd05f4f2e990263e6396d2a4fb536491..892d692bbf8f6c2a89ff1d7288929cf8a8891e95 100644 (file)
@@ -34,7 +34,7 @@ Context_mod::Context_mod (SCM mod_list)
   mods_ = scm_reverse (mod_list);
 }
 
-const char Context_mod::type_p_name_[] = "ly:context-mod?";
+const char * const Context_mod::type_p_name_ = "ly:context-mod?";
 
 int
 Context_mod::print_smob (SCM port, scm_print_state *) const
index e0acae14557319223f253df2655caf80950796c0..6e22b2f808211b28aaa7acedad6afba52f9829f6 100644 (file)
@@ -66,7 +66,7 @@ class Grob_properties : public Simple_smob<Grob_properties>
 {
 public:
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
 private:
   friend class Grob_property_info;
   friend SCM ly_make_grob_properties (SCM);
@@ -97,7 +97,7 @@ private:
     cooked_ (alist), cooked_from_ (alist), nested_ (0) { }
 };
 
-const char Grob_properties::type_p_name_[] = "ly:grob-properties?";
+const char * const Grob_properties::type_p_name_ = "ly:grob-properties?";
 
 SCM
 Grob_properties::mark_smob () const
index d96382e968226f697f300a24e05919f50fa959dc..7de61c5796fd291739c8f8e700a8132f58e1b2a8 100644 (file)
@@ -779,7 +779,7 @@ Context::mark_smob () const
   return properties_scm_;
 }
 
-const char Context::type_p_name_[] = "ly:context?";
+const char * const Context::type_p_name_ = "ly:context?";
 
 Global_context *
 Context::get_global_context () const
index 8f938d6f91a8bcd86a3721128bf0ba5c11920619..b1b076759f83b8a7e1a655d84054957b84afb4c5 100644 (file)
@@ -23,7 +23,7 @@
 #include "warn.hh"
 #include "lily-imports.hh"
 
-const char Dispatcher::type_p_name_[] = "ly:dispatcher?";
+const char * const Dispatcher::type_p_name_ = "ly:dispatcher?";
 
 Dispatcher::~Dispatcher ()
 {
index 0b1001954072852ea366ad18c257aa19ef0fb4e0..0c6fa4dd5f55c89b5fe628276c04b47acc3f7cc4 100644 (file)
@@ -136,7 +136,7 @@ Duration::to_string () const
   return s;
 }
 
-const char Duration::type_p_name_[] = "ly:duration?";
+const char * const Duration::type_p_name_ = "ly:duration?";
 
 
 int
index f2b6a0e1476c2e669a1917d47f8d17343960ac37..c9daa95f3edf2000d39fb47a5d856a8df505073a 100644 (file)
@@ -112,7 +112,7 @@ Font_metric::print_smob (SCM port, scm_print_state *) const
   return 1;
 }
 
-const char Font_metric::type_p_name_[] = "ly:font-metric?";
+const char * const Font_metric::type_p_name_ = "ly:font-metric?";
 
 SCM
 Font_metric::font_file_name () const
index ec0ee43e1895f92eb21f16f616110f5e1ed2ed0e..f5228dfd7148d91296dac7765b8b197cb162f34c 100644 (file)
@@ -116,7 +116,7 @@ Grob_array::filter_map_assign (const Grob_array &src,
     filter_map (map_fun);
 }
 
-const char Grob_array::type_p_name_[] = "ly:grob-array?";
+const char * const Grob_array::type_p_name_ = "ly:grob-array?";
 
 
 SCM
index 066b700a252004ac86f809d721208c1f243fa8d9..72949973b1acf777fb88295945c7cf44e7f6e489 100644 (file)
@@ -23,7 +23,7 @@
 #include "warn.hh"
 
 
-const char Grob::type_p_name_[] = "ly:grob?";
+const char * const Grob::type_p_name_ = "ly:grob?";
 
 SCM
 Grob::mark_smob () const
index f206a3b95d7ec375f6a864c44a8aab7b43170e05..a2d090a6dfd71c7567447e5ff75dd87ece76f756 100644 (file)
@@ -48,7 +48,6 @@ class All_font_metrics : public Smob<All_font_metrics>
 
   All_font_metrics (All_font_metrics const &);
 public:
-  static const char * const type_p_name_; // = 0
   SCM mark_smob () const;
 
   Index_to_charcode_map const *get_index_to_charcode_map (const string &filename,
index 3ea6c2c550b0346db2e77d88903df91735c6a2b4..0a71a6b9e442a6901b82028d45c83ca09831a945 100644 (file)
@@ -30,7 +30,7 @@ class Book : public Smob<Book>
 {
 public:
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Book ();
   SCM header_;
   Output_def *paper_;
index 7d5745d6965b757123606d33b4b25edf64dc1779..d4a8655a429b0cf965364132871cf2b7f9c3b054 100644 (file)
@@ -12,7 +12,7 @@
 class Box : public Simple_smob<Box>
 {
 public:
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
 private:
   Interval interval_a_[NO_AXES];
 public:
index 963f4eb59cdf633435b16aa0a479068981c628b8..671140673f5df0dd242c5ac883ff0b274128bb29 100644 (file)
@@ -48,7 +48,6 @@ class Callback_wrapper : public Simple_smob<Callback_wrapper>
     : trampoline_ (trampoline)
   { } // Private constructor, use only in make_smob
 public:
-  static const char * const type_p_name_; // = 0
   LY_DECLARE_SMOB_PROC (&Callback_wrapper::call, 2, 0, 0)
   SCM call (SCM target, SCM arg)
   {
@@ -77,7 +76,6 @@ class Callback2_wrapper : public Simple_smob<Callback2_wrapper>
     : trampoline_ (trampoline)
   { } // Private constructor, use only in make_smob
 public:
-  static const char * const type_p_name_; // = 0
   LY_DECLARE_SMOB_PROC (&Callback2_wrapper::call, 3, 0, 0)
   SCM call (SCM target, SCM arg1, SCM arg2)
   {
@@ -102,7 +100,6 @@ class Callback0_wrapper : public Simple_smob<Callback0_wrapper>
     : trampoline_ (trampoline)
   { } // Private constructor, use only in make_smob
 public:
-  static const char * const type_p_name_; // = 0
   LY_DECLARE_SMOB_PROC (&Callback0_wrapper::call, 1, 0, 0)
   SCM call (SCM target)
   {
@@ -153,7 +150,6 @@ class Method_instance : public Simple_smob<Method_instance>
 {
   SCM method_, instance_;
 public:
-  static const char * const type_p_name_; // = 0
   LY_DECLARE_SMOB_PROC (&Method_instance::call, 0, 0, 1)
   SCM call (SCM rest)
   {
index c49fee1e305a6ada60a051ac52400a0e7044bfae..b068e204c02e345d50bf2343def2e95a68941c27 100644 (file)
@@ -35,7 +35,7 @@ struct Context_def : public Smob<Context_def>
 {
   SCM mark_smob () const;
   int print_smob (SCM, scm_print_state *) const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Context_def ();
 private:
   /*
index c9f0caa8fbb9c32228b28ae56a0df1c14ad37deb..81b1f34e36c47189b543eda186e84dbf66e6fb98 100644 (file)
@@ -38,7 +38,7 @@ struct Context_mod : public Simple_smob<Context_mod>
 {
   SCM mark_smob () const;
   int print_smob (SCM, scm_print_state *) const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
 private:
   SCM mods_;
 public:
index 130a304f935ea694c71d3f9d773ad1aed98e365d..468f612061707734ee3865faf8937cba06ea92ec 100644 (file)
@@ -33,7 +33,7 @@ class Context : public Smob<Context>
 public:
   SCM mark_smob () const;
   int print_smob (SCM, scm_print_state *) const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Context ();
 private:
   Scheme_hash_table *properties_dict () const;
index f0eb30ba6dc41d8d8ad392e362d6ec480a7fa49d..98a8626fd8f04f370c632209b053c40d77bb0953 100644 (file)
@@ -29,7 +29,7 @@ class Dispatcher : public Smob<Dispatcher>
 public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Dispatcher ();
 private:
   /* Hash table. Each event-class maps to a list of listeners. */
index 7a57cf53af6a4ff5dd333266173374a89bac9591..6233fc1b2d4fdff1c897cc33c040e8145fbf457e 100644 (file)
@@ -29,7 +29,7 @@ struct Duration : public Simple_smob<Duration>
 {
   static SCM equal_p (SCM, SCM);
   int print_smob (SCM, scm_print_state *) const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   Duration ();
   Duration (int, int);
   Duration (Rational, bool scale);
index d74c8157ca9f50003aa1777d9cb35ed3d8923b19..e385a1e7af7ad603a9bb043b0c7fa4dcb6b9a995 100644 (file)
@@ -35,7 +35,7 @@ class Font_metric : public Smob<Font_metric>
 public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Font_metric ();
 private:
   DECLARE_CLASSNAME (Font_metric);
index 1a755fe66196c2bdbbf301c2217a068d06a010b0..ca925b42917621842afd3ce2fc5512a21662ff5d 100644 (file)
@@ -29,7 +29,7 @@ class Grob_array : public Simple_smob<Grob_array>
 public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
 private:
   vector<Grob *> grobs_;
   bool ordered_;
index db51e02e73cb0a0c5ec6ce1f4e91d56d5bc69bbe..a9408f09a2ac1cbc6beb21a9766526c3d3af5914 100644 (file)
@@ -32,7 +32,7 @@ class Grob : public Smob<Grob>
 public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Grob ();
 private:
   DECLARE_CLASSNAME (Grob);
index b77db2d66f547051ca07fd51cdb615dfbc34126d..aab0d117a66a561b7f6a0cea4c727a97b64d3e24 100644 (file)
@@ -32,7 +32,7 @@ class Input : public Simple_smob<Input>
   char const *end_;
   Source_file *source_file_;
 public:
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   int print_smob (SCM, scm_print_state *) const;
   static SCM equal_p (SCM, SCM);
   SCM mark_smob () const;
index 97982895f50c851ef1b993c157956fdf9fb771b6..d930f69cf940527ddd9eba2703ecf5920e220d34 100644 (file)
@@ -58,8 +58,10 @@ namespace Lily {
   extern Variable beat_structure;
   extern Variable calc_repeat_slash_count;
   extern Variable car_less;
+  extern Variable chordmodifiers;
   extern Variable construct_chord_elements;
   extern Variable default_time_signature_settings;
+  extern Variable drum_pitch_names;
   extern Variable grob_compose_function;
   extern Variable grob_offset_function;
   extern Variable hash_table_to_alist;
@@ -91,6 +93,7 @@ namespace Lily {
 #endif
   extern Variable f_parser;
   extern Variable percussion_p;
+  extern Variable pitchnames;
   extern Variable pure_chain_offset_callback;
   extern Variable remove_stencil_warnings;
   extern Variable scale_layout;
index 0e001ec187a76aae50ecf7aec3e312349df280a3..626d24efa64ba2242afe7a1a5ab697941a3043e4 100644 (file)
@@ -36,7 +36,7 @@ class Lily_lexer : public Smob<Lily_lexer>, public Includable_lexer
 public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Lily_lexer ();
 private:
   int lookup_keyword (const string&);
index b08df7c7a4ab487f5329b6f4f981a1b2c68f234b..e4ff2969b92ce8143326b8a4a7889ee0ee64169e 100644 (file)
@@ -36,7 +36,7 @@ class Lily_parser : public Smob<Lily_parser>
 public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Lily_parser ();
   Lily_lexer *lexer_;
   Sources *sources_;
index b9042ba301ac79f715b197ed22d159bbb47943df..a13fdc66e14e141d28917e4ffa46d72494b7e740 100644 (file)
@@ -96,7 +96,7 @@ private:
   SCM callback_;
   SCM target_;
 public:
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
 
   Listener (SCM callback, SCM target)
     : callback_ (callback), target_ (target) { }
index d84a992b40e73eb6b649476ffb14481558f259d4..c29032f99dc6f56d32fc087b2dcecfaccda7fe16 100644 (file)
@@ -32,7 +32,7 @@ class Moment : public Simple_smob<Moment>
 public:
   static SCM equal_p (SCM, SCM);
   int print_smob (SCM, scm_print_state *) const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   Moment ();
   Moment (int m);
 
index f2c349a3e1cdfd1f2bb6572c3c54c727b973bfe4..80239a61aaefe202f8282c78f453564a55b31b36 100644 (file)
@@ -27,7 +27,7 @@
 class Music_function : public Smob2<Music_function>
 {
 public:
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   int print_smob (SCM, scm_print_state *) const;
   SCM get_signature () const { return scm1 (); }
   SCM get_function () const { return scm2 (); }
index 810d230aac279b447a0c7bd989a1093141567221..bb095df71869e84bbd25d84042cd30adab580e79 100644 (file)
@@ -63,7 +63,7 @@ class Music_iterator : public Smob<Music_iterator>
 public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Music_iterator ();
 protected:
   Moment music_length_;
index dc1111b78ac58b9070f5ecb352baac9d522d2ca4..208c01a831e9f2f2920dd5b1407e15aed4a76668 100644 (file)
@@ -31,7 +31,7 @@ class Music_output : public Smob<Music_output>
 public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Music_output ();
 private:
   DECLARE_CLASSNAME (Music_output);
index 5de672e67addf202f1609017da8d0d838272bb81..8c188f2707872e0d8ea62bf8d5d71e41fca0b6bc 100644 (file)
@@ -51,7 +51,7 @@ class Output_def : public Smob<Output_def>
 public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Output_def ();
   VIRTUAL_COPY_CONSTRUCTOR (Output_def, Output_def);
 
index 02233d30a6d804d06bfa8d420e6e4187944007df..33f3a38c06151c9c46d4b851dedea23f6572d89c 100644 (file)
@@ -27,7 +27,7 @@ class Page_marker : public Smob<Page_marker>
 {
 public:
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Page_marker ();
 private:
   SCM symbol_; /* either 'page-turn-permission or 'page-break-permission */
index b105cdb3de50d5763909b3d38ef900de8468a286..9530c94b7076fb5a9137253adbcd8732a6900836 100644 (file)
@@ -31,7 +31,7 @@ class Paper_book : public Smob<Paper_book>
 {
 public:
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Paper_book ();
 private:
   SCM systems_;
index 8683b4c6d10dd5f04531e40691c3bad00228890f..cd1a5e2c92fb4ffb34a0581f85398750c1276d28 100644 (file)
@@ -33,7 +33,6 @@
 class Paper_outputter : public Smob<Paper_outputter>
 {
 public:
-  static const char * const type_p_name_; // = 0
   SCM mark_smob () const;
   virtual ~Paper_outputter ();
 private:
index daade82e81994b5e06ca2d2103fbe58cc4bd1d04..dad2bc1246727c5fc4f5dc016b78c7f2c788347b 100644 (file)
@@ -38,7 +38,7 @@ public:
   static SCM equal_p (SCM, SCM);
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
 private:
   int octave_;
   int notename_;
index cb850555fb414983ff0024c502fd66a0da920336..a9a485b5502642924d8610e352ec7b2967b3d2d6 100644 (file)
@@ -38,7 +38,7 @@ public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
   static SCM equal_p (SCM, SCM);
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Prob ();
 private:
   DECLARE_CLASSNAME (Prob);
index 7c990e503419ce7db183489fae7ce90c0074d092..19cd175c797fd7d9e63a5ac79dbb8c73696c1fa0 100644 (file)
@@ -26,7 +26,6 @@
 
 struct Scale : public Smob<Scale>
 {
-  static const char * const type_p_name_; // = 0
   virtual ~Scale ();
   Scale (vector<Rational> const &);
   Scale (Scale const &);
index 241f316c4ec3dd622ed493936a5dcf63b36f3447..3453904f7152cf3c8cfe60b652fca9892803637a 100644 (file)
@@ -46,7 +46,6 @@
 class Scheme_hash_table : public Smob1<Scheme_hash_table>
 {
 public:
-  static const char * const type_p_name_; // = 0
   int print_smob (SCM, scm_print_state *) const;
   bool try_retrieve (SCM key, SCM *val);
   bool contains (SCM key) const;
index b3ece8960a813245139822c999120a85d668899a..a5918242f14d6bf534508461801c0dc3e4134d85 100644 (file)
@@ -31,7 +31,7 @@ class Score : public Smob<Score>
 {
 public:
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Score ();
 private:
   SCM music_;
index 6d7cea0ac248d917091bea19bb05cba6d0abf72c..f7946c1851d50123979a6dd2623e62b90609ae32 100644 (file)
@@ -25,7 +25,7 @@
 class Skyline_pair : public Simple_smob<Skyline_pair>
 {
 public:
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
 private:
   Drul_array<Skyline> skylines_;
 
index 21693420c88419fd0fc8834eb3e7e749d4fafb6d..43feb407615ebff249454d8b3a132296f2e07d99 100644 (file)
@@ -51,7 +51,7 @@ struct Building
 class Skyline : public Simple_smob<Skyline>
 {
 public:
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
 private:
   list<Building> buildings_;
   Direction sky_;
index 889d86a8cab3a342b374593a7a6afa1879d98f9f..7ef46b23e41106eb444907d665cd1a6aecac80c8 100644 (file)
     debugging purposes.  If the class does not define this function,
     the output will be #<Classname> when printing.
 
-  - a static const type_p_name_[] string set to something like
+  - a static const * const type_p_name_ string set to something like
     "ly:grob?".  When provided, an accordingly named function for
     checking for the given smob type will be available in Scheme.
 
@@ -177,6 +177,7 @@ private:
   // Most default functions are do-nothings.  void init() will
   // recognize their address when not overriden and will then refrain
   // altogether from passing the the respective callbacks to GUILE.
+
   SCM mark_smob (void) const;
   static SCM mark_trampoline (SCM); // Used for calling mark_smob
   static size_t free_smob (SCM obj);
@@ -185,11 +186,10 @@ private:
   static int print_trampoline (SCM, SCM, scm_print_state *);
   static void smob_proc_init (scm_t_bits) { };
 
-  // type_p_name_ has to be defined in the Super class, either with a
-  // static const char [] string or as a null pointer of type const
-  // char *.  We used to provide a default here for convenience, but
-  // battling the various conflicting C++ standards was too much of a
-  // hassle.
+  // Define type_p_name_ in the Super class as a const char * const.
+  // Without such definition it defaults to 0, producing no predicate.
+
+  static const char * const type_p_name_; // = 0
 
   // LY_DECLARE_SMOB_PROC is used in the Super class definition for
   // making a smob callable like a function.  Its first argument is a
index b8dfc1f67fdb6027b897fa78b2dbb19964eb3312..818c0900a56bac154476b49282eae6bf529241b8 100644 (file)
@@ -113,6 +113,9 @@ Scm_init Smob_base<Super>::scm_init_ (init);
 template <class Super>
 string Smob_base<Super>::smob_name_;
 
+template <class Super>
+const char * const Smob_base<Super>::type_p_name_ = 0;
+
 template <class Super>
 void Smob_base<Super>::init ()
 {
index 6686389289e3cc04909d7aff588a38a719115cc7..fc5bf2f54111c83b1bcf35aa8f9c7d5bd3526549 100644 (file)
@@ -40,7 +40,7 @@ class Source_file : public Smob<Source_file>
 public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Source_file ();
 private:
   vector<char const *> newline_locations_;
index fd01ca048cf7bc0ce53506c8b058dae13b244702..d4ebee23cd05f3680b9bfcfe3bb036061a6af92a 100644 (file)
@@ -27,7 +27,7 @@ class Spring : public Simple_smob<Spring>
 {
 public:
   static SCM equal_p (SCM, SCM);
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
 private:
   Real distance_;
   Real min_distance_;
index 6ccb9252bb18a224f5a38ff36b53bda6c30cd94b..8af67c0f766f039184e6ba00500d43044a58a0e7 100644 (file)
@@ -59,7 +59,7 @@ class Stencil : public Simple_smob<Stencil>
 {
 public:
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
 private:
   Box dim_;
   SCM expr_;
index eb74e74cd69e2091d2e0714bd89c013852f2cf45..b6124572fc53d6f694fb7fae2a32cbbe0b83d248 100644 (file)
@@ -30,7 +30,6 @@ class Engraver_dispatch_list : public Simple_smob<Engraver_dispatch_list>
 {
   vector<Method_instance> dispatch_entries_;
 public:
-  static const char * const type_p_name_; // = 0
   void apply (Grob_info);
   SCM static create (SCM trans_list,
                      SCM iface_list, Direction);
index 4ba2fe6523d493e8b43b77cde05abfa6afb5bfe1..d4500ef2b4e170a4312b35746fc01a47d4d8429f 100644 (file)
@@ -29,7 +29,7 @@ class Translator_group : public Smob<Translator_group>
 public:
   SCM mark_smob () const;
   int print_smob (SCM, scm_print_state *) const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Translator_group ();
 private:
   void precompute_method_bindings ();
index fd93a3e42fb82397eabb3bda7eb09b58af7ce780..dd0659bf50866ec4a9e03e86565deffc0299f7dd 100644 (file)
@@ -91,7 +91,7 @@ class Translator : public Smob<Translator>
 public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
   virtual ~Translator ();
 private:
   void init ();
index 92974fe8f069d6e5e199916db70f50f166cb1bfd..7accff9a8843fcdb788595a8d7821fd86d80cd85 100644 (file)
@@ -26,7 +26,7 @@
 class Unpure_pure_container : public Smob2<Unpure_pure_container>
 {
 public:
-  static const char type_p_name_ [];
+  static const char * const type_p_name_;
   SCM unpure_part () const { return scm1 (); }
   // A container that has the same callback for both 'pure' and 'unpure' lookups
   // and which ignores the 'start' and 'end' columnns.
index f9de264277307556a0eec0c3ea296a030f5aa0e9..6f5fc18a54fb116a58dc2c1db13cf227c472704c 100644 (file)
@@ -25,7 +25,7 @@
 /* Dummy input location for use if real one is missing.  */
 Input dummy_input_global;
 
-const char Input::type_p_name_[] = "ly:input-location?";
+const char * const Input::type_p_name_ = "ly:input-location?";
 
 SCM
 Input::mark_smob () const
index adc9124fb7dc948c613515dff9c2a585a9350987..62e58b603c1ff36e8c150fbf920c9e6bae711965 100644 (file)
@@ -52,8 +52,10 @@ namespace Lily {
   Variable beat_structure ("beat-structure");
   Variable calc_repeat_slash_count ("calc-repeat-slash-count");
   Variable car_less ("car<");
+  Variable chordmodifiers ("chordmodifiers");
   Variable construct_chord_elements ("construct-chord-elements");
   Variable default_time_signature_settings ("default-time-signature-settings");
+  Variable drum_pitch_names ("drumPitchNames");
   Variable grob_compose_function ("grob::compose-function");
   Variable grob_offset_function ("grob::offset-function");
   Variable hash_table_to_alist ("hash-table->alist");
@@ -85,6 +87,7 @@ namespace Lily {
 #endif
   Variable f_parser ("%parser");
   Variable percussion_p ("percussion?");
+  Variable pitchnames ("pitchnames");
   Variable pure_chain_offset_callback ("pure-chain-offset-callback");
   Variable remove_stencil_warnings ("remove-stencil-warnings");
   Variable scale_layout ("scale-layout");
index 221d048cc00aa9a0f67f2f963b5932a43475328d..6db0e653e5480d224427df3488bd12ae5c1a3bb5 100644 (file)
@@ -369,7 +369,7 @@ Lily_lexer::add_lexed_char (int count)
 }
 
 
-const char Lily_lexer::type_p_name_[] = "ly:lily-lexer?";
+const char * const Lily_lexer::type_p_name_ = "ly:lily-lexer?";
 
 SCM
 Lily_lexer::mark_smob () const
index 31889742843cd750355ad2d4d64131233db438e4..d2499d4c4134c1453cc0a9b1a8618282df26da33 100644 (file)
@@ -200,7 +200,7 @@ Lily_parser::parser_error (Input const &i, const string &s)
   error_level_ = 1;
 }
 
-const char Lily_parser::type_p_name_[] = "ly:lily-parser?";
+const char * const Lily_parser::type_p_name_ = "ly:lily-parser?";
 
 /****************************************************************
   OUTPUT-DEF
index 2a8d28d8cbb6daa0d287eeccded86624f75fbb9d..836f8cdc6f1b450829ff7337befa4bbc3763db33 100644 (file)
@@ -19,4 +19,4 @@
 
 #include "listener.hh"
 
-const char Listener::type_p_name_[] = "ly:listener?";
+const char * const Listener::type_p_name_ = "ly:listener?";
index 81ab30e3aebebfe5bde60d265e31f94d257efdf7..20c1f58a0b51cdef2e0c5e42e16c4dced7014e7d 100644 (file)
@@ -44,7 +44,7 @@ Moment::Moment (Rational m)
 }
 
 
-const char Moment::type_p_name_[] = "ly:moment?";
+const char * const Moment::type_p_name_ = "ly:moment?";
 
 
 int
index 969d5ff7b538cb6abf82a3c2d750072d9bd3c83b..c252291736cae35e659efc07ea6659742f2e0947 100644 (file)
@@ -24,7 +24,7 @@
 #include "fluid.hh"
 #include "lily-imports.hh"
 
-const char Music_function::type_p_name_[] = "ly:music-function?";
+const char * const Music_function::type_p_name_ = "ly:music-function?";
 
 /* Print a textual represenation of the smob to a given port.  */
 int
index b89e92c28ec968f2f13bfbfff070a440d891ce7f..a7a06ff0d82a1ba88ac1f1a67a4346f2fc00ceb0 100644 (file)
@@ -190,7 +190,7 @@ Music_iterator::get_music () const
 
 /****************************************************************/
 
-const char Music_iterator::type_p_name_[] = "ly:iterator?";
+const char * const Music_iterator::type_p_name_ = "ly:iterator?";
 
 SCM
 Music_iterator::mark_smob () const
index 7b89b853f6c29c332aad8292c3f828912db3ff1d..9e8cc9ff9a5bcf3353588f0996afabdf73ded7ee 100644 (file)
@@ -39,7 +39,7 @@ Music_output::derived_mark () const
 {
 }
 
-const char Music_output::type_p_name_[] = "ly:music-output?";
+const char * const Music_output::type_p_name_ = "ly:music-output?";
 
 SCM
 Music_output::mark_smob () const
index a2ca6946e95a440635d3127fa5884bcd532a9ce6..468210d20d0852f26a7d576dfc483defe42a277f 100644 (file)
@@ -37,13 +37,14 @@ protected:
 
   void listen_note (Stream_event *);
   void listen_breathing (Stream_event *);
+  void listen_tie (Stream_event *);
+  void listen_articulation (Stream_event *);
 private:
-  vector<Stream_event *> note_evs_;
+  vector<Stream_event *> note_evs_, script_evs_;
   vector<Audio_note *> notes_;
 
   vector<Audio_note *> last_notes_;
   Moment last_start_;
-
 };
 
 void
@@ -68,6 +69,10 @@ Note_performer::process_music ()
           Stream_event *tie_event = 0;
           Moment len = get_event_length (n, now_mom ());
           int velocity = 0;
+
+          for (vsize j = script_evs_.size (); j--;)
+            articulations = scm_cons (script_evs_[j]->self_scm (), articulations);
+
           for (SCM s = articulations; scm_is_pair (s); s = scm_cdr (s))
             {
               Stream_event *ev = unsmob<Stream_event> (scm_car (s));
@@ -124,6 +129,7 @@ Note_performer::stop_translation_timestep ()
 
   notes_.clear ();
   note_evs_.clear ();
+  script_evs_.clear ();
 }
 
 void
@@ -132,6 +138,18 @@ Note_performer::listen_note (Stream_event *ev)
   note_evs_.push_back (ev);
 }
 
+void
+Note_performer::listen_tie (Stream_event *ev)
+{
+  script_evs_.push_back (ev);
+}
+
+void
+Note_performer::listen_articulation (Stream_event *ev)
+{
+  script_evs_.push_back (ev);
+}
+
 void
 Note_performer::listen_breathing (Stream_event *ev)
 {
@@ -160,6 +178,8 @@ Note_performer::boot ()
 {
   ADD_LISTENER (Note_performer, note);
   ADD_LISTENER (Note_performer, breathing);
+  ADD_LISTENER (Note_performer, tie);
+  ADD_LISTENER (Note_performer, articulation);
 }
 
 ADD_TRANSLATOR (Note_performer,
index 921f3dfcd5f9523ccbdbf20f6ffda170bb4152ed..65673c8a9ec71a6238104e70621f1313b224f810 100644 (file)
@@ -132,7 +132,7 @@ LY_DEFINE (ly_output_find_context_def, "ly:output-find-context-def",
 }
 
 const char
-Output_def::type_p_name_[] = "ly:output-def?";
+* const Output_def::type_p_name_ = "ly:output-def?";
 
 LY_DEFINE (ly_paper_outputscale, "ly:paper-outputscale",
           1, 0, 0, (SCM def),
index 02b9c4ad19e82c6a00b2a970ea5d098881820ed5..af62bdc95e27409ce44c14eea4bd4740ffe5f956 100644 (file)
@@ -40,7 +40,7 @@ Page_marker::~Page_marker ()
 {
 }
 
-const char Page_marker::type_p_name_[] = "ly:page-marker?";
+const char * const Page_marker::type_p_name_ = "ly:page-marker?";
 
 SCM
 Page_marker::mark_smob () const
index e23ef527772cbe2dc61d192ab2485673e8d0f7ab..3a672198b538df5a880c19b1032db80adb1af946 100644 (file)
@@ -53,7 +53,7 @@ Paper_book::~Paper_book ()
 {
 }
 
-const char Paper_book::type_p_name_[] = "ly:paper-book?";
+const char * const Paper_book::type_p_name_ = "ly:paper-book?";
 
 SCM
 Paper_book::mark_smob () const
index 471a36a41a4572eb1941eb83ad4a27b244cb3c26..a72ea59ccdef770d8f70c32f942a42ee4fe8a6d9 100644 (file)
@@ -40,8 +40,6 @@ using namespace std;
 #include "lily-imports.hh"
 
 
-const char * const Paper_outputter::type_p_name_ = 0;
-
 Paper_outputter::Paper_outputter (SCM port, const string &format)
 {
   file_ = port;
index b8849e8f4acaa79447fe0a81daa4d6e0d8a218d3..1695aea6259d838f12655f412692210e251eeb4e 100644 (file)
@@ -387,8 +387,7 @@ prec levels in different prods */
 start_symbol:
        lilypond
        | EMBEDDED_LILY {
-               SCM nn = parser->lexer_->lookup_identifier ("pitchnames");
-               parser->lexer_->push_note_state (nn);
+               parser->lexer_->push_note_state (Lily::pitchnames);
        } embedded_lilypond {
                parser->lexer_->pop_state ();
                 *retval = $3;
@@ -824,8 +823,7 @@ context_mod_arg:
        embedded_scm
        |
        {
-               SCM nn = parser->lexer_->lookup_identifier ("pitchnames");
-               parser->lexer_->push_note_state (nn);
+               parser->lexer_->push_note_state (Lily::pitchnames);
        }
        composite_music
        {
@@ -1282,8 +1280,7 @@ output_def_body:
        {
                if (scm_is_pair ($1))
                        $1 = scm_car ($1);
-               SCM nn = parser->lexer_->lookup_identifier ("pitchnames");
-               parser->lexer_->push_note_state (nn);
+               parser->lexer_->push_note_state (Lily::pitchnames);
        } music_or_context_def
        {
                parser->lexer_->pop_state ();
@@ -1455,8 +1452,7 @@ simple_music:
 context_modification:
         WITH
        {
-               SCM nn = parser->lexer_->lookup_identifier ("pitchnames");
-               parser->lexer_->push_note_state (nn);
+               parser->lexer_->push_note_state (Lily::pitchnames);
        } '{' context_mod_list '}'
         {
                 parser->lexer_->pop_state ();
@@ -2530,15 +2526,13 @@ mode_changed_music:
 
 mode_changing_head:
        NOTEMODE {
-               SCM nn = parser->lexer_->lookup_identifier ("pitchnames");
-               parser->lexer_->push_note_state (nn);
+               parser->lexer_->push_note_state (Lily::pitchnames);
 
                $$ = ly_symbol2scm ("notes");
        }
        | DRUMMODE
                {
-               SCM nn = parser->lexer_->lookup_identifier ("drumPitchNames");
-               parser->lexer_->push_note_state (nn);
+               parser->lexer_->push_note_state (Lily::drum_pitch_names);
 
                $$ = ly_symbol2scm ("drums");
        }
@@ -2548,10 +2542,9 @@ mode_changing_head:
                $$ = ly_symbol2scm ("figures");
        }
        | CHORDMODE {
-               SCM nn = parser->lexer_->lookup_identifier ("chordmodifiers");
-               parser->lexer_->chordmodifier_tab_ = alist_to_hashq (nn);
-               nn = parser->lexer_->lookup_identifier ("pitchnames");
-               parser->lexer_->push_chord_state (nn);
+               parser->lexer_->chordmodifier_tab_ =
+                       alist_to_hashq (Lily::chordmodifiers);
+               parser->lexer_->push_chord_state (Lily::pitchnames);
                $$ = ly_symbol2scm ("chords");
 
        }
@@ -2563,8 +2556,7 @@ mode_changing_head:
 
 mode_changing_head_with_context:
        DRUMS {
-               SCM nn = parser->lexer_->lookup_identifier ("drumPitchNames");
-               parser->lexer_->push_note_state (nn);
+               parser->lexer_->push_note_state (Lily::drum_pitch_names);
 
                $$ = ly_symbol2scm ("DrumStaff");
        }
@@ -2574,10 +2566,9 @@ mode_changing_head_with_context:
                $$ = ly_symbol2scm ("FiguredBass");
        }
        | CHORDS {
-               SCM nn = parser->lexer_->lookup_identifier ("chordmodifiers");
-               parser->lexer_->chordmodifier_tab_ = alist_to_hashq (nn);
-               nn = parser->lexer_->lookup_identifier ("pitchnames");
-               parser->lexer_->push_chord_state (nn);
+               parser->lexer_->chordmodifier_tab_ =
+                       alist_to_hashq (Lily::chordmodifiers);
+               parser->lexer_->push_chord_state (Lily::pitchnames);
                $$ = ly_symbol2scm ("ChordNames");
        }
        | LYRICS
@@ -3861,8 +3852,7 @@ markup_uncomposed_list:
                $$ = $2;
        }
        | SCORELINES {
-               SCM nn = parser->lexer_->lookup_identifier ("pitchnames");
-               parser->lexer_->push_note_state (nn);
+               parser->lexer_->push_note_state (Lily::pitchnames);
        } '{' score_body '}' {
                Score *sc = unsmob<Score> ($4);
                sc->origin ()->set_spot (@$);
@@ -3975,8 +3965,7 @@ simple_markup:
                $$ = make_simple_markup ($1);
        }
        | SCORE {
-               SCM nn = parser->lexer_->lookup_identifier ("pitchnames");
-               parser->lexer_->push_note_state (nn);
+               parser->lexer_->push_note_state (Lily::pitchnames);
        } '{' score_body '}' {
                Score *sc = unsmob<Score> ($4);
                sc->origin ()->set_spot (@$);
index e34562fecc5571fe83ab21b5c3b5df677ffb36d9..9e46bba70e6ff1d2360a66292427f312b4b5f5c8 100644 (file)
@@ -218,7 +218,7 @@ Pitch::down_to (int notename)
   notename_ = notename;
 }
 
-const char Pitch::type_p_name_[] = "ly:pitch?";
+const char * const Pitch::type_p_name_ = "ly:pitch?";
 
 SCM
 Pitch::mark_smob () const
index 938f10686164e33d98460e5d1d2bc682b341e90e..d05a33e4f3aa60387ad40a612deaf01a6d952a54 100644 (file)
@@ -24,7 +24,7 @@
 #include "profile.hh"
 
 
-const char Prob::type_p_name_[] = "ly:prob?";
+const char * const Prob::type_p_name_ = "ly:prob?";
 
 SCM
 Prob::equal_p (SCM sa, SCM sb)
index d6f566b9ed57517d28ae1ef2859d25438deff275..02c1dc5f8e2daca09b480ac977049c66e70d68e3 100644 (file)
@@ -90,8 +90,6 @@ LY_DEFINE (ly_set_default_scale, "ly:set-default-scale",
   return SCM_UNSPECIFIED;
 }
 
-const char * const Scale::type_p_name_ = 0;
-
 int
 Scale::step_count () const
 {
index 97af8f6cd5f97ab742aafc029d7a87785d4fd18b..0b1e0b4e2532a7cc481ba4a794270aa3caa44799 100644 (file)
@@ -21,8 +21,6 @@
 
 #include <cassert>
 
-const char * const Scheme_hash_table::type_p_name_ = 0;
-
 SCM
 Scheme_hash_table::make_smob ()
 {
index da48e8f1031c3a5230f2c073b9bd2b0ff4166442..d10023dd8506b5103bed7a09ef673a074cff8574 100644 (file)
@@ -59,7 +59,7 @@ Score::~Score ()
 {
 }
 
-const char Score::type_p_name_[] = "ly:score?";
+const char * const Score::type_p_name_ = "ly:score?";
 
 SCM
 Score::mark_smob () const
index b3c2b96df4ad9d4e34eb4641a8eef63a91a58db8..bab43494a6c68564cbae3886b64a543749a72c5f 100644 (file)
@@ -120,7 +120,7 @@ Skyline_pair::operator [] (Direction d) const
   return skylines_[d];
 }
 
-const char Skyline_pair::type_p_name_[] = "ly:skyline-pair?";
+const char * const Skyline_pair::type_p_name_ = "ly:skyline-pair?";
 
 
 MAKE_SCHEME_CALLBACK (Skyline_pair, skyline, 2);
index f46b2f3e84c401437e6136fbb7808b63a51c398d..6ef2069c39b50b0acb7273c06928c3e509cf4729 100644 (file)
@@ -802,7 +802,7 @@ Skyline::clear ()
 
 /****************************************************************/
 
-const char Skyline::type_p_name_[] = "ly:skyline?";
+const char * const Skyline::type_p_name_ = "ly:skyline?";
 
 MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Skyline, get_touching_point, 3, 1, "")
 SCM
index 5a94927a7ffb549977f5b284f5fda18f3bdf91a6..14fdf2beb3b6ef4c10ff835c60deeca2a5811157 100644 (file)
@@ -362,7 +362,7 @@ Source_file::get_port () const
 /****************************************************************/
 
 
-const char Source_file::type_p_name_[] = "ly:source-file?";
+const char * const Source_file::type_p_name_ = "ly:source-file?";
 
 SCM
 Source_file::mark_smob () const
index 77b01bb158d56152e6c8dd027a788ba7788c7636..a389df2efdb5921a60b56814a7a2c2f210bb495f 100644 (file)
@@ -66,4 +66,4 @@ LY_DEFINE (ly_spring_set_inverse_stretch_strength_x, "ly:spring-set-inverse-stre
   return s->smobbed_copy ();
 }
 
-const char Spring::type_p_name_[] = "ly:spring?";
+const char * const Spring::type_p_name_ = "ly:spring?";
index 3da186954132a5cfc3940471e116671bac07faf0..0cf49296f0b460f444eaad29b7941b2ab99d248e 100644 (file)
@@ -44,7 +44,7 @@ Stencil::mark_smob () const
   return expr_;
 }
 
-const char Stencil::type_p_name_[] = "ly:stencil?";
+const char * const Stencil::type_p_name_ = "ly:stencil?";
 
 Interval
 Stencil::extent (Axis a) const
index 40ca1b3a5d7261f5e0b344531491acda93a47899..eeee8d24831c1417b844919ccc282818864b1b9e 100644 (file)
@@ -21,8 +21,6 @@
 #include "engraver.hh"
 
 
-const char * const Engraver_dispatch_list::type_p_name_ = 0;
-
 void
 Engraver_dispatch_list::apply (Grob_info gi)
 {
index 972a487bf4861428734b8d483ab13a835bfae472..a9f1690f62998712b5bfe0a7470c437f838025f1 100644 (file)
@@ -324,7 +324,7 @@ Translator_group::~Translator_group ()
 }
 
 
-const char Translator_group::type_p_name_[] = "ly:translator-group?";
+const char * const Translator_group::type_p_name_ = "ly:translator-group?";
 
 int
 Translator_group::print_smob (SCM port, scm_print_state *) const
index 5cd42703a1d855c392f27402b7244c05da4c9182..bdc55f0f05467a4d4cb5fd56b548deb9995329c2 100644 (file)
@@ -207,7 +207,7 @@ Translator::get_score_context () const
   return daddy_context_->get_score_context ();
 }
 
-const char Translator::type_p_name_[] = "ly:translator?";
+const char * const Translator::type_p_name_ = "ly:translator?";
 
 bool
 Translator::must_be_last () const
index a328c66cafd0e6e376da5b4a7a4765752ea2a759..4aed7a60237f12b21d35e7f0eb5fb4aa122dc939 100644 (file)
@@ -24,7 +24,7 @@ class Undead : public Simple_smob<Undead>
 public:
   int print_smob (SCM, scm_print_state *) const;
   SCM mark_smob () const;
-  static const char type_p_name_[];
+  static const char * const type_p_name_;
 private:
   SCM object_;
 public:
@@ -51,7 +51,7 @@ Undead::print_smob (SCM port, scm_print_state *) const
   return 1;
 }
 
-const char Undead::type_p_name_[] = "ly:undead?";
+const char * const Undead::type_p_name_ = "ly:undead?";
 
 LY_DEFINE (ly_make_undead, "ly:make-undead",
            1, 0, 0, (SCM object),
index 7a7d6d48d16d3c139aca38ad9f0f38f307b5debb..143b2fd47de4c118e4b1818e94a9bc8c4779e01a 100644 (file)
@@ -25,7 +25,6 @@
 class Unpure_pure_call : public Smob1<Unpure_pure_call>
 {
 public:
-  static const char * const type_p_name_; // = 0
   // Smob procedures unfortunately can only take at most 3 SCM
   // arguments.  Otherwise we could use a "3, 0, 1" call signature and
   // not require an argument count check of our own.
@@ -38,8 +37,6 @@ public:
   }
 };
 
-const char * const Unpure_pure_call::type_p_name_ = 0;
-
 SCM
 Unpure_pure_container::pure_part () const
 {
@@ -48,7 +45,7 @@ Unpure_pure_container::pure_part () const
     : scm2 ();
 }
 
-const char Unpure_pure_container::type_p_name_[] = "ly:unpure-pure-container?";
+const char * const Unpure_pure_container::type_p_name_ = "ly:unpure-pure-container?";
 
 LY_DEFINE (ly_make_unpure_pure_container, "ly:make-unpure-pure-container",
            1, 1, 0, (SCM unpure, SCM pure),
index 1d41c973e80330876afc9de25d5e090e4bc223ef..23601a8deaba4e54a3014c0b2fcdc8dd9c324dd1 100644 (file)
@@ -18,6 +18,8 @@
 ;; for define-safe-public when byte-compiling using Guile V2
 (use-modules (scm safe-utility-defs) (ice-9 receive))
 
+(define-session-public chordmodifiers '())
+
 (define-public (construct-chord-elements root duration modifications)
   "Build a chord on root using modifiers in @var{modifications}.
 @code{NoteEvents} have duration @var{duration}.
index 10aecbd1db6794f29b3ee54f9cb99bdef23e47b4..42637cd16c0c5548b44395186893e0d96cdedd05 100644 (file)
@@ -89,8 +89,7 @@ expression."
   (define (pitch= pitch1 pitch2)
     (and (= (ly:pitch-notename pitch1) (ly:pitch-notename pitch2))
          (= (ly:pitch-alteration pitch1) (ly:pitch-alteration pitch2))))
-  (let* ((pitches (ly:parser-lookup 'pitchnames))
-         (result (rassoc ly-pitch pitches pitch=)))
+  (let* ((result (rassoc ly-pitch pitchnames pitch=)))
     (and result (car result))))
 
 (define-public (octave->lily-string pitch)
@@ -860,7 +859,11 @@ Otherwise, return #f."
                 num den
                 (new-line->lily-string))
         (format #f
-                "\\time #'~a ~a/~a~a"
+                ;; This is silly but the latter will also work for #f
+                ;; and other
+                (if (key-list? structure)
+                    "\\time ~{~a~^,~} ~a/~a~a"
+                    "\\time #'~a ~a/~a~a")
                 structure num den
                 (new-line->lily-string)))))
 
index 5825967428d9a3e14036480acd83b32d3d7ba627..e7d208a5119c6230372d0981ea780af70c4cb562 100644 (file)
 
 
 ;;; Variable declaration
-(define-public pitchnames '())
-(define-public default-language "")
-(define-public previous-pitchnames #f)
+(define-session-public pitchnames '())
+(define-session-public default-language "")
+(define-session-public previous-pitchnames #f)
 
-(define-public language-pitch-names
+;;; A bit out of place, but we don't have a good place elsewhere in
+;;; scm since it is only filled in ly/drumpitch-init.ly and we need it
+;;; in (scm lily) in order to access it in ly/parser.yy.
+(define-session-public drumPitchNames '())
+
+(define-session-public language-pitch-names
   `(
     ;; Language: Nederlands --------------------------------------------;
     ;;  Dutch note names -- LilyPond's default language.
index ce3486cf3f4e70f9479fa6b4ac91e8a596c5a490..d1248cdd92d6c0e1a23e0ecfebfc9e877d25dc5a 100644 (file)
       (ly:error (_ "call-after-session used after session start")))
   (add-hook! after-session-hook thunk #t))
 
-(defmacro-public define-session (name value)
+(define (make-session-variable name value)
+  (if (ly:undead? lilypond-declarations)
+      (ly:error (_ "define-session used after session start")))
+  (let ((var (module-make-local-var! (current-module) name)))
+    (if (variable-bound? var)
+        (ly:error (_ "symbol ~S redefined") name))
+    (variable-set! var value)
+    var))
+
+(defmacro define-session (name value)
   "This defines a variable @var{name} with the starting value
 @var{value} that is reinitialized at the start of each session.
 A@tie{}session basically corresponds to one LilyPond file on the
@@ -108,22 +117,23 @@ to their front or replacing them altogether, not by modifying parts of
 them.  It is an error to call @code{define-session} after the first
 session has started."
   (define (add-session-variable name value)
-    (if (ly:undead? lilypond-declarations)
-        (ly:error (_ "define-session used after session start")))
-    (let ((var (make-variable value)))
-      (module-add! (current-module) name var)
-      (set! lilypond-declarations (cons var lilypond-declarations))))
+    (set! lilypond-declarations
+          (cons (make-session-variable name value) lilypond-declarations)))
   `(,add-session-variable ',name ,value))
 
-(defmacro-public define-session-public (name value)
+(defmacro define-session-public (name value)
   "Like @code{define-session}, but also exports @var{name} into parser modules."
   (define (add-session-variable name value)
-    (if (ly:undead? lilypond-declarations)
-        (ly:error (_ "define-session-public used after session start")))
-    (let ((var (make-variable value)))
-      (module-add! (current-module) name var)
-      (set! lilypond-exports (acons name var lilypond-exports))))
-  `(,add-session-variable ',name ,value))
+    (set! lilypond-exports
+          (acons name (make-session-variable name value) lilypond-exports)))
+  `(begin
+     ;; this is a bit icky: we place the variable right into every
+     ;; parser module so that both set! and define will affect the
+     ;; original variable in the (lily) module.  However, we _also_
+     ;; export it normally from (lily) for the sake of other modules
+     ;; not sharing the name space of the parser.
+     (,add-session-variable ',name ,value)
+     (export ,name)))
 
 (define (session-terminate)
   (if (ly:undead? lilypond-declarations)