Mercurial > audlegacy
changeset 2225:a14a871be06b trunk
[svn] More eq stuff, from external contributor Michael Faerber <01mf02 -at- gmail.com>.
author | kiyoshi |
---|---|
date | Sat, 30 Dec 2006 13:15:44 -0800 |
parents | 4446a9e7bdee |
children | 325a97334c11 |
files | ChangeLog audacious/equalizer.c |
diffstat | 2 files changed, 19 insertions(+), 64 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri Dec 29 21:01:49 2006 -0800 +++ b/ChangeLog Sat Dec 30 13:15:44 2006 -0800 @@ -1,3 +1,15 @@ +2006-12-30 05:01:49 +0000 William Pitcock <nenolod@nenolod.net> + revision [3453] + - memory_pool_alloc_object() + - memory_pool_strdup() + - controlsocket now uses a memory pool for packet data + + trunk/audacious/controlsocket.c | 41 ++++++++++++++++++++++++---------------- + trunk/audacious/memorypool.c | 15 ++++++++++++++ + trunk/audacious/memorypool.h | 5 ++++ + 3 files changed, 45 insertions(+), 16 deletions(-) + + 2006-12-30 04:38:02 +0000 William Pitcock <nenolod@nenolod.net> revision [3451] - MemoryPool, a simple performance-oriented memory pool.
--- a/audacious/equalizer.c Fri Dec 29 21:01:49 2006 -0800 +++ b/audacious/equalizer.c Sat Dec 30 13:15:44 2006 -0800 @@ -1550,69 +1550,6 @@ vfs_fclose(file); } -static gint -equalizerwin_list_sort_func(GtkCList * clist, - gconstpointer ptr1, gconstpointer ptr2) -{ - GtkCListRow *row1 = (GtkCListRow *) ptr1; - GtkCListRow *row2 = (GtkCListRow *) ptr2; - - return strcasecmp(GTK_CELL_TEXT(row1->cell[clist->sort_column])->text, - GTK_CELL_TEXT(row2->cell[clist->sort_column])->text); -} - - -static GtkListStore * -preset_list_store_new(GList * preset) -{ - GtkListStore *store; - GtkTreeIter iter; - GList *node; - - store = gtk_list_store_new(PRESET_VIEW_N_COLS, G_TYPE_STRING); - - for (node = preset; node; node = g_list_next(node)) { - gtk_list_store_append(store, &iter); - gtk_list_store_set(store, &iter, - PRESET_VIEW_COL_NAME, - &((EqualizerPreset *) node->data)->name, -1); - } - - return store; -} - - -GtkWidget * -preset_view_new(GList * preset) -{ - GtkWidget *treeview; - GtkTreeModel *model; - GtkTreeViewColumn *column; - GtkCellRenderer *renderer; - GtkListStore *store; - - store = preset_list_store_new(preset); - - model = gtk_tree_model_sort_new_with_model(GTK_TREE_MODEL(store)); - gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model), - PRESET_VIEW_COL_NAME, - GTK_SORT_ASCENDING); - - treeview = gtk_tree_view_new_with_model(model); - gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(treeview), TRUE); - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), TRUE); - - renderer = gtk_cell_renderer_text_new(); - column = gtk_tree_view_column_new_with_attributes(_("Preset"), renderer, - "text", - PRESET_VIEW_COL_NAME, - NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); - - return treeview; -} - - static GtkWidget * equalizerwin_create_list_window(GList *preset_list, const gchar *title, @@ -1623,7 +1560,8 @@ GCallback action_func, GCallback select_row_func) { - GtkWidget *vbox, *scrolled_window, *bbox, *button_cancel, *button_action, *view; + GtkWidget *vbox, *scrolled_window, *bbox, *view; + GtkWidget *button_cancel, *button_action; GList *node; GtkListStore *store; @@ -1631,6 +1569,7 @@ GtkTreeModel *model; GtkCellRenderer *renderer; GtkTreeSelection *selection; + GtkTreeSortable *sortable; @@ -1665,6 +1604,10 @@ model = GTK_TREE_MODEL(store); + sortable = GTK_TREE_SORTABLE(store); + gtk_tree_sortable_set_sort_column_id(sortable, 0, GTK_SORT_ASCENDING); + + view = gtk_tree_view_new(); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1,