func (t *Sound) FadeIn(duration Double, loops int) { t.channel = int(C.Mix_FadeInChannelTimed(C.int(-1), t.chunk, C.int(loops), C.int(duration*1000.0), C.int(-1))) if t.channel == -1 { panic(fmt.Sprintf("Unable to FadeIn Sound file (%v): %v", t.name, util.GetMixError())) } t.SetVolume(GDefaultVolume) }
func (chunk *Chunk) FadeIn(channel, loops, ms, ticks int) bool { _channel := (C.int)(channel) _chunk := (*C.Mix_Chunk)(unsafe.Pointer(chunk)) _loops := (C.int)(loops) _ms := (C.int)(ms) return int(C.Mix_FadeInChannelTimed(_channel, _chunk, _loops, _ms, -1)) == 0 }
func (chunk *Chunk) FadeInTimed(channel, loops, ms, ticks int) (channel_ int, err error) { _channel := (C.int)(channel) _chunk := (*C.Mix_Chunk)(unsafe.Pointer(chunk)) _loops := (C.int)(loops) _ms := (C.int)(ms) _ticks := (C.int)(ticks) channel_ = int(C.Mix_FadeInChannelTimed(_channel, _chunk, _loops, _ms, _ticks)) if channel_ == -1 { err = sdl.GetError() } return }
//If the sample is long enough and has enough loops then the sample will stop after ticks //milliseconds. //Returns: the channel the sample is played on. On any errors, -1 is returned. func (c *Chunk) FadeInChannelTimed(channel, loops, ms, ticks int) int { return int(C.Mix_FadeInChannelTimed(C.int(channel), c.cchunk, C.int(loops), C.int(ms), C.int(ticks))) }
func FadeInChannelTimed(channel int, chunk * C.Mix_Chunk, loops, ms, ticks int) (int) { return int(C.Mix_FadeInChannelTimed(C.int(channel), chunk, C.int(loops), C.int(ms), C.int(ticks))) }