[vlc-commits] iOS vout 2: use simple tap instead of long touch gesture
Felix Paul Kühne
git at videolan.org
Fri Feb 6 17:46:29 CET 2015
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Feb 3 19:05:56 2015 +0100| [048ea8aae465093cfba2030786132d61e1b9237e] | committer: Felix Paul Kühne
iOS vout 2: use simple tap instead of long touch gesture
This proved to be more natural for on-screen navigation
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=048ea8aae465093cfba2030786132d61e1b9237e
---
modules/video_output/ios2.m | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/modules/video_output/ios2.m b/modules/video_output/ios2.m
index fd2c835..c7b9e5b 100644
--- a/modules/video_output/ios2.m
+++ b/modules/video_output/ios2.m
@@ -100,7 +100,7 @@ struct vout_display_sys_t
{
VLCOpenGLES2VideoView *glESView;
UIView* viewContainer;
- UILongPressGestureRecognizer *longTouchRecognizer;
+ UITapGestureRecognizer *tapRecognizer;
vlc_gl_t gl;
vout_display_opengl_t *vgl;
@@ -159,16 +159,15 @@ static int Open(vlc_object_t *this)
waitUntilDone:YES];
/* add tap gesture recognizer for DVD menus and stuff */
- sys->longTouchRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:sys->glESView
- action:@selector(longTouchRecognized:)];
- sys->longTouchRecognizer.allowableMovement = 20.;
+ sys->tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:sys->glESView
+ action:@selector(tapRecognized:)];
if (sys->viewContainer.window) {
if (sys->viewContainer.window.rootViewController) {
if (sys->viewContainer.window.rootViewController.view)
- [sys->viewContainer.superview addGestureRecognizer:sys->longTouchRecognizer];
+ [sys->viewContainer.superview addGestureRecognizer:sys->tapRecognizer];
}
}
- sys->longTouchRecognizer.cancelsTouchesInView = YES;
+ sys->tapRecognizer.cancelsTouchesInView = YES;
/* Initialize common OpenGL video display */
sys->gl.lock = OpenglESClean;
@@ -232,9 +231,9 @@ void Close (vlc_object_t *this)
vout_display_t *vd = (vout_display_t *)this;
vout_display_sys_t *sys = vd->sys;
- if (sys->longTouchRecognizer) {
- [sys->longTouchRecognizer.view removeGestureRecognizer:sys->longTouchRecognizer];
- [sys->longTouchRecognizer release];
+ if (sys->tapRecognizer) {
+ [sys->tapRecognizer.view removeGestureRecognizer:sys->tapRecognizer];
+ [sys->tapRecognizer release];
}
[sys->glESView setVoutDisplay:nil];
@@ -504,10 +503,10 @@ static void OpenglESSwap(vlc_gl_t *gl)
glViewport(place.x, place.y, place.width, place.height);
}
-- (void)longTouchRecognized:(UITapGestureRecognizer *)longTouchRecognizer
+- (void)tapRecognized:(UITapGestureRecognizer *)tapRecognizer
{
- UIGestureRecognizerState state = [longTouchRecognizer state];
- CGPoint touchPoint = [longTouchRecognizer locationInView:self];
+ UIGestureRecognizerState state = [tapRecognizer state];
+ CGPoint touchPoint = [tapRecognizer locationInView:self];
CGFloat scaleFactor = self.contentScaleFactor;
vout_display_SendMouseMovedDisplayCoordinates(_voutDisplay, ORIENT_NORMAL,
(int)touchPoint.x * scaleFactor, (int)touchPoint.y * scaleFactor,
More information about the vlc-commits
mailing list