Skip to content

Commit 287c46e

Browse files
committed
remove audio.System.GetSfx and GetMusic
All sound effects and music patterns are available in global variables: audio.Sfx and audio.Pat
1 parent eae966c commit 287c46e

File tree

3 files changed

+0
-22
lines changed

3 files changed

+0
-22
lines changed

audio/audio.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,10 @@ type System interface {
254254
// SoundEffect parameters are clamped when out of range.
255255
// For example, sfx note volume equal 8 will be silently clamped to 7.
256256
SetSfx(sfxNo int, e SoundEffect)
257-
// GetSfx returns sfx with given number. sfxNo is 0-63. Trying to get
258-
// sfx number higher than 63 will result in returning empty SoundEffect (zero-value).
259-
GetSfx(sfxNo int) SoundEffect
260257
// SetMusic updates the music pattern. patternNo is 0-63. Updating pattern number which
261258
// is higher than 63 does not do anything.
262259
//
263260
// Pattern parameters are clamped when out of range.
264261
// For example, pattern sfx number equal 64 will be silently clamped to 63.
265262
SetMusic(patternNo int, _ Pattern)
266-
// GetMusic returns music pattern with given number. patterNo is 0-63. Trying to get
267-
// pattern number higher than 63 will result in returning empty Pattern (zero-value).
268-
GetMusic(patterNo int) Pattern
269263
}

ebitengine/audio.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -216,23 +216,9 @@ func (e *ebitenPlayerSource) SetSfx(sfxNo int, effect audio.SoundEffect) {
216216
e.audioSystem.SetSfx(sfxNo, effect)
217217
}
218218

219-
func (e *ebitenPlayerSource) GetSfx(sfxNo int) audio.SoundEffect {
220-
e.mutex.Lock()
221-
defer e.mutex.Unlock()
222-
223-
return e.audioSystem.GetSfx(sfxNo)
224-
}
225-
226219
func (e *ebitenPlayerSource) SetMusic(patterNo int, pattern audio.Pattern) {
227220
e.mutex.Lock()
228221
defer e.mutex.Unlock()
229222

230223
e.audioSystem.SetMusic(patterNo, pattern)
231224
}
232-
233-
func (e *ebitenPlayerSource) GetMusic(patterNo int) audio.Pattern {
234-
e.mutex.Lock()
235-
defer e.mutex.Unlock()
236-
237-
return e.audioSystem.GetMusic(patterNo)
238-
}

ebitengine/audio_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ func TestEbitenPlayerSource_ThreadSafety(t *testing.T) {
174174
reader.Music(0, 0, 0)
175175
reader.Stat()
176176
reader.SetSfx(0, audio.SoundEffect{})
177-
reader.GetSfx(0)
178177
reader.SetMusic(0, audio.Pattern{})
179-
reader.GetMusic(0)
180178
}()
181179
}
182180

0 commit comments

Comments
 (0)