diff --git a/TODO b/TODO index d0f529ead9b77c1a62ad56b51428df5848349db1..d91a31364cac79dc81708f1a5f8290bff73d3324 100644 --- a/TODO +++ b/TODO @@ -22,10 +22,7 @@ MINOR: if it is started from creator - there is highlight of message but when started from 'start' menu - there is not - replace all font-szie: 20px with <big> -- lock right button and space bar during correction -- try to avoid many resizeEvent-s of TmultiScore during window size change - when exercise is finished and analysis dialog was opened message text remains -- add minimal zoom value depends on screen resolution - stop sniffer when melody dialogues are opening - changing tool bar auto-hiding causes sometimes locked melody menu - auto hidden tool bar remains big after decreased window size @@ -40,6 +37,8 @@ TRANSLATIONS ==== SMALL NEW FEATURES/IMPROVEMENTS ============================================================= +- try to avoid many resizeEvent-s of TmultiScore during window size change +- add minimal zoom value depends on screen resolution - average effectiveness line in chart - make exam summary pretty - certificates would have some additional data about melodies diff --git a/src/libs/sound/trtaudioin.cpp b/src/libs/sound/trtaudioin.cpp index e1164fef238c209a3f7fb88a0b2244465172b97e..18ffc16aee57ea8e5fa22b57375801488c7315ba 100755 --- a/src/libs/sound/trtaudioin.cpp +++ b/src/libs/sound/trtaudioin.cpp @@ -21,7 +21,7 @@ #if defined(Q_OS_WIN) #include "tasioemitter.h" #endif -#include <QDebug> + /*static */ diff --git a/src/libs/sound/trtaudioin.h b/src/libs/sound/trtaudioin.h index 93b7689e0d6cd317fcd32754a41c281046efd026..87d5c00ff031e704b5c66e5537a549f8713ded11 100755 --- a/src/libs/sound/trtaudioin.h +++ b/src/libs/sound/trtaudioin.h @@ -22,6 +22,7 @@ #include "nootkacoreglobal.h" #include <QObject> #include <QStringList> +#include <QDebug> #include <music/tnote.h> #include <music/tnotestruct.h> #include "rt/RtAudio.h" @@ -128,9 +129,11 @@ public slots: void stopListening(); protected: - static bool inCallBack(void* inBuff, unsigned int nBufferFrames, const RtAudioStreamStatus&) { + static bool inCallBack(void* inBuff, unsigned int nBufferFrames, const RtAudioStreamStatus& st) { if (m_goingDelete || instance()->isStoped()) return true; + if (st) + qDebug() << "input buffer underflow"; qint16 *in = (qint16*)inBuff; qint16 value; for (int i = 0; i < nBufferFrames; i++) { diff --git a/src/libs/sound/tsound.cpp b/src/libs/sound/tsound.cpp index 1c45b73f2922b6db96a9a6faa587054512710365..93dc5dfe5b259aaac7e82389b938d52eda078bee 100755 --- a/src/libs/sound/tsound.cpp +++ b/src/libs/sound/tsound.cpp @@ -148,7 +148,7 @@ void Tsound::setPitchView(TpitchView* pView) { m_pitchView->setIntonationAccuracy(Tcore::gl()->A->intonation); m_pitchView->setAudioInput(sniffer); if (sniffer) - QTimer::singleShot(1500, sniffer, SLOT(startListening())); + QTimer::singleShot(750, sniffer, SLOT(startListening())); // sniffer->startListening(); } diff --git a/src/libs/sound/widgets/tpitchview.cpp b/src/libs/sound/widgets/tpitchview.cpp index ce8c6681774d26859f05c571e235786b7c9f8182..0bb5c5703b2f90cd2e0bc50f062f4462bbbe40c6 100644 --- a/src/libs/sound/widgets/tpitchview.cpp +++ b/src/libs/sound/widgets/tpitchview.cpp @@ -81,7 +81,9 @@ void TpitchView::watchInput() { m_prevPitch = -1.0; m_watchTimer->start(75); connect(m_audioIN, &TaudioIN::noteStarted, this, &TpitchView::noteSlot); - if (m_intoView->accuracyChangeEnabled()) + if (m_intoView->accuracy() == TintonationView::e_noCheck && !m_intoView->accuracyChangeEnabled()) + m_intoView->setDisabled(true); + else m_intoView->setDisabled(false); } } @@ -96,8 +98,7 @@ void TpitchView::stopWatching() { if (m_intoView->isEnabled()) m_intoView->pitchSlot(0.0); } - if (m_intoView->accuracyChangeEnabled()) - m_intoView->setDisabled(true); + m_intoView->setDisabled(true); } diff --git a/src/main.cpp b/src/main.cpp index fcd0198e4ec743b829f841b5fc1428bd6645fb92..b70e6c6ce7a492c50f3165060d2c0c5e62387d82 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -76,6 +76,6 @@ int main(int argc, char *argv[]) delete w; delete gl; } while (resetConfig); - + return exitCode; } diff --git a/src/plugins/settings/audioinsettings.cpp b/src/plugins/settings/audioinsettings.cpp index 80d63c40788a00d4c422ab1411f1831b5383baf5..cbb2197f4e7dbcfa711ff1fe1b70bdb181a6ab41 100755 --- a/src/plugins/settings/audioinsettings.cpp +++ b/src/plugins/settings/audioinsettings.cpp @@ -452,31 +452,31 @@ float AudioInSettings::offPitch(float pitch) { void AudioInSettings::getFreqStatusTip() { - QString freqTxt = ""; - if (m_tune->stringNr() > 2) { // guitar - for (int i = 1; i <= m_tune->stringNr(); i++) { - freqTxt += QString("<span style=\"font-family: nootka;\">%1</span>%2 = %3 Hz, ").arg(i). - arg((m_tune->str(i)).toRichText()). - arg(offPitch((float)m_tune->str(i).chromatic() + 47), 0, 'f', 1); - if (i % 2 == 0 && i < 6) - freqTxt += "<br>"; // two entries per line - else if (i % 3 == 0 && i < 6) - freqTxt += "ALT_BR"; // three entries per line - } - } else { // no guitar - C-major scale frequencies - for (int i = 1; i < 8; i++) { - freqTxt += QString("<b>%1</b> = %2 Hz, ").arg(Tnote(i, 1, 0).toRichText()). - arg(offPitch((float)Tnote(i, 1, 0).chromatic() + 47), 0, 'f', 1); - if (i % 2 == 0 && i < 7) - freqTxt += "<br>"; // three entries per line - else if (i % 3 == 0 && i < 7) - freqTxt += "ALT_BR"; // four entries per line - } - } - QString freq2 = freqTxt; - freqLab->setStatusTip(tr("Frequency of detected note. You can use this for tuning.") + "<br>" + - freq2.replace("<br>", "").replace("ALT_BR", "<br>")); // three entries per line in status tip - tuneFreqlab->setText(freqTxt.replace("ALT_BR", "")); // two entries per line on the label + QString freqTxt = ""; + if (m_tune->stringNr() > 2) { // guitar + for (int i = 1; i <= m_tune->stringNr(); i++) { + freqTxt += QString("<span style=\"font-family: nootka;\">%1</span>%2 = %3 Hz, ").arg(i). + arg((m_tune->str(i)).toRichText()). + arg(offPitch((float)m_tune->str(i).chromatic() + 47), 0, 'f', 1); + if (i % 2 == 0 && i < 6) + freqTxt += "<br>"; // two entries per line + else if (i % 3 == 0 && i < 6) + freqTxt += "ALT_BR"; // three entries per line + } + } else { // no guitar - C-major scale frequencies + for (int i = 1; i < 8; i++) { + freqTxt += QString("<b>%1</b> = %2 Hz, ").arg(Tnote(i, 1, 0).toRichText()). + arg(offPitch((float)Tnote(i, 1, 0).chromatic() + 47), 0, 'f', 1); + if (i % 2 == 0 && i < 7) + freqTxt += "<br>"; // three entries per line + else if (i % 3 == 0 && i < 7) + freqTxt += "ALT_BR"; // four entries per line + } + } + QString freq2 = freqTxt; + freqLab->setStatusTip(tr("Frequency of detected note. You can use this for tuning.") + "<br>" + + freq2.replace("<br>", "").replace("ALT_BR", "<br>")); // three entries per line in status tip + tuneFreqlab->setText(freqTxt.replace("ALT_BR", "")); // two entries per line on the label } @@ -577,6 +577,7 @@ void AudioInSettings::testSlot() { if (m_audioIn) { pitchView->stopWatching(); m_audioIn->stopListening(); + m_intonationCombo->setCurrentIndex(m_audioIn->intonationAccuracy()); } testButt->setText(testTxt); testButt->setIcon(QIcon(style()->standardIcon(QStyle::SP_MediaPlay))); diff --git a/src/plugins/settings/tsettingsdialog.cpp b/src/plugins/settings/tsettingsdialog.cpp index e12d0fcc2a6d5cc3a90e9113a1c52865d3e7eaa7..c84f9b6b081b394c06021a0f187c7de9808937af 100755 --- a/src/plugins/settings/tsettingsdialog.cpp +++ b/src/plugins/settings/tsettingsdialog.cpp @@ -100,6 +100,12 @@ TsettingsDialog::TsettingsDialog(QWidget *parent, EsettingsMode mode) : connect(defaultBut, SIGNAL(pressed()), this, SLOT(restoreDefaults())); connect(m_helpButt, SIGNAL(pressed()), this, SLOT(helpSlot())); +// int maxW = 0; +// for (int i = 0; i < navList->count(); ++i) { +// maxW = qMax<int>(navList->visualItemRect(navList->item(i)).width(), maxW); +// } +// navList->setFixedWidth(maxW); + if (mode == e_settings) { navList->setCurrentRow(0); changeSettingsWidget(1); // score settings must to exist