mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-07-29 04:08:39 +00:00
add:打开和平精英映射
This commit is contained in:
parent
cd5a8a8bfd
commit
09e717586a
6 changed files with 101 additions and 84 deletions
|
@ -5,13 +5,18 @@
|
||||||
#include "videosocket.h"
|
#include "videosocket.h"
|
||||||
#include "controlmsg.h"
|
#include "controlmsg.h"
|
||||||
#include "receiver.h"
|
#include "receiver.h"
|
||||||
|
#include "inputconvertgame.h"
|
||||||
|
|
||||||
Controller::Controller(QObject* parent) : QObject(parent)
|
Controller::Controller(bool supportGame, QObject* parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
m_receiver = new Receiver(this);
|
m_receiver = new Receiver(this);
|
||||||
Q_ASSERT(m_receiver);
|
Q_ASSERT(m_receiver);
|
||||||
|
|
||||||
m_inputConvert = new InputConvertNormal(this);
|
if (supportGame) {
|
||||||
|
m_inputConvert = new InputConvertGame(this);
|
||||||
|
} else {
|
||||||
|
m_inputConvert = new InputConvertNormal(this);
|
||||||
|
}
|
||||||
Q_ASSERT(m_inputConvert);
|
Q_ASSERT(m_inputConvert);
|
||||||
connect(m_inputConvert, &InputConvertBase::grabCursor, this, &Controller::grabCursor);
|
connect(m_inputConvert, &InputConvertBase::grabCursor, this, &Controller::grabCursor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,15 +4,16 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
#include "inputconvertnormal.h"
|
#include "inputconvertbase.h"
|
||||||
|
|
||||||
class QTcpSocket;
|
class QTcpSocket;
|
||||||
class Receiver;
|
class Receiver;
|
||||||
|
class InputConvertBase;
|
||||||
class Controller : public QObject
|
class Controller : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Controller(QObject* parent = Q_NULLPTR);
|
Controller(bool supportGame = false, QObject* parent = Q_NULLPTR);
|
||||||
virtual ~Controller();
|
virtual ~Controller();
|
||||||
|
|
||||||
void setControlSocket(QTcpSocket* controlSocket);
|
void setControlSocket(QTcpSocket* controlSocket);
|
||||||
|
|
|
@ -26,7 +26,7 @@ Device::Device(DeviceParams params, QObject *parent)
|
||||||
m_vb->init();
|
m_vb->init();
|
||||||
m_decoder = new Decoder(m_vb, this);
|
m_decoder = new Decoder(m_vb, this);
|
||||||
m_fileHandler = new FileHandler(this);
|
m_fileHandler = new FileHandler(this);
|
||||||
m_controller = new Controller(this);
|
m_controller = new Controller(params.supportGame, this);
|
||||||
m_videoForm = new VideoForm();
|
m_videoForm = new VideoForm();
|
||||||
m_videoForm->setSerial(m_params.serial);
|
m_videoForm->setSerial(m_params.serial);
|
||||||
if (m_controller) {
|
if (m_controller) {
|
||||||
|
|
|
@ -25,6 +25,7 @@ public:
|
||||||
bool closeScreen = false; // 启动时自动息屏
|
bool closeScreen = false; // 启动时自动息屏
|
||||||
bool useReverse = true; // true:先使用adb reverse,失败后自动使用adb forward;false:直接使用adb forward
|
bool useReverse = true; // true:先使用adb reverse,失败后自动使用adb forward;false:直接使用adb forward
|
||||||
bool display = true; // 是否显示画面(或者仅仅后台录制)
|
bool display = true; // 是否显示画面(或者仅仅后台录制)
|
||||||
|
bool supportGame = false; // 是否支持游戏映射
|
||||||
};
|
};
|
||||||
explicit Device(DeviceParams params, QObject *parent = nullptr);
|
explicit Device(DeviceParams params, QObject *parent = nullptr);
|
||||||
virtual ~Device();
|
virtual ~Device();
|
||||||
|
|
|
@ -21,6 +21,8 @@ Dialog::Dialog(QWidget *parent) :
|
||||||
bool newLine = true;
|
bool newLine = true;
|
||||||
|
|
||||||
switch (processResult) {
|
switch (processResult) {
|
||||||
|
case AdbProcess::AER_ERROR_START:
|
||||||
|
break;
|
||||||
case AdbProcess::AER_SUCCESS_START:
|
case AdbProcess::AER_SUCCESS_START:
|
||||||
log = "adb run";
|
log = "adb run";
|
||||||
newLine = false;
|
newLine = false;
|
||||||
|
@ -131,6 +133,7 @@ void Dialog::on_startServerBtn_clicked()
|
||||||
params.closeScreen = ui->closeScreenCheck->isChecked();
|
params.closeScreen = ui->closeScreenCheck->isChecked();
|
||||||
params.useReverse = ui->useReverseCheck->isChecked();
|
params.useReverse = ui->useReverseCheck->isChecked();
|
||||||
params.display = !ui->notDisplayCheck->isChecked();
|
params.display = !ui->notDisplayCheck->isChecked();
|
||||||
|
params.supportGame = ui->gameForPeaceCheck->isChecked();
|
||||||
m_deviceManage.connectDevice(params);
|
m_deviceManage.connectDevice(params);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -113,81 +113,7 @@
|
||||||
<string>Start Config</string>
|
<string>Start Config</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item row="1" column="3" colspan="5">
|
<item row="2" column="9" colspan="2">
|
||||||
<widget class="QLineEdit" name="recordPathEdt">
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="9">
|
|
||||||
<widget class="QComboBox" name="formatBox"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="3" colspan="2">
|
|
||||||
<widget class="QComboBox" name="bitRateBox">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="currentText">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="8">
|
|
||||||
<widget class="QLabel" name="label_6">
|
|
||||||
<property name="text">
|
|
||||||
<string>record format:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="7">
|
|
||||||
<widget class="QComboBox" name="videoSizeBox">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="8" colspan="2">
|
|
||||||
<widget class="QPushButton" name="selectRecordPathBtn">
|
|
||||||
<property name="text">
|
|
||||||
<string>select path</string>
|
|
||||||
</property>
|
|
||||||
<property name="autoDefault">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="3" colspan="3">
|
|
||||||
<widget class="QCheckBox" name="alwaysTopCheck">
|
|
||||||
<property name="text">
|
|
||||||
<string>always top</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="notDisplayCheck">
|
|
||||||
<property name="text">
|
|
||||||
<string>not display</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>record save path:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>recordPathEdt</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="8" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="useReverseCheck">
|
<widget class="QCheckBox" name="useReverseCheck">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>use reverse</string>
|
<string>use reverse</string>
|
||||||
|
@ -197,7 +123,41 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="6" colspan="2">
|
<item row="0" column="8">
|
||||||
|
<widget class="QComboBox" name="videoSizeBox">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="9" colspan="2">
|
||||||
|
<widget class="QPushButton" name="selectRecordPathBtn">
|
||||||
|
<property name="text">
|
||||||
|
<string>select path</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoDefault">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="9">
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="text">
|
||||||
|
<string>record format:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="6" colspan="2">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>video size:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="10">
|
||||||
|
<widget class="QComboBox" name="formatBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="7" colspan="2">
|
||||||
<widget class="QCheckBox" name="closeScreenCheck">
|
<widget class="QCheckBox" name="closeScreenCheck">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>close screen</string>
|
<string>close screen</string>
|
||||||
|
@ -211,10 +171,57 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="5" colspan="2">
|
<item row="1" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>video size:</string>
|
<string>record save path:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>recordPathEdt</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2" colspan="4">
|
||||||
|
<widget class="QComboBox" name="bitRateBox">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="currentText">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2" colspan="7">
|
||||||
|
<widget class="QLineEdit" name="recordPathEdt">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="gameForPeaceCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>Game for Peace</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="5" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="alwaysTopCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>always top</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="notDisplayCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>not display</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue