VocalEasel/Sources/VLMIDIWriter.h
2011-09-11 23:27:53 +02:00

57 lines
1.2 KiB
C++

//
// File: VLMIDIWriter.h
//
// Author(s):
//
// (MN) Matthias Neeracher
//
// Copyright © 2008-2011 Matthias Neeracher
//
#include "VLModel.h"
#include <CoreFoundation/CoreFoundation.h>
#include <AudioToolbox/AudioToolbox.h>
struct VLMIDIUserEvent {
uint32_t fLength;
int8_t fPitch; // 0 -> Chord
uint8_t fStanza;
uint16_t fVisual;
VLLocation fAt;
};
class VLMIDIUtilities {
public:
VLMIDIUtilities(MusicSequence music);
MusicTimeStamp Length();
MusicTimeStamp Find(VLLocation at);
public:
MusicSequence fMusic;
};
class VLMIDIWriter: public VLSongVisitor {
public:
VLMIDIWriter(MusicSequence music, size_t countIn)
: fMusic(music), fCountIn(countIn) {}
virtual void Visit(VLSong & song);
virtual void VisitMeasure(size_t m, VLProperties & p, VLMeasure & meas);
virtual void VisitNote(VLLyricsNote & n);
virtual void VisitChord(VLChord & c);
private:
MusicSequence fMusic;
size_t fCountIn;
MusicTrack fTrack;
size_t fStanza;
MusicTimeStamp fChordTime;
MusicTimeStamp fNoteTime;
VLLocation fAt;
VLFraction fTime;
std::vector<uint8_t> fVolta;
};
// Local Variables:
// mode:C++
// End: