コード例 #1
0
ファイル: instance.go プロジェクト: golang-lib/go-vlc
// AudioDeviceId returns the id of an audio device.
func (this *Instance) AudioDeviceId(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_id(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
// AudioDeviceId returns the id of an audio device.
func (this *Player) AudioDeviceId(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_id(this.ptr, c, C.int(device)); r != nil {
		s = C.GoString(r)
		C.free(unsafe.Pointer(r))
		return
	}

	return "", checkError()
}