Skip to content

Commit 2eb2f77

Browse files
author
ThePBone
committed
Several major changes to the GST Plugin handling (see description))
- Autodetect legacy mode (via GStreamer Registry) - Display a troubleshooting overlay if the GStreamer package is nowhere to be found - Display a warning in the setup wizard if the legacy version of V4L is still installed - Show several details about the GST-Plugin in the settings dialog - Disable confusing "viper is inactive" error overlay and start viper automatically instead
1 parent 45defb8 commit 2eb2f77

File tree

11 files changed

+837
-1070
lines changed

11 files changed

+837
-1070
lines changed

V4L_Frontend.pro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ HEADERS += \
109109
dialog/slidingstackedwidget.h \
110110
dialog/statusfragment.h \
111111
mainwindow.h \
112+
misc/GstRegistryHelper.h \
112113
misc/autostartmanager.h \
113114
misc/biquad.h \
114115
misc/common.h \
@@ -164,3 +165,7 @@ DISTFILES += \
164165
RESOURCES += \
165166
resources.qrc \
166167
styles/styles.qrc
168+
169+
unix: CONFIG += link_pkgconfig
170+
unix: PKGCONFIG += gstreamer-1.0 gstreamer-plugins-bad-1.0
171+
unix: PKGCONFIG += libpulse

config/appconfigwrapper.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,6 @@ void AppConfigWrapper::setLegacyTabs(bool b){
235235
bool AppConfigWrapper::getLegacyTabs(){
236236
return appconf->getBool("theme.tab.legacy");
237237
}
238-
void AppConfigWrapper::setLegacyMode(bool b){
239-
appconf->setValue("app.legacymode",QVariant(b));
240-
saveAppConfig();
241-
}
242-
bool AppConfigWrapper::getLegacyMode(){
243-
return appconf->getBool("app.legacymode");
244-
}
245238
//--------
246239
QString AppConfigWrapper::getAppConfigFilePath(){
247240
return QString("%1/.config/viper4linux/ui.2.conf").arg(QDir::homePath());

config/appconfigwrapper.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ class AppConfigWrapper : public QObject
8888
int getSpectrumShape();
8989
bool getLegacyTabs();
9090
void setLegacyTabs(bool b);
91-
void setLegacyMode(bool b);
92-
bool getLegacyMode();
9391
signals:
9492
void spectrumChanged();
9593
void spectrumReloadRequired();

dialog/firstlaunchwizard.cpp

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "ui_firstlaunchwizard.h"
33
#include "misc/common.h"
44
#include "misc/autostartmanager.h"
5+
#include "misc/GstRegistryHelper.h"
56
#include "mainwindow.h"
67

78
#include <QTimer>
@@ -11,6 +12,7 @@
1112
#include <QFileInfo>
1213
#include <QDir>
1314
#include <QProcess>
15+
#include <QMessageBox>
1416

1517
FirstLaunchWizard::FirstLaunchWizard(AppConfigWrapper* _appconf, MainWindow* mainwin, QWidget *parent) :
1618
QWidget(parent),
@@ -25,43 +27,62 @@ FirstLaunchWizard::FirstLaunchWizard(AppConfigWrapper* _appconf, MainWindow* mai
2527
QTimer::singleShot(1000, [&]{
2628
ui->p1_icon->startAnimation();
2729
});
28-
ui->p1dot5_icon->startAnimation();
2930
ui->p2_icon->startAnimation();
31+
ui->pm_icon->startAnimation();
32+
ui->pl_icon->startAnimation();
3033
ui->p3_icon->startAnimation();
3134
ui->p4_icon->startAnimation();
3235

3336
ui->stackedWidget->setAnimation(QEasingCurve::Type::OutCirc);
37+
3438
connect(ui->p1_next,&QPushButton::clicked,[&]{
35-
ui->stackedWidget->slideInIdx(1);
36-
});
37-
connect(ui->p1dot5_next,&QPushButton::clicked,[&]{
38-
ui->stackedWidget->slideInIdx(2);
39+
if(!GstRegistryHelper::IsPluginInstalled()){
40+
ui->stackedWidget->slideInIdx(1);
41+
}
42+
else if(!GstRegistryHelper::HasDBusSupport()){
43+
ui->stackedWidget->slideInIdx(2);
44+
}
45+
else{
46+
ui->stackedWidget->slideInIdx(3);
47+
}
3948
});
4049
connect(ui->p2_next,&QPushButton::clicked,[&]{
41-
ui->stackedWidget->slideInIdx(3);
50+
ui->stackedWidget->slideInIdx(4);
4251
});
4352
connect(ui->p3_next,&QPushButton::clicked,[&]{
44-
ui->stackedWidget->slideInIdx(4);
53+
ui->stackedWidget->slideInIdx(5);
4554
});
4655
connect(ui->p4_next,&QPushButton::clicked,[&]{
4756
emit wizardFinished();
4857
});
49-
connect(ui->p4_telegram,&QPushButton::clicked,[&]{
50-
QDesktopServices::openUrl(QUrl("https://t.me/joinchat/FTKC2A2bolHkFAyO-fuPjw"));
51-
});
52-
53-
ui->p1dot5_mode_legacy->setChecked(appconf->getLegacyMode());
5458

55-
auto legacy_radio = [this]{
56-
if(lockslot)return;
57-
int mode = 0;
58-
if(ui->p1dot5_mode_a4l->isChecked())mode=0;
59-
else if(ui->p1dot5_mode_legacy->isChecked())mode=1;
60-
appconf->setLegacyMode(mode);
59+
auto openTelegram = []{
60+
QDesktopServices::openUrl(QUrl("https://t.me/joinchat/FTKC2A2bolHkFAyO-fuPjw"));
6161
};
62+
connect(ui->p4_telegram,&QPushButton::clicked, openTelegram);
6263

63-
connect(ui->p1dot5_mode_a4l,&QRadioButton::clicked,this,legacy_radio);
64-
connect(ui->p1dot5_mode_legacy,&QRadioButton::clicked,this,legacy_radio);
64+
connect(ui->pm_telegram,&QPushButton::clicked, openTelegram);
65+
connect(ui->pm_readme,&QPushButton::clicked, []{
66+
QDesktopServices::openUrl(QUrl("https://github.com/Audio4Linux/Viper4Linux"));
67+
});
68+
connect(ui->pm_next,&QPushButton::clicked, [this]{
69+
gst_update_registry();
70+
if(GstRegistryHelper::IsPluginInstalled()){
71+
if(!GstRegistryHelper::HasDBusSupport())
72+
ui->stackedWidget->slideInIdx(2);
73+
else
74+
ui->stackedWidget->slideInIdx(3);
75+
}
76+
else{
77+
QMessageBox::warning(this, "Error", "Still no luck. No GStreamer plugin named 'viperfx' has been found!");
78+
}
79+
});
80+
connect(ui->pl_next,&QPushButton::clicked, [this]{
81+
ui->stackedWidget->slideInIdx(3);
82+
});
83+
connect(ui->pl_help,&QPushButton::clicked, []{
84+
QDesktopServices::openUrl(QUrl("https://gist.github.com/ThePBone/93da516635cdbc01759c10d2e5abb7ea"));
85+
});
6586

6687
auto deviceUpdated = [this](){
6788
if(lockslot) return;

0 commit comments

Comments
 (0)