]> git.donarmstrong.com Git - lilypond.git/commitdiff
(find_create_context): go to Score if it exists.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 16 Feb 2004 11:38:15 +0000 (11:38 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 16 Feb 2004 11:38:15 +0000 (11:38 +0000)
ChangeLog
Documentation/user/cheatsheet.itely
Documentation/user/refman.itely
lily/context-def.cc
lily/context.cc
lily/recording-group-engraver.cc
lily/score-engraver.cc
lily/translator-scheme.cc
ly/engraver-init.ly
ly/performer-init.ly
scm/document-translation.scm

index ce1b4a6bdca4e80ccd7de10db16ea7e8f451e7f7..0d24b11d59303abd85db13e462a21c61ed501b6c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2004-02-16  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/context.cc (find_create_context): go to Score if it exists.
+
        * lily/context-scheme.cc: new file.
 
        * lily/score-translator.cc (get_output): new file.
index b39f168d157302b411b6ccdb75f493d34203737e..b47e200e307cc59cecc121fbc23a29e714486521 100644 (file)
@@ -230,10 +230,9 @@ a\> a a\!
 @tab printing lyrics
 @tab
 twinkle
-@c cheating .. 
-@c@li lypond[fragment]
-@c  \lyrics \new Lyrics { twinkle }
-@c @end lilypond
+@lilypond[fragment]
+\lyrics \new Lyrics { twinkle }
+@end lilypond
 
 @item @code{twin -- kle}
 @tab lyric hyphen 
index 165fc001ccf60db048f1dd64d5eefbd1916e6144..03c178464593132172f174ae9a0d178c8fedf99d 100644 (file)
@@ -3525,11 +3525,11 @@ The complete example is shown here:
      g2 e4 a2 f4 g2.  }
   \lyrics << \lyricsto "duet" \new Lyrics {
     \set stanza = "B."
-    \set vocName = "Bert"
+    \set vocNam = "Bert"
     Hi, my name is bert. }
   \lyricsto "duet" \new Lyrics {
     \set stanza = "E." 
-    \set vocName = "Ernie"
+    \set vocNam = "Ernie"
     Ooooo, ch\'e -- ri, je t'aime.
     }
   >> >>
index 6fcee6e2de67ae7019745d4d664c0a2cec84c1e3..c976fb63255e52824efdc4f0de4cf851aac406df 100644 (file)
@@ -315,7 +315,9 @@ Context_def::to_alist () const
   l = gh_cons (gh_cons (ly_symbol2scm ("accepts"),  get_accepted (SCM_EOL)), l);
   l = gh_cons (gh_cons (ly_symbol2scm ("property-ops"),  property_ops_), l);
   l = gh_cons (gh_cons (ly_symbol2scm ("context-name"),  context_name_), l);
-  l = gh_cons (gh_cons (ly_symbol2scm ("group-type"),  translator_group_type_), l);    
+
+  if (gh_symbol_p (translator_group_type_))
+    l = gh_cons (gh_cons (ly_symbol2scm ("group-type"),  translator_group_type_), l);    
 
   return l;  
 }
index df3766b82a13ec0b3078cc91022dd583d46b0bad..6dff7f838bab86575324979414078f7521cb2f54 100644 (file)
@@ -118,6 +118,14 @@ Context*
 Context::find_create_context (SCM n, String id,
                              SCM operations)
 {
+  /*
+    Don't create multiple score contexts.
+   */
+  if (dynamic_cast<Global_context*> (this)
+      && dynamic_cast<Global_context*> (this)->get_score_context ())
+    return get_score_context ()->find_create_context (n, id, operations);
+    
+  
   Context * existing = find_existing_context (n,id);
   if (existing)
     return existing;
@@ -377,17 +385,8 @@ Context::print_smob (SCM s, SCM port, scm_print_state *)
   
 
   scm_puts (" ", port);
-  scm_display (sc->implementation_, port);
-  
-#if 0
-  Translator * tr = unsmob_translator (sc->implementation_);
-  if  (Translator_group *tg = dynamic_cast<Translator_group*> (tr))
-    scm_display (tg->get_simple_trans_list (), port);
-#endif
-  
-  /*
-    don't try to print properties, that is too much hassle.
-   */
+
+  scm_display (sc->context_list_, port);
   scm_puts (" >", port);
   
   return 1;
index 2a0970b50961c22557d29d32339c0ec79c19eb6c..70b7f79f27bbc21a49a11e813b2af2819011d5b7 100644 (file)
@@ -7,6 +7,7 @@
 
  */
 
+#include "context.hh"
 #include "engraver-group-engraver.hh"
 #include "protected-scm.hh"
 
@@ -57,7 +58,7 @@ Recording_group_engraver::finalize ()
   SCM proc = get_property ("recordEventSequence");
 
   if (gh_procedure_p (proc))
-    scm_call_2  (proc, self_scm(), gh_cdr (accumulator_));
+    scm_call_2  (proc, daddy_context_->self_scm(), gh_cdr (accumulator_));
 
   accumulator_ = SCM_EOL;
 }
index c6748a34528651bed3623863e7cadd690d955265..55dd5ad32e9c5f8a92a774c484345bb80aaac4cb 100644 (file)
@@ -139,7 +139,7 @@ Score_engraver::one_time_step ()
 {
   if (!to_boolean (get_property ("skipTypesetting")))
     {
-      recurse_down_engravers (daddy_context_, &Engraver::process_music, false);
+      recurse_down_engravers (daddy_context_, &Engraver::process_music, true);
       recurse_down_engravers (daddy_context_, &Engraver::do_announces, true);
     }
   
index 6df422ae5f40cf5a06d35800d44b9dd733c29d4e..ab010a067961fb39299e28f664fa7755e10757b1 100644 (file)
@@ -34,7 +34,7 @@ LY_DEFINE(ly_translator_description,
          "Return an alist of properties of  translator @var{me}.")
 {
   Translator *tr =unsmob_translator (me);
-  SCM_ASSERT_TYPE (tr, me, SCM_ARG1, __FUNCTION__, "Context");
+  SCM_ASSERT_TYPE (tr, me, SCM_ARG1, __FUNCTION__, "Translator");
 
   return tr->translator_description ();
 }
index 08e3ff8d6762818b165e8ba4e3ee26620afb40e3..2cc1c0b46b5dbcf6d2ac07a11f1b5f3083f50829 100644 (file)
@@ -3,8 +3,8 @@
 \translator {
     \name Global
 
-    % nothing else needed -- tweaks are ignored anyway.
     \accepts Score
+\description "Hard coded entry point for LilyPond. Cannot be tuned."
     }
 
 %
index 5538b8324ba3f266e151bb7393b1bb62fd4c6fe8..26b04348f65950fcd70996c9c04cee5915649e9e 100644 (file)
@@ -15,6 +15,7 @@
 \translator {
     \name Global
     \accepts Score
+\description "Hard coded entry point for LilyPond. Cannot be tuned."
     }
 \translator {
     \StaffContext
index b7bf4b09db3900439605e9b3e786d9c21c26cc3d..f1e509eeb8c52e196bc39128e1c855204ef38539 100644 (file)
                       (lambda (x)
                         (let*
                             ((context (cdr (assoc 'context-name x)))
+                             (group (assq-ref x 'group-type))
                              (consists (append
-                                        (list
-                                         (cdr (assoc 'group-type x)))
+                                        (if group
+                                            (list group)
+                                            '())
                                         (cdr (assoc 'consists x))
                                         ))
 
                 (cdr desc-handle) "(not documented)"))
        
        (accepts (cdr (assoc 'accepts context-desc)))
+       (group (assq-ref context-desc 'group-type))
+
        (consists (append
-                 (list (cdr (assoc 'group-type context-desc)))
+                 (if group (list group)
+                     '())
                  (cdr (assoc 'consists context-desc))
                  ))
        (props (cdr (assoc 'property-ops context-desc)))
              (map document-engraver-by-name consists))
        ))))
 
-(define (engraver-grobs  grav)
+(define (engraver-grobs grav)
   (let* ((eg (if (symbol? grav)
                 (find-engraver-by-name grav)
                 grav)))
-
     (if (eq? eg #f)
        '()
        (map symbol->string (cdr (assoc 'grobs-created (ly:translator-description eg)))))
   ))
 
 (define (context-grobs context-desc)
-  (let* ((consists (append
-                   (list (cdr (assoc 'group-type context-desc)))
+  (let* (
+        (group (assq-ref context-desc 'group-type))
+        (consists (append
+                   (if group
+                       (list group)
+                       '())
                    (cdr (assoc 'consists context-desc))
                    ))
         (grobs  (apply append