mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 16:15:57 -05:00
Merge pull request #1484 from chme/fix/consume-repeat
[player] Turn repeat mode off when activating consume mode
This commit is contained in:
commit
ffcde46140
19
src/player.c
19
src/player.c
@ -2975,10 +2975,14 @@ volume_generic_bh(void *arg, int *retval)
|
|||||||
return COMMAND_END;
|
return COMMAND_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static enum command_state
|
||||||
|
consume_set(void *arg, int *retval);
|
||||||
|
|
||||||
static enum command_state
|
static enum command_state
|
||||||
repeat_set(void *arg, int *retval)
|
repeat_set(void *arg, int *retval)
|
||||||
{
|
{
|
||||||
enum repeat_mode *mode = arg;
|
enum repeat_mode *mode = arg;
|
||||||
|
union player_arg consume_arg;
|
||||||
|
|
||||||
if (*mode == repeat)
|
if (*mode == repeat)
|
||||||
{
|
{
|
||||||
@ -3003,6 +3007,13 @@ repeat_set(void *arg, int *retval)
|
|||||||
// Persist
|
// Persist
|
||||||
SETTINGS_SETINT(player_settings_category, PLAYER_SETTINGS_MODE_REPEAT, repeat);
|
SETTINGS_SETINT(player_settings_category, PLAYER_SETTINGS_MODE_REPEAT, repeat);
|
||||||
|
|
||||||
|
if (repeat == REPEAT_ALL || repeat == REPEAT_SONG)
|
||||||
|
{
|
||||||
|
// Activating repeat requires repeat consume mode to be off
|
||||||
|
consume_arg.intval = 0;
|
||||||
|
consume_set(&consume_arg, retval);
|
||||||
|
}
|
||||||
|
|
||||||
*retval = 0;
|
*retval = 0;
|
||||||
return COMMAND_END;
|
return COMMAND_END;
|
||||||
}
|
}
|
||||||
@ -3046,6 +3057,7 @@ shuffle_set(void *arg, int *retval)
|
|||||||
static enum command_state
|
static enum command_state
|
||||||
consume_set(void *arg, int *retval)
|
consume_set(void *arg, int *retval)
|
||||||
{
|
{
|
||||||
|
enum repeat_mode repeat_mode;
|
||||||
union player_arg *cmdarg = arg;
|
union player_arg *cmdarg = arg;
|
||||||
|
|
||||||
consume = cmdarg->intval;
|
consume = cmdarg->intval;
|
||||||
@ -3053,6 +3065,13 @@ consume_set(void *arg, int *retval)
|
|||||||
// Persist
|
// Persist
|
||||||
SETTINGS_SETBOOL(player_settings_category, PLAYER_SETTINGS_MODE_CONSUME, consume);
|
SETTINGS_SETBOOL(player_settings_category, PLAYER_SETTINGS_MODE_CONSUME, consume);
|
||||||
|
|
||||||
|
if (consume)
|
||||||
|
{
|
||||||
|
// Activating cosume mode requires repeat mode to be off
|
||||||
|
repeat_mode = REPEAT_OFF;
|
||||||
|
repeat_set(&repeat_mode, retval);
|
||||||
|
}
|
||||||
|
|
||||||
*retval = 0;
|
*retval = 0;
|
||||||
return COMMAND_END;
|
return COMMAND_END;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user