source file of the GNU LilyPond music typesetter
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--2002 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();
- virtual Request* clone() const { return new Request(*this); }
- void print()const ;
-
- 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 Script_req *script() { return 0;}
- virtual Text_req*text() { return 0; }
- virtual Rest_req *rest() { return 0; }
- virtual Span_req *span() { 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; }
+ Request ();
+ VIRTUAL_COPY_CONS (Music);
+ bool equal_b (Request const*) const;
protected:
- virtual void do_print()const ;
+ virtual bool do_equal_b (Request const*) const;
+
};
-#define REQUESTMETHODS(T,accessor) \
-virtual T * accessor() { return this;}\
-NAME_MEMBERS();\
-VIRTUAL_COPY_CONS(T, Request)\
-virtual void do_print() const
+class Script_req : public virtual Request
+{
+public:
+ void set_direction (Direction d);
+ Direction get_direction () const;
+ 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:
+ String get_span_type_str () const;
+ void set_span_type_str (String);
+ void set_span_dir (Direction d);
+ Direction get_span_dir () const;
+
+ Span_req ();
+protected:
+
+ virtual bool do_equal_b (Request const*) const;
+
+ VIRTUAL_COPY_CONS (Music);
+};
+
+/**
+ Start a tie at this note, end it at the next
+ */
+class Tie_req : public Request {
public:
- int dir_i_;
- General_script_def *scriptdef_p_;
-
- /* *************** */
- static int compare(const Script_req &, const Script_req &);
- Script_req();
- REQUESTMETHODS(Script_req,script);
- ~Script_req();
- Script_req(Script_req const&);
+ VIRTUAL_COPY_CONS (Music);
};
-
#endif