X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fcommand-request.hh;h=81990b4f3f29f864aa343c42aeff569b068536e1;hb=aad5ddf9162f3ee43f74a8e108324f3959f2f9c0;hp=3c257b67f193684103fe4514a43d29cb40decc52;hpb=79511c44a27908a1beaed25bbcac8d95a8a6b7c8;p=lilypond.git diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 3c257b67f1..81990b4f3f 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -1,9 +1,9 @@ /* - 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 + (c) 1997--1998 Han-Wen Nienhuys */ @@ -11,106 +11,121 @@ #define COMMANDREQUEST_HH #include "request.hh" -#include "varray.hh" +#include "array.hh" +#include "duration.hh" +#include "musical-pitch.hh" /** Request which are assumed to be "happening" before the - musical requests. */ + musical requests. Not coupled to a note or rest. */ class Command_req : public virtual Request { public: - REQUESTMETHODS(Command_req, command); - virtual Terminate_voice_req *terminate() {return 0;} - virtual Group_change_req * groupchange() { return 0;} - 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 Timing_req*timing() { return 0; } + REQUESTMETHODS(Command_req); + +}; + + +class Break_req : public Command_req { +public: + enum { DISALLOW = -10000, FORCE = 10000 }; + int penalty_i_; + Break_req (); + REQUESTMETHODS (Break_req); +}; + +class Mark_req : public Command_req { +public: + Mark_req (String); + String str_; + REQUESTMETHODS (Mark_req); }; +class Command_script_req : public Command_req, public Script_req { +public: + // huh? + Command_script_req(); + ~Command_script_req(); + REQUESTMETHODS(Command_script_req); +}; + +class Command_tie_req : public Command_req { +public: + REQUESTMETHODS(Command_tie_req); +}; -/** 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 { public: - REQUESTMETHODS(Timing_req, timing); + REQUESTMETHODS(Timing_req); }; +class Tempo_req : public Timing_req +{ +public: + Duration dur_; + int metronome_i_; + + Tempo_req(); + REQUESTMETHODS(Tempo_req); + bool do_equal_b (Request *) const; +}; + class Partial_measure_req : public Timing_req { public: - Moment duration_; + Moment duration_; - Partial_measure_req(Moment); - REQUESTMETHODS(Partial_measure_req, partial); + Partial_measure_req (Moment); + REQUESTMETHODS(Partial_measure_req); + 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_; + int beats_i_, one_beat_i_; - int compare(Meter_change_req const&); - Meter_change_req(); - void set(int,int); - REQUESTMETHODS(Meter_change_req, meterchange); + Time_signature_change_req(); + bool do_equal_b (Request*) const; + REQUESTMETHODS(Time_signature_change_req); }; /// toggle Cadenza mode class Cadenza_req : public Timing_req { public: - /// turn on? - bool on_b_; - Cadenza_req(bool); - REQUESTMETHODS(Cadenza_req,cadenza); + /// turn on? + bool on_b_; + bool do_equal_b (Request*) const; + Cadenza_req (bool); + REQUESTMETHODS(Cadenza_req); }; /// check if we're at start of a measure. class Barcheck_req : public Timing_req { public: - - REQUESTMETHODS(Barcheck_req,barcheck); + bool do_equal_b (Request *) const; + REQUESTMETHODS(Barcheck_req); }; class Measure_grouping_req : public Timing_req { public: - Array beat_i_arr_; - Array elt_length_arr_; - - REQUESTMETHODS(Measure_grouping_req, measuregrouping); -}; - -class Group_change_req : public Command_req { -public: - String newgroup_str_; - REQUESTMETHODS(Group_change_req, groupchange); + Array beat_i_arr_; + Array elt_length_arr_; + bool do_equal_b (Request *) const; + REQUESTMETHODS(Measure_grouping_req); }; /** 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 { public: - String type_str_; - Bar_req(String); - int compare(const Bar_req&)const; - REQUESTMETHODS(Bar_req,bar); -}; -class Terminate_voice_req : public Command_req { -public: - REQUESTMETHODS(Terminate_voice_req,terminate); -}; + String type_str_; + Bar_req (String); + bool do_equal_b (Request*) const; -class Group_feature_req : public Command_req { -public: - int stemdir_i_; - Group_feature_req(); - REQUESTMETHODS(Group_feature_req, groupfeature); + REQUESTMETHODS(Bar_req); }; @@ -121,34 +136,37 @@ public: */ class Key_change_req : public Command_req { public: - Array melodic_p_arr_; - bool minor_b_; + Array pitch_arr_; + int modality_i_; + bool ordinary_key_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); + Key_change_req(); + REQUESTMETHODS(Key_change_req); - /// squash the octaves to 1 - void squash_octaves(); - /// return number of flats in key - int flats_i(); + /// 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(); + /// return number of sharps in key + int sharps_i(); - void transpose(Melodic_req const & d) const; - /// is minor key? - int minor_b(); + void transpose (Musical_pitch d); + bool minor_b() const; }; class Clef_change_req : public Command_req { public: - String clef_str_; - Clef_change_req(String); - REQUESTMETHODS(Clef_change_req, clefchange); + String clef_str_; + Clef_change_req (String); + REQUESTMETHODS(Clef_change_req); }; +class Bracket_req : public Span_req, public Command_req { + +public: + REQUESTMETHODS(Bracket_req); +}; + + #endif // COMMANDREQUEST_HH