/*
- * omnplay.h -- GTK+ 2 omnplay
- * Copyright (C) 2011 Maksym Veremeyenko <verem@m1stereo.tv>
+ * omnplay.h -- GTK+ 2 melted gui
+ * Copyright (C) 2012 Maksym Veremeyenko <verem@m1stereo.tv>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifndef OMNPLAY_H
-#define OMNPLAY_H
+#ifndef INSTANCE_H
+#define INSTANCE_H
#include <pthread.h>
{
#endif /* __cplusplus */
+#define PRODUCT_NAME "Melted GUI"
+
typedef enum control_buttons
{
BUTTON_PLAYLIST_ITEM_ADD = 1,
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
+#define PLAYLIST_BLOCK_BEGIN 1
+#define PLAYLIST_BLOCK_BODY 0
+#define PLAYLIST_BLOCK_END 2
+#define PLAYLIST_BLOCK_LOOP 4
typedef enum playlist_item_type
{
// 1
- OMNPLAY_PLAYLIST_ITEM_BLOCK_BEGIN = OMNPLAY_PLAYLIST_BLOCK_BEGIN,
+ PLAYLIST_ITEM_BLOCK_BEGIN = PLAYLIST_BLOCK_BEGIN,
// 0
- OMNPLAY_PLAYLIST_ITEM_BLOCK_BODY = OMNPLAY_PLAYLIST_BLOCK_BODY,
+ PLAYLIST_ITEM_BLOCK_BODY = PLAYLIST_BLOCK_BODY,
// 2
- OMNPLAY_PLAYLIST_ITEM_BLOCK_END = OMNPLAY_PLAYLIST_BLOCK_END,
+ PLAYLIST_ITEM_BLOCK_END = PLAYLIST_BLOCK_END,
// 3
- OMNPLAY_PLAYLIST_ITEM_BLOCK_SINGLE = OMNPLAY_PLAYLIST_BLOCK_BEGIN |
- OMNPLAY_PLAYLIST_BLOCK_BODY |
- OMNPLAY_PLAYLIST_BLOCK_END,
+ PLAYLIST_ITEM_BLOCK_SINGLE = PLAYLIST_BLOCK_BEGIN |
+ PLAYLIST_BLOCK_BODY |
+ PLAYLIST_BLOCK_END,
// 5
- OMNPLAY_PLAYLIST_ITEM_LOOP_BEGIN = OMNPLAY_PLAYLIST_BLOCK_BEGIN |
- OMNPLAY_PLAYLIST_BLOCK_LOOP,
+ PLAYLIST_ITEM_LOOP_BEGIN = PLAYLIST_BLOCK_BEGIN |
+ PLAYLIST_BLOCK_LOOP,
// 4
- OMNPLAY_PLAYLIST_ITEM_LOOP_BODY = OMNPLAY_PLAYLIST_BLOCK_BODY |
- OMNPLAY_PLAYLIST_BLOCK_LOOP,
+ PLAYLIST_ITEM_LOOP_BODY = PLAYLIST_BLOCK_BODY |
+ PLAYLIST_BLOCK_LOOP,
// 6
- OMNPLAY_PLAYLIST_ITEM_LOOP_END = OMNPLAY_PLAYLIST_BLOCK_END |
- OMNPLAY_PLAYLIST_BLOCK_LOOP,
+ PLAYLIST_ITEM_LOOP_END = PLAYLIST_BLOCK_END |
+ 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_LOOP_SINGLE = PLAYLIST_BLOCK_BEGIN |
+ PLAYLIST_BLOCK_BODY |
+ PLAYLIST_BLOCK_END |
+ PLAYLIST_BLOCK_LOOP,
} playlist_item_type_t;
#define MAX_PLAYLIST_ITEMS 1024
#define PLAYLIST_ITEM_ERROR_LIB 1
#define PLAYLIST_ITEM_ERROR_CUE 2
+/**
+ * @anchor playlist_item_t
+ *
+ * fu
+ */
typedef struct playlist_item
{
- char id[PATH_MAX];
- char title[PATH_MAX];
+/*@{*/
+ char id[PATH_MAX]; /**< id of item, i.e. internal id or filename */
+ char title[PATH_MAX]; /**< title */
int in;
int dur;
- int player;
- playlist_item_type_t type;
- int omn_idx;
- int omn_offset;
- int error;
- int del;
+ int player; /**< player index that item currenly associated, -1 otherwise */
+ playlist_item_type_t type; /**< block type of item */
+ int int_idx; /**< internal playlist index */
+// int omn_offset;
+ int error; /**< flag indicates if any error occured with item */
+ int del; /**< */
+/*@}*/
} playlist_item_t;
#define MAX_PLAYERS 4
-struct omnplay_instance;
+struct instance_desc;
-typedef struct omnplay_player
+typedef struct player_desc
{
int idx;
- char name[PATH_MAX];
- char host[PATH_MAX];
+ int unit;
void* handle;
GThread* thread;
GtkWidget *label_status, *label_state, *label_tc_cur, *label_tc_rem, *label_clip;
- struct omnplay_instance *app;
+ struct instance_desc *app;
int playlist_start;
int playlist_length;
-} omnplay_player_t;
+} player_t;
-typedef struct omnplay_instance
+typedef struct instance_desc
{
GtkWidget *window;
GtkWidget *playlist_grid;
- GtkWidget *library_grid;
+ GtkWidget *library_tree;
GtkWidget *buttons[BUTTON_LAST + 1];
GtkWidget *status_label;
struct
{
- omnplay_player_t item[MAX_PLAYERS];
+ player_t item[MAX_PLAYERS];
int count;
- char path[PATH_MAX];
+ char host[PATH_MAX];
+ int port;
pthread_mutex_t lock;
} players;
int f_exit;
} playlist;
struct
{
+ int port;
+ void* handle[2];
+ GdkPixbuf *icons[8];
+
+
playlist_item_t item[MAX_LIBRARY_ITEMS];
int count;
char filename[PATH_MAX];
playlist_item_t item[MAX_LIBRARY_ITEMS];
int count;
} clipboard;
-} 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_relink(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);
+} instance_t;
+
+instance_t* instance_create(int argc, char** argv);
+void instance_init(instance_t* app);
+void instance_release(instance_t* app);
+void instance_destroy(instance_t* app);
+
+#if 0
void omnplay_library_load(omnplay_instance_t* app);
void omnplay_library_save(omnplay_instance_t* app);
void omnplay_library_refresh(omnplay_instance_t* app);
void omnplay_library_draw(omnplay_instance_t* app);
+
typedef void (*omnplay_get_content_cb_proc)(omnplay_instance_t* app, playlist_item_t *items, void* data);
int omnplay_get_content(omnplay_instance_t* app, playlist_item_t *items, int limit,
omnplay_get_content_cb_proc proc, void* data);
void omnplay_set_status(omnplay_instance_t* app, char* str);
int* omnplay_selected_idxs_playlist(omnplay_instance_t* app);
+#endif
+
#ifdef __cplusplus
};
#endif /* __cplusplus */
-#endif /* OMNPLAY_H */
+#endif /* INSTANCE_H */