OSDN Git Service

MacGui: "Ritsuka Bar" toolbar initial implementation
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 25 Jul 2007 19:08:39 +0000 (19:08 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 25 Jul 2007 19:08:39 +0000 (19:08 +0000)
- Thanks goes to Ritsuka!
- Moves the Start/Cancel, Pause/Resume, Presets Drawer and Activity Window (previously debug) controls into a nice toolbar at the top of the main window
- Resizes the height of the main window to allow for the progress bar at the bottom during encoding
- Small change in that now muxmkv.c is included in the xcode project under libhb resources. Instead of under the main project heading.

git-svn-id: svn://localhost/HandBrake/trunk@733 b64f7644-9d1e-0410-96f1-a4d463321fa5

15 files changed:
macosx/Controller.h
macosx/Controller.mm
macosx/English.lproj/MainMenu.nib/classes.nib
macosx/English.lproj/MainMenu.nib/info.nib
macosx/English.lproj/MainMenu.nib/keyedobjects.nib
macosx/English.lproj/OutputPanel.nib/info.nib
macosx/English.lproj/OutputPanel.nib/keyedobjects.nib
macosx/HandBrake.xcodeproj/project.pbxproj
macosx/icons/Add.tiff [new file with mode: 0644]
macosx/icons/Brushed Window.tiff [new file with mode: 0644]
macosx/icons/Drawer-List2.png [new file with mode: 0644]
macosx/icons/Pause.tiff [new file with mode: 0644]
macosx/icons/Play.tiff [new file with mode: 0644]
macosx/icons/Stop.tiff [new file with mode: 0644]
macosx/icons/Terminal.tiff [new file with mode: 0644]

index 9479c36..be931df 100644 (file)
 
 {
     IBOutlet NSWindow            * fWindow;
-
+       
     /* Scan panel */
        IBOutlet ScanController      * fScanController;
     IBOutlet NSPanel             * fScanPanel;
-
+       
     /* Picture panel */
     IBOutlet PictureController   * fPictureController;
     IBOutlet NSPanel             * fPicturePanel;
-
+       
     /* Queue panel */
     IBOutlet QueueController     * fQueueController;
     IBOutlet NSPanel             * fQueuePanel;
     IBOutlet NSTextField         * fQueueStatus;
-    IBOutlet NSButton            * fQueueAddButton;
-    IBOutlet NSButton            * fQueueShowButton;
-
+    //IBOutlet NSButton            * fQueueAddButton;
+    //IBOutlet NSButton            * fQueueShowButton;
+       
     /* Source box */
     IBOutlet NSTextField         * fSrcDVD1Field;
     IBOutlet NSTextField         * fSrcDVD2Field;
@@ -48,7 +48,7 @@
     IBOutlet NSPopUpButton       * fSrcChapterEndPopUp;
     IBOutlet NSTextField         * fSrcDuration1Field;
     IBOutlet NSTextField         * fSrcDuration2Field;
-
+       
     /* Destination box */
     IBOutlet NSTextField         * fDstFormatField;
        IBOutlet NSPopUpButton       * fDstFormatPopUp;
@@ -58,7 +58,7 @@
     IBOutlet NSTextField         * fDstFile1Field;
     IBOutlet NSTextField         * fDstFile2Field;
     IBOutlet NSButton            * fDstBrowseButton;
-
+       
     /* Video box */
     IBOutlet NSTextField         * fVidRateField;
     IBOutlet NSPopUpButton       * fVidRatePopUp;
     /* Subtitles box */
     IBOutlet NSTextField         * fSubField;
     IBOutlet NSPopUpButton       * fSubPopUp;
-
+       
     /* Audio box */
     IBOutlet NSTextField         * fAudLang1Field;
     IBOutlet NSPopUpButton       * fAudLang1PopUp;
     /* Chapters box */
     IBOutlet NSButton            * fCreateChapterMarkers;
     IBOutlet NSTableView         * fChapterTable;
-             ChapterTitles       * fChapterTitlesDelegate;
-
+       ChapterTitles       * fChapterTitlesDelegate;
+       
     /* Bottom */
     IBOutlet NSButton            * fPictureButton;
     IBOutlet NSTextField         * fStatusField;
     IBOutlet NSButton            * fAddToQuButton;
     IBOutlet NSButton            * fPauseButton;
     IBOutlet NSButton            * fRipButton;
-
+       
        /* Advanced Tab for opts fX264optView*/
        IBOutlet NSView              * fX264optView;
        IBOutlet NSTextField         * fX264optViewTitleLabel;
     hb_handle_t                  * fHandle;
        hb_title_t                   * fTitle;
     /* integer to set to determine the previous state
-       of encode 0==idle, 1==encoding, 2==cancelled*/
+               of encode 0==idle, 1==encoding, 2==cancelled*/
     int                            fEncodeState;
        int                            currentScanCount;
        NSString                      * currentSource;
        HBOutputPanelController *outputPanel;
+       
+       BOOL                         startButtonEnabled;
+    BOOL                         pauseButtonEnabled;
+    BOOL                         AddToQueueButtonEnabled;
+       BOOL                         stopOrStart;
+       BOOL                         resumeOrPause;
 }
 
 - (void)     TranslateStrings;
 - (NSDictionary *) registrationDictionaryForGrowl;
 -(IBAction)showGrowlDoneNotification:(id)sender;
 - (IBAction)showDebugOutputPanel:(id)sender;
-
+- (void)setupToolbar;
 @end
 
index 380cb20..f89856e 100644 (file)
@@ -35,6 +35,16 @@ static int FormatSettings[4][10] =
          0,
          0 } };
 
+/* We setup the toolbar values here */
+static NSString*       MyDocToolbarIdentifier          = @"My Document Toolbar Identifier";
+static NSString*       ToggleDrawerIdentifier  = @"Toggle Drawer Item Identifier";
+//static NSString*       ToggleDrawerIdentifier  = @"Toggle Presets Item Identifier";
+static NSString*       StartEncodingIdentifier         = @"Start Encoding Item Identifier";
+static NSString*       PauseEncodingIdentifier         = @"Pause Encoding Item Identifier";
+static NSString*       ShowQueueIdentifier     = @"Show Queue Item Identifier";
+static NSString*       AddToQueueIdentifier    = @"Add to Queue Item Identifier";
+static NSString*       DebugOutputIdentifier   = @"Debug Output Item Identifier";
+
 /*******************************
  * HBController implementation *
  *******************************/
@@ -253,15 +263,226 @@ static int FormatSettings[4][10] =
     [fStatusField setStringValue: @""];
 
     [self EnableUI: NO];
-    [fPauseButton setEnabled: NO];
-    [fRipButton setEnabled: NO];
-
+    //[fPauseButton setEnabled: NO];
+    //[fRipButton setEnabled: NO];
+       /* Use new Toolbar start and pause here */
+       
+       pauseButtonEnabled = NO;
+       startButtonEnabled = NO;
+       [self setupToolbar];
+       /* In Ritsuka's patch, this goes below the Turbo stuff below
+          Lets try to keep it all together */
+       startButtonEnabled = NO;
+       stopOrStart = NO;
+       AddToQueueButtonEnabled = NO;
+       pauseButtonEnabled = NO;
+       resumeOrPause = NO;
 
        /* We disable the Turbo 1st pass checkbox since we are not x264 */
        [fVidTurboPassCheck setEnabled: NO];
        [fVidTurboPassCheck setState: NSOffState];
 }
 
+// ============================================================
+// NSToolbar Related Methods
+// ============================================================
+
+- (void) setupToolbar {
+    // Create a new toolbar instance, and attach it to our document window 
+    NSToolbar *toolbar = [[[NSToolbar alloc] initWithIdentifier: MyDocToolbarIdentifier] autorelease];
+    
+    // Set up toolbar properties: Allow customization, give a default display mode, and remember state in user defaults 
+    [toolbar setAllowsUserCustomization: YES];
+    [toolbar setAutosavesConfiguration: YES];
+    [toolbar setDisplayMode: NSToolbarDisplayModeIconAndLabel];
+    
+    // We are the delegate
+    [toolbar setDelegate: self];
+    
+    // Attach the toolbar to the document window 
+    [fWindow setToolbar: toolbar];
+}
+
+- (NSToolbarItem *) toolbar: (NSToolbar *)toolbar itemForItemIdentifier: (NSString *) itemIdent willBeInsertedIntoToolbar:(BOOL) willBeInserted {
+    // Required delegate method:  Given an item identifier, this method returns an item 
+    // The toolbar will use this method to obtain toolbar items that can be displayed in the customization sheet, or in the toolbar itself 
+    NSToolbarItem *toolbarItem = nil;
+    
+    if ([itemIdent isEqual: ToggleDrawerIdentifier]) {
+        toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease];
+               
+        // Set the text label to be displayed in the toolbar and customization palette 
+               [toolbarItem setLabel: @"Toggle Presets"];
+               [toolbarItem setPaletteLabel: @"Toggler Presets"];
+               
+               // Set up a reasonable tooltip, and image   Note, these aren't localized, but you will likely want to localize many of the item's properties 
+               [toolbarItem setToolTip: @"Open/Close Preset Drawer"];
+               [toolbarItem setImage: [NSImage imageNamed: @"Drawer-List2"]];
+               
+               // Tell the item what message to send when it is clicked 
+               [toolbarItem setTarget: self];
+               [toolbarItem setAction: @selector(toggleDrawer)];
+               
+       } else if ([itemIdent isEqual: StartEncodingIdentifier]) {
+        toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease];
+               
+        // Set the text label to be displayed in the toolbar and customization palette 
+               [toolbarItem setLabel: @"Start"];
+               [toolbarItem setPaletteLabel: @"Start Encoding"];
+               
+               // Set up a reasonable tooltip, and image   Note, these aren't localized, but you will likely want to localize many of the item's properties 
+               [toolbarItem setToolTip: @"Start Encoding"];
+               [toolbarItem setImage: [NSImage imageNamed: @"Play"]];
+               
+               // Tell the item what message to send when it is clicked 
+               [toolbarItem setTarget: self];
+               [toolbarItem setAction: @selector(Rip:)];
+               
+               
+               
+       } else if ([itemIdent isEqual: ShowQueueIdentifier]) {
+        toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease];
+               
+        // Set the text label to be displayed in the toolbar and customization palette 
+               [toolbarItem setLabel: @"Show Queue"];
+               [toolbarItem setPaletteLabel: @"Show Queue"];
+               
+               // Set up a reasonable tooltip, and image   Note, these aren't localized, but you will likely want to localize many of the item's properties 
+               [toolbarItem setToolTip: @"Show Queue"];
+               [toolbarItem setImage: [NSImage imageNamed: @"Brushed Window"]];
+               
+               // Tell the item what message to send when it is clicked 
+               [toolbarItem setTarget: self];
+               [toolbarItem setAction: @selector(ShowQueuePanel:)];
+               
+       } else if ([itemIdent isEqual: AddToQueueIdentifier]) {
+        toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease];
+               
+        // Set the text label to be displayed in the toolbar and customization palette 
+               [toolbarItem setLabel: @"Add to Queue"];
+               [toolbarItem setPaletteLabel: @"Add to Queue"];
+               
+               // Set up a reasonable tooltip, and image   Note, these aren't localized, but you will likely want to localize many of the item's properties 
+               [toolbarItem setToolTip: @"Add to Queue"];
+               [toolbarItem setImage: [NSImage imageNamed: @"Add"]];
+               
+               // Tell the item what message to send when it is clicked 
+               [toolbarItem setTarget: self];
+               [toolbarItem setAction: @selector(AddToQueue:)];
+               
+               
+       } else if ([itemIdent isEqual: PauseEncodingIdentifier]) {
+        toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease];
+               
+        // Set the text label to be displayed in the toolbar and customization palette 
+               [toolbarItem setLabel: @"Pause"];
+               [toolbarItem setPaletteLabel: @"Pause Encoding"];
+               
+               // Set up a reasonable tooltip, and image   Note, these aren't localized, but you will likely want to localize many of the item's properties 
+               [toolbarItem setToolTip: @"Pause Encoding"];
+               [toolbarItem setImage: [NSImage imageNamed: @"Pause"]];
+               
+               // Tell the item what message to send when it is clicked 
+               [toolbarItem setTarget: self];
+               [toolbarItem setAction: @selector(Pause:)];
+               
+       } else if ([itemIdent isEqual: DebugOutputIdentifier]) {
+        toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease];
+               
+        // Set the text label to be displayed in the toolbar and customization palette 
+               [toolbarItem setLabel: @"Activity Window"];
+               [toolbarItem setPaletteLabel: @"Show Activity Window"];
+               
+               // Set up a reasonable tooltip, and image   Note, these aren't localized, but you will likely want to localize many of the item's properties 
+               [toolbarItem setToolTip: @"Show Activity Window"];
+               [toolbarItem setImage: [NSImage imageNamed: @"Terminal"]];
+               
+               // Tell the item what message to send when it is clicked 
+               [toolbarItem setTarget: self];
+               [toolbarItem setAction: @selector(showDebugOutputPanel:)];
+               
+    } else {
+        //itemIdent refered to a toolbar item that is not provide or supported by us or cocoa 
+        //Returning nil will inform the toolbar this kind of item is not supported 
+               toolbarItem = nil;
+    }
+       
+    return toolbarItem;
+}
+
+- (void) toggleDrawer {
+    [fPresetDrawer toggle:self];
+}
+
+- (NSArray *) toolbarDefaultItemIdentifiers: (NSToolbar *) toolbar {
+    // Required delegate method:  Returns the ordered list of items to be shown in the toolbar by default    
+    // If during the toolbar's initialization, no overriding values are found in the user defaults, or if the
+    // user chooses to revert to the default items this set will be used 
+    return [NSArray arrayWithObjects:  StartEncodingIdentifier, PauseEncodingIdentifier, NSToolbarSeparatorItemIdentifier,
+               AddToQueueIdentifier, ShowQueueIdentifier,
+               NSToolbarFlexibleSpaceItemIdentifier, 
+               NSToolbarSpaceItemIdentifier, DebugOutputIdentifier, ToggleDrawerIdentifier, nil];
+}
+
+- (NSArray *) toolbarAllowedItemIdentifiers: (NSToolbar *) toolbar {
+    // Required delegate method:  Returns the list of all allowed items by identifier.  By default, the toolbar 
+    // does not assume any items are allowed, even the separator.  So, every allowed item must be explicitly listed   
+    // The set of allowed items is used to construct the customization palette 
+    return [NSArray arrayWithObjects:  StartEncodingIdentifier, PauseEncodingIdentifier, AddToQueueIdentifier, ShowQueueIdentifier,
+               DebugOutputIdentifier, NSToolbarCustomizeToolbarItemIdentifier,
+               NSToolbarFlexibleSpaceItemIdentifier, NSToolbarSpaceItemIdentifier,
+               NSToolbarSeparatorItemIdentifier,ToggleDrawerIdentifier, nil];
+}
+
+- (BOOL) validateToolbarItem: (NSToolbarItem *) toolbarItem {
+    // Optional method:  This message is sent to us since we are the target of some toolbar item actions 
+    BOOL enable = NO;
+    if ([[toolbarItem itemIdentifier] isEqual: ToggleDrawerIdentifier]) {
+               enable = YES;
+       }
+       if ([[toolbarItem itemIdentifier] isEqual: StartEncodingIdentifier]) {
+               enable = startButtonEnabled;
+               if(stopOrStart) {
+                       [toolbarItem setImage: [NSImage imageNamed: @"Stop"]];
+                       [toolbarItem setLabel: @"Cancel"];
+                       [toolbarItem setPaletteLabel: @"Cancel"];
+                       [toolbarItem setToolTip: @"Cancel Encoding"];
+               }
+               else {
+                       [toolbarItem setImage: [NSImage imageNamed: @"Play"]];
+                       [toolbarItem setLabel: @"Start"];
+                       [toolbarItem setPaletteLabel: @"Start Encoding"];
+                       [toolbarItem setToolTip: @"Start Encoding"];
+               }
+               
+       }
+       if ([[toolbarItem itemIdentifier] isEqual: PauseEncodingIdentifier]) {
+               enable = pauseButtonEnabled;
+               if(resumeOrPause) {
+                       [toolbarItem setImage: [NSImage imageNamed: @"Play"]];
+                       [toolbarItem setLabel: @"Resume"];
+                       [toolbarItem setPaletteLabel: @"Resume Encoding"];
+                       [toolbarItem setToolTip: @"Resume Encoding"];
+               }
+               else {
+                       [toolbarItem setImage: [NSImage imageNamed: @"Pause"]];
+                       [toolbarItem setLabel: @"Pause"];
+                       [toolbarItem setPaletteLabel: @"Pause Encoding"];
+                       [toolbarItem setToolTip: @"Pause Encoding"];
+               }
+       }
+       if ([[toolbarItem itemIdentifier] isEqual: DebugOutputIdentifier]) {
+               enable = YES;
+       }
+       if ([[toolbarItem itemIdentifier] isEqual: ShowQueueIdentifier]) {
+               enable = YES;
+       }
+       if ([[toolbarItem itemIdentifier] isEqual: AddToQueueIdentifier]) {
+               enable = AddToQueueButtonEnabled;
+       }
+    return enable;
+}
+
 // register a test notification and make
 // it enabled by default
 #define SERVICE_NAME @"Encode Done"
@@ -378,50 +599,50 @@ return registrationDictionary;
 
 - (void) UpdateUI: (NSTimer *) timer
 {
-/* check to see if there has been a new scan done
-   this bypasses the constraints of HB_STATE_WORKING
-   not allowing setting a newly scanned source */
-int checkScanCount = hb_get_scancount( fHandle );
-if (checkScanCount > currentScanCount)
+       /* check to see if there has been a new scan done
+       this bypasses the constraints of HB_STATE_WORKING
+       not allowing setting a newly scanned source */
+       int checkScanCount = hb_get_scancount( fHandle );
+       if (checkScanCount > currentScanCount)
        {
                [fScanController Cancel: NULL];
                [self ShowNewScan: NULL];
                currentScanCount = checkScanCount;
        }
-
-
-
-
+       
+       
+       
+       
     hb_state_t s;
     hb_get_state( fHandle, &s );
-
-
+       
+       
     switch( s.state )
     {
         case HB_STATE_IDLE:
             break;
-
+                       
         case HB_STATE_SCANNING:
             [fScanController UpdateUI: &s];
             break;
-               
+                       
 #define p s.param.scandone
         case HB_STATE_SCANDONE:
         {
-               [fScanController Cancel: NULL];
-        [self ShowNewScan: NULL];
+                       [fScanController Cancel: NULL];
+                       [self ShowNewScan: NULL];
             break;
         }
 #undef p
-
+                       
 #define p s.param.working
         case HB_STATE_WORKING:
         {
             float progress_total;
             NSMutableString * string;
                        /* Currently, p.job_cur and p.job_count get screwed up when adding
-                          jobs during encoding, if they cannot be fixed in libhb, will implement a
-                          nasty but working cocoa solution */
+                               jobs during encoding, if they cannot be fixed in libhb, will implement a
+                               nasty but working cocoa solution */
                        /* Update text field */
                        string = [NSMutableString stringWithFormat: _( @"Encoding: task %d of %d, %.2f %%" ), p.job_cur, p.job_count, 100.0 * p.progress];
             
@@ -441,17 +662,16 @@ if (checkScanCount > currentScanCount)
             /* Update dock icon */
             [self UpdateDockIcon: progress_total];
                        
-            [fPauseButton setEnabled: YES];
-            [fPauseButton setTitle: _( @"Pause" )];
-            [fRipButton setEnabled: YES];
-            [fRipButton setTitle: _( @"Cancel" )];
-                       
-                       
+            /* new toolbar controls */
+            pauseButtonEnabled = YES;
+            resumeOrPause = NO;
+            startButtonEnabled = YES;
+            stopOrStart = YES;                 
                        
             break;
         }
 #undef p
-
+                       
 #define p s.param.muxing
         case HB_STATE_MUXING:
         {
@@ -469,22 +689,27 @@ if (checkScanCount > currentScanCount)
             /* Update dock icon */
             [self UpdateDockIcon: 1.0];
                        
-            [fPauseButton setEnabled: YES];
-            [fPauseButton setTitle: _( @"Pause" )];
-            [fRipButton setEnabled: YES];
-            [fRipButton setTitle: _( @"Cancel" )];
+            //[fPauseButton setEnabled: YES];
+            //[fPauseButton setTitle: _( @"Pause" )];
+            //[fRipButton setEnabled: YES];
+                       // [fRipButton setTitle: _( @"Cancel" )];
             break;
         }
 #undef p
                        
         case HB_STATE_PAUSED:
-                   [fStatusField setStringValue: _( @"Paused" )];
-            [fPauseButton setEnabled: YES];
-            [fPauseButton setTitle: _( @"Resume" )];
-            [fRipButton setEnabled: YES];
-            [fRipButton setTitle: _( @"Cancel" )];
+                   //[fStatusField setStringValue: _( @"Paused" )];
+            //[fPauseButton setEnabled: YES];
+            //[fPauseButton setTitle: _( @"Resume" )];
+            //[fRipButton setEnabled: YES];
+            //[fRipButton setTitle: _( @"Cancel" )];
+                       /* new toolbar controls */
+            pauseButtonEnabled = YES;
+            resumeOrPause = YES;
+            startButtonEnabled = YES;
+            stopOrStart = YES;
             break;
-
+                       
         case HB_STATE_WORKDONE:
         {
             [fStatusField setStringValue: _( @"Done." )];
@@ -495,10 +720,21 @@ if (checkScanCount > currentScanCount)
             /* Restore dock icon */
             [self UpdateDockIcon: -1.0];
                        
-            [fPauseButton setEnabled: NO];
-            [fPauseButton setTitle: _( @"Pause" )];
-            [fRipButton setEnabled: YES];
-            [fRipButton setTitle: _( @"Start" )];
+            //[fPauseButton setEnabled: NO];
+            //[fPauseButton setTitle: _( @"Pause" )];
+                       // [fRipButton setEnabled: YES];
+                       // [fRipButton setTitle: _( @"Start" )];
+                       /* new toolbar controls */
+            pauseButtonEnabled = NO;
+            resumeOrPause = NO;
+            startButtonEnabled = YES;
+            stopOrStart = NO;
+                       NSRect frame = [fWindow frame];
+                       if (frame.size.width <= 591)
+                               frame.size.width = 591;
+                       frame.size.height += -44;
+                       frame.origin.y -= -44;
+                       [fWindow setFrame:frame display:YES animate:YES];
                        
             /* FIXME */
             hb_job_t * job;
@@ -507,7 +743,7 @@ if (checkScanCount > currentScanCount)
                 hb_rem( fHandle, job );
             }
             /* Check to see if the encode state has not been cancelled
-                       to determine if we should check for encode done notifications */
+                               to determine if we should check for encode done notifications */
                        if (fEncodeState != 2)                  {
                                /* If Growl Notification or Window and Growl has been selected */
                                if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"AlertWhenDone"] isEqualToString: @"Growl Notification"] || 
@@ -537,30 +773,30 @@ if (checkScanCount > currentScanCount)
                        }
                        else
                        {
-                       [self EnableUI: YES];
+                               [self EnableUI: YES];
                        }
             break;
         }
     }
-
+       
     /* Lets show the queue status
-       here in the main window*/
-        int queue_count = hb_count( fHandle );
-        if( queue_count )
-        {
-            [fQueueStatus setStringValue: [NSString stringWithFormat:
-                @"%d task%s in the queue",
-                queue_count, ( queue_count > 1 ) ? "s" : ""]];
-        }
-        else
-        {
-            [fQueueStatus setStringValue: @""];
-        }
-
+               here in the main window*/
+       int queue_count = hb_count( fHandle );
+       if( queue_count )
+       {
+               [fQueueStatus setStringValue: [NSString stringWithFormat:
+                       @"%d task%s in the queue",
+                                                queue_count, ( queue_count > 1 ) ? "s" : ""]];
+       }
+       else
+       {
+               [fQueueStatus setStringValue: @""];
+       }
+       
     [[NSRunLoop currentRunLoop] addTimer: [NSTimer
         scheduledTimerWithTimeInterval: 0.2 target: self
-        selector: @selector( UpdateUI: ) userInfo: NULL repeats: FALSE]
-        forMode: NSModalPanelRunLoopMode];
+                                                         selector: @selector( UpdateUI: ) userInfo: NULL repeats: FALSE]
+                                                                forMode: NSModalPanelRunLoopMode];
 }
 - (IBAction) ShowNewScan:(id)sender
 {
@@ -670,8 +906,13 @@ if (checkScanCount > currentScanCount)
                        
             [self TitlePopUpChanged: NULL];
             [self EnableUI: YES];
-            [fPauseButton setEnabled: NO];
-            [fRipButton   setEnabled: YES];
+            //[fPauseButton setEnabled: NO];
+            //[fRipButton   setEnabled: YES];
+               startButtonEnabled = YES;
+       stopOrStart = NO;
+       AddToQueueButtonEnabled = YES;
+       pauseButtonEnabled = NO;
+       resumeOrPause = NO;
 }
 
 
@@ -1090,8 +1331,9 @@ if (checkScanCount > currentScanCount)
 - (IBAction) Rip: (id) sender
 {
     /* Rip or Cancel ? */
-    if( [[fRipButton title] isEqualToString: _( @"Cancel" )] )
-    {
+ //   if( [[fRipButton title] isEqualToString: _( @"Cancel" )] )
+    if(stopOrStart)
+       {
         [self Cancel: sender];
         return;
     }
@@ -1163,11 +1405,19 @@ if (checkScanCount > currentScanCount)
     hb_start( fHandle );
        /*set the fEncodeState State */
        fEncodeState = 1;
-
+       
     /* Disable interface */
-   //[self EnableUI: NO];
-    [fPauseButton setEnabled: NO];
-    [fRipButton   setEnabled: NO];
+       //[self EnableUI: NO];
+       // [fPauseButton setEnabled: NO];
+       // [fRipButton   setEnabled: NO];
+       pauseButtonEnabled = NO;
+       startButtonEnabled = NO;
+       NSRect frame = [fWindow frame];
+    if (frame.size.width <= 591)
+        frame.size.width = 591;
+    frame.size.height += 44;
+    frame.origin.y -= 44;
+    [fWindow setFrame:frame display:YES animate:YES];
 }
 
 - (IBAction) Cancel: (id) sender
@@ -1184,8 +1434,10 @@ if (checkScanCount > currentScanCount)
     if( returnCode == NSAlertAlternateReturn )
     {
         hb_stop( fHandle );
-        [fPauseButton setEnabled: NO];
-        [fRipButton   setEnabled: NO];
+       // [fPauseButton setEnabled: NO];
+       // [fRipButton   setEnabled: NO];
+          pauseButtonEnabled = NO;
+       startButtonEnabled = NO;
                /*set the fEncodeState State */
             fEncodeState = 2;
     }
@@ -1193,10 +1445,14 @@ if (checkScanCount > currentScanCount)
 
 - (IBAction) Pause: (id) sender
 {
-    [fPauseButton setEnabled: NO];
-    [fRipButton   setEnabled: NO];
+   // [fPauseButton setEnabled: NO];
+   // [fRipButton   setEnabled: NO];
+
+   // if( [[fPauseButton title] isEqualToString: _( @"Resume" )] )
+          pauseButtonEnabled = NO;
+       startButtonEnabled = NO;
 
-    if( [[fPauseButton title] isEqualToString: _( @"Resume" )] )
+    if(resumeOrPause)
     {
         hb_resume( fHandle );
     }
index 6967469..b1874b1 100644 (file)
@@ -51,7 +51,6 @@
             LANGUAGE = ObjC; 
             OUTLETS = {
                 fAddPresetPanel = NSPanel; 
-                fAddToQuButton = NSButton; 
                 fAudBitrateField = NSTextField; 
                 fAudBitratePopUp = NSPopUpButton; 
                 fAudLang1Field = NSTextField; 
@@ -76,7 +75,6 @@
                 fDstFormatField = NSTextField; 
                 fDstFormatPopUp = NSPopUpButton; 
                 fDstMpgLargeFileCheck = NSButton; 
-                fPauseButton = NSButton; 
                 fPicLabelAnamorphic = NSTextField; 
                 fPicLabelAr = NSTextField; 
                 fPicLabelDeinter = NSTextField; 
                 fPresetSelectedDisplay = NSTextField; 
                 fPresetsAdd = NSButton; 
                 fPresetsDelete = NSButton; 
-                fQueueAddButton = NSButton; 
                 fQueueController = QueueController; 
                 fQueuePanel = NSPanel; 
-                fQueueShowButton = NSButton; 
                 fQueueStatus = NSTextField; 
-                fRipButton = NSButton; 
                 fRipIndicator = NSProgressIndicator; 
                 fScanController = ScanController; 
                 fScanPanel = NSPanel; 
-                fShowQuButton = NSButton; 
                 fSrcChapterEndPopUp = NSPopUpButton; 
                 fSrcChapterField = NSTextField; 
                 fSrcChapterStartPopUp = NSPopUpButton; 
index 67485c2..dfc9a03 100644 (file)
@@ -7,7 +7,7 @@
        <key>IBEditorPositions</key>
        <dict>
                <key>1843</key>
-               <string>863 409 220 592 0 0 1920 1058 </string>
+               <string>620 338 200 530 0 0 1440 878 </string>
                <key>29</key>
                <string>155 478 365 44 0 0 1440 878 </string>
        </dict>
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>29</integer>
+               <integer>1843</integer>
+               <integer>365</integer>
                <integer>21</integer>
+               <integer>29</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8R2218</string>
@@ -30,8 +32,7 @@
                <dict>
                        <key>guideLocations</key>
                        <array>
-                               <string>Horizontal:576.000000</string>
-                               <string>Horizontal:318.000000</string>
+                               <string>Horizontal:492.000000</string>
                        </array>
                        <key>guidesLocked</key>
                        <false/>
index 2af236d..b22d0d9 100644 (file)
Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ
index 708844c..c402823 100644 (file)
@@ -17,6 +17,6 @@
                <integer>11</integer>
        </array>
        <key>IBSystem Version</key>
-       <string>8P2137</string>
+       <string>8R2218</string>
 </dict>
 </plist>
index f3f7253..60e0347 100644 (file)
Binary files a/macosx/English.lproj/OutputPanel.nib/keyedobjects.nib and b/macosx/English.lproj/OutputPanel.nib/keyedobjects.nib differ
index 5a8f75a..fc250f5 100644 (file)
                593034EC0BBA39A100172349 /* ChapterTitles.m in Sources */ = {isa = PBXBuildFile; fileRef = 593034EA0BBA39A100172349 /* ChapterTitles.m */; };
                59CBD2370BBB44DA004A3BE3 /* parsecsv.c in Sources */ = {isa = PBXBuildFile; fileRef = 59CBD2360BBB44DA004A3BE3 /* parsecsv.c */; };
                59CBD2650BBB4D1B004A3BE3 /* ChapterTitles.m in Sources */ = {isa = PBXBuildFile; fileRef = 593034EA0BBA39A100172349 /* ChapterTitles.m */; };
+               A273E04E0C57B39A00493A45 /* Add.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A273E0470C57B39A00493A45 /* Add.tiff */; };
+               A273E04F0C57B39A00493A45 /* Brushed Window.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A273E0480C57B39A00493A45 /* Brushed Window.tiff */; };
+               A273E0500C57B39A00493A45 /* Drawer-List2.png in Resources */ = {isa = PBXBuildFile; fileRef = A273E0490C57B39A00493A45 /* Drawer-List2.png */; };
+               A273E0510C57B39A00493A45 /* Pause.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A273E04A0C57B39A00493A45 /* Pause.tiff */; };
+               A273E0520C57B39A00493A45 /* Play.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A273E04B0C57B39A00493A45 /* Play.tiff */; };
+               A273E0530C57B39A00493A45 /* Stop.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A273E04C0C57B39A00493A45 /* Stop.tiff */; };
+               A273E0540C57B39A00493A45 /* Terminal.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A273E04D0C57B39A00493A45 /* Terminal.tiff */; };
+               A273E09A0C57C1CC00493A45 /* muxmkv.c in Sources */ = {isa = PBXBuildFile; fileRef = A273E0950C57C19500493A45 /* muxmkv.c */; };
+               A273E09B0C57C1CD00493A45 /* muxmkv.c in Sources */ = {isa = PBXBuildFile; fileRef = A273E0950C57C19500493A45 /* muxmkv.c */; };
                A29E05800BE1283E000533F5 /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A29E057F0BE1283E000533F5 /* Growl.framework */; };
                A29E058B0BE12889000533F5 /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A29E057F0BE1283E000533F5 /* Growl.framework */; };
                EAA526930C3B25D200944FF2 /* stream.c in Sources */ = {isa = PBXBuildFile; fileRef = EAA526920C3B25D200944FF2 /* stream.c */; };
                EAA526940C3B25D200944FF2 /* stream.c in Sources */ = {isa = PBXBuildFile; fileRef = EAA526920C3B25D200944FF2 /* stream.c */; };
-               FC6CE2C10C495A6B001A2D5B /* muxmkv.c in Sources */ = {isa = PBXBuildFile; fileRef = FC6CE2C00C495A6B001A2D5B /* muxmkv.c */; };
-               FC6CE2C20C495A6B001A2D5B /* muxmkv.c in Sources */ = {isa = PBXBuildFile; fileRef = FC6CE2C00C495A6B001A2D5B /* muxmkv.c */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
                593034E90BBA39A100172349 /* ChapterTitles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChapterTitles.h; sourceTree = "<group>"; };
                593034EA0BBA39A100172349 /* ChapterTitles.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChapterTitles.m; sourceTree = "<group>"; };
                59CBD2360BBB44DA004A3BE3 /* parsecsv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = parsecsv.c; path = ../test/parsecsv.c; sourceTree = SOURCE_ROOT; };
+               A273E0470C57B39A00493A45 /* Add.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Add.tiff; sourceTree = "<group>"; };
+               A273E0480C57B39A00493A45 /* Brushed Window.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "Brushed Window.tiff"; sourceTree = "<group>"; };
+               A273E0490C57B39A00493A45 /* Drawer-List2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Drawer-List2.png"; sourceTree = "<group>"; };
+               A273E04A0C57B39A00493A45 /* Pause.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Pause.tiff; sourceTree = "<group>"; };
+               A273E04B0C57B39A00493A45 /* Play.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Play.tiff; sourceTree = "<group>"; };
+               A273E04C0C57B39A00493A45 /* Stop.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Stop.tiff; sourceTree = "<group>"; };
+               A273E04D0C57B39A00493A45 /* Terminal.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Terminal.tiff; sourceTree = "<group>"; };
+               A273E0950C57C19500493A45 /* muxmkv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = muxmkv.c; path = ../libhb/muxmkv.c; sourceTree = SOURCE_ROOT; };
                A29E057F0BE1283E000533F5 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Growl.framework; sourceTree = "<group>"; };
                EAA526920C3B25D200944FF2 /* stream.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = stream.c; path = ../libhb/stream.c; sourceTree = SOURCE_ROOT; };
-               FC6CE2C00C495A6B001A2D5B /* muxmkv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = muxmkv.c; path = ../libhb/muxmkv.c; sourceTree = SOURCE_ROOT; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
                29B97314FDCFA39411CA2CEA /* HandBrake */ = {
                        isa = PBXGroup;
                        children = (
-                               FC6CE2C00C495A6B001A2D5B /* muxmkv.c */,
+                               A273E0460C57B39A00493A45 /* icons */,
                                526FBC940B4CAA310064E04C /* Instant HandBrake Sources */,
                                526FBC930B4CAA260064E04C /* HandBrake Sources */,
                                526FBC920B4CAA120064E04C /* HandBrakeCLI Sources */,
                526FBC8D0B4CA9F90064E04C /* libhb Sources */ = {
                        isa = PBXGroup;
                        children = (
+                               A273E0950C57C19500493A45 /* muxmkv.c */,
                                EAA526920C3B25D200944FF2 /* stream.c */,
                                0DFA5C7E0B8DD3B60020BC09 /* declpcm.c */,
                                0DFA5C7F0B8DD3B60020BC09 /* decmpeg2.c */,
                        name = "Instant HandBrake Sources";
                        sourceTree = "<group>";
                };
+               A273E0460C57B39A00493A45 /* icons */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A273E0470C57B39A00493A45 /* Add.tiff */,
+                               A273E0480C57B39A00493A45 /* Brushed Window.tiff */,
+                               A273E0490C57B39A00493A45 /* Drawer-List2.png */,
+                               A273E04A0C57B39A00493A45 /* Pause.tiff */,
+                               A273E04B0C57B39A00493A45 /* Play.tiff */,
+                               A273E04C0C57B39A00493A45 /* Stop.tiff */,
+                               A273E04D0C57B39A00493A45 /* Terminal.tiff */,
+                       );
+                       path = icons;
+                       sourceTree = "<group>";
+               };
 /* End PBXGroup section */
 
 /* Begin PBXHeadersBuildPhase section */
                                0DFA5C7B0B8DD1E90020BC09 /* HandBrake.icns in Resources */,
                                2538860C0BFE0B730064E995 /* OutputPanel.nib in Resources */,
                                25DE1FAD0C1699E500F01FC8 /* Preferences.nib in Resources */,
+                               A273E04E0C57B39A00493A45 /* Add.tiff in Resources */,
+                               A273E04F0C57B39A00493A45 /* Brushed Window.tiff in Resources */,
+                               A273E0500C57B39A00493A45 /* Drawer-List2.png in Resources */,
+                               A273E0510C57B39A00493A45 /* Pause.tiff in Resources */,
+                               A273E0520C57B39A00493A45 /* Play.tiff in Resources */,
+                               A273E0530C57B39A00493A45 /* Stop.tiff in Resources */,
+                               A273E0540C57B39A00493A45 /* Terminal.tiff in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                0D096E030B707D3400A845D4 /* decavcodec.c in Sources */,
                                5558B56A0BE3BADF00E15E27 /* decdca.c in Sources */,
                                EAA526940C3B25D200944FF2 /* stream.c in Sources */,
-                               FC6CE2C20C495A6B001A2D5B /* muxmkv.c in Sources */,
+                               A273E09B0C57C1CD00493A45 /* muxmkv.c in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                593034EC0BBA39A100172349 /* ChapterTitles.m in Sources */,
                                5558B5690BE3BADF00E15E27 /* decdca.c in Sources */,
                                EAA526930C3B25D200944FF2 /* stream.c in Sources */,
-                               FC6CE2C10C495A6B001A2D5B /* muxmkv.c in Sources */,
+                               A273E09A0C57C1CC00493A45 /* muxmkv.c in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/macosx/icons/Add.tiff b/macosx/icons/Add.tiff
new file mode 100644 (file)
index 0000000..9284fa0
Binary files /dev/null and b/macosx/icons/Add.tiff differ
diff --git a/macosx/icons/Brushed Window.tiff b/macosx/icons/Brushed Window.tiff
new file mode 100644 (file)
index 0000000..30a820b
Binary files /dev/null and b/macosx/icons/Brushed Window.tiff differ
diff --git a/macosx/icons/Drawer-List2.png b/macosx/icons/Drawer-List2.png
new file mode 100644 (file)
index 0000000..592e886
Binary files /dev/null and b/macosx/icons/Drawer-List2.png differ
diff --git a/macosx/icons/Pause.tiff b/macosx/icons/Pause.tiff
new file mode 100644 (file)
index 0000000..50b7362
Binary files /dev/null and b/macosx/icons/Pause.tiff differ
diff --git a/macosx/icons/Play.tiff b/macosx/icons/Play.tiff
new file mode 100644 (file)
index 0000000..916ec8d
Binary files /dev/null and b/macosx/icons/Play.tiff differ
diff --git a/macosx/icons/Stop.tiff b/macosx/icons/Stop.tiff
new file mode 100644 (file)
index 0000000..5ebae6d
Binary files /dev/null and b/macosx/icons/Stop.tiff differ
diff --git a/macosx/icons/Terminal.tiff b/macosx/icons/Terminal.tiff
new file mode 100644 (file)
index 0000000..a568c73
Binary files /dev/null and b/macosx/icons/Terminal.tiff differ