X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fcommand-request.hh;h=f8755a92dbc16cd7a9e9393fc383e0c01b94c5f1;hb=b0064942493df77833e6e41e05d362850f4874b0;hp=848d4d9e43c58149a3e069070c51c518700a9ca4;hpb=2862b1027f316a2f0444fa92e441ee28acf7a463;p=lilypond.git diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 848d4d9e43..f8755a92db 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997 Han-Wen Nienhuys + (c) 1997--2000 Han-Wen Nienhuys */ @@ -11,164 +11,119 @@ #define COMMANDREQUEST_HH #include "request.hh" -#include "varray.hh" +#include "array.hh" #include "duration.hh" +#include "musical-pitch.hh" +#include "key-def.hh" +#include "protected-scm.hh" -/** Request which are assumed to be "happening" before the - musical requests. */ -class Command_req : public virtual Request { +class Break_req : public Request { public: - REQUESTMETHODS(Command_req, command); - virtual Group_feature_req * groupfeature() { return 0; } - 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 Disallow_break_req *disallowbreak() { return 0; } - virtual Timing_req*timing() { return 0; } - virtual Command_script_req*commandscript() { return 0;} + Real penalty_f_; + Break_req (); +protected: + VIRTUAL_COPY_CONS(Music); }; - -class Command_script_req : public Command_req, public Script_req { -public: - // huh? - Command_script_req(); - REQUESTMETHODS(Command_script_req, commandscript); -}; - - -class Disallow_break_req : public Command_req { +class Mark_req : public Request { public: - REQUESTMETHODS(Disallow_break_req, disallowbreak); + Protected_scm mark_label_; +protected: + virtual bool do_equal_b (Request const*) 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. */ -class Timing_req : public Command_req { +class Timing_req : public Request { public: - REQUESTMETHODS(Timing_req, timing); - virtual Tempo_req * tempo(){return 0; } + VIRTUAL_COPY_CONS(Music); }; class Tempo_req : public Timing_req { public: - Duration dur_; - int metronome_i_; - - Tempo_req(); - REQUESTMETHODS(Tempo_req, tempo); - bool do_equal_b (Request *) const; + 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 duration_; - - Partial_measure_req (Moment); - REQUESTMETHODS(Partial_measure_req, partial); - bool do_equal_b (Request*) const; -}; /** - todo: allow C meter + todo: allow C time_signature */ -class Meter_change_req : public Timing_req { +class Time_signature_change_req : public Timing_req { public: - int beats_i_, one_beat_i_; - - Meter_change_req(); - void set (int,int); - bool do_equal_b (Request*) const; - REQUESTMETHODS(Meter_change_req, meterchange); + 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 -class Cadenza_req : public Timing_req { -public: - /// turn on? - bool on_b_; - bool do_equal_b (Request*) const; - Cadenza_req (bool); - REQUESTMETHODS(Cadenza_req,cadenza); -}; /// check if we're at start of a measure. class Barcheck_req : public Timing_req { public: - bool do_equal_b (Request *) const; - REQUESTMETHODS(Barcheck_req,barcheck); + bool do_equal_b (Request const *) const; + VIRTUAL_COPY_CONS(Music); }; -class Measure_grouping_req : public Timing_req { -public: - Array beat_i_arr_; - Array elt_length_arr_; - bool do_equal_b (Request *) const; - REQUESTMETHODS(Measure_grouping_req, measuregrouping); -}; /** draw a (repeat)-bar. This something different than #Barcheck_req#, the latter should only happen at the start of a measure. */ -class Bar_req : public Command_req { +class Bar_req : public Request { public: - String type_str_; - Bar_req (String); - bool do_equal_b (Request*) const; + String type_str_; + Bar_req (String); +protected: + virtual bool do_equal_b (Request const*) const; + virtual void do_print () const; - REQUESTMETHODS(Bar_req,bar); + VIRTUAL_COPY_CONS(Music); }; -class Group_feature_req : public Command_req { -public: - String type_str_; - String value_str_; - - REQUESTMETHODS(Group_feature_req, groupfeature); +class Breathing_sign_req : public Request { + VIRTUAL_COPY_CONS(Music); }; - /** Handle key changes. Routines for sharps and flats are separated, so that caller may identify non-conventional keys. */ -class Key_change_req : public Command_req { +class Key_change_req : public Request +{ public: - Array melodic_p_arr_; - bool minor_b_; - - /// don't ignore the octaves in #melodic_p_arr_#? - bool multi_octave_b_; - Key_change_req(); - Key_change_req (Key_change_req const&); - ~Key_change_req(); - REQUESTMETHODS(Key_change_req, keychange); - - /// squash the octaves to 1 - void squash_octaves(); - /// return number of flats in key - int flats_i(); - - /// return number of sharps in key - int sharps_i(); - - void transpose (Melodic_req const & d) const; - /// is minor key? - int minor_b(); + Key_change_req (); + ~Key_change_req(); + Key_change_req(Key_change_req const &); + Key_def *key_; + +protected: + VIRTUAL_COPY_CONS(Music); + void transpose (Musical_pitch d); + virtual void do_print () const; }; -class Clef_change_req : public Command_req { +class Clef_change_req : public Request { public: - String clef_str_; - Clef_change_req (String); - REQUESTMETHODS(Clef_change_req, clefchange); + String clef_str_; + Clef_change_req (String); +protected: + virtual void do_print () const; + VIRTUAL_COPY_CONS(Music); }; + #endif // COMMANDREQUEST_HH