X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=macosx%2FHBQueueController.h;h=51e01f66dec54d12ad8f20ead45dfc5bfa994bc3;hb=240cf3308bf21be4d1918a71a5510d07e7d6d85b;hp=d223e435f8239cc73dcc5621aaf476c80d00c4f4;hpb=15f95bc2af61e8a7b754a8e0115ef2445d2db5d6;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/macosx/HBQueueController.h b/macosx/HBQueueController.h index d223e435..51e01f66 100644 --- a/macosx/HBQueueController.h +++ b/macosx/HBQueueController.h @@ -1,95 +1,76 @@ /* HBQueueController This file is part of the HandBrake source code. - Homepage: . + Homepage: . It may be used under the terms of the GNU General Public License. */ -#include +#import #include "hb.h" @class HBController; + #define HB_QUEUE_DRAGGING 0 // <--- NOT COMPLETELY FUNCTIONAL YET #define HB_OUTLINE_METRIC_CONTROLS 0 // for tweaking the outline cell spacings -//------------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------------ +// As usual, we need to subclass NSOutlineView to handle a few special cases: +// +// (1) variable row heights during live resizes // HBQueueOutlineView exists solely to get around a bug in variable row height outline // views in which row heights get messed up during live resizes. See this discussion: // http://lists.apple.com/archives/cocoa-dev/2005/Oct/msg00871.html // However, the recommeneded fix (override drawRect:) does not work. Instead, this // subclass implements viewDidEndLiveResize in order to recalculate all row heights. +// +// (2) prevent expanding of items during drags +// During dragging operations, we don't want outline items to expand, since a queue +// doesn't really have children items. +// +// (3) generate a drag image that incorporates more than just the first column +// By default, NSTableView only drags an image of the first column. Change this to +// drag an image of the queue's icon and desc columns. + @interface HBQueueOutlineView : NSOutlineView { -} -@end -//------------------------------------------------------------------------------------ +BOOL fIsDragging; -@interface HBJob : NSObject -{ - hb_job_t *hbJob; } -+ (HBJob*) jobWithJob: (hb_job_t *) job; -- (id) initWithJob: (hb_job_t *) job; -- (hb_job_t *) job; -- (NSMutableAttributedString *) attributedDescriptionWithHBHandle: (hb_handle_t *)handle - withIcon: (BOOL)withIcon - withTitle: (BOOL)withTitle - withPassName: (BOOL)withPassName - withFormatInfo: (BOOL)withFormatInfo - withDestination: (BOOL)withDestination - withPictureInfo: (BOOL)withPictureInfo - withVideoInfo: (BOOL)withVideoInfo - withx264Info: (BOOL)withx264Info - withAudioInfo: (BOOL)withAudioInfo - withSubtitleInfo: (BOOL)withSubtitleInfo; +- (BOOL) isDragging; @end -//------------------------------------------------------------------------------------ -@interface HBJobGroup : NSObject -{ - NSMutableArray *fJobs; // array of HBJob - NSMutableAttributedString *fDescription; - BOOL fNeedsDescription; - float fLastDescriptionHeight; - float fLastDescriptionWidth; -} -+ (HBJobGroup *) jobGroup; -- (unsigned int) count; -- (void) addJob: (HBJob *)aJob; -- (HBJob *) jobAtIndex: (unsigned)index; -- (unsigned) indexOfJob: (HBJob *)aJob; -- (NSEnumerator *) jobEnumerator; -- (void) setNeedsDescription: (BOOL)flag; -- (NSMutableAttributedString *) attributedDescriptionWithHBHandle: (hb_handle_t *)handle; -- (float) heightOfDescriptionForWidth:(float)width withHBHandle: (hb_handle_t *)handle; -- (float) lastDescriptionHeight; -@end +@interface HBQueueController : NSWindowController +{ + hb_handle_t *fQueueEncodeLibhb; // reference to libhb + HBController *fHBController; // reference to HBController + NSMutableArray *fJobGroups; // mirror image of the queue array from controller.mm -//------------------------------------------------------------------------------------ + int fEncodingQueueItem; // corresponds to the index of fJobGroups encoding item + int fPendingCount; // Number of various kinds of job groups in fJobGroups. + int fCompletedCount; + int fCanceledCount; + int fWorkingCount; + BOOL fJobGroupCountsNeedUpdating; -@interface HBQueueController : NSObject -{ - hb_handle_t *fHandle; - HBController *fHBController; - NSMutableArray *fJobGroups; // hblib's job list organized in a hierarchy of HBJobGroup and HBJob - NSViewAnimation *fAnimation; // for revealing the fCurrentJobPane BOOL fCurrentJobPaneShown; // NO when fCurrentJobPane has been shifted out of view (see showCurrentJobPane) - hb_job_t *fLastKnownCurrentJob; - NSMutableIndexSet *fSavedExpandedItems; - unsigned int fSavedSelectedItem; + NSMutableIndexSet *fSavedExpandedItems; // used by save/restoreOutlineViewState to preserve which items are expanded + NSMutableIndexSet *fSavedSelectedItems; // used by save/restoreOutlineViewState to preserve which items are selected #if HB_QUEUE_DRAGGING - NSArray *fDraggedNodes; + NSArray *fDraggedNodes; #endif - - // +---------------fQueueWindow----------------+ + NSTimer *fAnimationTimer; // animates the icon of the current job in the queue outline view + int fAnimationIndex; // used to generate name of image used to animate the current job in the queue outline view + + // +------------------window-------------------+ // |+-------------fCurrentJobPane-------------+| // || || // || || @@ -105,8 +86,6 @@ // || || // |+-----------------------------------------+| // +-------------------------------------------+ - - IBOutlet NSWindow *fQueueWindow; // fCurrentJobPane - visible only when processing a job IBOutlet NSView *fCurrentJobPane; @@ -114,33 +93,58 @@ IBOutlet NSTextField *fJobDescTextField; IBOutlet NSProgressIndicator *fProgressBar; IBOutlet NSTextField *fProgressTextField; - + // fQueuePane - always visible; fills entire window when fCurrentJobPane is hidden IBOutlet NSView *fQueuePane; IBOutlet HBQueueOutlineView *fOutlineView; IBOutlet NSTextField *fQueueCountField; + NSArray *fDraggedNodes; + BOOL fIsDragging; #if HB_OUTLINE_METRIC_CONTROLS IBOutlet NSSlider *fIndentation; // debug IBOutlet NSSlider *fSpacing; // debug #endif - + } - (void)setHandle: (hb_handle_t *)handle; - (void)setHBController: (HBController *)controller; -- (void)updateQueueUI; -- (void)updateCurrentJobUI; + +- (void)setupToolbar; + +- (void)setQueueArray: (NSMutableArray *)QueueFileArray; +- (id)outlineView:(NSOutlineView *)fOutlineView child:(NSInteger)index ofItem:(id)item; + +- (BOOL)outlineView:(NSOutlineView *)fOutlineView isItemExpandable:(id)item; + +- (BOOL)outlineView:(NSOutlineView *)fOutlineView shouldExpandItem:(id)item; + +- (NSInteger)outlineView:(NSOutlineView *)fOutlineView numberOfChildrenOfItem:(id)item; + +- (id)outlineView:(NSOutlineView *)fOutlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item; + +- (void)outlineView:(NSOutlineView *)fOutlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item; + +/* Animate the icon for the current encode */ +- (void) animateWorkingEncodeIconInQueue; +- (void) startAnimatingCurrentWorkingEncodeInQueue; +- (void) stopAnimatingCurrentJobGroupInQueue; +- (void)setQueueStatusString: (NSString *)statusString; - (IBAction)showQueueWindow: (id)sender; -- (IBAction)removeSelectedJob: (id)sender; -- (IBAction)cancelCurrentJob: (id)sender; -- (IBAction)toggleStartCancel: (id)sender; -- (IBAction)togglePauseResume: (id)sender; + + +/* control encodes in the window */ +- (IBAction)removeSelectedQueueItem: (id)sender; +- (IBAction)revealSelectedQueueItem: (id)sender; #if HB_OUTLINE_METRIC_CONTROLS - (IBAction)imageSpacingChanged: (id)sender; - (IBAction)indentChanged: (id)sender; #endif -@end + + + +@end