2022-07-07 07:11:51 -04:00
|
|
|
#include "mainwindow.h"
|
2022-07-09 16:07:14 -04:00
|
|
|
#include "virtmic.h"
|
|
|
|
|
2022-10-10 15:50:26 -04:00
|
|
|
#ifdef KXMLGUI
|
|
|
|
#include <KAboutData>
|
|
|
|
#endif
|
|
|
|
|
2022-07-07 07:11:51 -04:00
|
|
|
#include <QApplication>
|
2022-07-09 16:07:14 -04:00
|
|
|
#include <QCommandLineParser>
|
2022-08-02 06:41:32 -04:00
|
|
|
#include <QLoggingCategory>
|
2022-07-07 07:11:51 -04:00
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
QApplication app(argc, argv);
|
2022-07-09 16:07:14 -04:00
|
|
|
QApplication::setApplicationName("discord-screenaudio");
|
2022-07-28 12:36:09 -04:00
|
|
|
QApplication::setWindowIcon(
|
|
|
|
QIcon(":assets/de.shorsh.discord-screenaudio.png"));
|
2022-07-28 11:34:54 -04:00
|
|
|
QApplication::setApplicationVersion(DISCORD_SCEENAUDIO_VERSION_FULL);
|
2022-07-29 10:08:19 -04:00
|
|
|
QApplication::setDesktopFileName("de.shorsh.discord-screenaudio");
|
2022-07-09 16:07:14 -04:00
|
|
|
|
2022-08-02 06:41:32 -04:00
|
|
|
qSetMessagePattern("[%{category}] %{message}");
|
|
|
|
|
2022-07-09 16:07:14 -04:00
|
|
|
QCommandLineParser parser;
|
|
|
|
parser.setApplicationDescription(
|
|
|
|
"Custom Discord client with the ability to stream audio on Linux");
|
|
|
|
parser.addHelpOption();
|
|
|
|
parser.addVersionOption();
|
|
|
|
QCommandLineOption virtmicOption("virtmic", "Start the Virtual Microphone",
|
|
|
|
"target");
|
|
|
|
parser.addOption(virtmicOption);
|
2022-08-01 13:59:01 -04:00
|
|
|
QCommandLineOption degubOption("remote-debugging",
|
|
|
|
"Open Chromium Remote Debugging on port 9222");
|
|
|
|
parser.addOption(degubOption);
|
2022-11-04 18:16:49 -04:00
|
|
|
QCommandLineOption notifySendOption(
|
|
|
|
"notify-send", "Use notify-send instead of QT/KF5 notifications");
|
|
|
|
parser.addOption(notifySendOption);
|
2022-10-10 15:50:26 -04:00
|
|
|
|
2022-07-09 16:07:14 -04:00
|
|
|
parser.process(app);
|
|
|
|
|
|
|
|
if (parser.isSet(virtmicOption)) {
|
|
|
|
Virtmic::start(parser.value(virtmicOption));
|
|
|
|
}
|
|
|
|
|
2022-07-30 15:09:30 -04:00
|
|
|
qputenv("QTWEBENGINE_CHROMIUM_FLAGS",
|
|
|
|
"--enable-features=WebRTCPipeWireCapturer " +
|
|
|
|
qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"));
|
|
|
|
|
2022-08-01 13:59:01 -04:00
|
|
|
if (parser.isSet(degubOption))
|
|
|
|
qputenv("QTWEBENGINE_CHROMIUM_FLAGS",
|
|
|
|
"--remote-debugging-port=9222 " +
|
|
|
|
qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"));
|
|
|
|
|
2022-11-04 18:16:49 -04:00
|
|
|
MainWindow w(parser.isSet(notifySendOption));
|
2022-07-07 07:11:51 -04:00
|
|
|
w.show();
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|