perf: ♻️ Optimize recording

This commit is contained in:
viarotel 2023-11-02 17:45:30 +08:00
parent 0f7209064b
commit f4dfb2ca98
4 changed files with 32 additions and 23 deletions

View File

@ -176,6 +176,8 @@
"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",

View File

@ -177,6 +177,8 @@
"preferences.record.name": "音视频录制",
"preferences.record.format.name": "录制视频格式",
"preferences.record.format.placeholder": "默认为 *.mp4 格式",
"preferences.record.time-limit.name": "录制时长",
"preferences.record.time-limit.placeholder": "默认不限时长",
"preferences.record.lock-video-orientation.name": "录制视频方向",
"preferences.record.lock-video-orientation.placeholder": "默认为设备默认方向",
"preferences.record.disable-video.name": "禁用视频录制",

View File

@ -22,6 +22,10 @@ export const usePreferenceStore = defineStore({
window.appStore.get('scrcpy.deviceScope') || 'global',
)
const recordKeys = Object.values(model?.record?.children || {}).map(
item => item.field,
)
return {
model: cloneDeep(model),
data: { ...getDefaultData() },
@ -31,14 +35,7 @@ export const usePreferenceStore = defineStore({
'--audio-code',
...getOtherFields('scrcpy'),
],
recordKeys: [
'--record-format',
'--lock-video-orientation',
'--no-video',
'--no-audio',
'--no-video-playback',
'--no-audio-playback',
],
recordKeys,
}
},
getters: {},

View File

@ -19,6 +19,14 @@ export default {
},
],
},
timeLimit: {
label: 'preferences.record.time-limit.name',
field: '--time-limit',
type: 'Input.number',
value: '',
placeholder: 'preferences.record.time-limit.placeholder',
append: 's',
},
lockVideoOrientation: {
label: 'preferences.record.lock-video-orientation.name',
field: '--lock-video-orientation',
@ -32,13 +40,13 @@ export default {
{ label: '90°', value: '3' },
],
},
// noVideo: {
// label: 'preferences.record.disable-video.name',
// field: '--no-video',
// type: 'Switch',
// value: null,
// placeholder: 'preferences.record.disable-video.placeholder',
// },
noVideo: {
label: 'preferences.record.disable-video.name',
field: '--no-video',
type: 'Switch',
value: null,
placeholder: 'preferences.record.disable-video.placeholder',
},
noAudio: {
label: 'preferences.record.disable-audio.name',
field: '--no-audio',
@ -46,14 +54,14 @@ export default {
value: null,
placeholder: 'preferences.record.disable-audio.placeholder',
},
// noVideoPlayback: {
// label: 'preferences.record.no-video-playback.name',
// field: '--no-video-playback',
// type: 'Switch',
// value: null,
// placeholder: 'preferences.record.no-video-playback.placeholder',
// tips: 'preferences.record.no-video-playback.tips',
// },
noVideoPlayback: {
label: 'preferences.record.no-video-playback.name',
field: '--no-video-playback',
type: 'Switch',
value: null,
placeholder: 'preferences.record.no-video-playback.placeholder',
tips: 'preferences.record.no-video-playback.tips',
},
noAudioPlayback: {
label: 'preferences.record.no-audio-playback.name',
field: '--no-audio-playback',