feat: 更新 README 并添加清空字幕记录功能

- 更新 README 中的项目状态和下载链接
- 添加清空字幕记录的功能
- 优化字幕记录的导出和清空界面
- 更新代码以支持跨平台兼容性
- 添加开源协议
This commit is contained in:
himeditator
2025-06-22 00:17:43 +08:00
parent 42237a229c
commit e23249bc54
9 changed files with 69 additions and 11 deletions

View File

@@ -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)
})
}
}

View File

@@ -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 = []