2 * omnplay.h -- GTK+ 2 melted gui
3 * Copyright (C) 2012 Maksym Veremeyenko <verem@m1stereo.tv>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 #endif /* __cplusplus */
30 #define PRODUCT_NAME "Melted GUI"
32 typedef enum control_buttons
34 BUTTON_PLAYLIST_ITEM_ADD
= 1,
35 BUTTON_PLAYLIST_ITEM_DEL
,
36 BUTTON_PLAYLIST_ITEM_EDIT
,
41 BUTTON_PLAYLIST_BLOCK_SINGLE
,
42 BUTTON_PLAYLIST_BLOCK_LOOP
,
44 BUTTON_PLAYLIST_ITEM_UP
,
45 BUTTON_PLAYLIST_ITEM_DOWN
,
53 BUTTON_LIBRARY_REFRESH
,
56 BUTTON_LIBRARY_FIND_NEXT
,
58 BUTTON_PLAYLIST_RELINK
,
63 #define PLAYLIST_BLOCK_BEGIN 1
64 #define PLAYLIST_BLOCK_BODY 0
65 #define PLAYLIST_BLOCK_END 2
66 #define PLAYLIST_BLOCK_LOOP 4
68 typedef enum playlist_item_type
71 PLAYLIST_ITEM_BLOCK_BEGIN
= PLAYLIST_BLOCK_BEGIN
,
73 PLAYLIST_ITEM_BLOCK_BODY
= PLAYLIST_BLOCK_BODY
,
75 PLAYLIST_ITEM_BLOCK_END
= PLAYLIST_BLOCK_END
,
77 PLAYLIST_ITEM_BLOCK_SINGLE
= PLAYLIST_BLOCK_BEGIN
|
81 PLAYLIST_ITEM_LOOP_BEGIN
= PLAYLIST_BLOCK_BEGIN
|
84 PLAYLIST_ITEM_LOOP_BODY
= PLAYLIST_BLOCK_BODY
|
87 PLAYLIST_ITEM_LOOP_END
= PLAYLIST_BLOCK_END
|
90 PLAYLIST_ITEM_LOOP_SINGLE
= PLAYLIST_BLOCK_BEGIN
|
94 } playlist_item_type_t
;
96 #define MAX_PLAYLIST_ITEMS 1024
97 #define MAX_LIBRARY_ITEMS 10240
98 #define PLAYLIST_ITEM_ERROR_LIB 1
99 #define PLAYLIST_ITEM_ERROR_CUE 2
101 typedef struct playlist_item
104 char title
[PATH_MAX
];
108 playlist_item_type_t type
;
115 #define MAX_PLAYERS 4
117 struct instance_desc
;
119 typedef struct player_desc
125 GtkWidget
*label_status
, *label_state
, *label_tc_cur
, *label_tc_rem
, *label_clip
;
126 struct instance_desc
*app
;
131 typedef struct instance_desc
134 GtkWidget
*playlist_grid
;
135 GtkWidget
*library_tree
;
136 GtkWidget
*buttons
[BUTTON_LAST
+ 1];
137 GtkWidget
*status_label
;
140 player_t item
[MAX_PLAYERS
];
143 pthread_mutex_t lock
;
148 playlist_item_t item
[MAX_PLAYLIST_ITEMS
];
152 pthread_mutex_t lock
;
154 GdkPixbuf
*block_icons
[8];
159 playlist_item_t item
[MAX_LIBRARY_ITEMS
];
161 char filename
[PATH_MAX
];
162 char whois
[PATH_MAX
];
163 pthread_mutex_t lock
;
164 GThread
* refresh_thread
;
171 playlist_item_t item
[MAX_LIBRARY_ITEMS
];
176 instance_t
* instance_create(int argc
, char** argv
);
177 void instance_init(instance_t
* app
);
178 void instance_release(instance_t
* app
);
179 void instance_destroy(instance_t
* app
);
182 void omnplay_library_load(omnplay_instance_t
* app
);
183 void omnplay_library_save(omnplay_instance_t
* app
);
184 void omnplay_library_refresh(omnplay_instance_t
* app
);
185 void omnplay_library_draw(omnplay_instance_t
* app
);
187 typedef void (*omnplay_get_content_cb_proc
)(omnplay_instance_t
* app
, playlist_item_t
*items
, void* data
);
188 int omnplay_get_content(omnplay_instance_t
* app
, playlist_item_t
*items
, int limit
,
189 omnplay_get_content_cb_proc proc
, void* data
);
190 int omnplay_whois_list(omnplay_instance_t
* app
, playlist_item_t
*items
, int* plimit
);
191 int omnplay_library_load_file(playlist_item_t
* items
, int *pcount
, char* filename
);
192 playlist_item_t
* omnplay_library_find(omnplay_instance_t
* app
, char* id
);
193 int omnplay_library_normalize_item(omnplay_instance_t
* app
, playlist_item_t
* item
);
194 int omnplay_library_relink_item(omnplay_instance_t
* app
, playlist_item_t
* item
);
195 playlist_item_t
* omnplay_library_get_selected(omnplay_instance_t
* app
, int *count
);
196 void omnplay_playlist_normalize(omnplay_instance_t
* app
);
197 void omnplay_library_search(omnplay_instance_t
* app
, int next
);
198 void omnplay_set_status(omnplay_instance_t
* app
, char* str
);
199 int* omnplay_selected_idxs_playlist(omnplay_instance_t
* app
);
205 #endif /* __cplusplus */
207 #endif /* INSTANCE_H */