Changeset 12cbd4c8b63bcd5bfc077e24a11166171c421c38
- Timestamp:
- 06/10/03 18:23:30 (5 years ago)
- git-parent:
- Files:
-
- include/vlc_playlist.h (modified) (6 diffs)
- modules/gui/wxwindows/Modules.am (modified) (1 diff)
- modules/gui/wxwindows/interface.cpp (modified) (16 diffs)
- modules/gui/wxwindows/iteminfo.cpp (added)
- modules/gui/wxwindows/playlist.cpp (modified) (23 diffs)
- modules/gui/wxwindows/wxwindows.h (modified) (10 diffs)
- modules/misc/sap.c (modified) (10 diffs)
- modules/visualization/visual/effects.c (modified) (19 diffs)
- src/playlist/playlist.c (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
include/vlc_playlist.h
r8f02c03 r12cbd4c 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN 5 * $Id: vlc_playlist.h,v 1.1 3 2003/09/08 12:02:16zorglub Exp $5 * $Id: vlc_playlist.h,v 1.14 2003/10/06 16:23:30 zorglub Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 11 11 * the Free Software Foundation; either version 2 of the License, or 12 12 * (at your option) any later version. 13 * 13 * 14 14 * This program is distributed in the hope that it will be useful, 15 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of … … 49 49 int i_type; /**< unused yet */ 50 50 int i_status; /**< unused yet */ 51 vlc_bool_t b_autodeletion; /**< Indicates w ether this item is to51 vlc_bool_t b_autodeletion; /**< Indicates whther this item is to 52 52 * be deleted after playback. True mean 53 53 * that this item is to be deleted 54 54 * 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 */ 55 60 }; 56 61 … … 74 79 playlist_status_t i_status; /**< current status of playlist */ 75 80 int i_size; /**< total size of the list */ 76 81 int i_enabled; /**< How many items are enabled ? */ 77 82 playlist_item_t ** pp_items; /**< array of pointers to the 78 83 * playlist items */ … … 85 90 #define SORT_NORMAL 0 86 91 #define SORT_REVERSE 1 92 93 #define PLAYLIST_TYPE_MANUAL 0 94 #define PLAYLIST_TYPE_SAP 1 87 95 88 96 /***************************************************************************** … … 106 114 VLC_EXPORT( int, playlist_AddItem, ( playlist_t *, playlist_item_t *, int, int ) ); 107 115 VLC_EXPORT( int, playlist_Delete, ( playlist_t *, int ) ); 116 VLC_EXPORT( int, playlist_Disable, ( playlist_t *, int ) ); 117 VLC_EXPORT( int, playlist_Enable, ( playlist_t *, int ) ); 118 VLC_EXPORT( int, playlist_DisableGroup, ( playlist_t *, int ) ); 119 VLC_EXPORT( int, playlist_EnableGroup, ( playlist_t *, int ) ); 108 120 VLC_EXPORT( int, playlist_Sort, ( playlist_t *, int) ); 109 121 VLC_EXPORT( int, playlist_Move, ( playlist_t *, int, int ) ); modules/gui/wxwindows/Modules.am
rbe6f765 r12cbd4c 8 8 messages.cpp \ 9 9 playlist.cpp \ 10 iteminfo.cpp \ 10 11 menus.cpp \ 11 12 preferences.cpp \ modules/gui/wxwindows/interface.cpp
r3c98f14 r12cbd4c 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2001 VideoLAN 5 * $Id: interface.cpp,v 1.6 0 2003/09/07 22:53:09 fenrirExp $5 * $Id: interface.cpp,v 1.61 2003/10/06 16:23:30 zorglub Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 126 126 127 127 Prefs_Event, 128 Extra_Event, 128 129 129 130 SliderScroll_Event, … … 135 136 FastStream_Event, 136 137 138 Adjust_Event, 139 Hue_Event, 140 Contrast_Event, 141 Brightness_Event, 142 Saturation_Event, 143 144 Ratio_Event, 137 145 /* it is important for the id corresponding to the "About" command to have 138 146 * this standard value as otherwise it won't be handled properly under Mac … … 152 160 153 161 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) 154 167 155 168 #if defined( __WXMSW__ ) || defined( __WXMAC__ ) … … 174 187 EVT_COMMAND_SCROLL(SliderScroll_Event, Interface::OnSliderUpdate) 175 188 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 176 194 END_EVENT_TABLE() 177 195 … … 186 204 p_intf = _p_intf; 187 205 i_old_playing_status = PAUSE_S; 206 b_extra = VLC_FALSE; 188 207 189 208 /* Give our interface a nice little icon */ … … 191 210 192 211 /* 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 ); 194 214 SetSizer( frame_sizer ); 195 215 … … 199 219 p_dummy->SetFocus(); 200 220 frame_sizer->Add( p_dummy ); 201 221 202 222 /* Creation of the menu bar */ 203 223 CreateOurMenuBar(); … … 208 228 /* Creation of the slider sub-window */ 209 229 CreateOurSlider(); 210 frame_sizer->Add( slider_frame, 1, wxGROW, 0 );230 frame_sizer->Add( slider_frame, 0, wxEXPAND , 0 ); 211 231 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 ); 212 237 213 238 /* Creation of the status bar … … 261 286 262 287 #define HELP_PREFS N_("Go to the preferences menu") 288 #define EXTRA_PREFS N_("Open the extended GUI") 263 289 264 290 #define HELP_ABOUT N_("About this program") … … 298 324 settings_menu->Append( Prefs_Event, wxU(_("&Preferences...")), 299 325 wxU(_(HELP_PREFS)) ); 326 settings_menu->Append( Extra_Event, wxU(_("&Extra GUI") ), 327 wxU(_(EXTRA_PREFS)) ); 328 300 329 301 330 /* Create the "Audio" menu */ … … 389 418 wxBoxSizer *toolbar_sizer = new wxBoxSizer( wxHORIZONTAL ); 390 419 toolbar_sizer->Add( toolbar, 0, 0, 0 ); 420 391 421 toolbar_sizer->Layout(); 392 422 … … 437 467 /* Hide the slider by default */ 438 468 slider_frame->Hide(); 469 } 470 471 472 void 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); 439 605 } 440 606 … … 470 636 if( !accel.Ok() ) 471 637 msg_Err( p_intf, "invalid accelerator table" ); 472 638 473 639 SetAcceleratorTable( accel ); 474 640 msg_Dbg( p_intf, "accelerator table loaded" ); 475 476 } 641 642 } 643 644 477 645 478 646 /***************************************************************************** … … 660 828 } 661 829 830 void 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 848 void 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 905 void Interface::OnHueUpdate( wxScrollEvent& event) 906 { 907 config_PutInt( p_intf , "hue" , event.GetPosition() ); 908 } 909 910 void Interface::OnSaturationUpdate( wxScrollEvent& event) 911 { 912 config_PutFloat( p_intf , "saturation" , (float)event.GetPosition()/300 ); 913 } 914 915 void Interface::OnBrightnessUpdate( wxScrollEvent& event) 916 { 917 config_PutFloat( p_intf , "brightness", (float)event.GetPosition()/200 ); 918 } 919 920 void Interface::OnContrastUpdate(wxScrollEvent& event) 921 { 922 config_PutFloat( p_intf , "contrast" , (float)event.GetPosition()/200 ); 923 924 } 925 926 void Interface::OnRatio( wxCommandEvent& event ) 927 { 928 config_PutPsz( p_intf, "aspect-ratio", ratio_combo->GetValue() ); 929 } 930 931 662 932 void Interface::OnPlayStream( wxCommandEvent& WXUNUSED(event) ) 663 933 { … … 668 938 if( p_playlist == NULL ) return; 669 939 670 if( p_playlist->i_size )940 if( p_playlist->i_size && p_playlist->i_enabled ) 671 941 { 672 942 vlc_value_t state; modules/gui/wxwindows/playlist.cpp
ra885565 r12cbd4c 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2001 VideoLAN 5 * $Id: playlist.cpp,v 1.2 1 2003/09/22 14:40:10 zorglub Exp $5 * $Id: playlist.cpp,v 1.22 2003/10/06 16:23:30 zorglub Exp $ 6 6 * 7 7 * Authors: Olivier Teuli� <ipkiss@via.ecp.fr> … … 56 56 Save_Event, 57 57 58 EnableSelection_Event, 59 DisableSelection_Event, 60 58 61 InvertSelection_Event, 59 62 DeleteSelection_Event, … … 62 65 Repeat_Event, 63 66 SelectAll_Event, 67 68 En_Dis_Event, 69 70 Infos_Event, 64 71 65 72 SearchText_Event, … … 79 86 EVT_MENU(Open_Event, Playlist::OnOpen) 80 87 EVT_MENU(Save_Event, Playlist::OnSave) 88 EVT_MENU(EnableSelection_Event, Playlist::OnEnableSelection) 89 EVT_MENU(DisableSelection_Event, Playlist::OnDisableSelection) 81 90 EVT_MENU(InvertSelection_Event, Playlist::OnInvertSelection) 82 91 EVT_MENU(DeleteSelection_Event, Playlist::OnDeleteSelection) 83 92 EVT_MENU(SelectAll_Event, Playlist::OnSelectAll) 93 EVT_MENU(Infos_Event, Playlist::OnInfos) 84 94 EVT_CHECKBOX(Random_Event, Playlist::OnRandom) 85 95 EVT_CHECKBOX(Repeat_Event, Playlist::OnRepeat) … … 92 102 /* Button events */ 93 103 EVT_BUTTON( Search_Event, Playlist::OnSearch) 104 EVT_BUTTON( En_Dis_Event, Playlist::OnEnDis) 94 105 EVT_BUTTON( Save_Event, Playlist::OnSave) 106 EVT_BUTTON( Infos_Event, Playlist::OnInfos) 95 107 96 108 EVT_TEXT(SearchText_Event, Playlist::OnSearchTextChange) … … 109 121 { 110 122 /* Initializations */ 123 iteminfo_dialog = NULL; 111 124 p_intf = _p_intf; 112 125 vlc_value_t val; … … 136 149 /* Create our "Selection" menu */ 137 150 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(); 138 154 selection_menu->Append( InvertSelection_Event, wxU(_("&Invert")) ); 139 155 selection_menu->Append( DeleteSelection_Event, wxU(_("&Delete")) ); … … 162 178 listview->InsertColumn( 0, wxU(_("Url")) ); 163 179 #if 0 164 listview->InsertColumn( 1, wxU(_("Duration")) );180 listview->InsertColumn( 1, wxU(_("Duration")) ); 165 181 #endif 166 182 listview->SetColumnWidth( 0, 300 ); 167 183 #if 0 168 listview->SetColumnWidth( 1, 100 );184 listview->SetColumnWidth( 1, 100 ); 169 185 #endif 170 186 171 187 /* Create the Random checkbox */ 172 wxCheckBox *random_checkbox = 188 wxCheckBox *random_checkbox = 173 189 new wxCheckBox( playlist_panel, Random_Event, wxU(_("Random")) ); 174 190 175 191 var_Get( p_intf, "random", &val); 176 192 vlc_bool_t b_random = val.b_bool; … … 178 194 179 195 /* Create the Loop Checkbox */ 180 wxCheckBox *loop_checkbox = 196 wxCheckBox *loop_checkbox = 181 197 new wxCheckBox( playlist_panel, Loop_Event, wxU(_("Loop")) ); 182 198 183 199 var_Get( p_intf, "loop", &val ); 184 int b_loop = val.b_bool ; 200 int b_loop = val.b_bool ; 185 201 loop_checkbox->SetValue( b_loop ); 186 202 187 203 /* 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")) ); 190 206 191 207 var_Get( p_intf, "repeat", &val ); 192 int b_repeat = val.b_bool ; 208 int b_repeat = val.b_bool ; 193 209 repeat_checkbox->SetValue( b_repeat ); 194 210 195 211 /* Create the Search Textbox */ 196 212 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); 200 216 201 217 /* 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") ) ); 206 226 /* 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); 215 230 button_sizer->Layout(); 216 231 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 ); 218 244 search_sizer->Add( search_text, 0, wxALL|wxALIGN_CENTER, 5); 219 245 search_sizer->Add( search_button, 0, wxALL|wxALIGN_CENTER, 5); … … 221 247 search_sizer->Layout(); 222 248 223 wxBoxSizer *bottom_sizer = new wxBoxSizer( wx HORIZONTAL );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 ); 225 251 bottom_sizer->Add( button_sizer , 0, wxALL|wxALIGN_CENTER, 5 ); 226 252 227 253 bottom_sizer->Layout(); 228 254 … … 231 257 wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL ); 232 258 panel_sizer->Add( listview, 1, wxEXPAND | wxALL, 5 ); 233 259 260 panel_sizer->Add( search_sizer, 0, wxALIGN_CENTRE ); 234 261 panel_sizer->Add( bottom_sizer, 0 , wxALIGN_CENTRE); 235 262 panel_sizer->Layout(); … … 271 298 } 272 299 300 delete iteminfo_dialog; 301 273 302 var_DelCallback( p_playlist, "intf-change", PlaylistChanged, this ); 274 303 vlc_object_release( p_playlist ); … … 294 323 wxString filename = wxU(p_playlist->pp_items[i]->psz_name); 295 324 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 } 296 332 /* FIXME: we should try to find the actual duration... */ 297 /* While we don't use it, hide it, it's ugly */298 #if 0299 listview->SetItem( i, 1, wxU(_("no info")) );300 #endif333 /* While we don't use it, hide it, it's ugly */ 334 #if 0 335 listview->SetItem( i, 1, wxU(_("no info")) ); 336 #endif 301 337 } 302 338 vlc_mutex_unlock( &p_playlist->object_lock ); … … 308 344 listview->SetItem( listitem ); 309 345 310 // listview->Select( p_playlist->i_index, TRUE );311 346 listview->Focus( p_playlist->i_index ); 312 347 … … 466 501 467 502 playlist_Sort( p_playlist , 0 ); 468 503 469 504 vlc_object_release( p_playlist ); 470 505 … … 485 520 486 521 playlist_Sort( p_playlist , 1 ); 487 522 488 523 vlc_object_release( p_playlist ); 489 524 … … 495 530 void Playlist::OnSearchTextChange( wxCommandEvent& WXUNUSED(event) ) 496 531 { 497 search_button->SetDefault(); 532 search_button->SetDefault(); 498 533 } 499 534 … … 503 538 504 539 int i_current; 505 int i_first = 0 ; 540 int i_first = 0 ; 506 541 int i_item = -1; 507 542 508 543 for( i_current = 0 ; i_current <= listview->GetItemCount() ; i_current++ ) 509 544 { 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 } 529 564 } 530 565 for( long item = 0; item < listview->GetItemCount(); item++ ) … … 563 598 } 564 599 600 void 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 621 void 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 565 642 void Playlist::OnRandom( wxCommandEvent& event ) 566 643 { 567 644 vlc_value_t val; 568 645 val.b_bool = event.IsChecked(); 569 // ? VLC_TRUE : VLC_FALSE ;570 646 playlist_t *p_playlist = 571 647 (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, … … 582 658 vlc_value_t val; 583 659 val.b_bool = event.IsChecked(); 584 // ? VLC_TRUE : VLC_FALSE ;585 660 playlist_t *p_playlist = 586 661 (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, … … 598 673 vlc_value_t val; 599 674 val.b_bool = event.IsChecked(); 600 // ? VLC_TRUE : VLC_FALSE ;601 675 playlist_t *p_playlist = 602 676 (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, … … 627 701 return; 628 702 } 629 630 703 playlist_Goto( p_playlist, event.GetIndex() ); 631 704 … … 643 716 } 644 717 718 void 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 749 void 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 } 645 777 /***************************************************************************** 646 778 * PlaylistChanged: callback triggered by the intf-change playlist variable modules/gui/wxwindows/wxwindows.h
ra885565 r12cbd4c 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999, 2000 VideoLAN 5 * $Id: wxwindows.h,v 1.6 2 2003/09/22 14:40:10 zorglub Exp $5 * $Id: wxwindows.h,v 1.63 2003/10/06 16:23:30 zorglub Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 142 142 void TogglePlayButton( int i_playing_status ); 143 143 144 // wxFlexGridSizer *frame_sizer; 144 145 wxBoxSizer *frame_sizer; 145 146 wxStatusBar *statusbar; … … 147 148 wxSlider *slider; 148 149 wxWindow *slider_frame; 150 wxWindow *extra_frame; 149 151 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; 150 163 151 164 wxGauge *volctrl; … … 155 168 void CreateOurMenuBar(); 156 169 void CreateOurToolBar(); 170 void CreateOurExtraPanel(); 157 171 void CreateOurSlider(); 158 172 void Open( int i_access_method ); … … 168 182 void OnOpenSat( wxCommandEvent& event ); 169 183 void OnOpenV4L( wxCommandEvent& event ); 184 void OnExtra( wxCommandEvent& event ); 170 185 void OnShowDialog( wxCommandEvent& event ); 171 186 void OnPlayStream( wxCommandEvent& event ); … … 176 191 void OnSlowStream( wxCommandEvent& event ); 177 192 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 ); 178 201 179 202 void OnMenuOpen( wxMenuEvent& event ); … … 639 662 640 663 /* Playlist */ 664 class ItemInfoDialog; 641 665 class Playlist: public wxFrame 642 666 { … … 662 686 void OnClose( wxCommandEvent& event ); 663 687 void OnSearch( wxCommandEvent& event ); 688 void OnEnDis( wxCommandEvent& event ); 689 void OnInfos( wxCommandEvent& event ); 664 690 void OnSearchTextChange( wxCommandEvent& event ); 665 691 void OnOpen( wxCommandEvent& event ); 666 692 void OnSave( wxCommandEvent& event ); 693 void OnEnableSelection( wxCommandEvent& event ); 694 void OnDisableSelection( wxCommandEvent& event ); 667 695 void OnInvertSelection( wxCommandEvent& event ); 668 696 void OnDeleteSelection( wxCommandEvent& event ); … … 676 704 677 705 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; 680 711 681 712 intf_thread_t *p_intf; … … 683 714 int i_update_counter; 684 715 }; 716 717 718 /* ItemInfo Dialog */ 719 class ItemInfoDialog: public wxDialog 720 { 721 public: 722 /* Constructor */ 723 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item, 724
