2 // midi-voice.cc -- implement midi_voice
4 // copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
8 Midi_voice::Midi_voice( Moment begin_mom )
10 begin_mom_ = begin_mom;
14 Midi_voice::add_event( Midi_event* midi_event_p )
16 midi_event_p_list_.bottom().add( midi_event_p );
20 Midi_voice::begin_mom()
28 Moment now_mom = begin_mom_;
29 dtor << now_mom << ", ";
30 for ( PCursor<Midi_event*> i( midi_event_p_list_.top() ); i.ok(); i++ ) {
31 dtor << now_mom << ", ";
39 Midi_voice::mudela_str( Moment from_mom, Moment to_mom, bool multiple_bo )
43 if ( begin_mom() >= to_mom )
45 if ( end_mom() <= from_mom )
48 Moment now_mom = begin_mom();
49 PCursor<Midi_event*> i( midi_event_p_list_.top() );
50 for ( ; i.ok() && now_mom < from_mom ; i++ )
53 for ( ; i.ok() && now_mom < to_mom ; i++ ) {
55 str += i->mudela_str( false ) + " ";
58 if ( str.length_i() && multiple_bo )
59 str = "\\music{ " + str + "} ";