X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fplaylist.c;h=0d325d35cb1f903105f5790fe58099de3897bdf9;hb=c7be31ae10a2a399cb21593d84703f8278472d72;hp=d7a86dfada1883375af66dfd88868c2e8897be56;hpb=7c1a2200d9071274ad16364be58bf82574748dd9;p=melted_gui diff --git a/src/playlist.c b/src/playlist.c index d7a86df..0d325d3 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -87,13 +87,34 @@ static int load_file_ply(omnplay_instance_t* app, char* filename) case 4: items[count].type = OMNPLAY_PLAYLIST_ITEM_LOOP_END; break; case 6: items[count].type = OMNPLAY_PLAYLIST_ITEM_BLOCK_END; break; case 0: - if(!count || items[count - 1].type != OMNPLAY_PLAYLIST_ITEM_BLOCK_BODY) + if(!count) items[count].type = OMNPLAY_PLAYLIST_ITEM_BLOCK_BEGIN; - else + else if(items[count - 1].type == OMNPLAY_PLAYLIST_ITEM_BLOCK_BEGIN || + items[count - 1].type == OMNPLAY_PLAYLIST_ITEM_BLOCK_BODY) items[count].type = OMNPLAY_PLAYLIST_ITEM_BLOCK_BODY; + else + items[count].type = OMNPLAY_PLAYLIST_ITEM_BLOCK_BEGIN; break; }; + { + char* n; + switch(items[count].type) + { + case OMNPLAY_PLAYLIST_ITEM_BLOCK_BEGIN: n = "BLOCK_BEGIN"; break; + case OMNPLAY_PLAYLIST_ITEM_BLOCK_BODY: n = "BLOCK_BODY"; break; + case OMNPLAY_PLAYLIST_ITEM_BLOCK_END: n = "BLOCK_END"; break; + case OMNPLAY_PLAYLIST_ITEM_BLOCK_SINGLE: n = "BLOCK_SINGLE"; break; + case OMNPLAY_PLAYLIST_ITEM_LOOP_BEGIN: n = "LOOP_BEGIN"; break; + case OMNPLAY_PLAYLIST_ITEM_LOOP_BODY: n = "LOOP_BODY"; break; + case OMNPLAY_PLAYLIST_ITEM_LOOP_END: n = "LOOP_END"; break; + case OMNPLAY_PLAYLIST_ITEM_LOOP_SINGLE: n = "LOOP_SINGLE"; break; + }; + fprintf(stderr, "src=[%s]\ndst=[idx=%d,block=%s,block_id=%d,in=%d,out=%d]\n", + l, count, n, items[count].type, items[count].in, items[count].dur); + }; + + count++; } }; @@ -171,4 +192,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].dur, 25.0, tc2), + 6, app->playlist.item[i].title, + -1 ); + } + + app->playlist.ver_prev = app->playlist.ver_curr; + + pthread_mutex_unlock(&app->playlist.lock); };