]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/request.hh
release: 1.1.1
[lilypond.git] / lily / include / request.hh
index f045b36204aa810c2d3524ee4a62dd00848ab7d9..4394fce306e9e37fd7ba461f0c78275b63b9d4ab 100644 (file)
@@ -3,69 +3,83 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #ifndef REQUEST_HH
 #define REQUEST_HH
-// GNU LilyPond's second egg of columbus!
 
-#include "glob.hh"
+
 #include "string.hh"
 #include "moment.hh"
 #include "virtual-methods.hh"
 #include "input.hh"
+#include "music.hh"
+#include "direction.hh"
+
+
+/** An atom of musical information.  This is an abstract class for any
+  piece of music that does not contain other Music.
+  
+  Hungarian postfix: req
 
-/**
- a voice element wants something printed.
- Hungarian postfix: req
- @see lilygut manpage
  */
-class Request : public Input {
+class Request : public Music {
+
 public:
-    Voice_element*elt_l_;
     
-    /* *************** */
-    Voice  * voice_l();
-    Request();
-    Request(Request const&);
-    virtual ~Request(){}
-
-    NAME_MEMBERS(Request);
-    virtual Request* clone() const { return new Request(*this); }
-    void print()const ;
+  virtual ~Request(){}
+
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  VIRTUAL_COPY_CONS(Request,Music);
     
-    virtual void transpose(Melodic_req const &){}
-    virtual Moment duration() const { return 0; }
-
-    /*  accessors for children
-       maybe checkout RTTI
-     */
-    virtual Barcheck_req *barcheck() { return 0; }
-    virtual Note_req *note() { return 0;}
-    virtual Script_req *script() { return 0;}
-    virtual Stem_req *stem() { return 0;}
-    virtual Text_req*text() { return 0; }
-    virtual Rest_req *rest() { return 0; }
-    virtual Span_req *span() { return 0; }
-    virtual Beam_req *beam() { return 0 ; }
-    virtual Plet_req* plet() { return 0; }
-    virtual Slur_req *slur() { return 0 ; }
-    virtual Rhythmic_req*rhythmic() { return 0; }
-    virtual Lyric_req* lreq_l() { return 0; }
-    virtual Melodic_req *melodic() { return 0; }
-     virtual Spacing_req * spacing() { return 0; }
-    virtual Blank_req * blank() { return 0; }
-    virtual Musical_req *musical() { return 0; }
-    virtual Command_req * command() { return 0; }
+  bool equal_b (Request*) const;
 protected:
-    virtual void do_print()const ;
+  virtual bool do_equal_b (Request*) const;
+  virtual void do_print() const;
 };
 
-#define REQUESTMETHODS(T,accessor)     \
-virtual T * accessor() { return this;}\
-NAME_MEMBERS(T);\
-VIRTUAL_COPY_CONS(T, Request)\
+
+#define REQUESTMETHODS(T)      \
+DECLARE_MY_RUNTIME_TYPEINFO;\
+VIRTUAL_COPY_CONS(T, Request);\
 virtual void do_print() const
 
+
+
+/** Put a script above or below this ``note'' or bar. eg upbow, downbow. Why
+  a request? These symbols may conflict with slurs and brackets, so
+  this also a request */
+
+class Script_req  : public virtual Request { 
+public:
+  Direction dir_;
+  General_script_def *scriptdef_p_;
+  
+  bool do_equal_b (Request*) const;
+
+  Script_req();
+  REQUESTMETHODS(Script_req);
+  ~Script_req();
+  Script_req (Script_req const&);
+};
+
+
+/**
+  Requests to start or stop something.
+ This type of request typically results in the creation of a #Spanner#
+*/
+class Span_req  : public virtual Request  {
+public:
+  /// should the spanner start or stop, or is it unwanted?
+  enum Spantype {
+    NOSPAN, START, STOP
+  } spantype;
+  bool do_equal_b (Request*) const;
+  REQUESTMETHODS(Span_req);
+
+  Span_req();
+};
+
+
 #endif