diff --git a/src/locales/languages/en_US.json b/src/locales/languages/en_US.json index f4e0eb7..d69c407 100644 --- a/src/locales/languages/en_US.json +++ b/src/locales/languages/en_US.json @@ -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", diff --git a/src/locales/languages/zh_CN.json b/src/locales/languages/zh_CN.json index 91883f3..12a05c5 100644 --- a/src/locales/languages/zh_CN.json +++ b/src/locales/languages/zh_CN.json @@ -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": "禁用视频录制", diff --git a/src/store/preference/index.js b/src/store/preference/index.js index ffcf94f..b8603aa 100644 --- a/src/store/preference/index.js +++ b/src/store/preference/index.js @@ -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: {}, diff --git a/src/store/preference/model/record/index.js b/src/store/preference/model/record/index.js index ba06b88..89a8685 100644 --- a/src/store/preference/model/record/index.js +++ b/src/store/preference/model/record/index.js @@ -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',