Compare commits

..

9 Commits
v1.2 ... master

@ -1,2 +1,19 @@
# pa-calculator # PA Calculator
Der PA Calculator dient der Berechnung von Limiterwerten für PA-Anlagen, sowie einem Tool, welches eine Stapelverarbeitung von Lautheitsanalysen sowie einer Korrekturempfehlung durchführen kann.
## Einrichten der Build-Umgebung
1. Installation von QT Version > 6.4.2 mit QT Installation Framework
2. (Auf Windows) Installation msvc2019 oder neuer
3. Installation 7zip
4. Umgebungsvariablen hinzufügen (Qt Binaries, 7-Zip, QtInstallerFramework)
## Release einer neuen Version
Zum Kompilieren einer neuen Version sind folgende Schritte zu beachten:
Die neue Version vor Kompilierung in folgenden Dateien anpassen:
* source/PA_Calculator.pro
* installer/config/config_xxx.xml
* installer/packages/com.dkmtech.pacalculator/meta/package.xml
Im Release-Modus Projekt kompilieren.
Im Anschluss Datei installer/createInstaller_xxx ausführen -> setup.exe

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Installer> <Installer>
<Name>PA Calculator</Name> <Name>PA Calculator</Name>
<Version>1.2.0</Version> <Version>1.4.0</Version>
<Title>PA Calculator Installer</Title> <Title>PA Calculator Installer</Title>
<Publisher>DKM-Tech</Publisher> <Publisher>DKM-Tech</Publisher>
<StartMenuDir>DKM-Tech</StartMenuDir> <StartMenuDir>DKM-Tech</StartMenuDir>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Installer> <Installer>
<Name>PA Calculator</Name> <Name>PA Calculator</Name>
<Version>1.2.0</Version> <Version>1.4.0</Version>
<Title>PA Calculator Installer</Title> <Title>PA Calculator Installer</Title>
<Publisher>DKM-Tech</Publisher> <Publisher>DKM-Tech</Publisher>
<StartMenuDir>DKM-Tech</StartMenuDir> <StartMenuDir>DKM-Tech</StartMenuDir>

@ -6,5 +6,5 @@
<ReleaseDate>2022-02-06</ReleaseDate> <ReleaseDate>2022-02-06</ReleaseDate>
<Name>com.dkmtech.installer</Name> <Name>com.dkmtech.installer</Name>
<Virtual>true</Virtual> <Virtual>true</Virtual>
<UpdateText>DKM-Teh Installer</UpdateText> <UpdateText>DKM-Tech Installer</UpdateText>
</Package> </Package>

@ -3,8 +3,8 @@
<DisplayName>Technik-AG Library</DisplayName> <DisplayName>Technik-AG Library</DisplayName>
<Description>Install pre-filled Library File with Devices of Technik-AG</Description> <Description>Install pre-filled Library File with Devices of Technik-AG</Description>
<Description xml:lang="de_de">Library-Datei mit Geräten der Technik-AG des GSG Daun</Description> <Description xml:lang="de_de">Library-Datei mit Geräten der Technik-AG des GSG Daun</Description>
<Version>1</Version> <Version>2</Version>
<ReleaseDate>2021-11-07</ReleaseDate> <ReleaseDate>2022-03-14</ReleaseDate>
<Name>com.dkmtech.libraryfile</Name> <Name>com.dkmtech.libraryfile</Name>
<Default>false</Default> <Default>false</Default>
<Script>installscript.qs</Script> <Script>installscript.qs</Script>

@ -2,8 +2,8 @@
<Package> <Package>
<DisplayName>PA-Calculator</DisplayName> <DisplayName>PA-Calculator</DisplayName>
<Description>Install PA-Calculator</Description> <Description>Install PA-Calculator</Description>
<Version>1.2.0</Version> <Version>1.4.0</Version>
<ReleaseDate>2022-02-20</ReleaseDate> <ReleaseDate>2023-11-26</ReleaseDate>
<Licenses> <Licenses>
<License name="GNU GENERAL PUBLIC LICENSE" file="license.txt" /> <License name="GNU GENERAL PUBLIC LICENSE" file="license.txt" />
</Licenses> </Licenses>

@ -1,4 +1,4 @@
QT += core gui multimedia testlib QT += core gui multimedia network concurrent
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
@ -55,10 +55,10 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
RESOURCES += \ RESOURCES += \
resources.qrc resources.qrc
VERSION=1.2.0 VERSION=1.4.0
QMAKE_TARGET_PRODUCT = "PA-Calculator" QMAKE_TARGET_PRODUCT = "PA-Calculator"
QMAKE_TARGET_COMPANY = "DKM-Tech" QMAKE_TARGET_COMPANY = "DKM-Tech"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2022 by Alexander Diamadis" QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2023 by Alexander Diamadis"
commit = $$system(git rev-parse --short=8 HEAD) commit = $$system(git rev-parse --short=8 HEAD)

@ -84,7 +84,6 @@
<property name="font"> <property name="font">
<font> <font>
<pointsize>21</pointsize> <pointsize>21</pointsize>
<weight>75</weight>
<bold>true</bold> <bold>true</bold>
</font> </font>
</property> </property>
@ -122,9 +121,9 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
<y>140</y> <y>170</y>
<width>341</width> <width>341</width>
<height>121</height> <height>91</height>
</rect> </rect>
</property> </property>
<property name="font"> <property name="font">
@ -134,9 +133,9 @@
</property> </property>
<property name="html"> <property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.AppleSystemUIFont'; font-size:7pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Segoe UI'; font-size:7pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;a name=&quot;license-text&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;T&lt;/span&gt;&lt;span style=&quot; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;his program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;a name=&quot;license-text&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;T&lt;/span&gt;&lt;span style=&quot; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;his program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.&lt;/span&gt;&lt;/p&gt;
@ -160,6 +159,28 @@ p, li { white-space: pre-wrap; }
<string>Build: </string> <string>Build: </string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label_git">
<property name="geometry">
<rect>
<x>290</x>
<y>140</y>
<width>321</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Git-Repository: &lt;a href=&quot;https://git.aldiserver.de/DKM-Tech/pa-calculator&quot;&gt;git.aldiserver.de/DKM-Tech/pa-calculator&lt;/a&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</widget> </widget>
<resources> <resources>
<include location="resources.qrc"/> <include location="resources.qrc"/>

@ -254,28 +254,24 @@ void library::printAllAmps()
void library::on_listWidget_ampView_currentRowChanged(int currentRow) void library::on_listWidget_ampView_currentRowChanged(int currentRow)
{ {
if (initAmps){ if (currentRow>=0){
if (currentRow>=0){ ui->lineEdit_ampName->setText(QString::fromStdString(m_pCamp[currentRow].getName()));
ui->lineEdit_ampName->setText(QString::fromStdString(m_pCamp[currentRow].getName())); ui->comboBox_sensUnit->setCurrentIndex(m_pCamp[currentRow].getSensivityUnit());
ui->comboBox_sensUnit->setCurrentIndex(m_pCamp[currentRow].getSensivityUnit()); ui->doubleSpinBox_inputSensitivity->setValue(m_pCamp[currentRow].getSensitivity());
ui->doubleSpinBox_inputSensitivity->setValue(m_pCamp[currentRow].getSensitivity()); refreshModeOverview();
refreshModeOverview(); ui->listWidget_modeSelector->setCurrentRow(0);
ui->listWidget_modeSelector->setCurrentRow(0); ui->lineEdit_ampName->setEnabled(true);
ui->lineEdit_ampName->setEnabled(true); ui->doubleSpinBox_inputSensitivity->setEnabled(true);
ui->doubleSpinBox_inputSensitivity->setEnabled(true); ui->comboBox_sensUnit->setEnabled(true);
ui->comboBox_sensUnit->setEnabled(true); ui->lineEdit_modeName->setEnabled(true);
ui->lineEdit_modeName->setEnabled(true); ui->listWidget_modeSelector->setEnabled(true);
ui->listWidget_modeSelector->setEnabled(true); ui->spinBox_ratedImp->setEnabled(true);
ui->spinBox_ratedImp->setEnabled(true); ui->spinBox_ratedPower->setEnabled(true);
ui->spinBox_ratedPower->setEnabled(true);
}else }else
{ {
ui->lineEdit_ampName->setEnabled(false); ui->lineEdit_ampName->setEnabled(false);
ui->doubleSpinBox_inputSensitivity->setEnabled(false); ui->doubleSpinBox_inputSensitivity->setEnabled(false);
}
}else {
initAmps =true;
} }
} }
@ -436,29 +432,25 @@ void library::on_pushButton_addSpeaker_clicked()
void library::on_listWidget_speakerView_currentRowChanged(int currentRow) void library::on_listWidget_speakerView_currentRowChanged(int currentRow)
{ {
if (initSpeaker){ if (currentRow>=0){
if (currentRow>=0){ ui->lineEdit_speakerName->setText(QString::fromStdString(m_pSpeaker[currentRow].getName()));
ui->lineEdit_speakerName->setText(QString::fromStdString(m_pSpeaker[currentRow].getName())); ui->spinBox_speakerImp->setValue(m_pSpeaker[currentRow].getImpedance());
ui->spinBox_speakerImp->setValue(m_pSpeaker[currentRow].getImpedance()); ui->spinBox_speakerRMSPower->setValue(m_pSpeaker[currentRow].getRMSPower());
ui->spinBox_speakerRMSPower->setValue(m_pSpeaker[currentRow].getRMSPower()); ui->spinBox_speakerPeakPower->setValue(m_pSpeaker[currentRow].getPeakPower());
ui->spinBox_speakerPeakPower->setValue(m_pSpeaker[currentRow].getPeakPower()); ui->spinBox_speakerHPF->setValue(m_pSpeaker[currentRow].getHPF());
ui->spinBox_speakerHPF->setValue(m_pSpeaker[currentRow].getHPF());
ui->lineEdit_speakerName->setEnabled(true); ui->lineEdit_speakerName->setEnabled(true);
ui->spinBox_speakerImp->setEnabled(true); ui->spinBox_speakerImp->setEnabled(true);
ui->spinBox_speakerRMSPower->setEnabled(true); ui->spinBox_speakerRMSPower->setEnabled(true);
ui->spinBox_speakerPeakPower->setEnabled(true); ui->spinBox_speakerPeakPower->setEnabled(true);
ui->spinBox_speakerHPF->setEnabled(true); ui->spinBox_speakerHPF->setEnabled(true);
}else { }else {
ui->lineEdit_speakerName->setEnabled(false); ui->lineEdit_speakerName->setEnabled(false);
//ui->spinBox_speakerImp->setEnabled(false); //ui->spinBox_speakerImp->setEnabled(false);
//ui->spinBox_speakerRMSPower->setEnabled(false); //ui->spinBox_speakerRMSPower->setEnabled(false);
//ui->spinBox_speakerPeakPower->setEnabled(false); //ui->spinBox_speakerPeakPower->setEnabled(false);
//ui->spinBox_speakerHPF->setEnabled(false); //ui->spinBox_speakerHPF->setEnabled(false);
}
}else{
initSpeaker=true;
} }
} }
@ -579,17 +571,13 @@ void library::on_pushButton_Apply_clicked()
void library::on_listWidget_dacView_currentRowChanged(int currentRow) void library::on_listWidget_dacView_currentRowChanged(int currentRow)
{ {
if (initDacs){ if (currentRow>=0){
if (currentRow>=0){ ui->lineEdit_dacName->setText(QString::fromStdString(m_pDac[currentRow].name()));
ui->lineEdit_dacName->setText(QString::fromStdString(m_pDac[currentRow].name())); ui->spinBox_dacOutputLevel->setValue(m_pDac[currentRow].outputLevel());
ui->spinBox_dacOutputLevel->setValue(m_pDac[currentRow].outputLevel()); ui->lineEdit_dacName->setEnabled(true);
ui->lineEdit_dacName->setEnabled(true); ui->spinBox_dacOutputLevel->setEnabled(true);
ui->spinBox_dacOutputLevel->setEnabled(true);
}else{
ui->lineEdit_dacName->setEnabled(false);
}
}else{ }else{
initDacs=true; ui->lineEdit_dacName->setEnabled(false);
} }
} }

@ -222,7 +222,7 @@
<item> <item>
<widget class="QPushButton" name="pushButton_applyMode"> <widget class="QPushButton" name="pushButton_applyMode">
<property name="text"> <property name="text">
<string>Apply</string> <string>Apply mode</string>
</property> </property>
</widget> </widget>
</item> </item>

@ -10,12 +10,25 @@
#include <QFileDialog> #include <QFileDialog>
#include "about.h" #include "about.h"
#include "analyzer.h" #include "analyzer.h"
#include <QJsonDocument>
#include <Qfile>
#include <QJsonParseError>
#include <QJsonObject>
#include <QJsonArray>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent) MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent) : QMainWindow(parent)
, ui(new Ui::MainWindow) , ui(new Ui::MainWindow)
{ {
ui->setupUi(this); ui->setupUi(this);
manager = new QNetworkAccessManager();
checkUpdates();
m_ampCount=0; m_ampCount=0;
m_pCAmp=Q_NULLPTR; m_pCAmp=Q_NULLPTR;
@ -68,6 +81,7 @@ void MainWindow::on_pushButton_requestLimiter_clicked()
return; return;
} }
qreal vMaxSpeakerInRMS=20*std::log10(qSqrt(speakerImp*speakerRMS)/0.7746); qreal vMaxSpeakerInRMS=20*std::log10(qSqrt(speakerImp*speakerRMS)/0.7746);
qreal vMaxSpeakerInPeak=20*std::log10(qSqrt(speakerImp*speakerPeak)/0.7746); qreal vMaxSpeakerInPeak=20*std::log10(qSqrt(speakerImp*speakerPeak)/0.7746);
@ -91,6 +105,7 @@ void MainWindow::on_pushButton_requestLimiter_clicked()
qreal releaseTimeRMS=attackTimeRMS*8; qreal releaseTimeRMS=attackTimeRMS*8;
qreal releaseTimePeak=attackTimeRMS; qreal releaseTimePeak=attackTimeRMS;
bool rmsRequired=true;
@ -98,6 +113,7 @@ void MainWindow::on_pushButton_requestLimiter_clicked()
QMessageBox msgBox(QMessageBox::Warning,"Amplifier can't deliver maximum RMS power","The maximum power level of the amplifier is below the maximum RMS power level of the speaker. To protect the speaker from a distorted signal the amplifier might deliver, a peak limiter is required with the amplifiers input sensitivty set as its threshold."); QMessageBox msgBox(QMessageBox::Warning,"Amplifier can't deliver maximum RMS power","The maximum power level of the amplifier is below the maximum RMS power level of the speaker. To protect the speaker from a distorted signal the amplifier might deliver, a peak limiter is required with the amplifiers input sensitivty set as its threshold.");
msgBox.exec(); msgBox.exec();
ui->label_thresholdRMS->setText(QString("not required")); ui->label_thresholdRMS->setText(QString("not required"));
rmsRequired=false;
ui->label_attackTimeRMS->setText(QString::number(attackTimeRMS,'f',2)+QString(" ms")); ui->label_attackTimeRMS->setText(QString::number(attackTimeRMS,'f',2)+QString(" ms"));
ui->label_releaseTimeRMS->setText(QString::number(releaseTimeRMS,'f',2)+QString(" ms")); ui->label_releaseTimeRMS->setText(QString::number(releaseTimeRMS,'f',2)+QString(" ms"));
ui->label_UMaxSpeakerInRMS->setText(QString::number(vMaxSpeakerInRMS,'f',2)+QString(" dBU (")+QString::number(qSqrt(speakerImp*speakerRMS),'f',2)+QString(" V)")); ui->label_UMaxSpeakerInRMS->setText(QString::number(vMaxSpeakerInRMS,'f',2)+QString(" dBU (")+QString::number(qSqrt(speakerImp*speakerRMS),'f',2)+QString(" V)"));
@ -114,6 +130,7 @@ void MainWindow::on_pushButton_requestLimiter_clicked()
msgBox.exec(); msgBox.exec();
if (QString::number(thresholdRMS,'f',1)==QString::number(-18-(ui->spinBox_digitalNominalLevel->value()-vAmpsens_dBu),'f',1)){ if (QString::number(thresholdRMS,'f',1)==QString::number(-18-(ui->spinBox_digitalNominalLevel->value()-vAmpsens_dBu),'f',1)){
ui->label_thresholdRMS->setText(QString("not required")); ui->label_thresholdRMS->setText(QString("not required"));
rmsRequired=false;
}else{ }else{
ui->label_thresholdRMS->setText(QString::number(thresholdRMS,'f',1)+QString(" dBFS")); ui->label_thresholdRMS->setText(QString::number(thresholdRMS,'f',1)+QString(" dBFS"));
} }
@ -140,7 +157,20 @@ void MainWindow::on_pushButton_requestLimiter_clicked()
ui->label_UMaxAmpInPeak->setText(QString::number(vMaxAmpInPeak,'f',2)+QString(" dBU (")+QString::number(qPow(10,vMaxAmpInPeak/20)*0.7746,'f',2)+QString(" V)")); ui->label_UMaxAmpInPeak->setText(QString::number(vMaxAmpInPeak,'f',2)+QString(" dBU (")+QString::number(qPow(10,vMaxAmpInPeak/20)*0.7746,'f',2)+QString(" V)"));
} }
if (ui->checkBox_optimizeGain->checkState()){
qreal diff=0;
qreal digitalHeadroom=ui->spinBox_digitalHeadroom->value();
while (thresholdPeak+diff+1<=-digitalHeadroom){
diff++;
}
ui->label_thresholdPeak->setText(QString::number(thresholdPeak+diff,'f',1)+QString(" dBFS"));
if (rmsRequired){
ui->label_thresholdRMS->setText(QString::number(thresholdRMS+diff,'f',1)+QString(" dBFS"));
}
ui->label_inputVolumeControl->setText(QString::number(-diff)+QString(" dB"));
}else {
ui->label_inputVolumeControl->setText(QString("0 dB"));
}
} }
@ -354,3 +384,47 @@ void MainWindow::on_actionOpen_Loudness_Analyzer_triggered()
analyzerWindow.exec(); analyzerWindow.exec();
} }
void MainWindow::on_checkBox_optimizeGain_stateChanged(int arg1)
{
if (ui->checkBox_optimizeGain->checkState()){
ui->spinBox_digitalHeadroom->setEnabled(true);
}else{
ui->spinBox_digitalHeadroom->setEnabled(false);
}
}
void MainWindow::checkUpdates()
{
QObject::connect(manager, &QNetworkAccessManager::finished,
this,&MainWindow::checkUpdatesFinished);
request.setUrl(QUrl("https://git.aldiserver.de/api/v1/repos/DKM-Tech/pa-calculator/releases?draft=false&pre-release=false&per_page=1&limit=1"));
manager->get(request);
}
void MainWindow::checkUpdatesFinished(QNetworkReply *reply)
{
if (reply->error()) {
//qDebug() << reply->errorString();
return;
}
QString ReplyText = reply->readAll();
QJsonDocument doc = QJsonDocument::fromJson(ReplyText.toUtf8());
QJsonArray array = doc.array();
QJsonObject obj=array.at(0).toObject();
QString current_version=obj.value("tag_name").toString().remove(0,1);
QString current_version_url=obj.value("html_url").toString();
QString installed_version = APP_VERSION;
installed_version=installed_version.mid(0,installed_version.lastIndexOf('.'));
//qDebug() << "Neueste Version: " <<current_version;
//qDebug() << "Installierte Version: " <<installed_version;
if (current_version!=installed_version){
QMessageBox msgBox;
msgBox.setTextFormat(Qt::RichText);
msgBox.setText("Es ist ein Update verfügbar!<br>Installierte Version: "+installed_version+"<br>Verfügbare Version: "+current_version+"<br> Du kannst das Update <a href='"+current_version_url+"'>hier</a> herunterladen.");
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
}
}

@ -6,6 +6,14 @@
#include "cspeaker.h" #include "cspeaker.h"
#include <cdac.h> #include <cdac.h>
#include <QThreadPool>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QFuture>
#include <QtConcurrent>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; } namespace Ui { class MainWindow; }
QT_END_NAMESPACE QT_END_NAMESPACE
@ -18,6 +26,7 @@ public:
MainWindow(QWidget *parent = nullptr); MainWindow(QWidget *parent = nullptr);
~MainWindow(); ~MainWindow();
private slots: private slots:
void on_ComboBox_selectSensUnit_currentIndexChanged(int index); void on_ComboBox_selectSensUnit_currentIndexChanged(int index);
@ -42,6 +51,11 @@ private slots:
void on_actionOpen_Loudness_Analyzer_triggered(); void on_actionOpen_Loudness_Analyzer_triggered();
void on_checkBox_optimizeGain_stateChanged(int arg1);
void checkUpdatesFinished(QNetworkReply *reply);
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
cAmp* m_pCAmp; cAmp* m_pCAmp;
@ -60,8 +74,12 @@ private:
void refreshLibraryDacs(); void refreshLibraryDacs();
void checkUpdates();
void loadLibrary(); void loadLibrary();
void saveLibrary(); void saveLibrary();
QNetworkAccessManager *manager;
QNetworkRequest request;
QFuture<void> requestFuture;
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1242</width> <width>1606</width>
<height>590</height> <height>639</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -51,6 +51,9 @@
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
@ -134,6 +137,19 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="4" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label_19"> <widget class="QLabel" name="label_19">
<property name="text"> <property name="text">
@ -168,19 +184,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0" colspan="2"> <item row="8" column="0" colspan="2">
<widget class="QPushButton" name="pushButton"> <widget class="QPushButton" name="pushButton">
<property name="font"> <property name="font">
@ -226,6 +229,9 @@
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum> <enum>QLayout::SetDefaultConstraint</enum>
</property> </property>
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
@ -318,29 +324,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label_21"> <widget class="QLabel" name="label_24">
<property name="text"> <property name="text">
<string>Load Speaker from library</string> <string>Number of speaker in parallel</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1">
<widget class="QComboBox" name="comboBox_librarySpeaker"/>
</item>
<item row="6" column="1">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1"> <item row="5" column="1">
<widget class="QSpinBox" name="spinBox_speakerCount"> <widget class="QSpinBox" name="spinBox_speakerCount">
<property name="minimum"> <property name="minimum">
@ -351,26 +341,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="7" column="0">
<spacer name="verticalSpacer_6"> <widget class="QLabel" name="label_21">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_24">
<property name="text"> <property name="text">
<string>Number of speaker in parallel</string> <string>Load Speaker from library</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1">
<widget class="QComboBox" name="comboBox_librarySpeaker"/>
</item>
<item row="8" column="0" colspan="2"> <item row="8" column="0" colspan="2">
<widget class="QPushButton" name="pushButton_loadSpeaker"> <widget class="QPushButton" name="pushButton_loadSpeaker">
<property name="minimumSize"> <property name="minimumSize">
@ -389,6 +369,32 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="1">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@ -407,6 +413,9 @@
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<layout class="QFormLayout" name="formLayout_3"> <layout class="QFormLayout" name="formLayout_3">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="label_8">
<property name="text"> <property name="text">
@ -427,16 +436,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Load DAC from library</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBox_dacPreset"/>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_23"> <widget class="QLabel" name="label_23">
<property name="text"> <property name="text">
@ -444,22 +443,49 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Output Gain Structure</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBox_optimizeGain">
<property name="text">
<string>Optimize</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1"> <item row="4" column="1">
<spacer name="verticalSpacer_5"> <spacer name="verticalSpacer_5">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Maximum</enum> <enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="5" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Load DAC from library</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBox_dacPreset"/>
</item>
<item row="6" column="0" colspan="2"> <item row="6" column="0" colspan="2">
<widget class="QPushButton" name="pushButton_loadDac"> <widget class="QPushButton" name="pushButton_loadDac">
<property name="font"> <property name="font">
@ -472,31 +498,34 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1"> <item row="3" column="1">
<spacer name="verticalSpacer_8"> <widget class="QSpinBox" name="spinBox_digitalHeadroom">
<property name="orientation"> <property name="enabled">
<enum>Qt::Vertical</enum> <bool>true</bool>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="suffix">
<size> <string> dB</string>
<width>20</width>
<height>40</height>
</size>
</property> </property>
</spacer> <property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="value">
<number>5</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_26">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Digital Headroom</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>
@ -538,6 +567,12 @@
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item> <item>
<layout class="QFormLayout" name="formLayout_4"> <layout class="QFormLayout" name="formLayout_4">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="formAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="label_9">
<property name="text"> <property name="text">
@ -568,9 +603,15 @@
</item> </item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_11"> <widget class="QLabel" name="label_11">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text"> <property name="text">
<string>Threshold:</string> <string>Threshold:</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
@ -584,6 +625,9 @@
<property name="text"> <property name="text">
<string>0 dBFS</string> <string>0 dBFS</string>
</property> </property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
@ -603,6 +647,9 @@
<property name="text"> <property name="text">
<string>0 ms</string> <string>0 ms</string>
</property> </property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
@ -622,9 +669,12 @@
<property name="text"> <property name="text">
<string>0 ms</string> <string>0 ms</string>
</property> </property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="6" column="0">
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -655,6 +705,9 @@
<layout class="QVBoxLayout" name="verticalLayout_6"> <layout class="QVBoxLayout" name="verticalLayout_6">
<item> <item>
<layout class="QFormLayout" name="formLayout_5"> <layout class="QFormLayout" name="formLayout_5">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_13"> <widget class="QLabel" name="label_13">
<property name="text"> <property name="text">
@ -701,6 +754,9 @@
<property name="text"> <property name="text">
<string>0 dBFS</string> <string>0 dBFS</string>
</property> </property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
@ -720,6 +776,9 @@
<property name="text"> <property name="text">
<string>0 ms</string> <string>0 ms</string>
</property> </property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
@ -739,9 +798,12 @@
<property name="text"> <property name="text">
<string>0 ms</string> <string>0 ms</string>
</property> </property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="6" column="1">
<spacer name="verticalSpacer_2"> <spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -759,6 +821,44 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="groupBox_6">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="title">
<string>Amplifier</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<layout class="QFormLayout" name="formLayout_6">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Input Volume Control:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_inputVolumeControl">
<property name="text">
<string>0 dB</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@ -768,8 +868,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1242</width> <width>1606</width>
<height>17</height> <height>22</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuLibrary"> <widget class="QMenu" name="menuLibrary">
@ -821,6 +921,11 @@
<string>Loudness Analyzer</string> <string>Loudness Analyzer</string>
</property> </property>
</action> </action>
<action name="actionHelp">
<property name="text">
<string>Help</string>
</property>
</action>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>

Loading…
Cancel
Save