4 #include <gmpc/gmpc-mpddata-model.h>
15 * This is a Special version of Gmpc:MpdData:Model that is made to show the current playlist, and keep in sync with it.
16 * This is to replace the old playlist-lis backend.
17 * Use this model with Gmpc:MpdData:Treeview
20 class Gmpc:MpdData:Model:Tagedit from Gmpc:MpdData:Model
21 (interface Gtk:Tree:Model)
24 GtkTreeModel *new (void)
30 * "override" the get_value method, because we need to fetch the value before it's available.
31 * So after we fetch it, let the Gmpc:MpdData:Model handle the hard work again.
33 interface Gtk:Tree:Model
35 get_value(Gtk:Tree:Model *model(check null type), GtkTreeIter *iter (check null), gint column (check >= 0 < MPDDATA_MODEL_N_COLUMNS), GValue *value (check null))
37 Self *self = GMPC_MPDDATA_MODEL_TAGEDIT(model);
38 MpdData_real *data = iter->user_data;
39 if(column == MPDDATA_MODEL_COL_ICON_ID)
41 si *i = data->userdata;
42 g_value_init(value, GMPC_MPDDATA_MODEL(self)->types[column]);
46 g_value_set_string(value, GTK_STOCK_CANCEL);
50 g_value_set_string(value, GTK_STOCK_OK);
56 * Call the parent function again
58 gmpc_mpddata_model_get_value(model, iter, column, value);
59 //PARENT(self)->get_value(model, iter, column, value);
60 //PARENT_HANDLER(model, iter,column,value);
64 revert_song(Gtk:Tree:Model *model(check null type), GtkTreeIter *iter (check null))
66 MpdData_real *data = iter->user_data;
70 si *i = data->userdata;
71 mpd_freeSong(data->song);
72 data->song = mpd_songDup(i->revert);
74 path = gtk_tree_model_get_path(model, iter);
75 gtk_tree_model_row_changed(model, path, iter);
76 gtk_tree_path_free(path);