1 /* $Id: PictureController.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>
13 #define HB_NUM_HBLIB_PICTURES 20 // # of preview pictures libhb should generate
15 @interface PictureController : NSWindowController
17 hb_handle_t * fHandle;
20 NSMutableDictionary * fPicturePreviews; // NSImages, one for each preview libhb creates, created lazily
23 IBOutlet NSImageView * fPictureView;
24 IBOutlet NSBox * fPictureViewArea;
25 IBOutlet NSTextField * fWidthField;
26 IBOutlet NSStepper * fWidthStepper;
27 IBOutlet NSTextField * fHeightField;
28 IBOutlet NSStepper * fHeightStepper;
29 IBOutlet NSButton * fRatioCheck;
30 IBOutlet NSMatrix * fCropMatrix;
31 IBOutlet NSTextField * fCropTopField;
32 IBOutlet NSStepper * fCropTopStepper;
33 IBOutlet NSTextField * fCropBottomField;
34 IBOutlet NSStepper * fCropBottomStepper;
35 IBOutlet NSTextField * fCropLeftField;
36 IBOutlet NSStepper * fCropLeftStepper;
37 IBOutlet NSTextField * fCropRightField;
38 IBOutlet NSStepper * fCropRightStepper;
39 IBOutlet NSPopUpButton * fDeinterlacePopUp;
40 IBOutlet NSButton * fDecombCheck;
41 IBOutlet NSButton * fDetelecineCheck;
42 IBOutlet NSButton * fDeblockCheck;
43 IBOutlet NSTextField * fDeblockField;
44 IBOutlet NSSlider * fDeblockSlider;
45 IBOutlet NSPopUpButton * fDenoisePopUp;
46 IBOutlet NSPopUpButton * fAnamorphicPopUp;
47 IBOutlet NSSlider * fPictureSlider;
48 IBOutlet NSTextField * fInfoField;
53 BOOL allowLooseAnamorphic;
54 int output_width, output_height, output_par_width, output_par_height;
56 /* used to track the previous state of the keep aspect
57 ratio checkbox when turning anamorphic on, so it can be
58 returned to the previous state when anamorphic is turned
60 BOOL keepAspectRatioPreviousState;
68 } fPictureFilterSettings;
73 IBOutlet NSButton * fCreatePreviewMovieButton;
74 IBOutlet NSButton * fShowPreviewMovieButton;
75 NSString * fPreviewMoviePath;
76 IBOutlet NSProgressIndicator * fMovieCreationProgressIndicator;
77 hb_handle_t * fPreviewLibhb; // private libhb for creating previews
78 NSTimer * fLibhbTimer; // timer for retrieving state from libhb
79 IBOutlet NSTextField * fPreviewMovieStatusField;
80 BOOL play_movie; // flag used to determine whether or not to automatically play the movie when done.
81 IBOutlet QTMovieView * fMovieView;
82 IBOutlet NSPopUpButton * fPreviewMovieLengthPopUp; // popup of choices for length of preview in seconds
84 - (id)initWithDelegate:(id)del;
86 - (void) SetHandle: (hb_handle_t *) handle;
87 - (void) SetTitle: (hb_title_t *) title;
88 - (void) setInitialPictureFilters;
89 - (void) displayPreview;
91 - (IBAction) SettingsChanged: (id) sender;
92 - (IBAction) pictureSliderChanged: (id) sender;
95 - (void) startReceivingLibhbNotifications;
96 - (void) stopReceivingLibhbNotifications;
98 - (IBAction) createMoviePreview: (id) sender;
99 - (void) libhbStateChanged: (hb_state_t &) state;
100 - (IBAction) showMoviePreview: (NSString *) path;
101 - (IBAction) previewDurationPopUpChanged: (id) sender;
104 - (IBAction) ClosePanel: (id) sender;
107 - (void) setAutoCrop: (BOOL) setting;
109 - (BOOL) allowLooseAnamorphic;
110 - (void) setAllowLooseAnamorphic: (BOOL) setting;
111 - (IBAction) deblockSliderChanged: (id) sender;
113 - (void) setDetelecine: (int) setting;
115 - (void) setDeinterlace: (int) setting;
117 - (void) setDecomb: (int) setting;
119 - (void) setDenoise: (int) setting;
121 - (void) setDeblock: (int) setting;
123 - (IBAction)showPreviewPanel: (id)sender forTitle: (hb_title_t *)title;
125 + (NSImage *) makeImageForPicture: (int)pictureIndex
126 libhb:(hb_handle_t*)handle
127 title:(hb_title_t*)title
128 removeBorders:(BOOL)removeBorders;
129 - (NSImage *) imageForPicture: (int) pictureIndex;
130 - (void) purgeImageCache;
133 @interface NSObject (PictureControllertDelegateMethod)
134 - (void)pictureSettingsDidChange;
135 - (void)prepareJobForPreview;