Rename edbus -> eldbus
This commit is contained in:
parent
9be61b67d4
commit
d998136966
|
@ -64,7 +64,7 @@ AM_GNU_GETTEXT_VERSION([0.12.1])
|
||||||
AM_GNU_GETTEXT([external])
|
AM_GNU_GETTEXT([external])
|
||||||
|
|
||||||
PKG_CHECK_MODULES([ECORE], [ecore])
|
PKG_CHECK_MODULES([ECORE], [ecore])
|
||||||
PKG_CHECK_MODULES([EDBUS], [edbus2])
|
PKG_CHECK_MODULES([ELDBUS], [eldbus])
|
||||||
PKG_CHECK_MODULES([EFL], [ecore-file eina evas ecore-evas edje])
|
PKG_CHECK_MODULES([EFL], [ecore-file eina evas ecore-evas edje])
|
||||||
PKG_CHECK_MODULES([ELEMENTARY], [elementary])
|
PKG_CHECK_MODULES([ELEMENTARY], [elementary])
|
||||||
PKG_CHECK_MODULES([EMOTION], [emotion])
|
PKG_CHECK_MODULES([EMOTION], [emotion])
|
||||||
|
|
|
@ -13,7 +13,7 @@ INCLUDES = \
|
||||||
@EMOTION_CFLAGS@ \
|
@EMOTION_CFLAGS@ \
|
||||||
@LMS_CFLAGS@ \
|
@LMS_CFLAGS@ \
|
||||||
@SQLITE3_CFLAGS@ \
|
@SQLITE3_CFLAGS@ \
|
||||||
@EDBUS_CFLAGS@
|
@ELDBUS_CFLAGS@
|
||||||
|
|
||||||
bin_PROGRAMS = enjoy
|
bin_PROGRAMS = enjoy
|
||||||
if BUILD_QUICKLAUNCH
|
if BUILD_QUICKLAUNCH
|
||||||
|
@ -27,7 +27,7 @@ PREFS_PLUGINS = \
|
||||||
preferences_db_folder_add.c \
|
preferences_db_folder_add.c \
|
||||||
preferences_db_optimize.c
|
preferences_db_optimize.c
|
||||||
|
|
||||||
enjoy_LDADD = @ELEMENTARY_LIBS@ @EFL_LIBS@ @ECORE_LIBS@ @EMOTION_LIBS@ @LMS_LIBS@ @SQLITE3_LIBS@ @EDBUS_LIBS@
|
enjoy_LDADD = @ELEMENTARY_LIBS@ @EFL_LIBS@ @ECORE_LIBS@ @EMOTION_LIBS@ @LMS_LIBS@ @SQLITE3_LIBS@ @ELDBUS_LIBS@
|
||||||
enjoy_CFLAGS = -rdynamic
|
enjoy_CFLAGS = -rdynamic
|
||||||
enjoy_SOURCES = main.c win.c db.c list.c page.c cover.c nowplaying.c preferences.c $(PREFS_PLUGINS) dbus.c
|
enjoy_SOURCES = main.c win.c db.c list.c page.c cover.c nowplaying.c preferences.c $(PREFS_PLUGINS) dbus.c
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ if BUILD_QUICKLAUNCH
|
||||||
enjoy_qldir = $(quicklauncher_libdir)
|
enjoy_qldir = $(quicklauncher_libdir)
|
||||||
enjoy_ql_LTLIBRARIES = enjoy_ql.la
|
enjoy_ql_LTLIBRARIES = enjoy_ql.la
|
||||||
enjoy_ql_la_SOURCES = main.c win.c db.c list.c page.c cover.c nowplaying.c preferences.c $(PREFS_PLUGINS) dbus.c
|
enjoy_ql_la_SOURCES = main.c win.c db.c list.c page.c cover.c nowplaying.c preferences.c $(PREFS_PLUGINS) dbus.c
|
||||||
enjoy_ql_la_LIBADD = @ELEMENTARY_LIBS@ @EFL_LIBS@ @ECORE_LIBS@ @EMOTION_LIBS@ @LMS_LIBS@ @SQLITE3_LIBS@ @EDBUS_LIBS@
|
enjoy_ql_la_LIBADD = @ELEMENTARY_LIBS@ @EFL_LIBS@ @ECORE_LIBS@ @EMOTION_LIBS@ @LMS_LIBS@ @SQLITE3_LIBS@ @ELDBUS_LIBS@
|
||||||
enjoy_ql_la_CFLAGS =
|
enjoy_ql_la_CFLAGS =
|
||||||
enjoy_ql_la_LDFLAGS = -module -avoid-version -no-undefined
|
enjoy_ql_la_LDFLAGS = -module -avoid-version -no-undefined
|
||||||
enjoy_ql_SOURCES = main.c
|
enjoy_ql_SOURCES = main.c
|
||||||
|
|
|
@ -3,72 +3,72 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "private.h"
|
#include "private.h"
|
||||||
#include <EDBus.h>
|
#include <Eldbus.h>
|
||||||
|
|
||||||
#define DBUS_NAME "org.enlightenment.enjoy"
|
#define DBUS_NAME "org.enlightenment.enjoy"
|
||||||
#define DBUS_IFACE "org.enlightenment.enjoy.Control"
|
#define DBUS_IFACE "org.enlightenment.enjoy.Control"
|
||||||
#define DBUS_PATH "/org/enlightenment/enjoy/Control"
|
#define DBUS_PATH "/org/enlightenment/enjoy/Control"
|
||||||
|
|
||||||
static EDBus_Connection *conn;
|
static Eldbus_Connection *conn;
|
||||||
static EDBus_Service_Interface *control;
|
static Eldbus_Service_Interface *control;
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_cb_dbus_quit(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_cb_dbus_quit(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
enjoy_quit();
|
enjoy_quit();
|
||||||
return edbus_message_method_return_new(msg);
|
return eldbus_message_method_return_new(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_cb_dbus_version(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_cb_dbus_version(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
EDBus_Message *reply = edbus_message_method_return_new(msg);
|
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
|
||||||
uint16_t aj = VMAJ, in = VMIN, ic = VMIC;
|
uint16_t aj = VMAJ, in = VMIN, ic = VMIC;
|
||||||
edbus_message_arguments_append(reply, "qqq", aj, in, ic);
|
eldbus_message_arguments_append(reply, "qqq", aj, in, ic);
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Avoid duplicating MPRIS -- see src/plugins/mpris */
|
/* Avoid duplicating MPRIS -- see src/plugins/mpris */
|
||||||
static const EDBus_Method control_methods[] = {
|
static const Eldbus_Method control_methods[] = {
|
||||||
{ "Quit", NULL, NULL, _cb_dbus_quit, 0 },
|
{ "Quit", NULL, NULL, _cb_dbus_quit, 0 },
|
||||||
{
|
{
|
||||||
"Version", NULL, EDBUS_ARGS({"q", ""}, {"q", ""}, {"q", ""}),
|
"Version", NULL, ELDBUS_ARGS({"q", ""}, {"q", ""}, {"q", ""}),
|
||||||
_cb_dbus_version, 0
|
_cb_dbus_version, 0
|
||||||
},
|
},
|
||||||
/* TODO: DB management */
|
/* TODO: DB management */
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Service_Interface_Desc desc = {
|
static const Eldbus_Service_Interface_Desc desc = {
|
||||||
DBUS_IFACE, control_methods
|
DBUS_IFACE, control_methods
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_cb_dbus_request_name(void *data __UNUSED__, const EDBus_Message *msg, EDBus_Pending *pending__UNUSED__)
|
_cb_dbus_request_name(void *data __UNUSED__, const Eldbus_Message *msg, Eldbus_Pending *pending__UNUSED__)
|
||||||
{
|
{
|
||||||
const char *error_name, *error_txt;
|
const char *error_name, *error_txt;
|
||||||
unsigned flag;
|
unsigned flag;
|
||||||
|
|
||||||
if (edbus_message_error_get(msg, &error_name, &error_txt))
|
if (eldbus_message_error_get(msg, &error_name, &error_txt))
|
||||||
{
|
{
|
||||||
ERR("Error %s %s", error_name, error_txt);
|
ERR("Error %s %s", error_name, error_txt);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!edbus_message_arguments_get(msg, "u", &flag))
|
if (!eldbus_message_arguments_get(msg, "u", &flag))
|
||||||
{
|
{
|
||||||
ERR("Error getting arguments.");
|
ERR("Error getting arguments.");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag != EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
|
if (flag != ELDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
|
||||||
{
|
{
|
||||||
ERR("Bus name in use by another application.");
|
ERR("Bus name in use by another application.");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
INF("Got DBus name - unique instance running.");
|
INF("Got DBus name - unique instance running.");
|
||||||
control = edbus_service_interface_register(conn, DBUS_PATH, &desc);
|
control = eldbus_service_interface_register(conn, DBUS_PATH, &desc);
|
||||||
|
|
||||||
/* will run after other events run, in the main loop */
|
/* will run after other events run, in the main loop */
|
||||||
ecore_event_add(ENJOY_EVENT_STARTED, NULL, NULL, NULL);
|
ecore_event_add(ENJOY_EVENT_STARTED, NULL, NULL, NULL);
|
||||||
|
@ -81,15 +81,15 @@ end:
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
enjoy_dbus_init(void)
|
enjoy_dbus_init(void)
|
||||||
{
|
{
|
||||||
edbus_init();
|
eldbus_init();
|
||||||
conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
|
conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
|
||||||
if (!conn)
|
if (!conn)
|
||||||
{
|
{
|
||||||
ERR("Could not get DBus session bus");
|
ERR("Could not get DBus session bus");
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
edbus_name_request(conn, DBUS_NAME, EDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
|
eldbus_name_request(conn, DBUS_NAME, ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
|
||||||
_cb_dbus_request_name, NULL);
|
_cb_dbus_request_name, NULL);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -98,10 +98,10 @@ void
|
||||||
enjoy_dbus_shutdown(void)
|
enjoy_dbus_shutdown(void)
|
||||||
{
|
{
|
||||||
if (control)
|
if (control)
|
||||||
edbus_service_interface_unregister(control);
|
eldbus_service_interface_unregister(control);
|
||||||
if (conn)
|
if (conn)
|
||||||
edbus_connection_unref(conn);
|
eldbus_connection_unref(conn);
|
||||||
edbus_shutdown();
|
eldbus_shutdown();
|
||||||
conn = NULL;
|
conn = NULL;
|
||||||
control = NULL;
|
control = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#include <Ecore_Getopt.h>
|
#include <Ecore_Getopt.h>
|
||||||
#include <Ecore_File.h>
|
#include <Ecore_File.h>
|
||||||
#include <EDBus.h>
|
#include <Eldbus.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
|
|
|
@ -7,12 +7,12 @@ INCLUDES = \
|
||||||
-DLIBRARY_DIR=\"$(libdir)\" \
|
-DLIBRARY_DIR=\"$(libdir)\" \
|
||||||
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
|
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
|
||||||
-DLOCALEDIR=\"$(localedir)\" \
|
-DLOCALEDIR=\"$(localedir)\" \
|
||||||
@EDBUS_CFLAGS@ \
|
@ELDBUS_CFLAGS@ \
|
||||||
@EFL_CFLAGS@
|
@EFL_CFLAGS@
|
||||||
|
|
||||||
pkgdir = $(libdir)/enjoy
|
pkgdir = $(libdir)/enjoy
|
||||||
pkg_LTLIBRARIES = fso.la
|
pkg_LTLIBRARIES = fso.la
|
||||||
fso_la_SOURCES = fso.c
|
fso_la_SOURCES = fso.c
|
||||||
fso_la_LIBADD = @EDBUS_LIBS@
|
fso_la_LIBADD = @ELDBUS_LIBS@
|
||||||
fso_la_LDFLAGS = -no-undefined -module -avoid-version
|
fso_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||||
fso_la_LIBTOOLFLAGS = --tag=disable-static
|
fso_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include <Eina.h>
|
#include <Eina.h>
|
||||||
#include <EDBus.h>
|
#include <Eldbus.h>
|
||||||
#include <Ecore.h>
|
#include <Ecore.h>
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ static int _fso_log_domain = -1;
|
||||||
#define FSO_OUSAGED_OBJECT_PATH "/org/freesmartphone/Usage"
|
#define FSO_OUSAGED_OBJECT_PATH "/org/freesmartphone/Usage"
|
||||||
#define FSO_OUSAGED_INTERFACE "org.freesmartphone.Usage"
|
#define FSO_OUSAGED_INTERFACE "org.freesmartphone.Usage"
|
||||||
|
|
||||||
static EDBus_Connection *conn = NULL;
|
static Eldbus_Connection *conn = NULL;
|
||||||
static EDBus_Proxy *proxy = NULL;
|
static Eldbus_Proxy *proxy = NULL;
|
||||||
|
|
||||||
typedef struct _FSO_Cb_Data
|
typedef struct _FSO_Cb_Data
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@ typedef struct _FSO_Cb_Data
|
||||||
} FSO_Cb_Data;
|
} FSO_Cb_Data;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fso_request_resource_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
|
fso_request_resource_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
|
||||||
{
|
{
|
||||||
FSO_Cb_Data *d = data;
|
FSO_Cb_Data *d = data;
|
||||||
Eina_Bool e = EINA_FALSE;
|
Eina_Bool e = EINA_FALSE;
|
||||||
|
@ -49,7 +49,7 @@ fso_request_resource_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pen
|
||||||
|
|
||||||
DBG("Request sent to fsousaged to enable resource.");
|
DBG("Request sent to fsousaged to enable resource.");
|
||||||
|
|
||||||
if (edbus_message_error_get(msg, &error_name, &error_txt))
|
if (eldbus_message_error_get(msg, &error_name, &error_txt))
|
||||||
{
|
{
|
||||||
ERR("Error requesting FSO resource: %s - %s", error_name, error_txt);
|
ERR("Error requesting FSO resource: %s - %s", error_name, error_txt);
|
||||||
e = EINA_TRUE;
|
e = EINA_TRUE;
|
||||||
|
@ -61,7 +61,7 @@ fso_request_resource_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pen
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fso_release_resource_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
|
fso_release_resource_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
|
||||||
{
|
{
|
||||||
FSO_Cb_Data *d = data;
|
FSO_Cb_Data *d = data;
|
||||||
Eina_Bool e = EINA_FALSE;
|
Eina_Bool e = EINA_FALSE;
|
||||||
|
@ -69,7 +69,7 @@ fso_release_resource_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pen
|
||||||
|
|
||||||
DBG("Request sent to fsousaged to disable resource.");
|
DBG("Request sent to fsousaged to disable resource.");
|
||||||
|
|
||||||
if (edbus_message_error_get(msg, &error_name, &error_txt))
|
if (eldbus_message_error_get(msg, &error_name, &error_txt))
|
||||||
{
|
{
|
||||||
ERR("Error releasing FSO resource: %s - %s", error_name, error_txt);
|
ERR("Error releasing FSO resource: %s - %s", error_name, error_txt);
|
||||||
e = EINA_TRUE;
|
e = EINA_TRUE;
|
||||||
|
@ -95,7 +95,7 @@ fso_request_resource(const char *resource, void (*func)(void *data, Eina_Bool er
|
||||||
d->data = (void *)data;
|
d->data = (void *)data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
edbus_proxy_call(proxy, "RequestResource", fso_request_resource_cb, d, -1,
|
eldbus_proxy_call(proxy, "RequestResource", fso_request_resource_cb, d, -1,
|
||||||
"s", resource);
|
"s", resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ fso_release_resource(const char *resource, void (*func)(void *data, Eina_Bool er
|
||||||
d->data = (void *)data;
|
d->data = (void *)data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
edbus_proxy_call(proxy, "RequestResource", fso_release_resource_cb, d, -1,
|
eldbus_proxy_call(proxy, "RequestResource", fso_release_resource_cb, d, -1,
|
||||||
"s", resource);
|
"s", resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ static const Enjoy_Plugin_Api api = {
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
fso_init(void)
|
fso_init(void)
|
||||||
{
|
{
|
||||||
EDBus_Object *obj;
|
Eldbus_Object *obj;
|
||||||
if (_fso_log_domain < 0)
|
if (_fso_log_domain < 0)
|
||||||
{
|
{
|
||||||
_fso_log_domain = eina_log_domain_register
|
_fso_log_domain = eina_log_domain_register
|
||||||
|
@ -170,15 +170,15 @@ fso_init(void)
|
||||||
|
|
||||||
if (conn) return EINA_TRUE;
|
if (conn) return EINA_TRUE;
|
||||||
|
|
||||||
edbus_init();
|
eldbus_init();
|
||||||
conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SYSTEM);
|
conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
|
||||||
if (!conn)
|
if (!conn)
|
||||||
{
|
{
|
||||||
ERR("Could not get DBus session bus");
|
ERR("Could not get DBus session bus");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
obj = edbus_object_get(conn, FSO_OUSAGED_SERVICE, FSO_OUSAGED_OBJECT_PATH);
|
obj = eldbus_object_get(conn, FSO_OUSAGED_SERVICE, FSO_OUSAGED_OBJECT_PATH);
|
||||||
proxy = edbus_proxy_get(obj, FSO_OUSAGED_INTERFACE);
|
proxy = eldbus_proxy_get(obj, FSO_OUSAGED_INTERFACE);
|
||||||
|
|
||||||
enjoy_plugin_register("sys/fso", &api, ENJOY_PLUGIN_PRIORITY_NORMAL);
|
enjoy_plugin_register("sys/fso", &api, ENJOY_PLUGIN_PRIORITY_NORMAL);
|
||||||
|
|
||||||
|
@ -193,14 +193,14 @@ fso_init(void)
|
||||||
static void
|
static void
|
||||||
fso_shutdown(void)
|
fso_shutdown(void)
|
||||||
{
|
{
|
||||||
EDBus_Object *obj;
|
Eldbus_Object *obj;
|
||||||
if (!conn) return;
|
if (!conn) return;
|
||||||
|
|
||||||
obj = edbus_proxy_object_get(proxy);
|
obj = eldbus_proxy_object_get(proxy);
|
||||||
edbus_proxy_unref(proxy);
|
eldbus_proxy_unref(proxy);
|
||||||
edbus_object_unref(obj);
|
eldbus_object_unref(obj);
|
||||||
edbus_connection_unref(conn);
|
eldbus_connection_unref(conn);
|
||||||
edbus_shutdown();
|
eldbus_shutdown();
|
||||||
conn = NULL;
|
conn = NULL;
|
||||||
if (_fso_log_domain >= 0)
|
if (_fso_log_domain >= 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,13 +7,13 @@ INCLUDES = \
|
||||||
-DLIBRARY_DIR=\"$(libdir)\" \
|
-DLIBRARY_DIR=\"$(libdir)\" \
|
||||||
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
|
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
|
||||||
-DLOCALEDIR=\"$(localedir)\" \
|
-DLOCALEDIR=\"$(localedir)\" \
|
||||||
@EDBUS_CFLAGS@ \
|
@ELDBUS_CFLAGS@ \
|
||||||
@ECORE_CFLAGS@ \
|
@ECORE_CFLAGS@ \
|
||||||
@EFL_CFLAGS@
|
@EFL_CFLAGS@
|
||||||
|
|
||||||
pkgdir = $(libdir)/enjoy
|
pkgdir = $(libdir)/enjoy
|
||||||
pkg_LTLIBRARIES = mpris.la
|
pkg_LTLIBRARIES = mpris.la
|
||||||
mpris_la_SOURCES = mpris.c
|
mpris_la_SOURCES = mpris.c
|
||||||
mpris_la_LIBADD = @EDBUS_LIBS@ @ECORE_LIBS@
|
mpris_la_LIBADD = @ELDBUS_LIBS@ @ECORE_LIBS@
|
||||||
mpris_la_LDFLAGS = -no-undefined -module -avoid-version
|
mpris_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||||
mpris_la_LIBTOOLFLAGS = --tag=disable-static
|
mpris_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include <Eina.h>
|
#include <Eina.h>
|
||||||
#include <EDBus.h>
|
#include <Eldbus.h>
|
||||||
#include <Ecore.h>
|
#include <Ecore.h>
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
@ -58,34 +58,34 @@ static void _mpris_signal_player_status_change(int playback, int shuffle, int re
|
||||||
static void _mpris_signal_player_track_change(const Song *song);
|
static void _mpris_signal_player_track_change(const Song *song);
|
||||||
static void _mpris_signal_tracklist_tracklist_change(int size);
|
static void _mpris_signal_tracklist_tracklist_change(int size);
|
||||||
|
|
||||||
static void _mpris_append_dict_entry(EDBus_Message_Iter *array, const char *key, const char *value_type, ...);
|
static void _mpris_append_dict_entry(Eldbus_Message_Iter *array, const char *key, const char *value_type, ...);
|
||||||
static EDBus_Message *_mpris_player_next(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_next(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_player_previous(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_previous(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_player_pause(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_pause(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_player_stop(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_stop(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_player_play(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_play(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_player_seek(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_seek(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_root_identity(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_root_identity(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_root_quit(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_root_quit(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_root_version(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_root_version(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_player_caps_get(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_caps_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_player_volume_set(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_volume_set(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_player_volume_get(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_volume_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_player_repeat_set(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_repeat_set(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_player_status_get(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_status_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_player_position_set(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_position_set(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_player_position_get(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_position_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_song_metadata_reply(const EDBus_Message *msg, const Song *song);
|
static Eldbus_Message *_mpris_song_metadata_reply(const Eldbus_Message *msg, const Song *song);
|
||||||
static EDBus_Message *_mpris_player_metadata_get(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_player_metadata_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_tracklist_current_track_get(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_tracklist_current_track_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_tracklist_count(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_tracklist_count(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_tracklist_metadata_get(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_tracklist_metadata_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
static EDBus_Message *_mpris_tracklist_shuffle_set(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
|
static Eldbus_Message *_mpris_tracklist_shuffle_set(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||||
|
|
||||||
static void _cb_dbus_request_name(void *data, const EDBus_Message *msg, EDBus_Pending *pending);
|
static void _cb_dbus_request_name(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending);
|
||||||
|
|
||||||
static EDBus_Connection *conn = NULL;
|
static Eldbus_Connection *conn = NULL;
|
||||||
static EDBus_Service_Interface *root, *player, *tracklist;
|
static Eldbus_Service_Interface *root, *player, *tracklist;
|
||||||
static Eina_List *ev_handlers = NULL;
|
static Eina_List *ev_handlers = NULL;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -95,13 +95,13 @@ enum
|
||||||
PLAYER_CAPS
|
PLAYER_CAPS
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Signal mpris_player_signals[] = {
|
static const Eldbus_Signal mpris_player_signals[] = {
|
||||||
/* Emitted whenever a new song is played; gives the song metadata */
|
/* Emitted whenever a new song is played; gives the song metadata */
|
||||||
[PLAYER_TRACK] = { "TrackChange", EDBUS_ARGS({"a{sv}", ""}), 0 },
|
[PLAYER_TRACK] = { "TrackChange", ELDBUS_ARGS({"a{sv}", ""}), 0 },
|
||||||
/* Emitted whenever player's status changes */
|
/* Emitted whenever player's status changes */
|
||||||
[PLAYER_STATUS] = { "StatusChange", EDBUS_ARGS({"(iiii)", ""}), 0 },
|
[PLAYER_STATUS] = { "StatusChange", ELDBUS_ARGS({"(iiii)", ""}), 0 },
|
||||||
/* Emitted whenever player's capabilities changes */
|
/* Emitted whenever player's capabilities changes */
|
||||||
[PLAYER_CAPS] = { "CapsChange", EDBUS_ARGS({"i", ""}), 0 },
|
[PLAYER_CAPS] = { "CapsChange", ELDBUS_ARGS({"i", ""}), 0 },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -110,27 +110,27 @@ enum
|
||||||
TRACK_LIST = 0,
|
TRACK_LIST = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Signal mpris_tracklist_signals[] = {
|
static const Eldbus_Signal mpris_tracklist_signals[] = {
|
||||||
/* Emitted whenever the tracklist changes; gives the number of items */
|
/* Emitted whenever the tracklist changes; gives the number of items */
|
||||||
[TRACK_LIST] = { "TrackListChange", EDBUS_ARGS({"i", ""}), 0 },
|
[TRACK_LIST] = { "TrackListChange", ELDBUS_ARGS({"i", ""}), 0 },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Method mpris_root_methods[] = {
|
static const Eldbus_Method mpris_root_methods[] = {
|
||||||
/* Returns a string representing the player name */
|
/* Returns a string representing the player name */
|
||||||
{
|
{
|
||||||
"Identity", NULL, EDBUS_ARGS({"s", "name"}), _mpris_root_identity, 0
|
"Identity", NULL, ELDBUS_ARGS({"s", "name"}), _mpris_root_identity, 0
|
||||||
},
|
},
|
||||||
/* Quits the player */
|
/* Quits the player */
|
||||||
{ "Quit", NULL, NULL, _mpris_root_quit, 0 },
|
{ "Quit", NULL, NULL, _mpris_root_quit, 0 },
|
||||||
/* Returns a tuple containing the version of MPRIS protocol implemented */
|
/* Returns a tuple containing the version of MPRIS protocol implemented */
|
||||||
{
|
{
|
||||||
"MprisVersion", NULL, EDBUS_ARGS({"(qq)", ""}), _mpris_root_version, 0
|
"MprisVersion", NULL, ELDBUS_ARGS({"(qq)", ""}), _mpris_root_version, 0
|
||||||
},
|
},
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Method mpris_player_methods[] = {
|
static const Eldbus_Method mpris_player_methods[] = {
|
||||||
/* Goes to the next song */
|
/* Goes to the next song */
|
||||||
{
|
{
|
||||||
"Next", NULL, NULL, _mpris_player_next, 0
|
"Next", NULL, NULL, _mpris_player_next, 0
|
||||||
|
@ -153,68 +153,68 @@ static const EDBus_Method mpris_player_methods[] = {
|
||||||
},
|
},
|
||||||
/* Seek the current song by given miliseconds */
|
/* Seek the current song by given miliseconds */
|
||||||
{
|
{
|
||||||
"Seek", EDBUS_ARGS({"x", "time"}), NULL, _mpris_player_seek, 0
|
"Seek", ELDBUS_ARGS({"x", "time"}), NULL, _mpris_player_seek, 0
|
||||||
},
|
},
|
||||||
/* Toggle the current track repeat */
|
/* Toggle the current track repeat */
|
||||||
{
|
{
|
||||||
"Repeat", EDBUS_ARGS({"b", ""}), NULL, _mpris_player_repeat_set, 0
|
"Repeat", ELDBUS_ARGS({"b", ""}), NULL, _mpris_player_repeat_set, 0
|
||||||
},
|
},
|
||||||
/* Return the status of the media player */
|
/* Return the status of the media player */
|
||||||
{
|
{
|
||||||
"GetStatus", NULL, EDBUS_ARGS({"(iiii)", ""}), _mpris_player_status_get, 0
|
"GetStatus", NULL, ELDBUS_ARGS({"(iiii)", ""}), _mpris_player_status_get, 0
|
||||||
},
|
},
|
||||||
/* Gets all the metadata for the currently played element */
|
/* Gets all the metadata for the currently played element */
|
||||||
{
|
{
|
||||||
"GetMetadata", NULL, EDBUS_ARGS({"a{sv}", "data"}),
|
"GetMetadata", NULL, ELDBUS_ARGS({"a{sv}", "data"}),
|
||||||
_mpris_player_metadata_get, 0
|
_mpris_player_metadata_get, 0
|
||||||
},
|
},
|
||||||
/* Returns the media player's current capabilities */
|
/* Returns the media player's current capabilities */
|
||||||
{
|
{
|
||||||
"GetCaps", NULL, EDBUS_ARGS({"i", ""}), _mpris_player_caps_get, 0
|
"GetCaps", NULL, ELDBUS_ARGS({"i", ""}), _mpris_player_caps_get, 0
|
||||||
},
|
},
|
||||||
/* Sets the volume */
|
/* Sets the volume */
|
||||||
{
|
{
|
||||||
"VolumeSet", EDBUS_ARGS({"i", ""}), NULL, _mpris_player_volume_set, 0
|
"VolumeSet", ELDBUS_ARGS({"i", ""}), NULL, _mpris_player_volume_set, 0
|
||||||
},
|
},
|
||||||
/* Gets the current volume */
|
/* Gets the current volume */
|
||||||
{
|
{
|
||||||
"VolumeGet", NULL, EDBUS_ARGS({"i", ""}), _mpris_player_volume_get, 0
|
"VolumeGet", NULL, ELDBUS_ARGS({"i", ""}), _mpris_player_volume_get, 0
|
||||||
},
|
},
|
||||||
/* Sets the playing position (in ms) */
|
/* Sets the playing position (in ms) */
|
||||||
{
|
{
|
||||||
"PositionSet", EDBUS_ARGS({"i", ""}), NULL, _mpris_player_position_set, 0
|
"PositionSet", ELDBUS_ARGS({"i", ""}), NULL, _mpris_player_position_set, 0
|
||||||
},
|
},
|
||||||
/* Gets the playing position (in ms) */
|
/* Gets the playing position (in ms) */
|
||||||
{
|
{
|
||||||
"PositionGet", NULL, EDBUS_ARGS({"i", ""}), _mpris_player_position_get, 0
|
"PositionGet", NULL, ELDBUS_ARGS({"i", ""}), _mpris_player_position_get, 0
|
||||||
},
|
},
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Method mpris_tracklist_methods[] = {
|
static const Eldbus_Method mpris_tracklist_methods[] = {
|
||||||
/* Gives all the metadata available at the given position in the track list */
|
/* Gives all the metadata available at the given position in the track list */
|
||||||
{
|
{
|
||||||
"GetMetadata", EDBUS_ARGS({"i", ""}), EDBUS_ARGS({"a{sv}", ""}),
|
"GetMetadata", ELDBUS_ARGS({"i", ""}), ELDBUS_ARGS({"a{sv}", ""}),
|
||||||
_mpris_tracklist_metadata_get, 0
|
_mpris_tracklist_metadata_get, 0
|
||||||
},
|
},
|
||||||
/* Returns the position of the current URI in the track list */
|
/* Returns the position of the current URI in the track list */
|
||||||
{
|
{
|
||||||
"GetCurrentTrack", NULL, EDBUS_ARGS({"i", ""}),
|
"GetCurrentTrack", NULL, ELDBUS_ARGS({"i", ""}),
|
||||||
_mpris_tracklist_current_track_get, 0
|
_mpris_tracklist_current_track_get, 0
|
||||||
},
|
},
|
||||||
/* Returns the number of elements in the track list */
|
/* Returns the number of elements in the track list */
|
||||||
{
|
{
|
||||||
"GetLength", NULL, EDBUS_ARGS({"i", ""}), _mpris_tracklist_count, 0
|
"GetLength", NULL, ELDBUS_ARGS({"i", ""}), _mpris_tracklist_count, 0
|
||||||
},
|
},
|
||||||
/* Appends an URI to the track list */
|
/* Appends an URI to the track list */
|
||||||
/*{ "AddTrack", EDBUS_ARGS({"sb", ""}), EDBUS_ARGS({"i", ""}), NULL, 0 },*/
|
/*{ "AddTrack", ELDBUS_ARGS({"sb", ""}), ELDBUS_ARGS({"i", ""}), NULL, 0 },*/
|
||||||
/* Removes an URL from the track list */
|
/* Removes an URL from the track list */
|
||||||
/*{ "DelTrack", EDBUS_ARGS({"i", ""}), NULL, NULL, 0 },*/
|
/*{ "DelTrack", ELDBUS_ARGS({"i", ""}), NULL, NULL, 0 },*/
|
||||||
/* Toggle playlist loop */
|
/* Toggle playlist loop */
|
||||||
/*{ "SetLoop", EDBUS_ARGS({"b", ""}), NULL, NULL, 0 },*/
|
/*{ "SetLoop", ELDBUS_ARGS({"b", ""}), NULL, NULL, 0 },*/
|
||||||
/* Toggle playlist shuffle/random */
|
/* Toggle playlist shuffle/random */
|
||||||
{
|
{
|
||||||
"SetRandom", EDBUS_ARGS({"b", ""}), NULL, _mpris_tracklist_shuffle_set, 0
|
"SetRandom", ELDBUS_ARGS({"b", ""}), NULL, _mpris_tracklist_shuffle_set, 0
|
||||||
},
|
},
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
@ -279,8 +279,8 @@ mpris_enable(Enjoy_Plugin *p __UNUSED__)
|
||||||
_cb_player_tracklist_change, NULL);
|
_cb_player_tracklist_change, NULL);
|
||||||
#undef EV_HANDLER
|
#undef EV_HANDLER
|
||||||
|
|
||||||
edbus_name_request(conn, APPLICATION_NAME,
|
eldbus_name_request(conn, APPLICATION_NAME,
|
||||||
EDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
|
ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
|
||||||
_cb_dbus_request_name, NULL);
|
_cb_dbus_request_name, NULL);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -292,9 +292,9 @@ mpris_disable(Enjoy_Plugin *p __UNUSED__)
|
||||||
|
|
||||||
if (root)
|
if (root)
|
||||||
{
|
{
|
||||||
edbus_service_object_unregister(root);
|
eldbus_service_object_unregister(root);
|
||||||
edbus_service_object_unregister(tracklist);
|
eldbus_service_object_unregister(tracklist);
|
||||||
edbus_service_object_unregister(player);
|
eldbus_service_object_unregister(player);
|
||||||
root = NULL;
|
root = NULL;
|
||||||
tracklist = NULL;
|
tracklist = NULL;
|
||||||
player = NULL;
|
player = NULL;
|
||||||
|
@ -335,8 +335,8 @@ mpris_init(void)
|
||||||
|
|
||||||
if (conn) return EINA_TRUE;
|
if (conn) return EINA_TRUE;
|
||||||
|
|
||||||
edbus_init();
|
eldbus_init();
|
||||||
conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
|
conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
|
||||||
if (!conn)
|
if (!conn)
|
||||||
{
|
{
|
||||||
ERR("Could not get DBus session bus");
|
ERR("Could not get DBus session bus");
|
||||||
|
@ -358,8 +358,8 @@ mpris_shutdown(void)
|
||||||
{
|
{
|
||||||
if (!conn) return;
|
if (!conn) return;
|
||||||
|
|
||||||
edbus_connection_unref(conn);
|
eldbus_connection_unref(conn);
|
||||||
edbus_shutdown();
|
eldbus_shutdown();
|
||||||
conn = NULL;
|
conn = NULL;
|
||||||
|
|
||||||
if (_mpris_log_domain >= 0)
|
if (_mpris_log_domain >= 0)
|
||||||
|
@ -369,69 +369,69 @@ mpris_shutdown(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const EDBus_Service_Interface_Desc root_desc = {
|
static const Eldbus_Service_Interface_Desc root_desc = {
|
||||||
PLAYER_INTERFACE_NAME, mpris_root_methods
|
PLAYER_INTERFACE_NAME, mpris_root_methods
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Service_Interface_Desc player_desc = {
|
static const Eldbus_Service_Interface_Desc player_desc = {
|
||||||
PLAYER_INTERFACE_NAME, mpris_player_methods, mpris_player_signals
|
PLAYER_INTERFACE_NAME, mpris_player_methods, mpris_player_signals
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Service_Interface_Desc tracklist_desc = {
|
static const Eldbus_Service_Interface_Desc tracklist_desc = {
|
||||||
PLAYER_INTERFACE_NAME, mpris_tracklist_methods, mpris_tracklist_signals
|
PLAYER_INTERFACE_NAME, mpris_tracklist_methods, mpris_tracklist_signals
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_cb_dbus_request_name(void *data __UNUSED__, const EDBus_Message *msg, EDBus_Pending *pending __UNUSED__)
|
_cb_dbus_request_name(void *data __UNUSED__, const Eldbus_Message *msg, Eldbus_Pending *pending __UNUSED__)
|
||||||
{
|
{
|
||||||
const char *error_name, *error_txt;
|
const char *error_name, *error_txt;
|
||||||
unsigned flag;
|
unsigned flag;
|
||||||
|
|
||||||
if (edbus_message_error_get(msg, &error_name, &error_txt))
|
if (eldbus_message_error_get(msg, &error_name, &error_txt))
|
||||||
{
|
{
|
||||||
ERR("Error %s %s", error_name, error_txt);
|
ERR("Error %s %s", error_name, error_txt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!edbus_message_arguments_get(msg, "u", &flag))
|
if (!eldbus_message_arguments_get(msg, "u", &flag))
|
||||||
{
|
{
|
||||||
ERR("Error getting arguments.");
|
ERR("Error getting arguments.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag != EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
|
if (flag != ELDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
|
||||||
{
|
{
|
||||||
ERR("Bus name in use by another application.");
|
ERR("Bus name in use by another application.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
root = edbus_service_interface_register(conn, ROOT_NAME, &root_desc);
|
root = eldbus_service_interface_register(conn, ROOT_NAME, &root_desc);
|
||||||
player = edbus_service_interface_register(conn, PLAYER_NAME, &player_desc);
|
player = eldbus_service_interface_register(conn, PLAYER_NAME, &player_desc);
|
||||||
tracklist = edbus_service_interface_register(conn, TRACKLIST_NAME,
|
tracklist = eldbus_service_interface_register(conn, TRACKLIST_NAME,
|
||||||
&tracklist_desc);
|
&tracklist_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mpris_append_dict_entry(EDBus_Message_Iter *array, const char *key,
|
_mpris_append_dict_entry(Eldbus_Message_Iter *array, const char *key,
|
||||||
const char *value_type, ...)
|
const char *value_type, ...)
|
||||||
{
|
{
|
||||||
EDBus_Message_Iter *dict, *val;
|
Eldbus_Message_Iter *dict, *val;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, value_type);
|
va_start(ap, value_type);
|
||||||
edbus_message_iter_arguments_append(array, "{sv}", &dict);
|
eldbus_message_iter_arguments_append(array, "{sv}", &dict);
|
||||||
edbus_message_iter_basic_append(dict, 's', key);
|
eldbus_message_iter_basic_append(dict, 's', key);
|
||||||
val = edbus_message_iter_container_new(dict, 'v', value_type);
|
val = eldbus_message_iter_container_new(dict, 'v', value_type);
|
||||||
edbus_message_iter_arguments_vappend(val, value_type, ap);
|
eldbus_message_iter_arguments_vappend(val, value_type, ap);
|
||||||
edbus_message_iter_container_close(dict, val);
|
eldbus_message_iter_container_close(dict, val);
|
||||||
edbus_message_iter_container_close(array, dict);
|
eldbus_message_iter_container_close(array, dict);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mpris_message_fill_song_metadata(EDBus_Message *msg, const Song *song)
|
_mpris_message_fill_song_metadata(Eldbus_Message *msg, const Song *song)
|
||||||
{
|
{
|
||||||
EDBus_Message_Iter *array, *main_iter;
|
Eldbus_Message_Iter *array, *main_iter;
|
||||||
|
|
||||||
if (!song) return;
|
if (!song) return;
|
||||||
|
|
||||||
|
@ -445,8 +445,8 @@ _mpris_message_fill_song_metadata(EDBus_Message *msg, const Song *song)
|
||||||
trackno s
|
trackno s
|
||||||
*/
|
*/
|
||||||
|
|
||||||
main_iter = edbus_message_iter_get(msg);
|
main_iter = eldbus_message_iter_get(msg);
|
||||||
edbus_message_iter_arguments_append(main_iter, "a{sv}", &array);
|
eldbus_message_iter_arguments_append(main_iter, "a{sv}", &array);
|
||||||
|
|
||||||
if (song->title)
|
if (song->title)
|
||||||
_mpris_append_dict_entry(array, "title", "s", song->title);
|
_mpris_append_dict_entry(array, "title", "s", song->title);
|
||||||
|
@ -461,7 +461,7 @@ _mpris_message_fill_song_metadata(EDBus_Message *msg, const Song *song)
|
||||||
_mpris_append_dict_entry(array, "enjoy:playcount", "i", song->playcnt);
|
_mpris_append_dict_entry(array, "enjoy:playcount", "i", song->playcnt);
|
||||||
_mpris_append_dict_entry(array, "enjoy:filesize", "i", song->size);
|
_mpris_append_dict_entry(array, "enjoy:filesize", "i", song->size);
|
||||||
|
|
||||||
edbus_message_iter_container_close(main_iter, array);
|
eldbus_message_iter_container_close(main_iter, array);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -471,7 +471,7 @@ _mpris_signal_player_caps_change(int caps)
|
||||||
if (caps != old_caps)
|
if (caps != old_caps)
|
||||||
{
|
{
|
||||||
int32_t caps32 = caps;
|
int32_t caps32 = caps;
|
||||||
edbus_service_signal_emit(player, PLAYER_CAPS, caps32);
|
eldbus_service_signal_emit(player, PLAYER_CAPS, caps32);
|
||||||
old_caps = caps;
|
old_caps = caps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -479,8 +479,8 @@ _mpris_signal_player_caps_change(int caps)
|
||||||
static void
|
static void
|
||||||
_mpris_signal_player_status_change(int playback, int shuffle, int repeat, int endless)
|
_mpris_signal_player_status_change(int playback, int shuffle, int repeat, int endless)
|
||||||
{
|
{
|
||||||
EDBus_Message *sig;
|
Eldbus_Message *sig;
|
||||||
EDBus_Message_Iter *st, *main_iter;
|
Eldbus_Message_Iter *st, *main_iter;
|
||||||
static int old_playback = 0, old_shuffle = 0, old_repeat = 0, old_endless = 0;
|
static int old_playback = 0, old_shuffle = 0, old_repeat = 0, old_endless = 0;
|
||||||
|
|
||||||
if (old_playback == playback && old_shuffle == shuffle &&
|
if (old_playback == playback && old_shuffle == shuffle &&
|
||||||
|
@ -490,18 +490,18 @@ _mpris_signal_player_status_change(int playback, int shuffle, int repeat, int en
|
||||||
old_repeat = repeat;
|
old_repeat = repeat;
|
||||||
old_endless = endless;
|
old_endless = endless;
|
||||||
|
|
||||||
sig = edbus_service_signal_new(player, PLAYER_STATUS);
|
sig = eldbus_service_signal_new(player, PLAYER_STATUS);
|
||||||
if (!sig) return;
|
if (!sig) return;
|
||||||
|
|
||||||
main_iter = edbus_message_iter_get(sig);
|
main_iter = eldbus_message_iter_get(sig);
|
||||||
edbus_message_iter_arguments_append(main_iter, "(iiii)", &st);
|
eldbus_message_iter_arguments_append(main_iter, "(iiii)", &st);
|
||||||
edbus_message_iter_basic_append(st, 'i', playback);
|
eldbus_message_iter_basic_append(st, 'i', playback);
|
||||||
edbus_message_iter_basic_append(st, 'i', shuffle);
|
eldbus_message_iter_basic_append(st, 'i', shuffle);
|
||||||
edbus_message_iter_basic_append(st, 'i', repeat);
|
eldbus_message_iter_basic_append(st, 'i', repeat);
|
||||||
edbus_message_iter_basic_append(st, 'i', endless);
|
eldbus_message_iter_basic_append(st, 'i', endless);
|
||||||
edbus_message_iter_container_close(main_iter, st);
|
eldbus_message_iter_container_close(main_iter, st);
|
||||||
|
|
||||||
edbus_service_signal_send(player, sig);
|
eldbus_service_signal_send(player, sig);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -510,10 +510,10 @@ _mpris_signal_player_track_change(const Song *song)
|
||||||
static const void *old_song = NULL;
|
static const void *old_song = NULL;
|
||||||
if (old_song != song)
|
if (old_song != song)
|
||||||
{
|
{
|
||||||
EDBus_Message *sig = edbus_service_signal_new(player, PLAYER_TRACK);
|
Eldbus_Message *sig = eldbus_service_signal_new(player, PLAYER_TRACK);
|
||||||
if (!sig) return;
|
if (!sig) return;
|
||||||
_mpris_message_fill_song_metadata(sig, song);
|
_mpris_message_fill_song_metadata(sig, song);
|
||||||
edbus_service_signal_send(player, sig);
|
eldbus_service_signal_send(player, sig);
|
||||||
old_song = song;
|
old_song = song;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -522,103 +522,103 @@ static void
|
||||||
_mpris_signal_tracklist_tracklist_change(int size)
|
_mpris_signal_tracklist_tracklist_change(int size)
|
||||||
{
|
{
|
||||||
int32_t size32 = size;
|
int32_t size32 = size;
|
||||||
edbus_service_signal_emit(tracklist, TRACK_LIST, size32);
|
eldbus_service_signal_emit(tracklist, TRACK_LIST, size32);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_next(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_next(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
enjoy_control_next();
|
enjoy_control_next();
|
||||||
return edbus_message_method_return_new(msg);
|
return eldbus_message_method_return_new(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_previous(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_previous(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
enjoy_control_previous();
|
enjoy_control_previous();
|
||||||
return edbus_message_method_return_new(msg);
|
return eldbus_message_method_return_new(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_pause(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_pause(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
enjoy_control_pause();
|
enjoy_control_pause();
|
||||||
return edbus_message_method_return_new(msg);
|
return eldbus_message_method_return_new(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_stop(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_stop(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
enjoy_control_stop();
|
enjoy_control_stop();
|
||||||
return edbus_message_method_return_new(msg);
|
return eldbus_message_method_return_new(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_play(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_play(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
Enjoy_Player_Status status = enjoy_player_status_get();
|
Enjoy_Player_Status status = enjoy_player_status_get();
|
||||||
if (!status.playback)
|
if (!status.playback)
|
||||||
enjoy_position_set(0);
|
enjoy_position_set(0);
|
||||||
enjoy_control_play();
|
enjoy_control_play();
|
||||||
return edbus_message_method_return_new(msg);
|
return eldbus_message_method_return_new(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_seek(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_seek(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
int64_t position;
|
int64_t position;
|
||||||
if (!edbus_message_arguments_get(msg, "x", &position))
|
if (!eldbus_message_arguments_get(msg, "x", &position))
|
||||||
goto end;
|
goto end;
|
||||||
enjoy_control_seek(position);
|
enjoy_control_seek(position);
|
||||||
end:
|
end:
|
||||||
return edbus_message_method_return_new(msg);
|
return eldbus_message_method_return_new(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_root_identity(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_root_identity(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
const char *identity = PACKAGE_STRING;
|
const char *identity = PACKAGE_STRING;
|
||||||
EDBus_Message *reply = edbus_message_method_return_new(msg);
|
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
|
||||||
edbus_message_arguments_append(reply, "s", identity);
|
eldbus_message_arguments_append(reply, "s", identity);
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_root_quit(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_root_quit(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
enjoy_quit();
|
enjoy_quit();
|
||||||
return edbus_message_method_return_new(msg);
|
return eldbus_message_method_return_new(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_root_version(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_root_version(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
EDBus_Message *reply = edbus_message_method_return_new(msg);
|
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
|
||||||
EDBus_Message_Iter *main_iter, *s;
|
Eldbus_Message_Iter *main_iter, *s;
|
||||||
uint16_t v1 = 1, v2 = 0;
|
uint16_t v1 = 1, v2 = 0;
|
||||||
|
|
||||||
main_iter = edbus_message_iter_get(reply);
|
main_iter = eldbus_message_iter_get(reply);
|
||||||
edbus_message_iter_arguments_append(main_iter, "(qq)", &s);
|
eldbus_message_iter_arguments_append(main_iter, "(qq)", &s);
|
||||||
edbus_message_iter_arguments_append(s, "qq", v1, v2);
|
eldbus_message_iter_arguments_append(s, "qq", v1, v2);
|
||||||
edbus_message_iter_container_close(main_iter, s);
|
eldbus_message_iter_container_close(main_iter, s);
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_caps_get(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_caps_get(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
EDBus_Message *reply = edbus_message_method_return_new(msg);
|
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
|
||||||
int32_t bits = _caps_to_mpris_bits(enjoy_player_caps_get());
|
int32_t bits = _caps_to_mpris_bits(enjoy_player_caps_get());
|
||||||
edbus_message_arguments_append(reply, "i", bits);
|
eldbus_message_arguments_append(reply, "i", bits);
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_volume_set(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_volume_set(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
int volume;
|
int volume;
|
||||||
|
|
||||||
if (!edbus_message_arguments_get(msg, "i", &volume))
|
if (!eldbus_message_arguments_get(msg, "i", &volume))
|
||||||
goto end;
|
goto end;
|
||||||
if (volume > 100)
|
if (volume > 100)
|
||||||
volume = 100;
|
volume = 100;
|
||||||
|
@ -626,35 +626,35 @@ _mpris_player_volume_set(const EDBus_Service_Interface *iface __UNUSED__, const
|
||||||
volume = 0;
|
volume = 0;
|
||||||
enjoy_volume_set(volume);
|
enjoy_volume_set(volume);
|
||||||
end:
|
end:
|
||||||
return edbus_message_method_return_new(msg);
|
return eldbus_message_method_return_new(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_volume_get(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_volume_get(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
EDBus_Message *reply = edbus_message_method_return_new(msg);
|
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
|
||||||
int32_t vol = enjoy_volume_get();
|
int32_t vol = enjoy_volume_get();
|
||||||
edbus_message_arguments_append(reply, "i", vol);
|
eldbus_message_arguments_append(reply, "i", vol);
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_repeat_set(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_repeat_set(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
Eina_Bool repeat;
|
Eina_Bool repeat;
|
||||||
if (!edbus_message_arguments_get(msg, "b", &repeat))
|
if (!eldbus_message_arguments_get(msg, "b", &repeat))
|
||||||
goto end;
|
goto end;
|
||||||
enjoy_control_loop_set(repeat);
|
enjoy_control_loop_set(repeat);
|
||||||
end:
|
end:
|
||||||
return edbus_message_method_return_new(msg);
|
return eldbus_message_method_return_new(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_status_get(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_status_get(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
EDBus_Message *reply = edbus_message_method_return_new(msg);
|
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
|
||||||
Enjoy_Player_Status status = enjoy_player_status_get();
|
Enjoy_Player_Status status = enjoy_player_status_get();
|
||||||
EDBus_Message_Iter *main_iter, *st;
|
Eldbus_Message_Iter *main_iter, *st;
|
||||||
int32_t p, s, r, e;
|
int32_t p, s, r, e;
|
||||||
|
|
||||||
p = status.playback;
|
p = status.playback;
|
||||||
|
@ -662,88 +662,88 @@ _mpris_player_status_get(const EDBus_Service_Interface *iface __UNUSED__, const
|
||||||
r = status.repeat;
|
r = status.repeat;
|
||||||
e = status.endless;
|
e = status.endless;
|
||||||
|
|
||||||
main_iter = edbus_message_iter_get(reply);
|
main_iter = eldbus_message_iter_get(reply);
|
||||||
edbus_message_iter_arguments_append(main_iter, "(iiii)", &st);
|
eldbus_message_iter_arguments_append(main_iter, "(iiii)", &st);
|
||||||
edbus_message_iter_arguments_append(st, "iiii", p, s, r, e);
|
eldbus_message_iter_arguments_append(st, "iiii", p, s, r, e);
|
||||||
edbus_message_iter_container_close(main_iter, st);
|
eldbus_message_iter_container_close(main_iter, st);
|
||||||
|
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_position_set(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_position_set(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
int position;
|
int position;
|
||||||
if (!edbus_message_arguments_get(msg, "i", &position))
|
if (!eldbus_message_arguments_get(msg, "i", &position))
|
||||||
goto end;
|
goto end;
|
||||||
enjoy_position_set(position);
|
enjoy_position_set(position);
|
||||||
end:
|
end:
|
||||||
return edbus_message_method_return_new(msg);
|
return eldbus_message_method_return_new(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_position_get(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_position_get(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
EDBus_Message *reply = edbus_message_method_return_new(msg);
|
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
|
||||||
int32_t pos = enjoy_position_get();
|
int32_t pos = enjoy_position_get();
|
||||||
edbus_message_arguments_append(reply, "i", pos);
|
eldbus_message_arguments_append(reply, "i", pos);
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_song_metadata_reply(const EDBus_Message *msg, const Song *song)
|
_mpris_song_metadata_reply(const Eldbus_Message *msg, const Song *song)
|
||||||
{
|
{
|
||||||
EDBus_Message *reply = edbus_message_method_return_new(msg);
|
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
|
||||||
_mpris_message_fill_song_metadata(reply, song);
|
_mpris_message_fill_song_metadata(reply, song);
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_player_metadata_get(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_player_metadata_get(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
return _mpris_song_metadata_reply(msg, enjoy_song_current_get());
|
return _mpris_song_metadata_reply(msg, enjoy_song_current_get());
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_tracklist_current_track_get(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_tracklist_current_track_get(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
EDBus_Message *reply = edbus_message_method_return_new(msg);
|
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
|
||||||
int32_t pos = enjoy_playlist_current_position_get();
|
int32_t pos = enjoy_playlist_current_position_get();
|
||||||
edbus_message_arguments_append(reply, "i", pos);
|
eldbus_message_arguments_append(reply, "i", pos);
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_tracklist_count(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_tracklist_count(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
EDBus_Message *reply = edbus_message_method_return_new(msg);
|
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
|
||||||
int32_t count = enjoy_playlist_count();
|
int32_t count = enjoy_playlist_count();
|
||||||
edbus_message_arguments_append(reply, "i", count);
|
eldbus_message_arguments_append(reply, "i", count);
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_tracklist_metadata_get(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_tracklist_metadata_get(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
EDBus_Message *reply;
|
Eldbus_Message *reply;
|
||||||
const Song *song;
|
const Song *song;
|
||||||
int position;
|
int position;
|
||||||
if (!edbus_message_arguments_get(msg, "i", &position))
|
if (!eldbus_message_arguments_get(msg, "i", &position))
|
||||||
return NULL;
|
return NULL;
|
||||||
song = enjoy_playlist_song_position_get(position);
|
song = enjoy_playlist_song_position_get(position);
|
||||||
reply = _mpris_song_metadata_reply(msg, song);
|
reply = _mpris_song_metadata_reply(msg, song);
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Message *
|
static Eldbus_Message *
|
||||||
_mpris_tracklist_shuffle_set(const EDBus_Service_Interface *iface __UNUSED__, const EDBus_Message *msg)
|
_mpris_tracklist_shuffle_set(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg)
|
||||||
{
|
{
|
||||||
Eina_Bool param;
|
Eina_Bool param;
|
||||||
if (!edbus_message_arguments_get(msg, "b", ¶m))
|
if (!eldbus_message_arguments_get(msg, "b", ¶m))
|
||||||
goto end;
|
goto end;
|
||||||
enjoy_control_shuffle_set(param);
|
enjoy_control_shuffle_set(param);
|
||||||
end:
|
end:
|
||||||
return edbus_message_method_return_new(msg);
|
return eldbus_message_method_return_new(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
EINA_MODULE_INIT(mpris_init);
|
EINA_MODULE_INIT(mpris_init);
|
||||||
|
|
Loading…
Reference in New Issue