OSDN Git Service

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