Add stub MainWindow

This commit is contained in:
Florian Märkl 2019-06-28 09:13:12 +02:00
commit 498e48e4f6
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857
4 changed files with 67 additions and 2 deletions

View file

@ -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)

31
gui/include/mainwindow.h Normal file
View file

@ -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 <https://www.gnu.org/licenses/>.
*/
#ifndef CHIAKI_MAINWINDOW_H
#define CHIAKI_MAINWINDOW_H
#include <QWidget>
class MainWindow : public QWidget
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
};
#endif //CHIAKI_MAINWINDOW_H

View file

@ -2,6 +2,7 @@
#include <streamwindow.h>
#include <videodecoder.h>
#include <discoverycmd.h>
#include <mainwindow.h>
#include <chiaki/session.h>
#include <chiaki/base64.h>
@ -16,6 +17,7 @@
int RunStream(QApplication &app, const QString &host, const QString &registkey, 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 &registkey, const QString &ostype, const QString &auth, const QString &morning, const QString &did)
{
QByteArray host_str = host.toUtf8();

22
gui/src/mainwindow.cpp Normal file
View file

@ -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 <https://www.gnu.org/licenses/>.
*/
#include <mainwindow.h>
MainWindow::MainWindow(QWidget *parent) : QWidget(parent)
{
}