1 /* $Id: HBPreviewController.h,v 1.6 2005/04/14 20:40:05 titer Exp $
3 This file is part of the HandBrake source code.
4 Homepage: <http://handbrake.fr/>.
5 It may be used under the terms of the GNU General Public License. */
7 #import <Cocoa/Cocoa.h>
10 /* Needed for Quicktime movie previews */
11 #import <QTKit/QTKit.h>
15 #define HB_NUM_HBLIB_PICTURES 20 // # of preview pictures libhb should generate
17 @interface PreviewController : NSWindowController
19 hb_handle_t * fHandle;
22 HBController *fHBController; // reference to HBController
24 IBOutlet NSWindow * fPreviewWindow;
25 NSWindow * fFullScreenWindow; // Full Screen window
26 NSMutableDictionary * fPicturePreviews; // NSImages, one for each preview libhb creates, created lazily
29 IBOutlet NSImageView * fPictureView;
30 IBOutlet NSBox * fPictureViewArea;
31 IBOutlet NSBox * fPictureControlBox;
32 IBOutlet NSBox * fEncodingControlBox;
34 IBOutlet NSSlider * fPictureSlider;
35 IBOutlet NSTextField * fInfoField;
43 int output_width, output_height, output_par_width, output_par_height;
46 /* Full Screen Mode Toggle */
47 IBOutlet NSButton * fFullScreenToggleButton;
48 IBOutlet NSButton * fPictureSettingsToggleButton;
51 IBOutlet NSButton * fCreatePreviewMovieButton;
52 IBOutlet NSButton * fCancelPreviewMovieButton;
53 IBOutlet NSButton * fShowPreviewMovieButton;
54 NSString * fPreviewMoviePath;
55 IBOutlet NSProgressIndicator * fMovieCreationProgressIndicator;
56 hb_handle_t * fPreviewLibhb; // private libhb for creating previews
57 NSTimer * fLibhbTimer; // timer for retrieving state from libhb
58 IBOutlet NSTextField * fPreviewMovieStatusField;
59 BOOL play_movie; // flag used to determine whether or not to automatically play the movie when done.
60 IBOutlet QTMovieView * fMovieView;
61 IBOutlet NSPopUpButton * fPreviewMovieLengthPopUp; // popup of choices for length of preview in seconds
65 - (void) SetHandle: (hb_handle_t *) handle;
66 - (void) SetTitle: (hb_title_t *) title;
67 - (void)setHBController: (HBController *)controller;
68 - (IBAction) showPreviewWindow: (id)sender;
69 - (BOOL)acceptsMouseMovedEvents;
70 - (void) displayPreview;
71 - (void) showHideHudControls;
72 - (IBAction) SettingsChanged: (id) sender;
73 - (IBAction) pictureSliderChanged: (id) sender;
74 - (IBAction)showPictureSettings:(id)sender;
76 - (IBAction)toggleScreenMode:(id)sender;
77 - (IBAction)goFullScreen:(id)sender;
78 - (IBAction)goWindowedScreen:(id)sender;
81 - (void) startReceivingLibhbNotifications;
82 - (void) stopReceivingLibhbNotifications;
84 - (IBAction) createMoviePreview: (id) sender;
85 - (void) libhbStateChanged: (hb_state_t &) state;
86 - (IBAction) showMoviePreview: (NSString *) path;
87 - (IBAction) previewDurationPopUpChanged: (id) sender;
90 - (IBAction)showPreviewPanel: (id)sender forTitle: (hb_title_t *)title;
92 + (NSImage *) makeImageForPicture: (int)pictureIndex
93 libhb:(hb_handle_t*)handle
94 title:(hb_title_t*)title
95 removeBorders:(BOOL)removeBorders;
96 - (NSImage *) imageForPicture: (int) pictureIndex;
97 - (void) purgeImageCache;