{
#endif /* __cplusplus */
+typedef enum control_buttons
+{
+ BUTTON_PLAYLIST_ITEM_ADD = 1,
+ BUTTON_PLAYLIST_ITEM_DEL,
+ BUTTON_PLAYLIST_ITEM_EDIT,
+
+ BUTTON_PLAYLIST_LOAD,
+ BUTTON_PLAYLIST_SAVE,
+
+ BUTTON_PLAYLIST_BLOCK_SINGLE,
+ BUTTON_PLAYLIST_BLOCK_LOOP,
+
+ BUTTON_PLAYLIST_ITEM_UP,
+ BUTTON_PLAYLIST_ITEM_DOWN,
+
+ BUTTON_PLAYER_CUE,
+ BUTTON_PLAYER_PLAY,
+ BUTTON_PLAYER_PAUSE,
+ BUTTON_PLAYER_STOP,
+
+ BUTTON_LIBRARY_ADD,
+ BUTTON_LIBRARY_REFRESH,
+
+ BUTTON_LAST
+} control_buttons_t;
+
+#define OMNPLAY_PLAYLIST_BLOCK_BEGIN (1 << 0) // 1
+#define OMNPLAY_PLAYLIST_BLOCK_BODY 0 // 0
+#define OMNPLAY_PLAYLIST_BLOCK_END (1 << 1) // 2
+#define OMNPLAY_PLAYLIST_BLOCK_LOOP (1 << 2) // 4
+
+typedef enum playlist_item_type
+{
+ OMNPLAY_PLAYLIST_ITEM_BLOCK_BEGIN = OMNPLAY_PLAYLIST_BLOCK_BEGIN,
+
+ OMNPLAY_PLAYLIST_ITEM_BLOCK_BODY = OMNPLAY_PLAYLIST_BLOCK_BODY,
+
+ OMNPLAY_PLAYLIST_ITEM_BLOCK_END = OMNPLAY_PLAYLIST_BLOCK_END,
+
+ OMNPLAY_PLAYLIST_ITEM_BLOCK_SINGLE = OMNPLAY_PLAYLIST_BLOCK_END | \
+ OMNPLAY_PLAYLIST_BLOCK_BODY | \
+ OMNPLAY_PLAYLIST_BLOCK_END,
+
+ OMNPLAY_PLAYLIST_ITEM_LOOP_BEGIN = OMNPLAY_PLAYLIST_BLOCK_BEGIN | \
+ OMNPLAY_PLAYLIST_BLOCK_LOOP,
+
+ OMNPLAY_PLAYLIST_ITEM_LOOP_BODY = OMNPLAY_PLAYLIST_BLOCK_BODY | \
+ OMNPLAY_PLAYLIST_BLOCK_LOOP,
+
+ OMNPLAY_PLAYLIST_ITEM_LOOP_END = OMNPLAY_PLAYLIST_BLOCK_END | \
+ OMNPLAY_PLAYLIST_BLOCK_LOOP,
+
+ OMNPLAY_PLAYLIST_ITEM_LOOP_SINGLE = OMNPLAY_PLAYLIST_BLOCK_END | \
+ OMNPLAY_PLAYLIST_BLOCK_BODY | \
+ OMNPLAY_PLAYLIST_BLOCK_END | \
+ OMNPLAY_PLAYLIST_BLOCK_LOOP,
+} playlist_item_type_t;
+
+#define MAX_PLAYLIST_ITEMS 1024
+
+typedef struct playlist_item
+{
+ char id[PATH_MAX];
+ char title[PATH_MAX];
+ int in;
+ int dur;
+ int player;
+ playlist_item_type_t type;
+} playlist_item_t;
+
+#define MAX_PLAYERS 4
+
+struct omnplay_instance;
+
+typedef struct omnplay_player
+{
+ int idx;
+ char name[PATH_MAX];
+ char host[PATH_MAX];
+ void* handle;
+ pthread_t thread;
+ pthread_mutex_t lock;
+ GtkWidget *label_status, *label_state, *label_tc_cur, *label_tc_rem, *label_clip;
+ struct omnplay_instance *app;
+ int playlist_start;
+ int playlist_count;
+} omnplay_player_t;
typedef struct omnplay_instance
{
GtkWidget *window;
-}
-omnplay_instance_t;
+ GtkWidget *playlist_grid;
+ GtkWidget *library_grid;
+ GtkWidget *buttons[BUTTON_LAST + 1];
+ struct
+ {
+ omnplay_player_t item[MAX_PLAYERS];
+ int count;
+ char path[PATH_MAX];
+ } players;
+ int f_exit;
+ struct
+ {
+ playlist_item_t item[MAX_PLAYLIST_ITEMS];
+ int count;
+ int ver_curr;
+ int ver_prev;
+ } playlist;
+} omnplay_instance_t;
omnplay_instance_t* omnplay_create(int argc, char** argv);
void omnplay_init(omnplay_instance_t* app);
-void omnplay_close(omnplay_instance_t* app);
+void omnplay_release(omnplay_instance_t* app);
+void omnplay_destroy(omnplay_instance_t* app);
#ifdef __cplusplus
};