Changeset 1595dc2534196eac95a1488e864292fab033e99c
- Timestamp:
- 05/01/04 14:00:39 (5 years ago)
- git-parent:
- Files:
-
- modules/gui/wxwindows/dialogs.cpp (modified) (2 diffs)
- modules/gui/wxwindows/interface.cpp (modified) (4 diffs)
- modules/gui/wxwindows/iteminfo.cpp (modified) (4 diffs)
- modules/gui/wxwindows/open.cpp (modified) (4 diffs)
- modules/gui/wxwindows/playlist.cpp (modified) (16 diffs)
- modules/gui/wxwindows/streamwizard.cpp (modified) (3 diffs)
- modules/gui/wxwindows/wxwindows.h (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/gui/wxwindows/dialogs.cpp
r3a6a1ce r1595dc2 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2001 VideoLAN 5 * $Id: dialogs.cpp,v 1.1 2 2003/12/11 02:26:03 asmaxExp $5 * $Id: dialogs.cpp,v 1.13 2004/01/05 13:00:39 zorglub Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 290 290 if( event.GetInt() ) 291 291 playlist_Add( p_playlist, (const char *)paths[i].mb_str(), 292 0, 0,292 (const char *)paths[i].mb_str(), 293 293 PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), 294 294 PLAYLIST_END ); 295 295 else 296 296 playlist_Add( p_playlist, (const char *)paths[i].mb_str(), 297 0, 0, PLAYLIST_APPEND, PLAYLIST_END ); 297 (const char *)paths[i].mb_str(), 298 PLAYLIST_APPEND, PLAYLIST_END ); 298 299 } 299 300 modules/gui/wxwindows/interface.cpp
r1fc66ed r1595dc2 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2001, 2003 VideoLAN 5 * $Id: interface.cpp,v 1.8 2 2004/01/03 10:55:07 gbazinExp $5 * $Id: interface.cpp,v 1.83 2004/01/05 13:00:39 zorglub Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 209 209 Interface::Interface( intf_thread_t *_p_intf ): 210 210 wxFrame( NULL, -1, wxT("VLC media player"), 211 wxDefaultPosition, wx DefaultSize, wxDEFAULT_FRAME_STYLE )211 wxDefaultPosition, wxSize(700,100), wxDEFAULT_FRAME_STYLE ) 212 212 { 213 213 /* Initializations */ … … 1175 1175 #endif 1176 1176 1177 #undef WIN32 1177 1178 vlc_mutex_unlock( &p_intf->change_lock ); 1178 1179 } … … 1313 1314 1314 1315 for( size_t i = 0; i < filenames.GetCount(); i++ ) 1315 playlist_Add( p_playlist, (const char *)filenames[i].mb_str(), 0, 0, 1316 playlist_Add( p_playlist, (const char *)filenames[i].mb_str(), 1317 (const char *)filenames[i].mb_str(), 1316 1318 PLAYLIST_APPEND | ((i | b_enqueue) ? 0 : PLAYLIST_GO), 1317 1319 PLAYLIST_END ); modules/gui/wxwindows/iteminfo.cpp
r4219568 r1595dc2 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2001 VideoLAN 5 * $Id: iteminfo.cpp,v 1. 5 2003/12/22 02:24:52 samExp $5 * $Id: iteminfo.cpp,v 1.6 2004/01/05 13:00:39 zorglub Exp $ 6 6 * 7 7 * Authors: Cl�nt Stenac <zorglub@videolan.org> … … 141 141 wxPanel *ItemInfoDialog::InfoPanel( wxWindow* parent ) 142 142 { 143 wxPanel * panel = new wxPanel( parent, -1, wxDefaultPosition,143 wxPanel *info_panel = new wxPanel( parent, -1, wxDefaultPosition, 144 144 wxDefaultSize ); 145 146 wxStaticBox *panel_box = new wxStaticBox( panel, -1, 145 info_panel->SetAutoLayout( TRUE ); 146 wxBoxSizer *info_sizer = new wxBoxSizer( wxHORIZONTAL ); 147 148 /* Create a box to surround the controls */ 149 wxStaticBox *panel_box = new wxStaticBox( info_panel, -1, 147 150 wxU(_("Item informations")) ); 148 wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box, 151 152 wxStaticBoxSizer *box_sizer = new wxStaticBoxSizer( panel_box, 149 153 wxVERTICAL ); 150 151 info_subpanel = new wxPanel( panel, -1 );152 153 wxFlexGridSizer *subpanel_sizer =154 new wxFlexGridSizer( 3, 1 , 0 , 0 );155 154 156 155 /* URI Textbox */ 157 156 wxStaticText *uri_label = 158 new wxStaticText( info_subpanel, -1, wxU(_("URI")) );159 160 uri_text = new wxTextCtrl( info_ subpanel, Uri_Event,157 new wxStaticText( info_panel, -1, wxU(_("URI")) ); 158 159 uri_text = new wxTextCtrl( info_panel, Uri_Event, 161 160 wxU(p_item->psz_uri), 162 161 wxDefaultPosition, wxSize( 300, -1 ), 163 162 wxTE_PROCESS_ENTER); 164 163 165 subpanel_sizer->Add( uri_label, 0, wxALIGN_LEFT | 166 wxALIGN_CENTER_VERTICAL ); 167 subpanel_sizer->Add( uri_text, 0, wxALIGN_RIGHT | 168 wxALIGN_CENTER_VERTICAL ); 169 164 wxBoxSizer *uri_sizer = new wxBoxSizer( wxHORIZONTAL ); 165 166 uri_sizer->Add( uri_label, 0 , wxALIGN_RIGHT |wxALL , 5 ); 167 uri_sizer->Add( uri_text, 1 , wxALIGN_RIGHT | wxALL , 5 ); 168 uri_sizer->Layout(); 169 box_sizer->Add( uri_sizer, 1, wxEXPAND , 5); 170 170 171 171 /* Name Textbox */ 172 172 wxStaticText *name_label = 173 new wxStaticText( info_subpanel, -1, wxU(_("Name")) );173 new wxStaticText( info_panel, -1, wxU(_("Name")) ); 174 174 175 175 name_text = 176 new wxTextCtrl( info_ subpanel, Uri_Event,176 new wxTextCtrl( info_panel, Uri_Event, 177 177 wxU(p_item->psz_name), 178 178 wxDefaultPosition, wxSize( 300, -1 ), 179 179 wxTE_PROCESS_ENTER); 180 180 181 subpanel_sizer->Add( name_label, 0, wxALIGN_LEFT | 182 wxALIGN_CENTER_VERTICAL ); 183 subpanel_sizer->Add( name_text, 0, wxALIGN_RIGHT | 184 wxALIGN_CENTER_VERTICAL ); 181 wxBoxSizer *name_sizer = new wxBoxSizer( wxHORIZONTAL ); 182 183 name_sizer->Add( name_label, 0 , wxALIGN_RIGHT |wxALL , 5 ); 184 name_sizer->Add( name_text, 1 , wxALIGN_RIGHT | wxALL , 5 ); 185 name_sizer->Layout(); 186 box_sizer->Add( name_sizer, 1 , wxEXPAND, 5 ); 185 187 186 188 /* Author Textbox */ 187 189 wxStaticText *author_label = 188 new wxStaticText( info_subpanel, -1, wxU(_("Author")) );190 new wxStaticText( info_panel, -1, wxU(_("Author")) ); 189 191 190 192 author_text = 191 new wxTextCtrl( info_subpanel, Uri_Event, 192 wxU(p_item->psz_author), 193 new wxTextCtrl( info_panel, Uri_Event, 194 wxU( playlist_GetItemInfo( p_item, 195 _("General"), _("Author") ) ), 193 196 wxDefaultPosition, wxSize( 300, -1 ), 194 197 wxTE_PROCESS_ENTER); 195 198 196 subpanel_sizer->Add( author_label, 0, wxALIGN_LEFT | 197 wxALIGN_CENTER_VERTICAL ); 198 subpanel_sizer->Add( author_text, 0, wxALIGN_RIGHT | 199 wxALIGN_CENTER_VERTICAL ); 200 201 info_subpanel->SetSizerAndFit( subpanel_sizer ); 202 203 /* Stuff everything into the main panel */ 204 panel_sizer->Add( info_subpanel, 1, 205 wxEXPAND | wxALIGN_LEFT | 206 wxALIGN_CENTER_VERTICAL | wxALL, 5 ); 207 208 panel->SetSizerAndFit( panel_sizer ); 209 210 return panel; 199 wxBoxSizer *author_sizer = new wxBoxSizer( wxHORIZONTAL ); 200 author_sizer->Add( author_label, 0 , wxALIGN_RIGHT | wxALL , 5 ); 201 author_sizer->Add( author_text, 1 , wxALIGN_RIGHT | wxALL , 5); 202 author_sizer->Layout(); 203 box_sizer->Add( author_sizer, 1, wxEXPAND, 5 ); 204 205 /* Treeview */ 206 info_tree = new wxTreeCtrl( info_panel, -1, wxDefaultPosition, 207 wxSize(220,200), 208 wxSUNKEN_BORDER |wxTR_HAS_BUTTONS | 209 wxTR_HIDE_ROOT ); 210 211 box_sizer->Add( info_tree, 0, wxEXPAND, 5 ); 212 info_sizer->Add( box_sizer, 1, wxBOTTOM, 5 ); 213 214 info_panel->SetSizer( info_sizer ); 215 info_sizer->Layout(); 216 info_sizer->SetSizeHints( info_panel ); 217 218 UpdateInfo(); 219 220 return info_panel; 211 221 } 212 222 … … 277 287 } 278 288 289 void ItemInfoDialog::UpdateInfo() 290 { 291 if( !info_root ) 292 { 293 info_root = info_tree->AddRoot( wxU( p_item->psz_name) ); 294 } 295 296 /* Rebuild the tree */ 297 for( int i = 0; i< p_item->i_categories ; i++) 298 { 299 if( !strcmp( p_item->pp_categories[i]->psz_name, _("Options") ) ) 300 { 301 continue; 302 } 303 wxTreeItemId cat = info_tree->AppendItem( info_root, 304 wxU( p_item->pp_categories[i]->psz_name) ); 305 306 for( int j = 0 ; j < p_item->pp_categories[i]->i_infos ; j++ ) 307 { 308 info_tree->AppendItem( cat , (wxString) 309 wxU(p_item->pp_categories[i]->pp_infos[j]->psz_name) + 310 wxT(": ") + 311 wxU(p_item->pp_categories[i]->pp_infos[j]->psz_value) ); 312 } 313 } 314 } 315 279 316 /***************************************************************************** 280 317 * Events methods. … … 284 321 p_item->psz_name = strdup( name_text->GetLineText(0).mb_str() ); 285 322 p_item->psz_uri = strdup( uri_text->GetLineText(0).mb_str() ); 286 p_item->psz_author = strdup( author_text->GetLineText(0).mb_str() ); 323 playlist_AddItemInfo( p_item,"General","Author", 324 author_text->GetLineText(0).mb_str() ); 287 325 vlc_bool_t b_old_enabled = p_item->b_enabled; 288 326 modules/gui/wxwindows/open.cpp
rdc93d55 r1595dc2 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000, 2001, 2003 VideoLAN 5 * $Id: open.cpp,v 1.6 1 2003/12/22 15:42:43 gbazinExp $5 * $Id: open.cpp,v 1.62 2004/01/05 13:00:39 zorglub Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 903 903 for( int i = 0; i < (int)mrl.GetCount(); i++ ) 904 904 { 905 int i_options = 0, i_total_options; 906 char **ppsz_options = NULL; 905 int i_options = 0; 906 907 int i_id = playlist_Add( p_playlist, (const char *)mrl[i].mb_str(), 908 (const char *)mrl[i].mb_str(), 909 PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), PLAYLIST_END ); 910 int i_pos = playlist_GetPositionById( p_playlist, i_id ); 907 911 908 912 /* Count the input options */ … … 913 917 } 914 918 915 /* Allocate ppsz_options */919 /* Insert options */ 916 920 for( int j = 0; j < i_options; j++ ) 917 921 { 918 if( !ppsz_options ) 919 ppsz_options = (char **)malloc( sizeof(char *) * i_options ); 920 921 ppsz_options[j] = strdup( mrl[i + j + 1].mb_str() ); 922 } 923 924 i_total_options = i_options; 922 playlist_AddOption( p_playlist, i_pos, mrl[i + j + 1].mb_str() ); 923 } 925 924 926 925 /* Get the options from the subtitles dialog */ 927 926 if( subsfile_checkbox->IsChecked() && subsfile_mrl.GetCount() ) 928 927 { 929 ppsz_options = (char **)realloc( ppsz_options, sizeof(char *) *930 (i_total_options + subsfile_mrl.GetCount()) );931 932 928 for( int j = 0; j < (int)subsfile_mrl.GetCount(); j++ ) 933 929 { 934 p psz_options[i_total_options + j] =935 strdup(subsfile_mrl[j].mb_str() );930 playlist_AddOption( p_playlist, i_pos , 931 subsfile_mrl[j].mb_str() ); 936 932 } 937 938 i_total_options += subsfile_mrl.GetCount();939 933 } 940 934 … … 942 936 if( sout_checkbox->IsChecked() && sout_mrl.GetCount() ) 943 937 { 944 ppsz_options = (char **)realloc( ppsz_options, sizeof(char *) *945 (i_total_options + sout_mrl.GetCount()) );946 947 938 for( int j = 0; j < (int)sout_mrl.GetCount(); j++ ) 948 939 { 949 p psz_options[i_total_options + j] =950 strdup(sout_mrl[j].mb_str() );940 playlist_AddOption( p_playlist, i_pos , 941 sout_mrl[j].mb_str() ); 951 942 } 952 953 i_total_options += sout_mrl.GetCount(); 954 955 } 956 957 playlist_Add( p_playlist, (const char *)mrl[i].mb_str(), 958 (const char **)ppsz_options, i_total_options, 959 PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), PLAYLIST_END ); 960 961 /* clean up */ 962 for( int j = 0; j < i_total_options; j++ ) 963 free( ppsz_options[j] ); 964 if( ppsz_options ) free( ppsz_options ); 965 943 } 966 944 i += i_options; 967 945 } modules/gui/wxwindows/playlist.cpp
r973409a r1595dc2 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2001, 2003 VideoLAN 5 * $Id: playlist.cpp,v 1.3 2 2003/12/22 14:31:01 gbazinExp $5 * $Id: playlist.cpp,v 1.33 2004/01/05 13:00:39 zorglub Exp $ 6 6 * 7 7 * Authors: Olivier Teuli� <ipkiss@via.ecp.fr> … … 34 34 int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable, 35 35 vlc_value_t old_val, vlc_value_t new_val, void *param ); 36 int PlaylistNext( vlc_object_t *p_this, const char *psz_variable, 37 vlc_value_t old_val, vlc_value_t new_val, void *param ); 38 int ItemChanged( vlc_object_t *p_this, const char *psz_variable, 39 vlc_value_t old_val, vlc_value_t new_val, void *param ); 36 40 37 41 /***************************************************************************** … … 73 77 Down_Event, 74 78 Infos_Event, 79 80 PopupPlay_Event, 81 PopupDel_Event, 82 PopupEna_Event, 83 PopupInfo_Event, 75 84 76 85 SearchText_Event, … … 115 124 EVT_LIST_COL_CLICK(ListView_Event, Playlist::OnColSelect) 116 125 EVT_LIST_KEY_DOWN(ListView_Event, Playlist::OnKeyDown) 126 EVT_LIST_ITEM_RIGHT_CLICK(ListView_Event, Playlist::OnPopup) 127 128 /* Popup events */ 129 EVT_MENU( PopupPlay_Event, Playlist::OnPopupPlay) 130 EVT_MENU( PopupDel_Event, Playlist::OnPopupDel) 131 EVT_MENU( PopupEna_Event, Playlist::OnPopupEna) 132 EVT_MENU( PopupInfo_Event, Playlist::OnPopupInfo) 133 117 134 118 135 /* Button events */ … … 215 232 SetMenuBar( menubar ); 216 233 234 /* Create the popup menu */ 235 popup_menu = new wxMenu; 236 popup_menu->Append( PopupPlay_Event, wxU(_("Play item")) ); 237 popup_menu->Append( PopupDel_Event, wxU(_("Delete item")) ); 238 popup_menu->Append( PopupEna_Event, wxU(_("Toggle enabled")) ); 239 popup_menu->Append( PopupInfo_Event, wxU(_("Info on item")) ); 217 240 218 241 /* Create a panel to put everything in */ … … 341 364 342 365 /* We want to be noticed of playlist changes */ 366 367 /* Some global changes happened -> Rebuild all */ 343 368 var_AddCallback( p_playlist, "intf-change", PlaylistChanged, this ); 369 370 /* We went to the next item */ 371 var_AddCallback( p_playlist, "playlist-current", PlaylistNext, this ); 372 373 /* One item has been updated */ 374 var_AddCallback( p_playlist, "item-change", ItemChanged, this ); 375 376 344 377 vlc_object_release( p_playlist ); 345 378 … … 362 395 var_DelCallback( p_playlist, "intf-change", PlaylistChanged, this ); 363 396 vlc_object_release( p_playlist ); 397 } 398 399 /********************************************************************** 400 * Update one playlist item 401 **********************************************************************/ 402 void Playlist::UpdateItem( int i ) 403 { 404 playlist_t *p_playlist = 405 (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 406 FIND_ANYWHERE ); 407 if( p_playlist == NULL ) 408 { 409 return; 410 } 411 if( i < 0 || i > p_playlist->i_size ) 412 { 413 vlc_object_release(p_playlist); 414 return; 415 } 416 listview->SetItem( i, 0, wxL2U(p_playlist->pp_items[i]->psz_name) ); 417 listview->SetItem( i, 1, wxL2U( playlist_GetInfo( p_playlist, i, 418 "General" , "Author" ) ) ); 419 listview->SetItem( i, 2, 420 wxL2U(playlist_FindGroup(p_playlist,p_playlist-> 421 pp_items[i]->i_group) ) ); 422 423 if( p_playlist->pp_items[i]->b_enabled == VLC_FALSE ) 424 { 425 wxListItem listitem; 426 listitem.m_itemId = i; 427 listitem.SetTextColour( *wxLIGHT_GREY); 428 listview->SetItem(listitem); 429 } 430 431 char psz_duration[MSTRTIME_MAX_SIZE]; 432 mtime_t dur = p_playlist->pp_items[i]->i_duration; 433 if( dur != -1 ) secstotimestr( psz_duration, dur/1000000 ); 434 else memcpy( psz_duration , "-:--:--", sizeof("-:--:--") ); 435 listview->SetItem( i, 3, wxU(psz_duration) ); 436 437 /* Change the colour for the currenty played stream */ 438 wxListItem listitem; 439 listitem.m_itemId = i; 440 if( i == p_playlist->i_index ) 441 { 442 listitem.SetTextColour( *wxRED ); 443 } 444 else 445 { 446 listitem.SetTextColour( *wxBLACK ); 447 } 448 listview->SetItem( listitem ); 449 450 vlc_object_release(p_playlist); 364 451 } 365 452 … … 388 475 wxString filename = wxL2U(p_playlist->pp_items[i]->psz_name); 389 476 listview->InsertItem( i, filename ); 390 listview->SetItem( i, 1, wxL2U(p_playlist->pp_items[i]->psz_author) ); 391 listview->SetItem( i, 2, 392 wxL2U(playlist_FindGroup( p_playlist, 393 p_playlist->pp_items[i]->i_group )) ); 394 if( p_playlist->pp_items[i]->b_enabled == VLC_FALSE ) 395 { 396 wxListItem listitem; 397 listitem.m_itemId = i; 398 listitem.SetTextColour( *wxLIGHT_GREY); 399 listview->SetItem(listitem); 400 } 401 402 char psz_duration[MSTRTIME_MAX_SIZE]; 403 mtime_t dur = p_playlist->pp_items[i]->i_duration; 404 if( dur != -1 ) secstotimestr( psz_duration, dur/1000000 ); 405 else memcpy( psz_duration , "-:--:--", sizeof("-:--:--") ); 406 listview->SetItem( i, 3, wxU(psz_duration) ); 477 UpdateItem( i ); 407 478 } 408 479 vlc_mutex_unlock( &p_playlist->object_lock ); 409 410 /* Change the colour for the currenty played stream */411 wxListItem listitem;412 listitem.m_itemId = p_playlist->i_index;413 listitem.SetTextColour( *wxRED );414 listview->SetItem( listitem );415 480 416 481 if( i_focused ) … … 816 881 { 817 882 playlist_Enable( p_playlist, item ); 883 UpdateItem( item ); 818 884 } 819 885 } 820 886 vlc_object_release( p_playlist); 821 Rebuild();822 887 } 823 888 … … 837 902 { 838 903 playlist_Disable( p_playlist, item ); 904 UpdateItem( item ); 839 905 } 840 906 } 841 907 vlc_object_release( p_playlist); 842 Rebuild();843 908 } 844 909 … … 913 978 vlc_object_release( p_playlist ); 914 979 } 980 915 981 void Playlist::OnKeyDown( wxListEvent& event ) 916 982 { … … 924 990 } 925 991 926 void Playlist::OnInfos( wxCommandEvent& WXUNUSED(event) ) 927 { 928 playlist_t *p_playlist = 929 (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 930 FIND_ANYWHERE ); 931 if( p_playlist == NULL ) 932 { 933 return; 934 } 935 992 void Playlist::ShowInfos( int i_item ) 993 { 994 playlist_t *p_playlist = 995 (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 996 FIND_ANYWHERE ); 997 if( p_playlist == NULL ) 998 { 999 return; 1000 } 936 1001 if( iteminfo_dialog == NULL ) 937 1002 { 938 /* We use the first selected item, so find it */939 long i_item = listview->GetNextItem( i_item, wxLIST_NEXT_ALL,940 wxLIST_STATE_SELECTED );941 1003 if( i_item >= 0 && i_item < p_playlist->i_size ) 942 1004 { … … 944 1006 p_intf, p_playlist->pp_items[i_item], this ); 945 1007 if( iteminfo_dialog->ShowModal() == wxID_OK ) 946 Rebuild();1008 UpdateItem( i_item ); 947 1009 delete iteminfo_dialog; 948 1010 iteminfo_dialog = NULL; … … 950 1012 } 951 1013 vlc_object_release( p_playlist ); 1014 } 1015 1016 void Playlist::OnInfos( wxCommandEvent& WXUNUSED(event) ) 1017 { 1018 /* We use the first selected item, so find it */ 1019 long i_item = listview->GetNextItem( -1 , wxLIST_NEXT_ALL, 1020 wxLIST_STATE_SELECTED ); 1021 ShowInfos( i_item ); 952 1022 } 953 1023 … … 985 1055 986 1056 /***************************************************************************** 1057 * Popup management functions 1058 *****************************************************************************/ 1059 void Playlist::OnPopup( wxListEvent& event ) 1060 { 1061 i_popup_item = event.GetIndex(); 1062 Playlist::PopupMenu( popup_menu , ScreenToClient( wxGetMousePosition() ) ); 1063 } 1064 1065 1066 void Playlist::OnPopupPlay( wxMenuEvent& event ) 1067 { 1068 playlist_t *p_playlist = 1069 (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 1070 FIND_ANYWHERE ); 1071 if( p_playlist == NULL ) 1072 { 1073 return; 1074 } 1075 if( i_popup_item != -1 ) 1076 { 1077 playlist_Goto( p_playlist, i_popup_item ); 1078 } 1079 vlc_object_release( p_playlist ); 1080 } 1081 1082 void Playlist::OnPopupDel( wxMenuEvent& event ) 1083 { 1084 DeleteItem( i_popup_item ); 1085 } 1086 1087 void Playlist::OnPopupEna( wxMenuEvent& event ) 1088 { 1089 playlist_t *p_playlist = 1090 (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 1091 FIND_ANYWHERE ); 1092 if( p_playlist == NULL ) 1093 { 1094 return; 1095 } 1096 1097 if( p_playlist->pp_items[i_popup_item]->b_enabled ) 1098 //playlist_IsEnabled( p_playlist, i_popup_item ) ) 1099 { 1100 playlist_Disable( p_playlist, i_popup_item ); 1101 } 1102 else 1103 { 1104 playlist_Enable( p_playlist, i_popup_item ); 1105 } 1106 vlc_object_release( p_playlist); 1107 UpdateItem( i_popup_item ); 1108 } 1109 1110 void Playlist::OnPopupInfo( wxMenuEvent& event ) 1111 { 1112 ShowInfos( i_popup_item ); 1113 } 1114 1115 /***************************************************************************** 987 1116 * PlaylistChanged: callback triggered by the intf-change playlist variable 988 1117 * We don't rebuild the playlist directly here because we don't want the … … 999 1128 } 1000 1129 1130 /***************************************************************************** 1131 * Next: callback triggered by the playlist-current playlist variable 1132 *****************************************************************************/ 1133 int PlaylistNext( vlc_object_t *p_this, const char *psz_variable, 1134 vlc_value_t old_val, vlc_value_t new_val, void *param ) 1135 { 1136 Playlist *p_playlist_dialog = (Playlist *)param; 1137 p_playlist_dialog->UpdateItem( old_val.i_int ); 1138 p_playlist_dialog->UpdateItem( new_val.i_int ); 1139 return 0; 1140 } 1141 1142 1143 /***************************************************************************** 1144 * ItemChanged: callback triggered by the item-change playlist variable 1145 *****************************************************************************/ 1146 int ItemChanged( vlc_object_t *p_this, const char *psz_variable, 1147 vlc_value_t old_val, vlc_value_t new_val, void *param ) 1148 { 1149 Playlist *p_playlist_dialog = (Playlist *)param; 1150 p_playlist_dialog->UpdateItem( new_val.i_int ); 1151 } 1152 1001 1153 1002 1154 /*************************************************************************** modules/gui/wxwindows/streamwizard.cpp
r4219568 r1595dc2 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2001 VideoLAN 5 * $Id: streamwizard.cpp,v 1. 3 2003/12/22 02:24:52 samExp $5 * $Id: streamwizard.cpp,v 1.4 2004/01/05 13:00:39 zorglub Exp $ 6 6 * 7 7 * Authors: Cl�nt Stenac <zorglub@videolan.org> … … 205 205 for( int i = 0; i < (int)p_open_dialog->mrl.GetCount(); i++ ) 206 206 { 207 int i_options = 0, i_total_options; 208 char **ppsz_options = NULL; 207 int i_id = playlist_Add( p_playlist, 208 (const char *)p_open_dialog->mrl[i].mb_str(), 209 (const char *)p_open_dialog->mrl[i].mb_str(), 210 PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), PLAYLIST_END ); 211 int i_pos = playlist_GetPositionById( p_playlist, i_id ); 212 int i_options = 0; 209 213 210 214 /* Count the input options */ … … 216 220 } 217 221 218 /* Allocate ppsz_options */222 /* Insert options */ 219 223 for( int j = 0; j < i_options; j++ ) 220 224 { 221 if( !ppsz_options ) 222 ppsz_options = (char **)malloc( sizeof(char *) * i_options ); 223 224 ppsz_options[j] = strdup( p_open_dialog->mrl[i + j + 1].mb_str() ); 225 playlist_AddOption( p_playlist, i_pos, 226 p_open_dialog->mrl[i + j + 1].mb_str() ); 225 227 } 226 227 i_total_options = i_options;228 228 229 229 /* Get the options from the stream output dialog */ 230 230 if( sout_mrl.GetCount() ) 231 231 { 232 ppsz_options = (char **)realloc( ppsz_options, sizeof(char *) *233 (i_total_options + sout_mrl.GetCount()) );234 235 232 for( int j = 0; j < (int)sout_mrl.GetCount(); j++ ) 236 233 { 237 p psz_options[i_total_options + j] =238 strdup(sout_mrl[j].mb_str() );234 playlist_AddOption( p_playlist, i_pos , 235 sout_mrl[j].mb_str() ); 239 236 } 240 241 i_total_options += sout_mrl.GetCount();242 243 237 } 244 msg_Dbg(p_intf,"playings %s",(const char *)p_open_dialog->mrl[i].mb_str()); 245 playlist_Add( p_playlist, (const char *)p_open_dialog->mrl[i].mb_str(), 246 (const char **)ppsz_options, i_total_options, 247 PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), PLAYLIST_END ); 248 /* clean up */ 249 for( int j = 0; j < i_total_options; j++ ) 250 free( ppsz_options[j] ); 251 if( ppsz_options ) free( ppsz_options ); 238 msg_Dbg(p_intf,"playings %s", 239 (const char *)p_open_dialog->mrl[i].mb_str()); 252 240 253 241 i += i_options; modules/gui/wxwindows/wxwindows.h
r973409a r1595dc2 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999, 2000 VideoLAN 5 * $Id: wxwindows.h,v 1.8 2 2003/12/22 14:31:01 gbazinExp $5 * $Id: wxwindows.h,v 1.83 2004/01/05 13:00:39 zorglub Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 750 750 void UpdatePlaylist(); 751 751 void ShowPlaylist( bool show ); 752 void UpdateItem( int ); 752 753 753 754 bool b_need_update; … … 756 757 private: 757 758 void DeleteItem( int item ); 759 void ShowInfos( int item ); 758 760 759 761 /* Event handlers (these functions should _not_ be virtual) */ … … 786 788 void OnNewGroup( wxCommandEvent& event ); 787 789 790 /* Popup functions */ 791 void OnPopup( wxListEvent& event ); 792 void OnPopupPlay( wxMenuEvent& event ); 793 void OnPopupDel( wxMenuEvent& event ); 794 void OnPopupEna( wxMenuEvent& event ); 795 void OnPopupInfo( wxMenuEvent& event ); 788 796 void Rebuild(); 789 797 … … 792 800 DECLARE_EVENT_TABLE(); 793 801 802 wxMenu *popup_menu; 794 803 795 804 ItemInfoDialog *iteminfo_dialog; … … 801 810 int i_sort_mode; 802 811 812 int i_popup_item; 813 803 814 int i_title_sorted; 804 815 int i_author_sorted; … … 852 863 void OnNewGroup( wxCommandEvent& event ); 853 864 865 void UpdateInfo(); 866 854 867 DECLARE_EVENT_TABLE(); 855 868 … … 868 881 wxTextCtrl *name_text; 869 882 wxTextCtrl *author_text; 883 884 wxTreeCtrl *info_tree; 885 wxTreeItemId info_root; 870 886 871 887 wxCheckBox *enabled_checkbox;
