diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 73d61f7..88c218d 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -14,7 +14,9 @@ add_executable(chiaki include/videodecoder.h src/videodecoder.cpp include/discoverycmd.h - src/discoverycmd.cpp) + src/discoverycmd.cpp + include/mainwindow.h + src/mainwindow.cpp) target_include_directories(chiaki PRIVATE include) target_link_libraries(chiaki chiaki-lib) diff --git a/gui/include/mainwindow.h b/gui/include/mainwindow.h new file mode 100644 index 0000000..06a92a7 --- /dev/null +++ b/gui/include/mainwindow.h @@ -0,0 +1,31 @@ +/* + * This file is part of Chiaki. + * + * Chiaki 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. + * + * Chiaki 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. + * + * You should have received a copy of the GNU General Public License + * along with Chiaki. If not, see . + */ + +#ifndef CHIAKI_MAINWINDOW_H +#define CHIAKI_MAINWINDOW_H + +#include + +class MainWindow : public QWidget +{ + Q_OBJECT + + public: + explicit MainWindow(QWidget *parent = nullptr); +}; + +#endif //CHIAKI_MAINWINDOW_H diff --git a/gui/src/main.cpp b/gui/src/main.cpp index 6b423db..1bfd141 100644 --- a/gui/src/main.cpp +++ b/gui/src/main.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -16,6 +17,7 @@ int RunStream(QApplication &app, const QString &host, const QString ®istkey, const QString &ostype, const QString &auth, const QString &morning, const QString &did); +int RunMain(QApplication &app); int main(int argc, char *argv[]) { @@ -47,6 +49,9 @@ int main(int argc, char *argv[]) parser.process(app); QStringList args = parser.positionalArguments(); + if(args.length() == 0) + return RunMain(app); + if(args.length() < 2) parser.showHelp(1); @@ -73,6 +78,12 @@ int main(int argc, char *argv[]) } } +int RunMain(QApplication &app) +{ + MainWindow main_window; + main_window.show(); + return app.exec(); +} QAudioOutput *audio_out; QIODevice *audio_io; @@ -98,7 +109,6 @@ void video_sample_cb(uint8_t *buf, size_t buf_size, void *user) //io_device->PushSample(buf, buf_size); } - int RunStream(QApplication &app, const QString &host, const QString ®istkey, const QString &ostype, const QString &auth, const QString &morning, const QString &did) { QByteArray host_str = host.toUtf8(); diff --git a/gui/src/mainwindow.cpp b/gui/src/mainwindow.cpp new file mode 100644 index 0000000..9e15964 --- /dev/null +++ b/gui/src/mainwindow.cpp @@ -0,0 +1,22 @@ +/* + * This file is part of Chiaki. + * + * Chiaki 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. + * + * Chiaki 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. + * + * You should have received a copy of the GNU General Public License + * along with Chiaki. If not, see . + */ + +#include + +MainWindow::MainWindow(QWidget *parent) : QWidget(parent) +{ +}