mirror of
https://github.com/viarotel-org/escrcpy.git
synced 2025-02-20 04:01:06 +01:00
perf: 💄 Normalize control window titles and generated file names
This commit is contained in:
parent
952b2a7250
commit
ccc7f0e734
@ -11,16 +11,19 @@ const recordModel = {
|
|||||||
excludes: [],
|
excludes: [],
|
||||||
commands: [],
|
commands: [],
|
||||||
extname: config => config['--record-format'] || 'mp4',
|
extname: config => config['--record-format'] || 'mp4',
|
||||||
|
label: 'Recording',
|
||||||
},
|
},
|
||||||
audio: {
|
audio: {
|
||||||
excludes: ['--video-source', '--no-audio', '--mouse'],
|
excludes: ['--video-source', '--no-audio', '--mouse'],
|
||||||
commands: ['--no-video', '--mouse=disabled'],
|
commands: ['--no-video', '--mouse=disabled'],
|
||||||
extname: config => config['--audio-record-format'] || 'opus',
|
extname: config => config['--audio-record-format'] || 'opus',
|
||||||
|
label: 'RecordingAudio',
|
||||||
},
|
},
|
||||||
camera: {
|
camera: {
|
||||||
excludes: ['--video-source', '--turn-screen-off', '--show-touches', '--no-power-on', '--stay-awake', '--power-off-on-close'],
|
excludes: ['--video-source', '--turn-screen-off', '--show-touches', '--no-power-on', '--stay-awake', '--power-off-on-close'],
|
||||||
commands: ['--video-source=camera'],
|
commands: ['--video-source=camera'],
|
||||||
extname: config => config['--record-format'] || 'mp4',
|
extname: config => config['--record-format'] || 'mp4',
|
||||||
|
label: 'RecordingCamera',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +84,7 @@ export default {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const recording = this.$scrcpy.record(row.id, {
|
const recording = this.$scrcpy.record(row.id, {
|
||||||
title: this.$store.device.getLabel(row, 'recording'),
|
title: this.$store.device.getLabel(row, ({ appName, deviceName }) => `${appName}${this.activeModel.label}-${deviceName}`),
|
||||||
savePath,
|
savePath,
|
||||||
args,
|
args,
|
||||||
})
|
})
|
||||||
@ -114,10 +117,7 @@ export default {
|
|||||||
|
|
||||||
const extension = this.activeModel.extname(deviceConfig)
|
const extension = this.activeModel.extname(deviceConfig)
|
||||||
|
|
||||||
const fileName = `${this.$store.device.getLabel(
|
const fileName = this.$store.device.getLabel(row, ({ currentTime, deviceName }) => `${this.activeModel.label}-${deviceName}-${currentTime}.${extension}`)
|
||||||
row,
|
|
||||||
'recorded',
|
|
||||||
)}.${extension}`
|
|
||||||
|
|
||||||
const filePath = this.$path.join(savePath, fileName)
|
const filePath = this.$path.join(savePath, fileName)
|
||||||
|
|
||||||
|
@ -49,14 +49,12 @@ export const useDeviceStore = defineStore({
|
|||||||
'mirror',
|
'mirror',
|
||||||
'camera',
|
'camera',
|
||||||
'custom',
|
'custom',
|
||||||
'recording',
|
|
||||||
'synergy',
|
'synergy',
|
||||||
]
|
]
|
||||||
.reduce((obj, type) => {
|
.reduce((obj, type) => {
|
||||||
obj[type] = createPreset(type)
|
obj[type] = createPreset(type)
|
||||||
return obj
|
return obj
|
||||||
}, {}),
|
}, {}),
|
||||||
recorded: `Record-${deviceName}-${currentTime}`,
|
|
||||||
screenshot: `Screenshot-${deviceName}-${currentTime}`,
|
screenshot: `Screenshot-${deviceName}-${currentTime}`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user