Esempio n. 1
0
// AudioDeviceName returns the long name of an audio device.
// If it is not available, the short name is given.
func (this *Instance) AudioDeviceName(output string, device int) (s string, err error) {
	if this.ptr == nil {
		return "", syscall.EINVAL
	}

	c := C.CString(output)
	defer C.free(unsafe.Pointer(c))

	if r := C.libvlc_audio_output_device_longname(this.ptr, c, C.int(device)); r != nil {
		s = C.GoString(r)
		C.free(unsafe.Pointer(r))
		return
	}

	return "", checkError()
}
Esempio n. 2
0
// AudioDeviceName returns the long name of an audio device.
// If it is not available, the short name is given.
func (this *Player) AudioDeviceName(output string, device int) (s string, err error) {
	if this.ptr == nil {
		return "", &VLCError{"Player is nil"}
	}

	c := C.CString(output)
	defer C.free(unsafe.Pointer(c))

	if r := C.libvlc_audio_output_device_longname(this.ptr, c, C.int(device)); r != nil {
		s = C.GoString(r)
		C.free(unsafe.Pointer(r))
		return
	}

	return "", checkError()
}