From 1bbcc24cd35fbfc8e87abd7d6e5df7e70b411971 Mon Sep 17 00:00:00 2001 From: Maksym Veremeyenko Date: Wed, 22 Jun 2011 16:59:07 +0300 Subject: [PATCH] add item lib/cue error flags --- src/library.c | 2 ++ src/omnplay.cpp | 2 ++ src/omnplay.h | 3 +++ 3 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/library.c b/src/library.c index a54bfaf..e547b5c 100644 --- a/src/library.c +++ b/src/library.c @@ -68,6 +68,8 @@ void omnplay_library_normalize_item(omnplay_instance_t* app, playlist_item_t* it item->in = lib->in; }; } + else + item->error = PLAYLIST_ITEM_ERROR_LIB; pthread_mutex_unlock(&app->library.lock); }; diff --git a/src/omnplay.cpp b/src/omnplay.cpp index b08f686..4e1511a 100644 --- a/src/omnplay.cpp +++ b/src/omnplay.cpp @@ -768,11 +768,13 @@ static void omnplay_ctl(omnplay_instance_t* app, control_buttons_t button) 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; diff --git a/src/omnplay.h b/src/omnplay.h index cebab56..fd9c1cc 100644 --- a/src/omnplay.h +++ b/src/omnplay.h @@ -86,6 +86,8 @@ typedef enum playlist_item_type #define MAX_PLAYLIST_ITEMS 1024 #define MAX_LIBRARY_ITEMS 10240 +#define PLAYLIST_ITEM_ERROR_LIB 1 +#define PLAYLIST_ITEM_ERROR_CUE 2 typedef struct playlist_item { @@ -97,6 +99,7 @@ typedef struct playlist_item playlist_item_type_t type; int omn_idx; int omn_offset; + int error; } playlist_item_t; #define MAX_PLAYERS 4 -- 1.7.4.4