2008-05-29 18:54:30 +00:00
|
|
|
//
|
|
|
|
// File: VLMIDIWriter.h
|
|
|
|
//
|
|
|
|
// Author(s):
|
|
|
|
//
|
|
|
|
// (MN) Matthias Neeracher
|
|
|
|
//
|
2018-02-19 00:59:23 +00:00
|
|
|
// Copyright © 2008-2018 Matthias Neeracher
|
2008-05-29 18:54:30 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "VLModel.h"
|
|
|
|
#include <CoreFoundation/CoreFoundation.h>
|
|
|
|
#include <AudioToolbox/AudioToolbox.h>
|
|
|
|
|
|
|
|
struct VLMIDIUserEvent {
|
|
|
|
uint32_t fLength;
|
|
|
|
int8_t fPitch; // 0 -> Chord
|
2008-07-05 13:55:41 +00:00
|
|
|
uint8_t fStanza;
|
2011-09-11 02:03:22 +00:00
|
|
|
uint16_t fVisual;
|
|
|
|
VLLocation fAt;
|
2008-05-29 18:54:30 +00:00
|
|
|
};
|
|
|
|
|
2011-09-11 21:27:53 +00:00
|
|
|
class VLMIDIUtilities {
|
|
|
|
public:
|
|
|
|
VLMIDIUtilities(MusicSequence music);
|
|
|
|
|
|
|
|
MusicTimeStamp Length();
|
|
|
|
MusicTimeStamp Find(VLLocation at);
|
|
|
|
public:
|
|
|
|
MusicSequence fMusic;
|
|
|
|
};
|
|
|
|
|
2008-05-29 18:54:30 +00:00
|
|
|
class VLMIDIWriter: public VLSongVisitor {
|
|
|
|
public:
|
|
|
|
VLMIDIWriter(MusicSequence music, size_t countIn)
|
|
|
|
: fMusic(music), fCountIn(countIn) {}
|
|
|
|
|
2018-02-19 00:59:23 +00:00
|
|
|
void Visit(VLSong & song) override;
|
|
|
|
void VisitMeasure(uint32_t m, VLProperties & p, VLMeasure & meas) override;
|
|
|
|
void VisitNote(VLLyricsNote & n) override;
|
|
|
|
void VisitChord(VLChord & c) override;
|
2008-05-29 18:54:30 +00:00
|
|
|
private:
|
2008-07-05 13:55:41 +00:00
|
|
|
MusicSequence fMusic;
|
|
|
|
size_t fCountIn;
|
|
|
|
MusicTrack fTrack;
|
|
|
|
size_t fStanza;
|
|
|
|
MusicTimeStamp fChordTime;
|
|
|
|
MusicTimeStamp fNoteTime;
|
2011-09-11 02:03:22 +00:00
|
|
|
VLLocation fAt;
|
2008-07-05 13:55:41 +00:00
|
|
|
VLFraction fTime;
|
|
|
|
std::vector<uint8_t> fVolta;
|
2008-05-29 18:54:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Local Variables:
|
|
|
|
// mode:C++
|
|
|
|
// End:
|