Jonathan Gordon | 71898e5 | 2008-10-16 10:38:03 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
Bertrik Sikken | 6fef14b | 2010-01-03 14:28:09 +0000 | [diff] [blame] | 8 | * $Id$ |
Jonathan Gordon | 71898e5 | 2008-10-16 10:38:03 +0000 | [diff] [blame] | 9 | * |
| 10 | * Copyright (C) 2008 by Jonathan Gordon |
| 11 | * |
| 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
| 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | |
| 22 | #ifndef _APPEVENTS_H |
| 23 | #define _APPEVENTS_H |
| 24 | |
| 25 | #include <stdbool.h> |
| 26 | #include "events.h" |
| 27 | |
| 28 | /** Only app/ level events should be defined here. |
| 29 | * firmware/ level events and CLASS's are defined in firmware/export/events.h |
| 30 | */ |
| 31 | |
| 32 | /** Playback events **/ |
| 33 | enum { |
Michael Sevakis | 023f6b6 | 2013-07-12 12:06:38 -0400 | [diff] [blame] | 34 | /* Playback is starting from a stopped state |
| 35 | data = NULL */ |
Jonathan Gordon | 7d5e0d7 | 2010-05-16 11:13:42 +0000 | [diff] [blame] | 36 | PLAYBACK_EVENT_START_PLAYBACK = (EVENT_CLASS_PLAYBACK|1), |
Michael Sevakis | 023f6b6 | 2013-07-12 12:06:38 -0400 | [diff] [blame] | 37 | /* Audio has begun buffering for decoding track (or is already completed) |
| 38 | data = &(struct track_event){} */ |
Jonathan Gordon | 7d5e0d7 | 2010-05-16 11:13:42 +0000 | [diff] [blame] | 39 | PLAYBACK_EVENT_TRACK_BUFFER, |
Michael Sevakis | 023f6b6 | 2013-07-12 12:06:38 -0400 | [diff] [blame] | 40 | /* Handles for current user track are ready (other than audio or codec) |
| 41 | data = &(struct track_event){} */ |
Michael Sevakis | caf907e | 2011-05-25 08:35:31 +0000 | [diff] [blame] | 42 | PLAYBACK_EVENT_CUR_TRACK_READY, |
Michael Sevakis | 023f6b6 | 2013-07-12 12:06:38 -0400 | [diff] [blame] | 43 | /* Current user track finished |
| 44 | data = &(struct track_event){} */ |
Jonathan Gordon | 71898e5 | 2008-10-16 10:38:03 +0000 | [diff] [blame] | 45 | PLAYBACK_EVENT_TRACK_FINISH, |
Michael Sevakis | 023f6b6 | 2013-07-12 12:06:38 -0400 | [diff] [blame] | 46 | /* A new current user track has begun |
| 47 | data = &(struct track_event){} */ |
Jonathan Gordon | 71898e5 | 2008-10-16 10:38:03 +0000 | [diff] [blame] | 48 | PLAYBACK_EVENT_TRACK_CHANGE, |
Michael Sevakis | 023f6b6 | 2013-07-12 12:06:38 -0400 | [diff] [blame] | 49 | /* A manual skip is about to be processed |
| 50 | data = NULL */ |
Michael Sevakis | c537d59 | 2011-04-27 03:08:23 +0000 | [diff] [blame] | 51 | PLAYBACK_EVENT_TRACK_SKIP, |
Michael Sevakis | 023f6b6 | 2013-07-12 12:06:38 -0400 | [diff] [blame] | 52 | /* Next track medadata was just loaded |
| 53 | data = &(struct track_event){} */ |
Jonathan Gordon | 843c7ef | 2009-04-06 00:39:43 +0000 | [diff] [blame] | 54 | PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, |
Michael Sevakis | 023f6b6 | 2013-07-12 12:06:38 -0400 | [diff] [blame] | 55 | /* Voice is playing |
| 56 | data = &(bool){true|false} */ |
Michael Sevakis | e62cb56 | 2013-05-31 18:45:51 -0400 | [diff] [blame] | 57 | PLAYBACK_EVENT_VOICE_PLAYING, |
Jonathan Gordon | 71898e5 | 2008-10-16 10:38:03 +0000 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | /** Buffering events **/ |
| 61 | enum { |
| 62 | BUFFER_EVENT_BUFFER_LOW = (EVENT_CLASS_BUFFERING|1), |
| 63 | BUFFER_EVENT_REBUFFER, |
| 64 | BUFFER_EVENT_CLOSED, |
| 65 | BUFFER_EVENT_MOVED, |
| 66 | BUFFER_EVENT_FINISHED, |
Michael Sevakis | 0ebfb93 | 2012-05-21 02:18:46 -0400 | [diff] [blame] | 67 | BUFFER_EVENT_BUFFER_RESET |
Jonathan Gordon | 71898e5 | 2008-10-16 10:38:03 +0000 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | /** Generic GUI class events **/ |
| 71 | enum { |
Thomas Martitz | 4c48b59 | 2009-08-16 22:20:11 +0000 | [diff] [blame] | 72 | GUI_EVENT_STATUSBAR_TOGGLE = (EVENT_CLASS_GUI|1), |
Jonathan Gordon | 8b9fdb5 | 2009-01-05 09:59:11 +0000 | [diff] [blame] | 73 | GUI_EVENT_ACTIONUPDATE, |
Thomas Martitz | 2eb1cb6 | 2009-09-07 17:37:06 +0000 | [diff] [blame] | 74 | GUI_EVENT_THEME_CHANGED, |
Jonathan Gordon | 94139ac | 2012-03-20 21:27:33 +1100 | [diff] [blame] | 75 | /* Called when the UI viewport is cleared in the skin engine to |
| 76 | * notify the current screen that it needs to do an update */ |
| 77 | GUI_EVENT_NEED_UI_UPDATE, |
Jonathan Gordon | 71898e5 | 2008-10-16 10:38:03 +0000 | [diff] [blame] | 78 | }; |
| 79 | |
Jonathan Gordon | 7d5e0d7 | 2010-05-16 11:13:42 +0000 | [diff] [blame] | 80 | /** Recording events **/ |
| 81 | enum { |
| 82 | RECORDING_EVENT_START = (EVENT_CLASS_RECORDING|1), |
| 83 | RECORDING_EVENT_STOP, |
| 84 | }; |
Jonathan Gordon | 71898e5 | 2008-10-16 10:38:03 +0000 | [diff] [blame] | 85 | #endif |
| 86 | |
| 87 | |