summaryrefslogtreecommitdiffstats
path: root/macosx/HBPreviewController.h
diff options
context:
space:
mode:
authordynaflash <[email protected]>2009-01-12 00:07:38 +0000
committerdynaflash <[email protected]>2009-01-12 00:07:38 +0000
commit7e73b3884143ae1fb8c8cd9a384c1ef959fa0a86 (patch)
tree3921b193dd1dbf5aafbe206d525ad4d40bf702fb /macosx/HBPreviewController.h
parentf2bd5d8c9da510bfc2969d0cf23a68196d61faa5 (diff)
MacGui: Separate Picture Settings and Preview Window Initial Implementation
- Picture Settings is now a hud style inspector panel: -- Allows more room to be displayed along with Main Window. -- Has button (though ugly ... for now) to open the preview window. - Separate Preview Window: -- Preview Window can now show the entire preview content via a hud style overlay controller (ala iTunes, DvdPlayer controls) activated by mouse movement. -- Has button to allow opening the Picture Settings inspector. -- Full Screen Mode (ala iTunes, DvdPlayer) which should help for max preview size for HD sources. - Note: all hud style controls in this implementation are created only using core animation filters, I decided against a third party hud control framework, though one can certainly be implemented at any time. - Known Issues: -- WARNING: Quitting HB while in full screen mode will crash the macgui. -- The hud overlay controls in the Preview Window will align kind of wonky when the resolution is scaled way below the source. -- Ideally, after moving the mouse within the preview area then stopping, after a certain amount of time the hud overlay control box should disappear. -- Hud style controls still need alot of development to fit within the HIG. -- Need a keboard shortcut for the Preview Window. -- As usual with initial implementations there are likely many more Bugs/Issues. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2076 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBPreviewController.h')
-rw-r--r--macosx/HBPreviewController.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/macosx/HBPreviewController.h b/macosx/HBPreviewController.h
new file mode 100644
index 000000000..21e262bc2
--- /dev/null
+++ b/macosx/HBPreviewController.h
@@ -0,0 +1,99 @@
+/* $Id: HBPreviewController.h,v 1.6 2005/04/14 20:40:05 titer Exp $
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
+
+#import <Cocoa/Cocoa.h>
+
+#include "hb.h"
+/* Needed for Quicktime movie previews */
+#import <QTKit/QTKit.h>
+
+@class HBController;
+
+#define HB_NUM_HBLIB_PICTURES 20 // # of preview pictures libhb should generate
+
+@interface PreviewController : NSWindowController
+{
+ hb_handle_t * fHandle;
+ hb_title_t * fTitle;
+
+ HBController *fHBController; // reference to HBController
+
+ IBOutlet NSWindow * fPreviewWindow;
+ NSWindow * fFullScreenWindow; // Full Screen window
+ NSMutableDictionary * fPicturePreviews; // NSImages, one for each preview libhb creates, created lazily
+ int fPicture;
+
+ IBOutlet NSImageView * fPictureView;
+ IBOutlet NSBox * fPictureViewArea;
+ IBOutlet NSBox * fPictureControlBox;
+ IBOutlet NSBox * fEncodingControlBox;
+
+ IBOutlet NSSlider * fPictureSlider;
+ IBOutlet NSTextField * fInfoField;
+
+ BOOL isEncoding;
+
+
+ int MaxOutputWidth;
+ int MaxOutputHeight;
+
+ int output_width, output_height, output_par_width, output_par_height;
+ int display_width;
+
+ /* Full Screen Mode Toggle */
+ IBOutlet NSButton * fFullScreenToggleButton;
+ IBOutlet NSButton * fPictureSettingsToggleButton;
+ BOOL isFullScreen;
+ /* Movie Previews */
+ IBOutlet NSButton * fCreatePreviewMovieButton;
+ IBOutlet NSButton * fCancelPreviewMovieButton;
+ IBOutlet NSButton * fShowPreviewMovieButton;
+ NSString * fPreviewMoviePath;
+ IBOutlet NSProgressIndicator * fMovieCreationProgressIndicator;
+ hb_handle_t * fPreviewLibhb; // private libhb for creating previews
+ NSTimer * fLibhbTimer; // timer for retrieving state from libhb
+ IBOutlet NSTextField * fPreviewMovieStatusField;
+ BOOL play_movie; // flag used to determine whether or not to automatically play the movie when done.
+ IBOutlet QTMovieView * fMovieView;
+ IBOutlet NSPopUpButton * fPreviewMovieLengthPopUp; // popup of choices for length of preview in seconds
+}
+- (id)init;
+
+- (void) SetHandle: (hb_handle_t *) handle;
+- (void) SetTitle: (hb_title_t *) title;
+- (void)setHBController: (HBController *)controller;
+- (IBAction) showPreviewWindow: (id)sender;
+- (BOOL)acceptsMouseMovedEvents;
+- (void) displayPreview;
+- (void) showHideHudControls;
+- (IBAction) SettingsChanged: (id) sender;
+- (IBAction) pictureSliderChanged: (id) sender;
+- (IBAction)showPictureSettings:(id)sender;
+/* Full Screen */
+- (IBAction)toggleScreenMode:(id)sender;
+- (IBAction)goFullScreen:(id)sender;
+- (IBAction)goWindowedScreen:(id)sender;
+
+/* Movie Previews */
+- (void) startReceivingLibhbNotifications;
+- (void) stopReceivingLibhbNotifications;
+
+- (IBAction) createMoviePreview: (id) sender;
+- (void) libhbStateChanged: (hb_state_t &) state;
+- (IBAction) showMoviePreview: (NSString *) path;
+- (IBAction) previewDurationPopUpChanged: (id) sender;
+
+
+- (IBAction)showPreviewPanel: (id)sender forTitle: (hb_title_t *)title;
+
++ (NSImage *) makeImageForPicture: (int)pictureIndex
+ libhb:(hb_handle_t*)handle
+ title:(hb_title_t*)title
+ removeBorders:(BOOL)removeBorders;
+- (NSImage *) imageForPicture: (int) pictureIndex;
+- (void) purgeImageCache;
+@end
+