commit 0977e96a0236af26cfd4663bce2dad656fa1ef07 from: Omar Polo date: Thu Feb 17 11:22:02 2022 UTC add playlist_swap commit - cd070aeadabc033a40fc829a21f62b4a37684a8c commit + 0977e96a0236af26cfd4663bce2dad656fa1ef07 blob - 50c3ce9a701bfc4d6ab0ceabedfd6f0a546646bc blob + f1a771837bb39ce5572ea229ebd85a682fb4e768 --- playlist.c +++ playlist.c @@ -30,6 +30,16 @@ int repeat_all = 1; ssize_t play_off = -1; void +playlist_swap(struct playlist *p) +{ + playlist_truncate(); + + playlist.len = p->len; + playlist.cap = p->cap; + playlist.songs = p->songs; +} + +void playlist_push(struct playlist *playlist, const char *path) { size_t newcap; blob - 62c2fe10cddf05aca8db7b5da5cdb53d38b563cd blob + a4fed13615d9a6b02734aa8c8573c5c71c0ff642 --- playlist.h +++ playlist.h @@ -36,6 +36,7 @@ extern int repeat_one; extern int repeat_all; extern ssize_t play_off; +void playlist_swap(struct playlist *); void playlist_push(struct playlist *, const char *); void playlist_enqueue(const char *); const char *playlist_current(void);