Esempio n. 1
0
// Renamed, was GetBuffer3i.
func (self Buffer) get3i(param int32) (value1, value2, value3 int32) {
	var v1, v2, v3 int32
	C.walGetBuffer3i(C.ALuint(self), C.ALenum(param), unsafe.Pointer(&v1),
		unsafe.Pointer(&v2), unsafe.Pointer(&v3))
	value1, value2, value3 = v1, v2, v3
	return
}
Esempio n. 2
0
// Renamed, was GetSource3f.
func (self Source) get3f(param int32) (value1, value2, value3 float32) {
	var v1, v2, v3 float32
	C.walGetSource3f(C.ALuint(self), C.ALenum(param), unsafe.Pointer(&v1),
		unsafe.Pointer(&v2), unsafe.Pointer(&v3))
	value1, value2, value3 = v1, v2, v3
	return
}
Esempio n. 3
0
// Renamed, was GetListener3f.
func (self Listener) get3f(param int32) (value1, value2, value3 float32) {
	var v1, v2, v3 float32
	C.walGetListener3f(C.ALenum(param), unsafe.Pointer(&v1),
		unsafe.Pointer(&v2), unsafe.Pointer(&v3))
	value1, value2, value3 = v1, v2, v3
	return
}
Esempio n. 4
0
File: buffer.go Progetto: nzlov/goal
func (buffer Buffer) GetBuffer3i(param ALenum) (value1, value2, value3 int32) {
	C.alGetBuffer3i(
		C.ALuint(buffer), C.ALenum(param),
		(*C.ALint)(&value1),
		(*C.ALint)(&value2),
		(*C.ALint)(&value3),
	)
	return
}
Esempio n. 5
0
func GetListener3i(param ALenum) (value1, value2, value3 int32) {
	C.alGetListener3i(
		C.ALenum(param),
		(*C.ALint)(&value1),
		(*C.ALint)(&value2),
		(*C.ALint)(&value3),
	)
	return
}
Esempio n. 6
0
func GetListener3f(param ALenum) (value1, value2, value3 float32) {
	C.alGetListener3f(
		C.ALenum(param),
		(*C.ALfloat)(&value1),
		(*C.ALfloat)(&value2),
		(*C.ALfloat)(&value3),
	)
	return
}
Esempio n. 7
0
File: source.go Progetto: nzlov/goal
func (source Source) GetSource3i(param ALenum) (value1, value2, value3 int32) {
	C.alGetSource3i(
		C.ALuint(source), C.ALenum(param),
		(*C.ALint)(&value1),
		(*C.ALint)(&value2),
		(*C.ALint)(&value3),
	)
	return
}
Esempio n. 8
0
File: buffer.go Progetto: nzlov/goal
func (buffer Buffer) GetBuffer3f(param ALenum) (value1, value2, value3 float32) {
	C.alGetBuffer3f(
		C.ALuint(buffer), C.ALenum(param),
		(*C.ALfloat)(&value1),
		(*C.ALfloat)(&value2),
		(*C.ALfloat)(&value3),
	)
	return
}
Esempio n. 9
0
File: alut.go Progetto: nzlov/goal
func LoadMemoryWaveform(waveshape al.ALenum, frequency float32, phase float32, duration float32) (
	format al.ALenum, size int32, freq float32, data unsafe.Pointer) {
	data = C.alutLoadMemoryWaveform(
		C.ALenum(waveshape), C.ALfloat(frequency), C.ALfloat(phase), C.ALfloat(duration),
		(*C.ALenum)(&format),
		(*C.ALsizei)(&size),
		(*C.ALfloat)(&frequency),
	)
	return
}
Esempio n. 10
0
func alGetBooleanv(k int, v []bool) {
	val := make([]C.ALboolean, len(v))
	for i, bv := range v {
		if bv {
			val[i] = C.AL_TRUE
		} else {
			val[i] = C.AL_FALSE
		}
	}
	C.call_alGetBooleanv(alGetBooleanvFunc, C.ALenum(k), &val[0])
}
Esempio n. 11
0
File: alut.go Progetto: nzlov/goal
func CreateBufferWavefrom(
	waveshape al.ALenum,
	frequency float32,
	phase float32,
	duration float32,
) al.Buffer {
	return al.Buffer(C.alutCreateBufferWaveform(
		C.ALenum(waveshape),
		C.ALfloat(frequency),
		C.ALfloat(phase),
		C.ALfloat(duration),
	))
}
Esempio n. 12
0
func (s *Sound) LoadPCMData() {
	format := 0

	if s.Channels > 1 {
		switch s.BitsPerSample {
		case 8:
			format = C.AL_FORMAT_STEREO8
		case 16:
			format = C.AL_FORMAT_STEREO16
		}
	} else {
		switch s.BitsPerSample {
		case 8:
			format = C.AL_FORMAT_MONO8
		case 16:
			format = C.AL_FORMAT_MONO16
		}
	}

	C.alGenBuffers(1, &s.buffer)
	C.alBufferData(s.buffer, C.ALenum(format), unsafe.Pointer(&s.Data[0]), C.ALsizei(s.Size), C.ALsizei(s.Frequency))
}
Esempio n. 13
0
func alGetSourcef(s Source, k int) float32 {
	var v C.ALfloat
	C.call_alGetSourcef(alGetSourcefFunc, C.ALuint(s), C.ALenum(k), &v)
	return float32(v)
}
Esempio n. 14
0
func alGetSourcei(s Source, k int) int32 {
	var v C.ALint
	C.call_alGetSourcei(alGetSourceiFunc, C.ALuint(s), C.ALenum(k), &v)
	return int32(v)
}
Esempio n. 15
0
func alDistanceModel(v int32) {
	C.call_alDistanceModel(alDistanceModelFunc, C.ALenum(v))
}
Esempio n. 16
0
func alGetString(v int) string {
	value := C.call_alGetString(alGetStringFunc, C.ALenum(v))
	return C.GoString(value)
}
Esempio n. 17
0
func alGetFloat(k int) float32 {
	return float32(C.call_alGetFloat(alGetFloatFunc, C.ALenum(k)))
}
Esempio n. 18
0
func alGetInteger(k int) int32 {
	return int32(C.call_alGetInteger(alGetIntegerFunc, C.ALenum(k)))
}
Esempio n. 19
0
func alGetBufferi(b Buffer, k int) int32 {
	var v C.ALint
	C.call_alGetBufferi(alGetBufferiFunc, C.ALuint(b), C.ALenum(k), &v)
	return int32(v)
}
Esempio n. 20
0
func alListenerf(k int, v float32) {
	C.call_alListenerf(alListenerfFunc, C.ALenum(k), C.ALfloat(v))
}
Esempio n. 21
0
func alSourcefv(s Source, k int, v []float32) {
	C.call_alSourcefv(alSourcefvFunc, C.ALuint(s), C.ALenum(k), (*C.ALfloat)(unsafe.Pointer(&v[0])))
}
Esempio n. 22
0
func alSourcei(s Source, k int, v int32) {
	C.call_alSourcei(alSourcefFunc, C.ALuint(s), C.ALenum(k), C.ALint(v))
}
Esempio n. 23
0
func alSourcef(s Source, k int, v float32) {
	C.call_alSourcef(alSourcefFunc, C.ALuint(s), C.ALenum(k), C.ALfloat(v))
}
Esempio n. 24
0
// Renamed, was GetListener3i.
func (self Listener) Get3i(param int32) (v1, v2, v3 int32) {
	C.walGetListener3i(C.ALenum(param), unsafe.Pointer(&v1),
		unsafe.Pointer(&v2), unsafe.Pointer(&v3))
	return
}
Esempio n. 25
0
func alGetListenerf(k int) float32 {
	var v C.ALfloat
	C.call_alGetListenerf(alListenerfFunc, C.ALenum(k), &v)
	return float32(v)
}
Esempio n. 26
0
// Renamed, was GetListeneriv.
func (self Listener) Getiv(param int32, values []int32) {
	C.walGetListeneriv(C.ALenum(param), unsafe.Pointer(&values[0]))
}
Esempio n. 27
0
func alListenerfv(k int, v []float32) {
	C.call_alListenerfv(alListenerfvFunc, C.ALenum(k), (*C.ALfloat)(unsafe.Pointer(&v[0])))
}
Esempio n. 28
0
func alDisable(capability int32) {
	C.call_alDisable(alDisableFunc, C.ALenum(capability))
}
Esempio n. 29
0
func alBufferData(b Buffer, format uint32, data []byte, freq int32) {
	C.call_alBufferData(alBufferDataFunc, C.ALuint(b), C.ALenum(format), unsafe.Pointer(&data[0]), C.ALsizei(len(data)), C.ALsizei(freq))
}
Esempio n. 30
0
func alIsEnabled(capability int32) bool {
	return C.call_alIsEnabled(alIsEnabledFunc, C.ALenum(capability)) == C.AL_TRUE
}