* Mutes a track regardless of current mute state. Maintains volume * settings on sounds. * * @param track {string} track to mute * * @return Array of sound IDs that were muted * * @throws {Error} when invalid track specified
({ state, dispatch, commit }, track)
| 552 | * @throws {Error} when invalid track specified |
| 553 | */ |
| 554 | muteTrack ({ state, dispatch, commit }, track) { |
| 555 | const trackData = state.tracks[track] |
| 556 | if (!trackData) { |
| 557 | throw new Error('Invalid track specified') |
| 558 | } |
| 559 | |
| 560 | const mutes = Array.from(trackData.keys()) |
| 561 | .map(id => dispatch('muteSound', id)) |
| 562 | |
| 563 | commit('setMute', { track, muted: true }) |
| 564 | return Promise.all(mutes) |
| 565 | }, |
| 566 | |
| 567 | /** |
| 568 | * Unmutes a track regardless of current mute state. Maintains volume |
nothing calls this directly
no test coverage detected