mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 11:14:00 +00:00
Draw proper pitch for note highlights (Tracker #3288852)
This commit is contained in:
parent
7b035f66bb
commit
b915085530
|
@ -54,7 +54,7 @@ void VLMIDIWriter::VisitMeasure(size_t m, VLProperties & p, VLMeasure & meas)
|
|||
void VLMIDIWriter::VisitNote(VLLyricsNote & n)
|
||||
{
|
||||
if (!(n.fTied & VLNote::kTiedWithPrev)) {
|
||||
VLMIDIUserEvent event = {8, n.fPitch, fStanza, fMeasure, fAt};
|
||||
VLMIDIUserEvent event = {12, n.fPitch, fStanza, fMeasure, n.fVisual, fAt};
|
||||
MusicTrackNewUserEvent(fTrack, fNoteTime,
|
||||
reinterpret_cast<const MusicEventUserData *>(&event));
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ void VLMIDIWriter::VisitNote(VLLyricsNote & n)
|
|||
void VLMIDIWriter::VisitChord(VLChord & c)
|
||||
{
|
||||
if (c.fPitch != VLNote::kNoPitch) {
|
||||
VLMIDIUserEvent event = {8, 0, fStanza, fMeasure, fAt};
|
||||
VLMIDIUserEvent event = {12, 0, fStanza, fMeasure, 0, fAt};
|
||||
MusicTrackNewUserEvent(fTrack, fChordTime,
|
||||
reinterpret_cast<const MusicEventUserData *>(&event));
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ struct VLMIDIUserEvent {
|
|||
int8_t fPitch; // 0 -> Chord
|
||||
uint8_t fStanza;
|
||||
int16_t fMeasure;
|
||||
uint32_t fVisual;
|
||||
VLFract fAt;
|
||||
};
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
- (void) drawNotesForSystem:(int)system;
|
||||
- (void) addNoteAtCursor;
|
||||
- (void) startKeyboardCursor;
|
||||
- (void) drawNoteCursor:(int)pitch inMeasure:(size_t)measure at:(VLFract)at;
|
||||
- (void) drawNoteCursor:(int)pitch inMeasure:(size_t)measure at:(VLFract)at accidental:(VLMusicElement)accidental;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -160,9 +160,10 @@
|
|||
}
|
||||
|
||||
- (void) drawNoteCursor:(int)pitch inMeasure:(size_t)measure at:(VLFract)at
|
||||
accidental:(VLMusicElement)accidental
|
||||
{
|
||||
[self drawNoteCursor:pitch inMeasure:measure at:at
|
||||
accidental:kMusicNothing mode:' '];
|
||||
accidental:accidental mode:' '];
|
||||
}
|
||||
|
||||
- (void) drawNoteCursor
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
size_t fNoteMeasure;
|
||||
VLFract fNoteAt;
|
||||
int fNotePitch;
|
||||
VLMusicElement fNoteAccidental;
|
||||
size_t fChordMeasure;
|
||||
VLFract fChordAt;
|
||||
}
|
||||
|
@ -50,6 +51,8 @@
|
|||
VLMIDIUserEvent * event = (VLMIDIUserEvent *)[ev pointerValue];
|
||||
if (event->fPitch) {
|
||||
fNotePitch = event->fPitch;
|
||||
fNoteAccidental = (event->fVisual & VLNote::kWantFlat) ? kMusicFlat
|
||||
: ((event->fVisual & VLNote::kWantSharp) ? kMusicSharp : kMusicNothing);
|
||||
fNoteMeasure = event->fMeasure;
|
||||
fNoteAt = event->fAt;
|
||||
fStanza = event->fStanza;
|
||||
|
@ -65,7 +68,7 @@
|
|||
- (void) highlightCursor
|
||||
{
|
||||
if (fNoteMeasure != 0x80000000 && fNotePitch != VLNote::kNoPitch)
|
||||
[fView drawNoteCursor:fNotePitch inMeasure:fNoteMeasure at:fNoteAt];
|
||||
[fView drawNoteCursor:fNotePitch inMeasure:fNoteMeasure at:fNoteAt accidental:fNoteAccidental];
|
||||
if (fChordMeasure != 0x80000000)
|
||||
[fView highlightChordInMeasure:fChordMeasure at:fChordAt];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user