Welcome to mirror list, hosted at ThFree Co, Russian Federation.

G15LCDEngine_helper.h « mumble « src - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7a20d487f368bd9aba2c8216dfc15f11ac14bfba (plain)
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
52
53
54
55
56
57
// Copyright 2010-2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.

#ifndef MUMBLE_MUMBLE_G15LCDENGINE_HELPER_H_
#	define MUMBLE_MUMBLE_G15LCDENGINE_HELPER_H_

#	include "../../g15helper/g15helper.h"
#	include "LCD.h"

#	include <QtCore/QProcess>

class G15LCDDeviceHelper;

class G15LCDEngineHelper : public LCDEngine {
	friend class G15LCDDeviceHelper;

private:
	Q_OBJECT
	Q_DISABLE_COPY(G15LCDEngineHelper)
protected:
	bool bUnavailable;
	bool bRunning;
	QProcess *qpHelper;
	QString qsHelperExecutable;
	bool framebufferReady() const;
	void submitFrame(bool alert, uchar *buf, qint64 len);
	void setProcessStatus(bool run);

public:
	G15LCDEngineHelper();
	~G15LCDEngineHelper() Q_DECL_OVERRIDE;
	QList< LCDDevice * > devices() const Q_DECL_OVERRIDE;
public slots:
	void on_Helper_finished(int exitCode, QProcess::ExitStatus status);
};

class G15LCDDeviceHelper : public LCDDevice {
protected:
	G15LCDEngineHelper *engine;
	bool bEnabled;

public:
	G15LCDDeviceHelper(G15LCDEngineHelper *e);
	~G15LCDDeviceHelper() Q_DECL_OVERRIDE;
	bool enabled() Q_DECL_OVERRIDE;
	void setEnabled(bool e) Q_DECL_OVERRIDE;
	void blitImage(QImage *img, bool alert) Q_DECL_OVERRIDE;
	QString name() const Q_DECL_OVERRIDE;
	QSize size() const Q_DECL_OVERRIDE;
};

#else
class G15LCDEngineHelper;
class G15LCDDeviceHelper;
#endif