add item lib/cue error flags
authorMaksym Veremeyenko <verem@m1stereo.tv>
Wed, 22 Jun 2011 13:59:07 +0000 (16:59 +0300)
committerMaksym Veremeyenko <verem@m1stereo.tv>
Wed, 22 Jun 2011 13:59:07 +0000 (16:59 +0300)
src/library.c
src/omnplay.cpp
src/omnplay.h

index a54bfaf..e547b5c 100644 (file)
@@ -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);
 };
index b08f686..4e1511a 100644 (file)
@@ -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;
index cebab56..fd9c1cc 100644 (file)
@@ -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