Mercurial > hg > xmms-sid
comparison src/xs_config.c @ 177:6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
consistent operation while graying out unavailable settings.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 18 Aug 2004 03:27:00 +0000 |
parents | 505da1389e5c |
children | e036ad3350d6 |
comparison
equal
deleted
inserted
replaced
176:d109d928ccc3 | 177:6e350784aa57 |
---|---|
615 gtk_widget_set_sensitive(LUW("cfg_emu_mem_real"), isActive); | 615 gtk_widget_set_sensitive(LUW("cfg_emu_mem_real"), isActive); |
616 | 616 |
617 gtk_widget_set_sensitive(LUW("cfg_oversample_grp"), isActive); | 617 gtk_widget_set_sensitive(LUW("cfg_oversample_grp"), isActive); |
618 gtk_widget_set_sensitive(LUW("cfg_oversample"), isActive); | 618 gtk_widget_set_sensitive(LUW("cfg_oversample"), isActive); |
619 gtk_widget_set_sensitive(LUW("cfg_oversample_factor"), isActive); | 619 gtk_widget_set_sensitive(LUW("cfg_oversample_factor"), isActive); |
620 gtk_widget_set_sensitive(LUW("cfg_overfilter_average"), isActive); | |
621 gtk_widget_set_sensitive(LUW("cfg_overfilter_sinc"), isActive); | |
622 | 620 |
623 gtk_widget_set_sensitive(LUW("cfg_sidplay2_grp"), isActive); | 621 gtk_widget_set_sensitive(LUW("cfg_sidplay2_grp"), isActive); |
624 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_opt"), isActive); | 622 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_opt"), isActive); |
625 | 623 |
624 gtk_widget_set_sensitive(LUW("cfg_chn_autopan"), !isActive); | |
625 | |
626 #ifdef HAVE_RESID_BUILDER | 626 #ifdef HAVE_RESID_BUILDER |
627 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_resid"), isActive); | 627 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_resid"), isActive); |
628 #else | 628 #else |
629 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_resid"), FALSE); | 629 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_resid"), FALSE); |
630 #endif | 630 #endif |
640 void xs_cfg_emu_nanosid_toggled(GtkToggleButton *togglebutton, gpointer user_data) | 640 void xs_cfg_emu_nanosid_toggled(GtkToggleButton *togglebutton, gpointer user_data) |
641 { | 641 { |
642 } | 642 } |
643 | 643 |
644 | 644 |
645 void xs_cfg_oversample_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
646 { | |
647 gboolean isActive = GTK_TOGGLE_BUTTON(LUW("cfg_oversample"))->active; | |
648 | |
649 gtk_widget_set_sensitive(LUW("cfg_oversample_factor"), isActive); | |
650 gtk_widget_set_sensitive(LUW("cfg_oversample_label1"), isActive); | |
651 gtk_widget_set_sensitive(LUW("cfg_oversample_label2"), isActive); | |
652 } | |
653 | |
654 | |
655 void xs_cfg_mintime_enable_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
656 { | |
657 gboolean isActive = GTK_TOGGLE_BUTTON(LUW("cfg_mintime_enable"))->active; | |
658 | |
659 gtk_widget_set_sensitive(LUW("cfg_mintime"), isActive); | |
660 gtk_widget_set_sensitive(LUW("cfg_mintime_label1"), isActive); | |
661 gtk_widget_set_sensitive(LUW("cfg_mintime_label2"), isActive); | |
662 } | |
663 | |
664 | |
665 void xs_cfg_maxtime_enable_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
666 { | |
667 gboolean isActive = GTK_TOGGLE_BUTTON(LUW("cfg_maxtime_enable"))->active; | |
668 | |
669 gtk_widget_set_sensitive(LUW("cfg_maxtime_unknown"), isActive); | |
670 gtk_widget_set_sensitive(LUW("cfg_maxtime"), isActive); | |
671 gtk_widget_set_sensitive(LUW("cfg_maxtime_label1"), isActive); | |
672 gtk_widget_set_sensitive(LUW("cfg_maxtime_label2"), isActive); | |
673 } | |
674 | |
675 | |
676 void xs_cfg_sld_enable_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
677 { | |
678 gboolean isActive = GTK_TOGGLE_BUTTON(LUW("cfg_sld_enable"))->active; | |
679 | |
680 gtk_widget_set_sensitive(LUW("cfg_sld_dbpath"), isActive); | |
681 gtk_widget_set_sensitive(LUW("cfg_sld_dbbrowse"), isActive); | |
682 gtk_widget_set_sensitive(LUW("cfg_sld_label1"), isActive); | |
683 } | |
684 | |
685 | |
686 void xs_cfg_stil_enable_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
687 { | |
688 gboolean isActive = GTK_TOGGLE_BUTTON(LUW("cfg_stil_enable"))->active; | |
689 | |
690 gtk_widget_set_sensitive(LUW("cfg_stil_dbpath"), isActive); | |
691 gtk_widget_set_sensitive(LUW("cfg_stil_browse"), isActive); | |
692 gtk_widget_set_sensitive(LUW("cfg_stil_label1"), isActive); | |
693 | |
694 gtk_widget_set_sensitive(LUW("cfg_hvsc_path"), isActive); | |
695 gtk_widget_set_sensitive(LUW("cfg_hvsc_browse"), isActive); | |
696 gtk_widget_set_sensitive(LUW("cfg_hvsc_label1"), isActive); | |
697 } | |
698 | |
699 | |
645 | 700 |
646 void xs_cfg_mintime_changed(GtkEditable *editable, gpointer user_data) | 701 void xs_cfg_mintime_changed(GtkEditable *editable, gpointer user_data) |
647 { | 702 { |
648 gint tmpValue, maxValue; | 703 gint tmpValue; |
704 GtkAdjustment *tmpAdj; | |
649 | 705 |
650 if (tmpValue > maxValue) | 706 tmpAdj = gtk_spin_button_get_adjustment( |
651 | 707 GTK_SPIN_BUTTON(LUW("cfg_maxtime"))); |
652 gtk_adjustment_set_value( | 708 |
653 gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW("cfg_maxtime"))), | 709 tmpValue = gtk_spin_button_get_adjustment( |
654 tmpValue); | 710 GTK_SPIN_BUTTON(editable))->value; |
711 | |
712 if (tmpValue > tmpAdj->value) | |
713 gtk_adjustment_set_value(tmpAdj, tmpValue); | |
655 } | 714 } |
656 | 715 |
657 | 716 |
658 void xs_cfg_maxtime_changed(GtkEditable *editable, gpointer user_data) | 717 void xs_cfg_maxtime_changed(GtkEditable *editable, gpointer user_data) |
659 { | 718 { |
660 gint tmpValue, minValue; | 719 gint tmpValue; |
720 GtkAdjustment *tmpAdj; | |
661 | 721 |
722 tmpAdj = gtk_spin_button_get_adjustment( | |
723 GTK_SPIN_BUTTON(LUW("cfg_mintime"))); | |
662 | 724 |
663 gtk_adjustment_set_value( | 725 tmpValue = gtk_spin_button_get_adjustment( |
664 gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW("cfg_mintime"))), | 726 GTK_SPIN_BUTTON(editable))->value; |
665 tmpValue); | 727 |
728 if (tmpValue < tmpAdj->value) | |
729 gtk_adjustment_set_value(tmpAdj, tmpValue); | |
666 } | 730 } |
667 | 731 |
668 | 732 |
669 /* | 733 /* |
670 * Execute the configuration panel | 734 * Execute the configuration panel |
683 | 747 |
684 /* Create the window */ | 748 /* Create the window */ |
685 xs_configwin = create_xs_configwin(); | 749 xs_configwin = create_xs_configwin(); |
686 | 750 |
687 | 751 |
688 /* Based on selected emulation library, disable options */ | 752 /* Based on available optional parts, gray out options */ |
689 #ifndef HAVE_SIDPLAY1 | 753 #ifndef HAVE_SIDPLAY1 |
690 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay1"), FALSE); | 754 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay1"), FALSE); |
691 #endif | 755 #endif |
692 | 756 |
693 #ifndef HAVE_SIDPLAY2 | 757 #ifndef HAVE_SIDPLAY2 |
696 | 760 |
697 #ifndef HAVE_NANOSID | 761 #ifndef HAVE_NANOSID |
698 gtk_widget_set_sensitive(LUW("cfg_emu_nanosid"), FALSE); | 762 gtk_widget_set_sensitive(LUW("cfg_emu_nanosid"), FALSE); |
699 #endif | 763 #endif |
700 | 764 |
701 /* Other UI options */ | |
702 #ifndef HAVE_XMMSEXTRA | 765 #ifndef HAVE_XMMSEXTRA |
703 gtk_widget_set_sensitive(LUW("cfg_ftitle_override"), FALSE); | 766 gtk_widget_set_sensitive(LUW("cfg_ftitle_override"), FALSE); |
704 xs_cfg.titleOverride = TRUE; | 767 xs_cfg.titleOverride = TRUE; |
705 #endif | 768 #endif |
706 | 769 |
712 xs_cfg_emu_filters_toggled(NULL, NULL); | 775 xs_cfg_emu_filters_toggled(NULL, NULL); |
713 xs_cfg_ftitle_override_toggled(NULL, NULL); | 776 xs_cfg_ftitle_override_toggled(NULL, NULL); |
714 xs_cfg_emu_sidplay1_toggled(NULL, NULL); | 777 xs_cfg_emu_sidplay1_toggled(NULL, NULL); |
715 xs_cfg_emu_sidplay2_toggled(NULL, NULL); | 778 xs_cfg_emu_sidplay2_toggled(NULL, NULL); |
716 xs_cfg_emu_nanosid_toggled(NULL, NULL); | 779 xs_cfg_emu_nanosid_toggled(NULL, NULL); |
780 xs_cfg_oversample_toggled(NULL, NULL); | |
781 xs_cfg_mintime_enable_toggled(NULL, NULL); | |
782 xs_cfg_maxtime_enable_toggled(NULL, NULL); | |
783 xs_cfg_sld_enable_toggled(NULL, NULL); | |
784 xs_cfg_stil_enable_toggled(NULL, NULL); | |
717 | 785 |
718 | 786 |
719 /* Set current data to widgets */ | 787 /* Set current data to widgets */ |
720 for (i = 0; i < xs_widtable_max; i++) | 788 for (i = 0; i < xs_widtable_max; i++) |
721 { | 789 { |