diff options
author | dynaflash <[email protected]> | 2008-11-24 10:01:06 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2008-11-24 10:01:06 +0000 |
commit | fdabd6ab9d2a8b8d7d1460b3b351a5b452abc963 (patch) | |
tree | f4e6d015af0b6e3be0e85a9a3e4103a6c2305496 /macosx/PictureController.h | |
parent | f220f6aae2360564e9fd307a4905336b8ceebe4e (diff) |
MacGui: Live Preview Initial Implementation
- Uses a separate instance of libhb called fPreviewLibhb to do the preview encode. Bypasses the queueing system so you can encode a live preview on one source while encoding another.
- All facets of the encode are replicated (including but not limited to audio tracks, subtitles and picture filters) *except* 2 pass. For speed's sake we only do one pass which should be more than sufficient for a 6 to 60 second preview.
- Live Preview clips are stored in "~/Library/Application Support/HandBrake/Previews/" and remain until a new preview is called for of the same format in which case the old version of "mymovie.mkv" would be replaced with a current version called "mymovie.mkv".
- Uses QTMovieView and QTMovieKit to show 5 - 60 seconds in 5 second increments (determined by a user set NSPopUpButton) of a live preview from the starting point of any of the existing 10 still previews.
- Preview window is now non-modal so can be kept open to see the effect of changing presets, etc.
- Next and Previous buttons replaced with a 10 position slider
- Live Preview is shown same as users QuickTime implementation would show it. ie. without Perian installed, mkv's will not play back, etc.
- Uses QT's stock controller bar with volume, scrubber and single frame advance buttons.
- Known Issues: Movie alignment against the still preview considering the additional height of the movie controller bar. Particularly using loose anamorphic. I am sure there are others.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1951 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/PictureController.h')
-rw-r--r-- | macosx/PictureController.h | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/macosx/PictureController.h b/macosx/PictureController.h index 24631c386..d2a3bc8f0 100644 --- a/macosx/PictureController.h +++ b/macosx/PictureController.h @@ -7,6 +7,8 @@ #import <Cocoa/Cocoa.h> #include "hb.h" +/* Needed for Quicktime movie previews */ +#import <QTKit/QTKit.h> #define HB_NUM_HBLIB_PICTURES 10 // hbilb generates 10 preview pictures @@ -42,8 +44,7 @@ IBOutlet NSSlider * fDeblockSlider; IBOutlet NSPopUpButton * fDenoisePopUp; IBOutlet NSPopUpButton * fAnamorphicPopUp; - IBOutlet NSButton * fPrevButton; - IBOutlet NSButton * fNextButton; + IBOutlet NSSlider * fPictureSlider; IBOutlet NSTextField * fInfoField; int MaxOutputWidth; @@ -67,6 +68,18 @@ } fPictureFilterSettings; id delegate; + + /* Movie Previews */ + IBOutlet NSButton * fCreatePreviewMovieButton; + IBOutlet NSButton * fShowPreviewMovieButton; + NSString * fPreviewMoviePath; + IBOutlet NSProgressIndicator * fMovieCreationProgressIndicator; + hb_handle_t * fPreviewLibhb; // private libhb for creating previews + NSTimer * fLibhbTimer; // timer for retrieving state from libhb + IBOutlet NSTextField * fPreviewMovieStatusField; + BOOL play_movie; // flag used to determine whether or not to automatically play the movie when done. + IBOutlet QTMovieView * fMovieView; + IBOutlet NSPopUpButton * fPreviewMovieLengthPopUp; // popup of choices for length of preview in seconds } - (id)initWithDelegate:(id)del; @@ -76,8 +89,18 @@ - (void) displayPreview; - (IBAction) SettingsChanged: (id) sender; -- (IBAction) PreviousPicture: (id) sender; -- (IBAction) NextPicture: (id) sender; +- (IBAction) pictureSliderChanged: (id) sender; + +/* Movie Previews */ +- (void) startReceivingLibhbNotifications; +- (void) stopReceivingLibhbNotifications; + +- (IBAction) createMoviePreview: (id) sender; +- (void) libhbStateChanged: (hb_state_t &) state; +- (IBAction) showMoviePreview: (NSString *) path; +- (IBAction) previewDurationPopUpChanged: (id) sender; + + - (IBAction) ClosePanel: (id) sender; - (BOOL) autoCrop; @@ -97,7 +120,7 @@ - (int) deblock; - (void) setDeblock: (int) setting; -- (void)showPanelInWindow: (NSWindow *)fWindow forTitle: (hb_title_t *)title; +- (IBAction)showPreviewPanel: (id)sender forTitle: (hb_title_t *)title; + (NSImage *) makeImageForPicture: (int)pictureIndex libhb:(hb_handle_t*)handle @@ -109,4 +132,5 @@ @interface NSObject (PictureControllertDelegateMethod) - (void)pictureSettingsDidChange; +- (void)prepareJobForPreview; @end |