]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/scm-option.cc
* input/regression/new-part-combine-solo.ly: more cases.
[lilypond.git] / lily / scm-option.cc
index ec9186dbcfe05dbb73011be531d125ed71726801..9918d1050fc9d50df9602477e6e86a9469a7869e 100644 (file)
@@ -13,6 +13,7 @@
 #include "lily-guile.hh"
 #include "scm-option.hh"
 #include "warn.hh"
+#include "main.hh"
 
 /*
   This interface to option setting is meant for setting options are
@@ -37,7 +38,9 @@ int testing_level_global;
 /*
   Backwards compatibility.
  */
-bool lily_1_8_relative = true;
+bool lily_1_8_relative = false;
+bool lily_1_8_compatibility_used = false;
+
 /*
   crash if internally the wrong type is used for a grob property.
  */
@@ -75,7 +78,7 @@ don't timestamp the output
 
 @item -t,--test
 Switch on any experimental features.  Not for general public use. */
-LY_DEFINE (ly_set_option, "ly:set-option", 2, 0, 0, (SCM var, SCM val),
+LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
            "Set a global option value.  Supported options include\n"
 "\n"
 "@table @code\n"
@@ -97,6 +100,9 @@ LY_DEFINE (ly_set_option, "ly:set-option", 2, 0, 0, (SCM var, SCM val),
 "This function is useful to call from the command line: @code{lilypond -e\n"
 "\"(ly-set-option 'midi-debug #t)\"}.\n")
 {
+  if (val == SCM_UNDEFINED)
+    val = SCM_BOOL_T;
+
   if (var == ly_symbol2scm ("help"))
     {
       /* lilypond -e "(ly-set-option 'help #t)" */
@@ -121,11 +127,17 @@ LY_DEFINE (ly_set_option, "ly:set-option", 2, 0, 0, (SCM var, SCM val),
   else if (var == ly_symbol2scm ("old-relative"))
     {
       lily_1_8_relative = true;
+      lily_1_8_compatibility_used = false; 
     }
   else if (var == ly_symbol2scm ("new-relative"))
     {
       lily_1_8_relative = false;
     }
+  else if (var == ly_symbol2scm ("debug-beam"))
+    {
+      extern bool debug_beam_quanting_flag;
+      debug_beam_quanting_flag = true;
+    }
   else
     {
       warning (_("Unknown internal option!"));
@@ -135,3 +147,34 @@ LY_DEFINE (ly_set_option, "ly:set-option", 2, 0, 0, (SCM var, SCM val),
 }
 
 
+LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
+           "Get a global option setting.  Supported options include\n"
+          "@table @code\n"
+          "@item old-relative-used\n"
+          "Report whether old-relative compatibility mode is necessary\n"
+          "@item old-relative\n"
+          "Report whether old-relative compatibility mode is used\n"
+          "@item verbose\n"
+          "Report whether we are running in verbose mode\n"
+          "@end table\n"
+          "\n")
+{
+  if (var == ly_symbol2scm ("old-relative-used"))
+    {
+      return gh_bool2scm (lily_1_8_compatibility_used);
+    }
+  if (var == ly_symbol2scm ("old-relative"))
+    {
+      return gh_bool2scm (lily_1_8_relative);
+    }
+  if (var == ly_symbol2scm ("verbose"))
+    {
+      return gh_bool2scm (verbose_global_b);
+    }  
+  else
+    {
+      warning (_("Unknown internal option!"));
+    }
+
+  return SCM_UNSPECIFIED;
+}