summaryrefslogtreecommitdiff
path: root/lily/spanner.cc
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/spanner.cc
parent94fdd3f7932666ac1b3169854ea0a9964b5d32f3 (diff)
make spanned_rank_iv() const; add Spanner::spanned_time() method
Diffstat (limited to 'lily/spanner.cc')
-rw-r--r--lily/spanner.cc28
1 files changed, 27 insertions, 1 deletions
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
{