fprintf(stderr, "cue: failed with %d, %s\n", r, OmPlrGetErrorString((OmPlrError)r));
app->playlist.item[i].omn_idx = -1;
app->playlist.item[i].omn_offset = -1;
+ app->playlist.item[i].error |= PLAYLIST_ITEM_ERROR_CUE;
}
else
{
app->playlist.item[i].omn_idx = c;
app->playlist.item[i].omn_offset = o;
+ app->playlist.item[i].error &= 0xF ^ PLAYLIST_ITEM_ERROR_CUE;
/* save selected item offset */
if(i == idx) p = o;
static void omnplay_playlist_item_swap(omnplay_instance_t* app, int dir)
{
- int sel, a, b;
+ int sel, a, b, e = 1;
GtkTreePath* path;
playlist_item_t item;
app->playlist.item[b] = item;
/* rewite type */
- app->playlist.item[a].type = OMNPLAY_PLAYLIST_ITEM_BLOCK_SINGLE;
- app->playlist.item[b].type = OMNPLAY_PLAYLIST_ITEM_BLOCK_SINGLE;
+ if(app->playlist.item[a].type != app->playlist.item[b].type)
+ {
+ e = 0;
+ app->playlist.item[a].type = OMNPLAY_PLAYLIST_ITEM_BLOCK_SINGLE;
+ app->playlist.item[b].type = OMNPLAY_PLAYLIST_ITEM_BLOCK_SINGLE;
+ };
/* redraw main items */
omnplay_playlist_draw_item(app, a);
omnplay_playlist_draw_item(app, b);
/* fix block types */
- if(a)
+ if(a && !e)
{
app->playlist.item[a - 1].type = (playlist_item_type_t)(app->playlist.item[a - 1].type |
OMNPLAY_PLAYLIST_BLOCK_END);
omnplay_playlist_draw_item(app, a - 1);
};
- if(b + 1 < app->playlist.count)
+ if(b + 1 < app->playlist.count && !e)
{
app->playlist.item[b + 1].type = (playlist_item_type_t)(app->playlist.item[b + 1].type |
OMNPLAY_PLAYLIST_BLOCK_BEGIN);
return TRUE;
};
break;
+ case GDK_S:
+ case GDK_s:
+ if(event->state & GDK_CONTROL_MASK)
+ {
+ omnplay_playlist_save(app);
+ return TRUE;
+ };
+ break;
+ case GDK_O:
+ case GDK_o:
+ if(event->state & GDK_CONTROL_MASK)
+ {
+ omnplay_playlist_load(app);
+ return TRUE;
+ };
+ break;
case GDK_KEY_space:
omnplay_ctl(app, BUTTON_PLAYER_PLAY);
return TRUE;