Mercurial > mplayer.hg
comparison gui/dialog/fileselect.c @ 35974:3ccb13092e88
Cosmetic: Rename file selector type enums.
author | ib |
---|---|
date | Thu, 28 Mar 2013 16:23:39 +0000 |
parents | cb1b178d3670 |
children | 16f60d1a3b7f |
comparison
equal
deleted
inserted
replaced
35973:d1301d4ca6d8 | 35974:3ccb13092e88 |
---|---|
321 | 321 |
322 str=gtk_entry_get_text( GTK_ENTRY(user_data ) ); | 322 str=gtk_entry_get_text( GTK_ENTRY(user_data ) ); |
323 | 323 |
324 switch ( fsType ) | 324 switch ( fsType ) |
325 { | 325 { |
326 case fsVideoSelector: | 326 case FILESELECT_VIDEO_AUDIO: |
327 for( i=0;fsVideoFilterNames[i][0];i++ ) | 327 for( i=0;fsVideoFilterNames[i][0];i++ ) |
328 if( !strcmp( str,fsVideoFilterNames[i][0] ) ) | 328 if( !strcmp( str,fsVideoFilterNames[i][0] ) ) |
329 { fsFilter=fsVideoFilterNames[i][1]; fsLastVideoFilterSelected = i; break; } | 329 { fsFilter=fsVideoFilterNames[i][1]; fsLastVideoFilterSelected = i; break; } |
330 break; | 330 break; |
331 case fsSubtitleSelector: | 331 case FILESELECT_SUBTITLE: |
332 for( i=0;fsSubtitleFilterNames[i][0];i++ ) | 332 for( i=0;fsSubtitleFilterNames[i][0];i++ ) |
333 if( !strcmp( str,fsSubtitleFilterNames[i][0] ) ) | 333 if( !strcmp( str,fsSubtitleFilterNames[i][0] ) ) |
334 { fsFilter=fsSubtitleFilterNames[i][1]; fsLastSubtitleFilterSelected = i; break; } | 334 { fsFilter=fsSubtitleFilterNames[i][1]; fsLastSubtitleFilterSelected = i; break; } |
335 break; | 335 break; |
336 /* case fsOtherSelector: | 336 /* case fsOtherSelector: |
337 for( i=0;fsOtherFilterNames[i][0];i++ ) | 337 for( i=0;fsOtherFilterNames[i][0];i++ ) |
338 if( !strcmp( str,fsOtherFilterNames[i][0] ) ) | 338 if( !strcmp( str,fsOtherFilterNames[i][0] ) ) |
339 { fsFilter=fsOtherFilterNames[i][1]; break; } | 339 { fsFilter=fsOtherFilterNames[i][1]; break; } |
340 break;*/ | 340 break;*/ |
341 case fsAudioSelector: | 341 case FILESELECT_AUDIO: |
342 for( i=0;fsAudioFileNames[i][0];i++ ) | 342 for( i=0;fsAudioFileNames[i][0];i++ ) |
343 if( !strcmp( str,fsAudioFileNames[i][0] ) ) | 343 if( !strcmp( str,fsAudioFileNames[i][0] ) ) |
344 { fsFilter=fsAudioFileNames[i][1]; fsLastAudioFilterSelected = i; break; } | 344 { fsFilter=fsAudioFileNames[i][1]; fsLastAudioFilterSelected = i; break; } |
345 break; | 345 break; |
346 case fsFontSelector: | 346 case FILESELECT_FONT: |
347 for( i=0;fsFontFileNames[i][0];i++ ) | 347 for( i=0;fsFontFileNames[i][0];i++ ) |
348 if( !strcmp( str,fsFontFileNames[i][0] ) ) | 348 if( !strcmp( str,fsFontFileNames[i][0] ) ) |
349 { fsFilter=fsFontFileNames[i][1]; fsLastFontFilterSelected = i; break; } | 349 { fsFilter=fsFontFileNames[i][1]; fsLastFontFilterSelected = i; break; } |
350 break; | 350 break; |
351 default: return; | 351 default: return; |
409 } | 409 } |
410 | 410 |
411 fsSelectedDirectory=get_current_dir_name(); | 411 fsSelectedDirectory=get_current_dir_name(); |
412 switch ( fsType ) | 412 switch ( fsType ) |
413 { | 413 { |
414 case fsVideoSelector: | 414 case FILESELECT_VIDEO_AUDIO: |
415 for (l = 0; fsVideoFilterNames[l][0]; l++) | 415 for (l = 0; fsVideoFilterNames[l][0]; l++) |
416 if (strcmp(fsVideoFilterNames[l][0], MSGTR_Filter_Playlists) == 0) break; | 416 if (strcmp(fsVideoFilterNames[l][0], MSGTR_Filter_Playlists) == 0) break; |
417 uiSetFile( fsSelectedDirectory,fsSelectedFile, fsLastVideoFilterSelected == l ? STREAMTYPE_PLAYLIST : STREAMTYPE_FILE ); | 417 uiSetFile( fsSelectedDirectory,fsSelectedFile, fsLastVideoFilterSelected == l ? STREAMTYPE_PLAYLIST : STREAMTYPE_FILE ); |
418 selected = g_strconcat(fsSelectedDirectory, "/", fsSelectedFile, NULL); | 418 selected = g_strconcat(fsSelectedDirectory, "/", fsSelectedFile, NULL); |
419 if (selected) | 419 if (selected) |
423 g_free(selected); | 423 g_free(selected); |
424 } | 424 } |
425 guiInfo.NewPlay=GUI_FILE_NEW; sub_fps=0; | 425 guiInfo.NewPlay=GUI_FILE_NEW; sub_fps=0; |
426 fs_PersistantHistory( fsSelectedDirectory ); | 426 fs_PersistantHistory( fsSelectedDirectory ); |
427 break; | 427 break; |
428 case fsSubtitleSelector: | 428 case FILESELECT_SUBTITLE: |
429 setddup( &guiInfo.SubtitleFilename,fsSelectedDirectory,fsSelectedFile ); | 429 setddup( &guiInfo.SubtitleFilename,fsSelectedDirectory,fsSelectedFile ); |
430 mplayerLoadSubtitle( guiInfo.SubtitleFilename ); | 430 mplayerLoadSubtitle( guiInfo.SubtitleFilename ); |
431 break; | 431 break; |
432 /* case fsOtherSelector: | 432 /* case fsOtherSelector: |
433 setddup( &guiInfo.Othername,fsSelectedDirectory,fsSelectedFile ); | 433 setddup( &guiInfo.Othername,fsSelectedDirectory,fsSelectedFile ); |
434 break;*/ | 434 break;*/ |
435 case fsAudioSelector: | 435 case FILESELECT_AUDIO: |
436 setddup( &guiInfo.AudioFilename,fsSelectedDirectory,fsSelectedFile ); | 436 setddup( &guiInfo.AudioFilename,fsSelectedDirectory,fsSelectedFile ); |
437 break; | 437 break; |
438 case fsFontSelector: | 438 case FILESELECT_FONT: |
439 setddup( &font_name,fsSelectedDirectory,fsSelectedFile ); | 439 setddup( &font_name,fsSelectedDirectory,fsSelectedFile ); |
440 mplayerLoadFont(); | 440 mplayerLoadFont(); |
441 if ( Preferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name ); | 441 if ( Preferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name ); |
442 break; | 442 break; |
443 } | 443 } |
663 else fsFileSelect=create_FileSelect(); | 663 else fsFileSelect=create_FileSelect(); |
664 | 664 |
665 fsType=type; | 665 fsType=type; |
666 switch ( type ) | 666 switch ( type ) |
667 { | 667 { |
668 case fsVideoSelector: | 668 case FILESELECT_VIDEO_AUDIO: |
669 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect ); | 669 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect ); |
670 fsList_items=NULL; | 670 fsList_items=NULL; |
671 for( i=0;fsVideoFilterNames[i][0];i++ ) | 671 for( i=0;fsVideoFilterNames[i][0];i++ ) |
672 fsList_items=g_list_append( fsList_items,fsVideoFilterNames[i][0] ); | 672 fsList_items=g_list_append( fsList_items,fsVideoFilterNames[i][0] ); |
673 k = fsLastVideoFilterSelected; | 673 k = fsLastVideoFilterSelected; |
674 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items ); | 674 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items ); |
675 g_list_free( fsList_items ); | 675 g_list_free( fsList_items ); |
676 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsVideoFilterNames[k >= 0 ? k : i-2][0] ); | 676 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsVideoFilterNames[k >= 0 ? k : i-2][0] ); |
677 //tmp=guiInfo.Filename; | 677 //tmp=guiInfo.Filename; |
678 break; | 678 break; |
679 case fsSubtitleSelector: | 679 case FILESELECT_SUBTITLE: |
680 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_SubtitleSelect ); | 680 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_SubtitleSelect ); |
681 fsList_items=NULL; | 681 fsList_items=NULL; |
682 for( i=0;fsSubtitleFilterNames[i][0];i++ ) | 682 for( i=0;fsSubtitleFilterNames[i][0];i++ ) |
683 fsList_items=g_list_append( fsList_items,fsSubtitleFilterNames[i][0] ); | 683 fsList_items=g_list_append( fsList_items,fsSubtitleFilterNames[i][0] ); |
684 k = fsLastSubtitleFilterSelected; | 684 k = fsLastSubtitleFilterSelected; |
695 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items ); | 695 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items ); |
696 g_list_free( fsList_items ); | 696 g_list_free( fsList_items ); |
697 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsOtherFilterNames[0][0] ); | 697 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsOtherFilterNames[0][0] ); |
698 tmp=guiInfo.Othername; | 698 tmp=guiInfo.Othername; |
699 break;*/ | 699 break;*/ |
700 case fsAudioSelector: | 700 case FILESELECT_AUDIO: |
701 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_AudioFileSelect ); | 701 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_AudioFileSelect ); |
702 fsList_items=NULL; | 702 fsList_items=NULL; |
703 for( i=0;fsAudioFileNames[i][0];i++ ) | 703 for( i=0;fsAudioFileNames[i][0];i++ ) |
704 fsList_items=g_list_append( fsList_items,fsAudioFileNames[i][0] ); | 704 fsList_items=g_list_append( fsList_items,fsAudioFileNames[i][0] ); |
705 k = fsLastAudioFilterSelected; | 705 k = fsLastAudioFilterSelected; |
706 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items ); | 706 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items ); |
707 g_list_free( fsList_items ); | 707 g_list_free( fsList_items ); |
708 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsAudioFileNames[k >= 0 ? k : i-2][0] ); | 708 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsAudioFileNames[k >= 0 ? k : i-2][0] ); |
709 tmp=guiInfo.AudioFilename; | 709 tmp=guiInfo.AudioFilename; |
710 break; | 710 break; |
711 case fsFontSelector: | 711 case FILESELECT_FONT: |
712 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FontSelect ); | 712 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FontSelect ); |
713 fsList_items=NULL; | 713 fsList_items=NULL; |
714 for( i=0;fsFontFileNames[i][0];i++ ) | 714 for( i=0;fsFontFileNames[i][0];i++ ) |
715 fsList_items=g_list_append( fsList_items,fsFontFileNames[i][0] ); | 715 fsList_items=g_list_append( fsList_items,fsFontFileNames[i][0] ); |
716 k = fsLastFontFilterSelected; | 716 k = fsLastFontFilterSelected; |
719 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsFontFileNames[k >= 0 ? k : i-2][0] ); | 719 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsFontFileNames[k >= 0 ? k : i-2][0] ); |
720 tmp=font_name; | 720 tmp=font_name; |
721 break; | 721 break; |
722 } | 722 } |
723 | 723 |
724 fsMedium=(fsType == fsVideoSelector || fsType == fsSubtitleSelector || fsType == fsAudioSelector); | 724 fsMedium=(fsType == FILESELECT_VIDEO_AUDIO || fsType == FILESELECT_SUBTITLE || fsType == FILESELECT_AUDIO); |
725 | 725 |
726 if ( tmp && tmp[0] && !strstr( tmp,"://" ) ) | 726 if ( tmp && tmp[0] && !strstr( tmp,"://" ) ) |
727 { | 727 { |
728 dir = strdup( tmp ); | 728 dir = strdup( tmp ); |
729 | 729 |