OSDN Git Service

LinGui: fix me_method/me_range dependency
[handbrake-jp/handbrake-jp-git.git] / macosx / PictureController.h
1 /* $Id: PictureController.h,v 1.6 2005/04/14 20:40:05 titer Exp $
2
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. */
6
7 #import <Cocoa/Cocoa.h>
8
9 #include "hb.h"
10 /* Needed for Quicktime movie previews */
11 #import <QTKit/QTKit.h> 
12
13 #define HB_NUM_HBLIB_PICTURES      20   // # of preview pictures libhb should generate
14
15 @interface PictureController : NSWindowController
16 {
17     hb_handle_t              * fHandle;
18     hb_title_t               * fTitle;
19
20     NSMutableDictionary      * fPicturePreviews;        // NSImages, one for each preview libhb creates, created lazily
21     int                        fPicture;
22
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;
49         
50     int     MaxOutputWidth;
51     int     MaxOutputHeight;
52     BOOL    autoCrop;
53     BOOL    allowLooseAnamorphic;
54     int output_width, output_height, output_par_width, output_par_height;
55     int display_width;
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
59     off */
60     BOOL    keepAspectRatioPreviousState; 
61     
62     struct {
63         int     detelecine;
64         int     deinterlace;
65         int     decomb;
66         int     denoise;
67         int     deblock;
68     } fPictureFilterSettings;
69
70     id delegate;
71     
72     /* Movie Previews */
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
83 }
84 - (id)initWithDelegate:(id)del;
85
86 - (void) SetHandle: (hb_handle_t *) handle;
87 - (void) SetTitle:  (hb_title_t *)  title;
88 - (void) setInitialPictureFilters;
89 - (void) displayPreview;
90
91 - (IBAction) SettingsChanged: (id) sender;
92 - (IBAction) pictureSliderChanged: (id) sender;
93
94 /* Movie Previews */
95 - (void) startReceivingLibhbNotifications;
96 - (void) stopReceivingLibhbNotifications;
97
98 - (IBAction) createMoviePreview: (id) sender;
99 - (void) libhbStateChanged: (hb_state_t &) state;
100 - (IBAction) showMoviePreview: (NSString *) path;
101 - (IBAction) previewDurationPopUpChanged: (id) sender;
102
103
104 - (IBAction) ClosePanel: (id) sender;
105
106 - (BOOL) autoCrop;
107 - (void) setAutoCrop: (BOOL) setting;
108
109 - (BOOL) allowLooseAnamorphic;
110 - (void) setAllowLooseAnamorphic: (BOOL) setting;
111 - (IBAction) deblockSliderChanged: (id) sender;
112 - (int) detelecine;
113 - (void) setDetelecine: (int) setting;
114 - (int) deinterlace;
115 - (void) setDeinterlace: (int) setting;
116 - (int) decomb;
117 - (void) setDecomb: (int) setting;
118 - (int) denoise;
119 - (void) setDenoise: (int) setting;
120 - (int) deblock;
121 - (void) setDeblock: (int) setting;
122
123 - (IBAction)showPreviewPanel: (id)sender forTitle: (hb_title_t *)title;
124
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;
131 @end
132
133 @interface NSObject (PictureControllertDelegateMethod)
134 - (void)pictureSettingsDidChange;
135 - (void)prepareJobForPreview;
136 @end