X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fomnplay.h;h=ebe0e68c5fa8ce0efc70b872e338cba2ebf71503;hb=4eff63591040d11a6c4b3726ea357ef2c64d9fb5;hp=2c3b41de3ec7987e776f71c55f1f0c559aeea510;hpb=e44b8496425b348e22165e767b3e8fa52dcad953;p=omnplay diff --git a/src/omnplay.h b/src/omnplay.h index 2c3b41d..ebe0e68 100644 --- a/src/omnplay.h +++ b/src/omnplay.h @@ -51,37 +51,104 @@ typedef enum control_buttons BUTTON_LAST } control_buttons_t; +#define OMNPLAY_PLAYLIST_BLOCK_BEGIN 1 +#define OMNPLAY_PLAYLIST_BLOCK_BODY 0 +#define OMNPLAY_PLAYLIST_BLOCK_END 2 +#define OMNPLAY_PLAYLIST_BLOCK_LOOP 4 + +typedef enum playlist_item_type +{ + // 1 + OMNPLAY_PLAYLIST_ITEM_BLOCK_BEGIN = OMNPLAY_PLAYLIST_BLOCK_BEGIN, + // 0 + OMNPLAY_PLAYLIST_ITEM_BLOCK_BODY = OMNPLAY_PLAYLIST_BLOCK_BODY, + // 2 + OMNPLAY_PLAYLIST_ITEM_BLOCK_END = OMNPLAY_PLAYLIST_BLOCK_END, + // 3 + OMNPLAY_PLAYLIST_ITEM_BLOCK_SINGLE = OMNPLAY_PLAYLIST_BLOCK_BEGIN | + OMNPLAY_PLAYLIST_BLOCK_BODY | + OMNPLAY_PLAYLIST_BLOCK_END, + // 5 + OMNPLAY_PLAYLIST_ITEM_LOOP_BEGIN = OMNPLAY_PLAYLIST_BLOCK_BEGIN | + OMNPLAY_PLAYLIST_BLOCK_LOOP, + // 4 + OMNPLAY_PLAYLIST_ITEM_LOOP_BODY = OMNPLAY_PLAYLIST_BLOCK_BODY | + OMNPLAY_PLAYLIST_BLOCK_LOOP, + // 6 + OMNPLAY_PLAYLIST_ITEM_LOOP_END = OMNPLAY_PLAYLIST_BLOCK_END | + OMNPLAY_PLAYLIST_BLOCK_LOOP, + // 7 + OMNPLAY_PLAYLIST_ITEM_LOOP_SINGLE = OMNPLAY_PLAYLIST_BLOCK_BEGIN | + 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; + int omn_idx; + int omn_offset; +} 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_cur, *label_rem, *label_clip; -} -omnplay_player_t; + GtkWidget *label_status, *label_state, *label_tc_cur, *label_tc_rem, *label_clip; + struct omnplay_instance *app; + int playlist_start; +} omnplay_player_t; typedef struct omnplay_instance { GtkWidget *window; + GtkWidget *playlist_grid; + GtkWidget *library_grid; GtkWidget *buttons[BUTTON_LAST + 1]; struct { omnplay_player_t item[MAX_PLAYERS]; int count; char path[PATH_MAX]; + pthread_mutex_t lock; } players; int f_exit; -} -omnplay_instance_t; + struct + { + playlist_item_t item[MAX_PLAYLIST_ITEMS]; + int count; + int ver_curr; + int ver_prev; + pthread_mutex_t lock; + char* path; + GdkPixbuf *block_icons[8]; + } playlist; +} omnplay_instance_t; omnplay_instance_t* omnplay_create(int argc, char** argv); void omnplay_init(omnplay_instance_t* app); void omnplay_release(omnplay_instance_t* app); void omnplay_destroy(omnplay_instance_t* app); +void omnplay_playlist_load(omnplay_instance_t* app); +void omnplay_playlist_save(omnplay_instance_t* app); +void omnplay_playlist_draw(omnplay_instance_t* app); +void omnplay_playlist_draw_item(omnplay_instance_t* app, int idx); +void omnplay_playlist_draw_item_rem(omnplay_instance_t* app, int idx, char* rem); #ifdef __cplusplus };