0
|
1 /* BMP - Cross-platform multimedia player
|
|
2 * Copyright (C) 2003-2004 BMP development team.
|
|
3 *
|
|
4 * Based on XMMS:
|
|
5 * Copyright (C) 1998-2003 XMMS development team.
|
|
6 *
|
|
7 * This program is free software; you can redistribute it and/or modify
|
|
8 * it under the terms of the GNU General Public License as published by
|
|
9 * the Free Software Foundation; either version 2 of the License, or
|
|
10 * (at your option) any later version.
|
|
11 *
|
|
12 * This program is distributed in the hope that it will be useful,
|
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 * GNU General Public License for more details.
|
|
16 *
|
|
17 * You should have received a copy of the GNU General Public License
|
|
18 * along with this program; if not, write to the Free Software
|
|
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
20 */
|
|
21
|
|
22 #ifndef CONTROLSOCKET_H
|
|
23 #define CONTROLSOCKET_H
|
|
24
|
|
25 #include <glib.h>
|
|
26
|
|
27 #define XMMS_PROTOCOL_VERSION 1
|
|
28
|
|
29 #define CTRLSOCKET_NAME "xmms"
|
|
30 #define CTRLSOCKET_IO_TIMEOUT_USEC 100000
|
|
31
|
|
32 enum {
|
|
33 CMD_GET_VERSION, CMD_PLAYLIST_ADD, CMD_PLAY, CMD_PAUSE, CMD_STOP,
|
|
34 CMD_IS_PLAYING, CMD_IS_PAUSED, CMD_GET_PLAYLIST_POS,
|
|
35 CMD_SET_PLAYLIST_POS, CMD_GET_PLAYLIST_LENGTH, CMD_PLAYLIST_CLEAR,
|
|
36 CMD_GET_OUTPUT_TIME, CMD_JUMP_TO_TIME, CMD_GET_VOLUME,
|
|
37 CMD_SET_VOLUME, CMD_GET_SKIN, CMD_SET_SKIN, CMD_GET_PLAYLIST_FILE,
|
|
38 CMD_GET_PLAYLIST_TITLE, CMD_GET_PLAYLIST_TIME, CMD_GET_INFO,
|
|
39 CMD_GET_EQ_DATA, CMD_SET_EQ_DATA, CMD_PL_WIN_TOGGLE,
|
|
40 CMD_EQ_WIN_TOGGLE, CMD_SHOW_PREFS_BOX, CMD_TOGGLE_AOT,
|
|
41 CMD_SHOW_ABOUT_BOX, CMD_EJECT, CMD_PLAYLIST_PREV, CMD_PLAYLIST_NEXT,
|
|
42 CMD_PING, CMD_GET_BALANCE, CMD_TOGGLE_REPEAT, CMD_TOGGLE_SHUFFLE,
|
|
43 CMD_MAIN_WIN_TOGGLE, CMD_PLAYLIST_ADD_URL_STRING,
|
|
44 CMD_IS_EQ_WIN, CMD_IS_PL_WIN, CMD_IS_MAIN_WIN, CMD_PLAYLIST_DELETE,
|
|
45 CMD_IS_REPEAT, CMD_IS_SHUFFLE,
|
|
46 CMD_GET_EQ, CMD_GET_EQ_PREAMP, CMD_GET_EQ_BAND,
|
|
47 CMD_SET_EQ, CMD_SET_EQ_PREAMP, CMD_SET_EQ_BAND,
|
|
48 CMD_QUIT, CMD_PLAYLIST_INS_URL_STRING, CMD_PLAYLIST_INS, CMD_PLAY_PAUSE,
|
|
49 CMD_PLAYQUEUE_ADD, CMD_GET_PLAYQUEUE_LENGTH, CMD_PLAYQUEUE_REMOVE,
|
|
50 CMD_TOGGLE_ADVANCE, CMD_IS_ADVANCE,
|
|
51 CMD_ACTIVATE
|
|
52 };
|
|
53
|
|
54
|
|
55 typedef struct {
|
|
56 guint16 version;
|
|
57 guint16 command;
|
|
58 guint32 data_length;
|
|
59 } ClientPktHeader;
|
|
60
|
|
61 typedef struct {
|
|
62 guint16 version;
|
|
63 guint32 data_length;
|
|
64 } ServerPktHeader;
|
|
65
|
|
66 typedef struct {
|
|
67 ClientPktHeader hdr;
|
|
68 gpointer data;
|
|
69 gint fd;
|
|
70 } PacketNode;
|
|
71
|
|
72
|
|
73 gboolean ctrlsocket_setup(void);
|
|
74 void ctrlsocket_start(void);
|
|
75 void ctrlsocket_check(void);
|
|
76 void ctrlsocket_cleanup(void);
|
|
77 gint ctrlsocket_get_session_id(void);
|
|
78
|
|
79 #endif
|