diff --git a/TODO b/TODO index 0a67b80811acee76524c713751e4296e1ec0b4bb..4b455633d168ed88150207e9ab518d90fbc3643e 100755 --- a/TODO +++ b/TODO @@ -15,7 +15,7 @@ ====== BUGS AND ISSUES =============================================== MAJOR: - +- right mouse button for melodies invokes repeat question - remember to delete temporary settings file when all will be working - when new staff is automatically added selected note is wrong - bound window size (or score size) in single note mode and hidden guitar and/or rest widgets @@ -24,9 +24,10 @@ MAJOR: - Pitch view remains enabled after exam (even the check box is unchecked) +- when tool bar has no icons - about label has to be a text only + Tcanvas - canvas has to recognize when widgets are hidden and doesn't start correct animations -- move what_next/question tips to the right over guitar in single note mode Scaling issues: @@ -42,17 +43,21 @@ Scaling issues: - changing to/from grand staff overrides TscoreNote ambitus - there is no problem as long as ambitus is unused -MINOR +MINOR: + +- move what_next/question tips to the right over guitar in single note mode +- during correction melodies on a score with a few staves clicking a note works strange due to staff is placed over staff Charts: - points (notes) shadow changes with zoom - fix it - zoom with CTRL+scroll moves a chart as well - fix it - staff line disappears sometimes (when zoom is big) - use of realW() & realH() of TgraphicsTip + - scaling small charts (its scene rectangle) look clumsy - flickering - revert to native style under MacOs when Qt5 - TscoreView and TscoreItem have to have Android compile scopes -s + Tnote - overload + and - operators to raise/drop a note - make appropriate methods const @@ -60,7 +65,8 @@ Tnote ==== NEW FEATURES ================================================================ - proxy corner widgets should be animated (if they remain live) - tidy key signature in note pixmap (width depends on accidentals number) -- increase precision of exam timers - regressions risk... +- allow scaling a multiple staves score in disabled state +- increase precision of exam timers - regressions risk... (to consider) - add blinking of settings icon(action) instead of expert check boxes in old versions - enable/disable animations option - make exam summary pretty @@ -98,11 +104,11 @@ TEXAMEXECUTOR - rhythms in score - rhythms in level and exercise/exam - improve saving melodies to musicXML and opening/importing melodies from XML -- managing melodies in levels, adding melodies set to the level +- managing melodies in levels, adding set of melodies to the level - settings for keyboard shortcuts - sophisticated and configurable algorithm to generate random melodies - option for changing melody key (transposition) - in a level key range as well -- intervals: creating melody with available intervals set only +- intervals: creating melody with set of available intervals only - intervals: questions related to them in exam/exercises - recognizing melodies from *.ogg and *.wav files - support for (octavation marks) - octave drop/rise (8-va, 15-va) diff --git a/changes b/changes index 103bcf1e6e7cbd984ec8a459556cbbdef9f95765..413314716a49a81c785f9016ec8907a9a4ccd86a 100644 --- a/changes +++ b/changes @@ -1,7 +1,8 @@ - - exam tips stores their position when moved by user +1.1.4 alpha + - exam tips are storing their position when moved by user BUGS FIXES - fixed a lot of small glitches - Under the hood + Under the hood - removed all 'extern' statements from libraries 1.1.3 alpha diff --git a/src/exam/texamexecutor.cpp b/src/exam/texamexecutor.cpp index a20086048c1998c7dfab95f130a46df1aee80d2f..4722a9bca33243ec1bb75bff6fc4e865edddc8e0 100755 --- a/src/exam/texamexecutor.cpp +++ b/src/exam/texamexecutor.cpp @@ -1138,48 +1138,55 @@ void TexamExecutor::exerciseToExam() { void TexamExecutor::stopExerciseSlot() { - bool askAfter = m_askingTimer->isActive(); - m_askingTimer->stop(); // stop questioning, if any - bool continuePractice = false; - stopSound(); - if (m_exam->count()) { - TQAunit lastQuestion; - if (!m_exam->curQ().melody()) { - lastQuestion = m_exam->curQ(); - if (!m_isAnswered) { // remove last question to skip it in summary (chart) but only if not a melody - m_penalty->pauseTime(); - m_exam->removeLastQuestion(); - } - } - m_penalty->updateExamTimes(); - Tnote::EnameStyle tmpStyle = gl->S->nameStyleInNoteName; - gl->S->nameStyleInNoteName = m_glStore->nameStyleInNoteName; // restore to show charts in user defined style - - bool startExam = false; - if (m_exam->count()) - m_exam->saveToFile(); - if (!m_goingClosed) - continuePractice = showExamSummary(m_exam, true, (bool)m_exercise, &startExam); - gl->S->nameStyleInNoteName = tmpStyle; - if (startExam) { - exerciseToExam(); - return; - } - if (!m_isAnswered && continuePractice && !m_exam->curQ().melody()) { - m_exam->addQuestion(lastQuestion); // add previously deleted - m_penalty->continueTime(); + bool askAfter = m_askingTimer->isActive(); + m_askingTimer->stop(); // stop questioning, if any + bool continuePractice = false; + stopSound(); + qDebug() << "1." << m_exam->count() << m_exam->mistakes() << m_exam->totalTime(); + if (m_exam->count()) { + TQAunit lastQuestion; + if (!m_exam->curQ().melody()) { + lastQuestion = m_exam->curQ(); + if (!m_isAnswered) { // remove last question to skip it in summary (chart) but only if not a melody + m_penalty->pauseTime(); + m_exam->removeLastQuestion(); } - } - if (continuePractice) { - if (askAfter) // ask next question if questioning was stopped - askQuestion(); - else // restore sniffing if necessary - if (m_exam->curQ().answerAsSound()) - startSniffing(); - qApp->installEventFilter(m_supp); - return; } - closeExecutor(); + qDebug() << "2." << m_exam->count() << m_exam->mistakes() << m_exam->totalTime(); + m_penalty->updateExamTimes(); + Tnote::EnameStyle tmpStyle = gl->S->nameStyleInNoteName; + gl->S->nameStyleInNoteName = m_glStore->nameStyleInNoteName; // restore to show charts in user defined style + + bool startExam = false; + if (m_exam->count()) + m_exam->saveToFile(); + if (!m_goingClosed) + continuePractice = showExamSummary(m_exam, true, (bool)m_exercise, &startExam); + gl->S->nameStyleInNoteName = tmpStyle; + if (startExam) { + exerciseToExam(); + return; + } + if (!m_isAnswered && continuePractice && !m_exam->curQ().melody()) { + m_exam->addQuestion(lastQuestion); // add previously deleted + m_exam->sumarizeAnswer(); + m_penalty->continueTime(); + } + } + qDebug() << "3." << m_exam->count() << m_exam->mistakes() << m_exam->totalTime(); + if (continuePractice) { + if (askAfter) // ask next question if questioning was stopped + askQuestion(); + else // restore sniffing if necessary + if (m_exam->curQ().answerAsSound()) + startSniffing(); + qApp->installEventFilter(m_supp); + return; + } else { + if (m_exam->count()) + m_exam->saveToFile(); + } + closeExecutor(); } @@ -1448,8 +1455,9 @@ void TexamExecutor::rightButtonSlot() { return; if (m_isAnswered) askQuestion(); - else + else { checkAnswer(); + } } diff --git a/src/gui/tmelman.cpp b/src/gui/tmelman.cpp index a737f747ad6b44d5c7ae6586652ddcf40cc43400..cacc911b57f30e663d447a04002d52d8119c8568 100644 --- a/src/gui/tmelman.cpp +++ b/src/gui/tmelman.cpp @@ -33,7 +33,7 @@ TmelMan::TmelMan(TmainScore* score) : QIcon(score->style()->standardIcon(QStyle::SP_MediaPlay))); m_recMelAct = createAction(tr("Record"), SLOT(recordMelodySlot()), QKeySequence("Alt+Space"), QIcon(Tpath::img("record"))); - createAction(tr("Create"), SLOT(randomizeMelodySlot())); + createAction(tr("Create"), SLOT(randomizeMelodySlot()), QKeySequence(), QIcon(Tpath::img("melody"))); m_menu->addSeparator(); QDialogButtonBox box; QPushButton *saveBut = box.addButton(QDialogButtonBox::Save); diff --git a/src/libs/core/exam/texam.cpp b/src/libs/core/exam/texam.cpp index a22f81839eea30b16b904f49238897b35e8c2ce5..1467dac70e583cb89e47cb82741b9dae649ad0c5 100644 --- a/src/libs/core/exam/texam.cpp +++ b/src/libs/core/exam/texam.cpp @@ -450,12 +450,14 @@ void Texam::sumarizeAnswer() { updateAverageReactTime(true); if (melodies()) { - } else - if (!isFinished()) { + } else { +// if (!isFinished()) { addPenalties(); // for melodies it should be invoked after ensuring that answer was finished - updateBlackCount(); + if (!isExercise()) + updateBlackCount(); m_workTime += curQ().time; - } +// } + } updateEffectiveness(); } @@ -481,6 +483,8 @@ void Texam::addPenalties() { void Texam::removeLastQuestion() { m_workTime -= curQ().time; + if (curQ().isWrong()) + m_mistNr--; m_answList.removeLast(); updateEffectiveness(); } diff --git a/src/libs/misc/taboutnootka.cpp b/src/libs/misc/taboutnootka.cpp index 2152cde76baa9990e16b78e5bc6247f0a8211fdd..9f2d58d9329192ae5b3a0de34888fb416e9003a2 100644 --- a/src/libs/misc/taboutnootka.cpp +++ b/src/libs/misc/taboutnootka.cpp @@ -181,7 +181,7 @@ TaboutNootka::TaboutNootka(QWidget *parent) : in.setCodec("UTF-8"); QStringList htmlText = in.readAll().replace(" ", " ").split("\n"); for (int i = 0; i < htmlText.size(); i++) { - if (htmlText[i].contains("0.")) + if (htmlText[i].contains("0.") || htmlText[i].contains("1.")) htmlText[i] = "<u><b> " + htmlText[i] + "</b></u>"; else if (htmlText[i].contains("======")) htmlText[i] = "<br><hr><b><big><center>Nootka ONE</big></b></center><hr>"; @@ -243,7 +243,7 @@ Tabout::Tabout(QWidget *parent) : QString info = tr("Welcome on board.<br>Nootka is an open source application to help you in learning (and in teaching) classical score notation.<br>It is specially designed for guitarists but others will find many usable features as well."); QString betaInfo = tr("This is a beta version and may contain bugs or behave in unexpected ways. Also, it has unfinished features.<br>In spite of that, you are welcome to try it!"); QString moreInfo = tr("See a <a href=\"http://nootka.sourceforge.net\">program site</a> for more details and further releases.</p><p>Any bugs, suggestions, translations and so on, report to: <a href=\"mailto:seelook.gmail.com\">seelook@gmail.com</a><p/><p>with respects<br>Author"); - betaInfo = ""; // comment it to show info in beta releases +// betaInfo = ""; // comment it to show info in beta releases m_aboutLab = new TroundedLabel("<center><p style=\"background-color: palette(Base); border: 1px solid palette(Text); border-radius: 10px; font-size: 20px;\"><b>Nootka " + Tcore::gl()->version + "</b></p></center><p><br>" + info + "</p><p>" + betaInfo + "</p><p>" + moreInfo + "</p><br>" #if defined(Q_OS_WIN32) + tr("<br>To support this project and also to avoid infection of your PC<br><b>PLEASE, use the official project site to download updates, new releases and to see news.</b>") diff --git a/src/score/tmainscore.cpp b/src/score/tmainscore.cpp index da0389b4a69add676e76195b371f2a3d12190ddf..891c0a53976f1dd00ef13a89c552b0b0c63f34a4 100644 --- a/src/score/tmainscore.cpp +++ b/src/score/tmainscore.cpp @@ -369,26 +369,6 @@ void TmainScore::isExamExecuting(bool isIt) { disconnect(m_nameMenu, SIGNAL(noteNameWasChanged(Tnote)), this, SLOT(menuChangedNote(Tnote))); connect(this, SIGNAL(noteWasChanged(int,Tnote)), this, SLOT(expertNoteChanged())); setNoteNameEnabled(false); - m_questMark = new QGraphicsSimpleTextItem(); - m_questMark->hide(); - #if defined(Q_OS_MACX) - m_questMark->setFont(TnooFont(10)); - #else - m_questMark->setFont(TnooFont(8)); - #endif - scoreScene()->addItem(m_questMark); - QColor c = gl->EquestionColor; -// if (insertMode() == e_single) { -// c.setAlpha(255); -// staff()->noteSegment(1)->setColor(c); -// } - c.setAlpha(30); - m_questMark->setBrush(QBrush(c)); - m_questMark->setText("?"); - m_questMark->setScale(((height() / transform().m11()) / m_questMark->boundingRect().height())); - m_questMark->setPos(((width() / transform().m11()) - m_questMark->boundingRect().width() * m_questMark->scale()) / 2, - ((height() / transform().m11()) - m_questMark->boundingRect().height() * m_questMark->scale()) / 2 ); - m_questMark->setZValue(4); setScoreDisabled(true); setClefDisabled(true); m_correctNoteNr = -1; @@ -396,8 +376,10 @@ void TmainScore::isExamExecuting(bool isIt) { connect(this, SIGNAL(noteWasChanged(int,Tnote)), this, SLOT(whenNoteWasChanged(int,Tnote))); connect(m_nameMenu, SIGNAL(noteNameWasChanged(Tnote)), this, SLOT(menuChangedNote(Tnote))); disconnect(this, SIGNAL(noteWasChanged(int,Tnote)), this, SLOT(expertNoteChanged())); - delete m_questMark; - m_questMark = 0; + if (m_questMark) { + delete m_questMark; + m_questMark = 0; + } delete m_questKey; m_questKey = 0; setClefDisabled(false); @@ -442,13 +424,15 @@ void TmainScore::clearScore() { for(int i = 0; i < m_bgRects.size(); i++) delete m_bgRects[i]; m_bgRects.clear(); - m_questMark->hide(); + if (m_questMark) + m_questMark->hide(); setBGcolor(mainWindow()->palette().base().color()); enableAccidToKeyAnim(enableAnim); } void TmainScore::askQuestion(Tnote note, char realStr) { + createQuestionMark(); TsimpleScore::setNote(1, note); setBGcolor(Tcolor::merge(gl->EquestionColor, mainWindow()->palette().window().color())); m_questMark->show(); @@ -465,7 +449,8 @@ void TmainScore::askQuestion(Tnote note, TkeySignature key, char realStr) { void TmainScore::askQuestion(Tmelody* mel) { setBGcolor(Tcolor::merge(gl->EquestionColor, mainWindow()->palette().window().color())); -// m_questMark->show(); + createQuestionMark(); + m_questMark->show(); setMelody(mel); setScoreDisabled(true); } @@ -939,6 +924,29 @@ void TmainScore::restoreNotesSettings() { } +void TmainScore::createQuestionMark() { + if (!m_questMark) { + m_questMark = new QGraphicsSimpleTextItem(); + m_questMark->hide(); +// #if defined(Q_OS_MACX) +// m_questMark->setFont(TnooFont(10)); +// #else + m_questMark->setFont(TnooFont(8)); +// #endif + scoreScene()->addItem(m_questMark); + QColor c = gl->EquestionColor; + c.setAlpha(30); + m_questMark->setBrush(QBrush(c)); + m_questMark->setText("?"); + m_questMark->setScale(scene()->height() / m_questMark->boundingRect().height()); + m_questMark->setPos(staff()->pos().x() + (staff()->width() - m_questMark->boundingRect().width() * m_questMark->scale()) / 2, + (scene()->height() - m_questMark->boundingRect().height() * m_questMark->scale()) / 2 ); + m_questMark->setZValue(4); + } +} + + + void TmainScore::createBgRect(QColor c, qreal width, QPointF pos) { QGraphicsRectItem* bgRect = new QGraphicsRectItem; bgRect->setParentItem(staff()); diff --git a/src/score/tmainscore.h b/src/score/tmainscore.h index 967f71a390ad34938f27e1a1b410699308d1c0e5..8af261baf5f90fa15ae1905edec63dfeca22fb0d 100644 --- a/src/score/tmainscore.h +++ b/src/score/tmainscore.h @@ -165,6 +165,7 @@ protected slots: private: void restoreNotesSettings(); /** Sets notes colors according to globals. */ void performScordatureSet(); /** Common method to set scordature */ + void createQuestionMark(); virtual void addStaff(TscoreStaff* st = 0); diff --git a/src/score/tmultiscore.cpp b/src/score/tmultiscore.cpp index 2c5f9e538a339c6d5b8194b58b9081a6113632c8..73889db94c84cdc1e46b945dbc42e2c686936864 100644 --- a/src/score/tmultiscore.cpp +++ b/src/score/tmultiscore.cpp @@ -70,6 +70,7 @@ void TmultiScore::setInsertMode(TmultiScore::EinMode mode) { scoreScene()->left()->enableToAddNotes(false); // It has to be invoked before deleteNotes() to hide 'enter note' text scoreScene()->right()->enableToAddNotes(false); deleteNotes(); + staff()->noteSegment(0)->setBackgroundColor(-1); // unset background staff()->setStafNumber(-1); staff()->setViewWidth(0.0); m_addNoteAnim = false; diff --git a/src/settings/tlaysettings.cpp b/src/settings/tlaysettings.cpp index b8ca8150f37e3e0cbbfd8594c71ae2b3ae386b16..ac474f5aed05202452d5e571b9d5d72e4725f96b 100644 --- a/src/settings/tlaysettings.cpp +++ b/src/settings/tlaysettings.cpp @@ -22,6 +22,7 @@ #include <music/tmelody.h> #include <widgets/tvolumeview.h> #include <graphics/tnotepixmap.h> +// #include <tpath.h> #include <QtWidgets> @@ -42,8 +43,9 @@ TlaySettings::TlaySettings(TlayoutParams* layParams, QWidget* parent) : m_textUnderRadio->setChecked(true); else if (m_layParams->iconTextOnToolBar == Qt::ToolButtonIconOnly) m_iconsOnlyRadio->setChecked(true); - else - m_textOnlyRadio->setChecked(true); +// else // TODO uncomment when text only will be implemented +// m_textOnlyRadio->setChecked(true); + m_textOnlyRadio->hide(); m_toolBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); // hints m_hintBox = new QGroupBox(tr("hints"), this); @@ -69,6 +71,8 @@ TlaySettings::TlaySettings(TlayoutParams* layParams, QWidget* parent) : mel->addNote(Tchunk(Tnote(1, 0), Trhythm())); mel->addNote(Tchunk(Tnote(2, 0), Trhythm())); mel->addNote(Tchunk(Tnote(3, 0), Trhythm())); + mel->addNote(Tchunk(Tnote(4, 0), Trhythm())); + mel->addNote(Tchunk(Tnote(5, 0), Trhythm())); QLabel *scoreLab = new QLabel(pixToHtml(getMelodyPixmap(mel)), this); scoreLab->setAlignment(Qt::AlignCenter); scoreLab->setStyleSheet("border: 1px solid palette(Text); border-radius: 10px; background-color: palette(Base);"); @@ -80,6 +84,7 @@ TlaySettings::TlaySettings(TlayoutParams* layParams, QWidget* parent) : m_guitarBox = new QGroupBox(tr("guitar"), this); m_guitarBox->setCheckable(true); m_guitarBox->setChecked(m_layParams->guitarEnabled); +// m_guitarBox->setStyleSheet(QString("background-image: url(%1);}").arg(Tpath::img("fingbg"))); // layout QVBoxLayout *mainLay = new QVBoxLayout; @@ -143,7 +148,7 @@ void TlaySettings::resizeEvent(QResizeEvent*) { // m_toolBox->setFixedHeight(height() * 0.1); // m_hintBox->setFixedHeight(height() * 0.1); // m_soundBox->setFixedHeight(height() * 0.1); - m_guitarBox->setFixedHeight(height() * 0.22); + m_guitarBox->setFixedHeight(height() * 0.18); }