mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-04 06:38:39 +00:00
feat: update config
This commit is contained in:
parent
c96e3ed9dd
commit
3e725e1675
8 changed files with 60 additions and 13 deletions
|
@ -10,6 +10,7 @@
|
||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
#include "videoform.h"
|
#include "videoform.h"
|
||||||
#include "controller.h"
|
#include "controller.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
Device::Device(DeviceParams params, QObject *parent)
|
Device::Device(DeviceParams params, QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
@ -27,8 +28,7 @@ Device::Device(DeviceParams params, QObject *parent)
|
||||||
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(params.gameScript, this);
|
m_controller = new Controller(params.gameScript, this);
|
||||||
//m_videoForm = new VideoForm(false);
|
m_videoForm = new VideoForm(Config::getInstance().getSkin());
|
||||||
m_videoForm = new VideoForm();
|
|
||||||
m_videoForm->setSerial(m_params.serial);
|
m_videoForm->setSerial(m_params.serial);
|
||||||
if (m_controller) {
|
if (m_controller) {
|
||||||
m_videoForm->setController(m_controller);
|
m_videoForm->setController(m_controller);
|
||||||
|
|
|
@ -153,7 +153,7 @@ void Dialog::on_startServerBtn_clicked()
|
||||||
params.maxSize = videoSize;
|
params.maxSize = videoSize;
|
||||||
params.bitRate = bitRate;
|
params.bitRate = bitRate;
|
||||||
// on devices with Android >= 10, the capture frame rate can be limited
|
// on devices with Android >= 10, the capture frame rate can be limited
|
||||||
params.maxFps = 60;
|
params.maxFps = Config::getInstance().getMaxFps();
|
||||||
params.recordFileName = absFilePath;
|
params.recordFileName = absFilePath;
|
||||||
params.closeScreen = ui->closeScreenCheck->isChecked();
|
params.closeScreen = ui->closeScreenCheck->isChecked();
|
||||||
params.useReverse = ui->useReverseCheck->isChecked();
|
params.useReverse = ui->useReverseCheck->isChecked();
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>600</width>
|
<width>513</width>
|
||||||
<height>637</height>
|
<height>637</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -169,7 +169,7 @@
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
<height>240</height>
|
<height>200</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="focusPolicy">
|
<property name="focusPolicy">
|
||||||
|
|
|
@ -18,9 +18,7 @@ void installTranslator();
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
//QApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
//QApplication::setAttribute(Qt::AA_UseOpenGLES);
|
|
||||||
//QApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
|
|
||||||
|
|
||||||
g_oldMessageHandler = qInstallMessageHandler(myMessageOutput);
|
g_oldMessageHandler = qInstallMessageHandler(myMessageOutput);
|
||||||
Stream::init();
|
Stream::init();
|
||||||
|
@ -64,6 +62,15 @@ int main(int argc, char *argv[])
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int opengl = Config::getInstance().getDesktopOpenGL();
|
||||||
|
if (0 == opengl) {
|
||||||
|
QApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
|
||||||
|
} else if (1 == opengl){
|
||||||
|
QApplication::setAttribute(Qt::AA_UseOpenGLES);
|
||||||
|
} else if (2 == opengl) {
|
||||||
|
QApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
|
||||||
|
}
|
||||||
|
|
||||||
g_mainDlg = new Dialog;
|
g_mainDlg = new Dialog;
|
||||||
g_mainDlg->setWindowTitle(Config::getInstance().getTitle());
|
g_mainDlg->setWindowTitle(Config::getInstance().getTitle());
|
||||||
g_mainDlg->show();
|
g_mainDlg->show();
|
||||||
|
|
|
@ -15,6 +15,14 @@
|
||||||
#define COMMON_SERVER_VERSION_KEY "ServerVersion"
|
#define COMMON_SERVER_VERSION_KEY "ServerVersion"
|
||||||
#define COMMON_SERVER_VERSION_DEF "1.12.1"
|
#define COMMON_SERVER_VERSION_DEF "1.12.1"
|
||||||
|
|
||||||
|
#define COMMON_MAX_FPS_KEY "MaxFps"
|
||||||
|
#define COMMON_MAX_FPS_DEF 60
|
||||||
|
|
||||||
|
#define COMMON_DESKTOP_OPENGL_KEY "UseDesktopOpenGL"
|
||||||
|
#define COMMON_DESKTOP_OPENGL_DEF -1
|
||||||
|
|
||||||
|
#define COMMON_SKIN_KEY "UseSkin"
|
||||||
|
#define COMMON_SKIN_DEF 1
|
||||||
|
|
||||||
QString Config::s_configPath = "";
|
QString Config::s_configPath = "";
|
||||||
|
|
||||||
|
@ -67,6 +75,33 @@ QString Config::getServerVersion()
|
||||||
return server;
|
return server;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Config::getMaxFps()
|
||||||
|
{
|
||||||
|
int fps = 60;
|
||||||
|
m_settings->beginGroup(GROUP_COMMON);
|
||||||
|
fps = m_settings->value(COMMON_MAX_FPS_KEY, COMMON_MAX_FPS_DEF).toInt();
|
||||||
|
m_settings->endGroup();
|
||||||
|
return fps;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Config::getDesktopOpenGL()
|
||||||
|
{
|
||||||
|
int opengl = 0;
|
||||||
|
m_settings->beginGroup(GROUP_COMMON);
|
||||||
|
opengl = m_settings->value(COMMON_DESKTOP_OPENGL_KEY, COMMON_DESKTOP_OPENGL_DEF).toInt();
|
||||||
|
m_settings->endGroup();
|
||||||
|
return opengl;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Config::getSkin()
|
||||||
|
{
|
||||||
|
int skin = 1;
|
||||||
|
m_settings->beginGroup(GROUP_COMMON);
|
||||||
|
skin = m_settings->value(COMMON_SKIN_KEY, COMMON_SKIN_DEF).toInt();
|
||||||
|
m_settings->endGroup();
|
||||||
|
return skin;
|
||||||
|
}
|
||||||
|
|
||||||
QString Config::getTitle()
|
QString Config::getTitle()
|
||||||
{
|
{
|
||||||
QString title;
|
QString title;
|
||||||
|
|
|
@ -14,6 +14,9 @@ public:
|
||||||
QString getRecordPath();
|
QString getRecordPath();
|
||||||
void setRecordPath(const QString& path);
|
void setRecordPath(const QString& path);
|
||||||
QString getServerVersion();
|
QString getServerVersion();
|
||||||
|
int getMaxFps();
|
||||||
|
int getDesktopOpenGL();
|
||||||
|
int getSkin();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit Config(QObject *parent = nullptr);
|
explicit Config(QObject *parent = nullptr);
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
[common]
|
[common]
|
||||||
WindowTitle=abc
|
WindowTitle=QtScrcpy
|
||||||
RecordPath=C:/Users/bytedance/Desktop
|
RecordPath=
|
||||||
|
MaxFps=60
|
||||||
ServerVersion=1.12.1
|
ServerVersion=1.12.1
|
||||||
|
UseSkin=1
|
||||||
|
UseDesktopOpenGL=-1
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
- 中文输入(server需要改为apk,作为一个输入法,暂不实现)(或者有其他方式案件注入方式,例如搜狗手机输入法可以监听当前注入?)
|
- 中文输入(server需要改为apk,作为一个输入法,暂不实现)(或者有其他方式案件注入方式,例如搜狗手机输入法可以监听当前注入?)
|
||||||
- [跳过帧改为动态配置,而不是静态编译](https://github.com/Genymobile/scrcpy/commit/ebccb9f6cc111e8acfbe10d656cac5c1f1b744a0)
|
- [跳过帧改为动态配置,而不是静态编译](https://github.com/Genymobile/scrcpy/commit/ebccb9f6cc111e8acfbe10d656cac5c1f1b744a0)
|
||||||
- [单独线程统计帧率](https://github.com/Genymobile/scrcpy/commit/e2a272bf99ecf48fcb050177113f903b3fb323c4)
|
- [单独线程统计帧率](https://github.com/Genymobile/scrcpy/commit/e2a272bf99ecf48fcb050177113f903b3fb323c4)
|
||||||
|
- text转换 https://github.com/Genymobile/scrcpy/commit/c916af0984f72a60301d13fa8ef9a85112f54202?tdsourcetag=s_pctim_aiomsg
|
||||||
- ui提供show touch设置
|
- ui提供show touch设置
|
||||||
|
|
||||||
## 中优先级
|
## 中优先级
|
||||||
|
@ -12,11 +13,9 @@
|
||||||
- 自动打包脚本
|
- 自动打包脚本
|
||||||
- 脚本
|
- 脚本
|
||||||
- 群控
|
- 群控
|
||||||
- 配置文件
|
|
||||||
- 软硬解配置,去皮肤配置
|
|
||||||
- 窗口可改变大小
|
|
||||||
- 竖屏全屏不拉伸画面
|
- 竖屏全屏不拉伸画面
|
||||||
- 分辨率码率可自定义
|
- 分辨率码率可自定义
|
||||||
|
- opengles 3.0
|
||||||
|
|
||||||
## 高优先级
|
## 高优先级
|
||||||
- linux打包以及版本号
|
- linux打包以及版本号
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue