summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueueController.h
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/HBQueueController.h')
-rw-r--r--macosx/HBQueueController.h73
1 files changed, 60 insertions, 13 deletions
diff --git a/macosx/HBQueueController.h b/macosx/HBQueueController.h
index d223e435f..cab1c201b 100644
--- a/macosx/HBQueueController.h
+++ b/macosx/HBQueueController.h
@@ -11,18 +11,44 @@
@class HBController;
#define HB_QUEUE_DRAGGING 0 // <--- NOT COMPLETELY FUNCTIONAL YET
-#define HB_OUTLINE_METRIC_CONTROLS 0 // for tweaking the outline cell spacings
+#define HB_OUTLINE_METRIC_CONTROLS 1 // for tweaking the outline cell spacings
-//------------------------------------------------------------------------------------
+typedef enum _HBQueueJobGroupStatus
+{
+ HBStatusNone = 0,
+ HBStatusPending = 1,
+ HBStatusWorking = 2,
+ HBStatusComplete = 3,
+ HBStatusCanceled = 4
+} HBQueueJobGroupStatus;
+//------------------------------------------------------------------------------------
+// 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
{
+#if HB_QUEUE_DRAGGING
+BOOL fIsDragging;
+#endif
}
+#if HB_QUEUE_DRAGGING
+- (BOOL) isDragging;
+#endif
@end
//------------------------------------------------------------------------------------
@@ -58,14 +84,30 @@
BOOL fNeedsDescription;
float fLastDescriptionHeight;
float fLastDescriptionWidth;
+ HBQueueJobGroupStatus fStatus;
+ NSString *fPath;
}
+// Creating a job group
+ (HBJobGroup *) jobGroup;
-- (unsigned int) count;
+
+// Adding jobs
- (void) addJob: (HBJob *)aJob;
+
+// Removing jobs
+- (void) removeAllJobs;
+
+// Querying a job group
+- (unsigned int) count;
- (HBJob *) jobAtIndex: (unsigned)index;
- (unsigned) indexOfJob: (HBJob *)aJob;
- (NSEnumerator *) jobEnumerator;
+- (void) setStatus: (HBQueueJobGroupStatus)status;
+- (HBQueueJobGroupStatus) status;
+- (void) setPath: (NSString *)path;
+- (NSString *) path;
+
+// Creating a description
- (void) setNeedsDescription: (BOOL)flag;
- (NSMutableAttributedString *) attributedDescriptionWithHBHandle: (hb_handle_t *)handle;
- (float) heightOfDescriptionForWidth:(float)width withHBHandle: (hb_handle_t *)handle;
@@ -77,17 +119,20 @@
@interface HBQueueController : NSObject
{
- hb_handle_t *fHandle;
- HBController *fHBController;
+ hb_handle_t *fHandle; // reference to hblib
+ HBController *fHBController; // reference to HBController
NSMutableArray *fJobGroups; // hblib's job list organized in a hierarchy of HBJobGroup and HBJob
- NSViewAnimation *fAnimation; // for revealing the fCurrentJobPane
+ HBJobGroup *fCurrentJobGroup; // the HJobGroup current being processed by hblib
BOOL fCurrentJobPaneShown; // NO when fCurrentJobPane has been shifted out of view (see showCurrentJobPane)
- hb_job_t *fLastKnownCurrentJob;
- NSMutableIndexSet *fSavedExpandedItems;
- unsigned int fSavedSelectedItem;
+ hb_job_t *fLastKnownCurrentJob; // this is how we track when hbib has started processing a different job
+ 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
+ NSMutableArray *fCompleted; // HBJobGroups that have been completed. These also appear in fJobGroups.
+ 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
// +---------------fQueueWindow----------------+
// |+-------------fCurrentJobPane-------------+|
@@ -128,11 +173,13 @@
- (void)setHandle: (hb_handle_t *)handle;
- (void)setHBController: (HBController *)controller;
-- (void)updateQueueUI;
-- (void)updateCurrentJobUI;
+- (void)hblibJobListChanged;
+- (void)hblibStateChanged: (hb_state_t &)state;
+- (void)hblibWillStop;
- (IBAction)showQueueWindow: (id)sender;
-- (IBAction)removeSelectedJob: (id)sender;
+- (IBAction)removeSelectedJobGroups: (id)sender;
+- (IBAction)revealSelectedJobGroups: (id)sender;
- (IBAction)cancelCurrentJob: (id)sender;
- (IBAction)toggleStartCancel: (id)sender;
- (IBAction)togglePauseResume: (id)sender;