mirror of
https://github.com/HiMeditator/auto-caption.git
synced 2026-02-14 11:34:43 +08:00
feat: 更新 README 并添加清空字幕记录功能
- 更新 README 中的项目状态和下载链接 - 添加清空字幕记录的功能 - 优化字幕记录的导出和清空界面 - 更新代码以支持跨平台兼容性 - 添加开源协议
This commit is contained in:
@@ -5,6 +5,7 @@ import icon from '../../resources/icon.png?asset'
|
||||
import { captionWindow } from './caption'
|
||||
import {
|
||||
captionEngine,
|
||||
captionLog,
|
||||
controls,
|
||||
setStyles,
|
||||
sendStyles,
|
||||
@@ -98,6 +99,10 @@ class ControlWindow {
|
||||
captionEngine.stop()
|
||||
this.window?.webContents.send('control.engine.stopped')
|
||||
})
|
||||
// 清空字幕记录
|
||||
ipcMain.on('control.caption.clear', () => {
|
||||
captionLog.splice(0)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,16 +15,26 @@ export class CaptionEngine {
|
||||
this.command = [ controls.customizedCommand ]
|
||||
}
|
||||
else if(controls.engine === 'gummy'){
|
||||
let gummyName = ''
|
||||
if(process.platform === 'win32'){
|
||||
gummyName = 'main-gummy.exe'
|
||||
}
|
||||
else if(process.platform === 'linux'){
|
||||
gummyName = 'main-gummy'
|
||||
}
|
||||
else{
|
||||
throw new Error('Unsupported platform')
|
||||
}
|
||||
if(is.dev){
|
||||
this.appPath = path.join(
|
||||
app.getAppPath(),
|
||||
'python-subprocess', 'dist', 'main-gummy.exe'
|
||||
'python-subprocess', 'dist', gummyName
|
||||
)
|
||||
}
|
||||
else{
|
||||
this.appPath = path.join(
|
||||
process.resourcesPath,
|
||||
'python-subprocess', 'dist', 'main-gummy.exe'
|
||||
'python-subprocess', 'dist', gummyName
|
||||
)
|
||||
}
|
||||
this.command = []
|
||||
|
||||
Reference in New Issue
Block a user