OSDN Git Service

MacGui: finishes out the b-frame x264 options by adding widgets for bime and direct...
[handbrake-jp/handbrake-jp-git.git] / macosx / Controller.h
1 /* $Id: Controller.h,v 1.35 2005/08/01 14:29:50 titer Exp $
2
3    This file is part of the HandBrake source code.
4    Homepage: <http://handbrake.m0k.org/>.
5    It may be used under the terms of the GNU General Public License. */
6
7 #include <Cocoa/Cocoa.h>
8 #include <Growl/Growl.h>
9
10 #include "hb.h"
11
12
13 #include "ChapterTitles.h"
14 #include "ScanController.h"
15 #include "PictureController.h"
16 #include "QueueController.h"
17
18 @interface HBController : NSObject <GrowlApplicationBridgeDelegate>
19
20 {
21     IBOutlet NSWindow            * fWindow;
22
23     /* Scan panel */
24         IBOutlet ScanController      * fScanController;
25     IBOutlet NSPanel             * fScanPanel;
26
27     /* Picture panel */
28     IBOutlet PictureController   * fPictureController;
29     IBOutlet NSPanel             * fPicturePanel;
30
31     /* Queue panel */
32     IBOutlet QueueController     * fQueueController;
33     IBOutlet NSPanel             * fQueuePanel;
34     IBOutlet NSTextField         * fQueueStatus;
35     IBOutlet NSButton            * fQueueAddButton;
36     IBOutlet NSButton            * fQueueShowButton;
37
38     /* Source box */
39     IBOutlet NSTextField         * fSrcDVD1Field;
40     IBOutlet NSTextField         * fSrcDVD2Field;
41     IBOutlet NSTextField         * fSrcTitleField;
42     IBOutlet NSPopUpButton       * fSrcTitlePopUp;
43     IBOutlet NSTextField         * fSrcChapterField;
44     IBOutlet NSPopUpButton       * fSrcChapterStartPopUp;
45     IBOutlet NSTextField         * fSrcChapterToField;
46     IBOutlet NSPopUpButton       * fSrcChapterEndPopUp;
47     IBOutlet NSTextField         * fSrcDuration1Field;
48     IBOutlet NSTextField         * fSrcDuration2Field;
49
50     /* Destination box */
51     IBOutlet NSTextField         * fDstFormatField;
52     IBOutlet NSPopUpButton       * fDstFormatPopUp;
53     IBOutlet NSTextField         * fDstCodecsField;
54     IBOutlet NSPopUpButton       * fDstCodecsPopUp;
55     IBOutlet NSTextField         * fDstFile1Field;
56     IBOutlet NSTextField         * fDstFile2Field;
57     IBOutlet NSButton            * fDstBrowseButton;
58
59     /* Video box */
60     IBOutlet NSTextField         * fVidRateField;
61     IBOutlet NSPopUpButton       * fVidRatePopUp;
62     IBOutlet NSTextField         * fVidEncoderField;
63     IBOutlet NSPopUpButton       * fVidEncoderPopUp;
64     IBOutlet NSTextField         * fVidQualityField;
65     IBOutlet NSMatrix            * fVidQualityMatrix;
66     IBOutlet NSButtonCell        * fVidTargetCell;
67     IBOutlet NSTextField         * fVidTargetSizeField;
68     IBOutlet NSButtonCell        * fVidBitrateCell;
69     IBOutlet NSTextField         * fVidBitrateField;
70     IBOutlet NSButtonCell        * fVidConstantCell;
71     IBOutlet NSSlider            * fVidQualitySlider;
72     IBOutlet NSButton            * fVidGrayscaleCheck;
73     IBOutlet NSButton            * fVidTwoPassCheck;
74
75         
76         /* Picture Settings box */
77         IBOutlet NSTextField         * fPicLabelSettings;
78         IBOutlet NSTextField         * fPicLabelSrc;
79         IBOutlet NSTextField         * fPicLabelOutp;
80         IBOutlet NSTextField         * fPicLabelAr;
81         IBOutlet NSTextField         * fPicLabelDeinter;
82         IBOutlet NSTextField         * fPicLabelSrcX;
83         IBOutlet NSTextField         * fPicLabelOutputX;
84         
85         IBOutlet NSTextField         * fPicSrcWidth;
86         IBOutlet NSTextField         * fPicSrcHeight;
87         IBOutlet NSTextField         * fPicSettingWidth;
88         IBOutlet NSTextField         * fPicSettingHeight;
89         IBOutlet NSTextField         * fPicSettingARkeep;
90         IBOutlet NSTextField         * fPicSettingPAR;
91         IBOutlet NSTextField         * fPicSettingDeinterlace;
92         IBOutlet NSTextField         * fPicSettingARkeepDsply;
93         IBOutlet NSTextField         * fPicSettingPARDsply;
94         IBOutlet NSTextField         * fPicSettingDeinterlaceDsply;
95         IBOutlet NSTextField         * fPicLabelAnamorphic;
96         IBOutlet NSTextField         * fPicLabelPAROutp;
97         IBOutlet NSTextField         * fPicLabelPAROutputX;
98         IBOutlet NSTextField         * fPicSettingPARWidth;
99         IBOutlet NSTextField         * fPicSettingPARHeight;
100     /* Picture variables */
101         int                        PicOrigOutputWidth;
102         int                        PicOrigOutputHeight;
103         
104     /* Subtitles box */
105     IBOutlet NSTextField         * fSubField;
106     IBOutlet NSPopUpButton       * fSubPopUp;
107
108     /* Audio box */
109     IBOutlet NSTextField         * fAudLang1Field;
110     IBOutlet NSPopUpButton       * fAudLang1PopUp;
111     IBOutlet NSTextField         * fAudLang2Field;
112     IBOutlet NSPopUpButton       * fAudLang2PopUp;
113         /* New Audio Mix PopUps */
114         IBOutlet NSTextField         * fAudTrack1MixLabel;
115         IBOutlet NSPopUpButton       * fAudTrack1MixPopUp;
116     IBOutlet NSTextField         * fAudTrack2MixLabel;
117         IBOutlet NSPopUpButton       * fAudTrack2MixPopUp;
118         
119         IBOutlet NSTextField         * fAudRateField;
120     IBOutlet NSPopUpButton       * fAudRatePopUp;
121     IBOutlet NSTextField         * fAudBitrateField;
122     IBOutlet NSPopUpButton       * fAudBitratePopUp;
123     
124     /* Chapters box */
125     IBOutlet NSButton            * fCreateChapterMarkers;
126     IBOutlet NSTableView         * fChapterTable;
127              ChapterTitles       * fChapterTitlesDelegate;
128
129     /* Bottom */
130     IBOutlet NSButton            * fPictureButton;
131     IBOutlet NSTextField         * fStatusField;
132     IBOutlet NSProgressIndicator * fRipIndicator;
133     IBOutlet NSButton            * fShowQuButton;
134     IBOutlet NSButton            * fAddToQuButton;
135     IBOutlet NSButton            * fPauseButton;
136     IBOutlet NSButton            * fRipButton;
137
138         /* Advanced Tab for opts fX264optView*/
139         IBOutlet NSView              * fX264optView;
140         IBOutlet NSTextField         * fX264optViewTitleLabel;
141         IBOutlet NSTextField         * fDisplayX264OptionsLabel;
142         IBOutlet NSTextField         * fDisplayX264Options;
143         IBOutlet NSTextField         * fX264optBframesLabel;
144         IBOutlet NSPopUpButton       * fX264optBframesPopUp;
145         IBOutlet NSTextField         * fX264optRefLabel;
146         IBOutlet NSPopUpButton       * fX264optRefPopUp;
147         IBOutlet NSTextField         * fX264optNfpskipLabel;
148         IBOutlet NSPopUpButton       * fX264optNfpskipPopUp;
149         IBOutlet NSTextField         * fX264optNodctdcmtLabel;
150         IBOutlet NSPopUpButton       * fX264optNodctdcmtPopUp;
151         IBOutlet NSTextField         * fX264optSubmeLabel;
152         IBOutlet NSPopUpButton       * fX264optSubmePopUp;
153         IBOutlet NSTextField         * fX264optTrellisLabel;
154         IBOutlet NSPopUpButton       * fX264optTrellisPopUp;
155     IBOutlet NSTextField         * fX264optMixedRefsLabel;
156     IBOutlet NSPopUpButton       * fX264optMixedRefsPopUp;
157     IBOutlet NSTextField         * fX264optMotionEstLabel;
158     IBOutlet NSPopUpButton       * fX264optMotionEstPopUp;
159     IBOutlet NSTextField         * fX264optMERangeLabel;
160     IBOutlet NSPopUpButton       * fX264optMERangePopUp;
161     IBOutlet NSTextField         * fX264optWeightBLabel;
162     IBOutlet NSPopUpButton       * fX264optWeightBPopUp;
163     IBOutlet NSTextField         * fX264optBRDOLabel;
164     IBOutlet NSPopUpButton       * fX264optBRDOPopUp;
165     IBOutlet NSTextField         * fX264optBPyramidLabel;
166     IBOutlet NSPopUpButton       * fX264optBPyramidPopUp;
167     IBOutlet NSTextField         * fX264optBiMELabel;
168     IBOutlet NSPopUpButton       * fX264optBiMEPopUp;
169     IBOutlet NSTextField         * fX264optDirectPredLabel;
170     IBOutlet NSPopUpButton       * fX264optDirectPredPopUp;
171     
172         /* User Preset variables here fPresetNewPicSettingsApply*/
173         
174         IBOutlet NSDrawer            * fPresetDrawer;
175         IBOutlet NSTextField         * fPresetNewName;
176         IBOutlet NSPopUpButton       * fPresetNewPicSettingsPopUp;
177         IBOutlet NSTextField         * fPresetSelectedDisplay;
178         
179         NSString                     * AppSupportDirectory;
180         NSString                     * UserPresetsFile;
181         NSString                     * x264ProfilesFile;
182         NSMutableArray               * UserPresets;
183         NSMutableArray               * x264Profiles;
184         NSMutableArray               * UserPresetssortedArray;
185         NSMutableDictionary          * chosenPreset;
186     int                            curUserPresetChosenNum;
187         
188     IBOutlet NSPanel             * fAddPresetPanel;
189         IBOutlet NSTableView         * tableView;
190         IBOutlet NSButton            * fPresetsAdd;
191         IBOutlet NSButton            * fPresetsDelete;
192     hb_handle_t                  * fHandle;
193         hb_title_t                   * fTitle;
194     /* integer to set to determine the previous state
195         of encode 0==idle, 1==encoding, 2==cancelled*/
196     int                            fEncodeState;
197 }
198
199 - (void)     TranslateStrings;
200
201 - (void)     UpdateUI: (NSTimer *) timer;
202 - (void)     EnableUI: (bool) enable;
203
204 - (IBAction) ShowScanPanel: (id) sender;
205
206 - (IBAction) TitlePopUpChanged: (id) sender;
207 - (IBAction) ChapterPopUpChanged: (id) sender;
208
209 - (IBAction) FormatPopUpChanged: (id) sender;
210 - (IBAction) CodecsPopUpChanged: (id) sender;
211 - (IBAction) EncoderPopUpChanged: (id) sender;
212
213 - (IBAction) SetEnabledStateOfAudioMixdownControls: (id) sender;
214 - (IBAction) AddAllAudioTracksToPopUp: (id) sender;
215 - (IBAction) SelectAudioTrackInPopUp: (id) sender searchPrefixString: (NSString *) searchPrefixString selectIndexIfNotFound: (int) selectIndexIfNotFound;
216 - (IBAction) AudioTrackPopUpChanged: (id) sender;
217 - (IBAction) AudioTrackPopUpChanged: (id) sender mixdownToUse: (int) mixdownToUse;
218 - (IBAction) AudioTrackMixdownChanged: (id) sender;
219
220 - (IBAction) BrowseFile: (id) sender;
221 - (void)     BrowseFileDone: (NSSavePanel *) sheet
222     returnCode: (int) returnCode contextInfo: (void *) contextInfo;
223
224 - (IBAction) VideoMatrixChanged: (id) sender;
225 - (IBAction) QualitySliderChanged: (id) sender;
226
227 - (IBAction) ShowPicturePanel: (id) sender;
228 - (IBAction) CalculatePictureSizing: (id) sender;
229
230
231 - (IBAction) AddToQueue: (id) sender;
232 - (IBAction) ShowQueuePanel: (id) sender;
233
234 - (IBAction) Rip: (id) sender;
235 - (void)     OverwriteAlertDone: (NSWindow *) sheet
236     returnCode: (int) returnCode contextInfo: (void *) contextInfo;
237 - (void)     UpdateAlertDone: (NSWindow *) sheet
238     returnCode: (int) returnCode contextInfo: (void *) contextInfo;
239 - (void)     _Rip;
240 - (IBAction) Cancel: (id) sender;
241 - (void)     _Cancel: (NSWindow *) sheet returnCode: (int) returnCode
242     contextInfo: (void *) contextInfo;
243 - (IBAction) Pause: (id) sender;
244
245 - (IBAction) CalculateBitrate: (id) sender;
246 - (void) controlTextDidBeginEditing: (NSNotification *) notification;
247 - (void) controlTextDidEndEditing: (NSNotification *) notification;
248 - (void) controlTextDidChange: (NSNotification *) notification;
249
250 - (IBAction) OpenHomepage: (id) sender;
251 - (IBAction) OpenForums:   (id) sender;
252 - (IBAction) OpenUserGuide:   (id) sender;
253
254 // x264 Advanced Panel Methods
255 - (IBAction) X264AdvancedOptionsSet: (id) sender;
256 - (IBAction) X264AdvancedOptionsStandardizeOptString: (id) sender;
257 - (IBAction) X264AdvancedOptionsSetCurrentSettings: (id) sender;
258 - (NSString *)  X264AdvancedOptionsStandardizeOptNames:(NSString *) cleanOptNameString;
259 - (IBAction) X264AdvancedOptionsChanged: (id) sender;
260
261 // Preset Methods Here
262 - (IBAction) CustomSettingUsed: (id) sender;
263 - (IBAction) ShowAddPresetPanel: (id) sender;
264 - (IBAction) CloseAddPresetPanel: (id) sender;
265 - (NSDictionary *)CreatePreset;
266 - (NSDictionary *)CreateIpodPreset;
267 - (NSDictionary *)CreateAppleTVPreset;
268 - (NSDictionary *)CreatePSThreePreset;  
269 - (NSDictionary *)CreatePSPPreset;
270 - (IBAction) RevertPictureSizeToMax:(id)sender;
271
272
273 - (void) savePreset;
274 - (IBAction)AddFactoryPresets:(id)sender;
275 - (IBAction)DeleteFactoryPresets:(id)sender;
276 - (IBAction)AddUserPreset:(id)sender;
277 - (void)AddPreset;
278 - (IBAction)InsertPreset:(id)sender;
279 - (IBAction)DeletePreset:(id)sender;
280 - (IBAction)tableViewSelected:(id)sender;
281 // NSTableDataSource methods
282 - (int)numberOfRowsInTableView:(NSTableView *)aTableView;
283 - (id)tableView:(NSTableView *)aTableView
284       objectValueForTableColumn:(NSTableColumn *)aTableColumn
285       row:(int)rowIndex;
286 - (void)tableView:(NSTableView *)aTableView
287         setObjectValue:(id)anObject
288         forTableColumn:(NSTableColumn *)aTableColumn
289         row:(int)rowIndex;
290 // To determine user presets cell display properties
291 - (void)tableView:(NSTableView *)aTableView
292                 willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn
293                  row:(int)rowIndex;
294
295 // Growl methods
296 - (NSDictionary *) registrationDictionaryForGrowl;
297 -(IBAction)showGrowlDoneNotification:(id)sender;
298
299 @end
300