incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eri...@apache.org
Subject svn commit: r1195272 - /incubator/ooo/trunk/main/apple_remote/HIDRemoteControlDevice.m
Date Sun, 30 Oct 2011 22:57:34 GMT
Author: ericb2
Date: Sun Oct 30 22:57:34 2011
New Revision: 1195272

URL: http://svn.apache.org/viewvc?rev=1195272&view=rev
Log:
Propragating the modif in the implementation (HIDRemoteControlDevice.m)

Modified:
    incubator/ooo/trunk/main/apple_remote/HIDRemoteControlDevice.m

Modified: incubator/ooo/trunk/main/apple_remote/HIDRemoteControlDevice.m
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/apple_remote/HIDRemoteControlDevice.m?rev=1195272&r1=1195271&r2=1195272&view=diff
==============================================================================
--- incubator/ooo/trunk/main/apple_remote/HIDRemoteControlDevice.m (original)
+++ incubator/ooo/trunk/main/apple_remote/HIDRemoteControlDevice.m Sun Oct 30 22:57:34 2011
@@ -278,30 +278,40 @@ cleanup:	
 		[previousRemainingCookieString release], previousRemainingCookieString=nil;							
 	}*/
 	if (cookieString == nil || [cookieString length] == 0) return;
-		
+
 	NSNumber* buttonId = [[self cookieToButtonMapping] objectForKey: cookieString];
 	if (buttonId != nil) {
-		[self sendRemoteButtonEvent: [buttonId intValue] pressedDown: (sumOfValues>0)];
+	    switch ( (int)buttonId )
+	    {
+		case kMetallicRemote2009ButtonPlay:
+		case kMetallicRemote2009ButtonMiddlePlay:
+		    buttonId = [NSNumber numberWithInt:kRemoteButtonPlay];
+		    break;
+		default:
+		    break;
+	    }
+	    [self sendRemoteButtonEvent: [buttonId intValue] pressedDown: (sumOfValues>0)];
+
 	} else {
-		// let's see if a number of events are stored in the cookie string. this does
-		// happen when the main thread is too busy to handle all incoming events in time.
-		NSString* subCookieString;
-		NSString* lastSubCookieString=nil;
-		while( (subCookieString = [self validCookieSubstring: cookieString]) ) {
-			cookieString = [cookieString substringFromIndex: [subCookieString length]];
-			lastSubCookieString = subCookieString;
-			if (processesBacklog) [self handleEventWithCookieString: subCookieString sumOfValues:sumOfValues];
-		}
-		if (processesBacklog == NO && lastSubCookieString != nil) {
-			// process the last event of the backlog and assume that the button is not pressed down
any longer.
-			// The events in the backlog do not seem to be in order and therefore (in rare cases)
the last event might be 
-			// a button pressed down event while in reality the user has released it. 
-			// NSLog(@"processing last event of backlog");
-			[self handleEventWithCookieString: lastSubCookieString sumOfValues:0];
-		}
-		if ([cookieString length] > 0) {
-			NSLog(@"Unknown button for cookiestring %@", cookieString);
-		}		
+	    // let's see if a number of events are stored in the cookie string. this does
+	    // happen when the main thread is too busy to handle all incoming events in time.
+	    NSString* subCookieString;
+	    NSString* lastSubCookieString=nil;
+	    while( (subCookieString = [self validCookieSubstring: cookieString]) ) {
+		cookieString = [cookieString substringFromIndex: [subCookieString length]];
+		lastSubCookieString = subCookieString;
+		if (processesBacklog) [self handleEventWithCookieString: subCookieString sumOfValues:sumOfValues];
+	    }
+	    if (processesBacklog == NO && lastSubCookieString != nil) {
+		// process the last event of the backlog and assume that the button is not pressed down
any longer.
+		// The events in the backlog do not seem to be in order and therefore (in rare cases) the
last event might be 
+		// a button pressed down event while in reality the user has released it. 
+		// NSLog(@"processing last event of backlog");
+		[self handleEventWithCookieString: lastSubCookieString sumOfValues:0];
+	    }
+	    if ([cookieString length] > 0) {
+		NSLog(@"Unknown button for cookiestring %@", cookieString);
+	    }		
 	}
 }
 



Mime
View raw message