audio: rename Ctrl.Duration -> Ctrl.Position

This commit is contained in:
faiface 2017-07-11 20:01:15 +02:00
parent f3647fc451
commit bf50427297
1 changed files with 2 additions and 2 deletions

View File

@ -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
} }