Skip to content

Commit

Permalink
perf: 🚀 Add camera options
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Nov 6, 2023
1 parent 0530ed3 commit 5a04b4c
Show file tree
Hide file tree
Showing 14 changed files with 272 additions and 42 deletions.
8 changes: 5 additions & 3 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ Windows 及 Linux 端内部集成了 Gnirehtet, 用于提供 PC 到安卓设
9. 支持国际化 ✅
10. 对深色模式的支持 ✅
11. 添加 Gnirehtet 反向供网功能 ✅
12. 添加 Scrcpy 快捷键查询页面 🚧
13. 添加新的相机镜像相关功能 🚧
14. 添加对游戏的增强功能,如游戏键位映射 🚧
12. 添加新的实现镜像相关功能 ✅
13. 添加独立的剪切板同步功能 🚧
14. 更好的多屏协同 🚧
15. 添加 Scrcpy 快捷键查询页面 🚧
16. 添加对游戏的增强功能,如游戏键位映射 🚧

## 常见问题

Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ Refer to [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master
9. Support internationalization ✅
10. Support for dark mode ✅
11. Add Gnirehtet reverse network function ✅
12. Add Scrcpy shortcut key query page 🚧
13. Add new camera mirror related features 🚧"
14. Add game enhancement features such as game keyboard mapping 🚧
12. Add new camera mirror related features ✅
13. Add an clipboard synchronization function 🚧
14. Better multi -screen collaboration 🚧
15. Add Scrcpy shortcut key query page 🚧
16. Add game enhancement features such as game keyboard mapping 🚧

## FAQ

Expand Down
47 changes: 47 additions & 0 deletions src/components/Preference/components/CameraSwitch/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<template>
<el-switch
v-bind="data.props || {}"
v-model="switchValue"
class="!w-full"
:title="$t(data.placeholder)"
></el-switch>
</template>

<script>
export default {
props: {
modelValue: {
type: Boolean,
value: null,
},
data: {
type: Object,
default: () => ({}),
},
deviceScope: {
type: String,
value: '',
},
preferenceData: {
type: Object,
default: () => ({}),
},
},
emits: ['update:model-value'],
computed: {
switchValue: {
get() {
return (
this.modelValue || this.preferenceData['--video-source'] === 'camera'
)
},
set(value) {
this.preferenceData['--video-source'] = value ? 'camera' : 'display'
this.$emit('update:model-value', value)
},
},
},
}
</script>

<style></style>
16 changes: 0 additions & 16 deletions src/components/Preference/composables/otg/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
import { watchEffect } from 'vue'

export function useOtg(data) {
watchEffect(() => {
if (data.value['--hid-keyboard'] || data.value['--hid-mouse']) {
data.value['--otg'] = true
}
else {
data.value['--otg'] = false
}
})

watchEffect(() => {
if (!data.value['--otg']) {
data.value['--hid-keyboard'] = false
data.value['--hid-mouse'] = false
}
})

watchEffect(() => {
if (data.value['--hid-keyboard']) {
data.value['--hid-mouse'] = false
Expand Down
2 changes: 2 additions & 0 deletions src/components/Preference/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ import PathInput from './components/PathInput/index.vue'
import VideoCodecSelect from './components/VideoCodecSelect/index.vue'
import AudioCodecSelect from './components/AudioCodecSelect/index.vue'
import DisplaySelect from './components/DisplaySelect/index.vue'
import CameraSwitch from './components/CameraSwitch/index.vue'
import LoadingIcon from '@/components/Device/components/LoadingIcon/index.vue'
import { usePreferenceStore } from '@/store/index.js'
Expand All @@ -209,6 +210,7 @@ export default {
VideoCodecSelect,
AudioCodecSelect,
DisplaySelect,
CameraSwitch,
},
setup() {
const preferenceStore = usePreferenceStore()
Expand Down
59 changes: 50 additions & 9 deletions src/locales/languages/en_US.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
{
"zh_CN": "中文",
"en_US": "English",

"common.cancel": "Cancel",
"common.confirm": "Confirm",
"common.restart": "Restart",
"common.default": "Default",
"common.tips": "Tips",
"common.open": "Open",
"common.input.placeholder": "Please input",

"close.quit": "Quit",
"close.quit.cancel": "Cancel quit",
"close.minimize": "Minimize to tray",
"close.message": "Are you sure you want to quit?",
"close.remember": "Remember this choice?",

"device.list": "Devices",
"device.list.loading": "Loading...",
"device.list.empty": "No devices detected",
"device.id": "Device ID",
"device.name": "Device Name",
"device.remark": "Remark",
"device.permission.error": "Device permission error, please reconnect device and allow USB debugging",

"device.wireless.name": "Wireless",
"device.wireless.mode": "Wireless Mode",
"device.wireless.mode.error": "Do not get the local area network connection address, please check the network",
Expand Down Expand Up @@ -50,21 +54,25 @@
"device.wireless.pair.code": "Pair Code",
"device.wireless.pair.code.message": "Pair code cannot be empty",
"device.wireless.pair.code.placeholder": "Input pair code",

"device.reset.title": "Operation Failed",
"device.reset.reasons[0]": "This is usually caused by incompatible cached dependencies after updating Escrcpy. Reset dependencies?",
"device.reset.reasons[1]": "Note: Dependencies will be cleared after reset, please backup first.",
"device.reset.confirm": "Reset Dependencies",
"device.reset.cancel": "@:common.cancel",
"device.reset.success": "Success, please try again",

"device.refresh.name": "Refresh",
"device.restart.name": "Restart",
"device.log.name": "Logs",
"device.mirror.start": "Mirror",
"device.mirror.progress": "Mirroring",

"device.record.start": "Record",
"device.record.progress": "Recording",
"device.record.success.title": "Record Success",
"device.record.success.message": "Open record location?",

"device.control.name": "Control",
"device.control.more": "More Controls",
"device.control.install": "Install App",
Expand All @@ -89,6 +97,7 @@
"device.control.gnirehtet.tips": "Gnirehtet provides reverse tethering for Android; Note: Initial connection requires authorization on the device.",
"device.control.gnirehtet.progress": "Starting Gnirehtet reverse tethering service...",
"device.control.gnirehtet.success": "Gnirehtet reverse tethering feature started successfully",

"preferences.name": "Preferences",
"preferences.reset": "Reset to Default",
"preferences.scope.global": "Global",
Expand All @@ -107,6 +116,7 @@
"preferences.config.edit.name": "Edit",
"preferences.config.reset.name": "Reset",
"preferences.config.save.placeholder": "Config saved",

"preferences.common.name": "Common",
"preferences.common.theme.name": "Theme",
"preferences.common.theme.placeholder": "Set theme",
Expand All @@ -125,6 +135,9 @@
"preferences.common.scrcpy.name": "Scrcpy Path",
"preferences.common.scrcpy.placeholder": "Set scrcpy path",
"preferences.common.scrcpy.tips": "scrcpy path to connect device",
"preferences.common.scrcpy.append.name": "Scrcpy Arguments",
"preferences.common.scrcpy.append.placeholder": "Append additional arguments to the scrcpy command",
"preferences.common.scrcpy.append.tips": "Note: The entered arguments will be directly appended to the scrcpy command without filtering duplicate arguments.",
"preferences.common.gnirehtet.name": "Gnirehtet Path",
"preferences.common.gnirehtet.placeholder": "Set gnirehtet path",
"preferences.common.gnirehtet.tips": "The path for gnirehtet used to provide reverse tethering for devices.",
Expand All @@ -135,7 +148,12 @@
"preferences.common.language.placeholder": "Select language",
"preferences.common.language.chinese": "中文",
"preferences.common.language.english": "English",

"preferences.video.name": "Video",
"preferences.video.video-source.name": "Video Source",
"preferences.video.video-source.placeholder": "Defaults to device display",
"preferences.video.video-source.display": "Display",
"preferences.video.video-source.camera": "Camera",
"preferences.video.resolution.name": "Resolution",
"preferences.video.resolution.placeholder": "Default is device resolution e.g. 1920",
"preferences.video.bit.name": "Video Bit Rate",
Expand All @@ -148,12 +166,13 @@
"preferences.video.screen-rotation.placeholder": "Default device rotation",
"preferences.video.screen-cropping.name": "Crop",
"preferences.video.screen-cropping.placeholder": "Default no crop, format is 1224:1440:0:0",
"preferences.video.multi-display.name": "Display",
"preferences.video.multi-display.placeholder": "Default 0 (main display)",
"preferences.video.display.name": "Display",
"preferences.video.display.placeholder": "Default 0 (main display)",
"preferences.video.video-buffer.name": "Video Buffer",
"preferences.video.video-buffer.placeholder": "Default 0ms",
"preferences.video.receiver-buffer.name": "Receiver Buffer (v412)",
"preferences.video.receiver-buffer.placeholder": "Default 0ms",

"preferences.device.name": "Device",
"preferences.device.show-touch.name": "Show Touches",
"preferences.device.show-touch.placeholder": "Enable touch feedback dots",
Expand All @@ -168,6 +187,7 @@
"preferences.device.control-in-stop-charging.name": "Stop Charging",
"preferences.device.control-in-stop-charging.placeholder": "Stop charging when controlling",
"preferences.device.control-in-stop-charging.tips": "May not work on some models",

"preferences.window.name": "Window",
"preferences.window.borderless.name": "Borderless",
"preferences.window.borderless.placeholder": "Borderless control window",
Expand All @@ -177,27 +197,30 @@
"preferences.window.always-top.placeholder": "Keep control window topmost",
"preferences.window.disable-screen-saver.name": "Disable Screensaver",
"preferences.window.disable-screen-saver.placeholder": "Disable computer screensaver",

"preferences.record.name": "Recording",
"preferences.record.format.name": "Format",
"preferences.record.time-limit.name": "Recording Time Limit",
"preferences.record.time-limit.placeholder": "Default No time limit",
"preferences.record.format.placeholder": "Default *.mp4",
"preferences.record.lock-video-orientation.name": "Video Direction",
"preferences.record.lock-video-orientation.placeholder": "Default Device Orientation",
"preferences.record.disable-video.name": "Disable video recording",
"preferences.record.disable-video.name": "Disable Video Recording",
"preferences.record.disable-video.placeholder": "Video recording will be disabled when enabled",
"preferences.record.disable-audio.name": "Disable audio recording",
"preferences.record.disable-audio.name": "Disable Audio Recording",
"preferences.record.disable-audio.placeholder": "Audio recording will be disabled when enabled",
"preferences.record.no-video-playback.name": "Disable video playback",
"preferences.record.no-video-playback.name": "Disable Video Playback",
"preferences.record.no-video-playback.placeholder": "Video playback will be disabled during recording when enabled",
"preferences.record.no-video-playback.tips": "Note: Video will still be recorded, just playback disabled",
"preferences.record.no-audio-playback.name": "Disable audio playback",
"preferences.record.no-audio-playback.name": "Disable Audio Playback",
"preferences.record.no-audio-playback.placeholder": "Audio playback will be disabled during recording when enabled",
"preferences.record.no-audio-playback.tips": "Note: Audio will still be recorded, just playback disabled",

"preferences.audio.name": "Audio",
"preferences.audio.audio-source.name": "Audio Source",
"preferences.audio.audio-source.placeholder": "Default Device Audio Output",
"preferences.audio.audio-source.tips": "Tip: Selecting 'Microphone' as the source will allow you to record audio.",
"preferences.audio.audio-source.output": "Output",
"preferences.audio.audio-source.mic": "Microphone",
"preferences.audio.audio-code.name": "Audio Codec",
"preferences.audio.audio-code.placeholder": "Default Opus",
Expand All @@ -208,16 +231,34 @@
"preferences.audio.audio-buffer.placeholder": "Default 0ms",
"preferences.audio.audio-output-buffer.name": "Audio Output Buffer",
"preferences.audio.audio-output-buffer.placeholder": "Default 5ms",

"preferences.otg.name": "OTG",
"preferences.otg.enable.name": "Enable OTG",
"preferences.otg.enable.placeholder": "Enable or disable OTG",
"preferences.otg.enable.tips": "Enables using physical keyboard and mouse with Android device",
"preferences.otg.only-keyboard.name": "Keyboard only",
"preferences.otg.enable.tips": "Enables using physical keyboard and mouse with Android device. Note: After turning on this function, it will freeze ADB -related functions. It cannot be used at the same time as mirror and recording function, please know.",
"preferences.otg.only-keyboard.name": "Keyboard Only",
"preferences.otg.only-keyboard.placeholder": "Enable keyboard-only OTG",
"preferences.otg.only-keyboard.tips": "Note: This disables mouse OTG",
"preferences.otg.only-mouse.name": "Mouse only",
"preferences.otg.only-mouse.name": "Mouse Only",
"preferences.otg.only-mouse.placeholder": "Enable or disable mouse-only OTG",
"preferences.otg.only-mouse.tips": "Note: This disables keyboard OTG",

"preferences.camera.name": "Camera",
"preferences.camera.enable.name": "Enable Camera",
"preferences.camera.enable.placeholder": "Enable or disable camera video source",
"preferences.camera.enable.tips": "Enabled for camera as video source when mirroring or recording",
"preferences.camera.camera-facing.name": "Camera Source",
"preferences.camera.camera-facing.placeholder": "Default is device camera source",
"preferences.camera.camera-facing.front": "Front Camera",
"preferences.camera.camera-facing.back": "Back Camera",
"preferences.camera.camera-facing.external": "External Camera",
"preferences.camera.camera-size.name": "Camera Size",
"preferences.camera.camera-size.placeholder": "Default is device camera size, value format: 1920x1080",
"preferences.camera.camera-ar.name": "Camera Aspect Ratio",
"preferences.camera.camera-ar.placeholder": "Default is device camera aspect ratio, value format: 4:3, sensor, 1.6 etc",
"preferences.camera.camera-fps.name": "Camera Frame Rate",
"preferences.camera.camera-fps.placeholder": "Default is device camera frame rate",

"about.name": "About",
"about.description": "📱 Graphical Scrcpy to display and control Android, devices powered by Electron.",
"about.update": "Check for Updates",
Expand Down
Loading

0 comments on commit 5a04b4c

Please sign in to comment.