Skip to content
Snippets Groups Projects
Commit 65380cbe authored by SeeLook's avatar SeeLook
Browse files

Get rid of volume messages, there was more doubts and confusions than...

Get rid of volume messages, there was more doubts and confusions than benefits. But low level audio stack still can handle them.
parent 4b069626
Branches
Tags
No related merge requests found
1.???
1.4.0
- new method to make random melodies more... melodic
- melody can be randomized from selected notes, i.e. pentatonic scale
- so added level with pentatonic scales
- added notifications about too hi/low input volume
- improved look of sound views, better fit to high DPI screens
ANDROID
- reduced paint operations, application works even 2-4 times faster
- reduced number of paint operations, works even 2-4 times faster
- volume settings and pitch preview can be invoked with volume keys
- stop pitch detection when app is going background, restore when backs
BUGS FIXES
- other small fixes
1.3.0 alpha1
- removed roundness of widget/tips
- scroll-able widgets can be flicked with mouse/finger
- improved scaling of dialog windows
- prepared code for further features
Under the hood
- Android and Desktop code are in the single branch now
- reorganized layout of libraries, score is in separate lib
- exam execution moved to plugin
1.2A.7 rc3
ANDROID
- handle pinch gesture to zoom score in/out
......
......@@ -35,11 +35,6 @@
#include <QtCore/qdebug.h>
/*static*/
QString TpitchView::m_tooLowText = QLatin1String("<span style=\"color: red;\">") + tr("Too low volume of input sound!").toUpper() + QLatin1String("</span>");
QString TpitchView::m_tooHighText = QLatin1String("<span style=\"color: red;\">") + tr("Too high volume of input sound!").toUpper() + QLatin1String("</span>");
TpitchView::TpitchView(TaudioIN* audioIn, QWidget* parent, bool pauseActive) :
QWidget(parent),
m_audioIN(audioIn),
......@@ -93,8 +88,6 @@ void TpitchView::setAudioInput(TaudioIN* audioIn) {
connect(m_audioIN, &TaudioIN::stateChanged, this, &TpitchView::inputStateChanged);
connect(m_audioIN, &TaudioIN::destroyed, this, &TpitchView::inputDeviceDeleted);
// Redirect signals, send appropriate messages
connect(m_audioIN, &TaudioIN::lowPCMvolume, [=]{ emit lowPCMvolume(m_tooLowText); });
connect(m_audioIN, &TaudioIN::hiPCMvolume, [=]{ emit hiPCMvolume(m_tooHighText); });
setDisabled(false);
} else
inputDeviceDeleted();
......
......@@ -89,20 +89,10 @@ public:
/** Starts animation displaying correction of unclear sound. */
void outOfTuneAnim(float outTune, int duration = 300);
/** Text: Too low volume of input sound! */
static QString tooLowInputText() { return m_tooLowText; }
/** Text: Too high volume of input sound! */
static QString tooHighInputText() { return m_tooHighText; }
signals:
/** Emitted when correction animation finish */
void correctingFinished();
/** Emitted when raw PCM volume is too high or too low for a few detected notes */
void lowPCMvolume(const QString&);
void hiPCMvolume(const QString&);
protected slots:
void noteSlot();
......@@ -142,7 +132,6 @@ private:
QAction *m_pauseAct;
void updatePauseActIcon(); /**< Depends on action state (checked or not) sets the icon */
#endif
static QString m_tooLowText, m_tooHighText;
};
#endif // TPITCHVIEW_H
......@@ -115,8 +115,6 @@ TquickAudioDialog::TquickAudioDialog(QWidget* parent) :
connect(m_exitButt, &QPushButton::clicked, this, &TquickAudioDialog::exitSlot);
connect(m_sysVolButt, &QPushButton::clicked, this, &TquickAudioDialog::exitSlot);
connect(m_outVolSlider, &QSlider::valueChanged, this, &TquickAudioDialog::volChangedSlot);
connect(pitchView(), &TpitchView::lowPCMvolume, this, &TquickAudioDialog::volumeWarningSlot);
connect(pitchView(), &TpitchView::hiPCMvolume, this, &TquickAudioDialog::volumeWarningSlot);
if (SOUND->sniffer) {
pitchView()->setAudioInput(SOUND->sniffer);
......@@ -198,12 +196,6 @@ void TquickAudioDialog::keyPressEvent(QKeyEvent* e) {
}
void TquickAudioDialog::volumeWarningSlot(const QString& message) {
m_tuneLab->setText(message);
QTimer::singleShot(7000, [=]{ setTuningText(); }); // revert label with tuning frequencies after 7s
}
void TquickAudioDialog::setTuningText() {
QString br = QStringLiteral("<br>");
QString tuneText = TabstractSoundView::getStringsFreqText(Tcore::gl()->Gtune(), Tcore::gl()->A->a440diff);
......
......@@ -62,7 +62,6 @@ protected:
void exitSlot();
void sysVolSlot();
void volChangedSlot(int v);
void volumeWarningSlot(const QString& message);
virtual void keyPressEvent(QKeyEvent* e);
......
......@@ -196,8 +196,6 @@ MainWindow::MainWindow(QWidget *parent) :
connect(m_score, &TmainScore::clefChanged, this, &MainWindow::adjustAmbitus);
connect(m_guitar, &TfingerBoard::guitarClicked, this, &MainWindow::guitarWasClicked);
connect(m_innerWidget, &TmainView::sizeChanged, this, &MainWindow::updateSize);
connect(m_pitchView, &TpitchView::lowPCMvolume, this, &MainWindow::pcmStatusMessage);
connect(m_pitchView, &TpitchView::hiPCMvolume, this, &MainWindow::pcmStatusMessage);
#if defined (Q_OS_ANDROID)
connect(qApp, &QGuiApplication::applicationStateChanged, [=](Qt::ApplicationState state){
......@@ -304,14 +302,8 @@ void MainWindow::openFile(QString runArg) {
file.close();
if (Texam::couldBeExam(hdr)) {
if (Texam::isExamVersion(hdr)) {
// prepareToExam();
runArg.prepend(QLatin1String("file:")); // exam file path starts with 'file:' text
startExamPlugin(runArg);
// m_examPlugin = new TpluginsLoader(this);
// if (m_examPlugin->load(TpluginsLoader::e_exam)) {
// connect(m_examPlugin->node(), &TpluginObject::value, this, &MainWindow::examMessageSlot);
// m_examPlugin->init(runArg, this);
// }
}
} else {
if (Tlevel::couldBeLevel(hdr)) {
......@@ -392,16 +384,10 @@ void MainWindow::openLevelCreator(QString levelFile) {
bool ok;
int levelNr = levelText.toInt(&ok);
if (ok) {
// prepareToExam();
QString args = QString("level:%1").arg(levelNr); // plugin run argument is string 'level:' with level number
if (startExercise)
args.append(QLatin1String(":exercise")); // and ';exercise' string if exercise has to be started
startExamPlugin(args);
// m_examPlugin = new TpluginsLoader(this);
// if (m_examPlugin->load(TpluginsLoader::e_exam)) {
// connect(m_examPlugin->node(), &TpluginObject::value, this, &MainWindow::examMessageSlot);
// m_examPlugin->init(args, this);
// }
}
else
m_sound->go(); // restore pitch detection
......@@ -409,13 +395,7 @@ void MainWindow::openLevelCreator(QString levelFile) {
void MainWindow::startExamSlot() {
// prepareToExam();
startExamPlugin(QString());
// m_examPlugin = new TpluginsLoader(this);
// if (m_examPlugin->load(TpluginsLoader::e_exam)) {
// connect(m_examPlugin->node(), &TpluginObject::value, this, &MainWindow::examMessageSlot);
// m_examPlugin->init(QString(), this);
// }
}
......@@ -556,15 +536,6 @@ void MainWindow::adjustAmbitus() {
m_sound->setDefaultAmbitus();
}
void MainWindow::pcmStatusMessage(const QString& msg) {
#if defined (Q_OS_ANDROID)
#else
m_statusLabel->setMessage(msg, 7000);
#endif
}
//#################################################################################################
//################### PRIVATE ############################################
//#################################################################################################
......
......@@ -90,7 +90,6 @@ protected slots:
* It adjust ambitus to score possibilities if clef is differ than default
* or to instrument scale if clef backs to default */
void adjustAmbitus();
void pcmStatusMessage(const QString& msg);
private:
void startExamPlugin(const QString& pluginArgs);
......
......@@ -414,8 +414,6 @@ AudioInSettings::AudioInSettings(TaudioParams* params, Ttune* tune, QWidget* par
connect(m_topList, &TlistMenu::currentRowChanged, this, &AudioInSettings::testSlot);
#else
connect(m_toolBox, SIGNAL(currentChanged(int)), this, SLOT(testSlot()));
connect(pitchView, &TpitchView::lowPCMvolume, this, &AudioInSettings::pcmStatusMessage);
connect(pitchView, &TpitchView::hiPCMvolume, this, &AudioInSettings::pcmStatusMessage);
#if defined (Q_OS_LINUX) || defined (Q_OS_WIN)
connect(m_JACK_ASIO_ChB, &QCheckBox::clicked, this, &AudioInSettings::JACKASIOSlot);
#endif
......@@ -782,11 +780,6 @@ void AudioInSettings::adjustInstrSlot(int instr) {
}
void AudioInSettings::pcmStatusMessage(const QString& msg) {
QStatusTipEvent e(msg);
qApp->notify(this, &e);
}
#if !defined (Q_OS_ANDROID) && (defined (Q_OS_LINUX) || defined (Q_OS_WIN))
void AudioInSettings::JACKASIOSlot() {
TrtAudio::setJACKorASIO(m_JACK_ASIO_ChB->isChecked());
......
......@@ -113,7 +113,6 @@ protected slots:
void splitByVolChanged(bool enab);
void skipStillerChanged(bool enab);
void adjustInstrSlot(int instr);
void pcmStatusMessage(const QString& msg);
private:
/** Calculates frequencies of strings related to a440diff and sets status tip.*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment