Blame


1 3baa2617 2022-02-16 op /*
2 3baa2617 2022-02-16 op * Copyright (c) 2022 Omar Polo <op@openbsd.org>
3 3baa2617 2022-02-16 op *
4 3baa2617 2022-02-16 op * Permission to use, copy, modify, and distribute this software for any
5 3baa2617 2022-02-16 op * purpose with or without fee is hereby granted, provided that the above
6 3baa2617 2022-02-16 op * copyright notice and this permission notice appear in all copies.
7 3baa2617 2022-02-16 op *
8 3baa2617 2022-02-16 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 3baa2617 2022-02-16 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 3baa2617 2022-02-16 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 3baa2617 2022-02-16 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 3baa2617 2022-02-16 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 3baa2617 2022-02-16 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 3baa2617 2022-02-16 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 3baa2617 2022-02-16 op */
16 3baa2617 2022-02-16 op
17 3baa2617 2022-02-16 op #ifndef PLAYLIST_H
18 3baa2617 2022-02-16 op #define PLAYLIST_H
19 3baa2617 2022-02-16 op
20 3baa2617 2022-02-16 op struct playlist {
21 3baa2617 2022-02-16 op size_t len;
22 3baa2617 2022-02-16 op size_t cap;
23 3baa2617 2022-02-16 op char **songs;
24 3baa2617 2022-02-16 op };
25 3baa2617 2022-02-16 op
26 3baa2617 2022-02-16 op enum play_state {
27 3baa2617 2022-02-16 op STATE_STOPPED,
28 3baa2617 2022-02-16 op STATE_PLAYING,
29 3baa2617 2022-02-16 op STATE_PAUSED,
30 3baa2617 2022-02-16 op };
31 3baa2617 2022-02-16 op
32 3baa2617 2022-02-16 op extern struct playlist playlist;
33 3baa2617 2022-02-16 op
34 3baa2617 2022-02-16 op extern enum play_state play_state;
35 3baa2617 2022-02-16 op extern int repeat_one;
36 3baa2617 2022-02-16 op extern int repeat_all;
37 9fb94242 2022-07-13 op extern int consume;
38 3baa2617 2022-02-16 op extern ssize_t play_off;
39 74c987d5 2022-02-19 op extern const char *current_song;
40 ff06024f 2022-07-08 op extern int64_t current_position;
41 ff06024f 2022-07-08 op extern int64_t current_duration;
42 3baa2617 2022-02-16 op
43 3af93963 2022-03-02 op void playlist_swap(struct playlist *, ssize_t);
44 532ca63c 2022-02-17 op void playlist_push(struct playlist *, const char *);
45 3baa2617 2022-02-16 op void playlist_enqueue(const char *);
46 3baa2617 2022-02-16 op const char *playlist_advance(void);
47 af27e631 2022-02-17 op const char *playlist_previous(void);
48 3baa2617 2022-02-16 op void playlist_reset(void);
49 cd070aea 2022-02-17 op void playlist_free(struct playlist *);
50 3baa2617 2022-02-16 op void playlist_truncate(void);
51 13b83883 2022-02-16 op void playlist_dropcurrent(void);
52 a913de21 2022-02-17 op const char *playlist_jump(const char *);
53 3baa2617 2022-02-16 op
54 3baa2617 2022-02-16 op #endif