commit - 3aa75c64d7d3cdcf3988263eaf4d073dc7c89e50
commit + 8d08767078347495fc28f6a97ad1e5e1b3b6f5f2
blob - bf368c371689924a2eaedfb47abd27af8a2f6db4
blob + 807d19af4e75d3e1cc13776b84f878af1b8330fe
--- amused.c
+++ amused.c
}
void
-main_restart_track(void)
-{
- if (current_song == NULL)
- return;
-
- if (main_play_song(current_song))
- return;
-
- playlist_dropcurrent();
- main_playlist_advance();
-}
-
-void
main_senderr(struct imsgev *iev, const char *msg)
{
imsg_compose_event(iev, IMSG_CTL_ERR, 0, 0, -1,
blob - 5bfef5817b5b06a34ca123c200879905a1161b6a
blob + 0327648d1507905618118f4ceda5bef4638be8a0
--- amused.h
+++ amused.h
IMSG_CTL_TOGGLE_PLAY,
IMSG_CTL_PAUSE,
IMSG_CTL_STOP,
- IMSG_CTL_RESTART,
IMSG_CTL_FLUSH,
IMSG_CTL_SHOW,
IMSG_CTL_STATUS,
PAUSE,
TOGGLE,
STOP,
- RESTART,
+ RESTART, /* seek to zero */
ADD,
FLUSH,
SHOW,
void main_playlist_resume(void);
void main_playlist_advance(void);
void main_playlist_previous(void);
-void main_restart_track(void);
void main_senderr(struct imsgev *, const char *);
void main_enqueue(int, struct playlist *, struct imsgev *, struct imsg *);
void main_send_playlist(struct imsgev *);
blob - abf505eaf22728d250eee8a0e5d0aab25d7b86fa
blob + 706e2a01ee1b31c5ba370a5405a5157877355faa
--- control.c
+++ control.c
main_send_player(IMSG_STOP, -1, NULL, 0);
control_notify(&c->iev, imsg.hdr.type);
break;
- case IMSG_CTL_RESTART:
- main_send_player(IMSG_STOP, -1, NULL, 0);
- main_restart_track();
- control_notify(&c->iev, imsg.hdr.type);
- break;
case IMSG_CTL_FLUSH:
playlist_truncate();
control_notify(&c->iev, imsg.hdr.type);
blob - c4629edaa511ae2d9c584c4d1ac6c9458242e1ee
blob + 9b3ad2a9c8311d24800ae4635ebacf817c1c49af
--- ctl.c
+++ ctl.c
return "pause";
case IMSG_CTL_STOP:
return "stop";
- case IMSG_CTL_RESTART:
- return "restart";
case IMSG_CTL_FLUSH:
return "flush";
case IMSG_CTL_NEXT:
case STOP:
imsg_compose(ibuf, IMSG_CTL_STOP, 0, 0, -1, NULL, 0);
break;
- case RESTART:
- imsg_compose(ibuf, IMSG_CTL_RESTART, 0, 0, -1, NULL, 0);
- if (verbose) {
- imsg_compose(ibuf, IMSG_CTL_STATUS, 0, 0, -1,
- NULL, 0);
- done = 0;
- }
- break;
case ADD:
done = 0;
for (i = 0; res->files[i] != NULL; ++i) {
imsg_compose(ibuf, IMSG_CTL_MONITOR, 0, 0, -1,
NULL, 0);
break;
+ case RESTART:
+ memset(&res->seek, 0, sizeof(res->seek));
+ /* fallthrough */
case SEEK:
imsg_compose(ibuf, IMSG_CTL_SEEK, 0, 0, -1, &res->seek,
sizeof(res->seek));
res->monitor[IMSG_CTL_PAUSE] = 1;
else if (!strcmp(tok, "stop"))
res->monitor[IMSG_CTL_STOP] = 1;
- else if (!strcmp(tok, "restart"))
- res->monitor[IMSG_CTL_RESTART] = 1;
+ else if (!strcmp(tok, "restart")) /* compat */
+ res->monitor[IMSG_CTL_SEEK] = 1;
else if (!strcmp(tok, "flush"))
res->monitor[IMSG_CTL_FLUSH] = 1;
else if (!strcmp(tok, "next"))