]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/request.cc
parse scm fixes
[lilypond.git] / lily / request.cc
index 36589b64554f4a81c9c06def26310233f05f986f..5b0911a2dab71ece99fc16f4df5c02d3cc7c993c 100644 (file)
@@ -3,41 +3,64 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c) 1996--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "request.hh"
-#include "debug.hh"
+#include "warn.hh"
 
+bool
+Request::equal_b (Request const* r) const
+{
+  return r->do_equal_b (this) || this->do_equal_b (r) ;
+}
 
-IMPLEMENT_IS_TYPE_B1(Request,Music);
+bool
+Request::do_equal_b (Request const*) const
+{
+  return true;
+}
+  
+Request::Request ()
+  : Music (SCM_EOL)
+{
+  set_mus_property ("type", ly_symbol2scm ("request"));
+}
 
-void
-Request::do_print() const
+Script_req::Script_req ()
 {
+  set_direction (CENTER);
 }
 
-MInterval
-Request::time_int() const
+void
+Script_req::set_direction (Direction d)
 {
-    return MInterval(0, duration());
+  set_mus_property ("direction", gh_int2scm (d));
 }
 
+Direction
+Script_req::get_direction () const
+{
+  SCM d = get_mus_property ("direction");
+
+  return (ly_dir_p (d)) ?  to_dir (d) : CENTER;
+}
 
-bool
-Request::equal_b(Request *r)const
+Direction
+Span_req::get_span_dir () const
 {
-    if ( is_type_b ( r->name() ) )
-       return r->do_equal_b( (Request*)this );
-    if ( r->is_type_b( name ()))
-       return do_equal_b( r );
-        
-    return false;
+  SCM d = get_mus_property ("span-direction");
+
+  return (ly_dir_p (d)) ?  to_dir (d) : CENTER;
 }
 
-bool
-Request::do_equal_b(Request*)const
+void
+Span_req::set_span_dir (Direction d)
 {
-    return false;
+  set_mus_property ("span-direction", gh_int2scm (d));
 }
-    
+
+
+
+
+