summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueueController.h
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/HBQueueController.h')
-rw-r--r--macosx/HBQueueController.h90
1 files changed, 71 insertions, 19 deletions
diff --git a/macosx/HBQueueController.h b/macosx/HBQueueController.h
index 1afd58fb1..d223e435f 100644
--- a/macosx/HBQueueController.h
+++ b/macosx/HBQueueController.h
@@ -6,28 +6,87 @@
#include <Cocoa/Cocoa.h>
-
#include "hb.h"
+
@class HBController;
-// HB_OUTLINE_QUEUE turns on an outline view for the queue.
-#define HB_OUTLINE_QUEUE 1
+#define HB_QUEUE_DRAGGING 0 // <--- NOT COMPLETELY FUNCTIONAL YET
#define HB_OUTLINE_METRIC_CONTROLS 0 // for tweaking the outline cell spacings
+//------------------------------------------------------------------------------------
+
+// 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.
+@interface HBQueueOutlineView : NSOutlineView
+{
+}
+@end
+
+//------------------------------------------------------------------------------------
+
+@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;
+
+@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 : NSObject
{
hb_handle_t *fHandle;
HBController *fHBController;
- NSViewAnimation *fAnimation;
- BOOL fCurrentJobHidden; // YES when fCurrentJobPane has been shifted out of view (see showCurrentJobPane)
- BOOL fShowsJobsAsGroups;
- BOOL fShowsDetail;
-#if HB_OUTLINE_QUEUE
- NSMutableArray *fEncodes; // hblib's job list organized in a hierarchy. Contents are NSArrays of HBJobs.
+ 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;
- hb_job_t *fLastKnownCurrentJob;
+#if HB_QUEUE_DRAGGING
+ NSArray *fDraggedNodes;
#endif
// +---------------fQueueWindow----------------+
@@ -58,11 +117,7 @@
// fQueuePane - always visible; fills entire window when fCurrentJobPane is hidden
IBOutlet NSView *fQueuePane;
-#if HB_OUTLINE_QUEUE
- IBOutlet NSOutlineView *fOutlineView;
-#else
- IBOutlet NSTableView *fTaskView;
-#endif
+ IBOutlet HBQueueOutlineView *fOutlineView;
IBOutlet NSTextField *fQueueCountField;
#if HB_OUTLINE_METRIC_CONTROLS
IBOutlet NSSlider *fIndentation; // debug
@@ -79,10 +134,6 @@
- (IBAction)showQueueWindow: (id)sender;
- (IBAction)removeSelectedJob: (id)sender;
- (IBAction)cancelCurrentJob: (id)sender;
-- (IBAction)showDetail: (id)sender;
-- (IBAction)hideDetail: (id)sender;
-- (IBAction)showJobsAsGroups: (id)sender;
-- (IBAction)showJobsAsPasses: (id)sender;
- (IBAction)toggleStartCancel: (id)sender;
- (IBAction)togglePauseResume: (id)sender;
@@ -92,3 +143,4 @@
#endif
@end
+