]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 18 Aug 2005 14:55:12 +0000 (14:55 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 18 Aug 2005 14:55:12 +0000 (14:55 +0000)
input/les-nereides.ly
input/test/engraver-one-by-one.ly
input/test/staff-container.ly
input/test/time-signature-staff.ly
lily/engraver-group-engraver.cc [deleted file]
lily/engraver-group.cc [new file with mode: 0644]
lily/performer-group-performer.cc [deleted file]
lily/performer-group.cc [new file with mode: 0644]
lily/translator-group-ctors.cc

index 73ff6b60de4a2e484b55fa870008aca0114508ae..dea383a68cd9518db8aef51b1258cad80fec2262 100644 (file)
@@ -260,7 +260,7 @@ theScore = \score{
            \remove Bar_number_engraver
         }
        \context {
-           \type "Engraver_group_engraver"
+           \type "Engraver_group"
            \name Dynamics
            \consists "Output_property_engraver"
            minimumVerticalExtent = #'(-1 . 1)
index 47f06bd8591dff165858cf462ab21596bc3d5f00..694f84ac6b9ef814d2e75d1196954104be72c6d2 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.6.0"
+\version "2.7.6"
 \header {
     
 texidoc = "The notation problem, creating a certain symbol,
@@ -32,7 +32,7 @@ Staff context.
 %
 
 MyStaff =\context {
-       \type "Engraver_group_engraver"
+       \type "Engraver_group"
        \name Staff
 
        \description "Handles clefs, bar lines, keys, accidentals.  It can contain
@@ -73,7 +73,7 @@ MyStaff =\context {
 
 
 MyVoice = \context {
-       \type "Engraver_group_engraver"
+       \type "Engraver_group"
        \name Voice
 
 \description "
index 218693bc02ce337fa8f95962faed8d2f36c2fd56..00c13dc796a3f923967d52268d9e968cb9359cfb 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.6.0"
+\version "2.7.6"
 
 \header {
 
@@ -43,7 +43,7 @@ what you would expect.)
            \denies Staff
        }
        \context {
-           \type Engraver_group_engraver
+           \type Engraver_group
            \consists Clef_engraver
            \consists Time_signature_engraver
            \consists Separating_line_group_engraver
index e176c9cc7dd6b74219b92519d0fc106e56aab68d..a58cf37a174f205f7790b709117414d6892305a9 100644 (file)
@@ -6,14 +6,14 @@
   used contemporary pieces with many time signature changes.  "
 
 }
-\version "2.6.0"
+\version "2.7.6"
 \layout {
   raggedright =  ##T
 }
 
 \layout{
   \context { 
-    \type "Engraver_group_engraver"
+    \type "Engraver_group"
     \consists "Time_signature_engraver"
     \consists "Axis_group_engraver"
     \name "TimeSig"
diff --git a/lily/engraver-group-engraver.cc b/lily/engraver-group-engraver.cc
deleted file mode 100644 (file)
index a3a5f99..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-  engraver-group-engraver.cc -- implement Engraver_group
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "engraver-group-engraver.hh"
-
-#include "warn.hh"
-#include "paper-score.hh"
-#include "grob.hh"
-#include "context.hh"
-#include "translator-dispatch-list.hh"
-
-void
-Engraver_group::announce_grob (Grob_info info)
-{
-  announce_infos_.push (info);
-
-  Engraver_group *dad_eng
-    = context_->get_parent_context ()
-    ? dynamic_cast<Engraver_group *> (context_->get_parent_context ()->implementation ())
-    : 0;
-  if (dad_eng)
-    dad_eng->announce_grob (info);
-}
-
-void
-Engraver_group::acknowledge_grobs ()
-{
-  if (!announce_infos_.size ())
-    return;
-
-  SCM name_sym = ly_symbol2scm ("name");
-  SCM meta_sym = ly_symbol2scm ("meta");
-
-  for (int j = 0; j < announce_infos_.size (); j++)
-    {
-      Grob_info info = announce_infos_[j];
-
-      SCM meta = info.grob ()->internal_get_property (meta_sym);
-      SCM nm = scm_assoc (name_sym, meta);
-      if (scm_is_pair (nm))
-       nm = scm_cdr (nm);
-      else
-       continue;
-
-      SCM acklist = scm_hashq_ref (acknowledge_hash_table_, nm, SCM_BOOL_F);
-      Engraver_dispatch_list *dispatch
-       = Engraver_dispatch_list::unsmob (acklist);
-
-      if (acklist == SCM_BOOL_F)
-       {
-         SCM ifaces
-           = scm_cdr (scm_assoc (ly_symbol2scm ("interfaces"), meta));
-         acklist = Engraver_dispatch_list::create (get_simple_trans_list (),
-                                                   ifaces);
-
-         dispatch
-           = Engraver_dispatch_list::unsmob (acklist);
-
-         scm_hashq_set_x (acknowledge_hash_table_, nm, acklist);
-       }
-
-      if (dispatch)
-       dispatch->apply (info);
-    }
-}
-
-/*
-  Ugh. This is slightly expensive. We could/should cache the value of
-  the group count?
-*/
-int
-Engraver_group::pending_grob_count () const
-{
-  int count = announce_infos_.size ();
-  for (SCM s = context_->children_contexts ();
-       scm_is_pair (s); s = scm_cdr (s))
-    {
-      Context *c = unsmob_context (scm_car (s));
-      Engraver_group *group
-       = dynamic_cast<Engraver_group *> (c->implementation ());
-
-      if (group)
-       count += group->pending_grob_count ();
-    }
-  return count;
-}
-
-void
-Engraver_group::do_announces ()
-{
-  do
-    {
-      for (SCM s = context ()->children_contexts ();
-          scm_is_pair (s); s = scm_cdr (s))
-       {
-         Context *c = unsmob_context (scm_car (s));
-         Engraver_group *group
-           = dynamic_cast<Engraver_group *> (c->implementation ());
-         if (group)
-           group->do_announces ();
-       }
-
-      while (1)
-       {
-         precomputed_translator_foreach (PROCESS_ACKNOWLEDGED);
-         if (announce_infos_.size () == 0)
-           break;
-
-         acknowledge_grobs ();
-         announce_infos_.clear ();
-       }
-    }
-  while (pending_grob_count () > 0);
-}
-
-Engraver_group::Engraver_group ()
-{
-  acknowledge_hash_table_ = SCM_EOL;
-  acknowledge_hash_table_ = scm_c_make_hash_table (61);
-}
-
-#include "translator.icc"
-
-ADD_TRANSLATOR_GROUP (Engraver_group,
-                     /* doc */ "A group of engravers taken together",
-                     /* create */ "",
-                     /* accept */ "",
-                     /* read */ "",
-                     /* write */ "");
-
-void
-Engraver_group::derived_mark () const
-{
-  scm_gc_mark (acknowledge_hash_table_);
-}
diff --git a/lily/engraver-group.cc b/lily/engraver-group.cc
new file mode 100644 (file)
index 0000000..a3a5f99
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+  engraver-group-engraver.cc -- implement Engraver_group
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "engraver-group-engraver.hh"
+
+#include "warn.hh"
+#include "paper-score.hh"
+#include "grob.hh"
+#include "context.hh"
+#include "translator-dispatch-list.hh"
+
+void
+Engraver_group::announce_grob (Grob_info info)
+{
+  announce_infos_.push (info);
+
+  Engraver_group *dad_eng
+    = context_->get_parent_context ()
+    ? dynamic_cast<Engraver_group *> (context_->get_parent_context ()->implementation ())
+    : 0;
+  if (dad_eng)
+    dad_eng->announce_grob (info);
+}
+
+void
+Engraver_group::acknowledge_grobs ()
+{
+  if (!announce_infos_.size ())
+    return;
+
+  SCM name_sym = ly_symbol2scm ("name");
+  SCM meta_sym = ly_symbol2scm ("meta");
+
+  for (int j = 0; j < announce_infos_.size (); j++)
+    {
+      Grob_info info = announce_infos_[j];
+
+      SCM meta = info.grob ()->internal_get_property (meta_sym);
+      SCM nm = scm_assoc (name_sym, meta);
+      if (scm_is_pair (nm))
+       nm = scm_cdr (nm);
+      else
+       continue;
+
+      SCM acklist = scm_hashq_ref (acknowledge_hash_table_, nm, SCM_BOOL_F);
+      Engraver_dispatch_list *dispatch
+       = Engraver_dispatch_list::unsmob (acklist);
+
+      if (acklist == SCM_BOOL_F)
+       {
+         SCM ifaces
+           = scm_cdr (scm_assoc (ly_symbol2scm ("interfaces"), meta));
+         acklist = Engraver_dispatch_list::create (get_simple_trans_list (),
+                                                   ifaces);
+
+         dispatch
+           = Engraver_dispatch_list::unsmob (acklist);
+
+         scm_hashq_set_x (acknowledge_hash_table_, nm, acklist);
+       }
+
+      if (dispatch)
+       dispatch->apply (info);
+    }
+}
+
+/*
+  Ugh. This is slightly expensive. We could/should cache the value of
+  the group count?
+*/
+int
+Engraver_group::pending_grob_count () const
+{
+  int count = announce_infos_.size ();
+  for (SCM s = context_->children_contexts ();
+       scm_is_pair (s); s = scm_cdr (s))
+    {
+      Context *c = unsmob_context (scm_car (s));
+      Engraver_group *group
+       = dynamic_cast<Engraver_group *> (c->implementation ());
+
+      if (group)
+       count += group->pending_grob_count ();
+    }
+  return count;
+}
+
+void
+Engraver_group::do_announces ()
+{
+  do
+    {
+      for (SCM s = context ()->children_contexts ();
+          scm_is_pair (s); s = scm_cdr (s))
+       {
+         Context *c = unsmob_context (scm_car (s));
+         Engraver_group *group
+           = dynamic_cast<Engraver_group *> (c->implementation ());
+         if (group)
+           group->do_announces ();
+       }
+
+      while (1)
+       {
+         precomputed_translator_foreach (PROCESS_ACKNOWLEDGED);
+         if (announce_infos_.size () == 0)
+           break;
+
+         acknowledge_grobs ();
+         announce_infos_.clear ();
+       }
+    }
+  while (pending_grob_count () > 0);
+}
+
+Engraver_group::Engraver_group ()
+{
+  acknowledge_hash_table_ = SCM_EOL;
+  acknowledge_hash_table_ = scm_c_make_hash_table (61);
+}
+
+#include "translator.icc"
+
+ADD_TRANSLATOR_GROUP (Engraver_group,
+                     /* doc */ "A group of engravers taken together",
+                     /* create */ "",
+                     /* accept */ "",
+                     /* read */ "",
+                     /* write */ "");
+
+void
+Engraver_group::derived_mark () const
+{
+  scm_gc_mark (acknowledge_hash_table_);
+}
diff --git a/lily/performer-group-performer.cc b/lily/performer-group-performer.cc
deleted file mode 100644 (file)
index ef4a9d8..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-  performer-group-performer.cc -- implement Performer_group
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#include "performer-group-performer.hh"
-
-#include "context.hh"
-#include "audio-element.hh"
-#include "warn.hh"
-
-ADD_TRANSLATOR_GROUP (Performer_group,
-                     /* doc */ "",
-                     /* create */ "",
-                     /* accept */ "",
-                     /* read */ "",
-                     /* write */ "");
-
-void
-Performer_group::announce_element (Audio_element_info info)
-{
-  announce_infos_.push (info);
-  Translator_group *t
-    = context ()->get_parent_context ()->implementation ();
-
-  if (Performer_group *eg = dynamic_cast<Performer_group *> (t))
-    eg->announce_element (info);
-}
-
-void
-Performer_group::acknowledge_audio_elements ()
-{
-  for (int j = 0; j < announce_infos_.size (); j++)
-    {
-      Audio_element_info info = announce_infos_[j];
-
-      for (SCM p = get_simple_trans_list (); scm_is_pair (p); p = scm_cdr (p))
-       {
-         Translator *t = unsmob_translator (scm_car (p));
-         Performer *eng = dynamic_cast<Performer *> (t);
-         if (eng && eng != info.origin_trans_)
-           eng->acknowledge_audio_element (info);
-       }
-    }
-}
-
-void
-performer_each (SCM list, Performer_method method)
-{
-  for (SCM p = list; scm_is_pair (p); p = scm_cdr (p))
-    {
-      Performer *e = dynamic_cast<Performer *> (unsmob_translator (scm_car (p)));
-      if (e)
-       (e->*method) ();
-    }
-}
-
-void
-Performer_group::do_announces ()
-{
-  while (1)
-    {
-      performer_each (get_simple_trans_list (),
-                     &Performer::create_audio_elements);
-
-      if (!announce_infos_.size ())
-       break;
-
-      acknowledge_audio_elements ();
-      announce_infos_.clear ();
-    }
-}
-
-void
-Performer_group::play_element (Audio_element *e)
-{
-  Context *c = context_->get_parent_context ();
-  if (c)
-    {
-      Performer_group *pgp = dynamic_cast<Performer_group *> (c->implementation ());
-      pgp->play_element (e);
-    }
-}
-
-int
-Performer_group::get_tempo () const
-{
-  Context *c = context_->get_parent_context ();
-  if (c)
-    {
-      Performer_group *pgp = dynamic_cast<Performer_group *> (c->implementation ());
-      return pgp->get_tempo ();
-    }
-  return 60;
-}
-
diff --git a/lily/performer-group.cc b/lily/performer-group.cc
new file mode 100644 (file)
index 0000000..ef4a9d8
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+  performer-group-performer.cc -- implement Performer_group
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "performer-group-performer.hh"
+
+#include "context.hh"
+#include "audio-element.hh"
+#include "warn.hh"
+
+ADD_TRANSLATOR_GROUP (Performer_group,
+                     /* doc */ "",
+                     /* create */ "",
+                     /* accept */ "",
+                     /* read */ "",
+                     /* write */ "");
+
+void
+Performer_group::announce_element (Audio_element_info info)
+{
+  announce_infos_.push (info);
+  Translator_group *t
+    = context ()->get_parent_context ()->implementation ();
+
+  if (Performer_group *eg = dynamic_cast<Performer_group *> (t))
+    eg->announce_element (info);
+}
+
+void
+Performer_group::acknowledge_audio_elements ()
+{
+  for (int j = 0; j < announce_infos_.size (); j++)
+    {
+      Audio_element_info info = announce_infos_[j];
+
+      for (SCM p = get_simple_trans_list (); scm_is_pair (p); p = scm_cdr (p))
+       {
+         Translator *t = unsmob_translator (scm_car (p));
+         Performer *eng = dynamic_cast<Performer *> (t);
+         if (eng && eng != info.origin_trans_)
+           eng->acknowledge_audio_element (info);
+       }
+    }
+}
+
+void
+performer_each (SCM list, Performer_method method)
+{
+  for (SCM p = list; scm_is_pair (p); p = scm_cdr (p))
+    {
+      Performer *e = dynamic_cast<Performer *> (unsmob_translator (scm_car (p)));
+      if (e)
+       (e->*method) ();
+    }
+}
+
+void
+Performer_group::do_announces ()
+{
+  while (1)
+    {
+      performer_each (get_simple_trans_list (),
+                     &Performer::create_audio_elements);
+
+      if (!announce_infos_.size ())
+       break;
+
+      acknowledge_audio_elements ();
+      announce_infos_.clear ();
+    }
+}
+
+void
+Performer_group::play_element (Audio_element *e)
+{
+  Context *c = context_->get_parent_context ();
+  if (c)
+    {
+      Performer_group *pgp = dynamic_cast<Performer_group *> (c->implementation ());
+      pgp->play_element (e);
+    }
+}
+
+int
+Performer_group::get_tempo () const
+{
+  Context *c = context_->get_parent_context ();
+  if (c)
+    {
+      Performer_group *pgp = dynamic_cast<Performer_group *> (c->implementation ());
+      return pgp->get_tempo ();
+    }
+  return 60;
+}
+
index 529a60184ba54f5ddc15a53633ec8fed6babe3f6..0f9656d8cd9c242c9b7eb078b9e716c53bade54c 100644 (file)
@@ -11,6 +11,7 @@
 #include "engraver-group-engraver.hh"
 #include "performer-group-performer.hh"
 #include "recording-group-engraver.hh"
+#include "warn.hh"
 
 /*
   Quick & dirty.
@@ -29,6 +30,11 @@ get_translator_group (SCM sym)
   else if (sym == ly_symbol2scm ("Recording_group_engraver"))
     return new Recording_group_engraver ();
 
+  programming_error ("Couldn't find type");
+  scm_flush (scm_current_error_port ());
+  scm_display (sym, scm_current_error_port ());
+  scm_flush (scm_current_error_port ());
+  
   assert (0);
   return 0;
 }