have pause take an optional arugment

git-svn-id: https://svn.musicpd.org/mpd/trunk@43 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes
2004-02-25 00:08:48 +00:00
parent 068d307a71
commit aaf4282654
3 changed files with 30 additions and 1 deletions

View File

@@ -215,6 +215,23 @@ int playerPause(FILE * fp) {
return 0;
}
int playerSetPause(FILE * fp, int pause) {
PlayerControl * pc = &(getPlayerData()->playerControl);
if(player_pid<=0) return 0;
switch(pc->state) {
case PLAYER_STATE_PLAY:
if(pause) playerPause(fp);
break;
case PLAYER_STATE_PAUSE:
if(!pause) playerPause(fp);
break;
}
return 0;
}
int getPlayerElapsedTime() {
return (int)(getPlayerData()->playerControl.elapsedTime+0.5);
}