Wire up DACP setproperty for dacp.shufflestate

This commit is contained in:
Julien BLACHE 2010-05-01 09:04:05 +02:00
parent a74caeed82
commit 9f84fd9794
1 changed files with 20 additions and 1 deletions

View File

@ -111,6 +111,8 @@ dacp_propset_volume(const char *value);
static void
dacp_propset_playingtime(const char *value);
static void
dacp_propset_shufflestate(const char *value);
static void
dacp_propset_repeatstate(const char *value);
static struct dacp_prop_map dacp_props[] =
@ -122,7 +124,7 @@ static struct dacp_prop_map dacp_props[] =
{ 0, "dacp.volumecontrollable", dacp_propget_volumecontrollable, NULL },
{ 0, "dacp.availableshufflestates", dacp_propget_availableshufflestates, NULL },
{ 0, "dacp.availablerepeatstates", dacp_propget_availablerepeatstates, NULL },
{ 0, "dacp.shufflestate", dacp_propget_shufflestate, NULL },
{ 0, "dacp.shufflestate", dacp_propget_shufflestate, dacp_propset_shufflestate },
{ 0, "dacp.repeatstate", dacp_propget_repeatstate, dacp_propset_repeatstate },
{ 0, NULL, NULL, NULL }
@ -576,6 +578,23 @@ dacp_propset_playingtime(const char *value)
evtimer_add(&seek_timer, &tv);
}
static void
dacp_propset_shufflestate(const char *value)
{
int enable;
int ret;
ret = safe_atoi32(value, &enable);
if (ret < 0)
{
DPRINTF(E_LOG, L_DACP, "dacp.shufflestate argument doesn't convert to integer: %s\n", value);
return;
}
player_shuffle_set(enable);
}
static void
dacp_propset_repeatstate(const char *value)
{