diff --git a/.prettierignore b/.prettierignore index 9c6b791d..1383d672 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,5 +2,5 @@ out dist pnpm-lock.yaml LICENSE.md -tsconfig.json -tsconfig.*.json +jsconfig.json +jsconfig.*.json diff --git a/src/renderer/src/App.vue b/src/renderer/src/App.vue index 71ce6a9e..7200133a 100644 --- a/src/renderer/src/App.vue +++ b/src/renderer/src/App.vue @@ -8,7 +8,7 @@ :name="item.prop" lazy > - + @@ -39,11 +39,7 @@ export default { } }, mounted() {}, - methods: { - getDevices() { - window.adbkit.createClient() - }, - }, + methods: {}, } diff --git a/src/renderer/src/components/Advanced/configs/audio/index.js b/src/renderer/src/components/Advanced/configs/audio/index.js new file mode 100644 index 00000000..5be2c1b0 --- /dev/null +++ b/src/renderer/src/components/Advanced/configs/audio/index.js @@ -0,0 +1,15 @@ +export default () => { + // "[server] INFO: List of audio encoders:" + // "--audio-codec=opus --audio-encoder='c2.android.opus.encoder'" + // "--audio-codec=aac --audio-encoder='c2.android.aac.encoder'" + // "--audio-codec=aac --audio-encoder='OMX.google.aac.encoder'" + return [ + { + label: '禁用音频', + field: '--no-audio', + type: 'switch', + value: false, + placeholder: '开启后将禁用音频功能', + }, + ] +} diff --git a/src/renderer/src/components/Advanced/configs/device/index.js b/src/renderer/src/components/Advanced/configs/device/index.js new file mode 100644 index 00000000..7d36c26f --- /dev/null +++ b/src/renderer/src/components/Advanced/configs/device/index.js @@ -0,0 +1,18 @@ +export default () => { + return [ + { + label: '保持清醒', + type: 'switch', + field: '--stay-awake', + value: false, + placeholder: '开启以防止设备进入睡眠状态(仅有线方式连接时有效)', + }, + { + label: '关闭屏幕', + type: 'switch', + field: '--turn-screen-off', + value: false, + placeholder: '开启后连接镜像时将自动关闭设备屏幕', + }, + ] +} diff --git a/src/renderer/src/components/Advanced/configs/index.js b/src/renderer/src/components/Advanced/configs/index.js new file mode 100644 index 00000000..deb05d7f --- /dev/null +++ b/src/renderer/src/components/Advanced/configs/index.js @@ -0,0 +1,4 @@ +export { default as video } from './video/index.js' +export { default as device } from './device/index.js' +export { default as window } from './window/index.js' +export { default as audio } from './audio/index.js' diff --git a/src/renderer/src/components/Advanced/configs/video/index.js b/src/renderer/src/components/Advanced/configs/video/index.js new file mode 100644 index 00000000..4c4d67ab --- /dev/null +++ b/src/renderer/src/components/Advanced/configs/video/index.js @@ -0,0 +1,94 @@ +export default () => { + return [ + { + label: '分辨率', + type: 'input.number', + field: '--max-size', + value: '', + placeholder: '默认值为设备分辨率,如 1920', + }, + { + label: '比特率', + type: 'input', + field: '--video-bit-rate', + value: '', + placeholder: '默认值为 4M,等同于 4000000', + }, + { + label: '刷新率', + type: 'input.number', + field: '--max-fps', + value: '', + placeholder: '默认值为 60', + }, + { + label: '屏幕旋转', + type: 'select', + field: '--rotation=0', + value: '', + placeholder: '默认值为设备屏幕旋转角度', + options: [ + { label: '0°', value: '0' }, + { label: '-90°', value: '1' }, + { label: '180°', value: '2' }, + { label: '90°', value: '3' }, + ], + }, + { + label: '解码器', + type: 'select', + field: '--video-codec', + value: '', + placeholder: '解码器默认值为 h264', + options: [ + { + label: 'h264', + value: 'h264', + }, + { + label: 'h265', + value: 'h265', + }, + { + label: 'av1', + value: 'av1', + }, + ], + }, + { + label: '编码器', + type: 'select', + field: '--video-encoder', + value: '', + placeholder: '编码器默认值为 h264', + // "[server] INFO: List of video encoders:" + // "--video-codec=h264 --video-encoder='OMX.qcom.video.encoder.avc'" + // "--video-codec=h264 --video-encoder='c2.android.avc.encoder'" + // "--video-codec=h264 --video-encoder='OMX.google.h264.encoder'" + // "--video-codec=h265 --video-encoder='OMX.qcom.video.encoder.hevc'" + // "--video-codec=h265 --video-encoder='c2.android.hevc.encoder'" + options: [ + { + label: 'OMX.qcom.video.encoder.avc', + value: 'OMX.qcom.video.encoder.avc', + }, + { + label: 'c2.android.avc.encoder', + value: 'c2.android.avc.encoder', + }, + { + label: 'OMX.google.h264.encoder', + value: 'OMX.google.h264.encoder', + }, + { + label: 'OMX.qcom.video.encoder.hevc', + value: 'OMX.qcom.video.encoder.hevc', + }, + { + label: 'c2.android.hevc.encoder', + value: 'c2.android.hevc.encoder', + }, + ], + }, + ] +} diff --git a/src/renderer/src/components/Advanced/configs/window/index.js b/src/renderer/src/components/Advanced/configs/window/index.js new file mode 100644 index 00000000..634ee08a --- /dev/null +++ b/src/renderer/src/components/Advanced/configs/window/index.js @@ -0,0 +1,18 @@ +export default () => { + return [ + { + label: '无边框模式', + field: '--window-borderless', + type: 'switch', + value: false, + placeholder: '开启无边框模式', + }, + { + label: '全屏模式', + field: '--fullscreen', + type: 'switch', + value: false, + placeholder: '开启全屏模式', + }, + ] +} diff --git a/src/renderer/src/components/Advanced/index.vue b/src/renderer/src/components/Advanced/index.vue index d896ba64..b6097552 100644 --- a/src/renderer/src/components/Advanced/index.vue +++ b/src/renderer/src/components/Advanced/index.vue @@ -1,11 +1,148 @@ - + diff --git a/src/renderer/src/components/Devices/index.vue b/src/renderer/src/components/Devices/index.vue index 53a7816a..65e498dc 100644 --- a/src/renderer/src/components/Devices/index.vue +++ b/src/renderer/src/components/Devices/index.vue @@ -1,19 +1,26 @@