finalize editable clefs
This commit is contained in:
parent
462d8128ee
commit
10363f312b
|
@ -834,11 +834,12 @@ void CDraw::drawSlot(CSlot* slot)
|
|||
else if (hand == PB_PART_left) {
|
||||
clef = m_settings->value("SidePanel/clefLeft").toInt();
|
||||
}
|
||||
stavePos.notePos(hand, slot->getSymbol(i).getNote(), clef);
|
||||
CSymbol symbol = slot->getSymbol(i);
|
||||
symbol.setClef(clef);
|
||||
stavePos.notePos(hand, symbol.getNote(), clef);
|
||||
//ppLogTrace ("compileSlot len %d id %2d next %2d time %2d type %2d note %2d", slot->length(), slot->m_displayListId,
|
||||
//slot->m_nextDisplayListId, slot->getDeltaTime(), slot->getSymbol(i).getType(), slot->getSymbol(i).getNote());
|
||||
|
||||
drawSymbol(slot->getSymbol(i), 0.0, stavePos.getPosYRelative()); // we add this back when drawing this symbol
|
||||
drawSymbol(symbol, 0.0, stavePos.getPosYRelative()); // we add this back when drawing this symbol
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "GuiTopBar.h"
|
||||
#include "TrackList.h"
|
||||
#include "Conductor.h"
|
||||
#include "Draw.h"
|
||||
|
||||
GuiSidePanel::GuiSidePanel(QWidget *parent, CSettings* settings)
|
||||
: QWidget(parent), m_parent(parent)
|
||||
|
@ -331,7 +332,6 @@ void GuiSidePanel::on_rhythmTappingCombo_activated (int index)
|
|||
void GuiSidePanel::on_clefComboChange (const QString &name, int value)
|
||||
{
|
||||
m_settings->setValue(name,value);
|
||||
CDraw::forceCompileRedraw();
|
||||
m_song->refreshScroll();
|
||||
//m_score->drawScore(); // TODO makes it crash
|
||||
//TODO do I need to do more to request a redraw?
|
||||
}
|
||||
|
|
|
@ -251,9 +251,9 @@ void CScore::drawScore()
|
|||
if (m_settings->value("SidePanel/clefRight").toInt() == PB_SYMBOL_gClef)
|
||||
drawSymbol(CSymbol(PB_SYMBOL_gClef, CStavePos(PB_PART_right, -1)), Cfg::clefX()); // The Treble Clef
|
||||
else if (m_settings->value("SidePanel/clefRight").toInt() == PB_SYMBOL_fClef)
|
||||
drawSymbol(CSymbol(PB_SYMBOL_fClef, CStavePos(PB_PART_right, -1)), Cfg::clefX());
|
||||
drawSymbol(CSymbol(PB_SYMBOL_fClef, CStavePos(PB_PART_right, 1)), Cfg::clefX());
|
||||
if (m_settings->value("SidePanel/clefLeft").toInt() == PB_SYMBOL_gClef)
|
||||
drawSymbol(CSymbol(PB_SYMBOL_gClef, CStavePos(PB_PART_left, 1)), Cfg::clefX());
|
||||
drawSymbol(CSymbol(PB_SYMBOL_gClef, CStavePos(PB_PART_left, -1)), Cfg::clefX());
|
||||
else if (m_settings->value("SidePanel/clefLeft").toInt() == PB_SYMBOL_fClef)
|
||||
drawSymbol(CSymbol(PB_SYMBOL_fClef, CStavePos(PB_PART_left, 1)), Cfg::clefX());
|
||||
drawKeySignature(CStavePos::getKeySignature());
|
||||
|
|
|
@ -55,14 +55,12 @@ void CStavePos::notePos(whichPart_t hand, int midiNote, int clef) // in fact cle
|
|||
clef = PB_SYMBOL_fClef;
|
||||
}
|
||||
if (m_hand == PB_PART_right && clef == PB_SYMBOL_gClef || m_hand == PB_PART_left && clef == PB_SYMBOL_gClef)
|
||||
m_staveIndex = lookUpItem->pianoNote - 7;
|
||||
m_staveIndex = lookUpItem->pianoNote - 7;
|
||||
else if (m_hand == PB_PART_left && clef == PB_SYMBOL_fClef || m_hand == PB_PART_right && clef == PB_SYMBOL_fClef)
|
||||
m_staveIndex = lookUpItem->pianoNote + 5;
|
||||
|
||||
m_staveIndex += (midiNote/semitonesInAnOctive)*notesInAnOctive - notesInAnOctive*5 ;
|
||||
m_accidental = lookUpItem->accidental;
|
||||
ppLogInfo("chan %d clef %2d Note %2d - %2d (%d %d %d),\n", midiNote, clef, m_staveIndex, m_accidental,
|
||||
index%semitonesInAnOctive, lookUpItem->pianoNote, (midiNote/semitonesInAnOctive)*notesInAnOctive);
|
||||
//ppLogTrace("chan %d Note %2d - %2d (%d %d %d),\n", midiNote, m_staveIndex, m_accidental,
|
||||
//index%semitonesInAnOctive, lookUpItem->pianoNote, (midiNote/semitonesInAnOctive)*notesInAnOctive);
|
||||
}
|
||||
|
|
|
@ -73,14 +73,14 @@ public:
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//@brief constructors
|
||||
CSymbol(musicalSymbol_t type, whichPart_t hand, int midiNote)
|
||||
CSymbol(musicalSymbol_t type, whichPart_t hand, int midiNote, int clef = -1)
|
||||
{
|
||||
init();
|
||||
m_symbolType = type;
|
||||
m_midiNote = midiNote;
|
||||
m_hand = hand;
|
||||
m_midiDuration = 0;
|
||||
m_stavePos.notePos(hand, midiNote);
|
||||
m_stavePos.notePos(hand, midiNote, clef);
|
||||
}
|
||||
|
||||
CSymbol()
|
||||
|
@ -158,6 +158,11 @@ public:
|
|||
void setAccidentalModifer(accidentalModifer_t value) {m_accidentalModifer = value;}
|
||||
accidentalModifer_t getAccidentalModifer() {return m_accidentalModifer;}
|
||||
|
||||
void setClef(int clef = -1)
|
||||
{
|
||||
m_stavePos.notePos(m_hand, m_midiNote, clef);
|
||||
}
|
||||
|
||||
private:
|
||||
void init()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue