/*
- command-request.hh -- declare Non musical requests
+ command-request.hh -- declare non-musical requests
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#define COMMANDREQUEST_HH
#include "request.hh"
-#include "varray.hh"
-
-/** Request which are assumed to be "happening" before the
- musical requests. */
-struct Command_req : virtual Request {
- REQUESTMETHODS(Command_req, command);
-
- virtual Measure_grouping_req * measuregrouping() { return 0; }
- virtual Clef_change_req * clefchange() { return 0; }
- virtual Key_change_req * keychange() { return 0; }
- virtual Partial_measure_req * partial() { return 0; }
- virtual Meter_change_req * meterchange() { return 0; }
- virtual Bar_req *bar() { return 0; }
- virtual Cadenza_req *cadenza() { return 0; }
- virtual Timing_req*timing() { return 0; }
+#include "array.hh"
+#include "duration.hh"
+#include "musical-pitch.hh"
+#include "key-def.hh"
+
+class Break_req : public Request {
+public:
+ enum { DISALLOW = -10000, FORCE = 10000 };
+ int penalty_i_;
+ Break_req ();
+protected:
+ VIRTUAL_COPY_CONS(Music);
+};
+
+class Mark_req : public Request {
+public:
+ Mark_req (String);
+ String str_;
+protected:
+ virtual void do_print () const;
+ VIRTUAL_COPY_CONS(Music);
};
-/** Baseclass for meter/partial req. It has to be handled by
+/** Baseclass for time_signature/partial req. It has to be handled by
Staff_{walker,column} baseclass. */
-struct Timing_req : Command_req {
- REQUESTMETHODS(Timing_req, timing);
+class Timing_req : public Request {
+public:
+ VIRTUAL_COPY_CONS(Music);
};
-struct Partial_measure_req : Timing_req {
- Moment duration_;
+class Tempo_req : public Timing_req
+{
+public:
+ Duration dur_;
+ int metronome_i_;
+
+ Tempo_req();
+protected:
+ virtual void do_print () const;
+ VIRTUAL_COPY_CONS(Music);
+ bool do_equal_b (Request const *) const;
+};
+
+class Partial_measure_req : public Timing_req {
+public:
+ Moment length_mom_;
- Partial_measure_req(Moment);
- REQUESTMETHODS(Partial_measure_req, partial);
+ Partial_measure_req (Moment);
+protected:
+ VIRTUAL_COPY_CONS(Music);
+ virtual void do_print () const;
+ bool do_equal_b (Request const *) const;
};
/**
- todo: allow C meter
+ todo: allow C time_signature
*/
-struct Meter_change_req : Timing_req {
- int beats_i_, one_beat_i_;
-
- Meter_change_req();
- void set(int,int);
- REQUESTMETHODS(Meter_change_req, meterchange);
+class Time_signature_change_req : public Timing_req {
+public:
+ int beats_i_;
+ int one_beat_i_;
+
+ Time_signature_change_req();
+protected:
+ virtual void do_print () const;
+ bool do_equal_b (Request const *) const;
+ VIRTUAL_COPY_CONS(Music);
};
/// toggle Cadenza mode
-struct Cadenza_req : Timing_req {
- /// turn on?
- bool on_b_;
- Cadenza_req(bool);
- REQUESTMETHODS(Cadenza_req,cadenza);
+class Cadenza_req : public Timing_req {
+public:
+ /// turn on?
+ bool on_b_;
+ Cadenza_req (bool);
+protected:
+ virtual void do_print () const;
+
+ bool do_equal_b (Request const *) const;
+ VIRTUAL_COPY_CONS(Music);
};
/// check if we're at start of a measure.
-struct Barcheck_req : Timing_req {
-
- REQUESTMETHODS(Barcheck_req,barcheck);
+class Barcheck_req : public Timing_req {
+public:
+ bool do_equal_b (Request const *) const;
+ VIRTUAL_COPY_CONS(Music);
};
-struct Measure_grouping_req: Timing_req {
- Array<int> beat_i_arr_;
- Array<Moment> elt_length_arr_;
-
- REQUESTMETHODS(Measure_grouping_req, measuregrouping);
-};
-
-struct Group_change_req : Command_req {
- String newgroup_str_;
- REQUESTMETHODS(Group_change_req, groupchange);
-};
/** draw a (repeat)-bar. This something different than #Barcheck_req#,
the latter should only happen at the start of a measure. */
-struct Bar_req : Command_req {
- String type_str_;
- Bar_req(String);
- int compare(const Bar_req&)const;
- REQUESTMETHODS(Bar_req,bar);
-};
-struct Terminate_voice_req : Command_req {
- REQUESTMETHODS(Terminate_voice_req,terminate);
+class Bar_req : public Request {
+public:
+ String type_str_;
+ Bar_req (String);
+protected:
+ virtual void do_print () const;
+ bool do_equal_b (Request const *) const;
+
+ VIRTUAL_COPY_CONS(Music);
};
-struct Group_feature_req : Command_req {
- int stemdir_i_;
- Group_feature_req();
- REQUESTMETHODS(Group_feature_req, groupfeature);
+class Breathing_sign_req : public Request {
+ VIRTUAL_COPY_CONS(Music);
};
-
-struct Key_change_req : Command_req {
- Array<Melodic_req*> melodic_p_arr_;
-
- Key_change_req();
- Key_change_req(Key_change_req const&);
- ~Key_change_req();
- REQUESTMETHODS(Key_change_req, keychange);
+/**
+ Handle key changes.
+ Routines for sharps and flats are separated,
+ so that caller may identify non-conventional keys.
+*/
+class Key_change_req : public Request
+{
+public:
+ Key_change_req ();
+ Key_def key_;
+
+protected:
+ VIRTUAL_COPY_CONS(Music);
+ void transpose (Musical_pitch d);
+ virtual void do_print () const;
};
-struct Clef_change_req : Command_req {
- String clef_str_;
- Clef_change_req(String);
- REQUESTMETHODS(Clef_change_req, clefchange);
+class Clef_change_req : public Request {
+public:
+ String clef_str_;
+ Clef_change_req (String);
+protected:
+ virtual void do_print () const;
+ VIRTUAL_COPY_CONS(Music);
};
+
#endif // COMMANDREQUEST_HH