79eddc563e027cc0c78d993e4edfcc87b40ccd4d
[monky] / src / audacious.h
1 /* audacious.h:  conky support for audacious music player
2  *
3  * Copyright (C) 2005-2007 Philip Kovacs pkovacs@users.sourceforge.net
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
18  * USA.
19  *
20  * vim: ts=4 sw=4 noet ai cindent syntax=c
21  *
22  */
23
24 #ifndef AUDACIOUS_H
25 #define AUDACIOUS_H
26
27 #include "timed_thread.h"
28
29 enum _audacious_items {
30         AUDACIOUS_STATUS = 0,
31         AUDACIOUS_TITLE,
32         AUDACIOUS_LENGTH,
33         AUDACIOUS_LENGTH_SECONDS,
34         AUDACIOUS_POSITION,
35         AUDACIOUS_POSITION_SECONDS,
36         AUDACIOUS_BITRATE,
37         AUDACIOUS_FREQUENCY,
38         AUDACIOUS_CHANNELS,
39         AUDACIOUS_FILENAME,
40         AUDACIOUS_PLAYLIST_LENGTH,
41         AUDACIOUS_PLAYLIST_POSITION,
42         AUDACIOUS_MAIN_VOLUME,
43 };
44
45 /* 12 slots for the audacious values */
46 typedef char audacious_t[13][128];
47
48 /* type for data exchange with main thread */
49 typedef struct audacious_s {
50   audacious_t items;  /* e.g. items[AUDACIOUS_STATUS] */
51   int max_title_len;  /* e.g. ${audacious_title 50} */
52   timed_thread *p_timed_thread;
53 } AUDACIOUS_S;
54
55 /* create a worker thread for audacious media player status */
56 int create_audacious_thread(void);
57
58 /* destroy audacious media player worker thread */
59 int destroy_audacious_thread(void);
60
61 /* Service routine for the conky main thread */
62 void update_audacious(void);
63
64 /* Thread functions */
65 void *audacious_thread_func(void *);
66
67 #endif