/*
- music-sequence.cc -- implement Music_sequence
+ This file is part of LilyPond, the GNU music typesetter.
- source file of the GNU LilyPond music typesetter
+ Copyright (C) 1998--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
- (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ LilyPond is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ LilyPond is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "music-sequence.hh"
+
#include "warn.hh"
#include "program-option.hh"
-#include "pitch.hh"
+#include "music.hh"
#include "input.hh"
-#include "music-sequence.hh"
void
transpose_music_list (SCM lst, Pitch rq)
{
Moment l = unsmob_music (scm_car (s))->get_length ();
if (last_len.grace_part_ && l.main_part_)
- {
- last_len.grace_part_ = Rational (0);
- }
+ last_len.grace_part_ = Rational (0);
cumulative += last_len;
last_len = l;
}
for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
{
Music *m = unsmob_music (scm_car (s));
- Moment l = m->get_length ();
- dur = max (dur, l);
+ if (!m)
+ programming_error ("Music sequence should have music elements");
+ else
+ {
+ Moment l = m->get_length ();
+ dur = max (dur, l);
+ }
}
return dur;
Moment m;
for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
- {
- m = min (m, unsmob_music (scm_car (s))->start_mom ());
- }
+ m = min (m, unsmob_music (scm_car (s))->start_mom ());
return m;
}