changeset 15731:532a351962fb

set window alpha
author nplourde
date Thu, 16 Jun 2005 00:26:47 +0000
parents 0bc42444c110
children 52edb32f0c2a
files libvo/vo_macosx.m
diffstat 1 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_macosx.m	Wed Jun 15 22:37:38 2005 +0000
+++ b/libvo/vo_macosx.m	Thu Jun 16 00:26:47 2005 +0000
@@ -55,6 +55,7 @@
 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 @@
 		
 	//config OpenGL View
 	[mpGLView config];
-		
+	
 	return 0;
 }
 
@@ -412,7 +413,11 @@
 	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)
 	{
@@ -764,6 +769,19 @@
 }
 
 /*
+	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
 */
 - (void) keyDown: (NSEvent *) theEvent