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

📄 dialogs.cpp

📁 uclinux 下的vlc播放器源代码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
        p_messages_dialog->Show( !p_messages_dialog->IsShown() );    }}void DialogsProvider::OnFileInfo( wxCommandEvent& WXUNUSED(event) ){    /* Show/hide the file info window */    if( !p_fileinfo_dialog )        p_fileinfo_dialog = new FileInfo( p_intf, this );    if( p_fileinfo_dialog )    {        p_fileinfo_dialog->Show( !p_fileinfo_dialog->IsShown() );    }}void DialogsProvider::OnPreferences( wxCommandEvent& WXUNUSED(event) ){    /* Show/hide the open dialog */    if( !p_prefs_dialog )        p_prefs_dialog = new PrefsDialog( p_intf, this );    if( p_prefs_dialog )    {        p_prefs_dialog->Show( !p_prefs_dialog->IsShown() );    }}void DialogsProvider::OnWizardDialog( wxCommandEvent& WXUNUSED(event) ){    p_wizard_dialog = new WizardDialog( p_intf, this, NULL, 0, 0 );    if( p_wizard_dialog )    {        p_wizard_dialog->Run();        delete p_wizard_dialog;    }    p_wizard_dialog = NULL;}void DialogsProvider::OnBookmarks( wxCommandEvent& WXUNUSED(event) ){    /* Show/hide the open dialog */    if( !p_bookmarks_dialog )        p_bookmarks_dialog = new BookmarksDialog( p_intf, this );    if( p_bookmarks_dialog )    {        p_bookmarks_dialog->Show( !p_bookmarks_dialog->IsShown() );    }}void DialogsProvider::OnOpenFileGeneric( wxCommandEvent& event ){    intf_dialog_args_t *p_arg = (intf_dialog_args_t *)event.GetClientData();    if( p_arg == NULL )    {        msg_Dbg( p_intf, "OnOpenFileGeneric() called with NULL arg" );        return;    }    if( p_file_generic_dialog == NULL )        p_file_generic_dialog = new wxFileDialog( NULL );    if( p_file_generic_dialog )    {        p_file_generic_dialog->SetMessage( wxU(p_arg->psz_title) );        p_file_generic_dialog->SetWildcard( wxU(p_arg->psz_extensions) );        p_file_generic_dialog->SetStyle( (p_arg->b_save ? wxSAVE : wxOPEN) |                                         (p_arg->b_multiple ? wxMULTIPLE:0) );    }    if( p_file_generic_dialog &&        p_file_generic_dialog->ShowModal() == wxID_OK )    {        wxArrayString paths;        p_file_generic_dialog->GetPaths( paths );        p_arg->i_results = paths.GetCount();        p_arg->psz_results = (char **)malloc( p_arg->i_results *                                              sizeof(char *) );        for( size_t i = 0; i < paths.GetCount(); i++ )        {            p_arg->psz_results[i] = strdup( paths[i].mb_str(wxConvUTF8) );        }    }    /* Callback */    if( p_arg->pf_callback )    {        p_arg->pf_callback( p_arg );    }    if( p_arg->psz_results )    {        for( int i = 0; i < p_arg->i_results; i++ )        {            free( p_arg->psz_results[i] );        }        free( p_arg->psz_results );    }    if( p_arg->psz_title ) free( p_arg->psz_title );    if( p_arg->psz_extensions ) free( p_arg->psz_extensions );    free( p_arg );}void DialogsProvider::OnOpenFileSimple( wxCommandEvent& event ){    playlist_t *p_playlist =        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,                                       FIND_ANYWHERE );    if( p_playlist == NULL )    {        return;    }    if( p_file_dialog == NULL )        p_file_dialog = new wxFileDialog( NULL, wxU(_("Open File")),            wxT(""), wxT(""), wxT("*"), wxOPEN | wxMULTIPLE );	p_file_dialog->SetWildcard(wxU(_("All Files (*.*)|*"        "|Sound Files (*.mp3, *.ogg, etc.)|" EXTENSIONS_AUDIO         "|Video Files (*.avi, *.mpg, etc.)|" EXTENSIONS_VIDEO         "|Playlist Files (*.m3u, *.pls, etc.)|" EXTENSIONS_PLAYLIST         "|Subtitle Files (*.srt, *.sub, etc.)|" EXTENSIONS_SUBTITLE)));    if( p_file_dialog && p_file_dialog->ShowModal() == wxID_OK )    {        wxArrayString paths;        p_file_dialog->GetPaths( paths );        for( size_t i = 0; i < paths.GetCount(); i++ )        {            char *psz_utf8 = wxFromLocale( paths[i] );            if( event.GetInt() )                playlist_Add( p_playlist, psz_utf8, psz_utf8,                              PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) |                              (i ? PLAYLIST_PREPARSE : 0 ),                              PLAYLIST_END );            else                playlist_Add( p_playlist, psz_utf8, psz_utf8,                              PLAYLIST_APPEND | PLAYLIST_PREPARSE , PLAYLIST_END );            wxLocaleFree( psz_utf8 );        }    }    vlc_object_release( p_playlist );}void DialogsProvider::OnOpenDirectory( wxCommandEvent& event ){    playlist_t *p_playlist =        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,                                       FIND_ANYWHERE );    if( p_playlist == NULL )    {        return;    }    if( p_dir_dialog == NULL )        p_dir_dialog = new wxDirDialog( NULL, wxU(_("Select a directory")) );    if( p_dir_dialog && p_dir_dialog->ShowModal() == wxID_OK )    {        wxString path = p_dir_dialog->GetPath();        char *psz_utf8 = wxFromLocale( path );        playlist_Add( p_playlist, psz_utf8, psz_utf8,                      PLAYLIST_APPEND | (event.GetInt() ? PLAYLIST_GO : 0),                      PLAYLIST_END );        wxLocaleFree( psz_utf8 );    }    vlc_object_release( p_playlist );}void DialogsProvider::OnOpenFile( wxCommandEvent& event ){    Open( FILE_ACCESS, event.GetInt() );}void DialogsProvider::OnOpenDisc( wxCommandEvent& event ){    Open( DISC_ACCESS, event.GetInt() );}void DialogsProvider::OnOpenNet( wxCommandEvent& event ){    Open( NET_ACCESS, event.GetInt() );}void DialogsProvider::OnOpenCapture( wxCommandEvent& event ){    Open( CAPTURE_ACCESS, event.GetInt() );}void DialogsProvider::Open( int i_access_method, int i_arg ){    /* Show/hide the open dialog */    if( !p_open_dialog )        p_open_dialog = new OpenDialog( p_intf, this, i_access_method, i_arg,                                        OPEN_NORMAL );    if( p_open_dialog )    {        p_open_dialog->Show( i_access_method, i_arg );    }}void DialogsProvider::OnPopupMenu( wxCommandEvent& event ){    wxPoint mousepos = ScreenToClient( wxGetMousePosition() );    ::PopupMenu( p_intf, this, mousepos );}void DialogsProvider::OnAudioPopupMenu( wxCommandEvent& event ){    wxPoint mousepos = ScreenToClient( wxGetMousePosition() );    ::AudioPopupMenu( p_intf, this, mousepos );}void DialogsProvider::OnVideoPopupMenu( wxCommandEvent& event ){    wxPoint mousepos = ScreenToClient( wxGetMousePosition() );    ::VideoPopupMenu( p_intf, this, mousepos );}void DialogsProvider::OnMiscPopupMenu( wxCommandEvent& event ){    wxPoint mousepos = ScreenToClient( wxGetMousePosition() );    ::MiscPopupMenu( p_intf, this, mousepos );}void DialogsProvider::OnExitThread( wxCommandEvent& WXUNUSED(event) ){    wxTheApp->ExitMainLoop();}void DialogsProvider::OnUpdateVLC( wxCommandEvent& WXUNUSED(event) ){    /* Show/hide the file info window */    if( !p_updatevlc_dialog )        p_updatevlc_dialog = new UpdateVLC( p_intf, this );    if( p_updatevlc_dialog )    {        p_updatevlc_dialog->Show( !p_updatevlc_dialog->IsShown() );    }}void DialogsProvider::OnVLM( wxCommandEvent& WXUNUSED(event) ){    /* Show/hide the file info window */    if( !p_vlm_dialog )        p_vlm_dialog = new VLMFrame( p_intf, this );    if( p_vlm_dialog )    {        p_vlm_dialog->Show( !p_vlm_dialog->IsShown() );    }}void DialogsProvider::OnInteraction( wxCommandEvent& event ){    intf_dialog_args_t *p_arg = (intf_dialog_args_t *)event.GetClientData();    interaction_dialog_t *p_dialog;    InteractionDialog *p_wxdialog;    if( p_arg == NULL )    {        msg_Dbg( p_intf, "OnInteraction() called with NULL arg" );        return;    }    p_dialog = p_arg->p_dialog;    /** \bug We store the interface object for the dialog in the p_private     * field of the core dialog object. This is not safe if we change     * interface while a dialog is loaded */    switch( p_dialog->i_action )    {    case INTERACT_NEW:        p_wxdialog = new InteractionDialog( p_intf, this, p_dialog );        p_dialog->p_private = (void*)p_wxdialog;        p_wxdialog->Show();        break;    case INTERACT_UPDATE:        p_wxdialog = (InteractionDialog*)(p_dialog->p_private);        if( p_wxdialog)            p_wxdialog->Update();        break;    case INTERACT_HIDE:        p_wxdialog = (InteractionDialog*)(p_dialog->p_private);        if( p_wxdialog )            p_wxdialog->Hide();        p_dialog->i_status = HIDDEN_DIALOG;        break;    case INTERACT_DESTROY:        p_wxdialog = (InteractionDialog*)(p_dialog->p_private);        /// \todo        p_dialog->i_status = DESTROYED_DIALOG;        break;    }}

⌨️ 快捷键说明

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