RemoteMainController.m (dbfe0a54) RemoteMainController.m (53e04a5d)
1/*****************************************************************************
2 * RemoteMainController.m
3 *
4 * Created by Martin Kahr on 11.03.06 under a MIT-style license.
5 * Copyright (c) 2006 martinkahr.com. All rights reserved.
6 *
7 * Code modified and adapted to OpenOffice.org
8 * by Eric Bachard on 11.08.2008 under the same License

--- 91 unchanged lines hidden (view full) ---

100- (void) remoteButton: (RemoteControlEventIdentifier)buttonIdentifier pressedDown: (BOOL) pressedDown clickCount: (unsigned int)clickCount
101{
102 NSString* pressed = @"";
103#ifdef DEBUG
104 NSString* buttonName = nil;
105#endif
106 if (pressedDown)
107 {
1/*****************************************************************************
2 * RemoteMainController.m
3 *
4 * Created by Martin Kahr on 11.03.06 under a MIT-style license.
5 * Copyright (c) 2006 martinkahr.com. All rights reserved.
6 *
7 * Code modified and adapted to OpenOffice.org
8 * by Eric Bachard on 11.08.2008 under the same License

--- 91 unchanged lines hidden (view full) ---

100- (void) remoteButton: (RemoteControlEventIdentifier)buttonIdentifier pressedDown: (BOOL) pressedDown clickCount: (unsigned int)clickCount
101{
102 NSString* pressed = @"";
103#ifdef DEBUG
104 NSString* buttonName = nil;
105#endif
106 if (pressedDown)
107 {
108 pressed = @"(pressed)";
108 pressed = @"(AppleRemoteMainController: button pressed)";
109
110#ifdef DEBUG
111 switch(buttonIdentifier)
112 {
113 case kRemoteButtonPlus: buttonName = @"Volume up"; break; // MEDIA_COMMAND_VOLUME_UP ( see vcl/inc/vcl/cmdevt.hxx )
114 case kRemoteButtonMinus: buttonName = @"Volume down"; break; // MEDIA_COMMAND_VOLUME_DOWN
115 case kRemoteButtonMenu: buttonName = @"Menu"; break; // MEDIA_COMMAND_MENU
116 case kRemoteButtonPlay: buttonName = @"Play"; break; // MEDIA_COMMAND_PLAY
117 case kRemoteButtonRight: buttonName = @"Next slide"; break; // MEDIA_COMMAND_NEXTTRACK
118 case kRemoteButtonLeft: buttonName = @"Left"; break; // MEDIA_COMMAND_PREVIOUSTRACK
119 case kRemoteButtonRight_Hold: buttonName = @"Last slide"; break; // MEDIA_COMMAND_NEXTTRACK_HOLD
120 case kRemoteButtonLeft_Hold: buttonName = @"First slide"; break; // MEDIA_COMMAND_PREVIOUSTRACK_HOLD
121 case kRemoteButtonPlus_Hold: buttonName = @"Volume up holding"; break;
122 case kRemoteButtonMinus_Hold: buttonName = @"Volume down holding"; break;
123 case kRemoteButtonPlay_Hold: buttonName = @"Play (sleep mode)"; break; // MEDIA_COMMAND_PLAY_HOLD
124 case kRemoteButtonMenu_Hold: buttonName = @"Menu (long)"; break; // MEDIA_COMMAND_MENU_HOLD
125 case kRemoteControl_Switched: buttonName = @"Remote Control Switched";break;
126
109
110#ifdef DEBUG
111 switch(buttonIdentifier)
112 {
113 case kRemoteButtonPlus: buttonName = @"Volume up"; break; // MEDIA_COMMAND_VOLUME_UP ( see vcl/inc/vcl/cmdevt.hxx )
114 case kRemoteButtonMinus: buttonName = @"Volume down"; break; // MEDIA_COMMAND_VOLUME_DOWN
115 case kRemoteButtonMenu: buttonName = @"Menu"; break; // MEDIA_COMMAND_MENU
116 case kRemoteButtonPlay: buttonName = @"Play"; break; // MEDIA_COMMAND_PLAY
117 case kRemoteButtonRight: buttonName = @"Next slide"; break; // MEDIA_COMMAND_NEXTTRACK
118 case kRemoteButtonLeft: buttonName = @"Left"; break; // MEDIA_COMMAND_PREVIOUSTRACK
119 case kRemoteButtonRight_Hold: buttonName = @"Last slide"; break; // MEDIA_COMMAND_NEXTTRACK_HOLD
120 case kRemoteButtonLeft_Hold: buttonName = @"First slide"; break; // MEDIA_COMMAND_PREVIOUSTRACK_HOLD
121 case kRemoteButtonPlus_Hold: buttonName = @"Volume up holding"; break;
122 case kRemoteButtonMinus_Hold: buttonName = @"Volume down holding"; break;
123 case kRemoteButtonPlay_Hold: buttonName = @"Play (sleep mode)"; break; // MEDIA_COMMAND_PLAY_HOLD
124 case kRemoteButtonMenu_Hold: buttonName = @"Menu (long)"; break; // MEDIA_COMMAND_MENU_HOLD
125 case kRemoteControl_Switched: buttonName = @"Remote Control Switched";break;
126
127 default: NSLog(@"Unmapped event for button %d", buttonIdentifier); break;
127 default: NSLog( @"AppleRemoteMainController: Unmapped event for button %d", buttonIdentifier); break;
128 }
129#endif
130 [ self postTheEvent:buttonIdentifier modifierFlags: 0 ];
131 }
132 else // not pressed
133 {
128 }
129#endif
130 [ self postTheEvent:buttonIdentifier modifierFlags: 0 ];
131 }
132 else // not pressed
133 {
134 pressed = @"(released)";
134 pressed = @"(AppleRemoteMainController: button released)";
135 }
136
137#ifdef DEBUG
138 //NSLog(@"Button %@ pressed %@", buttonName, pressed);
139 NSString* clickCountString = @"";
140 if (clickCount > 1) clickCountString = [NSString stringWithFormat: @"%d clicks", clickCount];
141 NSString* feedbackString = [NSString stringWithFormat:@"(Value:%4d) %@ %@ %@",buttonIdentifier, buttonName, pressed, clickCountString];
142

--- 25 unchanged lines hidden ---
135 }
136
137#ifdef DEBUG
138 //NSLog(@"Button %@ pressed %@", buttonName, pressed);
139 NSString* clickCountString = @"";
140 if (clickCount > 1) clickCountString = [NSString stringWithFormat: @"%d clicks", clickCount];
141 NSString* feedbackString = [NSString stringWithFormat:@"(Value:%4d) %@ %@ %@",buttonIdentifier, buttonName, pressed, clickCountString];
142

--- 25 unchanged lines hidden ---