Mercurial > mplayer.hg
comparison Gui/mplayer/gtk/opts.c @ 7186:02b1976e12e2
fix vfm and add afm support
author | pontscho |
---|---|
date | Sat, 31 Aug 2002 09:45:59 +0000 |
parents | dd1e21e775b6 |
children | 3b44192516e4 |
comparison
equal
deleted
inserted
replaced
7185:3d40a2bbd73b | 7186:02b1976e12e2 |
---|---|
10 #include "../../../config.h" | 10 #include "../../../config.h" |
11 #include "../../../help_mp.h" | 11 #include "../../../help_mp.h" |
12 #include "../../../mixer.h" | 12 #include "../../../mixer.h" |
13 #include "../../../libao2/audio_out.h" | 13 #include "../../../libao2/audio_out.h" |
14 #include "../../../libvo/video_out.h" | 14 #include "../../../libvo/video_out.h" |
15 | |
15 #include "../../cfg.h" | 16 #include "../../cfg.h" |
16 #include "../../interface.h" | 17 #include "../../interface.h" |
17 #include "../widgets.h" | 18 #include "../widgets.h" |
18 #include "opts.h" | 19 #include "opts.h" |
19 #include "fs.h" | 20 #include "fs.h" |
21 | |
22 typedef struct sh_video_t sh_video_t; | |
23 typedef struct mp_image_t mp_image_t; | |
24 typedef struct sh_audio_t sh_audio_t; | |
25 | |
26 #include "../../../libmpcodecs/vd.h" | |
27 #include "../../../libmpcodecs/ad.h" | |
20 | 28 |
21 GtkWidget * Preferences; | 29 GtkWidget * Preferences; |
22 static GtkWidget * AConfig; | 30 static GtkWidget * AConfig; |
23 static GtkWidget * VConfig; | 31 static GtkWidget * VConfig; |
24 //static GtkWidget * BLoadSubtitle; | 32 //static GtkWidget * BLoadSubtitle; |
30 static GtkWidget * CLVDrivers; | 38 static GtkWidget * CLVDrivers; |
31 | 39 |
32 //static GtkWidget * ESubtitleName; | 40 //static GtkWidget * ESubtitleName; |
33 GtkWidget * prEFontName; | 41 GtkWidget * prEFontName; |
34 static GtkWidget * EVFM; | 42 static GtkWidget * EVFM; |
43 static GtkWidget * EAFM; | |
35 | 44 |
36 static GtkWidget * CBVFM; | 45 static GtkWidget * CBVFM; |
46 static GtkWidget * CBAFM; | |
37 static GtkWidget * CBAudioEqualizer; | 47 static GtkWidget * CBAudioEqualizer; |
38 //static GtkWidget * CBSurround; | 48 //static GtkWidget * CBSurround; |
39 static GtkWidget * CBExtraStereo; | 49 static GtkWidget * CBExtraStereo; |
40 static GtkWidget * CBNoSound; | 50 static GtkWidget * CBNoSound; |
41 static GtkWidget * CBNormalize; | 51 static GtkWidget * CBNormalize; |
76 static GtkAdjustment * HSFontBluradj, * HSFontOutLineadj, * HSFontTextScaleadj, * HSFontOSDScaleadj; | 86 static GtkAdjustment * HSFontBluradj, * HSFontOutLineadj, * HSFontTextScaleadj, * HSFontOSDScaleadj; |
77 static GtkWidget * CBFontEncoding, * EFontEncoding; | 87 static GtkWidget * CBFontEncoding, * EFontEncoding; |
78 static GtkWidget * RBFontNoAutoScale, * BRFontAutoScaleWidth, * RBFontAutoScaleHeight, * RBFontAutoScaleDiagonal; | 88 static GtkWidget * RBFontNoAutoScale, * BRFontAutoScaleWidth, * RBFontAutoScaleHeight, * RBFontAutoScaleDiagonal; |
79 //static GtkWidget * AutoScale; | 89 //static GtkWidget * AutoScale; |
80 #endif | 90 #endif |
81 | |
82 static struct | |
83 { | |
84 int vfm; | |
85 char * name; | |
86 } lVFM[] = | |
87 { | |
88 { -1,MSGTR_PREFERENCES_None }, | |
89 { 2,MSGTR_PREFERENCES_Codec1 }, | |
90 { 3,MSGTR_PREFERENCES_Codec2 }, | |
91 { 4,MSGTR_PREFERENCES_Codec3 }, | |
92 { 5,MSGTR_PREFERENCES_Codec4 }, | |
93 { 7,MSGTR_PREFERENCES_Codec5 }, | |
94 { 10,MSGTR_PREFERENCES_Codec6 }, | |
95 { 0,NULL } | |
96 }; | |
97 | 91 |
98 #ifdef HAVE_FREETYPE | 92 #ifdef HAVE_FREETYPE |
99 static struct | 93 static struct |
100 { | 94 { |
101 char * name; | 95 char * name; |
264 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ),force_ni ); | 258 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ),force_ni ); |
265 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBIndex ),index_mode ); | 259 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBIndex ),index_mode ); |
266 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPostprocess ),gtkVopPP ); | 260 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPostprocess ),gtkVopPP ); |
267 gtk_adjustment_set_value( HSPPQualityadj,auto_quality ); | 261 gtk_adjustment_set_value( HSPPQualityadj,auto_quality ); |
268 { | 262 { |
269 int i = 0; | 263 int i; |
270 for ( i=0;i<7;i++ ) | 264 GList * Items = NULL; |
271 if ( lVFM[i].vfm == video_family ) break; | 265 char * name = NULL; |
272 gtk_entry_set_text( GTK_ENTRY( EVFM ),lVFM[i].name ); | 266 |
267 for( i=0;mpcodecs_vd_drivers[i];i++ ) | |
268 { | |
269 Items=g_list_append( Items,(char *)mpcodecs_vd_drivers[i]->info->name ); | |
270 if ( !gstrcmp( video_fm,(char *)mpcodecs_vd_drivers[i]->info->short_name ) ) name=(char *)mpcodecs_vd_drivers[i]->info->name; | |
271 } | |
272 gtk_combo_set_popdown_strings( GTK_COMBO( CBVFM ),Items ); | |
273 g_list_free( Items ); | |
274 if ( name ) gtk_entry_set_text( GTK_ENTRY( EVFM ),name ); | |
275 } | |
276 { | |
277 int i; | |
278 GList * Items = NULL; | |
279 char * name = NULL; | |
280 | |
281 for( i=0;mpcodecs_ad_drivers[i];i++ ) | |
282 { | |
283 Items=g_list_append( Items,(char *)mpcodecs_ad_drivers[i]->info->name ); | |
284 if ( !gstrcmp( audio_fm,(char *)mpcodecs_ad_drivers[i]->info->short_name ) ) name=(char *)mpcodecs_ad_drivers[i]->info->name; | |
285 } | |
286 gtk_combo_set_popdown_strings( GTK_COMBO( CBAFM ),Items ); | |
287 g_list_free( Items ); | |
288 if ( name ) gtk_entry_set_text( GTK_ENTRY( EAFM ),name ); | |
273 } | 289 } |
274 | 290 |
275 // -- disables | 291 // -- disables |
276 #ifndef USE_SUB | 292 #ifndef USE_SUB |
277 gtk_widget_set_sensitive( AConfig,FALSE ); | 293 gtk_widget_set_sensitive( AConfig,FALSE ); |
431 gtkVopPP=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPostprocess ) ); | 447 gtkVopPP=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPostprocess ) ); |
432 gtkSet( gtkSetAutoq,HSPPQualityadj->value,NULL ); | 448 gtkSet( gtkSetAutoq,HSPPQualityadj->value,NULL ); |
433 { | 449 { |
434 int i; | 450 int i; |
435 char * tmp = gtk_entry_get_text( GTK_ENTRY( EVFM ) ); | 451 char * tmp = gtk_entry_get_text( GTK_ENTRY( EVFM ) ); |
436 video_family=-1; | 452 gfree( (void **)&video_fm ); |
437 for ( i=0;i<7;i++ ) | 453 for( i=0;mpcodecs_vd_drivers[i];i++ ) |
438 if ( !strcmp( tmp,lVFM[i].name ) ) { video_family=lVFM[i].vfm; break; } | 454 if ( !gstrcmp( tmp,(char *)mpcodecs_vd_drivers[i]->info->name ) ) { video_fm=gstrdup( (char *)mpcodecs_vd_drivers[i]->info->short_name ); break; } |
455 } | |
456 { | |
457 int i; | |
458 char * tmp = gtk_entry_get_text( GTK_ENTRY( EAFM ) ); | |
459 gfree( (void **)&audio_fm ); | |
460 for( i=0;mpcodecs_ad_drivers[i];i++ ) | |
461 if ( !gstrcmp( tmp,(char *)mpcodecs_ad_drivers[i]->info->name ) ) { audio_fm=gstrdup( (char *)mpcodecs_ad_drivers[i]->info->short_name ); break; } | |
439 } | 462 } |
440 | 463 |
441 case bCancel: | 464 case bCancel: |
442 HidePreferences(); | 465 HidePreferences(); |
443 break; | 466 break; |
585 GtkWidget * vbox6; | 608 GtkWidget * vbox6; |
586 GtkWidget * frame5; | 609 GtkWidget * frame5; |
587 GtkWidget * vbox600; | 610 GtkWidget * vbox600; |
588 GSList * OSD_group = NULL; | 611 GSList * OSD_group = NULL; |
589 GSList * Font_group = NULL; | 612 GSList * Font_group = NULL; |
590 GList * CBVFM_items = NULL; | |
591 GList * CBFontEncoding_items = NULL; | 613 GList * CBFontEncoding_items = NULL; |
592 GtkWidget * frame6; | 614 GtkWidget * frame6; |
593 GtkWidget * vbox7; | 615 GtkWidget * vbox7; |
594 GtkWidget * vbox8; | 616 GtkWidget * vbox8; |
595 GtkWidget * table1; | 617 GtkWidget * table1; |
1647 CBVFM=gtk_combo_new(); | 1669 CBVFM=gtk_combo_new(); |
1648 gtk_widget_set_name( CBVFM,"CBVFM" ); | 1670 gtk_widget_set_name( CBVFM,"CBVFM" ); |
1649 gtk_widget_ref( CBVFM ); | 1671 gtk_widget_ref( CBVFM ); |
1650 gtk_widget_show( CBVFM ); | 1672 gtk_widget_show( CBVFM ); |
1651 gtk_box_pack_start( GTK_BOX( hbox5 ),CBVFM,TRUE,TRUE,0 ); | 1673 gtk_box_pack_start( GTK_BOX( hbox5 ),CBVFM,TRUE,TRUE,0 ); |
1652 { | |
1653 int i; | |
1654 for ( i=0;lVFM[i].name;i++ ) CBVFM_items=g_list_append( CBVFM_items,lVFM[i].name ); | |
1655 } | |
1656 gtk_combo_set_popdown_strings( GTK_COMBO( CBVFM ),CBVFM_items ); | |
1657 g_list_free( CBVFM_items ); | |
1658 | 1674 |
1659 EVFM=GTK_COMBO( CBVFM )->entry; | 1675 EVFM=GTK_COMBO( CBVFM )->entry; |
1660 gtk_widget_set_name( EVFM,"CEVFM" ); | 1676 gtk_widget_set_name( EVFM,"CEVFM" ); |
1661 gtk_entry_set_editable( GTK_ENTRY( EVFM ),FALSE ); | 1677 gtk_entry_set_editable( GTK_ENTRY( EVFM ),FALSE ); |
1662 gtk_widget_ref( EVFM ); | 1678 gtk_widget_ref( EVFM ); |
1663 gtk_object_set_data_full( GTK_OBJECT( Preferences ),"EVFM",EVFM,(GtkDestroyNotify)gtk_widget_unref ); | 1679 gtk_object_set_data_full( GTK_OBJECT( Preferences ),"EVFM",EVFM,(GtkDestroyNotify)gtk_widget_unref ); |
1664 gtk_widget_show( EVFM ); | 1680 gtk_widget_show( EVFM ); |
1681 | |
1682 hbox5=gtk_hbox_new( FALSE,0 ); | |
1683 gtk_widget_set_name( hbox5,"hbox5" ); | |
1684 gtk_widget_ref( hbox5 ); | |
1685 gtk_object_set_data_full( GTK_OBJECT( Preferences ),"hbox5",hbox5,(GtkDestroyNotify)gtk_widget_unref ); | |
1686 gtk_widget_show( hbox5 ); | |
1687 gtk_box_pack_start( GTK_BOX( vbox602 ),hbox5,FALSE,FALSE,0 ); | |
1688 | |
1689 label16=gtk_label_new( MSGTR_PREFERENCES_AudioCodecFamily ); | |
1690 gtk_widget_set_name( label16,"label16" ); | |
1691 gtk_widget_ref( label16 ); | |
1692 gtk_object_set_data_full( GTK_OBJECT( Preferences ),"label16",label16,(GtkDestroyNotify)gtk_widget_unref ); | |
1693 gtk_widget_show( label16 ); | |
1694 gtk_box_pack_start( GTK_BOX( hbox5 ),label16,FALSE,FALSE,0 ); | |
1695 gtk_misc_set_alignment( GTK_MISC( label16 ),7.45058e-09,0.5 ); | |
1696 gtk_misc_set_padding( GTK_MISC( label16 ),4,0 ); | |
1697 | |
1698 CBAFM=gtk_combo_new(); | |
1699 gtk_widget_set_name( CBAFM,"CBAFM" ); | |
1700 gtk_widget_ref( CBAFM ); | |
1701 gtk_widget_show( CBAFM ); | |
1702 gtk_box_pack_start( GTK_BOX( hbox5 ),CBAFM,TRUE,TRUE,0 ); | |
1703 | |
1704 EAFM=GTK_COMBO( CBAFM )->entry; | |
1705 gtk_widget_set_name( EAFM,"EAFM" ); | |
1706 gtk_entry_set_editable( GTK_ENTRY( EAFM ),FALSE ); | |
1707 gtk_widget_ref( EAFM ); | |
1708 gtk_object_set_data_full( GTK_OBJECT( Preferences ),"EAFM",EAFM,(GtkDestroyNotify)gtk_widget_unref ); | |
1709 gtk_widget_show( EAFM ); | |
1665 | 1710 |
1666 label4=gtk_label_new( "Misc" ); | 1711 label4=gtk_label_new( "Misc" ); |
1667 gtk_widget_set_name( label4,"label4" ); | 1712 gtk_widget_set_name( label4,"label4" ); |
1668 gtk_widget_ref( label4 ); | 1713 gtk_widget_ref( label4 ); |
1669 gtk_object_set_data_full( GTK_OBJECT( Preferences ),"label4",label4,(GtkDestroyNotify)gtk_widget_unref ); | 1714 gtk_object_set_data_full( GTK_OBJECT( Preferences ),"label4",label4,(GtkDestroyNotify)gtk_widget_unref ); |
1751 gtk_signal_connect( GTK_OBJECT( HSSubFPS ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSSubFPS_motion_notify_event ),NULL ); | 1796 gtk_signal_connect( GTK_OBJECT( HSSubFPS ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSSubFPS_motion_notify_event ),NULL ); |
1752 gtk_signal_connect( GTK_OBJECT( HSFontFactor ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSFontFactor_motion_notify_event ),NULL ); | 1797 gtk_signal_connect( GTK_OBJECT( HSFontFactor ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSFontFactor_motion_notify_event ),NULL ); |
1753 gtk_signal_connect( GTK_OBJECT( HSPPQuality ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSPPQuality_motion_notify_event ),NULL ); | 1798 gtk_signal_connect( GTK_OBJECT( HSPPQuality ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSPPQuality_motion_notify_event ),NULL ); |
1754 #endif | 1799 #endif |
1755 | 1800 |
1756 gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ),2 ); | 1801 gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ),3 ); |
1757 | 1802 |
1758 gtk_window_add_accel_group( GTK_WINDOW( Preferences ),accel_group ); | 1803 gtk_window_add_accel_group( GTK_WINDOW( Preferences ),accel_group ); |
1759 | 1804 |
1760 return Preferences; | 1805 return Preferences; |
1761 } | 1806 } |