add:打开和平精英映射

This commit is contained in:
rankun 2019-07-12 13:55:03 +08:00
parent 445ed4615c
commit 0cb9af0aa6
6 changed files with 101 additions and 84 deletions

View file

@ -5,13 +5,18 @@
#include "videosocket.h"
#include "controlmsg.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);
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);
connect(m_inputConvert, &InputConvertBase::grabCursor, this, &Controller::grabCursor);
}

View file

@ -4,15 +4,16 @@
#include <QObject>
#include <QPointer>
#include "inputconvertnormal.h"
#include "inputconvertbase.h"
class QTcpSocket;
class Receiver;
class InputConvertBase;
class Controller : public QObject
{
Q_OBJECT
public:
Controller(QObject* parent = Q_NULLPTR);
Controller(bool supportGame = false, QObject* parent = Q_NULLPTR);
virtual ~Controller();
void setControlSocket(QTcpSocket* controlSocket);

View file

@ -26,7 +26,7 @@ Device::Device(DeviceParams params, QObject *parent)
m_vb->init();
m_decoder = new Decoder(m_vb, this);
m_fileHandler = new FileHandler(this);
m_controller = new Controller(this);
m_controller = new Controller(params.supportGame, this);
m_videoForm = new VideoForm();
m_videoForm->setSerial(m_params.serial);
if (m_controller) {

View file

@ -25,6 +25,7 @@ public:
bool closeScreen = false; // 启动时自动息屏
bool useReverse = true; // true:先使用adb reverse失败后自动使用adb forwardfalse:直接使用adb forward
bool display = true; // 是否显示画面(或者仅仅后台录制)
bool supportGame = false; // 是否支持游戏映射
};
explicit Device(DeviceParams params, QObject *parent = nullptr);
virtual ~Device();

View file

@ -21,6 +21,8 @@ Dialog::Dialog(QWidget *parent) :
bool newLine = true;
switch (processResult) {
case AdbProcess::AER_ERROR_START:
break;
case AdbProcess::AER_SUCCESS_START:
log = "adb run";
newLine = false;
@ -131,6 +133,7 @@ void Dialog::on_startServerBtn_clicked()
params.closeScreen = ui->closeScreenCheck->isChecked();
params.useReverse = ui->useReverseCheck->isChecked();
params.display = !ui->notDisplayCheck->isChecked();
params.supportGame = ui->gameForPeaceCheck->isChecked();
m_deviceManage.connectDevice(params);
/*

View file

@ -113,81 +113,7 @@
<string>Start Config</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="3" colspan="5">
<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">
<item row="2" column="9" colspan="2">
<widget class="QCheckBox" name="useReverseCheck">
<property name="text">
<string>use reverse</string>
@ -197,7 +123,41 @@
</property>
</widget>
</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">
<property name="text">
<string>close screen</string>
@ -211,10 +171,57 @@
</property>
</widget>
</item>
<item row="0" column="5" colspan="2">
<widget class="QLabel" name="label_4">
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_5">
<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>
</widget>
</item>