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

📄 intf.m

📁 VLC Player Source Code
💻 M
📖 第 1 页 / 共 5 页
字号:
    o_size_with_playlist = [o_window contentRectForFrameRect:[o_window frame]].size;    p_playlist = pl_Yield( p_intf );    var_Create( p_playlist, "fullscreen", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);    val.b_bool = false;    var_AddCallback( p_playlist, "fullscreen", FullscreenChanged, self);    var_AddCallback( p_intf->p_libvlc, "intf-show", ShowController, self);    pl_Release( p_intf );     var_Create( p_intf, "interaction", VLC_VAR_ADDRESS );    var_AddCallback( p_intf, "interaction", InteractCallback, self );    p_intf->b_interaction = true;    /* update the playmode stuff */    p_intf->p_sys->b_playmode_update = true;    [[NSNotificationCenter defaultCenter] addObserver: self                                             selector: @selector(refreshVoutDeviceMenu:)                                                 name: NSApplicationDidChangeScreenParametersNotification                                               object: nil];    o_img_play = [NSImage imageNamed: @"play"];    o_img_pause = [NSImage imageNamed: @"pause"];            [self controlTintChanged];    [[NSNotificationCenter defaultCenter] addObserver: self                                             selector: @selector( controlTintChanged )                                                 name: NSControlTintDidChangeNotification                                               object: nil];        nib_main_loaded = TRUE;}- (void)applicationWillFinishLaunching:(NSNotification *)o_notification{    o_msg_lock = [[NSLock alloc] init];    o_msg_arr = [[NSMutableArray arrayWithCapacity: 200] retain];    /* FIXME: don't poll */    interfaceTimer = [[NSTimer scheduledTimerWithTimeInterval: 0.5                                     target: self selector: @selector(manageIntf:)                                   userInfo: nil repeats: FALSE] retain];    /* Note: we use the pthread API to support pre-10.5 */    pthread_create( &manage_thread, NULL, ManageThread, self );    [o_controls setupVarMenuItem: o_mi_add_intf target: (vlc_object_t *)p_intf        var: "intf-add" selector: @selector(toggleVar:)];    /* check whether the user runs a valid version of OSX; alert is auto-released */    if( MACOS_VERSION < 10.4f )    {        NSAlert *ourAlert;        int i_returnValue;        ourAlert = [NSAlert alertWithMessageText: _NS("Your version of Mac OS X is not supported")                        defaultButton: _NS("Quit")                      alternateButton: NULL                          otherButton: NULL            informativeTextWithFormat: _NS("VLC media player requires Mac OS X 10.4 or higher.")];        [ourAlert setAlertStyle: NSCriticalAlertStyle];        i_returnValue = [ourAlert runModal];        [NSApp terminate: self];    }    vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_LOW );}- (void)applicationDidFinishLaunching:(NSNotification *)aNotification{#ifdef UPDATE_CHECK    /* Check for update silently on startup */    if( !nib_update_loaded )        nib_update_loaded = [NSBundle loadNibNamed:@"Update" owner:self];    if([o_update shouldCheckForUpdate])        [NSThread detachNewThreadSelector:@selector(checkForUpdate) toTarget:o_update withObject:nil];#endif    /* Handle sleep notification */    [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(computerWillSleep:)           name:NSWorkspaceWillSleepNotification object:nil];    [NSThread detachNewThreadSelector:@selector(lookForCrashLog) toTarget:self withObject:nil];}- (void)initStrings{    [o_window setTitle: _NS("VLC media player")];    [self setScrollField:_NS("VLC media player") stopAfter:-1];    /* button controls */    [o_btn_prev setToolTip: _NS("Previous")];    [o_btn_rewind setToolTip: _NS("Rewind")];    [o_btn_play setToolTip: _NS("Play")];    [o_btn_stop setToolTip: _NS("Stop")];    [o_btn_ff setToolTip: _NS("Fast Forward")];    [o_btn_next setToolTip: _NS("Next")];    [o_btn_fullscreen setToolTip: _NS("Fullscreen")];    [o_volumeslider setToolTip: _NS("Volume")];    [o_timeslider setToolTip: _NS("Position")];    [o_btn_playlist setToolTip: _NS("Playlist")];    /* messages panel */    [o_msgs_panel setTitle: _NS("Messages")];    [o_msgs_btn_crashlog setTitle: _NS("Open CrashLog...")];    /* main menu */    [o_mi_about setTitle: [_NS("About VLC media player") \        stringByAppendingString: @"..."]];    [o_mi_checkForUpdate setTitle: _NS("Check for Update...")];    [o_mi_prefs setTitle: _NS("Preferences...")];    [o_mi_add_intf setTitle: _NS("Add Interface")];    [o_mu_add_intf setTitle: _NS("Add Interface")];    [o_mi_services setTitle: _NS("Services")];    [o_mi_hide setTitle: _NS("Hide VLC")];    [o_mi_hide_others setTitle: _NS("Hide Others")];    [o_mi_show_all setTitle: _NS("Show All")];    [o_mi_quit setTitle: _NS("Quit VLC")];    [o_mu_file setTitle: _ANS("1:File")];    [o_mi_open_generic setTitle: _NS("Open File...")];    [o_mi_open_file setTitle: _NS("Quick Open File...")];    [o_mi_open_disc setTitle: _NS("Open Disc...")];    [o_mi_open_net setTitle: _NS("Open Network...")];    [o_mi_open_capture setTitle: _NS("Open Capture Device...")];    [o_mi_open_recent setTitle: _NS("Open Recent")];    [o_mi_open_recent_cm setTitle: _NS("Clear Menu")];    [o_mi_open_wizard setTitle: _NS("Streaming/Exporting Wizard...")];    [o_mu_edit setTitle: _NS("Edit")];    [o_mi_cut setTitle: _NS("Cut")];    [o_mi_copy setTitle: _NS("Copy")];    [o_mi_paste setTitle: _NS("Paste")];    [o_mi_clear setTitle: _NS("Clear")];    [o_mi_select_all setTitle: _NS("Select All")];    [o_mu_controls setTitle: _NS("Playback")];    [o_mi_play setTitle: _NS("Play")];    [o_mi_stop setTitle: _NS("Stop")];    [o_mi_faster setTitle: _NS("Faster")];    [o_mi_slower setTitle: _NS("Slower")];    [o_mi_previous setTitle: _NS("Previous")];    [o_mi_next setTitle: _NS("Next")];    [o_mi_random setTitle: _NS("Random")];    [o_mi_repeat setTitle: _NS("Repeat One")];    [o_mi_loop setTitle: _NS("Repeat All")];    [o_mi_fwd setTitle: _NS("Step Forward")];    [o_mi_bwd setTitle: _NS("Step Backward")];    [o_mi_program setTitle: _NS("Program")];    [o_mu_program setTitle: _NS("Program")];    [o_mi_title setTitle: _NS("Title")];    [o_mu_title setTitle: _NS("Title")];    [o_mi_chapter setTitle: _NS("Chapter")];    [o_mu_chapter setTitle: _NS("Chapter")];    [o_mu_audio setTitle: _NS("Audio")];    [o_mi_vol_up setTitle: _NS("Volume Up")];    [o_mi_vol_down setTitle: _NS("Volume Down")];    [o_mi_mute setTitle: _NS("Mute")];    [o_mi_audiotrack setTitle: _NS("Audio Track")];    [o_mu_audiotrack setTitle: _NS("Audio Track")];    [o_mi_channels setTitle: _NS("Audio Channels")];    [o_mu_channels setTitle: _NS("Audio Channels")];    [o_mi_device setTitle: _NS("Audio Device")];    [o_mu_device setTitle: _NS("Audio Device")];    [o_mi_visual setTitle: _NS("Visualizations")];    [o_mu_visual setTitle: _NS("Visualizations")];    [o_mu_video setTitle: _NS("Video")];    [o_mi_half_window setTitle: _NS("Half Size")];    [o_mi_normal_window setTitle: _NS("Normal Size")];    [o_mi_double_window setTitle: _NS("Double Size")];    [o_mi_fittoscreen setTitle: _NS("Fit to Screen")];    [o_mi_fullscreen setTitle: _NS("Fullscreen")];    [o_mi_floatontop setTitle: _NS("Float on Top")];    [o_mi_snapshot setTitle: _NS("Snapshot")];    [o_mi_videotrack setTitle: _NS("Video Track")];    [o_mu_videotrack setTitle: _NS("Video Track")];    [o_mi_aspect_ratio setTitle: _NS("Aspect-ratio")];    [o_mu_aspect_ratio setTitle: _NS("Aspect-ratio")];    [o_mi_crop setTitle: _NS("Crop")];    [o_mu_crop setTitle: _NS("Crop")];    [o_mi_screen setTitle: _NS("Fullscreen Video Device")];    [o_mu_screen setTitle: _NS("Fullscreen Video Device")];    [o_mi_subtitle setTitle: _NS("Subtitles Track")];    [o_mu_subtitle setTitle: _NS("Subtitles Track")];    [o_mi_deinterlace setTitle: _NS("Deinterlace")];    [o_mu_deinterlace setTitle: _NS("Deinterlace")];    [o_mi_ffmpeg_pp setTitle: _NS("Post processing")];    [o_mu_ffmpeg_pp setTitle: _NS("Post processing")];    [o_mu_window setTitle: _NS("Window")];    [o_mi_minimize setTitle: _NS("Minimize Window")];    [o_mi_close_window setTitle: _NS("Close Window")];    [o_mi_controller setTitle: _NS("Controller...")];    [o_mi_equalizer setTitle: _NS("Equalizer...")];    [o_mi_extended setTitle: _NS("Extended Controls...")];    [o_mi_bookmarks setTitle: _NS("Bookmarks...")];    [o_mi_playlist setTitle: _NS("Playlist...")];    [o_mi_info setTitle: _NS("Media Information...")];    [o_mi_messages setTitle: _NS("Messages...")];    [o_mi_errorsAndWarnings setTitle: _NS("Errors and Warnings...")];    [o_mi_bring_atf setTitle: _NS("Bring All to Front")];    [o_mu_help setTitle: _NS("Help")];    [o_mi_help setTitle: _NS("VLC media player Help...")];    [o_mi_readme setTitle: _NS("ReadMe / FAQ...")];    [o_mi_license setTitle: _NS("License")];    [o_mi_documentation setTitle: _NS("Online Documentation...")];    [o_mi_website setTitle: _NS("VideoLAN Website...")];    [o_mi_donation setTitle: _NS("Make a donation...")];    [o_mi_forum setTitle: _NS("Online Forum...")];    /* dock menu */    [o_dmi_play setTitle: _NS("Play")];    [o_dmi_stop setTitle: _NS("Stop")];    [o_dmi_next setTitle: _NS("Next")];    [o_dmi_previous setTitle: _NS("Previous")];    [o_dmi_mute setTitle: _NS("Mute")];     /* vout menu */    [o_vmi_play setTitle: _NS("Play")];    [o_vmi_stop setTitle: _NS("Stop")];    [o_vmi_prev setTitle: _NS("Previous")];    [o_vmi_next setTitle: _NS("Next")];    [o_vmi_volup setTitle: _NS("Volume Up")];    [o_vmi_voldown setTitle: _NS("Volume Down")];    [o_vmi_mute setTitle: _NS("Mute")];    [o_vmi_fullscreen setTitle: _NS("Fullscreen")];    [o_vmi_snapshot setTitle: _NS("Snapshot")];    /* crash reporter panel */    [o_crashrep_send_btn setTitle: _NS("Send")];    [o_crashrep_dontSend_btn setTitle: _NS("Don't Send")];    [o_crashrep_title_txt setStringValue: _NS("VLC crashed previously")];    [o_crashrep_win setTitle: _NS("VLC crashed previously")];    [o_crashrep_desc_txt setStringValue: _NS("Do you want to send details on the crash to VLC's development team?\n\nIf you want, you can enter a few lines on what you did before VLC crashed along with other helpful information: a link to download a sample file, a URL of a network stream, ...")];}#pragma mark -#pragma mark Termination- (void)applicationWillTerminate:(NSNotification *)notification{    playlist_t * p_playlist;    vout_thread_t * p_vout;    int returnedValue = 0;     msg_Dbg( p_intf, "Terminating" );    /* Make sure the manage_thread won't call -terminate: again */    pthread_cancel( manage_thread );    /* Make sure the intf object is getting killed */    vlc_object_kill( p_intf );    /* Make sure our manage_thread ends */    pthread_join( manage_thread, NULL );    /* Make sure the interfaceTimer is destroyed */    [interfaceTimer invalidate];    [interfaceTimer release];    interfaceTimer = nil;    /* make sure that the current volume is saved */    config_PutInt( p_intf->p_libvlc, "volume", i_lastShownVolume );    returnedValue = config_SaveConfigFile( p_intf->p_libvlc, "main" );    if( returnedValue != 0 )        msg_Err( p_intf,                 "error while saving volume in osx's terminate method (%i)",                 returnedValue );    /* save the prefs if they were changed in the extended panel */    if(o_extended && [o_extended getConfigChanged])    {        [o_extended savePrefs];    }     p_intf->b_interaction = false;    var_DelCallback( p_intf, "interaction", InteractCallback, self );    /* remove global observer watching for vout device changes correctly */    [[NSNotificationCenter defaultCenter] removeObserver: self];    /* release some other objects here, because it isn't sure whether dealloc     * will be called later on */    if( nib_about_loaded )        [o_about release];    if( nib_prefs_loaded )    {        [o_sprefs release];        [o_prefs release];    }    if( nib_open_loaded )        [o_open release];    if( nib_extended_loaded )    {        [o_extended release];    }    if( nib_bookmarks_loaded )        [o_bookmarks release];    if( o_info )    {        [o_info stopTimers];        [o_info release];    }    if( nib_wizard_loaded )        [o_wizard release];    [crashLogURLConnection cancel];    [crashLogURLConnection release];     [o_embedded_list release];    [o_interaction_list release];    [o_eyetv release];    [o_img_pause_pressed release];    [o_img_play_pressed release];    [o_img_pause release];    [o_img_play release];    [o_msg_arr removeAllObjects];    [o_msg_arr release];    [o_msg_lock release];    /* write cached user defaults to disk */    [[NSUserDefaults standardUserDefaults] synchronize];    /* Kill the playlist, so that it doesn't accept new request     * such as the play request from vlc.c (we are a blocking interface). */    p_playlist = pl_Yield( p_intf );    vlc_object_kill( p_playlist );    pl_Release( p_intf );    vlc_object_kill( p_intf->p_libvlc );    [self setIntf:nil];    /* Go back to Run() and make libvlc exit properly */    if( jmpbuffer )        longjmp( jmpbuffer, 1 );    /* not reached */}#pragma mark -#pragma mark Toolbar delegate/* Our item identifiers */static NSString * VLCToolbarMediaControl     = @"VLCToolbarMediaControl";- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar{    return [NSArray arrayWithObjects://                        NSToolbarCustomizeToolbarItemIdentifier,//                        NSToolbarFlexibleSpaceItemIdentifier,//                        NSToolbarSpaceItemIdentifier,//                        NSToolbarSeparatorItemIdentifier,                        VLCToolbarMediaControl,                        nil ];}- (NSArray *) toolbarDefaultItemIdentifiers: (NSToolbar *) toolbar{    return [NSArray arrayWithObjects:                        VLCToolbarMediaControl,                        nil ];}- (NSToolbarItem *) toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag{    NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdentifier] autorelease];     if( [itemIdentifier isEqual: VLCToolbarMediaControl] )    {

⌨️ 快捷键说明

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