Keybind c to clear playlist
Summary: It's somewhat annoying to keep restarting rage in order to manipulate the playlist. Having a keybind for clearing it goes a long way for usability. Test Plan: Add files. Hit c. Add more files. Skip around in the playlist. Clear. Add. Reviewers: etrunko, raster Projects: #rage Differential Revision: https://phab.enlightenment.org/D1484 * fix mem leak of vid content
This commit is contained in:
parent
05608eec3a
commit
873ed3c4b6
|
@ -110,6 +110,13 @@ key_handle(Evas_Object *win, Evas_Event_Key_Down *ev)
|
|||
video_stop(inf->vid);
|
||||
elm_layout_signal_emit(inf->lay, "action,stop", "rage");
|
||||
}
|
||||
else if (!strcmp(ev->keyname, "c"))
|
||||
{
|
||||
printf("(c)lear!\n");
|
||||
video_stop(inf->vid);
|
||||
elm_layout_signal_emit(inf->lay, "action,stop", "rage");
|
||||
win_video_free(win);
|
||||
}
|
||||
else if ((!strcmp(ev->key, "Prior")) ||
|
||||
(!strcmp(ev->key, "XF86AudioPrev")))
|
||||
{
|
||||
|
|
|
@ -239,6 +239,35 @@ win_video_insert(Evas_Object *win, const char *file)
|
|||
evas_object_data_set(win, "file_list", inf->file_list);
|
||||
}
|
||||
|
||||
void
|
||||
win_video_free(Evas_Object *win)
|
||||
{
|
||||
Winvid_Entry *vid;
|
||||
Inf *inf = evas_object_data_get(win, "inf");
|
||||
if (!inf->file_list)
|
||||
{
|
||||
printf("AAAAIEEEEEE, no file_list\n");
|
||||
return;
|
||||
}
|
||||
|
||||
EINA_LIST_FREE(inf->file_list, vid)
|
||||
{
|
||||
printf("[%p] Free %s\n", vid, vid->file);
|
||||
if (vid->file) eina_stringshare_del(vid->file);
|
||||
if (vid->sub) eina_stringshare_del(vid->sub);
|
||||
free(vid);
|
||||
}
|
||||
|
||||
// Clean up inf state and reinit window
|
||||
// to not confuse rage
|
||||
inf->file_cur = NULL;
|
||||
inf->vid = NULL;
|
||||
win_video_init(win);
|
||||
|
||||
// Refresh to get rid of playlist icons/preview videos
|
||||
win_list_content_update(win);
|
||||
}
|
||||
|
||||
void
|
||||
win_video_goto(Evas_Object *win, Eina_List *l)
|
||||
{
|
||||
|
|
|
@ -10,6 +10,7 @@ typedef struct _Winvid_Entry
|
|||
void win_video_init(Evas_Object *win);
|
||||
void win_video_file_list_set(Evas_Object *win, Eina_List *list);
|
||||
void win_video_insert(Evas_Object *win, const char *file);
|
||||
void win_video_free(Evas_Object *win);
|
||||
void win_video_goto(Evas_Object *win, Eina_List *l);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue