OSDN Git Service

16dd75e4833d77e5afecfd22eb165378c4e819b1
[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     /* Hud Control Overlay */
47     NSTimer                         * fHudTimer;
48     int                               hudTimerSeconds;
49     
50     /* Full Screen Mode Toggle */
51     IBOutlet NSButton               * fFullScreenToggleButton;
52     IBOutlet NSButton               * fPictureSettingsToggleButton;
53     BOOL                              isFullScreen;
54     /* Movie Previews */
55     IBOutlet NSButton               * fCreatePreviewMovieButton;
56     IBOutlet NSButton               * fCancelPreviewMovieButton;
57     IBOutlet NSButton               * fShowPreviewMovieButton;
58     NSString                        * fPreviewMoviePath;
59     IBOutlet NSProgressIndicator    * fMovieCreationProgressIndicator;
60     hb_handle_t                     * fPreviewLibhb;           // private libhb for creating previews
61     NSTimer                         * fLibhbTimer;             // timer for retrieving state from libhb
62     IBOutlet NSTextField            * fPreviewMovieStatusField;
63     BOOL                              play_movie; // flag used to determine whether or not to automatically play the movie when done.   
64     IBOutlet QTMovieView            * fMovieView;
65     IBOutlet NSPopUpButton          * fPreviewMovieLengthPopUp; // popup of choices for length of preview in seconds
66 }
67 - (id)init;
68
69 - (void) SetHandle: (hb_handle_t *) handle;
70 - (void) SetTitle:  (hb_title_t *)  title;
71 - (void)setHBController: (HBController *)controller;
72 - (IBAction) showPreviewWindow: (id)sender;
73 - (BOOL)acceptsMouseMovedEvents;
74 - (void) displayPreview;
75 - (void) showHideHudControls;
76 - (IBAction) SettingsChanged: (id) sender;
77 - (IBAction) pictureSliderChanged: (id) sender;
78 - (IBAction)showPictureSettings:(id)sender;
79 /* Full Screen */
80 - (IBAction)toggleScreenMode:(id)sender;
81 - (IBAction)goFullScreen:(id)sender;
82 - (IBAction)goWindowedScreen:(id)sender;
83
84 /* HUD overlay */
85 - (void) startHudTimer;
86 - (void) stopHudTimer;
87
88 /* Movie Previews */
89 - (void) startReceivingLibhbNotifications;
90 - (void) stopReceivingLibhbNotifications;
91
92 - (IBAction) createMoviePreview: (id) sender;
93 - (void) libhbStateChanged: (hb_state_t &) state;
94 - (IBAction) showMoviePreview: (NSString *) path;
95 - (IBAction) previewDurationPopUpChanged: (id) sender;
96
97
98 - (IBAction)showPreviewPanel: (id)sender forTitle: (hb_title_t *)title;
99
100 + (NSImage *) makeImageForPicture: (int)pictureIndex
101                 libhb:(hb_handle_t*)handle
102                 title:(hb_title_t*)title
103                 removeBorders:(BOOL)removeBorders;
104 - (NSImage *) imageForPicture: (int) pictureIndex;
105 - (void) purgeImageCache;
106 @end
107