summaryrefslogtreecommitdiffstats
path: root/apple_remote/source/RemoteControl.m
diff options
context:
space:
mode:
Diffstat (limited to 'apple_remote/source/RemoteControl.m')
-rw-r--r--apple_remote/source/RemoteControl.m34
1 files changed, 18 insertions, 16 deletions
diff --git a/apple_remote/source/RemoteControl.m b/apple_remote/source/RemoteControl.m
index 36f7ffecca2c..d43597d96c7d 100644
--- a/apple_remote/source/RemoteControl.m
+++ b/apple_remote/source/RemoteControl.m
@@ -52,7 +52,7 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
if ( (self = [super init]) ) {
delegate = [_remoteControlDelegate retain];
#ifdef DEBUG
- NSLog(@"RemoteControl initWithDelegate ok");
+ NSLog( @"Apple RemoteControl initWithDelegate ok");
#endif
}
return self;
@@ -65,7 +65,7 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
- (void) setListeningToRemote: (BOOL) value {
#ifdef DEBUG
- NSLog(@"setListeningToRemote ok");
+ NSLog( @"Apple RemoteControl setListeningToRemote ok");
#endif
(void)value;
}
@@ -75,13 +75,13 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
- (void) startListening: (id) sender {
#ifdef DEBUG
- NSLog(@"startListening ok");
+ NSLog( @"Apple RemoteControl startListening ok");
#endif
(void)sender;
}
- (void) stopListening: (id) sender {
#ifdef DEBUG
- NSLog(@"stopListening ok");
+ NSLog( @"Apple RemoteControl stopListening ok");
#endif
(void)sender;
}
@@ -95,7 +95,7 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
- (BOOL) sendsEventForButtonIdentifier: (RemoteControlEventIdentifier) identifier {
#ifdef DEBUG
- NSLog(@"sending event for button identifier \n");
+ NSLog( @"Apple RemoteControl: sending event for button identifier\n");
#endif
(void)identifier;
return YES;
@@ -111,17 +111,19 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
kTargetApplicationIdentifier /*targetBundleIdentifier -> does not appear, since the peer is nil*/,
nil];
#ifdef DEBUG
+ NSLog( @"Apple Remote: sendDistributedNotification ...");
// Debug purpose: returns all the existing dictionary keys.
- NSString *s;
- NSEnumerator *e = [userInfo keyEnumerator];
- while ( (s = [e nextObject]) ) {
- NSLog(@"key = %@ ",s);
+ NSEnumerator* itKey = [userInfo keyEnumerator];
+ NSEnumerator* itVal = [userInfo objectEnumerator];
+ for(;;) {
+ NSString* sKey = [itKey nextObject];
+ NSString* sVal = [itVal nextObject];
+ if( !sKey && !sVal)
+ break;
+ if( !sKey) sKey = @"nil";
+ if( !sVal) sVal = @"nil";
+ NSLog( @"\tARdict[\"%@\"] = \"%@\"",sKey,sVal);
}
- NSEnumerator *f = [userInfo objectEnumerator ];
- while ( (s = [f nextObject]) ) {
- NSLog(@"value = %@ ",s);
- }
- NSLog(@"sendDistributedNotification ...");
#endif
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:notificationName
@@ -133,13 +135,13 @@ NSString* kTargetApplicationIdentifier = @"TargetBundleIdentifier";
+ (void) sendFinishedNotifcationForAppIdentifier: (NSString*) identifier {
[self sendDistributedNotification:FINISHED_USING_REMOTE_CONTROL_NOTIFICATION targetBundleIdentifier:identifier];
#ifdef DEBUG
- NSLog(@"sendFinishedNotifcationForAppIdentifier ...");
+ NSLog( @"Apple RemoteControl: sendFinishedNotifcationForAppIdentifier ...");
#endif
}
+ (void) sendRequestForRemoteControlNotification {
[self sendDistributedNotification:REQUEST_FOR_REMOTE_CONTROL_NOTIFCATION targetBundleIdentifier:nil];
#ifdef DEBUG
- NSLog(@"sendRequestForRemoteControlNotification ...");
+ NSLog( @"Apple RemoteControl: sendRequestForRemoteControlNotification ...");
#endif
}