コード例 #1
0
ファイル: instance.go プロジェクト: golang-lib/go-vlc
// 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()
}
コード例 #2
0
ファイル: player.go プロジェクト: henrym/go-vlc
// 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()
}