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 NSBox * fPictureSizeBox;
30 IBOutlet NSBox * fPictureCropBox;
31 IBOutlet NSBox * fPictureFilterBox;
32 IBOutlet NSTextField * fWidthField;
33 IBOutlet NSStepper * fWidthStepper;
34 IBOutlet NSTextField * fHeightField;
35 IBOutlet NSStepper * fHeightStepper;
36 IBOutlet NSButton * fRatioCheck;
37 IBOutlet NSMatrix * fCropMatrix;
38 IBOutlet NSTextField * fCropTopField;
39 IBOutlet NSStepper * fCropTopStepper;
40 IBOutlet NSTextField * fCropBottomField;
41 IBOutlet NSStepper * fCropBottomStepper;
42 IBOutlet NSTextField * fCropLeftField;
43 IBOutlet NSStepper * fCropLeftStepper;
44 IBOutlet NSTextField * fCropRightField;
45 IBOutlet NSStepper * fCropRightStepper;
46 IBOutlet NSPopUpButton * fDeinterlacePopUp;
47 IBOutlet NSButton * fDecombCheck;
48 IBOutlet NSButton * fDetelecineCheck;
49 IBOutlet NSButton * fDeblockCheck;
50 IBOutlet NSTextField * fDeblockField;
51 IBOutlet NSSlider * fDeblockSlider;
52 IBOutlet NSPopUpButton * fDenoisePopUp;
53 IBOutlet NSPopUpButton * fAnamorphicPopUp;
54 IBOutlet NSSlider * fPictureSlider;
55 IBOutlet NSTextField * fInfoField;
60 BOOL allowLooseAnamorphic;
61 int output_width, output_height, output_par_width, output_par_height;
63 /* used to track the previous state of the keep aspect
64 ratio checkbox when turning anamorphic on, so it can be
65 returned to the previous state when anamorphic is turned
67 BOOL keepAspectRatioPreviousState;
75 } fPictureFilterSettings;
80 IBOutlet NSButton * fCreatePreviewMovieButton;
81 IBOutlet NSButton * fShowPreviewMovieButton;
82 NSString * fPreviewMoviePath;
83 IBOutlet NSProgressIndicator * fMovieCreationProgressIndicator;
84 hb_handle_t * fPreviewLibhb; // private libhb for creating previews
85 NSTimer * fLibhbTimer; // timer for retrieving state from libhb
86 IBOutlet NSTextField * fPreviewMovieStatusField;
87 BOOL play_movie; // flag used to determine whether or not to automatically play the movie when done.
88 IBOutlet QTMovieView * fMovieView;
89 IBOutlet NSPopUpButton * fPreviewMovieLengthPopUp; // popup of choices for length of preview in seconds
93 - (void) SetHandle: (hb_handle_t *) handle;
94 - (void) SetTitle: (hb_title_t *) title;
95 - (void)setHBController: (HBController *)controller;
96 - (IBAction) showPictureWindow: (id)sender;
98 - (void) setInitialPictureFilters;
99 - (void) displayPreview;
101 - (IBAction) SettingsChanged: (id) sender;
102 - (IBAction) pictureSliderChanged: (id) sender;
105 - (void) startReceivingLibhbNotifications;
106 - (void) stopReceivingLibhbNotifications;
108 - (IBAction) createMoviePreview: (id) sender;
109 - (void) libhbStateChanged: (hb_state_t &) state;
110 - (IBAction) showMoviePreview: (NSString *) path;
111 - (IBAction) previewDurationPopUpChanged: (id) sender;
114 - (void) setAutoCrop: (BOOL) setting;
116 - (BOOL) allowLooseAnamorphic;
117 - (void) setAllowLooseAnamorphic: (BOOL) setting;
118 - (IBAction) deblockSliderChanged: (id) sender;
120 - (void) setDetelecine: (int) setting;
122 - (void) setDeinterlace: (int) setting;
124 - (void) setDecomb: (int) setting;
126 - (void) setDenoise: (int) setting;
128 - (void) setDeblock: (int) setting;
130 - (IBAction)showPreviewPanel: (id)sender forTitle: (hb_title_t *)title;
132 + (NSImage *) makeImageForPicture: (int)pictureIndex
133 libhb:(hb_handle_t*)handle
134 title:(hb_title_t*)title
135 removeBorders:(BOOL)removeBorders;
136 - (NSImage *) imageForPicture: (int) pictureIndex;
137 - (void) purgeImageCache;