X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fplaylist.c;h=0fece7b023f9fd8112baa1f0eb5a256b751f0b41;hb=d36841f273ffe01ba67ae77a65ba2cd658339e64;hp=4c47bf0febd07bad33db8513b2527406fe6e8a21;hpb=a0d2ee063233dc9e3388f0e51b7bccc20a1885a5;p=omnplay diff --git a/src/playlist.c b/src/playlist.c index 4c47bf0..0fece7b 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -87,12 +87,33 @@ 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; }; +#if 0 + { + 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); + }; +#endif count++; } @@ -191,8 +212,9 @@ void omnplay_playlist_draw(omnplay_instance_t* app) 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), + 5, frames2tc(app->playlist.item[i].dur, 25.0, tc2), 6, app->playlist.item[i].title, + 7, i, -1 ); }