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