add llm processing notification
This commit is contained in:
@@ -190,6 +190,7 @@ func (d *Daemon) toggle() {
|
||||
|
||||
go d.notifier.Send(notify.MsgRecordingStarted)
|
||||
go d.monitorPipelineErrors(p)
|
||||
go d.monitorPipelineNotifications(p)
|
||||
|
||||
case pipeline.Recording:
|
||||
d.stopPipeline()
|
||||
@@ -240,3 +241,15 @@ func (d *Daemon) monitorPipelineErrors(p pipeline.Pipeline) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (d *Daemon) monitorPipelineNotifications(p pipeline.Pipeline) {
|
||||
notifyCh := p.GetNotifyCh()
|
||||
for {
|
||||
select {
|
||||
case mt := <-notifyCh:
|
||||
d.notifier.Send(mt)
|
||||
case <-d.ctx.Done():
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/leonardotrapani/hyprvoice/internal/notify"
|
||||
"github.com/leonardotrapani/hyprvoice/internal/pipeline"
|
||||
)
|
||||
|
||||
@@ -480,3 +481,6 @@ func (m *MockPipeline) GetErrorCh() <-chan pipeline.PipelineError {
|
||||
return make(chan pipeline.PipelineError)
|
||||
}
|
||||
func (m *MockPipeline) GetActionCh() chan<- pipeline.Action { return make(chan pipeline.Action) }
|
||||
func (m *MockPipeline) GetNotifyCh() <-chan notify.MessageType {
|
||||
return make(chan notify.MessageType)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user