Misc


Functions

Evas_List * convert_rowlist_in_playlist_with_file (Evas_List *rowlist)
 Convert a list of row in a Evas_List. And set the song->file element.
Evas_List * convert_rowlist_in_playlist_with_id (Evas_List *rowlist)
 Convert a list of row in a Evas_List. And set the song->id element.

Function Documentation

Evas_List* convert_rowlist_in_playlist_with_file ( Evas_List *  rowlist  ) 

Convert a list of row in a Evas_List. And set the song->file element.

Parameters:
rowlist An Evas_List of song's row
Returns:
A list of song
00033 {
00034   Evas_List *list = NULL, *first_rowlist;
00035   Etk_Tree_Row *row;
00036   Emphasis_Data *data = NULL;
00037 
00038   if (!rowlist)
00039     return NULL;
00040 
00041   first_rowlist = rowlist;
00042 
00043   while (rowlist)
00044     {
00045       row = evas_list_data(rowlist);
00046 
00047       data = calloc(1, sizeof(Emphasis_Data));
00048       if(!data) return NULL;
00049       data->type = MPD_DATA_TYPE_SONG;
00050       data->song = calloc(1, sizeof(Emphasis_Song));
00051       if(!data->song) { free(data); return NULL; }
00052       data->song->file = strdup(etk_tree_row_data_get(row));
00053 
00054       list = evas_list_append(list, data);
00055       rowlist = evas_list_next(rowlist);
00056     }
00057 
00058   rowlist = first_rowlist;
00059   return list;
00060 }

Evas_List* convert_rowlist_in_playlist_with_id ( Evas_List *  rowlist  ) 

Convert a list of row in a Evas_List. And set the song->id element.

Parameters:
rowlist An Evas_List of song's row
Returns:
A list of song
00070 {
00071   Evas_List *list = NULL, *first_rowlist;
00072   Etk_Tree_Row *row;
00073   int id;
00074   Emphasis_Data *data = NULL;
00075 
00076   if (!rowlist)
00077     return NULL;
00078 
00079   first_rowlist = rowlist;
00080 
00081   while (rowlist)
00082     {
00083       row = evas_list_data(rowlist);
00084       id = (int) etk_tree_row_data_get(row);
00085 
00086       data = malloc(sizeof(Emphasis_Data));
00087       if(!data) return NULL;
00088       data->type = MPD_DATA_TYPE_SONG;
00089       data->song = malloc(sizeof(Emphasis_Song));
00090       if(!data->song) { free(data); return NULL; }
00091       data->song->id = id;
00092 
00093       list = evas_list_append(list, data);
00094       rowlist = evas_list_next(rowlist);
00095     }
00096 
00097   rowlist = first_rowlist;
00098   return list;
00099 }


Generated on Sat Apr 7 19:19:38 2007 for Emphasis by  doxygen 1.4.7