handle single command and remove hacks used as substitute for it
mpd-git has single command, which provides functionality of both "repeat one" and "stop after current track" modes. repeat one = single && repeat stop after current track = single && !repeat
This commit is contained in:
@@ -739,6 +739,7 @@ mpd_Status * mpd_getStatus(mpd_Connection * connection) {
|
||||
status->volume = -1;
|
||||
status->repeat = 0;
|
||||
status->random = 0;
|
||||
status->single = 0;
|
||||
status->playlist = -1;
|
||||
status->playlistLength = -1;
|
||||
status->state = -1;
|
||||
@@ -769,6 +770,9 @@ mpd_Status * mpd_getStatus(mpd_Connection * connection) {
|
||||
else if(strcmp(re->name,"random")==0) {
|
||||
status->random = atoi(re->value);
|
||||
}
|
||||
else if(strcmp(re->name,"single")==0) {
|
||||
status->single = atoi(re->value);
|
||||
}
|
||||
else if(strcmp(re->name,"playlist")==0) {
|
||||
status->playlist = strtol(re->value,NULL,10);
|
||||
}
|
||||
@@ -1692,6 +1696,14 @@ void mpd_sendRandomCommand(mpd_Connection * connection, int randomMode) {
|
||||
free(string);
|
||||
}
|
||||
|
||||
void mpd_sendSingleCommand(mpd_Connection * connection, int singleMode) {
|
||||
int len = strlen("single")+2+INTLEN+3;
|
||||
char *string = malloc(len);
|
||||
snprintf(string, len, "single \"%i\"\n", singleMode);
|
||||
mpd_executeCommand(connection,string);
|
||||
free(string);
|
||||
}
|
||||
|
||||
void mpd_sendSetvolCommand(mpd_Connection * connection, int volumeChange) {
|
||||
int len = strlen("setvol")+2+INTLEN+3;
|
||||
char *string = malloc(len);
|
||||
|
||||
Reference in New Issue
Block a user