Skip to content
This repository has been archived by the owner on Sep 12, 2021. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePBone committed Aug 31, 2019
0 parents commit b519722
Show file tree
Hide file tree
Showing 193 changed files with 15,558 additions and 0 deletions.
67 changes: 67 additions & 0 deletions JDSP4Linux-GUI.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#-------------------------------------------------
#
# Project created by QtCreator 2019-08-30T23:36:04
#
#-------------------------------------------------

QT += core gui xml network multimedia sql

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = jdsp-gui
TEMPLATE = app
QMAKE_CXXFLAGS += "-Wno-old-style-cast -Wdouble-promotion"

# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

CONFIG += c++11

SOURCES += \
log.cpp \
main.cpp \
mainwindow.cpp \
palette.cpp \
settings.cpp \
preset.cpp

HEADERS += \
log.h \
mainwindow.h \
configlist.h \
palette.h \
settings.h \
main.h \
preset.h

FORMS += \
log.ui \
mainwindow.ui \
palette.ui \
settings.ui \
preset.ui

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /usr/bin/

# Set BUILDPATH variable to change the output path
!isEmpty($$BUILDPATH): target.path = $$BUILDPATH
!isEmpty($$BUILDPATH): DESTDIR = $$BUILDPATH

!isEmpty(target.path): INSTALLS += target

DISTFILES +=

RESOURCES += \
ddc.qrc \
resources.qrc \
styles/styles.qrc
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# JDSP4Linux-GUI

User Interface for JDSP4Linux [https://github.com/ThePBone/JDSP4Linux](https://github.com/ThePBone/JDSP4Linux)
* Telegram: @ThePBone

This project is work-in-progress.

## Installation
* [Portable/Manually](#portablemanually)

### Portable/Manually
#### Install Dependencies
You will need to change this line, depending on which package manager your distribution uses.
```bash
sudo apt install qt5-qmake libqt5widgets5 libqt5gui5 libqt5core5a libqt5multimedia5 libqt5xml5 libgl1-mesa-dev git
```

#### Build from sources
Clone this repository

git clone https://github.com/ThePBone/JDSP4Linux-GUI

Compile sources

cd JDSP4Linux-GUI
qmake
make

```bash
./jdsp-gui
```

#### Optional: Manual Install
##### Copy to /usr/local/bin
```bash
sudo cp jdsp-gui /usr/local/bin
sudo chmod 755 /usr/local/bin/jdsp-gui
```
##### Create Menu Entry
```bash
sudo cat <<EOT >> /usr/share/applications/jdsp-gui.desktop
[Desktop Entry]
Name=JDSP4Linux
GenericName=Equalizer
Comment=User Interface for JDSP4Linux
Keywords=equalizer
Categories=AudioVideo;Audio;
Exec=jdsp-gui
Icon=/usr/share/pixmaps/jdsp-gui.png
StartupNotify=false
Terminal=false
Type=Application
EOT
```
##### Download Icon
```bash
sudo wget -O /usr/share/pixmaps/jdsp-gui.png https://raw.githubusercontent.com/ThePBone/JDSP4Linux-GUI/master/icons/icon.png -q --show-progress
```
## Credits
* [Material Icons](https://material.io/tools/icons/)
* [QSS Stylesheets - GTRONICK (modified by ThePBone)](https://github.com/GTRONICK/QSS)
96 changes: 96 additions & 0 deletions configlist.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#ifndef CONFIGLIST_H
#define CONFIGLIST_H


#include <string>

enum Config {
enable,
analogmodelling_enable,
analogmodelling_tubedrive,
bass_enable,
bass_mode,
bass_filtertype,
bass_freq,
headset_enable,
headset_preset,
stereowide_enable,
stereowide_mode,
bs2b_enable,
bs2b_mode,
compression_enable,
compression_pregain,
compression_threshold,
compression_knee,
compression_ratio,
compression_attack,
compression_release,
tone_enable,
tone_filtertype,
tone_eq,
masterswitch_limthreshold,
masterswitch_limrelease,
ddc_enable,
ddc_file,
unknown
};
enum AppConfig {
configpath,
autoapply,
autoapplymode,
mutedRestart,
glavafix,
stylesheet,
thememode,
colorpalette,
custompalette,
customwhiteicons,
unknownApp
};
inline Config resolveConfig(const std::string& input) {
if( input == "enable" ) return enable;
if( input == "analogmodelling_enable" ) return analogmodelling_enable;
if( input == "analogmodelling_tubedrive" ) return analogmodelling_tubedrive;
if( input == "bass_enable" ) return bass_enable;
if( input == "bass_mode" ) return bass_mode;
if( input == "bass_filtertype" ) return bass_filtertype;
if( input == "bass_freq" ) return bass_freq;
if( input == "headset_enable" ) return headset_enable;
if( input == "headset_preset" ) return headset_preset;
if( input == "stereowide_enable" ) return stereowide_enable;
if( input == "stereowide_mode" ) return stereowide_mode;
if( input == "bs2b_enable" ) return bs2b_enable;
if( input == "bs2b_mode" ) return bs2b_mode;
if( input == "compression_enable" ) return compression_enable;
if( input == "compression_pregain" ) return compression_pregain;
if( input == "compression_threshold" ) return compression_threshold;
if( input == "compression_knee" ) return compression_knee;
if( input == "compression_ratio" ) return compression_ratio;
if( input == "compression_attack" ) return compression_attack;
if( input == "compression_release" ) return compression_release;
if( input == "tone_enable" ) return tone_enable;
if( input == "tone_filtertype" ) return tone_filtertype;
if( input == "tone_eq" ) return tone_eq;
if( input == "masterswitch_limthreshold" ) return masterswitch_limthreshold;
if( input == "masterswitch_limrelease" ) return masterswitch_limrelease;
if( input == "ddc_enable" ) return ddc_enable;
if( input == "ddc_file" ) return ddc_file;
return unknown;
}
inline AppConfig resolveAppConfig(const std::string& input) {
if( input == "configpath" ) return configpath;
if( input == "autoapply" ) return autoapply;
if( input == "autoapplymode" ) return autoapplymode;
if( input == "glavafix" ) return glavafix;
if( input == "muteOnRestart" ) return mutedRestart;
if( input == "stylesheet" ) return stylesheet;
if( input == "thememode" ) return thememode;
if( input == "colorpalette" ) return colorpalette;
if( input == "customwhiteicons" ) return customwhiteicons;
if( input == "custompalette" ) return custompalette;
return unknownApp;
}

static std::string default_config = "enable=true\nanalogmodelling_enable=false\nanalogmodelling_tubedrive=10000\nbass_enable=false\nbass_mode=1000\nbass_filtertype=1\nbass_freq=65\nheadset_enable=false\nheadset_preset=10\nstereowide_enable=false\nstereowide_mode=4\nbs2b_enable=false\nbs2b_mode=2\ncompression_enable=false\ncompression_pregain=20\ncompression_threshold=-60\ncompression_knee=40\ncompression_ratio=-20\ncompression_attack=1\ncompression_release=88\ntone_enable=false\ntone_filtertype=0\ntone_eq=\"0;0;0;0;0;0;0;0;0;0;0;0;0;0;0\"\nmasterswitch_limthreshold=0\nmasterswitch_limrelease=50\nddc_enable=false\nddc_file=\"none\"\n";
static std::string default_appconfig = "configspath=\"\"\nautoapply=false\nglavafix=false\nmuteOnRestart=true";
#endif // CONFIGLIST_H
5 changes: 5 additions & 0 deletions ddc.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>ddc/ViPERDDC.db</file>
</qresource>
</RCC>
Binary file added ddc/ViPERDDC.db
Binary file not shown.
Binary file added icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/menu-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/queue-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/queue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/refresh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/settings-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions log.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "log.h"
#include "ui_log.h"
#include "main.h"
#include <QFile>

log::log(QWidget *parent) :
QDialog(parent),
ui(new Ui::log)
{
ui->setupUi(this);
connect(ui->reload, SIGNAL(clicked()), this, SLOT(updateLog()));
connect(ui->select, SIGNAL(currentIndexChanged(int)),this,SLOT(updateLog()));
updateLog();
}

log::~log()
{
delete ui;
}
void log::reject()
{
mainwin->enableLogBtn(true);
QDialog::reject();
}
void log::updateLog(){
ui->viperlog->clear();
QString path;
if(ui->select->currentText()=="JDSP") path = "/tmp/jamesdsp/ui_jdsp.log";
else if(ui->select->currentText()=="GST Plugin") path = "/tmp/jamesdsp/jdsp.log";
else path = "/tmp/jamesdsp/ui.log";

QFile file(path);
if(!file.open(QIODevice::ReadOnly)) {
ui->viperlog->append("<Failed to open '" + path + "'>");
}

QTextStream in(&file);
while(!in.atEnd()) {
QString line = in.readLine();
ui->viperlog->append(line);
}

file.close();
}
24 changes: 24 additions & 0 deletions log.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef LOG_H
#define LOG_H

#include <QDialog>

namespace Ui {
class log;
}

class log : public QDialog
{
Q_OBJECT

public:
explicit log(QWidget *parent = nullptr);
~log();
private slots:
void reject();
void updateLog();
private:
Ui::log *ui;
};

#endif // LOG_H
Loading

0 comments on commit b519722

Please sign in to comment.