Blame
Date:
Wed Mar 2 17:54:37 2022 UTC
Message:
keep the current song if load input was generated by show -p `amused show -p' generates a listing in the form of song > current song song ... This adds an heuristic to `amused load' so that the current song can be set if it's prefixed by "> ". It's particularly useful when re-importing the state from a previous run.
01
2022-02-16
op
/*
02
2022-02-16
op
* Copyright (c) 2022 Omar Polo <op@openbsd.org>
03
2022-02-16
op
*
04
2022-02-16
op
* Permission to use, copy, modify, and distribute this software for any
05
2022-02-16
op
* purpose with or without fee is hereby granted, provided that the above
06
2022-02-16
op
* copyright notice and this permission notice appear in all copies.
07
2022-02-16
op
*
08
2022-02-16
op
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
09
2022-02-16
op
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
2022-02-16
op
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
2022-02-16
op
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
2022-02-16
op
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
2022-02-16
op
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
2022-02-16
op
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
2022-02-16
op
*/
16
2022-02-16
op
17
2022-02-16
op
#ifndef PLAYLIST_H
18
2022-02-16
op
#define PLAYLIST_H
19
2022-02-16
op
20
2022-02-16
op
struct playlist {
21
2022-02-16
op
size_t len;
22
2022-02-16
op
size_t cap;
23
2022-02-16
op
char **songs;
24
2022-02-16
op
};
25
2022-02-16
op
26
2022-02-16
op
enum play_state {
27
2022-02-16
op
STATE_STOPPED,
28
2022-02-16
op
STATE_PLAYING,
29
2022-02-16
op
STATE_PAUSED,
30
2022-02-16
op
};
31
2022-02-16
op
32
2022-02-16
op
extern struct playlist playlist;
33
2022-02-16
op
34
2022-02-16
op
extern enum play_state play_state;
35
2022-02-16
op
extern int repeat_one;
36
2022-02-16
op
extern int repeat_all;
37
2022-02-16
op
extern ssize_t play_off;
38
2022-02-19
op
extern const char *current_song;
39
2022-02-16
op
40
2022-03-02
op
void playlist_swap(struct playlist *, ssize_t);
41
2022-02-17
op
void playlist_push(struct playlist *, const char *);
42
2022-02-16
op
void playlist_enqueue(const char *);
43
2022-02-16
op
const char *playlist_advance(void);
44
2022-02-17
op
const char *playlist_previous(void);
45
2022-02-16
op
void playlist_reset(void);
46
2022-02-17
op
void playlist_free(struct playlist *);
47
2022-02-16
op
void playlist_truncate(void);
48
2022-02-16
op
void playlist_dropcurrent(void);
49
2022-02-17
op
const char *playlist_jump(const char *);
50
2022-02-16
op
51
2022-02-16
op
#endif
Omar Polo