|
From: Tapio V. <aa...@us...> - 2011-01-11 14:46:46
|
Module: editor
Branch: master
Commit: 01feaed6bdaf64b17513d453db68d7d20426443a
Author: Tapio Vierros <tap...@gm...>
Date: Tue Jan 11 16:27:26 2011 +0200
Some preparation for sentence end handling.
---
notelabel.cc | 6 ++++++
notes.cc | 2 +-
notes.hh | 1 +
3 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/notelabel.cc b/notelabel.cc
index fb18ace..548eecd 100644
--- a/notelabel.cc
+++ b/notelabel.cc
@@ -71,6 +71,12 @@ void NoteLabel::createPixmap(QSize size)
painter.setFont(font);
painter.setBrush(Qt::black);
painter.drawText(QRect(QPoint(6, 6), QSize(size.width()-text_margin, size.height()-text_margin)), Qt::AlignCenter, lyric());
+
+ // Render sentence end indicator
+ if (m_note.lineBreak) {
+ // TODO
+ }
+
painter.end();
setPixmap(QPixmap::fromImage(image));
diff --git a/notes.cc b/notes.cc
index 09e1071..f952dd0 100644
--- a/notes.cc
+++ b/notes.cc
@@ -54,7 +54,7 @@ double MusicalScale::getNoteOffset(double freq) const {
Duration::Duration(): begin(getNaN()), end(getNaN()) {}
-Note::Note(std::string lyric): syllable(lyric), duration(getNaN(), getNaN()), phase(getNaN()), type(NORMAL), note(), notePrev() {}
+Note::Note(std::string lyric): syllable(lyric), duration(getNaN(), getNaN()), phase(getNaN()), type(NORMAL), note(), notePrev(), lineBreak() {}
double Note::diff(double note, double n) { return remainder(n - note, 12.0); }
diff --git a/notes.hh b/notes.hh
index 4b29864..cd85bae 100644
--- a/notes.hh
+++ b/notes.hh
@@ -55,6 +55,7 @@ struct Note {
int note; ///< MIDI pitch of the note (at the end for slide notes)
int notePrev; ///< MIDI pitch of the previous note (should be same as note for everything but SLIDE)
std::string syllable; ///< lyrics syllable for that note
+ bool lineBreak; ///< is this note ending a syllable?
/// note begin time access
double& begin() { return duration.begin; }
double begin() const { return duration.begin; }
|