OSDN Git Service

MacGui: Preview replace a method that was hastily removed in 3125 when removing Full...
[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     IBOutlet NSTextField     * fscaleInfoField;
37     
38     BOOL                     isEncoding;
39
40         
41     int                      MaxOutputWidth;
42     int                      MaxOutputHeight;
43
44     int output_width, output_height, output_par_width, output_par_height;
45     int display_width;
46     
47     /* Hud Control Overlay */
48     NSTimer                         * fHudTimer;
49     int                               hudTimerSeconds;
50     
51     /* Full Screen Mode Toggle */
52     IBOutlet NSButton               * fScaleToScreenToggleButton;
53     IBOutlet NSButton               * fPictureSettingsToggleButton;
54     BOOL                              scaleToScreen;
55     /* Movie Previews */
56     IBOutlet NSButton               * fCreatePreviewMovieButton;
57     IBOutlet NSButton               * fCancelPreviewMovieButton;
58     IBOutlet NSButton               * fShowPreviewMovieButton;
59     NSString                        * fPreviewMoviePath;
60     IBOutlet NSProgressIndicator    * fMovieCreationProgressIndicator;
61     hb_handle_t                     * fPreviewLibhb;           // private libhb for creating previews
62     NSTimer                         * fLibhbTimer;             // timer for retrieving state from libhb
63     IBOutlet NSTextField            * fPreviewMovieStatusField; 
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
76 - (IBAction) SettingsChanged: (id) sender;
77 - (IBAction) pictureSliderChanged: (id) sender;
78 - (IBAction)showPictureSettings:(id)sender;
79 - (NSString*) pictureSizeInfoString;
80
81 - (IBAction)toggleScaleToScreen:(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 - (NSImage *) imageForPicture: (int) pictureIndex;
104 - (void) purgeImageCache;
105 @end
106