]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/context-specced-music-iterator.cc (class
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 28 Sep 2002 21:02:25 +0000 (21:02 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 28 Sep 2002 21:02:25 +0000 (21:02 +0000)
Context_specced_music_iterator): new file. Obsoletes the
Context_specced_music type.

* scm/music-types.scm (make-repeated-music): put different kinds
of repeated music into music-type table.

12 files changed:
ChangeLog
lily/command-request.cc [deleted file]
lily/context-specced-music.cc [deleted file]
lily/include/context-specced-music.hh [deleted file]
lily/include/key-item.hh [deleted file]
lily/include/line-of-score.hh [deleted file]
lily/include/tuplet-spanner.hh [deleted file]
lily/music-iterator.cc
lily/musical-request.cc [deleted file]
lily/parser.yy
scm/music-functions.scm
scm/music-types.scm

index 6837226ed31d1355963b734627440dede5f1d48d..6d555e324949858b7177d99862bcaa6ada85f884 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2002-09-28  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * lily/context-specced-music-iterator.cc (class
+       Context_specced_music_iterator): new file. Obsoletes the
+       Context_specced_music type.
+
+       * scm/music-types.scm (make-repeated-music): put different kinds
+       of repeated music into music-type table.
+
+       * VERSION: 1.7.1 released.
+
        * scm/to-xml.scm: new file.
 
        * input/test/to-xml.ly (fooBar): demo of what is possible with the
diff --git a/lily/command-request.cc b/lily/command-request.cc
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/lily/context-specced-music.cc b/lily/context-specced-music.cc
deleted file mode 100644 (file)
index 333b747..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*   
-  context-specced-music.cc --  implement Context_specced_music
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 1999--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-#include "context-specced-music.hh"
-
-
-Context_specced_music::Context_specced_music ()
-{
-}
-
-ADD_MUSIC (Context_specced_music);
diff --git a/lily/include/context-specced-music.hh b/lily/include/context-specced-music.hh
deleted file mode 100644 (file)
index e1ca431..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*   
-  context-specced-music.hh -- declare Context_specced_music
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 1999--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-
-#ifndef CONTEXT_SPECCED_MUSIC_HH
-#define CONTEXT_SPECCED_MUSIC_HH
-
-#include "music-wrapper.hh"
-
-class Context_specced_music : public Music_wrapper
-{
-public:
-  Context_specced_music ();
-  Context_specced_music (SCM);
-  VIRTUAL_COPY_CONS (Music);
-};
-#endif /* CONTEXT_SPECCED_MUSIC_HH */
-
diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh
deleted file mode 100644 (file)
index 65296f8..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-#error
diff --git a/lily/include/line-of-score.hh b/lily/include/line-of-score.hh
deleted file mode 100644 (file)
index 65296f8..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-#error
diff --git a/lily/include/tuplet-spanner.hh b/lily/include/tuplet-spanner.hh
deleted file mode 100644 (file)
index 65296f8..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-#error
index a6d2a721a44c6b8cc7a95a22bcea03c5ae16692f..51aba71a782030a7ab1d4e4a767776c629eae5ba 100644 (file)
@@ -15,7 +15,6 @@
 #include "music-wrapper.hh"
 #include "music-wrapper-iterator.hh"
 #include "simple-music-iterator.hh"
-#include "context-specced-music.hh"
 
 #include "ly-smobs.icc"
 
@@ -131,25 +130,6 @@ Music_iterator::init_translator (Music *m, Translator_group *report)
 {
   music_ = m;
   assert (m);
-  if (Context_specced_music * csm =dynamic_cast<Context_specced_music *> (m))
-    {
-      SCM ct = csm->get_mus_property ("context-type");
-      String c_type;
-      if (gh_string_p (ct))
-         c_type =  ly_scm2string (ct);
-      
-      String c_id;
-      SCM ci = csm->get_mus_property ("context-id");
-      if (gh_string_p (ci))
-       c_id = ly_scm2string (ci);
-      
-      Translator_group* a
-       =report->find_create_translator (c_type, c_id);
-
-      set_translator (a);
-      
-    }
-
   if (! report_to ())
     set_translator (report);
 }
diff --git a/lily/musical-request.cc b/lily/musical-request.cc
deleted file mode 100644 (file)
index e69de29..0000000
index 03ad89173278691038daa74b8a5001fcb7f58178..68dae701247dde661e1b6257fbbc930e24897ec1 100644 (file)
@@ -729,8 +729,15 @@ Repeated_music:
                    _("More alternatives than repeats.  Junking excess alternatives."));
                  alts = ly_truncate_list (times, alts);
                }
-               
-               Music *r = MY_MAKE_MUSIC("RepeatedMusic");
+
+
+               static SCM proc;
+               if (!proc)
+                       proc = scm_c_eval_string ("make-repeated-music");
+
+               SCM mus = scm_call_1 (proc, $2);
+               scm_gc_protect_object (mus); // UGH. 
+               Music *r =unsmob_music (mus);
                if (beg)
                        {
                        r-> set_mus_property ("element", beg->self_scm ());
@@ -739,9 +746,6 @@ Repeated_music:
                r->set_mus_property ("repeat-count", gh_int2scm (times >? 1));
 
                r-> set_mus_property ("elements",alts);
-               SCM func = scm_primitive_eval (ly_symbol2scm ("repeat-name-to-ctor"));
-               SCM result = gh_call1 (func, $2);
-
                if (gh_equal_p ($2, scm_makfrom0str ("tremolo")))
                {
                /*
@@ -754,9 +758,6 @@ Repeated_music:
                        else
                          gh_call3 (func, r->self_scm (), gh_int2scm(-intlog2 ($3)), gh_int2scm(0));
                }
-
-               set_music_properties (r, result);
-
                r->set_spot (*$4->origin ());
 
                $$ = r;
index 8c0476ce1d3434dd347ef2ef64703e4b4a6a238a..4132342c2becaf686c121b3ab6c6a1447d72e1e4 100644 (file)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; repeats.
 
-(define-public (repeat-name-to-ctor name)
-  (let*
-      ((supported-reps
-       `(("volta" . ((iterator-ctor . ,Volta_repeat_iterator::constructor)
-                     (start-moment-function .  ,Repeated_music::first_start)
-                     (length . ,Repeated_music::volta_music_length)))
-         
-           ("unfold" . ((iterator-ctor . ,Unfolded_repeat_iterator::constructor)
-                        (start-moment-function .  ,Repeated_music::first_start)                         
-                        (length . ,Repeated_music::unfolded_music_length)))
-           ("fold" . ((iterator-ctor  . ,Folded_repeat_iterator::constructor)
-                      (start-moment-function .  ,Repeated_music::minimum_start)                         
-                      (length . ,Repeated_music::folded_music_length)))
-           ("percent" . ((iterator-ctor . ,Percent_repeat_iterator::constructor)
-                         (start-moment-function .  ,Repeated_music::first_start)
-                         (length . ,Repeated_music::unfolded_music_length)))
-           ("tremolo" . ((iterator-ctor . ,Chord_tremolo_iterator::constructor)
-                         (start-moment-function .  ,Repeated_music::first_start)
-
-                         ;; the length of the repeat is handled by shifting the note logs
-                         (length . ,Repeated_music::folded_music_length)))))
-         
-       (handle (assoc name supported-reps)))
-
-    (if (pair? handle)
-       (cdr handle)
-       (begin
-         (ly-warn
-          (string-append "Unknown repeat type `" name "'\nSee scm/c++.scm for supported repeats"))
-         '(type . 'repeated-music)))))
-
 (define-public (unfold-repeats music)
 "
 This function replaces all repeats  with unfold repeats. It was 
index e3a6c5a7177d24886c58eb81d94f9eb99614129f..ef08c59fd4505f2ae7b4ac4467d124052fe8c61e 100644 (file)
@@ -35,8 +35,7 @@
        ))
      (BarCheck
       . (
-       (description .  "")
-
+        (description .  "")
         (internal-class-name . "Music")
         (types . (general-music bar-check))
         (iterator-ctor . ,Bar_check_iterator::constructor)
@@ -79,8 +78,8 @@
     (ContextSpeccedMusic
      . (
        (description .  "")
-
-       (internal-class-name . "Context_specced_music")
+       (iterator-ctor . ,Context_specced_music_iterator::constructor)
+       (internal-class-name . "Music_wrapper")
        (types . (context-specification general-music music-wrapper-music))
        ))
    (CrescendoEvent
      . (
        (description .  "")
 
-       (internal-class-name . "Repeated_music")
        (type .  repeated-music)
        (types . (general-music repeated-music))
        ))
         (internal-class-name . "Music")
         (types . (separator general-music))
         ))
-    
-    ))
+
+     (VoltaRepeatedMusic
+      . (
+        (iterator-ctor . ,Volta_repeat_iterator::constructor)
+        (internal-class-name . "Repeated_music")
+        (description . "")
+        (start-moment-function .  ,Repeated_music::first_start)
+        (length . ,Repeated_music::volta_music_length)
+        (types . (general-music repeated-music volta-repeated-music))
+        ))
+      
+     (UnfoldedRepeatedMusic
+      . (
+        (iterator-ctor . ,Unfolded_repeat_iterator::constructor)
+        (description .  "")
+        (start-moment-function .  ,Repeated_music::first_start)
+        (internal-class-name . "Repeated_music")
+        (types . (general-music repeated-music unfolded-repeated-music))
+        (length . ,Repeated_music::unfolded_music_length)
+        ))
+     (PercentRepeatedMusic
+      . (
+        (internal-class-name . "Repeated_music")
+        (description .  "")
+        (iterator-ctor . ,Percent_repeat_iterator::constructor)
+        (start-moment-function .  ,Repeated_music::first_start)
+        (length . ,Repeated_music::unfolded_music_length)
+        (types . (general-music repeated-music percent-repeated-music))
+        ))
+     
+     (TremoloRepeteadMusic
+      . (
+        (iterator-ctor . ,Chord_tremolo_iterator::constructor)
+        (description .  "")
+        (internal-class-name . "Repeated_music")
+        (start-moment-function .  ,Repeated_music::first_start)
+
+        ;; the length of the repeat is handled by shifting the note logs
+        (length . ,Repeated_music::folded_music_length)
+        (types . (general-music repeated-music tremolo-repeated-music))
+        
+        ))
+     (FoldedRepeatedMusic
+      . (
+        (internal-class-name . "Repeated_music")
+        (description .  "")
+        (iterator-ctor  . ,Folded_repeat_iterator::constructor)
+        (start-moment-function .  ,Repeated_music::minimum_start)
+        (length . ,Repeated_music::folded_music_length)
+        (types . (general-music repeated-music folded-repeated-music))
+        ))
+     ))
 
 (set! music-descriptions
       (sort music-descriptions alist<?))
        (make-music-by-name (cdr entry))
        )
   ))
+
+(define-public (make-repeated-music name)
+  (let*
+      (
+       (handle (assoc
+               name
+               '(("volta" . VoltaRepeatedMusic)
+                 ("unfold" . UnfoldedRepeatedMusic)
+                 ("percent" . PercentRepeatedMusic)
+                 ("tremolo" . TremoloRepeteadMusic)
+                 ("fold" . FoldedRepeatedMusic)
+                 )))
+       (music-name
+       (if (pair? handle)
+           (cdr handle)
+           (begin
+             (ly-warn
+              (string-append "Unknown repeat type `" name
+                             "'\nSee music-types.scm for supported repeats"))
+             'VoltaRepeatedMusic)
+           )
+       )
+       )
+
+       (make-music-by-name music-name)
+    ))
+