Changeset 5518

Show
Ignore:
Timestamp:
05/11/08 17:17:37 (5 days ago)
Author:
morris
Message:

Only allow Bluetooth remote input when we're active

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Spiral/trunk/SPApplicationController.m

    r5490 r5518  
    190190                         
    191191                case SPRemoteDisplayTime: 
    192                         [movieController flashCurrentTime]; 
     192                        [movieController showStatusOverlay]; 
    193193                        break; 
    194194                 
     
    501501                movieController = [delegate movieController]; 
    502502 
    503                 if([movieController rate] > 1.0) 
     503                if(fabs([movieController rate]) > 1.0) 
    504504                        [movieController playAtRate:1.0]; 
    505505        } 
     
    515515        SPRemoteAction          action; 
    516516         
    517         action = [[SPPS3Remote sharedRemote] actionForButton:button inContext:[self _remoteContext]]; 
    518          
    519         [self _handleRemoteAction:action]; 
    520  
    521         _holdingPS3RemoteButton = NO; 
     517        if([NSApp isActive]) { 
     518                action = [[SPPS3Remote sharedRemote] actionForButton:button inContext:[self _remoteContext]]; 
     519                 
     520                [self _handleRemoteAction:action]; 
     521 
     522                _holdingPS3RemoteButton = NO; 
     523        } 
    522524} 
    523525 
     
    525527 
    526528- (void)PS3RemoteHeldButton:(SPPS3RemoteButton)button { 
    527         _holdingPS3RemoteButton = YES; 
    528          
    529         [self performSelector:@selector(holdPS3RemoteButton:)  
    530                            withObject:[NSNumber numberWithInt:button]]; 
     529        if([NSApp isActive]) { 
     530                _holdingPS3RemoteButton = YES; 
     531                 
     532                [self performSelector:@selector(holdPS3RemoteButton:)  
     533                                   withObject:[NSNumber numberWithInt:button]]; 
     534        } 
    531535} 
    532536 
     
    536540        SPRemoteAction          action; 
    537541         
    538         if(_holdingPS3RemoteButton) { 
     542        if([NSApp isActive] && _holdingPS3RemoteButton) { 
    539543                action = [[SPPS3Remote sharedRemote] actionForButton:[button intValue] inContext:[self _remoteContext]]; 
    540544                 
     
    550554 
    551555- (void)PS3RemoteReleasedButton { 
    552         _holdingPS3RemoteButton = NO; 
     556        if([NSApp isActive]) 
     557                _holdingPS3RemoteButton = NO; 
    553558} 
    554559 
     
    560565        SPRemoteAction          action; 
    561566         
    562         action = [[SPWiiRemote sharedRemote] actionForButton:button inContext:[self _remoteContext]]; 
    563          
    564         [self _handleRemoteAction:action]; 
    565  
    566         _holdingWiiRemoteButton = NO; 
     567        if([NSApp isActive]) { 
     568                action = [[SPWiiRemote sharedRemote] actionForButton:button inContext:[self _remoteContext]]; 
     569                 
     570                [self _handleRemoteAction:action]; 
     571                 
     572                _holdingWiiRemoteButton = NO; 
     573        } 
    567574} 
    568575 
     
    570577 
    571578- (void)wiiRemoteHeldButton:(SPWiiRemoteButton)button { 
    572         _holdingWiiRemoteButton = YES; 
    573          
    574         [self performSelector:@selector(holdWiiRemoteButton:)  
    575                            withObject:[NSNumber numberWithInt:button]]; 
     579        if([NSApp isActive]) { 
     580                _holdingWiiRemoteButton = YES; 
     581                 
     582                [self performSelector:@selector(holdWiiRemoteButton:)  
     583                                   withObject:[NSNumber numberWithInt:button]]; 
     584        } 
    576585} 
    577586 
     
    581590        SPRemoteAction          action; 
    582591         
    583         if(_holdingWiiRemoteButton) { 
     592        if([NSApp isActive] && _holdingWiiRemoteButton) { 
    584593                action = [[SPWiiRemote sharedRemote] actionForButton:[button intValue] inContext:[self _remoteContext]]; 
    585594                 
     
    595604 
    596605- (void)wiiRemoteReleasedButton { 
    597         _holdingWiiRemoteButton = NO; 
     606        if([NSApp isActive]) 
     607                _holdingWiiRemoteButton = NO; 
    598608} 
    599609