當前位置: 首頁>>代碼示例>>Golang>>正文


Golang base.ResultToError函數代碼示例

本文整理匯總了Golang中github.com/MobRulesGames/fmod/base.ResultToError函數的典型用法代碼示例。如果您正苦於以下問題:Golang ResultToError函數的具體用法?Golang ResultToError怎麽用?Golang ResultToError使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ResultToError函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: GetCues

// Different than the FMOD definition of GetCues - instead this returns a
// slice of all matching cues.  Pass in the empty string to match all cues.
func (music *MusicSystem) GetCues(filter string) ([]MusicEntity, error) {
	var it C.FMOD_MUSIC_ITERATOR
	var cfilter *C.char
	if filter != "" {
		cfilter = C.CString(filter)
	} else {
		cfilter = nil
	}

	var ents []MusicEntity
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_MusicSystem_GetCues(music.system, &it, cfilter)
		if base.ResultToError(ferr) != nil {
			return
		}
		for unsafe.Pointer(it.value) != unsafe.Pointer(uintptr(0)) {
			ent := MusicEntity{C.GoString(it.value.name), MusicId(it.value.id)}
			ents = append(ents, ent)
			ferr = C.FMOD_MusicSystem_GetNextCue(music.system, &it)
			if base.ResultToError(ferr) != nil {
				return
			}
		}
	})
	if filter != "" {
		C.free(unsafe.Pointer(cfilter))
	}
	return ents, base.ResultToError(ferr)
}
開發者ID:runningwild,項目名稱:fmod,代碼行數:32,代碼來源:music.go

示例2: Reset

// FMOD_RESULT F_API FMOD_MusicSystem_Reset             (FMOD_MUSICSYSTEM *musicsystem);
func (music *MusicSystem) Reset() error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_MusicSystem_Reset(music.system)
	})
	return base.ResultToError(ferr)
}
開發者ID:runningwild,項目名稱:fmod,代碼行數:8,代碼來源:music.go

示例3: SetOutput

func (s *System) SetOutput(output OutputType) error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_System_SetOutput(s.system, C.FMOD_OUTPUTTYPE(output))
	})
	return base.ResultToError(ferr)
}
開發者ID:runningwild,項目名稱:fmod,代碼行數:7,代碼來源:fmod.go

示例4: SetValue

// FMOD_RESULT F_API FMOD_EventParameter_SetValue       (FMOD_EVENTPARAMETER *eventparameter, float value);
func (p *Param) SetValue(value float64) error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_EventParameter_SetValue(p.param, C.float(value))
	})
	return base.ResultToError(ferr)
}
開發者ID:losinggeneration,項目名稱:fmod,代碼行數:8,代碼來源:parameter.go

示例5: PromptCue

// FMOD_RESULT F_API FMOD_MusicSystem_PromptCue         (FMOD_MUSICSYSTEM *musicsystem, FMOD_MUSIC_CUE_ID id);
func (music *MusicSystem) PromptCue(cue MusicEntity) error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_MusicSystem_PromptCue(music.system, C.FMOD_MUSIC_CUE_ID(cue.Id()))
	})
	return base.ResultToError(ferr)
}
開發者ID:runningwild,項目名稱:fmod,代碼行數:8,代碼來源:music.go

示例6: Init

// FMOD_RESULT F_API FMOD_System_Init (FMOD_SYSTEM *system, int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);
func (s *System) Init(max_channels int, flags InitFlags, extra_driver_data interface{}) error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_System_Init(s.system, C.int(max_channels), C.FMOD_INITFLAGS(flags), unsafe.Pointer(uintptr(0)))
	})
	return base.ResultToError(ferr)
}
開發者ID:runningwild,項目名稱:fmod,代碼行數:8,代碼來源:fmod.go

示例7: SetVolume

// FMOD_RESULT F_API FMOD_Event_SetVolume         (FMOD_EVENT *event, float volume);
func (e *Event) SetVolume(volume float64) error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_Event_SetVolume(e.event, C.float(volume))
	})
	return base.ResultToError(ferr)
}
開發者ID:runningwild,項目名稱:fmod,代碼行數:8,代碼來源:event.go

示例8: SetVolume

// FMOD_RESULT F_API FMOD_MusicSystem_SetVolume         (FMOD_MUSICSYSTEM *musicsystem, float volume);
func (music *MusicSystem) SetVolume(volume float64) error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_MusicSystem_SetVolume(music.system, C.float(volume))
	})
	return base.ResultToError(ferr)
}
開發者ID:runningwild,項目名稱:fmod,代碼行數:8,代碼來源:music.go

示例9: SetPaused

// FMOD_RESULT F_API FMOD_Channel_SetPaused             (FMOD_CHANNEL *channel, FMOD_BOOL paused);
func (c *Channel) SetPaused(paused bool) error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_Channel_SetPaused(c.channel, makeFmodBool(paused))
	})
	return base.ResultToError(ferr)
}
開發者ID:losinggeneration,項目名稱:fmod,代碼行數:8,代碼來源:channel.go

示例10: SetChannelGroup

// FMOD_RESULT F_API FMOD_Channel_SetChannelGroup       (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP *channelgroup);
func (c *Channel) SetChannelGroup(group *ChannelGroup) error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_Channel_SetChannelGroup(c.channel, group.group)
	})
	return base.ResultToError(ferr)
}
開發者ID:losinggeneration,項目名稱:fmod,代碼行數:8,代碼來源:channel.go

示例11: Stop

// FMOD_RESULT F_API FMOD_Channel_Stop                  (FMOD_CHANNEL *channel);
func (c *Channel) Stop() error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_Channel_Stop(c.channel)
	})
	return base.ResultToError(ferr)
}
開發者ID:losinggeneration,項目名稱:fmod,代碼行數:8,代碼來源:channel.go

示例12: AddGroup

// FMOD_RESULT F_API FMOD_ChannelGroup_AddGroup         (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP *group);
func (cg *ChannelGroup) AddGroup(group *ChannelGroup) error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_ChannelGroup_AddGroup(cg.group, group.group)
	})
	return base.ResultToError(ferr)
}
開發者ID:losinggeneration,項目名稱:fmod,代碼行數:8,代碼來源:channel_group.go

示例13: SetMute

// FMOD_RESULT F_API FMOD_ChannelGroup_SetMute          (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL mute);
func (cg *ChannelGroup) SetMute(mute bool) error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_ChannelGroup_SetMute(cg.group, makeFmodBool(mute))
	})
	return base.ResultToError(ferr)
}
開發者ID:losinggeneration,項目名稱:fmod,代碼行數:8,代碼來源:channel_group.go

示例14: SetPitch

// FMOD_RESULT F_API FMOD_ChannelGroup_SetPitch         (FMOD_CHANNELGROUP *channelgroup, float pitch);
func (cg *ChannelGroup) SetPitch(pitch float64) error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_ChannelGroup_SetPitch(cg.group, C.float(pitch))
	})
	return base.ResultToError(ferr)
}
開發者ID:losinggeneration,項目名稱:fmod,代碼行數:8,代碼來源:channel_group.go

示例15: SetPaused

// FMOD_RESULT F_API FMOD_Event_SetPaused         (FMOD_EVENT *event, FMOD_BOOL paused);
func (event *Event) SetPaused(paused bool) error {
	var ferr C.FMOD_RESULT
	base.Thread(func() {
		ferr = C.FMOD_Event_SetPaused(event.event, makeFmodBool(paused))
	})
	return base.ResultToError(ferr)
}
開發者ID:runningwild,項目名稱:fmod,代碼行數:8,代碼來源:event.go


注:本文中的github.com/MobRulesGames/fmod/base.ResultToError函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。