⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 intf.m

📁 video linux conference
💻 M
📖 第 1 页 / 共 4 页
字号:
    {        playlist_Stop( p_playlist );        vlc_object_release( p_playlist );    }    /* FIXME - Wait here until all vouts are terminated because       libvlc's VLC_CleanUp destroys interfaces before vouts, which isn't       good on OS X. We definitly need a cleaner way to handle this,       but this may hopefully be good enough for now.         -- titer 2003/11/22 */    while( ( p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,                                       FIND_ANYWHERE ) ) )    {        vlc_object_release( p_vout );        msleep( 100000 );    }    msleep( 500000 );    if( o_img_pause_pressed != nil )    {        [o_img_pause_pressed release];        o_img_pause_pressed = nil;    }    if( o_img_pause_pressed != nil )    {        [o_img_pause_pressed release];        o_img_pause_pressed = nil;    }    if( o_img_pause != nil )    {        [o_img_pause release];        o_img_pause = nil;    }    if( o_img_play != nil )    {        [o_img_play release];        o_img_play = nil;    }    if( o_msg_arr != nil )    {        [o_msg_arr removeAllObjects];        [o_msg_arr release];        o_msg_arr = nil;    }    if( o_msg_lock != nil )    {        [o_msg_lock release];        o_msg_lock = nil;    }    /* write cached user defaults to disk */    [[NSUserDefaults standardUserDefaults] synchronize];    p_intf->b_die = VLC_TRUE;    [NSApp stop:NULL];}- (IBAction)clearRecentItems:(id)sender{    [[NSDocumentController sharedDocumentController]                          clearRecentDocuments: nil];}- (void)openRecentItem:(id)sender{    [self application: nil openFile: [sender title]];}- (IBAction)intfOpenFile:(id)sender{    if (!nib_open_loaded)    {        nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];        [o_open awakeFromNib];        [o_open openFile];    } else {        [o_open openFile];    }}- (IBAction)intfOpenFileGeneric:(id)sender{    if (!nib_open_loaded)    {        nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];        [o_open awakeFromNib];        [o_open openFileGeneric];    } else {        [o_open openFileGeneric];    }}- (IBAction)intfOpenDisc:(id)sender{    if (!nib_open_loaded)    {        nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];        [o_open awakeFromNib];        [o_open openDisc];    } else {        [o_open openDisc];    }}- (IBAction)intfOpenNet:(id)sender{    if (!nib_open_loaded)    {        nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];        [o_open awakeFromNib];        [o_open openNet];    } else {        [o_open openNet];    }}- (IBAction)viewAbout:(id)sender{    [o_about showPanel];}- (IBAction)viewPreferences:(id)sender{/* GRUIIIIIIIK */    if( o_prefs == nil )        o_prefs = [[VLCPrefs alloc] init];    [o_prefs showPrefs];}- (IBAction)closeError:(id)sender{    vlc_value_t val;    if( [o_err_ckbk_surpress state] == NSOnState )    {        val.i_int = -1;        var_Set( p_intf->p_vlc, "verbose", val );    }    [o_err_msg setString: @""];    [o_error performClose: self];}- (IBAction)openReadMe:(id)sender{    NSString * o_path = [[NSBundle mainBundle]        pathForResource: @"README.MacOSX" ofType: @"rtf"];    [[NSWorkspace sharedWorkspace] openFile: o_path                                   withApplication: @"TextEdit"];}- (IBAction)openDocumentation:(id)sender{    NSURL * o_url = [NSURL URLWithString:        @"http://www.videolan.org/doc/"];    [[NSWorkspace sharedWorkspace] openURL: o_url];}- (IBAction)reportABug:(id)sender{    NSURL * o_url = [NSURL URLWithString:        @"http://www.videolan.org/support/bug-reporting.html"];    [[NSWorkspace sharedWorkspace] openURL: o_url];}- (IBAction)openWebsite:(id)sender{    NSURL * o_url = [NSURL URLWithString: @"http://www.videolan.org/"];    [[NSWorkspace sharedWorkspace] openURL: o_url];}- (IBAction)openLicense:(id)sender{    NSString * o_path = [[NSBundle mainBundle]        pathForResource: @"COPYING" ofType: nil];    [[NSWorkspace sharedWorkspace] openFile: o_path                                   withApplication: @"TextEdit"];}- (IBAction)openForum:(id)sender{    NSURL * o_url = [NSURL URLWithString: @"http://forum.videolan.org/"];    [[NSWorkspace sharedWorkspace] openURL: o_url];}- (IBAction)openDonate:(id)sender{    NSURL * o_url = [NSURL URLWithString: @"http://www.videolan.org/contribute.html#paypal"];    [[NSWorkspace sharedWorkspace] openURL: o_url];}- (IBAction)openCrashLog:(id)sender{    NSString * o_path = [@"~/Library/Logs/CrashReporter/VLC.crash.log"                                    stringByExpandingTildeInPath];    if ( [[NSFileManager defaultManager] fileExistsAtPath: o_path ] )    {        [[NSWorkspace sharedWorkspace] openFile: o_path                                    withApplication: @"Console"];    }    else    {        NSBeginInformationalAlertSheet(_NS("No CrashLog found"), @"Continue", nil, nil, o_msgs_panel, self, NULL, NULL, nil, _NS("Either you are running Mac OS X pre 10.2 or you haven't experienced any heavy crashes yet.") );    }}- (void)windowDidBecomeKey:(NSNotification *)o_notification{    if( [o_notification object] == o_msgs_panel )    {        id o_msg;        NSEnumerator * o_enum;        [o_messages setString: @""];        [o_msg_lock lock];        o_enum = [o_msg_arr objectEnumerator];        while( ( o_msg = [o_enum nextObject] ) != nil )        {            [o_messages insertText: o_msg];        }        [o_msg_lock unlock];    }}- (IBAction)togglePlaylist:(id)sender{    NSRect o_rect = [o_window frame];    /*First, check if the playlist is visible*/    if( o_rect.size.height <= 200 )    {        b_small_window = YES; /* we know we are small, make sure this is actually set (see case below) */        /* make large */        if ( o_size_with_playlist.height > 200 )        {            o_rect.size.height = o_size_with_playlist.height;        } else {            o_rect.size.height = 500;        }                if ( o_size_with_playlist.width > [o_window minSize].width )        {            o_rect.size.width = o_size_with_playlist.width;        } else {            o_rect.size.width = 500;        }                o_rect.size.height = (o_size_with_playlist.height > 200) ?            o_size_with_playlist.height : 500;        o_rect.origin.x = [o_window frame].origin.x;        o_rect.origin.y = [o_window frame].origin.y - o_rect.size.height +                                                [o_window minSize].height;        [o_btn_playlist setState: YES];    }    else    {        /* make small */        o_rect.size.height = [o_window minSize].height;        o_rect.size.width = [o_window minSize].width;        o_rect.origin.x = [o_window frame].origin.x;        /* Calculate the position of the lower right corner after resize */        o_rect.origin.y = [o_window frame].origin.y +            [o_window frame].size.height - [o_window minSize].height;                [o_playlist_view setAutoresizesSubviews: NO];        [o_playlist_view removeFromSuperview];        [o_btn_playlist setState: NO];        b_small_window = NO; /* we aren't small here just yet. we are doing an animated resize after this */    }    [o_window setFrame: o_rect display:YES animate: YES];}- (void)updateTogglePlaylistState{    if( [o_window frame].size.height <= 200 )    {        [o_btn_playlist setState: NO];    }    else    {        [o_btn_playlist setState: YES];    }}- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)proposedFrameSize{    /* Not triggered on a window resize or maxification of the window. only by window mouse dragging resize */   /*Stores the size the controller one resize, to be able to restore it when     toggling the playlist*/    o_size_with_playlist = proposedFrameSize;    if( proposedFrameSize.height <= 200 )    {        if( b_small_window == NO )        {            /* if large and going to small then hide */            b_small_window = YES;            [o_playlist_view setAutoresizesSubviews: NO];            [o_playlist_view removeFromSuperview];        }        return NSMakeSize( proposedFrameSize.width, [o_window minSize].height);    }    return proposedFrameSize;}- (void)windowDidResize:(NSNotification *)notif{    if( [o_window frame].size.height > 200 && b_small_window )    {        /* If large and coming from small then show */        [o_playlist_view setAutoresizesSubviews: YES];        [o_playlist_view setFrame: NSMakeRect( 10, 10, [o_window frame].size.width - 20, [o_window frame].size.height - [o_window minSize].height - 10 )];        [o_playlist_view setNeedsDisplay:YES];        [[o_window contentView] addSubview: o_playlist_view];        b_small_window = NO;    }    [self updateTogglePlaylistState];}@end@implementation VLCMain (NSMenuValidation)- (BOOL)validateMenuItem:(NSMenuItem *)o_mi{    NSString *o_title = [o_mi title];    BOOL bEnabled = TRUE;    /* Recent Items Menu */    if( [o_title isEqualToString: _NS("Clear Menu")] )    {        NSMenu * o_menu = [o_mi_open_recent submenu];        int i_nb_items = [o_menu numberOfItems];        NSArray * o_docs = [[NSDocumentController sharedDocumentController]                                                       recentDocumentURLs];        UInt32 i_nb_docs = [o_docs count];        if( i_nb_items > 1 )        {            while( --i_nb_items )            {                [o_menu removeItemAtIndex: 0];            }        }        if( i_nb_docs > 0 )        {            NSURL * o_url;            NSString * o_doc;            [o_menu insertItem: [NSMenuItem separatorItem] atIndex: 0];            while( TRUE )            {                i_nb_docs--;                o_url = [o_docs objectAtIndex: i_nb_docs];                if( [o_url isFileURL] )                {                    o_doc = [o_url path];                }                else                {                    o_doc = [o_url absoluteString];                }                [o_menu insertItemWithTitle: o_doc                    action: @selector(openRecentItem:)                    keyEquivalent: @"" atIndex: 0];                if( i_nb_docs == 0 )                {                    break;                }            }        }        else        {            bEnabled = FALSE;        }    }    return( bEnabled );}@end@implementation VLCMain (Internal)- (void)handlePortMessage:(NSPortMessage *)o_msg{    id ** val;    NSData * o_data;    NSValue * o_value;    NSInvocation * o_inv;    NSConditionLock * o_lock;    o_data = [[o_msg components] lastObject];    o_inv = *((NSInvocation **)[o_data bytes]);    [o_inv getArgument: &o_value atIndex: 2];    val = (id **)[o_value pointerValue];    [o_inv setArgument: val[1] atIndex: 2];    o_lock = *(val[0]);    [o_lock lock];    [o_inv invoke];    [o_lock unlockWithCondition: 1];}@end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -