source file of the GNU LilyPond music typesetter
- (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 2000--2002 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "part-combine-music-iterator.hh"
#include "pitch.hh"
-Part_combine_music::Part_combine_music (SCM what, Music * f, Music * s)
+Part_combine_music::Part_combine_music (SCM l)
+ : Music (l)
{
- assert (gh_string_p (what));
- set_mus_property ("what", what);
- set_mus_property ("one", f->self_scm ());
- set_mus_property ("two", s->self_scm ());
-
- scm_unprotect_object (f->self_scm());
- scm_unprotect_object (s->self_scm());
-
- set_mus_property ("type",
- Part_combine_music_iterator::constructor_cxx_function);
+ set_mus_property ("iterator-ctor",
+ Part_combine_music_iterator::constructor_proc);
}
void
Part_combine_music::transpose (Pitch p)
{
- first_l ()->transpose (p);
- second_l () ->transpose (p);
+ get_first ()->transpose (p);
+ get_second () ->transpose (p);
}
-
-
Moment
Part_combine_music::length_mom () const
{
- return first_l ()->length_mom ();
+ return get_first ()->length_mom ();
}
Pitch
Part_combine_music::to_relative_octave (Pitch p)
{
- p = first_l ()->to_relative_octave (p);
- return second_l ()->to_relative_octave (p);
+ p = get_first ()->to_relative_octave (p);
+ return get_second ()->to_relative_octave (p);
}
void
Part_combine_music::compress (Moment m)
{
- first_l ()->compress (m);
- second_l ()->compress (m);
+ get_first ()->compress (m);
+ get_second ()->compress (m);
}
Music*
-Part_combine_music::first_l () const
+Part_combine_music::get_first () const
{
- return unsmob_music (get_mus_property ("one"));
+ SCM l = get_mus_property ("elements");
+ if (!gh_pair_p (l))
+ return 0;
+ return unsmob_music (gh_car (l));
}
+
Music*
-Part_combine_music::second_l () const
+Part_combine_music::get_second () const
{
- return unsmob_music (get_mus_property ("two"));
+ SCM l = get_mus_property ("elements");
+ if (!gh_pair_p (l))
+ return 0;
+ l = gh_cdr (l);
+ if (!gh_pair_p (l))
+ return 0;
+ return unsmob_music (gh_car (l));
}
+
+
+Part_combine_music::Part_combine_music ()
+ : Music (SCM_EOL)
+{
+}
+
+ADD_MUSIC (Part_combine_music);