Skip to content

Commit 97975ee

Browse files
authored
Merge pull request #640 from barry-ran/dev
sync
2 parents 5d62f85 + 3929ebf commit 97975ee

File tree

7 files changed

+62
-34
lines changed

7 files changed

+62
-34
lines changed

QtScrcpy/res/i18n/en_US.qm

0 Bytes
Binary file not shown.

QtScrcpy/res/i18n/en_US.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@
287287
</message>
288288
<message>
289289
<source>auto update</source>
290-
<translation>autp update</translation>
290+
<translation>auto update</translation>
291291
</message>
292292
</context>
293293
</TS>

QtScrcpy/sndcpy/sndcpy.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ echo Find device %1
1919
for /f "delims=" %%i in ('%ADB% %serial% shell pm path com.rom1v.sndcpy') do set sndcpy_installed=%%i
2020
if "%sndcpy_installed%"=="" (
2121
echo Install %SNDCPY_APK%...
22-
%ADB% %serial% uninstall com.rom1v.sndcpy || goto :error
22+
%ADB% %serial% uninstall com.rom1v.sndcpy || echo uninstall failed
2323
%ADB% %serial% install -t -r -g %SNDCPY_APK% || goto :error
2424
echo Install %SNDCPY_APK% success
2525
)

QtScrcpy/sndcpy/sndcpy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ echo "Find device $1"
1919
sndcpy_installed=$($ADB $serial shell pm path com.rom1v.sndcpy)
2020
if [[ $sndcpy_installed == "" ]]; then
2121
echo Install $SNDCPY_APK...
22-
$ADB $serial uninstall com.rom1v.sndcpy
22+
$ADB $serial uninstall com.rom1v.sndcpy || echo uninstall failed
2323
$ADB $serial install -t -r -g $SNDCPY_APK
2424
echo Install $SNDCPY_APK success
2525
fi

QtScrcpy/ui/dialog.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ void Dialog::delayMs(int ms)
233233

234234
QString Dialog::getGameScript(const QString &fileName)
235235
{
236+
if (fileName.isEmpty()) {
237+
return "";
238+
}
239+
236240
QFile loadFile(getKeyMapPath() + "/" + fileName);
237241
if (!loadFile.open(QIODevice::ReadOnly)) {
238242
outLog("open file failed:" + fileName, true);
@@ -667,7 +671,7 @@ void Dialog::on_useSingleModeCheck_clicked()
667671
ui->rightWidget->show();
668672
}
669673

670-
resize(layout()->sizeHint().width(), height());
674+
adjustSize();
671675
}
672676

673677
void Dialog::on_serialBox_currentIndexChanged(const QString &arg1)

QtScrcpy/ui/dialog.ui

+24
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@
119119
</item>
120120
<item>
121121
<widget class="QCheckBox" name="autoUpdatecheckBox">
122+
<property name="sizePolicy">
123+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
124+
<horstretch>0</horstretch>
125+
<verstretch>0</verstretch>
126+
</sizepolicy>
127+
</property>
122128
<property name="text">
123129
<string>auto update</string>
124130
</property>
@@ -975,20 +981,38 @@
975981
</property>
976982
<item>
977983
<widget class="QPushButton" name="installSndcpyBtn">
984+
<property name="sizePolicy">
985+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
986+
<horstretch>0</horstretch>
987+
<verstretch>0</verstretch>
988+
</sizepolicy>
989+
</property>
978990
<property name="text">
979991
<string>install sndcpy</string>
980992
</property>
981993
</widget>
982994
</item>
983995
<item>
984996
<widget class="QPushButton" name="startAudioBtn">
997+
<property name="sizePolicy">
998+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
999+
<horstretch>0</horstretch>
1000+
<verstretch>0</verstretch>
1001+
</sizepolicy>
1002+
</property>
9851003
<property name="text">
9861004
<string>start audio</string>
9871005
</property>
9881006
</widget>
9891007
</item>
9901008
<item>
9911009
<widget class="QPushButton" name="stopAudioBtn">
1010+
<property name="sizePolicy">
1011+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
1012+
<horstretch>0</horstretch>
1013+
<verstretch>0</verstretch>
1014+
</sizepolicy>
1015+
</property>
9921016
<property name="text">
9931017
<string>stop audio</string>
9941018
</property>

README.md

+30-30
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# QtScrcpy
22

3-
[![Financial Contributors on Open Collective](https://opencollective.com/QtScrcpy/all/badge.svg?label=financial+contributors)](https://opencollective.com/QtScrcpy)
3+
[![Financial Contributors to Open Collective](https://opencollective.com/QtScrcpy/all/badge.svg?label=financial+contributors)](https://opencollective.com/QtScrcpy)
44
![Windows](https://github.com/barry-ran/QtScrcpy/workflows/Windows/badge.svg)
55
![MacOS](https://github.com/barry-ran/QtScrcpy/workflows/MacOS/badge.svg)
66
![Ubuntu](https://github.com/barry-ran/QtScrcpy/workflows/Ubuntu/badge.svg)
@@ -10,9 +10,9 @@
1010

1111
[中文介绍](README_zh.md)
1212

13-
QtScrcpy connects to Android devices via USB (or via TCP/IP) for display and control. It does NOT require the root privileges.
13+
QtScrcpy connects to Android devices via USB (or via TCP/IP) for display and control. It does NOT require root privileges.
1414

15-
It supports three major platforms: GNU/Linux, Windows and MacOS.
15+
It supports three major platforms: GNU/Linux, Windows and macOS.
1616

1717
It focuses on:
1818

@@ -32,15 +32,15 @@ It focuses on:
3232
![linux](screenshot/linux-en.png)
3333

3434
## Customized key mapping
35-
You can write your own script to map keyboard and mouse actions to touches and clicks of the mobile phone according to your needs. [Here](docs/KeyMapDes.md) are the rules.
35+
You can write your script to map keyboard and mouse actions to touches and clicks of the mobile phone according to your needs. [Here](docs/KeyMapDes.md) are the rules.
3636

37-
A script for "PUBG mobile" and TikTok mapping is provided by default. Once enabled, you can play the game with your keyboard and mouse as the PC version. or you can use up/down/left/right direction keys to simulate up/down/left/right sliding. You can also write your own mapping files for other games according to [writing rules](docs/KeyMapDes.md). The default key mapping is as follows:
37+
A script for "PUBG mobile" and TikTok mapping is provided by default. Once enabled, you can play the game with your keyboard and mouse as the PC version. or you can use up/down/left/right direction keys to simulate up/down/left/right sliding. You can also write your mapping files for other games according to [the writing rules](docs/KeyMapDes.md). The default key mapping is as follows:
3838

3939
![game](screenshot/game.jpg)
4040

4141
[Here is a video demonstration of playing "PUBG mobile"](http://mp.weixin.qq.com/mp/video?__biz=MzU1NTg5MjYyNw==&mid=100000015&sn=3e301fdc5a364bd16d6207fa674bc8b3&vid=wxv_968792362971430913&idx=1&vidsn=eec329cc13c3e24c187dc9b4d5eb8760&fromid=1&scene=20&xtrack=1&clicktime=1567346543&sessionid=1567346375&subscene=92&ascene=0&fasttmpl_type=0&fasttmpl_fullversion=4730859-zh_CN-zip&fasttmpl_flag=0&realreporttime=1567346543910#wechat_redirect)
4242

43-
Here is the instruction of adding new customized mapping files.
43+
Here is the instruction for adding new customized mapping files.
4444

4545
- Write a customized script and put it in the `keymap` directory
4646
- Click `refresh script` to check whether it can be found
@@ -81,7 +81,7 @@ build|meson+gradle|qmake or CMake
8181
## Learn
8282

8383
If you are interested in it and want to learn how it works but do not know how to get started, you can choose to purchase my recorded video lessons.
84-
It details the development architecture and the development process of the entire software, and help you develop QtScrcpy from scratch.
84+
It details the development architecture and the development process of the entire software and helps you develop QtScrcpy from scratch.
8585

8686
Course introduction:[https://blog.csdn.net/rankun1/article/details/87970523](https://blog.csdn.net/rankun1/article/details/87970523)
8787

@@ -93,7 +93,7 @@ QQ Group number:901736468
9393
## Requirements
9494
Android API >= 21 (Android 5.0).
9595

96-
Make sure you enabled [adb debugging][enable-adb] on your device(s).
96+
Make sure you have enabled [ADB debugging][enable-adb] on your device(s).
9797

9898
[enable-adb]: https://developer.android.com/studio/command-line/adb.html#Enabling
9999

@@ -104,63 +104,63 @@ Make sure you enabled [adb debugging][enable-adb] on your device(s).
104104
[github-download]: https://github.com/barry-ran/QtScrcpy/releases
105105

106106
### Windows
107-
For Windows, for simplicity, prebuilt archives with all the dependencies (including adb) are available:
107+
For Windows, for simplicity, prebuilt archives with all the dependencies (including ADB) are available:
108108

109109
- [`QtScrcpy`][github-download]
110110

111-
or you can [build it by yourself](##Build)
111+
or you can [build it by yourself](#Build)
112112

113113
### Mac OS
114-
For Mac OS, for simplicity, prebuilt archives with all the dependencies (including adb) are available:
114+
For Mac OS, for simplicity, prebuilt archives with all the dependencies (including ADB) are available:
115115

116116
- [`QtScrcpy`][github-download]
117117

118-
or you can [build it by yourself](##Build)
118+
or you can [build it by yourself](#Build)
119119

120120
### Linux
121-
you can [build it by yourself](##Build)(just ubuntu test)
121+
you can [build it by yourself](#Build)(just ubuntu test)
122122

123123

124124
## Run
125125
Connect to your Android device on your computer, then run the program and click `USB connect` or `WiFi connect`
126126

127-
### Wireless connection steps (ensure that the mobile phone and PC are in the same LAN):
127+
### Wireless connection steps (ensure that the mobile phone and PC are on the same LAN):
128128
1. Enable USB debugging in developer options on the Android device
129-
2. Connect the Android device to computer via USB
129+
2. Connect the Android device to the computer via USB
130130
3. Click update device, and you will see that the device number is updated
131131
4. Click get device IP
132132
5. Click start adbd
133133
6. Click wireless connect
134-
7. Click update device again, and another device with IP address will be found. Select this device.
134+
7. Click update device again, and another device with an IP address will be found. Select this device.
135135
8. Click start service
136136

137137

138-
Note: it is not necessary to keep you Android device connected via USB after you start adbd.
138+
Note: it is not necessary to keep your Android device connected via USB after you start adbd.
139139

140140
## Interface button introduction:
141141

142142
- Start config: function parameter settings before starting the service
143143

144-
You can set the bit rate, resolution, recording format, and video save path of the local recorded video.
144+
You can set the bit rate, resolution, recording format, and video save path of the locally recorded video.
145145

146-
- Background record: the Android device screen is not displayed after starting the service. It is recorded in background.
147-
- Always on top: the video window for Android device will be kept on the top
146+
- Background record: the Android device screen is not displayed after starting the service. It is recorded in the background.
147+
- Always on top: the video window for Android devices will be kept on the top
148148
- Close screen: automatically turn off the Android device screen to save power after starting the service
149-
- Reverse connection: service startup mode. You can uncheck it if you experience connection failure with message `more than one device`
149+
- Reverse connection: service startup mode. You can uncheck it if you experience connection failure with a message `more than one device`
150150

151151
- Refresh devices: Refresh the currently connected device
152152
- Start service: connect to the Android device
153-
- Stop service: disconnect from Android device
153+
- Stop service: disconnect from the Android device
154154
- Stop all services: disconnect all connected Android devices
155155
- Get device IP: Get the IP address of the Android device and update it to the "Wireless" area for the ease of wireless connection setting.
156156
- Start adbd: Start the adbd service of the Android device. You must start it before the wireless connection.
157157
- Wireless connect: Connect to Android devices wirelessly
158158
- Wireless disconnect: Disconnect wirelessly connected Android devices
159-
- adb command: execute customized adb commands (blocking commands are not supported now, such as shell)
159+
- adb command: execute customized ADB commands (blocking commands are not supported now, such as a shell)
160160

161161

162162
## The main function
163-
- Display Android device screens in real time
163+
- Display Android device screens in real-time
164164
- Real-time mouse and keyboard control of Android devices
165165
- Screen recording
166166
- Screenshot to png
@@ -228,11 +228,11 @@ Everyone is welcome to maintain this project and contribute your own code, but p
228228
4. Please keep the code style consistent with the existing style
229229

230230
## Why develop QtScrcpy?
231-
There are several reasons listed as below according to importance (high to low).
231+
There are several reasons listed below according to importance (high to low).
232232
1. In the process of learning Qt, I need a real project to try
233-
2. I have some background skill about audio and video and I am interested at them
233+
2. I have some background skills in audio and video and I am interested in them
234234
3. I have some Android development skills. But I have used it for a long time. I want to consolidate it.
235-
4. I found scrcpy and decided to re-make it with the new technology stack (C++ + Qt + Opengl + ffmpeg)
235+
4. I found scrcpy and decided to re-make it with the new technology stack (C++ + Qt + Opengl + FFmpeg)
236236

237237

238238
## Build
@@ -249,8 +249,8 @@ Qt version>=5.12 (use MSVC 2019 on Windows)
249249

250250
1. Set up an Android development environment on the target platform
251251
2. Open server project in project root with Android Studio
252-
3. The first time you open it, if you do not have the corresponding version of gradle, you will be prompted to find gradle, whether to upgrade gradle and create it. Select Cancel. After canceling, you will be prompted to select the location of the existing gradle. You can also cancel it (it will download automatically).
253-
4. Edit the code as needed, but of course you do n’t need to.
252+
3. The first time you open it, if you do not have the corresponding version of Gradle, you will be prompted to find Gradle, whether to upgrade Gradle or create it. Select Cancel. After canceling, you will be prompted to select the location of the existing Gradle. You can also cancel it (it will download automatically).
253+
4. Edit the code as needed, but of course, you don’t need to.
254254
4. After compiling the apk, rename it to scrcpy-server and replace QtScrcpy/QtScrcpyCore/src/third_party/scrcpy-server.
255255

256256
## Licence
@@ -274,7 +274,7 @@ Since it is based on scrcpy, respect its Licence
274274

275275
[Barry CSDN](https://blog.csdn.net/rankun1)
276276

277-
An ordinary programmer, working mainly in C++ for desktop client development, graduated from Shandong for more than a year of steel simulation education software, and later moved to Shanghai to work in security, online education related fields, familiar with audio and video. I have an understanding of audio and video fields such as voice calls, live education, video conferencing and other related solutions. I also have experience in Android, Linux server and other kinds of development.
277+
An ordinary programmer, working mainly in C++ for desktop client development, graduated from Shandong for more than a year of steel simulation education software, and later moved to Shanghai to work in security, online education-related fields, familiar with audio and video. I have an understanding of audio and video fields such as voice calls, live education, video conferencing and other related solutions. I also have experience in Android, Linux servers and other kinds of development.
278278

279279
## Contributors
280280

0 commit comments

Comments
 (0)