audio: rename Ctrl.Duration -> Ctrl.Position
This commit is contained in:
parent
72b34b78c4
commit
ce53548e84
|
@ -5,7 +5,7 @@ import "time"
|
|||
type Ctrl struct {
|
||||
Streamer Streamer
|
||||
Paused bool
|
||||
Duration time.Duration
|
||||
Position time.Duration
|
||||
}
|
||||
|
||||
func (c *Ctrl) Stream(samples [][2]float64) (n int, ok bool) {
|
||||
|
@ -19,6 +19,6 @@ func (c *Ctrl) Stream(samples [][2]float64) (n int, ok bool) {
|
|||
return len(samples), true
|
||||
}
|
||||
n, ok = c.Streamer.Stream(samples)
|
||||
c.Duration += time.Duration(n) * time.Second / time.Duration(SampleRate)
|
||||
c.Position += time.Duration(n) * time.Second / time.Duration(SampleRate)
|
||||
return n, ok
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue