OSDN Git Service

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