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