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;
36 IBOutlet NSTextField * fscaleInfoField;
44 int output_width, output_height, output_par_width, output_par_height;
47 /* Hud Control Overlay */
51 /* Full Screen Mode Toggle */
52 IBOutlet NSButton * fFullScreenToggleButton;
53 IBOutlet NSButton * fScaleToScreenToggleButton;
54 IBOutlet NSButton * fPictureSettingsToggleButton;
58 IBOutlet NSButton * fCreatePreviewMovieButton;
59 IBOutlet NSButton * fCancelPreviewMovieButton;
60 IBOutlet NSButton * fShowPreviewMovieButton;
61 NSString * fPreviewMoviePath;
62 IBOutlet NSProgressIndicator * fMovieCreationProgressIndicator;
63 hb_handle_t * fPreviewLibhb; // private libhb for creating previews
64 NSTimer * fLibhbTimer; // timer for retrieving state from libhb
65 IBOutlet NSTextField * fPreviewMovieStatusField;
66 BOOL play_movie; // flag used to determine whether or not to automatically play the movie when done.
67 IBOutlet QTMovieView * fMovieView;
68 IBOutlet NSPopUpButton * fPreviewMovieLengthPopUp; // popup of choices for length of preview in seconds
72 - (void) SetHandle: (hb_handle_t *) handle;
73 - (void) SetTitle: (hb_title_t *) title;
74 - (void)setHBController: (HBController *)controller;
75 - (IBAction) showPreviewWindow: (id)sender;
76 - (BOOL)acceptsMouseMovedEvents;
77 - (void) displayPreview;
79 - (void) showHideHudControls;
80 - (IBAction) SettingsChanged: (id) sender;
81 - (IBAction) pictureSliderChanged: (id) sender;
82 - (IBAction)showPictureSettings:(id)sender;
83 - (NSString*) pictureSizeInfoString;
86 - (IBAction)toggleScreenMode:(id)sender;
87 - (IBAction)toggleScaleToScreen:(id)sender;
89 - (IBAction)goFullScreen:(id)sender;
90 - (IBAction)goWindowedScreen:(id)sender;
93 - (void) startHudTimer;
94 - (void) stopHudTimer;
97 - (void) startReceivingLibhbNotifications;
98 - (void) stopReceivingLibhbNotifications;
100 - (IBAction) createMoviePreview: (id) sender;
101 - (void) libhbStateChanged: (hb_state_t &) state;
102 - (IBAction) showMoviePreview: (NSString *) path;
103 - (IBAction) previewDurationPopUpChanged: (id) sender;
106 - (IBAction)showPreviewPanel: (id)sender forTitle: (hb_title_t *)title;
108 + (NSImage *) makeImageForPicture: (int)pictureIndex
109 libhb:(hb_handle_t*)handle
110 title:(hb_title_t*)title;
111 - (NSImage *) imageForPicture: (int) pictureIndex;
112 - (void) purgeImageCache;