mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-13 23:17:09 +00:00
0ab07303c9
* Add quit cli command and app quit option after stream session. Fixes #92 * Code review fixes.
48 lines
1 KiB
C++
48 lines
1 KiB
C++
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QVariant>
|
|
|
|
class ComputerManager;
|
|
class NvComputer;
|
|
class Session;
|
|
class StreamingPreferences;
|
|
|
|
namespace CliStartStream
|
|
{
|
|
|
|
class Event;
|
|
class LauncherPrivate;
|
|
|
|
class Launcher : public QObject
|
|
{
|
|
Q_OBJECT
|
|
Q_DECLARE_PRIVATE_D(m_DPtr, Launcher)
|
|
|
|
public:
|
|
explicit Launcher(QString computer, QString app,
|
|
StreamingPreferences* preferences,
|
|
QObject *parent = nullptr);
|
|
~Launcher();
|
|
Q_INVOKABLE void execute(ComputerManager *manager);
|
|
Q_INVOKABLE void quitRunningApp();
|
|
Q_INVOKABLE bool isExecuted() const;
|
|
|
|
signals:
|
|
void searchingComputer();
|
|
void searchingApp();
|
|
void sessionCreated(QString appName, Session *session);
|
|
void failed(QString text);
|
|
void appQuitRequired(QString appName);
|
|
|
|
private slots:
|
|
void onComputerFound(NvComputer *computer);
|
|
void onComputerUpdated(NvComputer *computer);
|
|
void onTimeout();
|
|
void onQuitAppCompleted(QVariant error);
|
|
|
|
private:
|
|
QScopedPointer<LauncherPrivate> m_DPtr;
|
|
};
|
|
|
|
}
|