(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-
+#include "voice.hh"
#include "proto.hh"
#include "plist.hh"
#include "musical-request.hh"
if (id=="") // UGH
id = __FUNCTION__ + String(temp_id_count++);
group_id_str_ = id;
+ termination_mom_ = 0;
}
bool
for (int i=0; i <voice_regs_l_.size(); i++) {
if (r_l == voice_regs_l_[i])
voice_regs_l_.del(i);
+ mtor << "Terminating voice_reg " ;
Register_group_register::terminate_register(r_l);
return;
}
}
assert(false);
}
+IMPLEMENT_STATIC_NAME(Voice_group_registers);
+
void
Voice_group_registers::do_print() const
{
#ifndef NPRINT
mtor << "ID: " << group_id_str_<<"\n";
+ mtor << "stopping at " << termination_mom_ << "\n";
Register_group_register::do_print();
#endif
}
Voice_group_registers::add(Request_register*r_l)
{
Register_group_register::add(r_l);
- if (r_l->name() == Voice_registers::static_name())
- voice_regs_l_.push( (Voice_registers*)r_l );
+ if (r_l->name() == Voice_registers::static_name()) {
+ Voice_registers * vregs_l = (Voice_registers*)r_l;
+ voice_regs_l_.push( vregs_l );
+ Voice *v_l = vregs_l->voice_l_;
+ termination_mom_ = termination_mom_ >? v_l -> last();
+ mtor << "adding Voice_registers, now terminating at " <<
+ termination_mom_<< "\n";
+ }
+}
+
+void
+Voice_group_registers::post_move_processing()
+{
+ if ( get_staff_info().time_C_ ->when_ > termination_mom_ ){
+ mtor << "Terminating voice_group\n";
+ daddy_reg_l_->terminate_register(this);
+ }
+ Register_group_register::post_move_processing();
}