feat: add event

This commit is contained in:
崔竞宁
2022-12-07 19:50:48 +08:00
parent 988889e8bd
commit 9fa93b905b
16 changed files with 681 additions and 724 deletions

View File

@@ -1,7 +1,17 @@
package acp
type deviceOption struct {
linear bool
linear bool
threads int
}
func (do *deviceOption) check() {
if do.threads == 0 {
do.threads = 8
}
if do.linear {
do.threads = 1
}
}
type DeviceOption func(*deviceOption) *deviceOption
@@ -12,3 +22,10 @@ func LinearDevice(b bool) DeviceOption {
return d
}
}
func DeviceThreads(threads int) DeviceOption {
return func(d *deviceOption) *deviceOption {
d.threads = threads
return d
}
}