OSDN Git Service

LinGui: initialize srt language with preferred language from prefernces
[handbrake-jp/handbrake-jp-git.git] / macosx / HBQueueController.h
1 /* HBQueueController
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
8 #import <Cocoa/Cocoa.h>
9 #include "hb.h"
10
11 @class HBController;
12
13
14 #define HB_QUEUE_DRAGGING 0             // <--- NOT COMPLETELY FUNCTIONAL YET
15 #define HB_OUTLINE_METRIC_CONTROLS 0    // for tweaking the outline cell spacings
16
17
18
19 //------------------------------------------------------------------------------------
20 // As usual, we need to subclass NSOutlineView to handle a few special cases:
21 //
22 // (1) variable row heights during live resizes
23 // HBQueueOutlineView exists solely to get around a bug in variable row height outline
24 // views in which row heights get messed up during live resizes. See this discussion:
25 // http://lists.apple.com/archives/cocoa-dev/2005/Oct/msg00871.html
26 // However, the recommeneded fix (override drawRect:) does not work. Instead, this
27 // subclass implements viewDidEndLiveResize in order to recalculate all row heights.
28 //
29 // (2) prevent expanding of items during drags
30 // During dragging operations, we don't want outline items to expand, since a queue
31 // doesn't really have children items.
32 //
33 // (3) generate a drag image that incorporates more than just the first column
34 // By default, NSTableView only drags an image of the first column. Change this to
35 // drag an image of the queue's icon and desc columns.
36
37 @interface HBQueueOutlineView : NSOutlineView
38 {
39
40 BOOL                        fIsDragging;
41
42 }
43
44 - (BOOL) isDragging;
45
46 @end
47
48
49
50
51 @interface HBQueueController : NSWindowController
52 {
53     hb_handle_t                  *fQueueEncodeLibhb;              // reference to libhb
54     HBController                 *fHBController;        // reference to HBController
55     NSMutableArray               *fJobGroups;           // mirror image of the queue array from controller.mm
56
57     int                          fEncodingQueueItem;     // corresponds to the index of fJobGroups encoding item
58     int                          fPendingCount;         // Number of various kinds of job groups in fJobGroups.
59     int                          fCompletedCount;
60     int                          fCanceledCount;
61     int                          fWorkingCount;
62     BOOL                         fJobGroupCountsNeedUpdating;
63
64     BOOL                         fCurrentJobPaneShown;  // NO when fCurrentJobPane has been shifted out of view (see showCurrentJobPane)
65     NSMutableIndexSet            *fSavedExpandedItems;  // used by save/restoreOutlineViewState to preserve which items are expanded
66     NSMutableIndexSet            *fSavedSelectedItems;  // used by save/restoreOutlineViewState to preserve which items are selected
67 #if HB_QUEUE_DRAGGING
68     NSArray                      *fDraggedNodes;
69 #endif
70     NSTimer                      *fAnimationTimer;      // animates the icon of the current job in the queue outline view
71     int                          fAnimationIndex;       // used to generate name of image used to animate the current job in the queue outline view
72
73     //  +------------------window-------------------+
74     //  |+-------------fCurrentJobPane-------------+|
75     //  ||                                         ||
76     //  ||                                         ||
77     //  ||                                         ||
78     //  |+-----------------------------------------+|
79     //  |+---------------fQueuePane----------------+|
80     //  ||                                         ||
81     //  ||                                         ||
82     //  ||                                         ||
83     //  ||                                         ||
84     //  ||                                         ||
85     //  ||                                         ||
86     //  ||                                         ||
87     //  |+-----------------------------------------+|
88     //  +-------------------------------------------+
89
90     // fCurrentJobPane - visible only when processing a job
91     IBOutlet NSView              *fCurrentJobPane;
92     IBOutlet NSImageView         *fJobIconView;
93     IBOutlet NSTextField         *fJobDescTextField;
94     IBOutlet NSProgressIndicator *fProgressBar;
95     IBOutlet NSTextField         *fProgressTextField;
96
97     // fQueuePane - always visible; fills entire window when fCurrentJobPane is hidden
98     IBOutlet NSView              *fQueuePane;
99     IBOutlet HBQueueOutlineView  *fOutlineView;
100     IBOutlet NSTextField         *fQueueCountField;
101     NSArray                      *fDraggedNodes;
102     BOOL                          fIsDragging;
103 #if HB_OUTLINE_METRIC_CONTROLS
104     IBOutlet NSSlider            *fIndentation; // debug
105     IBOutlet NSSlider            *fSpacing;     // debug
106 #endif
107
108 }
109
110 - (void)setHandle: (hb_handle_t *)handle;
111 - (void)setHBController: (HBController *)controller;
112
113 - (void)setupToolbar;
114
115 - (void)setQueueArray: (NSMutableArray *)QueueFileArray;
116 - (id)outlineView:(NSOutlineView *)fOutlineView child:(NSInteger)index ofItem:(id)item;
117
118 - (BOOL)outlineView:(NSOutlineView *)fOutlineView isItemExpandable:(id)item;
119
120 - (BOOL)outlineView:(NSOutlineView *)fOutlineView shouldExpandItem:(id)item;
121
122 - (NSInteger)outlineView:(NSOutlineView *)fOutlineView numberOfChildrenOfItem:(id)item;
123
124 - (id)outlineView:(NSOutlineView *)fOutlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item;
125
126 - (void)outlineView:(NSOutlineView *)fOutlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item;
127
128 /* Animate the icon for the current encode */
129 - (void) animateWorkingEncodeIconInQueue;
130 - (void) startAnimatingCurrentWorkingEncodeInQueue;
131 - (void) stopAnimatingCurrentJobGroupInQueue;
132 - (void)setQueueStatusString: (NSString *)statusString;
133
134 - (IBAction)showQueueWindow: (id)sender;
135
136
137 /* control encodes in the window */
138 - (IBAction)removeSelectedQueueItem: (id)sender;
139 - (IBAction)revealSelectedQueueItem: (id)sender;
140 - (IBAction)editSelectedQueueItem: (id)sender;
141
142 #if HB_OUTLINE_METRIC_CONTROLS
143 - (IBAction)imageSpacingChanged: (id)sender;
144 - (IBAction)indentChanged: (id)sender;
145 #endif
146
147
148
149
150
151 @end