From 1b0c8682c44596669928f5d90b498f07c5c47d4f Mon Sep 17 00:00:00 2001 From: nplourde Date: Thu, 16 Jun 2005 00:26:47 +0000 Subject: [PATCH] set window alpha git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15732 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_macosx.m | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/libvo/vo_macosx.m b/libvo/vo_macosx.m index 30447ca99b..d053dfc6c5 100644 --- a/libvo/vo_macosx.m +++ b/libvo/vo_macosx.m @@ -55,6 +55,7 @@ extern float movie_aspect; static float old_movie_aspect; extern float vo_panscan; +static float winAlpha = 1; static int int_pause = 0; static vo_info_t info = @@ -133,7 +134,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32 //config OpenGL View [mpGLView config]; - + return 0; } @@ -412,7 +413,11 @@ static uint32_t control(uint32_t request, void *data, ...) NSRect frame; aspect((int *)&d_width, (int *)&d_height,A_NOZOOM); - //if(sender == kQuitCmd) + + if(sender == kQuitCmd) + { + mplayer_put_key(KEY_ESC); + } if(sender == kHalfScreenCmd) { @@ -763,6 +768,19 @@ static uint32_t control(uint32_t request, void *data, ...) } } +/* + From NSView, respond to key equivalents. +*/ +- (BOOL)performKeyEquivalent:(NSEvent *)theEvent +{ + switch([theEvent keyCode]) + { + case 0x21: [window setAlphaValue: winAlpha-=0.05]; return YES; + case 0x1e: [window setAlphaValue: winAlpha+=0.05]; return YES; + } + return NO; +} + /* Process key event */