示例#1
0
文件: player.go 项目: jteeuwen/go-vlc
// Get the mouse pointer coordinates over a video.
// Coordinates are expressed in terms of the decoded video resolution,
// /not/ in terms of pixels on the screen/viewport (to get the latter,
// you can query your windowing system directly).
//
// Either of the coordinates may be negative or larger than the corresponding
// dimension of the video, if the cursor is outside the rendering area.
//
// Note: The coordinates may be out-of-date if the pointer is not located
// on the video rendering area. LibVLC does not track the pointer if it is
// outside of the video widget.
//
// Note: LibVLC does not support multiple pointers (it does of course support
// multiple input devices sharing the same pointer) at the moment.
//
// vidnum is the number of the target video. Most commonly starts at 0.
func (this *Player) Cursor(vidnum uint) (cx, cy int, err error) {
	if this.ptr == nil {
		return 0, 0, syscall.EINVAL
	}

	var x, y C.int
	C.libvlc_video_get_cursor(this.ptr, C.uint(vidnum), &x, &y)
	return int(x), int(y), nil
}
示例#2
0
文件: player.go 项目: henrym/go-vlc
// Get the mouse pointer coordinates over a video.
// Coordinates are expressed in terms of the decoded video resolution,
// /not/ in terms of pixels on the screen/viewport (to get the latter,
// you can query your windowing system directly).
//
// Either of the coordinates may be negative or larger than the corresponding
// dimension of the video, if the cursor is outside the rendering area.
//
// Note: The coordinates may be out-of-date if the pointer is not located
// on the video rendering area. LibVLC does not track the pointer if it is
// outside of the video widget.
//
// Note: LibVLC does not support multiple pointers (it does of course support
// multiple input devices sharing the same pointer) at the moment.
//
// vidnum is the number of the target video. Most commonly starts at 0.
func (this *Player) Cursor(vidnum uint) (cx, cy int, err error) {
	if this.ptr == nil {
		return 0, 0, &VLCError{"Player is nil"}
	}

	var x, y C.int
	C.libvlc_video_get_cursor(this.ptr, C.uint(vidnum), &x, &y)
	return int(x), int(y), nil
}