forked from MatsuriDayo/nekoray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExternalProcess.hpp
51 lines (36 loc) · 1.04 KB
/
ExternalProcess.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include <memory>
#include <QProcess>
namespace NekoGui_sys {
class ExternalProcess : public QProcess {
public:
QString tag;
QString program;
QStringList arguments;
QStringList env;
bool managed = true; // MW_dialog_message
ExternalProcess();
~ExternalProcess();
// start & kill is one time
virtual void Start();
void Kill();
protected:
bool started = false;
bool killed = false;
bool crashed = false;
};
class CoreProcess : public ExternalProcess {
public:
CoreProcess(const QString &core_path, const QStringList &args);
void Start() override;
void Restart();
int start_profile_when_core_is_up = -1;
private:
bool show_stderr = false;
bool failed_to_start = false;
bool restarting = false;
};
// 手动管理
inline std::list<std::shared_ptr<ExternalProcess>> running_ext;
inline QAtomicInt logCounter;
} // namespace NekoGui_sys