-/* audacious.c: conky support for audacious music player
+/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
+ * vim: ts=4 sw=4 noet ai cindent syntax=c
+ *
+ * audacious.c: conky support for audacious music player
*
* Copyright (C) 2005-2007 Philip Kovacs pkovacs@users.sourceforge.net
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
- * USA. */
+ * USA.
+ *
+ */
#include "config.h"
#include "conky.h"
/* -----------------------------------------
* Conky update function for audacious data.
* ----------------------------------------- */
-void update_audacious(void)
+int update_audacious(void)
{
/* The worker thread is updating audacious_items array asynchronously
* to the main conky thread.
* structure when the main thread's update cycle fires. */
if (!info.audacious.p_timed_thread) {
if (create_audacious_thread() != 0) {
- CRIT_ERR("unable to create audacious thread!");
+ CRIT_ERR(NULL, NULL, "unable to create audacious thread!");
}
timed_thread_register(info.audacious.p_timed_thread,
&info.audacious.p_timed_thread);
timed_thread_lock(info.audacious.p_timed_thread);
memcpy(&info.audacious.items, audacious_items, sizeof(audacious_items));
timed_thread_unlock(info.audacious.p_timed_thread);
+ return 0;
}
/* ---------------------------------------------------------
g_type_init();
connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
if (!connection) {
- CRIT_ERR("unable to establish dbus connection");
+ CRIT_ERR(NULL, NULL, "unable to establish dbus connection");
}
session = dbus_g_proxy_new_for_name(connection, AUDACIOUS_DBUS_SERVICE,
AUDACIOUS_DBUS_PATH, AUDACIOUS_DBUS_INTERFACE);
if (!session) {
- CRIT_ERR("unable to create dbus proxy");
+ CRIT_ERR(NULL, NULL, "unable to create dbus proxy");
}
#endif /* AUDACIOUS_LEGACY */
/* Main volume */
vol = audacious_remote_get_main_volume(session);
snprintf(items[AUDACIOUS_MAIN_VOLUME],
- sizeof(items[AUDACIOUS_MAIN_VOLUME]) - 1, "%d", vol);
+ sizeof(items[AUDACIOUS_MAIN_VOLUME]) - 1, "%d", vol);
} while (0);
/* Deliver the refreshed items array to audacious_items. */