2355c8b70bd64f04ae62a49748a6157f63259b6c
[omnplay] / src / omnplay.h
1 /*
2 * omnplay.h -- GTK+ 2 omnplay
3 * Copyright (C) 2011 Maksym Veremeyenko <verem@m1stereo.tv>
4 *
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.
9 *
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.
14 *
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.
18 */
19
20 #ifndef OMNPLAY_H
21 #define OMNPLAY_H
22
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif /* __cplusplus */
27
28 typedef enum control_buttons
29 {
30 BUTTON_PLAYLIST_ITEM_ADD = 1,
31 BUTTON_PLAYLIST_ITEM_DEL,
32 BUTTON_PLAYLIST_ITEM_EDIT,
33
34 BUTTON_PLAYLIST_LOAD,
35 BUTTON_PLAYLIST_SAVE,
36
37 BUTTON_PLAYLIST_BLOCK_SINGLE,
38 BUTTON_PLAYLIST_BLOCK_LOOP,
39
40 BUTTON_PLAYLIST_ITEM_UP,
41 BUTTON_PLAYLIST_ITEM_DOWN,
42
43 BUTTON_PLAYER_CUE,
44 BUTTON_PLAYER_PLAY,
45 BUTTON_PLAYER_PAUSE,
46 BUTTON_PLAYER_STOP,
47
48 BUTTON_LIBRARY_ADD,
49 BUTTON_LIBRARY_REFRESH,
50
51 BUTTON_LAST
52 } control_buttons_t;
53
54 #define MAX_PLAYERS 4
55
56 typedef struct omnplay_player
57 {
58 char name[PATH_MAX];
59 char host[PATH_MAX];
60 void* handle;
61 pthread_t thread;
62 pthread_mutex_t lock;
63 GtkWidget *label_status, *label_state, *label_tc_cur, *label_tc_rem, *label_clip;
64 }
65 omnplay_player_t;
66
67 typedef struct omnplay_instance
68 {
69 GtkWidget *window;
70 GtkWidget *playlist;
71 GtkWidget *library;
72 GtkWidget *buttons[BUTTON_LAST + 1];
73 struct
74 {
75 omnplay_player_t item[MAX_PLAYERS];
76 int count;
77 char path[PATH_MAX];
78 } players;
79 int f_exit;
80 }
81 omnplay_instance_t;
82
83 omnplay_instance_t* omnplay_create(int argc, char** argv);
84 void omnplay_init(omnplay_instance_t* app);
85 void omnplay_release(omnplay_instance_t* app);
86 void omnplay_destroy(omnplay_instance_t* app);
87
88 #ifdef __cplusplus
89 };
90 #endif /* __cplusplus */
91
92 #endif /* OMNPLAY_H */