]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/parser.yy (command_element): extract quoted vector in
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 21 Feb 2004 22:56:13 +0000 (22:56 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 21 Feb 2004 22:56:13 +0000 (22:56 +0000)
parser.

* input/regression/quote.ly: new file.

* lily/parser.yy (command_element): \quote DURATION NAME: support
cue notes.

* lily/quote-iterator.cc (class Quote_iterator): new file.

ChangeLog
input/regression/quote.ly
lily/parser.yy
lily/quote-iterator.cc
scm/define-music-properties.scm

index b6440fe3e0e2b62e1ea1f2badfd67012f0b75562..0ea6d3c87ca45f770e959b4dd577abaffa924319 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-02-21  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/parser.yy (command_element): extract quoted vector in
+       parser.
+
        * input/regression/quote.ly: new file.
 
        * lily/sequential-iterator.cc (process): only process if moment >= 0.
index f8a47044bc8956c4fffe6981fbb4e96eb231387f..bd1d84c55d1a0edd83809c4c1952a64923ec57ae 100644 (file)
@@ -13,8 +13,6 @@ bla = \notes\relative c' { fis4 fis fis fis }
 
 \score {
     \notes \relative c'' {
-       \set Score.quotes = \musicQuotes
-       
        c8 d8 \quote 2 "bla" es8 gis  
        }
 }
index 566af26bb6b3d05915b8732b681af30ece516220..8d6e4651f743c2b5955e03b7bf7e2dd5e766bf82 100644 (file)
@@ -1349,9 +1349,23 @@ command_element:
                $$ = skip;
        }
        | QUOTE duration_length STRING {
-               Music * quote = MY_MAKE_MUSIC("QuoteMusic");
-               quote->set_mus_property ("duration", $2);
-               quote->set_mus_property ("quoted-name", $3);
+               SCM tab = THIS->lexer_->lookup_identifier ("musicQuotes");
+               SCM evs =  SCM_EOL;
+               if (scm_hash_table_p (tab) == SCM_BOOL_T)
+               { 
+                       SCM key = $3; // use symbol? 
+                       evs = scm_hash_ref (tab, key, SCM_BOOL_F);
+               }
+               Music * quote = 0;
+               if (scm_vector_p (evs) == SCM_BOOL_T)
+               {
+                       quote = MY_MAKE_MUSIC("QuoteMusic");
+                       quote->set_mus_property ("duration", $2);
+                       quote->set_mus_property ("quoted-events", evs);
+               } else {
+                       THIS->here_input ().warning (_f ("Can\'t find music.")); 
+                       quote = MY_MAKE_MUSIC ("Event");
+               }
                quote->set_spot (THIS->here_input ());
                $$ = quote; 
        }
index 680b616fe191fe2557d16b6a95d8b992af50c740..8439e5698fe865ce8646a0596cabeff5dcff173e 100644 (file)
@@ -79,16 +79,7 @@ binsearch_scm_vector (SCM vec, SCM key, bool (*is_less)(SCM a,SCM b))
 void
 Quote_iterator::construct_children ()
 {
-  SCM tab = get_outlet()->get_property ("quotes");
-  if (scm_hash_table_p (tab) != SCM_BOOL_T)
-    {
-      get_music ()->origin ()->warning ("Context property `quotes' unset; cannot process quote.");
-      return ;
-    }
-
-  SCM name = get_music ()->get_mus_property ("quoted-name");
   SCM dur = get_music ()->get_mus_property ("duration");
-
   if (!unsmob_duration (dur))
     return ;
 
@@ -98,16 +89,13 @@ Quote_iterator::construct_children ()
   Moment stop = now + unsmob_duration (dur)->get_length ();
 
   start_moment_ = now;
-  
-  event_vector_ = scm_hash_ref (tab, name, SCM_BOOL_F);
+  event_vector_ = get_music ()->get_mus_property ("quoted-events");
 
   if (scm_vector_p (event_vector_) == SCM_BOOL_T)
     {
       event_idx_ = binsearch_scm_vector (event_vector_, now.smobbed_copy (), &moment_less);
       end_idx_ = binsearch_scm_vector (event_vector_, stop.smobbed_copy (), &moment_less);
     }
-  else
-    get_music ()->origin ()->warning ("Can't find requested source");
 }
 
 
index f033680d3b6d296960a13a80be52906263cab394..e7cc07e34fb9c40ef59ac0c447446ff13bc8e218 100644 (file)
@@ -80,8 +80,8 @@ For chord inversions, this is negative.")
                "The function to run with \\applycontext. It must take a single argument, being the context.")
      (property-operations ,list?
                          "Do these operations for instantiating the context.")
-     (predicate ,procedure? "the predicate of a \\outputproperty")
-     (quoted-name ,string? "The name of the voice to be quoted")
+     (predicate ,procedure? "the predicate of a \\outputproperty.")
+     (quoted-events ,vector? "A vector of with moment/event-list entries.")
      (type ,symbol? "The type of this music object. Determines iteration in some cases.")
      (types ,list? "The types of this music
 object; determines by what engraver this music expression is