本文整理汇总了Golang中C.Mix_PlayChannelTimed函数的典型用法代码示例。如果您正苦于以下问题:Golang Mix_PlayChannelTimed函数的具体用法?Golang Mix_PlayChannelTimed怎么用?Golang Mix_PlayChannelTimed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Mix_PlayChannelTimed函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Play
func (t *Sound) Play(loops int) {
t.channel = int(C.Mix_PlayChannelTimed(C.int(-1), t.chunk, C.int(loops), C.int(-1)))
if t.channel == -1 {
panic(fmt.Sprintf("Unable to play Sound file (%v): %v", t.name, util.GetMixError()))
}
t.SetVolume(GDefaultVolume)
}
示例2: PlayTimed
func (chunk *Chunk) PlayTimed(channel, loops, ticks int) bool {
_channel := (C.int)(channel)
_chunk := (*C.Mix_Chunk)(unsafe.Pointer(chunk))
_loops := (C.int)(loops)
_ticks := (C.int)(ticks)
return int(C.Mix_PlayChannelTimed(_channel, _chunk, _loops, _ticks)) == 0
}
示例3: PlayChannel
func (chunk *Chunk) PlayChannel(channel, loops int) (channel_ int, err error) {
_channel := (C.int)(channel)
_chunk := (*C.Mix_Chunk)(unsafe.Pointer(chunk))
_loops := (C.int)(loops)
channel_ = int(C.Mix_PlayChannelTimed(_channel, _chunk, _loops, -1))
if channel_ == -1 {
err = sdl.GetError()
}
return
}
示例4: PlayChannelTimed
//If the sample is long enough and has enough loops then the sample will stop after ticks milliseconds.
//Otherwise this function is the same as chunk.PlayChannel()
//Returns: the channel the sample is played on. On any errors, -1 is returned
func (c *Chunk) PlayChannelTimed(channel, loops, ticks int) int {
return int(C.Mix_PlayChannelTimed(C.int(channel), c.cchunk, C.int(loops), C.int(ticks)))
}
示例5: PlayChannel
func (c *Chunk) PlayChannel(channel, loops int) int {
return int(C.Mix_PlayChannelTimed(C.int(channel), c.cchunk, C.int(loops), -1))
}
示例6: PlayChannelTimed
// Play an audio chunk on a specific channel.
// If the specified channel is -1, play on the first free channel.
// If 'loops' is greater than zero, loop the sound that many times.
// If 'loops' is -1, loop inifinitely (~65000 times).
// Returns which channel was used to play the sound.
// The the sound is played at most 'ticks' milliseconds.
func PlayChannelTimed(channel int , chunk * C.Mix_Chunk,
loops, ticks int) (int) {
return int(C.Mix_PlayChannelTimed(C.int(channel), chunk,
C.int(loops), C.int(ticks)))
}