summaryrefslogtreecommitdiff
path: root/firmware/export/events.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/events.h')
-rw-r--r--firmware/export/events.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/firmware/export/events.h b/firmware/export/events.h
new file mode 100644
index 0000000000..b27b5dee4c
--- /dev/null
+++ b/firmware/export/events.h
@@ -0,0 +1,51 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Miika Pekkarinen
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#ifndef _EVENTS_H
21#define _EVENTS_H
22
23#include <stdbool.h>
24
25#define MAX_SYS_EVENTS 10
26
27/**
28 * High nibble = Event class definition
29 * Low nibble = Event ID
30 */
31
32#define EVENT_CLASS_DISK 0x0100
33#define EVENT_CLASS_PLAYBACK 0x0200
34
35/**
36 * Because same playback events are used in mpeg.c and playback.c, define
37 * them here to prevent cluttering and ifdefs.
38 */
39enum {
40 PLAYBACK_EVENT_TRACK_BUFFER = (EVENT_CLASS_PLAYBACK|1),
41 PLAYBACK_EVENT_TRACK_FINISH,
42 PLAYBACK_EVENT_TRACK_CHANGE,
43};
44
45
46bool add_event(unsigned short id, void (*handler));
47void remove_event(unsigned short id, void (*handler));
48void send_event(unsigned short id, bool oneshot, void *data);
49
50#endif
51