当前位置: 首页>>代码示例>>Golang>>正文


Golang C.Mix_PlayChannelTimed函数代码示例

本文整理汇总了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)
}
开发者ID:swantescholz,项目名称:coding,代码行数:7,代码来源:sound.go

示例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
}
开发者ID:hybridgroup,项目名称:go-sdl2,代码行数:7,代码来源:sdl_mixer.go

示例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
}
开发者ID:flazz,项目名称:go-sdl2,代码行数:10,代码来源:sdl_mixer.go

示例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)))
}
开发者ID:paul-lalonde,项目名称:Go-SDL,代码行数:6,代码来源:chunks.go

示例5: PlayChannel

func (c *Chunk) PlayChannel(channel, loops int) int {
	return int(C.Mix_PlayChannelTimed(C.int(channel), c.cchunk, C.int(loops), -1))
}
开发者ID:pakohan,项目名称:Go-SDL,代码行数:3,代码来源:mixer.go

示例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))) 
}
开发者ID:beoran,项目名称:fungo,代码行数:11,代码来源:mixer.go


注:本文中的C.Mix_PlayChannelTimed函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。