]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/request.hh
release: 1.3.93
[lilypond.git] / lily / include / request.hh
index eab7b2d8b07de1fb3328bb37a477f3cc5ad0b7ec..f1cd68f48301f949e49e364fe264b87f3617b159 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #ifndef REQUEST_HH
 #include "music.hh"
 #include "direction.hh"
 
-#define DEFAULTACCESSOR(T)  virtual T *access_ ## T () { return 0; }
 
+/** An atom of musical information.  This is an abstract class for any
+  piece of music that does not contain other Music.
+  
+  Hungarian postfix: req
 
-/**
-   An atom of musical information .
- Hungarian postfix: req
- @see lilygut manpage
  */
 class Request : public Music {
-
 public:
-    
-  /* *************** */
-
-  virtual ~Request(){}
-
-  DECLARE_MY_RUNTIME_TYPEINFO;
-  VIRTUAL_COPY_CONS(Request,Music);
-    
-  virtual MInterval time_int() const;
-  virtual Moment duration() const { return 0; }
-
-  /*  accessors for children
-      maybe checkout RTTI
-  */
-
-  DEFAULTACCESSOR(Barcheck_req)
-  DEFAULTACCESSOR(Script_req)
-  DEFAULTACCESSOR(Span_req)
-  DEFAULTACCESSOR(Spacing_req)
-  DEFAULTACCESSOR(Musical_req)
-  DEFAULTACCESSOR(Command_req)
-    
-  bool equal_b (Request*) const;
+  VIRTUAL_COPY_CONS(Music);
+  bool equal_b (Request const*) const;
 protected:
-  virtual bool do_equal_b (Request*) const;
-  virtual void do_print() const;
+  virtual bool do_equal_b (Request const*) const;
+
 };
 
 
-#define REQUESTMETHODS(T)      \
-virtual T * access_ ## T() { return this;}\
-DECLARE_MY_RUNTIME_TYPEINFO;\
-VIRTUAL_COPY_CONS(T, Request);\
-virtual void do_print() const
 
+class Script_req : public virtual Request
+{
+public:
+  Direction dir_;
+  void set_direction (Direction d ) { dir_ =  d; }
+  Direction get_direction () const { return dir_; }
 
+  VIRTUAL_COPY_CONS(Music);
+  Script_req ();
+};
 
-/** 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 { 
+/**
+  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:
-  Direction dir_;
-  General_script_def *scriptdef_p_;
+  /// should the spanner start or stop, or is it unwanted?
+  Direction span_dir_;
+  String span_type_str_;
   
-  bool do_equal_b (Request*) const;
+  Span_req();
+protected:
+  virtual bool do_equal_b (Request const*) const;
+
+  VIRTUAL_COPY_CONS(Music);
+};
 
-  Script_req();
-  REQUESTMETHODS(Script_req);
-  ~Script_req();
-  Script_req (Script_req const&);
+/**
+  Start a tie at this note, end it at the next
+ */
+class Tie_req : public Request {
+public:
+  VIRTUAL_COPY_CONS(Music);
 };
 
-    
 #endif