Added Analyzer Window

pull/4/head
Alexander Diamadis 4 years ago
parent 9bcd22a53c
commit 4161fac661

@ -1,4 +1,4 @@
QT += core gui
QT += core gui multimedia testlib
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
@ -10,6 +10,7 @@ CONFIG+=sdk_no_version_check
SOURCES += \
about.cpp \
analyzer.cpp \
camp.cpp \
campmode.cpp \
cdac.cpp \
@ -20,6 +21,7 @@ SOURCES += \
HEADERS += \
about.h \
analyzer.h \
camp.h \
campmode.h \
cdac.h \
@ -29,6 +31,7 @@ HEADERS += \
FORMS += \
about.ui \
analyzer.ui \
library.ui \
mainwindow.ui
@ -50,7 +53,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
RESOURCES += \
resources.qrc
VERSION=1.0.0
VERSION=1.1.0
QMAKE_TARGET_PRODUCT = "PA-Calculator"
QMAKE_TARGET_COMPANY = "Alexander Diamadis"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2021 by Alexander Diamadis (alex@dkm-tech.de)"

@ -0,0 +1,39 @@
#include "analyzer.h"
#include "ui_analyzer.h"
#include "QFileDialog"
#include <QStandardPaths>
#include <QString>
#include <QDirIterator>
#include <QFileInfo>
analyzer::analyzer(QWidget *parent) :
QDialog(parent),
ui(new Ui::analyzer)
{
ui->setupUi(this);
}
analyzer::~analyzer()
{
delete ui;
}
void analyzer::on_pushButton_clicked()
{
QString folder=QFileDialog::getExistingDirectory(this,"Select the folder that is containing audio",QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
ui->lineEdit_path->setText(folder);
}
void analyzer::on_pushButton_calculate_clicked()
{
QDirIterator it(ui->lineEdit_path->text(), QStringList() << "*.mp3", QDir::NoFilter, QDirIterator::Subdirectories);
//while (it.hasNext()) {
QFileInfo f(it.next());
CAudioSource src;
src.decode(f.absoluteFilePath());
}

@ -0,0 +1,29 @@
#ifndef ANALYZER_H
#define ANALYZER_H
#include <QDialog>
#include <QAudioDecoder>
namespace Ui {
class analyzer;
}
class analyzer : public QDialog
{
Q_OBJECT
public:
explicit analyzer(QWidget *parent = nullptr);
~analyzer();
private slots:
void on_pushButton_clicked();
void on_pushButton_calculate_clicked();
private:
Ui::analyzer *ui;
};
#endif // ANALYZER_H

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>analyzer</class>
<widget class="QDialog" name="analyzer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>432</width>
<height>141</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Folder containing Audio Files</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_path">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>C:/Users/fsx12/Downloads/Zeugnisverleihung</string>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<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="1" column="1">
<widget class="QPushButton" name="pushButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>preferred Loudness</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_preferredLoudness">
<property name="suffix">
<string> dBFS</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>-100.000000000000000</double>
</property>
<property name="maximum">
<double>0.000000000000000</double>
</property>
<property name="value">
<double>-18.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="pushButton_calculate">
<property name="text">
<string>Calculate</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -474,8 +474,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>244</x>
<y>444</y>
<x>250</x>
<y>473</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
@ -490,8 +490,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>312</x>
<y>444</y>
<x>318</x>
<y>473</y>
</hint>
<hint type="destinationlabel">
<x>286</x>

@ -9,6 +9,7 @@
#include <QDataStream>
#include <QFileDialog>
#include "about.h"
#include "analyzer.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
@ -29,6 +30,9 @@ MainWindow::MainWindow(QWidget *parent)
refreshLibraryAmpModes();
refreshLibrarySpeaker();
refreshLibraryDacs();
analyzer analyzerWindow;
analyzerWindow.exec();
}
MainWindow::~MainWindow()
@ -343,3 +347,10 @@ void MainWindow::on_actionAbout_triggered()
aboutDialog.exec();
}
void MainWindow::on_actionOpen_Loudness_Analyzer_triggered()
{
analyzer analyzerWindow;
analyzerWindow.exec();
}

@ -40,6 +40,8 @@ private slots:
void on_actionAbout_triggered();
void on_actionOpen_Loudness_Analyzer_triggered();
private:
Ui::MainWindow *ui;
cAmp* m_pCAmp;

@ -578,7 +578,6 @@
<property name="font">
<font>
<pointsize>15</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@ -696,7 +695,6 @@
<property name="font">
<font>
<pointsize>15</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@ -771,7 +769,7 @@
<x>0</x>
<y>0</y>
<width>1242</width>
<height>21</height>
<height>17</height>
</rect>
</property>
<widget class="QMenu" name="menuLibrary">
@ -788,8 +786,15 @@
</property>
<addaction name="actionAbout"/>
</widget>
<widget class="QMenu" name="menuLoudness_Analyzer">
<property name="title">
<string>Tools</string>
</property>
<addaction name="actionOpen_Loudness_Analyzer"/>
</widget>
<addaction name="menuPA_Calculator"/>
<addaction name="menuLibrary"/>
<addaction name="menuLoudness_Analyzer"/>
</widget>
<action name="actionEditLibrary">
<property name="text">
@ -811,6 +816,11 @@
<string>About</string>
</property>
</action>
<action name="actionOpen_Loudness_Analyzer">
<property name="text">
<string>Loudness Analyzer</string>
</property>
</action>
</widget>
<resources/>
<connections/>

Loading…
Cancel
Save