Mercurial > audlegacy-plugins
changeset 2796:2ce16807a088
Automated merge with ssh://hg.atheme-project.org//hg//audacious-plugins
author | Calin Crisan ccrisan@gmail.com |
---|---|
date | Thu, 10 Jul 2008 01:41:27 +0300 |
parents | 4c9db0b2194f (current diff) f3e242d1855b (diff) |
children | 11fb1503ee4b |
files | |
diffstat | 8 files changed, 52 insertions(+), 114 deletions(-) [+] |
line wrap: on
line diff
--- a/src/skins/plugin.c Thu Jul 10 01:40:57 2008 +0300 +++ b/src/skins/plugin.c Thu Jul 10 01:41:27 2008 +0300 @@ -36,7 +36,8 @@ .id = "skinned", .desc = "Audacious Skinned GUI", .init = skins_init, - .fini = skins_cleanup + .fini = skins_cleanup, + .conf = skins_configure }; SIMPLE_INTERFACE_PLUGIN("skinned", &skins_gp); @@ -85,6 +86,8 @@ init_skins(config.skin); mainwin_setup_menus(); + aud_hook_call("create prefswin", NULL); + if (config.player_visible) mainwin_real_show(); if (config.equalizer_visible) equalizerwin_show(TRUE); if (config.playlist_visible) playlistwin_show();
--- a/src/skins/skins_cfg.c Thu Jul 10 01:40:57 2008 +0300 +++ b/src/skins/skins_cfg.c Thu Jul 10 01:41:27 2008 +0300 @@ -547,7 +547,7 @@ } } -void skins_configure(void) { +GtkWidget* skins_configure(void) { GtkWidget *appearance_page_vbox; GtkWidget *vbox37; GtkWidget *vbox38; @@ -561,21 +561,7 @@ GtkWidget *alignment95; GtkWidget *skin_view_scrolled_window; - if (cfg_win != NULL) { - gtk_window_present(GTK_WINDOW(cfg_win)); - return; - } - - cfg_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_type_hint(GTK_WINDOW(cfg_win), GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_title(GTK_WINDOW(cfg_win), _("Audacious Skinned GUI Configuration")); - gtk_container_set_border_width(GTK_CONTAINER(cfg_win), 10); - g_signal_connect(G_OBJECT(cfg_win), "destroy" , - G_CALLBACK(gtk_widget_destroyed), &cfg_win); - gtk_widget_set_size_request(cfg_win, 500, -1); - appearance_page_vbox = gtk_vbox_new (FALSE, 0); - gtk_container_add(GTK_CONTAINER(cfg_win), appearance_page_vbox); vbox37 = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (appearance_page_vbox), vbox37, TRUE, TRUE, 0); @@ -658,5 +644,5 @@ gtk_window_present(GTK_WINDOW(cfg_win)); - return; + return appearance_page_vbox; }
--- a/src/skins/skins_cfg.h Thu Jul 10 01:40:57 2008 +0300 +++ b/src/skins/skins_cfg.h Thu Jul 10 01:41:27 2008 +0300 @@ -22,6 +22,7 @@ #define SKINS_CFG_H #include <glib.h> +#include <gtk/gtk.h> #define MAINWIN_DEFAULT_POS_X 20 #define MAINWIN_DEFAULT_POS_Y 20 @@ -86,6 +87,6 @@ void skins_cfg_load(); void skins_cfg_save(); -void skins_configure(void); +GtkWidget* skins_configure(void); #endif
--- a/src/skins/ui_equalizer.c Thu Jul 10 01:40:57 2008 +0300 +++ b/src/skins/ui_equalizer.c Thu Jul 10 01:41:27 2008 +0300 @@ -165,9 +165,9 @@ { gint i; - aud_cfg->equalizer_preamp = ui_skinned_equalizer_slider_get_position(equalizerwin_preamp); - for (i = 0; i < 10; i++) - aud_cfg->equalizer_bands[i] = ui_skinned_equalizer_slider_get_position(equalizerwin_bands[i]); + aud_cfg->equalizer_preamp = equalizerwin_get_preamp(); + for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) + aud_cfg->equalizer_bands[i] = equalizerwin_get_band(i); aud_hook_call("equalizer changed", NULL); gtk_widget_queue_draw(equalizerwin_graph); @@ -176,20 +176,20 @@ static void equalizerwin_apply_preset(EqualizerPreset *preset) { + if (preset == NULL) + return; + gint i; - ui_skinned_equalizer_slider_set_position(equalizerwin_preamp, preset->preamp); - for (i = 0; i < 10; i++) { - ui_skinned_equalizer_slider_set_position(equalizerwin_bands[i], preset->bands[i]); - } - equalizerwin_eq_changed(); + equalizerwin_set_preamp(preset->preamp); + for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) + equalizerwin_set_band(i, preset->bands[i]); } static void equalizerwin_on_pushed(void) { - aud_cfg->equalizer_active = UI_SKINNED_BUTTON(equalizerwin_on)->inside; - equalizerwin_eq_changed(); + equalizerwin_activate(!aud_cfg->equalizer_active); } static void @@ -371,7 +371,7 @@ ui_skinned_toggle_button_setup(equalizerwin_on, SKINNED_WINDOW(equalizerwin)->normal, 14, 18, 25, 12, 10, 119, 128, 119, 69, 119, 187, 119, SKIN_EQMAIN); g_signal_connect(equalizerwin_on, "clicked", equalizerwin_on_pushed, NULL); - ui_skinned_button_set_inside(equalizerwin_on, aud_cfg->equalizer_active); + equalizerwin_activate(aud_cfg->equalizer_active); equalizerwin_auto = ui_skinned_button_new(); ui_skinned_toggle_button_setup(equalizerwin_auto, SKINNED_WINDOW(equalizerwin)->normal, @@ -408,12 +408,12 @@ equalizerwin_graph = ui_skinned_equalizer_graph_new(SKINNED_WINDOW(equalizerwin)->normal, 86, 17); equalizerwin_preamp = ui_skinned_equalizer_slider_new(SKINNED_WINDOW(equalizerwin)->normal, 21, 38); - ui_skinned_equalizer_slider_set_position(equalizerwin_preamp, aud_cfg->equalizer_preamp); + equalizerwin_set_preamp(aud_cfg->equalizer_preamp); - for (i = 0; i < 10; i++) { + for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) { equalizerwin_bands[i] = ui_skinned_equalizer_slider_new(SKINNED_WINDOW(equalizerwin)->normal, 78 + (i * 18), 38); - ui_skinned_equalizer_slider_set_position(equalizerwin_bands[i], aud_cfg->equalizer_bands[i]); + equalizerwin_set_band(i, aud_cfg->equalizer_bands[i]); } equalizerwin_volume = @@ -556,10 +556,10 @@ gint i; if ((preset = equalizerwin_find_preset(list, name)) != NULL) { - ui_skinned_equalizer_slider_set_position(equalizerwin_preamp, preset->preamp); - for (i = 0; i < 10; i++) - ui_skinned_equalizer_slider_set_position(equalizerwin_bands[i], preset->bands[i]); - equalizerwin_eq_changed(); + equalizerwin_set_preamp(preset->preamp); + for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) + equalizerwin_set_band(i, preset->bands[i]); + return TRUE; } return FALSE; @@ -578,9 +578,9 @@ list = g_list_append(list, preset); } - preset->preamp = ui_skinned_equalizer_slider_get_position(equalizerwin_preamp); - for (i = 0; i < 10; i++) - preset->bands[i] = ui_skinned_equalizer_slider_get_position(equalizerwin_bands[i]); + preset->preamp = equalizerwin_get_preamp(); + for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) + preset->bands[i] = equalizerwin_get_band(i); aud_equalizer_write_preset_file(list, filename); @@ -669,12 +669,10 @@ /* just get the first preset --asphyx */ EqualizerPreset *preset = (EqualizerPreset*)presets->data; - ui_skinned_equalizer_slider_set_position(equalizerwin_preamp, - preset->preamp); + equalizerwin_set_preamp(preset->preamp); - for (i = 0; i < 10; i++) - ui_skinned_equalizer_slider_set_position(equalizerwin_bands[i], - preset->bands[i]); + for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) + equalizerwin_set_band(i, preset->bands[i]); g_list_foreach(presets, free_cb, NULL); g_list_free(presets); @@ -901,11 +899,12 @@ g_strlcpy(name, "Entry1", 257); aud_vfs_fwrite(name, 1, 257, file); - for (i = 0; i < 10; i++) - bands[i] = 63 - (((ui_skinned_equalizer_slider_get_position(equalizerwin_bands[i]) + EQUALIZER_MAX_GAIN) * 63) / EQUALIZER_MAX_GAIN / 2); - bands[10] = 63 - (((ui_skinned_equalizer_slider_get_position(equalizerwin_preamp) + EQUALIZER_MAX_GAIN) * 63) / EQUALIZER_MAX_GAIN / 2); + for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) + bands[i] = 63 - (((equalizerwin_get_band(i) + EQUALIZER_MAX_GAIN) * 63) / EQUALIZER_MAX_GAIN / 2); + + bands[AUD_EQUALIZER_NBANDS] = 63 - (((equalizerwin_get_preamp() + EQUALIZER_MAX_GAIN) * 63) / EQUALIZER_MAX_GAIN / 2); + aud_vfs_fwrite(bands, 1, 11, file); - aud_vfs_fclose(file); } @@ -1068,7 +1067,7 @@ void equalizerwin_set_band(gint band, gfloat value) { - g_return_if_fail(band >= 0 && band < 10); + g_return_if_fail(band >= 0 && band < AUD_EQUALIZER_NBANDS); ui_skinned_equalizer_slider_set_position(equalizerwin_bands[band], value); } @@ -1081,7 +1080,7 @@ gfloat equalizerwin_get_band(gint band) { - g_return_val_if_fail(band >= 0 && band < 10, 0.0); + g_return_val_if_fail(band >= 0 && band < AUD_EQUALIZER_NBANDS, 0.0); return ui_skinned_equalizer_slider_get_position(equalizerwin_bands[band]); } @@ -1092,7 +1091,7 @@ gtk_window_present(GTK_WINDOW(equalizerwin_load_window)); return; } - + equalizerwin_create_list_window(equalizer_presets, Q_("Load preset"), &equalizerwin_load_window, @@ -1130,11 +1129,9 @@ { gint i; - ui_skinned_equalizer_slider_set_position(equalizerwin_preamp, 0); - for (i = 0; i < 10; i++) - ui_skinned_equalizer_slider_set_position(equalizerwin_bands[i], 0); - - equalizerwin_eq_changed(); + equalizerwin_set_preamp(0); + for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) + equalizerwin_set_band(i, 0); } void @@ -1253,9 +1250,9 @@ file_uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog)); EqualizerPreset *preset = g_new0(EqualizerPreset, 1); preset->name = g_strdup(file_uri); - preset->preamp = ui_skinned_equalizer_slider_get_position(equalizerwin_preamp); - for (i = 0; i < 10; i++) - preset->bands[i] = ui_skinned_equalizer_slider_get_position(equalizerwin_bands[i]); + preset->preamp = equalizerwin_get_preamp(); + for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) + preset->bands[i] = equalizerwin_get_band(i); aud_save_preset_file(preset, file_uri); equalizer_preset_free(preset); g_free(file_uri); @@ -1325,10 +1322,9 @@ } void -equalizer_activate(gboolean active) +equalizerwin_activate(gboolean active) { aud_cfg->equalizer_active = active; ui_skinned_button_set_inside(equalizerwin_on, active); - equalizerwin_eq_changed(); }
--- a/src/skins/ui_equalizer.h Thu Jul 10 01:40:57 2008 +0300 +++ b/src/skins/ui_equalizer.h Thu Jul 10 01:41:27 2008 +0300 @@ -64,6 +64,6 @@ extern GtkWidget *equalizerwin_graph; extern gboolean equalizerwin_focus; -void equalizer_activate(gboolean active); +void equalizerwin_activate(gboolean active); #endif /* AUDACIOUS_UI_EQUALIZER_H */
--- a/src/skins/ui_main.c Thu Jul 10 01:40:57 2008 +0300 +++ b/src/skins/ui_main.c Thu Jul 10 01:41:27 2008 +0300 @@ -68,7 +68,6 @@ #include "ui_dock.h" #include "ui_main_evlisteners.h" #include "ui_skinselector.h" -#include "ui_urlopener.h" #include "util.h" #include "visualization.h" #endif @@ -1073,30 +1072,6 @@ } static void -on_add_url_add_clicked(GtkWidget * widget, - GtkWidget * entry) -{ - const gchar *text = gtk_entry_get_text(GTK_ENTRY(entry)); - if (text && *text) - aud_playlist_add_url(aud_playlist_get_active(), text); -} - -static void -on_add_url_ok_clicked(GtkWidget * widget, - GtkWidget * entry) -{ - Playlist *playlist = aud_playlist_get_active(); - - const gchar *text = gtk_entry_get_text(GTK_ENTRY(entry)); - if (text && *text) - { - aud_playlist_clear(playlist); - aud_playlist_add_url(playlist, text); - audacious_drct_initiate(); - } -} - -static void on_visibility_warning_toggle(GtkToggleButton *tbt, gpointer unused) { config.warn_about_win_visibility = !gtk_toggle_button_get_active(tbt); @@ -1220,28 +1195,6 @@ g_free(theme); } -void -mainwin_show_add_url_window(void) -{ -#if 0 - static GtkWidget *url_window = NULL; - - if (!url_window) { - url_window = - util_add_url_dialog_new(_("Enter location to play:"), - G_CALLBACK(on_add_url_ok_clicked), - G_CALLBACK(on_add_url_add_clicked)); - gtk_window_set_transient_for(GTK_WINDOW(url_window), - GTK_WINDOW(mainwin)); - g_signal_connect(url_window, "destroy", - G_CALLBACK(gtk_widget_destroyed), - &url_window); - } - - gtk_window_present(GTK_WINDOW(url_window)); -#endif -} - static void check_set( GtkActionGroup * action_group , const gchar * action_name , @@ -1749,7 +1702,7 @@ break; } case MAINWIN_GENERAL_PLAYLOCATION: - mainwin_show_add_url_window(); + action_play_location(); break; case MAINWIN_GENERAL_FILEINFO: aud_playlist_fileinfo_current(playlist); @@ -2756,7 +2709,7 @@ void action_play_location( void ) { - mainwin_show_add_url_window(); + aud_hook_call("urlopener show", NULL); } void
--- a/src/skins/ui_main.h Thu Jul 10 01:40:57 2008 +0300 +++ b/src/skins/ui_main.h Thu Jul 10 01:41:27 2008 +0300 @@ -155,7 +155,6 @@ void mainwin_repeat_pushed(gboolean toggled); void mainwin_disable_seekbar(void); void mainwin_set_title(const gchar * text); -void mainwin_show_add_url_window(void); void mainwin_minimize_cb(void); void mainwin_general_menu_callback(gpointer cb_data, guint action,
--- a/src/skins/ui_playlist.c Thu Jul 10 01:40:57 2008 +0300 +++ b/src/skins/ui_playlist.c Thu Jul 10 01:41:27 2008 +0300 @@ -1199,7 +1199,7 @@ break; case GDK_Insert: if (event->state & GDK_MOD1_MASK) - mainwin_show_add_url_window(); + action_playlist_add_url(); else playlistwin_show_filebrowser(); break; @@ -1800,7 +1800,7 @@ void action_playlist_add_url(void) { - mainwin_show_add_url_window(); + aud_hook_call("urlopener show", NULL); } void