forked from cmus/cmus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
job.h
67 lines (56 loc) · 1.68 KB
/
job.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
56
57
58
59
60
61
62
63
64
65
66
67
/*
* Copyright 2008-2013 Various Authors
* Copyright 2008 Timo Hirvonen
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CMUS_JOB_H
#define CMUS_JOB_H
#include "cmus.h"
#define JOB_TYPE_LIB 1 << 0
#define JOB_TYPE_PL 1 << 1
#define JOB_TYPE_QUEUE 1 << 2
#define JOB_TYPE_ADD 1 << 16
#define JOB_TYPE_UPDATE 1 << 17
#define JOB_TYPE_UPDATE_CACHE 1 << 18
#define JOB_TYPE_DELETE 1 << 19
struct add_data {
enum file_type type;
char *name;
add_ti_cb add;
void *opaque;
unsigned int force : 1;
};
struct update_data {
size_t size;
size_t used;
struct track_info **ti;
unsigned int force : 1;
};
struct update_cache_data {
unsigned int force : 1;
};
struct pl_delete_data {
struct playlist *pl;
void (*cb)(struct playlist *);
};
extern int job_fd;
void job_init(void);
void job_exit(void);
void job_schedule_add(int type, struct add_data *data);
void job_schedule_update(struct update_data *data);
void job_schedule_update_cache(int type, struct update_cache_data *data);
void job_schedule_pl_delete(struct pl_delete_data *data);
void job_handle(void);
#endif