Changeset 1289
- Timestamp:
- 06/24/10 10:05:53 (2 years ago)
- Location:
- trunk/CommonMediaPlayer
- Files:
-
- 3 modified
-
General Actions/CMPOverlayAction.h (modified) (1 diff)
-
General Actions/CMPOverlayAction.m (modified) (10 diffs)
-
Media Players/DVD Framework/CMPDVDWindowCreationAction.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CommonMediaPlayer/General Actions/CMPOverlayAction.h
r1286 r1289 77 77 @end 78 78 79 extern NSString *CMPOverlayActionWindowKey; 79 extern NSString *CMPOverlayActionWindowNumberKey; 80 extern NSString *CMPOverlayActionWindowRectKey; 80 81 81 82 @interface CMPOverlayAction : NSObject <CMPActionController>{ 82 NSWindow *window; 83 NSRect windowRect; 84 int windowNumber; 83 85 NSMutableArray *overlays; 84 86 } -
trunk/CommonMediaPlayer/General Actions/CMPOverlayAction.m
r1286 r1289 22 22 #import "CMPOverlayAction.h" 23 23 #import "CoreGraphicsServices.h" 24 #import "CMPOverlayModeAction.h"25 24 #import "CMPATVVersion.h" 26 25 … … 568 567 @end 569 568 570 NSString *CMPOverlayActionWindowKey = @"window"; 569 NSString *CMPOverlayActionNumberKey = @"windowNumber"; 570 NSString *CMPOverlayActionRectKey = @"windowNumber"; 571 571 572 572 @interface BRDisplayManager (compat) … … 578 578 - (id)initWithController:(id <CMPPlayerController>)controller andSettings:(NSDictionary *)settings 579 579 { 580 NS Window *win = [settings objectForKey:CMPOverlayActionWindowKey];581 if(win == nil)580 NSNumber *windowNum = [settings objectForKey:CMPOverlayActionWindowNumberKey]; 581 if(windowNum == nil) 582 582 return [self autorelease]; 583 583 … … 586 586 return self; 587 587 588 window = [win retain]; 588 windowNumber = [windowNum intValue]; 589 NSValue *windowRectValue = [settings objectForKey:CMPOverlayActionWindowRectKey]; 590 if(windowRectValue != nil) 591 windowRect = [windowRectValue rectValue]; 592 else { 593 CGDirectDisplayID display = [(BRDisplayManager *)[BRDisplayManager sharedInstance] display]; 594 CGRect frame = CGDisplayBounds(display); 595 frame.size.width = CGDisplayPixelsWide(display); 596 frame.size.height = CGDisplayPixelsHigh(display); 597 598 if(frame.size.width < 0.0f) 599 frame.size.width = ABS(frame.size.width); 600 if(frame.size.height < 0.0f) 601 frame.size.height = ABS(frame.size.height); 602 603 windowRect = NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); 604 } 589 605 overlays = [[NSMutableArray alloc] init]; 590 606 … … 594 610 - (void) dealloc 595 611 { 596 [window release];597 612 [overlays release]; 598 613 [super dealloc]; … … 606 621 - (CMPOverlayWindow *)addBlackShieldWindow 607 622 { 608 CMPOverlayWindow *ret = [[CMPOverlayWindow alloc] initWithContentRect: [window frame] overWindow:[window windowNumber]];623 CMPOverlayWindow *ret = [[CMPOverlayWindow alloc] initWithContentRect:windowRect overWindow:windowNumber]; 609 624 610 625 [overlays addObject:ret]; … … 616 631 - (CMPTextView *)addTextOverlayInPosition:(CMPOverlayPosition)position 617 632 { 618 CMPTextView *ret = [[CMPTextView alloc] initWithContentRect: [window frame] position:position overWindow:[window windowNumber]];633 CMPTextView *ret = [[CMPTextView alloc] initWithContentRect:windowRect position:position overWindow:windowNumber]; 619 634 620 635 [overlays addObject:ret]; … … 626 641 - (CMPPlayerPlayHead *)addPlayheadOverlay 627 642 { 628 CMPPlayerPlayHead *ret = [[CMPPlayerPlayHead alloc] initWithContentRect: [window frame] overWindow:[window windowNumber]];643 CMPPlayerPlayHead *ret = [[CMPPlayerPlayHead alloc] initWithContentRect:windowRect overWindow:windowNumber]; 629 644 630 645 [overlays addObject:ret]; … … 636 651 - (CMPBlurredMenu *)addBlurredMenuOverlayWithItems:(NSArray *)items 637 652 { 638 CMPBlurredMenu *ret = [[CMPBlurredMenu alloc] initWithItems:items contentRect: [window frame] overWindow:[window windowNumber]];653 CMPBlurredMenu *ret = [[CMPBlurredMenu alloc] initWithItems:items contentRect:windowRect overWindow:windowNumber]; 639 654 640 655 [overlays addObject:ret]; … … 673 688 { 674 689 [self closeAllOverlays]; 675 [window close];676 690 return YES; 677 691 } -
trunk/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDWindowCreationAction.m
r1286 r1289 25 25 #import "CMPScreenReleaseAction.h" 26 26 #import "CoreGraphicsServices.h" 27 #import "CMPOverlayModeAction.h"28 27 #import "CMPATVVersion.h" 29 28 #import "CMPDVDPlayer.h" … … 42 41 return self; 43 42 44 // screenRelease = [[CMPOverlayModeAction alloc] initWithController:controller andSettings:settings];45 43 screenRelease = [[CMPScreenReleaseAction alloc] initWithController:controller andSettings:settings]; 46 44 … … 123 121 CGContextRelease(ctx); 124 122 125 overlayAction = [[CMPOverlayAction alloc] initWithController:nil andSettings:[NSDictionary dictionaryWithObjectsAndKeys: dvdWindow, CMPOverlayActionWindowKey, nil]];123 overlayAction = [[CMPOverlayAction alloc] initWithController:nil andSettings:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:[dvdWindow windowNumber]], CMPOverlayActionWindowNumberKey, [NSValue valueWithRect:[dvdWindow frame]], CMPOverlayActionWindowRectKey, nil]]; 126 124 [overlayAction openWithError:nil]; 127 125
