feat(icon)+fix(audio): 앱 아이콘 적용 + 트레이 아이콘 + 마이크 테스트 조기 종료 수정
- 앱 아이콘: icon.svg 마스터(d3ro 브랜드 — 메탈 섀시+오렌지 웨이브) → png/ico 생성 스크립트(generate-icons.mjs, sharp) + electron-builder win/mac 연결 - 트레이: createEmpty() 빈 아이콘 → 실제 앱 아이콘 (getAppIconPath) - 마이크 테스트: 초기 무음 level:0을 종료로 오인하던 조기 종료 버그 — AUDIO.TEST_LEVEL에 done 플래그 신설(SSOT), STOP 버튼이 실제 캡처 중지, testDevice 실패 시 상태 롤백
This commit is contained in:
parent
26b3fd1f63
commit
cbed451209
12 changed files with 184 additions and 11 deletions
|
|
@ -71,12 +71,13 @@ export function registerAudioHandlers(): void {
|
|||
}
|
||||
service.on('audio-data', testAudioHandler)
|
||||
|
||||
// 100ms 간격으로 레벨을 렌더러에 전송
|
||||
// 100ms 간격으로 레벨을 렌더러에 전송.
|
||||
// level 0은 "무음/초기화 중"일 뿐 종료가 아님 — 종료는 done:true로만 알린다.
|
||||
testLevelInterval = setInterval(() => {
|
||||
const level = testLastRms > 0 ? Math.min(1.0, Math.pow(testLastRms, 0.28)) : 0
|
||||
const win = getMainWindow()
|
||||
if (win && !win.isDestroyed()) {
|
||||
win.webContents.send('audio:testLevel', { level })
|
||||
win.webContents.send(IPC_CHANNELS.AUDIO.TEST_LEVEL, { level, done: false })
|
||||
}
|
||||
}, 100)
|
||||
|
||||
|
|
@ -85,7 +86,7 @@ export function registerAudioHandlers(): void {
|
|||
stopAudioTest()
|
||||
const win = getMainWindow()
|
||||
if (win && !win.isDestroyed()) {
|
||||
win.webContents.send('audio:testLevel', { level: 0 })
|
||||
win.webContents.send(IPC_CHANNELS.AUDIO.TEST_LEVEL, { level: 0, done: true })
|
||||
}
|
||||
}, 5000)
|
||||
|
||||
|
|
@ -98,4 +99,14 @@ export function registerAudioHandlers(): void {
|
|||
)
|
||||
}
|
||||
})
|
||||
|
||||
// 테스트 수동 중지 (STOP 버튼)
|
||||
ipcMain.handle(IPC_CHANNELS.AUDIO.STOP_TEST, async () => {
|
||||
stopAudioTest()
|
||||
const win = getMainWindow()
|
||||
if (win && !win.isDestroyed()) {
|
||||
win.webContents.send(IPC_CHANNELS.AUDIO.TEST_LEVEL, { level: 0, done: true })
|
||||
}
|
||||
return ipcSuccess(undefined)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue