Changeset 12cbd4c8b63bcd5bfc077e24a11166171c421c38

Show
Ignore:
Timestamp:
06/10/03 18:23:30 (5 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1065457410 +0000
git-parent:

[de2868c437d01f3d476d239ee787f255e1b699d2]

git-author:
Clément Stenac <zorglub@videolan.org> 1065457410 +0000
Message:

* include/vlc_playlist.h

src/playlist/playlist.c:

  • Implemented a boolean b_enabled to disable a playlist item
  • Implemented the idea of group (p_item->i_group), that allows
    to enable/disable and to sort some series of items
  • Implemented an unused (at the moment), psz_author field
  • Started to implement a new playlist format to store all of these

* modules/gui/wxwindows/interface.cpp:

Added a hiddeable panel to put some important options.
(Menu Preferences->Extra GUI)
At the moment, we put the adjust filter and aspect ratio, and must
decide what options we want here

* modules/gui/wxwindows/playlist.cpp

modules/gui/wxwindows/iteminfo.cpp:

Added "Enable/disable group button", options to enable/disable selection
Added an item info dialog box

* modules/misc/sap.c :

Added a sap-group-id option: the SAP playlist items are in a separate group
(defaults to 42)

* modules/visualization/visual/effects.c:

Minor coding style fixes

Todo:


* Advanced sort (alphabetical and/or by group)
* Ability to load 0_6 playlists
* Really use the libid3tag

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_playlist.h

    r8f02c03 r12cbd4c  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN 
    5  * $Id: vlc_playlist.h,v 1.13 2003/09/08 12:02:16 zorglub Exp $ 
     5 * $Id: vlc_playlist.h,v 1.14 2003/10/06 16:23:30 zorglub Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    1111 * the Free Software Foundation; either version 2 of the License, or 
    1212 * (at your option) any later version. 
    13  *  
     13 * 
    1414 * This program is distributed in the hope that it will be useful, 
    1515 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     
    4949    int        i_type;         /**< unused yet */ 
    5050    int        i_status;       /**< unused yet */ 
    51     vlc_bool_t b_autodeletion; /**< Indicates wether this item is to 
     51    vlc_bool_t b_autodeletion; /**< Indicates whther this item is to 
    5252                                * be deleted after playback. True mean 
    5353                                * that this item is to be deleted 
    5454                                * after playback, false otherwise */ 
     55    vlc_bool_t b_enabled;      /**< Indicates whether this item is to be 
     56                                * played or skipped */ 
     57 
     58    int        i_group;         /**< unused yet */ 
     59    char *     psz_author;     /**< Author */ 
    5560}; 
    5661 
     
    7479    playlist_status_t     i_status; /**< current status of playlist */ 
    7580    int                   i_size;   /**< total size of the list */ 
    76  
     81    int                   i_enabled; /**< How many items are enabled ? */ 
    7782    playlist_item_t **    pp_items; /**< array of pointers to the 
    7883                                     * playlist items */ 
     
    8590#define SORT_NORMAL 0 
    8691#define SORT_REVERSE 1 
     92 
     93#define PLAYLIST_TYPE_MANUAL 0 
     94#define PLAYLIST_TYPE_SAP 1 
    8795 
    8896/***************************************************************************** 
     
    106114VLC_EXPORT( int,  playlist_AddItem, ( playlist_t *, playlist_item_t *, int, int ) ); 
    107115VLC_EXPORT( int,  playlist_Delete, ( playlist_t *, int ) ); 
     116VLC_EXPORT( int,  playlist_Disable, ( playlist_t *, int ) ); 
     117VLC_EXPORT( int,  playlist_Enable, ( playlist_t *, int ) ); 
     118VLC_EXPORT( int,  playlist_DisableGroup, ( playlist_t *, int ) ); 
     119VLC_EXPORT( int,  playlist_EnableGroup, ( playlist_t *, int ) ); 
    108120VLC_EXPORT( int,  playlist_Sort, ( playlist_t *, int) ); 
    109121VLC_EXPORT( int,  playlist_Move, ( playlist_t *, int, int ) ); 
  • modules/gui/wxwindows/Modules.am

    rbe6f765 r12cbd4c  
    88    messages.cpp \ 
    99    playlist.cpp \ 
     10        iteminfo.cpp \ 
    1011    menus.cpp \ 
    1112    preferences.cpp \ 
  • modules/gui/wxwindows/interface.cpp

    r3c98f14 r12cbd4c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000-2001 VideoLAN 
    5  * $Id: interface.cpp,v 1.60 2003/09/07 22:53:09 fenrir Exp $ 
     5 * $Id: interface.cpp,v 1.61 2003/10/06 16:23:30 zorglub Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    126126 
    127127    Prefs_Event, 
     128    Extra_Event, 
    128129 
    129130    SliderScroll_Event, 
     
    135136    FastStream_Event, 
    136137 
     138    Adjust_Event, 
     139    Hue_Event, 
     140    Contrast_Event, 
     141    Brightness_Event, 
     142    Saturation_Event, 
     143 
     144    Ratio_Event, 
    137145    /* it is important for the id corresponding to the "About" command to have 
    138146     * this standard value as otherwise it won't be handled properly under Mac 
     
    152160 
    153161    EVT_MENU_OPEN(Interface::OnMenuOpen) 
     162 
     163    EVT_MENU( Extra_Event, Interface::OnExtra) 
     164    EVT_CHECKBOX( Adjust_Event, Interface::OnEnableAdjust) 
     165 
     166    EVT_COMBOBOX( Ratio_Event, Interface::OnRatio) 
    154167 
    155168#if defined( __WXMSW__ ) || defined( __WXMAC__ ) 
     
    174187    EVT_COMMAND_SCROLL(SliderScroll_Event, Interface::OnSliderUpdate) 
    175188 
     189    EVT_COMMAND_SCROLL(Hue_Event, Interface::OnHueUpdate) 
     190    EVT_COMMAND_SCROLL(Contrast_Event, Interface::OnContrastUpdate) 
     191    EVT_COMMAND_SCROLL(Brightness_Event, Interface::OnBrightnessUpdate) 
     192    EVT_COMMAND_SCROLL(Saturation_Event, Interface::OnSaturationUpdate) 
     193 
    176194END_EVENT_TABLE() 
    177195 
     
    186204    p_intf = _p_intf; 
    187205    i_old_playing_status = PAUSE_S; 
     206    b_extra = VLC_FALSE; 
    188207 
    189208    /* Give our interface a nice little icon */ 
     
    191210 
    192211    /* Create a sizer for the main frame */ 
    193     frame_sizer = new wxBoxSizer( wxHORIZONTAL ); 
     212    //frame_sizer= new wxFlexGridSizer( 1, 0, 0); 
     213    frame_sizer = new wxBoxSizer( wxVERTICAL ); 
    194214    SetSizer( frame_sizer ); 
    195215 
     
    199219    p_dummy->SetFocus(); 
    200220    frame_sizer->Add( p_dummy ); 
    201                  
     221 
    202222    /* Creation of the menu bar */ 
    203223    CreateOurMenuBar(); 
     
    208228    /* Creation of the slider sub-window */ 
    209229    CreateOurSlider(); 
    210     frame_sizer->Add( slider_frame, 1, wxGROW, 0 ); 
     230    frame_sizer->Add( slider_frame, 0, wxEXPAND , 0 ); 
    211231    frame_sizer->Hide( slider_frame ); 
     232 
     233    /* Create the extra panel */ 
     234    CreateOurExtraPanel(); 
     235    frame_sizer->Add( extra_frame, 0, wxEXPAND , 0 ); 
     236    frame_sizer->Hide( extra_frame ); 
    212237 
    213238    /* Creation of the status bar 
     
    261286 
    262287#define HELP_PREFS N_("Go to the preferences menu") 
     288#define EXTRA_PREFS N_("Open the extended GUI") 
    263289 
    264290#define HELP_ABOUT N_("About this program") 
     
    298324    settings_menu->Append( Prefs_Event, wxU(_("&Preferences...")), 
    299325                           wxU(_(HELP_PREFS)) ); 
     326    settings_menu->Append( Extra_Event, wxU(_("&Extra GUI") ), 
     327                           wxU(_(EXTRA_PREFS)) ); 
     328 
    300329 
    301330    /* Create the "Audio" menu */ 
     
    389418    wxBoxSizer *toolbar_sizer = new wxBoxSizer( wxHORIZONTAL ); 
    390419    toolbar_sizer->Add( toolbar, 0, 0, 0 ); 
     420 
    391421    toolbar_sizer->Layout(); 
    392422 
     
    437467    /* Hide the slider by default */ 
    438468    slider_frame->Hide(); 
     469} 
     470 
     471 
     472void Interface::CreateOurExtraPanel() 
     473{ 
     474    char *psz_filters; 
     475 
     476    extra_frame = new wxPanel( this, -1, wxDefaultPosition, wxDefaultSize ); 
     477    extra_frame->SetAutoLayout( TRUE ); 
     478    wxBoxSizer *extra_sizer = new wxBoxSizer( wxHORIZONTAL ); 
     479 
     480    /* Create static box to surround the adjust controls */ 
     481    adjust_box = new wxStaticBox( extra_frame, -1, 
     482                  wxT(_("Image adjust")) ); 
     483 
     484    /* Create the size for the frame */ 
     485    wxStaticBoxSizer *adjust_sizer = 
     486        new wxStaticBoxSizer( adjust_box, wxVERTICAL ); 
     487    adjust_sizer->SetMinSize( -1, 50 ); 
     488 
     489    /* Create every controls */ 
     490 
     491    /* Create the adjust button */ 
     492    wxCheckBox * adjust_check = new wxCheckBox( extra_frame, Adjust_Event, 
     493                                                 wxU(_("Enable"))); 
     494 
     495 
     496    wxBoxSizer *hue_sizer = new wxBoxSizer( wxHORIZONTAL ); 
     497    wxStaticText *hue_text = new wxStaticText( extra_frame, -1, 
     498                                       wxU(_("Hue")) ); 
     499    hue_slider = new wxSlider ( extra_frame, Hue_Event, 0, 0, 
     500                                360, wxDefaultPosition, wxDefaultSize ); 
     501 
     502   hue_sizer->Add(hue_text,1, 0 ,0); 
     503   hue_sizer->Add(hue_slider,1, 0 ,0); 
     504   hue_sizer->Layout(); 
     505 
     506    wxBoxSizer *contrast_sizer = new wxBoxSizer( wxHORIZONTAL ); 
     507    wxStaticText *contrast_text = new wxStaticText( extra_frame, -1, 
     508                                       wxU(_("Contrast")) ); 
     509    contrast_slider = new wxSlider ( extra_frame, Contrast_Event, 0, 0, 
     510                                200, wxDefaultPosition, wxDefaultSize); 
     511    contrast_sizer->Add(contrast_text,1, 0 ,0); 
     512    contrast_sizer->Add(contrast_slider,1, 0 ,0); 
     513    contrast_sizer->Layout(); 
     514 
     515    wxBoxSizer *brightness_sizer = new wxBoxSizer( wxHORIZONTAL ); 
     516    wxStaticText *brightness_text = new wxStaticText( extra_frame, -1, 
     517                                       wxU(_("Brightness")) ); 
     518    brightness_slider = new wxSlider ( extra_frame, Brightness_Event, 0, 0, 
     519                           200, wxDefaultPosition, wxDefaultSize) ; 
     520    brightness_sizer->Add(brightness_text,1,0,0); 
     521    brightness_sizer->Add(brightness_slider,1,0,0); 
     522    brightness_sizer->Layout(); 
     523 
     524    wxBoxSizer *saturation_sizer = new wxBoxSizer( wxHORIZONTAL ); 
     525    wxStaticText *saturation_text = new wxStaticText( extra_frame, -1, 
     526                                          wxU(_("Saturation")) ); 
     527    saturation_slider = new wxSlider ( extra_frame, Saturation_Event, 0, 0, 
     528                           300, wxDefaultPosition, wxDefaultSize ); 
     529    saturation_sizer->Add(saturation_text,1,0,0); 
     530    saturation_sizer->Add(saturation_slider,1,0,0); 
     531    saturation_sizer->Layout(); 
     532 
     533    adjust_sizer->Add(adjust_check, 1, wxEXPAND, 0); 
     534    adjust_sizer->Add(hue_sizer, 1, wxEXPAND, 0); 
     535    adjust_sizer->Add(contrast_sizer, 1, wxEXPAND, 0); 
     536    adjust_sizer->Add(brightness_sizer, 1, wxEXPAND, 0); 
     537    adjust_sizer->Add(saturation_sizer, 1, wxEXPAND, 0); 
     538 
     539    extra_sizer->Add(adjust_sizer,1,wxBOTTOM,5); 
     540 
     541 
     542    /* Create static box to surround the other controls */ 
     543    other_box = new wxStaticBox( extra_frame, -1, 
     544                  wxT(_("Video Options")) ); 
     545 
     546    /* Create the sizer for the frame */ 
     547    wxStaticBoxSizer *other_sizer = 
     548        new wxStaticBoxSizer( other_box, wxVERTICAL ); 
     549    other_sizer->SetMinSize( -1, 50 ); 
     550 
     551    static const wxString ratio_array[] = 
     552    { 
     553        wxT("4:3"), 
     554        wxT("16:9"), 
     555    }; 
     556 
     557    wxBoxSizer *ratio_sizer = new wxBoxSizer( wxHORIZONTAL ); 
     558    wxStaticText *ratio_text = new wxStaticText( extra_frame, -1, 
     559                                          wxU(_("Ratio")) ); 
     560 
     561    ratio_combo = new wxComboBox( extra_frame, Ratio_Event, wxT(""), 
     562                                  wxDefaultPosition, wxSize(120,-1), 
     563                                  WXSIZEOF(ratio_array), ratio_array, 
     564                                  0 ); 
     565 
     566    ratio_sizer->Add( ratio_text, 0, wxALL, 2 ); 
     567    ratio_sizer->Add( ratio_combo, 0, wxALL, 2 ); 
     568    ratio_sizer->Layout(); 
     569 
     570    other_sizer->Add(ratio_sizer,0,wxALL,0 ); 
     571 
     572    extra_sizer->Add(other_sizer,0,wxBOTTOM,5); 
     573 
     574    extra_frame->SetSizer( extra_sizer ); 
     575 
     576    /* Layout the whole panel */ 
     577    extra_sizer->Layout(); 
     578 
     579    extra_sizer->SetSizeHints(extra_frame); 
     580 
     581    /* Write down initial values */ 
     582    psz_filters = config_GetPsz( p_intf, "filter" ); 
     583 
     584    if(psz_filters == NULL) psz_filters=strdup(""); 
     585 
     586    if( strstr(psz_filters,"adjust") ) 
     587    { 
     588        adjust_check->SetValue( 1 ); 
     589        saturation_slider->Enable(); 
     590        contrast_slider->Enable(); 
     591        brightness_slider->Enable(); 
     592        hue_slider->Enable(); 
     593    } 
     594    else 
     595    { 
     596        adjust_check->SetValue( 0 ); 
     597        saturation_slider->Disable(); 
     598        contrast_slider->Disable(); 
     599        brightness_slider->Disable(); 
     600        hue_slider->Disable(); 
     601    } 
     602 
     603    extra_frame->Hide(); 
     604    free(psz_filters); 
    439605} 
    440606 
     
    470636    if( !accel.Ok() ) 
    471637        msg_Err( p_intf, "invalid accelerator table" ); 
    472      
     638 
    473639    SetAcceleratorTable( accel ); 
    474640    msg_Dbg( p_intf, "accelerator table loaded" ); 
    475      
    476 
     641 
     642
     643 
     644 
    477645 
    478646/***************************************************************************** 
     
    660828} 
    661829 
     830void Interface::OnExtra(wxCommandEvent& event) 
     831{ 
     832    if( b_extra == VLC_FALSE) 
     833    { 
     834        extra_frame->Show(); 
     835        frame_sizer->Show( extra_frame ); 
     836        b_extra = VLC_TRUE; 
     837    } 
     838    else 
     839    { 
     840        extra_frame->Hide(); 
     841        frame_sizer->Hide( extra_frame ); 
     842        b_extra = VLC_FALSE; 
     843    } 
     844    frame_sizer->Layout(); 
     845    frame_sizer->Fit(this); 
     846} 
     847 
     848void Interface::OnEnableAdjust(wxCommandEvent& event) 
     849{ 
     850    char *psz_filters=config_GetPsz( p_intf, "filter"); 
     851    char *psz_new = NULL; 
     852    if( event.IsChecked() ) 
     853    { 
     854        if(psz_filters == NULL) 
     855        { 
     856            psz_new = strdup( "adjust" ); 
     857        } 
     858        else 
     859        { 
     860            psz_new= (char *) malloc(strlen(psz_filters) + 8 ); 
     861            sprintf( psz_new, "%s:adjust", psz_filters); 
     862        } 
     863        config_PutPsz( p_intf, "filter", psz_new ); 
     864 
     865        brightness_slider->Enable(); 
     866        saturation_slider->Enable(); 
     867        contrast_slider->Enable(); 
     868        hue_slider->Enable(); 
     869    } 
     870    else 
     871    { 
     872        if( psz_filters != NULL ) 
     873        { 
     874 
     875            char *psz_current; 
     876            unsigned int i=0; 
     877            for( i = 0; i< strlen(psz_filters ); i++) 
     878            { 
     879                if ( !strncasecmp( &psz_filters[i],"adjust",6 )) 
     880                { 
     881                    if(i > 0) 
     882                        if( psz_filters[i-1] == ':' ) i--; 
     883                    psz_current = strchr( &psz_filters[i+1] , ':' ); 
     884                    if( !psz_current ) 
     885                        psz_filters[i] = '\0'; 
     886                    else 
     887                    { 
     888                       memmove( &psz_filters[i] , psz_current, 
     889                                &psz_filters[strlen(psz_filters)]-psz_current 
     890                                +1); 
     891                    } 
     892                } 
     893            } 
     894            config_PutPsz( p_intf, "filter", psz_filters); 
     895        } 
     896        brightness_slider->Disable(); 
     897        saturation_slider->Disable(); 
     898        contrast_slider->Disable(); 
     899        hue_slider->Disable(); 
     900    } 
     901    if(psz_filters) free(psz_filters); 
     902    if(psz_new) free(psz_new); 
     903} 
     904 
     905void Interface::OnHueUpdate( wxScrollEvent& event) 
     906{ 
     907   config_PutInt( p_intf , "hue" , event.GetPosition() ); 
     908} 
     909 
     910void Interface::OnSaturationUpdate( wxScrollEvent& event) 
     911{ 
     912   config_PutFloat( p_intf , "saturation" , (float)event.GetPosition()/300 ); 
     913} 
     914 
     915void Interface::OnBrightnessUpdate( wxScrollEvent& event) 
     916{ 
     917   config_PutFloat( p_intf , "brightness", (float)event.GetPosition()/200 ); 
     918} 
     919 
     920void Interface::OnContrastUpdate(wxScrollEvent& event) 
     921{ 
     922   config_PutFloat( p_intf , "contrast" , (float)event.GetPosition()/200 ); 
     923 
     924} 
     925 
     926void Interface::OnRatio( wxCommandEvent& event ) 
     927{ 
     928   config_PutPsz( p_intf, "aspect-ratio", ratio_combo->GetValue() ); 
     929} 
     930 
     931 
    662932void Interface::OnPlayStream( wxCommandEvent& WXUNUSED(event) ) 
    663933{ 
     
    668938    if( p_playlist == NULL ) return; 
    669939 
    670     if( p_playlist->i_size
     940    if( p_playlist->i_size && p_playlist->i_enabled
    671941    { 
    672942        vlc_value_t state; 
  • modules/gui/wxwindows/playlist.cpp

    ra885565 r12cbd4c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000-2001 VideoLAN 
    5  * $Id: playlist.cpp,v 1.21 2003/09/22 14:40:10 zorglub Exp $ 
     5 * $Id: playlist.cpp,v 1.22 2003/10/06 16:23:30 zorglub Exp $ 
    66 * 
    77 * Authors: Olivier Teuli� <ipkiss@via.ecp.fr> 
     
    5656    Save_Event, 
    5757 
     58    EnableSelection_Event, 
     59    DisableSelection_Event, 
     60 
    5861    InvertSelection_Event, 
    5962    DeleteSelection_Event, 
     
    6265    Repeat_Event, 
    6366    SelectAll_Event, 
     67 
     68    En_Dis_Event, 
     69 
     70    Infos_Event, 
    6471 
    6572    SearchText_Event, 
     
    7986    EVT_MENU(Open_Event, Playlist::OnOpen) 
    8087    EVT_MENU(Save_Event, Playlist::OnSave) 
     88    EVT_MENU(EnableSelection_Event, Playlist::OnEnableSelection) 
     89    EVT_MENU(DisableSelection_Event, Playlist::OnDisableSelection) 
    8190    EVT_MENU(InvertSelection_Event, Playlist::OnInvertSelection) 
    8291    EVT_MENU(DeleteSelection_Event, Playlist::OnDeleteSelection) 
    8392    EVT_MENU(SelectAll_Event, Playlist::OnSelectAll) 
     93    EVT_MENU(Infos_Event, Playlist::OnInfos) 
    8494    EVT_CHECKBOX(Random_Event, Playlist::OnRandom) 
    8595    EVT_CHECKBOX(Repeat_Event, Playlist::OnRepeat) 
     
    92102    /* Button events */ 
    93103    EVT_BUTTON( Search_Event, Playlist::OnSearch) 
     104    EVT_BUTTON( En_Dis_Event, Playlist::OnEnDis) 
    94105    EVT_BUTTON( Save_Event, Playlist::OnSave) 
     106    EVT_BUTTON( Infos_Event, Playlist::OnInfos) 
    95107 
    96108    EVT_TEXT(SearchText_Event, Playlist::OnSearchTextChange) 
     
    109121{ 
    110122    /* Initializations */ 
     123    iteminfo_dialog = NULL; 
    111124    p_intf = _p_intf; 
    112125    vlc_value_t  val; 
     
    136149    /* Create our "Selection" menu */ 
    137150    wxMenu *selection_menu = new wxMenu; 
     151    selection_menu->Append( EnableSelection_Event, wxU(_("&Enable")) ); 
     152    selection_menu->Append( DisableSelection_Event, wxU(_("&Disable")) ); 
     153    selection_menu->AppendSeparator(); 
    138154    selection_menu->Append( InvertSelection_Event, wxU(_("&Invert")) ); 
    139155    selection_menu->Append( DeleteSelection_Event, wxU(_("&Delete")) ); 
     
    162178    listview->InsertColumn( 0, wxU(_("Url")) ); 
    163179    #if 0 
    164    listview->InsertColumn( 1, wxU(_("Duration")) ); 
     180        listview->InsertColumn( 1, wxU(_("Duration")) ); 
    165181    #endif 
    166182    listview->SetColumnWidth( 0, 300 ); 
    167183    #if 0 
    168    listview->SetColumnWidth( 1, 100 ); 
     184        listview->SetColumnWidth( 1, 100 ); 
    169185    #endif 
    170186 
    171187    /* Create the Random checkbox */ 
    172     wxCheckBox *random_checkbox =  
     188    wxCheckBox *random_checkbox = 
    173189        new wxCheckBox( playlist_panel, Random_Event, wxU(_("Random")) ); 
    174      
     190 
    175191    var_Get( p_intf, "random", &val); 
    176192    vlc_bool_t b_random = val.b_bool; 
     
    178194 
    179195    /* Create the Loop Checkbox */ 
    180     wxCheckBox *loop_checkbox =  
     196    wxCheckBox *loop_checkbox = 
    181197        new wxCheckBox( playlist_panel, Loop_Event, wxU(_("Loop")) ); 
    182198 
    183199    var_Get( p_intf, "loop", &val ); 
    184     int b_loop = val.b_bool ;  
     200    int b_loop = val.b_bool ; 
    185201    loop_checkbox->SetValue( b_loop ); 
    186202 
    187203    /* Create the Repeat one checkbox */ 
    188     wxCheckBox *repeat_checkbox =  
    189    new wxCheckBox( playlist_panel, Repeat_Event, wxU(_("Repeat one")) ); 
     204    wxCheckBox *repeat_checkbox = 
     205        new wxCheckBox( playlist_panel, Repeat_Event, wxU(_("Repeat one")) ); 
    190206 
    191207    var_Get( p_intf, "repeat", &val ); 
    192     int b_repeat = val.b_bool ;  
     208    int b_repeat = val.b_bool ; 
    193209    repeat_checkbox->SetValue( b_repeat ); 
    194210 
    195211    /* Create the Search Textbox */ 
    196212    search_text = 
    197     new wxTextCtrl( playlist_panel, SearchText_Event, wxT(""),  
    198             wxDefaultPosition, wxSize( 140, -1),  
    199             wxTE_PROCESS_ENTER);     
     213        new wxTextCtrl( playlist_panel, SearchText_Event, wxT(""), 
     214                        wxDefaultPosition, wxSize( 140, -1), 
     215                        wxTE_PROCESS_ENTER); 
    200216 
    201217    /* Create the search button */ 
    202     search_button =  
    203     new wxButton( playlist_panel, Search_Event, wxU(_("Search")) ); 
    204  
    205   
     218    search_button = 
     219        new wxButton( playlist_panel, Search_Event, wxU(_("Search")) ); 
     220 
     221    wxButton *en_dis_button = 
     222        new wxButton( playlist_panel, En_Dis_Event, wxU(_("Enable/Disable Group") ) ); 
     223 
     224    wxButton *iteminfo_button = 
     225        new wxButton( playlist_panel, Infos_Event, wxU(_("Item Infos") ) ); 
    206226    /* Place everything in sizers */ 
    207     wxBoxSizer *button_sizer = new wxBoxSizer( wxVERTICAL ); 
    208     button_sizer->Add( random_checkbox, 0,  
    209                  wxEXPAND|wxALIGN_RIGHT, 5); 
    210     button_sizer->Add( loop_checkbox, 0,  
    211                       wxEXPAND|wxALIGN_RIGHT, 5); 
    212     button_sizer->Add( repeat_checkbox, 0,  
    213                       wxEXPAND|wxALIGN_RIGHT, 5); 
    214  
     227    wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL ); 
     228    button_sizer->Add( en_dis_button, 0, wxALIGN_CENTER|wxRIGHT, 5); 
     229    button_sizer->Add( iteminfo_button, 0, wxALIGN_CENTER|wxLEFT , 5); 
    215230    button_sizer->Layout(); 
    216231 
    217     wxBoxSizer *search_sizer = new wxBoxSizer( wxVERTICAL ); 
     232 
     233    wxBoxSizer *checkbox_sizer = new wxBoxSizer( wxHORIZONTAL ); 
     234    checkbox_sizer->Add( random_checkbox, 0, 
     235                       wxEXPAND|wxALIGN_RIGHT, 5); 
     236    checkbox_sizer->Add( loop_checkbox, 0, 
     237                       wxEXPAND|wxALIGN_RIGHT, 5); 
     238    checkbox_sizer->Add( repeat_checkbox, 0, 
     239                       wxEXPAND|wxALIGN_RIGHT, 5); 
     240 
     241    checkbox_sizer->Layout(); 
     242 
     243    wxBoxSizer *search_sizer = new wxBoxSizer( wxHORIZONTAL ); 
    218244    search_sizer->Add( search_text, 0, wxALL|wxALIGN_CENTER, 5); 
    219245    search_sizer->Add( search_button, 0, wxALL|wxALIGN_CENTER, 5); 
     
    221247    search_sizer->Layout(); 
    222248 
    223     wxBoxSizer *bottom_sizer = new wxBoxSizer( wxHORIZONTAL ); 
    224     bottom_sizer->Add( search_sizer , 0, wxALL|wxALIGN_CENTER, 5 ); 
     249    wxBoxSizer *bottom_sizer = new wxBoxSizer( wxVERTICAL ); 
     250    bottom_sizer->Add( checkbox_sizer, 0, wxALL|wxALIGN_CENTER, 5 ); 
    225251    bottom_sizer->Add( button_sizer , 0, wxALL|wxALIGN_CENTER, 5 ); 
    226      
     252 
    227253    bottom_sizer->Layout(); 
    228254 
     
    231257    wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL ); 
    232258    panel_sizer->Add( listview, 1, wxEXPAND | wxALL, 5 ); 
    233      
     259 
     260    panel_sizer->Add( search_sizer, 0, wxALIGN_CENTRE ); 
    234261    panel_sizer->Add( bottom_sizer, 0 , wxALIGN_CENTRE); 
    235262    panel_sizer->Layout(); 
     
    271298    } 
    272299 
     300    delete iteminfo_dialog; 
     301 
    273302    var_DelCallback( p_playlist, "intf-change", PlaylistChanged, this ); 
    274303    vlc_object_release( p_playlist ); 
     
    294323        wxString filename = wxU(p_playlist->pp_items[i]->psz_name); 
    295324        listview->InsertItem( i, filename ); 
     325        if( p_playlist->pp_items[i]->b_enabled == VLC_FALSE ) 
     326        { 
     327            wxListItem listitem; 
     328            listitem.m_itemId = i; 
     329            listitem.SetTextColour( *wxLIGHT_GREY); 
     330            listview->SetItem(listitem); 
     331        } 
    296332        /* FIXME: we should try to find the actual duration... */ 
    297    /* While we don't use it, hide it, it's ugly */ 
    298    #if 0 
    299        listview->SetItem( i, 1, wxU(_("no info")) ); 
    300    #endif 
     333        /* While we don't use it, hide it, it's ugly */ 
     334        #if 0 
     335            listview->SetItem( i, 1, wxU(_("no info")) ); 
     336        #endif 
    301337    } 
    302338    vlc_mutex_unlock( &p_playlist->object_lock ); 
     
    308344    listview->SetItem( listitem ); 
    309345 
    310 //    listview->Select( p_playlist->i_index, TRUE ); 
    311346    listview->Focus( p_playlist->i_index ); 
    312347 
     
    466501 
    467502    playlist_Sort( p_playlist , 0  ); 
    468     
     503 
    469504    vlc_object_release( p_playlist ); 
    470505 
     
    485520 
    486521    playlist_Sort( p_playlist , 1 ); 
    487     
     522 
    488523    vlc_object_release( p_playlist ); 
    489524 
     
    495530void Playlist::OnSearchTextChange( wxCommandEvent& WXUNUSED(event) ) 
    496531{ 
    497    search_button->SetDefault();  
     532   search_button->SetDefault(); 
    498533} 
    499534 
     
    503538 
    504539    int i_current; 
    505     int i_first = 0 ;  
     540    int i_first = 0 ; 
    506541    int i_item = -1; 
    507542 
    508543    for( i_current = 0 ; i_current <= listview->GetItemCount() ; i_current++ )  
    509544    { 
    510    if( listview->GetItemState( i_current, wxLIST_STATE_SELECTED) 
    511        == wxLIST_STATE_SELECTED ) 
    512    
    513        i_first = i_current; 
    514        break; 
    515    
    516     } 
    517  
    518     for ( i_current = i_first + 1; i_current <= listview->GetItemCount() 
    519         ; i_current++ ) 
    520     { 
    521    wxListItem listitem; 
    522    listitem.SetId( i_current ); 
    523    listview->GetItem( listitem ); 
    524    if( listitem.m_text.Lower().Contains( search_string.Lower() ) ) 
    525    
    526       i_item = i_current; 
    527       break; 
    528    
     545        if( listview->GetItemState( i_current, wxLIST_STATE_SELECTED) 
     546                   == wxLIST_STATE_SELECTED ) 
     547       
     548            i_first = i_current; 
     549            break; 
     550       
     551    } 
     552 
     553    for ( i_current = i_first + 1; i_current <= listview->GetItemCount() ;  
     554          i_current++ ) 
     555    { 
     556        wxListItem listitem; 
     557        listitem.SetId( i_current ); 
     558        listview->GetItem( listitem ); 
     559        if( listitem.m_text.Lower().Contains( search_string.Lower() ) ) 
     560       
     561            i_item = i_current; 
     562            break; 
     563       
    529564    } 
    530565    for( long item = 0; item < listview->GetItemCount(); item++ ) 
     
    563598} 
    564599 
     600void Playlist::OnEnableSelection( wxCommandEvent& WXUNUSED(event) ) 
     601{ 
     602    playlist_t *p_playlist = 
     603        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
     604                                       FIND_ANYWHERE ); 
     605    if( p_playlist == NULL ) 
     606    { 
     607        return; 
     608    } 
     609 
     610    for( long item = listview->GetItemCount() - 1; item >= 0; item-- ) 
     611    { 
     612        if( listview->IsSelected( item ) ) 
     613        { 
     614            playlist_Enable( p_playlist, item ); 
     615        } 
     616    } 
     617    vlc_object_release( p_playlist); 
     618    Rebuild(); 
     619} 
     620 
     621void Playlist::OnDisableSelection( wxCommandEvent& WXUNUSED(event) ) 
     622{ 
     623    playlist_t *p_playlist = 
     624        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
     625                                       FIND_ANYWHERE ); 
     626    if( p_playlist == NULL ) 
     627    { 
     628        return; 
     629    } 
     630 
     631    for( long item = listview->GetItemCount() - 1; item >= 0; item-- ) 
     632    { 
     633        if( listview->IsSelected( item ) ) 
     634        { 
     635            playlist_Disable( p_playlist, item ); 
     636        } 
     637    } 
     638    vlc_object_release( p_playlist); 
     639    Rebuild(); 
     640} 
     641 
    565642void Playlist::OnRandom( wxCommandEvent& event ) 
    566643{ 
    567644    vlc_value_t val; 
    568645    val.b_bool = event.IsChecked(); 
    569 // ? VLC_TRUE : VLC_FALSE ; 
    570646    playlist_t *p_playlist = 
    571647        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
     
    582658    vlc_value_t val; 
    583659    val.b_bool = event.IsChecked(); 
    584 // ? VLC_TRUE : VLC_FALSE ; 
    585660    playlist_t *p_playlist = 
    586661        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
     
    598673    vlc_value_t val; 
    599674    val.b_bool = event.IsChecked(); 
    600 // ? VLC_TRUE : VLC_FALSE ; 
    601675    playlist_t *p_playlist = 
    602676        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
     
    627701        return; 
    628702    } 
    629  
    630703    playlist_Goto( p_playlist, event.GetIndex() ); 
    631704 
     
    643716} 
    644717 
     718void Playlist::OnInfos( wxCommandEvent& WXUNUSED(event) ) 
     719{ 
     720    playlist_t *p_playlist = 
     721        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
     722                                       FIND_ANYWHERE ); 
     723    if( p_playlist == NULL ) 
     724    { 
     725        return; 
     726    } 
     727 
     728    if( iteminfo_dialog == NULL ) 
     729    { 
     730        /* We use the first selected item, so find it */ 
     731        long i_item = -1; 
     732        i_item = listview->GetNextItem(i_item, 
     733                         wxLIST_NEXT_ALL, 
     734                         wxLIST_STATE_SELECTED); 
     735        if( i_item >= 0 && i_item < p_playlist->i_size ) 
     736        { 
     737            iteminfo_dialog = new ItemInfoDialog( 
     738                              p_intf, p_playlist->pp_items[i_item], this ); 
     739            if( iteminfo_dialog->ShowModal()  == wxID_OK ) 
     740                Rebuild(); 
     741            delete iteminfo_dialog; 
     742            iteminfo_dialog = NULL; 
     743        } 
     744    } 
     745    vlc_object_release( p_playlist ); 
     746} 
     747 
     748 
     749void Playlist::OnEnDis( wxCommandEvent& WXUNUSED(event) ) 
     750{ 
     751    playlist_t *p_playlist = 
     752        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
     753                                       FIND_ANYWHERE ); 
     754    if( p_playlist == NULL ) 
     755    { 
     756        return; 
     757    } 
     758 
     759    long i_item = -1; 
     760    i_item = listview->GetNextItem(i_item, 
     761                       wxLIST_NEXT_ALL, 
     762                       wxLIST_STATE_SELECTED); 
     763 
     764    if( i_item >= 0 && i_item < p_playlist->i_size ) 
     765    { 
     766       if( p_playlist->pp_items[i_item]->b_enabled == VLC_TRUE) 
     767           playlist_DisableGroup( p_playlist , 
     768                                  p_playlist->pp_items[i_item]->i_group ); 
     769       else 
     770           playlist_EnableGroup( p_playlist , 
     771                                  p_playlist->pp_items[i_item]->i_group ); 
     772       Rebuild(); 
     773    } 
     774 
     775    vlc_object_release( p_playlist ); 
     776} 
    645777/***************************************************************************** 
    646778 * PlaylistChanged: callback triggered by the intf-change playlist variable 
  • modules/gui/wxwindows/wxwindows.h

    ra885565 r12cbd4c  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: wxwindows.h,v 1.62 2003/09/22 14:40:10 zorglub Exp $ 
     5 * $Id: wxwindows.h,v 1.63 2003/10/06 16:23:30 zorglub Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    142142    void TogglePlayButton( int i_playing_status ); 
    143143 
     144//    wxFlexGridSizer *frame_sizer; 
    144145    wxBoxSizer  *frame_sizer; 
    145146    wxStatusBar *statusbar; 
     
    147148    wxSlider    *slider; 
    148149    wxWindow    *slider_frame; 
     150    wxWindow    *extra_frame; 
    149151    wxStaticBox *slider_box; 
     152 
     153    vlc_bool_t b_extra; 
     154 
     155    wxStaticBox *adjust_box; 
     156    wxSlider *brightness_slider; 
     157    wxSlider *contrast_slider; 
     158    wxSlider *saturation_slider; 
     159    wxSlider *hue_slider; 
     160 
     161    wxStaticBox *other_box; 
     162    wxComboBox *ratio_combo; 
    150163 
    151164    wxGauge     *volctrl; 
     
    155168    void CreateOurMenuBar(); 
    156169    void CreateOurToolBar(); 
     170    void CreateOurExtraPanel(); 
    157171    void CreateOurSlider(); 
    158172    void Open( int i_access_method ); 
     
    168182    void OnOpenSat( wxCommandEvent& event ); 
    169183    void OnOpenV4L( wxCommandEvent& event ); 
     184    void OnExtra( wxCommandEvent& event ); 
    170185    void OnShowDialog( wxCommandEvent& event ); 
    171186    void OnPlayStream( wxCommandEvent& event ); 
     
    176191    void OnSlowStream( wxCommandEvent& event ); 
    177192    void OnFastStream( wxCommandEvent& event ); 
     193 
     194    void OnEnableAdjust( wxCommandEvent& event ); 
     195    void OnHueUpdate( wxScrollEvent& event ); 
     196    void OnContrastUpdate( wxScrollEvent& event ); 
     197    void OnBrightnessUpdate( wxScrollEvent& event ); 
     198    void OnSaturationUpdate( wxScrollEvent& event ); 
     199 
     200    void OnRatio( wxCommandEvent& event ); 
    178201 
    179202    void OnMenuOpen( wxMenuEvent& event ); 
     
    639662 
    640663/* Playlist */ 
     664class ItemInfoDialog; 
    641665class Playlist: public wxFrame 
    642666{ 
     
    662686    void OnClose( wxCommandEvent& event ); 
    663687    void OnSearch( wxCommandEvent& event ); 
     688    void OnEnDis( wxCommandEvent& event ); 
     689    void OnInfos( wxCommandEvent& event ); 
    664690    void OnSearchTextChange( wxCommandEvent& event ); 
    665691    void OnOpen( wxCommandEvent& event ); 
    666692    void OnSave( wxCommandEvent& event ); 
     693    void OnEnableSelection( wxCommandEvent& event ); 
     694    void OnDisableSelection( wxCommandEvent& event ); 
    667695    void OnInvertSelection( wxCommandEvent& event ); 
    668696    void OnDeleteSelection( wxCommandEvent& event ); 
     
    676704 
    677705    wxTextCtrl *search_text; 
    678     wxButton *search_button;  
    679     DECLARE_EVENT_TABLE(); 
     706    wxButton *search_button; 
     707    DECLARE_EVENT_TABLE(); 
     708 
     709 
     710    ItemInfoDialog *iteminfo_dialog; 
    680711 
    681712    intf_thread_t *p_intf; 
     
    683714    int i_update_counter; 
    684715}; 
     716 
     717 
     718/* ItemInfo Dialog */ 
     719class ItemInfoDialog: public wxDialog 
     720{ 
     721public: 
     722    /* Constructor */ 
     723    ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item, 
     724