audio: rename Ctrl.Duration -> Ctrl.Position
This commit is contained in:
parent
f3647fc451
commit
bf50427297
|
@ -5,7 +5,7 @@ import "time"
|
||||||
type Ctrl struct {
|
type Ctrl struct {
|
||||||
Streamer Streamer
|
Streamer Streamer
|
||||||
Paused bool
|
Paused bool
|
||||||
Duration time.Duration
|
Position time.Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Ctrl) Stream(samples [][2]float64) (n int, ok bool) {
|
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
|
return len(samples), true
|
||||||
}
|
}
|
||||||
n, ok = c.Streamer.Stream(samples)
|
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
|
return n, ok
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue