feat(main): 修改 python 子进程与主程序的通信方式,由 WebSocket 改为 IPC 通信

This commit is contained in:
himeditator
2025-06-17 22:37:10 +08:00
parent d1bee65ae1
commit 5da9c3c038
8 changed files with 93 additions and 77 deletions

View File

@@ -2,9 +2,9 @@ import { app, BrowserWindow } from 'electron'
import { electronApp, optimizer } from '@electron-toolkit/utils'
import { controlWindow } from './control'
import { captionWindow } from './caption'
import { WebSocketConnector } from './wsConnector'
const wsConnector = new WebSocketConnector()
import { PythonProcess } from './pythonProcess'
const pySubProcess = new PythonProcess()
app.whenReady().then(() => {
electronApp.setAppUserModelId('com.himeditator.autocaption')
@@ -18,7 +18,7 @@ app.whenReady().then(() => {
controlWindow.createWindow()
wsConnector.connect()
pySubProcess.start()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0){