OSDN Git Service

MacGui: Separate Picture Settings and Preview Window Initial Implementation
[handbrake-jp/handbrake-jp-git.git] / macosx / HBPreviewController.h
1 /* $Id: HBPreviewController.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 PreviewController : NSWindowController
18 {
19     hb_handle_t              * fHandle;
20     hb_title_t               * fTitle;
21
22     HBController             *fHBController;        // reference to HBController
23     
24     IBOutlet NSWindow        * fPreviewWindow;
25     NSWindow                 * fFullScreenWindow; // Full Screen window
26     NSMutableDictionary      * fPicturePreviews;        // NSImages, one for each preview libhb creates, created lazily
27     int                        fPicture;
28
29     IBOutlet NSImageView     * fPictureView;
30     IBOutlet NSBox           * fPictureViewArea;
31     IBOutlet NSBox           * fPictureControlBox;
32     IBOutlet NSBox           * fEncodingControlBox;
33
34     IBOutlet NSSlider        * fPictureSlider;
35     IBOutlet NSTextField     * fInfoField;
36     
37     BOOL                     isEncoding;
38
39         
40     int     MaxOutputWidth;
41     int     MaxOutputHeight;
42
43     int output_width, output_height, output_par_width, output_par_height;
44     int display_width;
45
46     /* Full Screen Mode Toggle */
47     IBOutlet NSButton               * fFullScreenToggleButton;
48     IBOutlet NSButton               * fPictureSettingsToggleButton;
49     BOOL                              isFullScreen;
50     /* Movie Previews */
51     IBOutlet NSButton               * fCreatePreviewMovieButton;
52     IBOutlet NSButton               * fCancelPreviewMovieButton;
53     IBOutlet NSButton               * fShowPreviewMovieButton;
54     NSString                        * fPreviewMoviePath;
55     IBOutlet NSProgressIndicator    * fMovieCreationProgressIndicator;
56     hb_handle_t                     * fPreviewLibhb;           // private libhb for creating previews
57     NSTimer                         * fLibhbTimer;             // timer for retrieving state from libhb
58     IBOutlet NSTextField            * fPreviewMovieStatusField;
59     BOOL                              play_movie; // flag used to determine whether or not to automatically play the movie when done.   
60     IBOutlet QTMovieView            * fMovieView;
61     IBOutlet NSPopUpButton          * fPreviewMovieLengthPopUp; // popup of choices for length of preview in seconds
62 }
63 - (id)init;
64
65 - (void) SetHandle: (hb_handle_t *) handle;
66 - (void) SetTitle:  (hb_title_t *)  title;
67 - (void)setHBController: (HBController *)controller;
68 - (IBAction) showPreviewWindow: (id)sender;
69 - (BOOL)acceptsMouseMovedEvents;
70 - (void) displayPreview;
71 - (void) showHideHudControls;
72 - (IBAction) SettingsChanged: (id) sender;
73 - (IBAction) pictureSliderChanged: (id) sender;
74 - (IBAction)showPictureSettings:(id)sender;
75 /* Full Screen */
76 - (IBAction)toggleScreenMode:(id)sender;
77 - (IBAction)goFullScreen:(id)sender;
78 - (IBAction)goWindowedScreen:(id)sender;
79
80 /* Movie Previews */
81 - (void) startReceivingLibhbNotifications;
82 - (void) stopReceivingLibhbNotifications;
83
84 - (IBAction) createMoviePreview: (id) sender;
85 - (void) libhbStateChanged: (hb_state_t &) state;
86 - (IBAction) showMoviePreview: (NSString *) path;
87 - (IBAction) previewDurationPopUpChanged: (id) sender;
88
89
90 - (IBAction)showPreviewPanel: (id)sender forTitle: (hb_title_t *)title;
91
92 + (NSImage *) makeImageForPicture: (int)pictureIndex
93                 libhb:(hb_handle_t*)handle
94                 title:(hb_title_t*)title
95                 removeBorders:(BOOL)removeBorders;
96 - (NSImage *) imageForPicture: (int) pictureIndex;
97 - (void) purgeImageCache;
98 @end
99