mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-02-09 15:38:38 +00:00
Let cmake check whether to build for old or new audacious
This commit is contained in:
parent
4d157a298b
commit
e918ea4655
@ -119,11 +119,6 @@ if(BUILD_LUA)
|
|||||||
endif(BUILD_LUA)
|
endif(BUILD_LUA)
|
||||||
|
|
||||||
option(BUILD_AUDACIOUS "Build audacious (music player) support" false)
|
option(BUILD_AUDACIOUS "Build audacious (music player) support" false)
|
||||||
if(BUILD_AUDACIOUS)
|
|
||||||
option(BUILD_AUDACIOUS_LEGACY "Use legacy audacious (music player) support" false)
|
|
||||||
else(BUILD_AUDACIOUS)
|
|
||||||
set(BUILD_AUDACIOUS_LEGACY false)
|
|
||||||
endif(BUILD_AUDACIOUS)
|
|
||||||
|
|
||||||
option(BUILD_BMPX "Build BMPx (music player) support" false)
|
option(BUILD_BMPX "Build BMPx (music player) support" false)
|
||||||
|
|
||||||
|
@ -234,15 +234,14 @@ endif(BUILD_LUA)
|
|||||||
|
|
||||||
if(BUILD_AUDACIOUS)
|
if(BUILD_AUDACIOUS)
|
||||||
set(WANT_GLIB true)
|
set(WANT_GLIB true)
|
||||||
if(NOT BUILD_AUDACIOUS_LEGACY)
|
pkg_check_modules(NEW_AUDACIOUS audacious>=1.4.0)
|
||||||
pkg_check_modules(AUDACIOUS REQUIRED audacious>=1.4.0 audclient>=1.4.0 dbus-glib-1 gobject-2.0)
|
if(NEW_AUDACIOUS_FOUND)
|
||||||
set(conky_libs ${conky_libs} ${AUDACIOUS_LIBRARIES})
|
pkg_check_modules(AUDACIOUS REQUIRED audclient>=1.4.0)
|
||||||
set(conky_includes ${conky_includes} ${AUDACIOUS_INCLUDE_DIRS})
|
else(NEW_AUDACIOUS_FOUND)
|
||||||
else(NOT BUILD_AUDACIOUS_LEGACY)
|
|
||||||
pkg_check_modules(AUDACIOUS REQUIRED audacious<1.4.0)
|
pkg_check_modules(AUDACIOUS REQUIRED audacious<1.4.0)
|
||||||
set(conky_libs ${conky_libs} ${AUDACIOUS_LIBRARIES})
|
endif(NEW_AUDACIOUS_FOUND)
|
||||||
set(conky_includes ${conky_includes} ${AUDACIOUS_INCLUDE_DIRS})
|
set(conky_libs ${conky_libs} ${AUDACIOUS_LIBRARIES})
|
||||||
endif(NOT BUILD_AUDACIOUS_LEGACY)
|
set(conky_includes ${conky_includes} ${AUDACIOUS_INCLUDE_DIRS})
|
||||||
endif(BUILD_AUDACIOUS)
|
endif(BUILD_AUDACIOUS)
|
||||||
|
|
||||||
if(BUILD_BMPX)
|
if(BUILD_BMPX)
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#cmakedefine BUILD_AUDACIOUS 1
|
#cmakedefine BUILD_AUDACIOUS 1
|
||||||
|
|
||||||
#cmakedefine BUILD_AUDACIOUS_LEGACY 1
|
#cmakedefine NEW_AUDACIOUS_FOUND 1
|
||||||
|
|
||||||
#cmakedefine BUILD_MPD 1
|
#cmakedefine BUILD_MPD 1
|
||||||
|
|
||||||
|
@ -29,11 +29,11 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#ifndef BUILD_AUDACIOUS_LEGACY
|
#ifdef NEW_AUDACIOUS_FOUND
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
#include <audacious/audctrl.h>
|
#include <audacious/audctrl.h>
|
||||||
#include <audacious/dbus.h>
|
#include <audacious/dbus.h>
|
||||||
#else /* BUILD_AUDACIOUS_LEGACY */
|
#else /* NEW_AUDACIOUS_FOUND */
|
||||||
#include <audacious/beepctrl.h>
|
#include <audacious/beepctrl.h>
|
||||||
#define audacious_remote_is_running(x) \
|
#define audacious_remote_is_running(x) \
|
||||||
xmms_remote_is_running(x)
|
xmms_remote_is_running(x)
|
||||||
@ -55,7 +55,7 @@
|
|||||||
xmms_remote_get_playlist_file(x, y)
|
xmms_remote_get_playlist_file(x, y)
|
||||||
#define audacious_remote_get_playlist_length(x) \
|
#define audacious_remote_get_playlist_length(x) \
|
||||||
xmms_remote_get_playlist_length(x)
|
xmms_remote_get_playlist_length(x)
|
||||||
#endif /* BUILD_AUDACIOUS_LEGACY */
|
#endif /* NEW_AUDACIOUS_FOUND */
|
||||||
|
|
||||||
/* access to this item array is synchronized */
|
/* access to this item array is synchronized */
|
||||||
static audacious_t audacious_items;
|
static audacious_t audacious_items;
|
||||||
@ -125,7 +125,7 @@ void audacious_thread_func(thread_handle &handle)
|
|||||||
gint rate, freq, chans, vol;
|
gint rate, freq, chans, vol;
|
||||||
gchar *psong, *pfilename;
|
gchar *psong, *pfilename;
|
||||||
|
|
||||||
#ifndef BUILD_AUDACIOUS_LEGACY
|
#ifdef NEW_AUDACIOUS_FOUND
|
||||||
DBusGProxy *session = NULL;
|
DBusGProxy *session = NULL;
|
||||||
DBusGConnection *connection = NULL;
|
DBusGConnection *connection = NULL;
|
||||||
#else
|
#else
|
||||||
@ -136,7 +136,7 @@ void audacious_thread_func(thread_handle &handle)
|
|||||||
psong = NULL;
|
psong = NULL;
|
||||||
pfilename = NULL;
|
pfilename = NULL;
|
||||||
|
|
||||||
#ifndef BUILD_AUDACIOUS_LEGACY
|
#ifdef NEW_AUDACIOUS_FOUND
|
||||||
g_type_init();
|
g_type_init();
|
||||||
connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
|
connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
|
||||||
if (!connection) {
|
if (!connection) {
|
||||||
@ -147,7 +147,7 @@ void audacious_thread_func(thread_handle &handle)
|
|||||||
if (!session) {
|
if (!session) {
|
||||||
CRIT_ERR(NULL, NULL, "unable to create dbus proxy");
|
CRIT_ERR(NULL, NULL, "unable to create dbus proxy");
|
||||||
}
|
}
|
||||||
#endif /* BUILD_AUDACIOUS_LEGACY */
|
#endif /* NEW_AUDACIOUS_FOUND */
|
||||||
|
|
||||||
/* Loop until the main thread resets the runnable signal. */
|
/* Loop until the main thread resets the runnable signal. */
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -242,7 +242,7 @@ void audacious_thread_func(thread_handle &handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (handle.test(0)) {
|
if (handle.test(0)) {
|
||||||
#ifndef BUILD_AUDACIOUS_LEGACY
|
#ifdef NEW_AUDACIOUS_FOUND
|
||||||
/* release reference to dbus proxy */
|
/* release reference to dbus proxy */
|
||||||
g_object_unref(session);
|
g_object_unref(session);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user