ReadFloat32s fills buf with the multiplexed data of the players as float32 values.
(buf []float32)
| 139 | |
| 140 | // ReadFloat32s fills buf with the multiplexed data of the players as float32 values. |
| 141 | func (m *Mux) ReadFloat32s(buf []float32) { |
| 142 | m.cond.L.Lock() |
| 143 | players := make([]*playerImpl, 0, len(m.players)) |
| 144 | for p := range m.players { |
| 145 | players = append(players, p) |
| 146 | } |
| 147 | m.cond.L.Unlock() |
| 148 | |
| 149 | for i := range buf { |
| 150 | buf[i] = 0 |
| 151 | } |
| 152 | for _, p := range players { |
| 153 | p.readBufferAndAdd(buf) |
| 154 | } |
| 155 | m.cond.Signal() |
| 156 | } |
| 157 | |
| 158 | type Player struct { |
| 159 | p *playerImpl |
no test coverage detected