Changeset 5523
- Timestamp:
- 05/11/08 21:50:29 (4 days ago)
- Files:
-
- Spiral/trunk/SPApplicationController.m (modified) (6 diffs)
- Spiral/trunk/SPBluetoothRemote.h (modified) (1 diff)
- Spiral/trunk/SPBluetoothRemote.m (modified) (2 diffs)
- Spiral/trunk/SPPS3Remote.h (modified) (1 diff)
- Spiral/trunk/SPPS3Remote.m (modified) (4 diffs)
- Spiral/trunk/SPWiiRemote.h (modified) (1 diff)
- Spiral/trunk/SPWiiRemote.m (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Spiral/trunk/SPApplicationController.m
r5521 r5523 512 512 #pragma mark - 513 513 514 - (void)PS3RemotePressedButton:(SPPS3RemoteButton)button { 514 - (BOOL)PS3RemoteShouldDisconnect:(SPPS3Remote *)remote { 515 id delegate; 516 517 delegate = [[NSApp keyWindow] delegate]; 518 519 if([delegate isKindOfClass:[SPPlayerController class]] || [delegate isKindOfClass:[SPDrillController class]]) 520 return NO; 521 522 return YES; 523 } 524 525 526 527 - (void)PS3Remote:(SPPS3Remote *)remote pressedButton:(SPPS3RemoteButton)button { 515 528 SPRemoteAction action; 516 529 … … 526 539 527 540 528 - (void)PS3Remote HeldButton:(SPPS3RemoteButton)button {541 - (void)PS3Remote:(SPPS3Remote *)remote heldButton:(SPPS3RemoteButton)button { 529 542 if([NSApp isActive]) { 530 543 _holdingPS3RemoteButton = YES; … … 553 566 554 567 555 - (void)PS3RemoteReleasedButton {568 - (void)PS3RemoteReleasedButton:(SPPS3Remote *)remote { 556 569 if([NSApp isActive]) 557 570 _holdingPS3RemoteButton = NO; … … 562 575 #pragma mark - 563 576 564 - (void)wiiRemotePressedButton:(SPWiiRemoteButton)button { 577 - (BOOL)wiiRemoteShouldDisconnect:(SPWiiRemote *)remote { 578 id delegate; 579 580 delegate = [[NSApp keyWindow] delegate]; 581 582 if([delegate isKindOfClass:[SPPlayerController class]] || [delegate isKindOfClass:[SPDrillController class]]) 583 return NO; 584 585 return YES; 586 } 587 588 589 590 - (void)wiiRemote:(SPWiiRemote *)remote pressedButton:(SPWiiRemoteButton)button { 565 591 SPRemoteAction action; 566 592 … … 576 602 577 603 578 - (void)wiiRemote HeldButton:(SPWiiRemoteButton)button {604 - (void)wiiRemote:(SPWiiRemote *)remote heldButton:(SPWiiRemoteButton)button { 579 605 if([NSApp isActive]) { 580 606 _holdingWiiRemoteButton = YES; … … 603 629 604 630 605 - (void)wiiRemoteReleasedButton {631 - (void)wiiRemoteReleasedButton:(SPWiiRemote *)remote { 606 632 if([NSApp isActive]) 607 633 _holdingWiiRemoteButton = NO; Spiral/trunk/SPBluetoothRemote.h
r5517 r5523 59 59 - (void)connectAfterDelay; 60 60 - (void)disconnectAfterDelay; 61 - (BOOL)remoteShouldDisconnect; 61 62 - (void)remoteDidConnect; 62 63 Spiral/trunk/SPBluetoothRemote.m
r5517 r5523 124 124 NSLog(@"*** -[%@ _disconnect]", [self class]); 125 125 126 if(_controlConnected) 127 [_controlChannel closeChannel]; 128 129 if(_interruptConnected) 130 [_interruptChannel closeChannel]; 131 132 [_device closeConnection]; 126 if([self remoteShouldDisconnect]) { 127 if(_controlConnected) 128 [_controlChannel closeChannel]; 129 130 if(_interruptConnected) 131 [_interruptChannel closeChannel]; 132 133 [_device closeConnection]; 134 } else { 135 [self disconnectAfterDelay]; 136 } 133 137 } 134 138 … … 197 201 198 202 - (void)disconnectAfterDelay { 199 [self performSelectorOnce:@selector(_disconnect) afterDelay:1800.0]; 203 [self performSelectorOnce:@selector(_disconnect) afterDelay:600.0]; 204 } 205 206 207 208 - (BOOL)remoteShouldDisconnect { 209 return NO; 200 210 } 201 211 Spiral/trunk/SPPS3Remote.h
r5472 r5523 111 111 @protocol SPPS3RemoteDelegate <NSObject> 112 112 113 - (BOOL)PS3RemoteShouldDisconnect:(SPPS3Remote *)remote; 114 113 115 @optional 114 116 115 - (void)PS3Remote PressedButton:(SPPS3RemoteButton)button;116 - (void)PS3Remote HeldButton:(SPPS3RemoteButton)button;117 - (void)PS3RemoteReleasedButton ;117 - (void)PS3Remote:(SPPS3Remote *)remote pressedButton:(SPPS3RemoteButton)button; 118 - (void)PS3Remote:(SPPS3Remote *)remote heldButton:(SPPS3RemoteButton)button; 119 - (void)PS3RemoteReleasedButton:(SPPS3Remote *)remote; 118 120 119 121 @end Spiral/trunk/SPPS3Remote.m
r5521 r5523 48 48 49 49 if(_delegatePS3RemotePressedButton) 50 [delegate PS3Remote PressedButton:button];50 [delegate PS3Remote:self pressedButton:button]; 51 51 } else { 52 52 if(_lastButtonSimulatedHold) { … … 58 58 59 59 if(_delegatePS3RemoteReleasedButton) 60 [delegate PS3RemoteReleasedButton ];60 [delegate PS3RemoteReleasedButton:self]; 61 61 } 62 62 } … … 69 69 70 70 if(_delegatePS3RemoteHeldButton) 71 [delegate PS3Remote HeldButton:_lastHoldButton];71 [delegate PS3Remote:self heldButton:_lastHoldButton]; 72 72 } 73 73 } … … 110 110 111 111 [super remoteDidConnect]; 112 } 113 114 115 116 - (BOOL)remoteShouldDisconnect { 117 return [delegate PS3RemoteShouldDisconnect:self]; 112 118 } 113 119 Spiral/trunk/SPWiiRemote.h
r5472 r5523 71 71 @protocol SPWiiRemoteDelegate <NSObject> 72 72 73 - (BOOL)wiiRemoteShouldDisconnect:(SPWiiRemote *)remote; 74 73 75 @optional 74 76 75 - (void)wiiRemote PressedButton:(SPWiiRemoteButton)button;76 - (void)wiiRemote HeldButton:(SPWiiRemoteButton)button;77 - (void)wiiRemoteReleasedButton ;77 - (void)wiiRemote:(SPWiiRemote *)remote pressedButton:(SPWiiRemoteButton)button; 78 - (void)wiiRemote:(SPWiiRemote *)remote heldButton:(SPWiiRemoteButton)button; 79 - (void)wiiRemoteReleasedButton:(SPWiiRemote *)remote; 78 80 79 81 @end Spiral/trunk/SPWiiRemote.m
r5520 r5523 74 74 75 75 if(_delegateWiiRemotePressedButton) 76 [delegate wiiRemote PressedButton:button];76 [delegate wiiRemote:self pressedButton:button]; 77 77 } else { 78 78 if(_lastButtonSimulatedHold) { … … 84 84 85 85 if(_delegateWiiRemoteReleasedButton) 86 [delegate wiiRemoteReleasedButton ];86 [delegate wiiRemoteReleasedButton:self]; 87 87 } 88 88 } … … 95 95 96 96 if(_delegateWiiRemoteHeldButton) 97 [delegate wiiRemote HeldButton:_lastHoldButton];97 [delegate wiiRemote:self heldButton:_lastHoldButton]; 98 98 } 99 99 } … … 156 156 157 157 [super remoteDidConnect]; 158 } 159 160 161 162 - (BOOL)remoteShouldDisconnect { 163 return [delegate wiiRemoteShouldDisconnect:self]; 158 164 } 159 165
