From a0d2ee063233dc9e3388f0e51b7bccc20a1885a5 Mon Sep 17 00:00:00 2001 From: Maksym Veremeyenko Date: Sun, 19 Jun 2011 16:02:50 +0300 Subject: [PATCH 1/1] basic playlist draw --- src/playlist.c | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/src/playlist.c b/src/playlist.c index d7a86df..4c47bf0 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -171,4 +171,32 @@ void omnplay_playlist_save(omnplay_instance_t* app) void omnplay_playlist_draw(omnplay_instance_t* app) { + int i; + char tc1[12], tc2[12]; + GtkListStore *list_store; + GtkTreeIter iter; + + list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(app->playlist_grid))); + gtk_list_store_clear(list_store); + + pthread_mutex_lock(&app->playlist.lock); + + for(i = 0;i < app->playlist.count; i++) + { + gtk_list_store_append(list_store, &iter); + + gtk_list_store_set(list_store, &iter, + 0, "", + 1, app->playlist.block_icons[app->playlist.item[i].type], + 2, (0 == app->playlist.item[i].player)?"A":"B", + 3, app->playlist.item[i].id, + 4, frames2tc(app->playlist.item[i].in, 25.0, tc1), + 5, frames2tc(app->playlist.item[i].in, 25.0, tc2), + 6, app->playlist.item[i].title, + -1 ); + } + + app->playlist.ver_prev = app->playlist.ver_curr; + + pthread_mutex_unlock(&app->playlist.lock); }; -- 1.7.4.4