summaryrefslogtreecommitdiff
path: root/lily
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@xs4all.nl>2007-01-24 02:27:00 +0100
committerHan-Wen Nienhuys <hanwen@xs4all.nl>2007-01-24 02:27:00 +0100
commitba16526a792dc8d4ef4d9ec025c3f1d19d5d165f (patch)
tree4a760e43347cad7418bcb90f9603d752bf6c0c7b /lily
parent94fdd3f7932666ac1b3169854ea0a9964b5d32f3 (diff)
make spanned_rank_iv() const; add Spanner::spanned_time() method
Diffstat (limited to 'lily')
-rw-r--r--lily/grob.cc2
-rw-r--r--lily/include/grob.hh2
-rw-r--r--lily/include/item.hh2
-rw-r--r--lily/include/spanner.hh4
-rw-r--r--lily/item.cc2
-rw-r--r--lily/spanner.cc28
6 files changed, 34 insertions, 6 deletions
diff --git a/lily/grob.cc b/lily/grob.cc
index 01b2c7f3e3..bc948659f1 100644
--- a/lily/grob.cc
+++ b/lily/grob.cc
@@ -446,7 +446,7 @@ Grob::maybe_pure_extent (Grob *refp, Axis a, bool pure, int start, int end)
}
Interval_t<int>
-Grob::spanned_rank_iv ()
+Grob::spanned_rank_iv () const
{
return Interval_t<int> (-1, 0);
}
diff --git a/lily/include/grob.hh b/lily/include/grob.hh
index bcd101b98e..c7ecbbabfd 100644
--- a/lily/include/grob.hh
+++ b/lily/include/grob.hh
@@ -125,7 +125,7 @@ public:
Grob *get_parent (Axis a) const;
void fixup_refpoint ();
- virtual Interval_t<int> spanned_rank_iv ();
+ virtual Interval_t<int> spanned_rank_iv () const;
};
/* smob utilities */
diff --git a/lily/include/item.hh b/lily/include/item.hh
index d00541a8bf..a23cab577c 100644
--- a/lily/include/item.hh
+++ b/lily/include/item.hh
@@ -38,7 +38,7 @@ public:
virtual System *get_system () const;
virtual Paper_column *get_column () const;
virtual void handle_prebroken_dependencies ();
- virtual Interval_t<int> spanned_rank_iv ();
+ virtual Interval_t<int> spanned_rank_iv () const;
DECLARE_GROB_INTERFACE();
protected:
virtual void discretionary_processing ();
diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh
index e4a09cc0cf..23455d73b1 100644
--- a/lily/include/spanner.hh
+++ b/lily/include/spanner.hh
@@ -47,7 +47,8 @@ public:
void substitute_one_mutable_property (SCM sym, SCM val);
bool fast_substitute_grob_array (SCM sym, Grob_array *);
- virtual Interval_t<int> spanned_rank_iv ();
+ Interval_t<Moment> spanned_time () const;
+ virtual Interval_t<int> spanned_rank_iv () const;
void set_bound (Direction d, Grob *);
Item *get_bound (Direction d) const;
@@ -64,6 +65,7 @@ public:
DECLARE_GROB_INTERFACE();
virtual System *get_system () const;
+
protected:
void set_my_columns ();
virtual Grob *clone () const;
diff --git a/lily/item.cc b/lily/item.cc
index c6ca1b2c69..9d6a517d3b 100644
--- a/lily/item.cc
+++ b/lily/item.cc
@@ -174,7 +174,7 @@ Item::pure_is_visible (int start, int end) const
}
Interval_t<int>
-Item::spanned_rank_iv ()
+Item::spanned_rank_iv () const
{
int c = get_column ()->get_rank ();
return Interval_t<int> (c, c);
diff --git a/lily/spanner.cc b/lily/spanner.cc
index e1fe55efe1..8a1e9e62c9 100644
--- a/lily/spanner.cc
+++ b/lily/spanner.cc
@@ -14,6 +14,7 @@
#include "stencil.hh"
#include "system.hh"
#include "warn.hh"
+#include "moment.hh"
Grob *
Spanner::clone () const
@@ -145,7 +146,7 @@ Spanner::set_my_columns ()
}
Interval_t<int>
-Spanner::spanned_rank_iv ()
+Spanner::spanned_rank_iv () const
{
Interval_t<int> iv (0, 0);
@@ -156,6 +157,31 @@ Spanner::spanned_rank_iv ()
return iv;
}
+Interval_t<Moment>
+Spanner::spanned_time () const
+{
+ Interval_t<Moment> iv;
+
+ Direction d = LEFT;
+ do
+ {
+ if (spanned_drul_[d] && spanned_drul_[d]->get_column ())
+ iv[d] = robust_scm2moment (spanned_drul_[d]->get_column ()->get_property ("when"),
+ iv[d]);
+ }
+ while (flip (&d) != LEFT);
+
+ do
+ {
+ if (!spanned_drul_[d] || !spanned_drul_[d]->get_column ())
+ iv[d] = iv[-d];
+ }
+ while (flip (&d) != LEFT);
+
+
+ return iv;
+}
+
Item *
Spanner::get_bound (Direction d) const
{