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>
15 #define HB_NUM_HBLIB_PICTURES 20 // # of preview pictures libhb should generate
17 @interface PictureController : NSWindowController
19 hb_handle_t * fHandle;
22 HBController *fHBController; // reference to HBController
23 IBOutlet NSWindow * fPictureWindow;
24 NSMutableDictionary * fPicturePreviews; // NSImages, one for each preview libhb creates, created lazily
27 IBOutlet NSImageView * fPictureView;
28 IBOutlet NSBox * fPictureViewArea;
29 IBOutlet NSTextField * fWidthField;
30 IBOutlet NSStepper * fWidthStepper;
31 IBOutlet NSTextField * fHeightField;
32 IBOutlet NSStepper * fHeightStepper;
33 IBOutlet NSButton * fRatioCheck;
34 IBOutlet NSMatrix * fCropMatrix;
35 IBOutlet NSTextField * fCropTopField;
36 IBOutlet NSStepper * fCropTopStepper;
37 IBOutlet NSTextField * fCropBottomField;
38 IBOutlet NSStepper * fCropBottomStepper;
39 IBOutlet NSTextField * fCropLeftField;
40 IBOutlet NSStepper * fCropLeftStepper;
41 IBOutlet NSTextField * fCropRightField;
42 IBOutlet NSStepper * fCropRightStepper;
43 IBOutlet NSPopUpButton * fDeinterlacePopUp;
44 IBOutlet NSButton * fDecombCheck;
45 IBOutlet NSButton * fDetelecineCheck;
46 IBOutlet NSButton * fDeblockCheck;
47 IBOutlet NSTextField * fDeblockField;
48 IBOutlet NSSlider * fDeblockSlider;
49 IBOutlet NSPopUpButton * fDenoisePopUp;
50 IBOutlet NSPopUpButton * fAnamorphicPopUp;
51 IBOutlet NSSlider * fPictureSlider;
52 IBOutlet NSTextField * fInfoField;
57 BOOL allowLooseAnamorphic;
58 int output_width, output_height, output_par_width, output_par_height;
60 /* used to track the previous state of the keep aspect
61 ratio checkbox when turning anamorphic on, so it can be
62 returned to the previous state when anamorphic is turned
64 BOOL keepAspectRatioPreviousState;
72 } fPictureFilterSettings;
77 IBOutlet NSButton * fCreatePreviewMovieButton;
78 IBOutlet NSButton * fShowPreviewMovieButton;
79 NSString * fPreviewMoviePath;
80 IBOutlet NSProgressIndicator * fMovieCreationProgressIndicator;
81 hb_handle_t * fPreviewLibhb; // private libhb for creating previews
82 NSTimer * fLibhbTimer; // timer for retrieving state from libhb
83 IBOutlet NSTextField * fPreviewMovieStatusField;
84 BOOL play_movie; // flag used to determine whether or not to automatically play the movie when done.
85 IBOutlet QTMovieView * fMovieView;
86 IBOutlet NSPopUpButton * fPreviewMovieLengthPopUp; // popup of choices for length of preview in seconds
90 - (void) SetHandle: (hb_handle_t *) handle;
91 - (void) SetTitle: (hb_title_t *) title;
92 - (void)setHBController: (HBController *)controller;
93 - (IBAction) showPictureWindow: (id)sender;
95 - (void) setInitialPictureFilters;
96 - (void) displayPreview;
98 - (IBAction) SettingsChanged: (id) sender;
99 - (IBAction) pictureSliderChanged: (id) sender;
102 - (void) startReceivingLibhbNotifications;
103 - (void) stopReceivingLibhbNotifications;
105 - (IBAction) createMoviePreview: (id) sender;
106 - (void) libhbStateChanged: (hb_state_t &) state;
107 - (IBAction) showMoviePreview: (NSString *) path;
108 - (IBAction) previewDurationPopUpChanged: (id) sender;
111 - (void) setAutoCrop: (BOOL) setting;
113 - (BOOL) allowLooseAnamorphic;
114 - (void) setAllowLooseAnamorphic: (BOOL) setting;
115 - (IBAction) deblockSliderChanged: (id) sender;
117 - (void) setDetelecine: (int) setting;
119 - (void) setDeinterlace: (int) setting;
121 - (void) setDecomb: (int) setting;
123 - (void) setDenoise: (int) setting;
125 - (void) setDeblock: (int) setting;
127 - (IBAction)showPreviewPanel: (id)sender forTitle: (hb_title_t *)title;
129 + (NSImage *) makeImageForPicture: (int)pictureIndex
130 libhb:(hb_handle_t*)handle
131 title:(hb_title_t*)title
132 removeBorders:(BOOL)removeBorders;
133 - (NSImage *) imageForPicture: (int) pictureIndex;
134 - (void) purgeImageCache;