()
| 87 | } |
| 88 | |
| 89 | func (sound *Sound) UpdateVolume() { |
| 90 | speaker.Lock() |
| 91 | |
| 92 | var v float64 |
| 93 | switch sound.channel { |
| 94 | case AudioChannelSoundCard: |
| 95 | v = globals.Settings.Get(SettingsAudioSoundVolume).AsFloat() |
| 96 | case AudioChannelUI: |
| 97 | v = globals.Settings.Get(SettingsAudioUIVolume).AsFloat() |
| 98 | } |
| 99 | |
| 100 | if v > 0 { |
| 101 | sound.volume.Silent = false |
| 102 | sound.volume.Volume = v - 1 |
| 103 | } else { |
| 104 | sound.volume.Silent = true |
| 105 | } |
| 106 | |
| 107 | speaker.Unlock() |
| 108 | } |
| 109 | |
| 110 | func (sound *Sound) Play() { |
| 111 |
no test coverage detected