Initial support for application specific overrides.
This commit is contained in:
1 parent
901fd58ba8
commit
b45f800489
37 files changed
+3909
-475
No files matched your search
@@ -57,6 +57,11 @@ func run(ctx context.Context, source Source, keyboards Keyboards, voices Speaker
|
||||
return err
|
||||
}
|
||||
defer func() { a.ui.close(); a.ui.testWorkers.Wait() }()
|
||||
defer func() {
|
||||
for _, selected := range a.overrides {
|
||||
selected.adapter.Close()
|
||||
}
|
||||
}()
|
||||
return a.loop(ticks)
|
||||
}
|
||||
|
||||
@@ -111,6 +116,9 @@ func (a *application) loop(ticks <-chan time.Time) error {
|
||||
a.quick.discovery = discovery
|
||||
case result := <-a.speechResults:
|
||||
a.speech_result(result)
|
||||
if len(a.overrides) != 0 || a.overrideCurrent != nil {
|
||||
a.overrideDirty = true
|
||||
}
|
||||
case result := <-spellResults:
|
||||
if err := a.poll_input(false); err != nil {
|
||||
return err
|
||||
@@ -175,6 +183,12 @@ func (a *application) loop(ticks <-chan time.Time) error {
|
||||
return err
|
||||
}
|
||||
case <-ticks:
|
||||
if a.overrideDirty {
|
||||
a.overrideDirty = false
|
||||
if err := a.read_screen(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := a.poll_input(false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user