OSDN Git Service

MacGui: adds mixed-refs pop-up for the advanced x264 options.
[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
158         /* User Preset variables here fPresetNewPicSettingsApply*/
159         
160         IBOutlet NSDrawer            * fPresetDrawer;
161         IBOutlet NSTextField         * fPresetNewName;
162         IBOutlet NSPopUpButton       * fPresetNewPicSettingsPopUp;
163         IBOutlet NSTextField         * fPresetSelectedDisplay;
164         
165         NSString                     * AppSupportDirectory;
166         NSString                     * UserPresetsFile;
167         NSString                     * x264ProfilesFile;
168         NSMutableArray               * UserPresets;
169         NSMutableArray               * x264Profiles;
170         NSMutableArray               * UserPresetssortedArray;
171         NSMutableDictionary          * chosenPreset;
172     int                            curUserPresetChosenNum;
173         
174     IBOutlet NSPanel             * fAddPresetPanel;
175         IBOutlet NSTableView         * tableView;
176         IBOutlet NSButton            * fPresetsAdd;
177         IBOutlet NSButton            * fPresetsDelete;
178     hb_handle_t                  * fHandle;
179         hb_title_t                   * fTitle;
180     /* integer to set to determine the previous state
181         of encode 0==idle, 1==encoding, 2==cancelled*/
182     int                            fEncodeState;
183 }
184
185 - (void)     TranslateStrings;
186
187 - (void)     UpdateUI: (NSTimer *) timer;
188 - (void)     EnableUI: (bool) enable;
189
190 - (IBAction) ShowScanPanel: (id) sender;
191
192 - (IBAction) TitlePopUpChanged: (id) sender;
193 - (IBAction) ChapterPopUpChanged: (id) sender;
194
195 - (IBAction) FormatPopUpChanged: (id) sender;
196 - (IBAction) CodecsPopUpChanged: (id) sender;
197 - (IBAction) EncoderPopUpChanged: (id) sender;
198
199 - (IBAction) SetEnabledStateOfAudioMixdownControls: (id) sender;
200 - (IBAction) AddAllAudioTracksToPopUp: (id) sender;
201 - (IBAction) SelectAudioTrackInPopUp: (id) sender searchPrefixString: (NSString *) searchPrefixString selectIndexIfNotFound: (int) selectIndexIfNotFound;
202 - (IBAction) AudioTrackPopUpChanged: (id) sender;
203 - (IBAction) AudioTrackPopUpChanged: (id) sender mixdownToUse: (int) mixdownToUse;
204 - (IBAction) AudioTrackMixdownChanged: (id) sender;
205
206 - (IBAction) BrowseFile: (id) sender;
207 - (void)     BrowseFileDone: (NSSavePanel *) sheet
208     returnCode: (int) returnCode contextInfo: (void *) contextInfo;
209
210 - (IBAction) VideoMatrixChanged: (id) sender;
211 - (IBAction) QualitySliderChanged: (id) sender;
212
213 - (IBAction) ShowPicturePanel: (id) sender;
214 - (IBAction) CalculatePictureSizing: (id) sender;
215
216
217 - (IBAction) AddToQueue: (id) sender;
218 - (IBAction) ShowQueuePanel: (id) sender;
219
220 - (IBAction) Rip: (id) sender;
221 - (void)     OverwriteAlertDone: (NSWindow *) sheet
222     returnCode: (int) returnCode contextInfo: (void *) contextInfo;
223 - (void)     UpdateAlertDone: (NSWindow *) sheet
224     returnCode: (int) returnCode contextInfo: (void *) contextInfo;
225 - (void)     _Rip;
226 - (IBAction) Cancel: (id) sender;
227 - (void)     _Cancel: (NSWindow *) sheet returnCode: (int) returnCode
228     contextInfo: (void *) contextInfo;
229 - (IBAction) Pause: (id) sender;
230
231 - (IBAction) CalculateBitrate: (id) sender;
232 - (void) controlTextDidBeginEditing: (NSNotification *) notification;
233 - (void) controlTextDidEndEditing: (NSNotification *) notification;
234 - (void) controlTextDidChange: (NSNotification *) notification;
235
236 - (IBAction) OpenHomepage: (id) sender;
237 - (IBAction) OpenForums:   (id) sender;
238 - (IBAction) OpenUserGuide:   (id) sender;
239
240 // x264 Advanced Panel Methods
241 - (IBAction) X264AdvancedOptionsSet: (id) sender;
242 - (IBAction) X264AdvancedOptionsStandardizeOptString: (id) sender;
243 - (IBAction) X264AdvancedOptionsSetCurrentSettings: (id) sender;
244 - (NSString *)  X264AdvancedOptionsStandardizeOptNames:(NSString *) cleanOptNameString;
245 - (IBAction) X264AdvancedOptionsChanged: (id) sender;
246
247 // Preset Methods Here
248 - (IBAction) CustomSettingUsed: (id) sender;
249 - (IBAction) ShowAddPresetPanel: (id) sender;
250 - (IBAction) CloseAddPresetPanel: (id) sender;
251 - (NSDictionary *)CreatePreset;
252 - (NSDictionary *)CreateIpodPreset;
253 - (NSDictionary *)CreateAppleTVPreset;
254 - (NSDictionary *)CreatePSThreePreset;  
255 - (NSDictionary *)CreatePSPPreset;
256 - (IBAction) RevertPictureSizeToMax:(id)sender;
257
258
259 - (void) savePreset;
260 - (IBAction)AddFactoryPresets:(id)sender;
261 - (IBAction)DeleteFactoryPresets:(id)sender;
262 - (IBAction)AddUserPreset:(id)sender;
263 - (void)AddPreset;
264 - (IBAction)InsertPreset:(id)sender;
265 - (IBAction)DeletePreset:(id)sender;
266 - (IBAction)tableViewSelected:(id)sender;
267 // NSTableDataSource methods
268 - (int)numberOfRowsInTableView:(NSTableView *)aTableView;
269 - (id)tableView:(NSTableView *)aTableView
270       objectValueForTableColumn:(NSTableColumn *)aTableColumn
271       row:(int)rowIndex;
272 - (void)tableView:(NSTableView *)aTableView
273         setObjectValue:(id)anObject
274         forTableColumn:(NSTableColumn *)aTableColumn
275         row:(int)rowIndex;
276 // To determine user presets cell display properties
277 - (void)tableView:(NSTableView *)aTableView
278                 willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn
279                  row:(int)rowIndex;
280
281 // Growl methods
282 - (NSDictionary *) registrationDictionaryForGrowl;
283 -(IBAction)showGrowlDoneNotification:(id)sender;
284
285 @end
286