seamus

ref: master

include/seamus.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
#ifndef SEAMUS_SEAMUS
#define SEAMUS_SEAMUS
#include <string.h>
#include <stdbool.h>
#include <mpd/client.h>
#include <tickit.h>
#include "log.h"

struct seamus_song {
	int song_id;
	char *title;
	char *artist;
};

struct seamus_status {
	bool repeat;
	bool random;
	bool single;

	int current_song_position;
	int current_song_id;

	int version;
	int length;

	unsigned elapsed_time;
	unsigned total_time;

	enum mpd_state state;
	char *description;
};

struct seamus_frontend {
	struct mpd_connection *conn;
	struct seamus_song *queue;
	struct seamus_status *status;

	int version;
	int queue_size;
	int scroll_position;

	TickitWindow *main_window;
	TickitWindow *status_window;
	Tickit *t;

	TickitPen *scrolling_pen;
	TickitPen *playing_pen;
};

int seamus_init(struct seamus_frontend *s);
int setup_connection(struct seamus_frontend *s);
int fetch_mpd_from_current_queue(struct seamus_frontend *seamus, int max_count);

#endif