#include "debug.hh"
#include "voice.hh"
-void
-Voice_element::add(Request*r)
+Voice::Voice(Voice const&src)
{
- if (r->rhythmic()) {
- assert (!duration);
- duration = r->duration();
- }
- reqs.bottom().add(r);
+ PL_copy(elts, src.elts);
+ start = src.start;
}
Voice::Voice()
elts.bottom().add(v);
}
-Voice_element::Voice_element()
-{
- voice = 0;
- group = 0;
- duration = 0.0;
-}
-
void
Voice::print() const
{
vec->print();
#endif
}
+
+Real
+Voice::last() const
+{
+ Real l =start;
+ for (PCursor<Voice_element*> vec(elts); vec.ok(); vec++)
+ l += vec->duration;
+ return l;
+}
+/****************************************************************/
void
Voice_element::print() const
{
mtor << "}\n";
#endif
}
+void
+Voice_element::add(Request*r)
+{
+ if (r->rhythmic()) {
+ assert (!duration);
+ duration = r->duration();
+ }
+ reqs.bottom().add(r);
+}
-Real
-Voice::last() const
+
+Voice_element::Voice_element()
{
- Real l =start;
- for (PCursor<Voice_element*> vec(elts); vec.ok(); vec++)
- l += vec->duration;
- return l;
+ voice = 0;
+ group = 0;
+ duration = 0.0;
+}
+
+Voice_element::Voice_element(Voice_element const&src)
+{
+ duration=src.duration;
+ voice=src.voice;
+ PointerList__copy(Request*, reqs, src.reqs, clone());
+ group=src.group;
+ assert(!granted_items.size() && !granted_spanners.size());
}