Skip to content

Commit

Permalink
新增:支持设置投屏视频比特率和刷新率
Browse files Browse the repository at this point in the history
  • Loading branch information
modstart committed Dec 23, 2024
1 parent a4e4f7a commit 0706be2
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 45 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## v0.3.0

- 新增:支持设置投屏视频比特率和刷新率
- 新增:调试窗口统一管理,方便查看调试信息
- 增加:构建版本时间序列号
- 优化:Mac 打包增加自建证书,避免安装提示被损坏问题
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linkandroid",
"version": "0.3.0-beta",
"version": "0.3.0",
"main": "dist-electron/main/index.js",
"description": "Link android to PC easily",
"author": "ModStartLib",
Expand Down
40 changes: 34 additions & 6 deletions src/components/Device/DeviceDefaultSettingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import {ref} from "vue";
import SettingItemYesNo from "../common/SettingItemYesNo.vue";
import {useSettingStore} from "../../store/modules/setting";
import SettingItemInput from "../common/SettingItemInput.vue";
const setting = useSettingStore()
const visible = ref(false)
Expand All @@ -10,6 +11,8 @@ const formData = ref({
alwaysTop: '',
mirrorSound: '',
previewImage: '',
videoBitRate: '',
maxFps: ''
})
const show = async () => {
formData.value.dimWhenMirror = setting.configGet('Device.dimWhenMirror', 'no').value
Expand Down Expand Up @@ -51,12 +54,12 @@ defineExpose({
<div class="font-bold text-xl mb-3">
{{ $t('投屏') }}
</div>
<!-- <div class="flex mb-3">-->
<!-- <div class="flex-grow">{{ $t('投屏时调暗屏幕') }}</div>-->
<!-- <div class="">-->
<!-- <SettingItemYesNo v-model="formData.dimWhenMirror"/>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="flex mb-3">-->
<!-- <div class="flex-grow">{{ $t('投屏时调暗屏幕') }}</div>-->
<!-- <div class="">-->
<!-- <SettingItemYesNo v-model="formData.dimWhenMirror"/>-->
<!-- </div>-->
<!-- </div>-->
<div class="flex mb-3">
<div class="flex-grow">{{ $t('投屏总在最上层') }}</div>
<div class="">
Expand All @@ -75,6 +78,31 @@ defineExpose({
<SettingItemYesNo v-model="formData.previewImage"/>
</div>
</div>
<div class="flex mb-3">
<div class="flex-grow">
<div>{{ $t('视频比特率') }}</div>
<div class="text-gray-400 text-xs">{{ $t('默认 8000000(8M),支持支持单位 K、M') }}</div>
</div>
<div class="">
<a-input :model-value="setting.configGet('Device.videoBitRate', '8M').value"
style="width:10rem;"
size="small"
@input="setting.onConfigChange('Device.videoBitRate',$event)">
<template #append>BPS</template>
</a-input>
</div>
</div>
<div class="flex mb-3">
<div class="flex-grow">{{ $t('刷新率') }}</div>
<div class="">
<a-input :model-value="setting.configGet('Device.maxFps', '60').value"
style="width:10rem;"
size="small"
@input="setting.onConfigChange('Device.maxFps',$event)">
<template #append>FPS</template>
</a-input>
</div>
</div>
</div>
</div>
</div>
Expand Down
30 changes: 24 additions & 6 deletions src/components/Device/DeviceSettingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const formData = ref({
alwaysTop: '',
mirrorSound: '',
previewImage: '',
videoBitRate: '',
maxFps: '',
})
const device = ref<DeviceRecord | null>(null)
const infoColumns = [
Expand All @@ -37,6 +39,8 @@ const show = (record: DeviceRecord) => {
formData.value.alwaysTop = record.setting?.alwaysTop || ''
formData.value.mirrorSound = record.setting?.mirrorSound || ''
formData.value.previewImage = record.setting?.previewImage || ''
formData.value.videoBitRate = record.setting?.videoBitRate || ''
formData.value.maxFps = record.setting?.maxFps || ''
visible.value = true
}
Expand All @@ -46,6 +50,8 @@ const doSubmit = async () => {
alwaysTop: formData.value.alwaysTop,
mirrorSound: formData.value.mirrorSound,
previewImage: formData.value.previewImage,
videoBitRate: formData.value.videoBitRate,
maxFps: formData.value.maxFps,
})
visible.value = false
}
Expand Down Expand Up @@ -74,12 +80,12 @@ defineExpose({
<div class="font-bold text-xl mb-3">
{{ $t('投屏') }}
</div>
<!-- <div class="flex mb-3">-->
<!-- <div class="flex-grow">{{ $t('投屏时调暗屏幕') }}</div>-->
<!-- <div class="">-->
<!-- <SettingItemYesNoDefault v-model="formData.dimWhenMirror"/>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="flex mb-3">-->
<!-- <div class="flex-grow">{{ $t('投屏时调暗屏幕') }}</div>-->
<!-- <div class="">-->
<!-- <SettingItemYesNoDefault v-model="formData.dimWhenMirror"/>-->
<!-- </div>-->
<!-- </div>-->
<div class="flex mb-3">
<div class="flex-grow">{{ $t('投屏总在最上层') }}</div>
<div class="">
Expand All @@ -98,6 +104,18 @@ defineExpose({
<SettingItemYesNoDefault v-model="formData.previewImage"/>
</div>
</div>
<div class="flex mb-3">
<div class="flex-grow">{{ $t('视频比特率') }}</div>
<div class="">
<a-input v-model="formData.videoBitRate" size="small" :placeholder="$t('留空使用默认配置')"/>
</div>
</div>
<div class="flex mb-3">
<div class="flex-grow">{{ $t('刷新率') }}</div>
<div class="">
<a-input v-model="formData.maxFps" size="small" :placeholder="$t('留空使用默认配置')"/>
</div>
</div>
<div class="font-bold text-xl mb-3">
{{ $t('其他') }}
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/components/Setting/SettingAbout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,19 @@ const doOpenLog = async () => {
</div>
<div class="flex mb-3 items-center">
<div class="w-20">{{ t('官网') }}</div>
<div class="flex-grow">
<div class="flex-grow flex items-center">
<a :href="AppConfig.website" target="_blank"
class="text-link">
{{ AppConfig.website }}
</a>
<a :href="AppConfig.feedbackUrl"
target="_blank"
class="align-top arco-btn arco-btn-secondary arco-btn-shape-square arco-btn-size-medium arco-btn-status-normal ml-3">
class="align-top arco-btn arco-btn-secondary arco-btn-shape-square arco-btn-size-mini arco-btn-status-normal ml-3">
<icon-customer-service class="mr-1"/>
{{ t('使用反馈') }}
</a>
<a-button class="ml-3"
size="mini"
@click="doOpenLog">
<template #icon>
<icon-file/>
Expand Down
11 changes: 11 additions & 0 deletions src/components/common/SettingItemInput.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup lang="ts">
</script>

<template>
<a-input size="small"/>
</template>

<style scoped>
</style>
4 changes: 4 additions & 0 deletions src/lang/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"0012c13f": "Hide",
"0013c7cc": "Default",
"002d4177": "IP",
"0141644e": "Frame Rate",
"01473f25": "Shell",
"0161efea": "FPS",
"016d5865": "Disconnected",
Expand All @@ -70,6 +71,7 @@
"196deb0f": "Always top",
"1bb341a5": "This product is open-source software and follows the GPL-3.0 license.",
"1d609af5": "Recording Duration {time}",
"23886069": "Video Bit Rate",
"24aeb765": "Upload Successful",
"24af1f25": "Upload File",
"24ba3978": "Device Not Connected",
Expand Down Expand Up @@ -125,6 +127,7 @@
"3bcdfa72": "Network",
"3d329aff": "Default {port}",
"3dc180fa": "Are you sure you want to delete the device?",
"3eb6a611": "Default 8000000(8M), Support Unit K、M",
"40e57868": "Detail",
"4148da61": "Request error",
"42554fbd": "Shell of {name} started",
Expand All @@ -143,6 +146,7 @@
"4f59d0b6": "Dim screen",
"4f997a55": "Delete",
"508513f9": "Are you sure you want to delete the selected files?",
"59950117": "Leave blank to use default",
"5affe2ba": "Click Close",
"5e1bac63": "Enter keywords to filter",
"613be122": "Close network device port",
Expand Down
6 changes: 5 additions & 1 deletion src/lang/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"删除设备": "279acc4d",
"刷新": "000a5a59",
"刷新成功": "26e95aa8",
"刷新率": "0141644e",
"刷新设备成功": "2513df31",
"剪切": "000a4cdd",
"加载中...": "07f6f37e",
Expand Down Expand Up @@ -145,6 +146,7 @@
"版本": "000e3de4",
"环境设置": "35f3e924",
"用户中心": "36bc2185",
"留空使用默认配置": "59950117",
"直接退出": "379a84eb",
"确定": "000ef0ec",
"确定删除设备?": "3dc180fa",
Expand All @@ -161,6 +163,7 @@
"网络设备": "3bcd6ff4",
"网络连接": "3bcdfa72",
"视图": "001105f8",
"视频比特率": "23886069",
"记住我的选择": "160fdc0e",
"设备": "00114509",
"设备 {name} 命令行": "6a51c6b3",
Expand Down Expand Up @@ -197,6 +200,7 @@
"隐藏其他": "4671999f",
"隐藏窗口": "467699ab",
"默认": "0013c7cc",
"默认 8000000(8M),支持支持单位 K、M": "3eb6a611",
"默认端口 {port}": "3d329aff",
"默认设置": "4a52703c"
}
}
6 changes: 5 additions & 1 deletion src/lang/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"0012c13f": "隐藏",
"0013c7cc": "默认",
"002d4177": "IP地址",
"0141644e": "刷新率",
"01473f25": "命令行",
"0161efea": "帧/秒",
"016d5865": "已断开",
Expand All @@ -83,6 +84,7 @@
"196deb0f": "投屏总在最上层",
"1bb341a5": "本产品为开源软件,遵循 GPL-3.0 license 协议。",
"1d609af5": "录制时长 {time}",
"23886069": "视频比特率",
"24aeb765": "上传成功",
"24af1f25": "上传文件",
"24ba3978": "设备未连接",
Expand Down Expand Up @@ -149,6 +151,7 @@
"3d718795": "更多内容,请查看",
"3dad1885": "设备版本过低,不支持此功能",
"3dc180fa": "确定删除设备?",
"3eb6a611": "默认 8000000(8M),支持支持单位 K、M",
"40e57868": "设备设置",
"4148da61": "请求错误",
"42554fbd": "进入设备 {name} 的命令行",
Expand All @@ -173,6 +176,7 @@
"4f997a55": "delete",
"508513f9": "确定删除选中的文件吗?",
"53f5fcc1": "支持的命令:",
"59950117": "留空使用默认配置",
"5affe2ba": "点击关闭时",
"5e1bac63": "输入关键词过滤",
"5e819406": "打开手机USB调试",
Expand Down Expand Up @@ -200,4 +204,4 @@
"7b5e9f5a": "正在打开摄像头",
"7cb31927": "确认卸载应用 {name} ?",
"7d2a202f": "发现新版本{version},是否立即下载更新?"
}
}
Loading

0 comments on commit 0706be2

Please sign in to comment.