- (void)windowWillClose:(NSNotification *)aNotification
{
+
+
/* Upon Closing the picture window, we make sure we clean up any
* preview movie that might be playing
*/
[fPictureView setHidden:NO];
[fMovieView pause:nil];
[fMovieView setHidden:YES];
- if (isFullScreen)
- {
- [self goWindowedScreen:nil];
- }
isFullScreen = NO;
hudTimerSeconds = 0;
- (BOOL)windowShouldClose:(id)fPictureWindow
{
- return YES;
+
+ return YES;
}
- (void) dealloc
[fMovieCreationProgressIndicator setHidden: YES];
[fPictureView setHidden:NO];
-
[fPictureView setImage: [self imageForPicture: fPicture]];
-
-
NSSize displaySize = NSMakeSize( ( CGFloat )fTitle->width, ( CGFloat )fTitle->height );
/* Set the picture size display fields below the Preview Picture*/
if( fTitle->job->anamorphic.mode == 1 ) // Original PAR Implementation
output_height = fTitle->height-fTitle->job->crop[0]-fTitle->job->crop[1];
display_width = output_width * fTitle->job->anamorphic.par_width / fTitle->job->anamorphic.par_height;
[fInfoField setStringValue:[NSString stringWithFormat:
- @"Source: %dx%d, Output: %dx%d, Anamorphic: %dx%d",
+ @"Source: %dx%d, Output: %dx%d, Anamorphic: %dx%d Strict",
fTitle->width, fTitle->height, output_width, output_height, display_width, output_height]];
displaySize.width *= ( ( CGFloat )fTitle->job->anamorphic.par_width ) / ( ( CGFloat )fTitle->job->anamorphic.par_height );
}
hb_set_anamorphic_size(job, &output_width, &output_height, &output_par_width, &output_par_height);
display_width = output_width * output_par_width / output_par_height;
[fInfoField setStringValue:[NSString stringWithFormat:
- @"Source: %dx%d, Output: %dx%d, Anamorphic: %dx%d",
+ @"Source: %dx%d, Output: %dx%d, Anamorphic: %dx%d Loose",
fTitle->width, fTitle->height, output_width, output_height, display_width, output_height]];
displaySize.width = display_width;
@"Source: %dx%d, Output: %dx%d", fTitle->width, fTitle->height,
fTitle->job->width, fTitle->job->height]];
}
-
+
+
NSSize viewSize = [self optimalViewSizeForImageSize:displaySize];
/* we also need to take into account scaling to full screen to activate switching the view size */
if( [self viewNeedsToResizeToSize:viewSize])
isFullScreen = NO;
scaleToScreen = NO;
hudTimerSeconds = 0;
+ [self pictureSliderChanged:nil];
[self startHudTimer];
}
}
+- (NSString*) pictureSizeInfoString
+{
+ return [fInfoField stringValue];
+}
+
- (IBAction)showPictureSettings:(id)sender
{
[fHBController showPicturePanel:self];
- (IBAction)goFullScreen:(id)sender
{
// Get the screen information.
- NSScreen* mainScreen = [NSScreen mainScreen];
+ NSScreen* mainScreen = [fPreviewWindow screen];
NSDictionary* screenInfo = [mainScreen deviceDescription];
NSNumber* screenID = [screenInfo objectForKey:@"NSScreenNumber"];
// Capture the screen.
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO
- screen:[NSScreen mainScreen]];
+ screen:mainScreen];
// Establish the window attributes.
[fFullScreenWindow setReleasedWhenClosed:NO];
[fFullScreenWindow setContentView:fPictureViewArea];
[fPictureViewArea setNeedsDisplay:YES];
- // Center the window
-
/* Better to center the window using the screen's frame
* and the windows origin. Note that we should take into
* account the auto sizing and alignment that occurs in
* setViewSize each time the preview changes.
+ * Note: by using [fFullScreenWindow screen] (instead of
+ * [NSScreen mainScreen]) in referencing the screen
+ * coordinates, the full screen window will show up on
+ * whichever display was being used in windowed mode
+ * on multi-display systems
*/
- NSSize screenSize = [[NSScreen mainScreen] frame].size;
+ NSSize screenSize = [[fFullScreenWindow screen] frame].size;
NSSize windowSize = [fFullScreenWindow frame].size;
NSPoint windowOrigin = [fFullScreenWindow frame].origin;
/* Adjust our origin y (vertical) based on the screen height */
- windowOrigin.y = (screenSize.height - windowSize.height) / 2.0;
- windowOrigin.x = (screenSize.width - windowSize.width) / 2.0;
+ windowOrigin.y += (screenSize.height - windowSize.height) / 2.0;
+ windowOrigin.x += (screenSize.width - windowSize.width) / 2.0;
[fFullScreenWindow setFrameOrigin:windowOrigin];
-
-
/* lets kill the timer for now */
[self stopReceivingLibhbNotifications];
// Show the window.
[fFullScreenWindow makeKeyAndOrderFront:self];
+
/* Change the name of fFullScreenToggleButton appropriately */
[fFullScreenToggleButton setTitle: @"Windowed"];
}
}
+// Title-less windows normally don't receive key presses, override this
+- (BOOL)canBecomeKeyWindow
+{
+ return YES;
+}
+
+// Title-less windows normally can't become main which means that another
+// non-fullscreen window will have the "active" titlebar in expose. Bad, fix it.
+- (BOOL)canBecomeMainWindow
+{
+ return YES;
+}
+
+
- (IBAction)goWindowedScreen:(id)sender
{
[fMovieView setMovie:nil];
aMovie = [QTMovie movieWithFile:path error:nil];
-
+
/* we get some size information from the preview movie */
- Rect movieBox;
- GetMovieBox ([aMovie quickTimeMovie], &movieBox);
+ NSSize movieSize= [[aMovie attributeForKey:QTMovieNaturalSizeAttribute] sizeValue];
movieBounds = [fMovieView movieBounds];
- movieBounds.size.height = movieBox.bottom - movieBox.top;
-
+ movieBounds.size.height = movieSize.height;
+
if ([fMovieView isControllerVisible])
movieBounds.size.height += [fMovieView controllerBarHeight];
/* since for whatever the reason I cannot seem to get the [fMovieView controllerBarHeight]
* For now just use 15 for additional height as it seems to line up well
*/
movieBounds.size.height += 15;
-
- movieBounds.size.width = movieBox.right - movieBox.left;
-
+
+ movieBounds.size.width = movieSize.width;
+
/* We need to find out if the preview movie needs to be scaled down so
* that it doesn't overflow our available viewing container (just like for image
* in -displayPreview) for HD sources, etc. [fPictureViewArea frame].size.height*/