OSDN Git Service

MacGui: Picture window now uses a subclass of HBController to access the main controller.
[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 @class HBController;
14
15 #define HB_NUM_HBLIB_PICTURES      20   // # of preview pictures libhb should generate
16
17 @interface PictureController : NSWindowController
18 {
19     hb_handle_t              * fHandle;
20     hb_title_t               * fTitle;
21
22     HBController             *fHBController;        // reference to HBController
23     IBOutlet NSWindow        * fPictureWindow;
24     NSMutableDictionary      * fPicturePreviews;        // NSImages, one for each preview libhb creates, created lazily
25     int                        fPicture;
26
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;
53         
54     int     MaxOutputWidth;
55     int     MaxOutputHeight;
56     BOOL    autoCrop;
57     BOOL    allowLooseAnamorphic;
58     int output_width, output_height, output_par_width, output_par_height;
59     int display_width;
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
63     off */
64     BOOL    keepAspectRatioPreviousState; 
65     
66     struct {
67         int     detelecine;
68         int     deinterlace;
69         int     decomb;
70         int     denoise;
71         int     deblock;
72     } fPictureFilterSettings;
73
74     id delegate;
75     
76     /* Movie Previews */
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
87 }
88 - (id)init;
89
90 - (void) SetHandle: (hb_handle_t *) handle;
91 - (void) SetTitle:  (hb_title_t *)  title;
92 - (void)setHBController: (HBController *)controller;
93 - (IBAction) showPictureWindow: (id)sender;
94
95 - (void) setInitialPictureFilters;
96 - (void) displayPreview;
97
98 - (IBAction) SettingsChanged: (id) sender;
99 - (IBAction) pictureSliderChanged: (id) sender;
100
101 /* Movie Previews */
102 - (void) startReceivingLibhbNotifications;
103 - (void) stopReceivingLibhbNotifications;
104
105 - (IBAction) createMoviePreview: (id) sender;
106 - (void) libhbStateChanged: (hb_state_t &) state;
107 - (IBAction) showMoviePreview: (NSString *) path;
108 - (IBAction) previewDurationPopUpChanged: (id) sender;
109
110 - (BOOL) autoCrop;
111 - (void) setAutoCrop: (BOOL) setting;
112
113 - (BOOL) allowLooseAnamorphic;
114 - (void) setAllowLooseAnamorphic: (BOOL) setting;
115 - (IBAction) deblockSliderChanged: (id) sender;
116 - (int) detelecine;
117 - (void) setDetelecine: (int) setting;
118 - (int) deinterlace;
119 - (void) setDeinterlace: (int) setting;
120 - (int) decomb;
121 - (void) setDecomb: (int) setting;
122 - (int) denoise;
123 - (void) setDenoise: (int) setting;
124 - (int) deblock;
125 - (void) setDeblock: (int) setting;
126
127 - (IBAction)showPreviewPanel: (id)sender forTitle: (hb_title_t *)title;
128
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;
135 @end
136