Don't do grid computations on rests

This commit is contained in:
Matthias Neeracher 2011-08-28 23:05:02 +02:00
parent f27dc9ee8f
commit ec538bb4da

View File

@ -141,7 +141,7 @@ void VLPlistVisitor::VisitNote(VLLyricsNote & n)
nil] nil]
: [NSDictionary dictionary]]; : [NSDictionary dictionary]];
int grid = VLPitchToGrid(n.fPitch, n.fVisual, 0); int grid = n.fPitch==VLNote::kNoPitch ? 0 : VLPitchToGrid(n.fPitch, n.fVisual, 0);
NSDictionary * nd = NSDictionary * nd =
[NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:n.fDuration.fNum], @"durNum", [NSNumber numberWithInt:n.fDuration.fNum], @"durNum",
@ -156,9 +156,11 @@ void VLPlistVisitor::VisitNote(VLLyricsNote & n)
void VLPlistVisitor::VisitChord(VLChord & c) void VLPlistVisitor::VisitChord(VLChord & c)
{ {
int pitchGrid = VLPitchToGrid(c.fPitch, c.fVisual, 0); int pitchGrid =
c.fPitch==VLNote::kNoPitch ? 0 : VLPitchToGrid(c.fPitch, c.fVisual, 0);
VLVisualFilter pitchFilter(0); VLVisualFilter pitchFilter(0);
int rootGrid = VLPitchToGrid(c.fRootPitch, c.fRootAccidental, 0); int rootGrid =
c.fRootPitch==VLNote::kNoPitch ? 0 : VLPitchToGrid(c.fRootPitch, c.fRootAccidental, 0);
VLVisualFilter rootFilter(0); VLVisualFilter rootFilter(0);
NSDictionary * cd = NSDictionary * cd =
[NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys: