]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.47
authorfred <fred>
Sun, 24 Mar 2002 19:37:51 +0000 (19:37 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:37:51 +0000 (19:37 +0000)
Documentation/examples.pod
lily/include/time-description.hh
lily/time-description.cc

index cd76ca11b49825be2a284ecb3c5c871bcc29f158..580ab8c809596f99d0c94948e6e092e72a01594c 100644 (file)
@@ -12,6 +12,9 @@ each file:
        tested LilyPond features.
        copyright info
 
+Most music distributed with LilyPond was composed a long time ago, and
+do not have copyrights. Any exceptions are mentioned here.
+
 =head2 F<cadenza.ly>
 
 A cadenza to Mozart Horn concerto no. 3. 
@@ -31,7 +34,7 @@ Features: pushgroup, popgroup.
 
 =head2 F<error.ly>
 
-Error messages, context errors.
+Features: Error messages, context errors.
 
 =head2 F<fugue1.midi.ly>
 
index 16ea5c5f14c12ea02d425c5e8e35f5e0630a40cf..1bfd5820e6c2dffb6cad2fc1d54567a48b3f5871 100644 (file)
@@ -37,9 +37,10 @@ struct Time_description {
     String str()const;
     void print() const;
     void setpartial(Moment p);
+    String try_set_partial_str(Moment)const;
     Moment barleft();
     void set_meter(int,int);
-    static int compare (Time_description&, Time_description&);
+    static int compare (const Time_description&, const Time_description&);
 };
 
 #include "compare.hh"
index 2266b61b334e4ecbd0a05accca2ed4c33f99e6fd..44d9b3d5e930a2a2e9e26b23b5c271cb056b8a6f 100644 (file)
@@ -46,7 +46,7 @@ Time_description::set_cadenza(bool b)
 {
     if (cadenza_b_ && !b) {
        if (whole_in_measure_) {
-           bars_i_ ++;
+           bars_i_ ++;         // should do?
            whole_in_measure_ = 0;
        }
     }
@@ -90,13 +90,27 @@ Time_description::allow_meter_change_b()
 {
     return!(whole_in_measure_);
 }
+
+/**
+  retrieve error messages.
+  @return 
+  error messages if not possible, "" if possible
+  */
+String
+Time_description::try_set_partial_str(Moment p)const
+{
+      if (when_)
+       return ("Partial measure only allowed at beginning.");
+    if (p<Rational(0))
+       return ("Partial must be non-negative");
+    if (p > whole_per_measure_)
+       return ("Partial measure too large");
+    return "";
+}
+
 void
 Time_description::setpartial(Moment p)
 {
-    if (when_)
-       error_t ("Partial measure only allowed at beginning.", *this);
-    if (p<Rational(0)||p > whole_per_measure_)
-       error_t ("Partial measure has incorrect size", *this);
     whole_in_measure_ = whole_per_measure_ - p;
 }
 
@@ -108,7 +122,7 @@ Time_description::barleft()
 }
 
 int
-Time_description::compare(Time_description &t1, Time_description&t2)
+Time_description::compare(Time_description const &t1,  Time_description const&t2)
 {
     int i = sign(t1.when_-t2.when_);