Implement groove changes in MMA documents

This commit is contained in:
Matthias Neeracher 2008-01-24 00:57:58 +00:00
parent cb78a2ba75
commit fc1e8277c7
4 changed files with 26 additions and 15 deletions

View File

@ -42,10 +42,6 @@
// Can't handle these yet
break;
}
sprintf(buf, "Groove %s\n", [songGroove UTF8String]);
mmaFile += buf;
sprintf(buf, "KeySig %d%c\n", labs(prop.fKey), prop.fKey>=0 ? '#' : '&');
mmaFile += buf;
if (!(playElements & kVLPlayAccompaniment))
mmaFile += "AllTracks Off\nSolo On\n";
if (!(playElements & kVLPlayMelody))

View File

@ -16,16 +16,29 @@ void VLMMAWriter::Visit(VLSong & song)
fMeas = 0;
fInitial= true;
fMeasures.clear();
fKey = -999;
fGroove = "";
VisitMeasures(song, true);
}
void VLMMAWriter::VisitMeasure(size_t m, VLProperties & p, VLMeasure & meas)
{
char buf[8];
char buf[64];
if (p.fKey != fKey) {
fKey = p.fKey;
sprintf(buf, "KeySig %d%c\n", labs(fKey), fKey>=0 ? '#' : '&');
fMeasures += buf;
}
if (p.fGroove != fGroove) {
fGroove = p.fGroove;
fMeasures += "Groove " + fGroove + '\n';
}
sprintf(buf, "%-3d", ++fMeas);
fUseSharps = p.fKey >= 0;
fUseSharps = fKey >= 0;
//
// Generate chords

View File

@ -21,15 +21,17 @@ public:
const std::string & Measures() const { return fMeasures; }
private:
std::string fMeasures;
std::string fMeasures;
VLSong * fSong;
bool fUseSharps;
bool fTied;
bool fInitial;
int fMeas;
size_t fLastDur;
std::string fAccum;
VLSong * fSong;
bool fUseSharps;
bool fTied;
bool fInitial;
int fMeas;
size_t fLastDur;
std::string fAccum;
int fKey;
std::string fGroove;
};
// Local Variables:

View File

@ -517,4 +517,4 @@ advanceAt:
return [self readFromPlist:outPlist error:outError];
}
@end
@end