diff options
Diffstat (limited to 'apps/playback.h')
-rw-r--r-- | apps/playback.h | 78 |
1 files changed, 58 insertions, 20 deletions
diff --git a/apps/playback.h b/apps/playback.h index 76c394603f..225946cfaf 100644 --- a/apps/playback.h +++ b/apps/playback.h | |||
@@ -26,6 +26,16 @@ | |||
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include "config.h" | 27 | #include "config.h" |
28 | 28 | ||
29 | #if CONFIG_CODEC == SWCODEC | ||
30 | /* Including the code for fast previews is entirely optional since it | ||
31 | does add two more mp3entry's - for certain targets it may be less | ||
32 | beneficial such as flash-only storage */ | ||
33 | #if MEMORYSIZE > 2 | ||
34 | #define AUDIO_FAST_SKIP_PREVIEW | ||
35 | #endif | ||
36 | |||
37 | #endif /* CONFIG_CODEC == SWCODEC */ | ||
38 | |||
29 | #ifdef HAVE_ALBUMART | 39 | #ifdef HAVE_ALBUMART |
30 | 40 | ||
31 | #include "bmp.h" | 41 | #include "bmp.h" |
@@ -67,6 +77,8 @@ long audio_filebufused(void); | |||
67 | void audio_pre_ff_rewind(void); | 77 | void audio_pre_ff_rewind(void); |
68 | void audio_skip(int direction); | 78 | void audio_skip(int direction); |
69 | void audio_hard_stop(void); /* Stops audio from serving playback */ | 79 | void audio_hard_stop(void); /* Stops audio from serving playback */ |
80 | |||
81 | void audio_set_cuesheet(int enable); | ||
70 | #ifdef HAVE_CROSSFADE | 82 | #ifdef HAVE_CROSSFADE |
71 | void audio_set_crossfade(int enable); | 83 | void audio_set_crossfade(int enable); |
72 | #endif | 84 | #endif |
@@ -78,11 +90,10 @@ enum | |||
78 | }; | 90 | }; |
79 | bool audio_restore_playback(int type); /* Restores the audio buffer to handle the requested playback */ | 91 | bool audio_restore_playback(int type); /* Restores the audio buffer to handle the requested playback */ |
80 | size_t audio_get_filebuflen(void); | 92 | size_t audio_get_filebuflen(void); |
81 | void audio_pcmbuf_position_callback(unsigned int time) ICODE_ATTR; | ||
82 | void audio_post_track_change(bool pcmbuf); | ||
83 | int get_audio_hid(void); | ||
84 | void audio_set_prev_elapsed(unsigned long setting); | ||
85 | bool audio_buffer_state_trashed(void); | 93 | bool audio_buffer_state_trashed(void); |
94 | |||
95 | /* Automatic transition? Only valid to call during the track change events, | ||
96 | otherwise the result is undefined. */ | ||
86 | bool audio_automatic_skip(void); | 97 | bool audio_automatic_skip(void); |
87 | 98 | ||
88 | /* Define one constant that includes recording related functionality */ | 99 | /* Define one constant that includes recording related functionality */ |
@@ -91,35 +102,62 @@ bool audio_automatic_skip(void); | |||
91 | #endif | 102 | #endif |
92 | 103 | ||
93 | enum { | 104 | enum { |
94 | Q_NULL = 0, | 105 | Q_NULL = 0, /* reserved */ |
106 | |||
107 | /* -> audio */ | ||
95 | Q_AUDIO_PLAY = 1, | 108 | Q_AUDIO_PLAY = 1, |
96 | Q_AUDIO_STOP, | 109 | Q_AUDIO_STOP, |
97 | Q_AUDIO_PAUSE, | 110 | Q_AUDIO_PAUSE, |
98 | Q_AUDIO_SKIP, | 111 | Q_AUDIO_SKIP, |
99 | Q_AUDIO_PRE_FF_REWIND, | 112 | Q_AUDIO_PRE_FF_REWIND, |
100 | Q_AUDIO_FF_REWIND, | 113 | Q_AUDIO_FF_REWIND, |
101 | Q_AUDIO_CHECK_NEW_TRACK, | ||
102 | Q_AUDIO_FLUSH, | 114 | Q_AUDIO_FLUSH, |
103 | Q_AUDIO_TRACK_CHANGED, | ||
104 | Q_AUDIO_SEEK_COMPLETE, | ||
105 | Q_AUDIO_DIR_SKIP, | 115 | Q_AUDIO_DIR_SKIP, |
106 | Q_AUDIO_POSTINIT, | ||
107 | Q_AUDIO_FILL_BUFFER, | ||
108 | Q_AUDIO_FINISH_LOAD, | ||
109 | Q_CODEC_REQUEST_COMPLETE, | ||
110 | Q_CODEC_REQUEST_FAILED, | ||
111 | 116 | ||
117 | /* pcmbuf -> audio */ | ||
118 | Q_AUDIO_TRACK_CHANGED, | ||
119 | |||
120 | /* audio -> audio */ | ||
121 | Q_AUDIO_FILL_BUFFER, /* continue buffering next track */ | ||
122 | |||
123 | /* buffering -> audio */ | ||
124 | Q_AUDIO_BUFFERING, /* some buffer event */ | ||
125 | Q_AUDIO_FINISH_LOAD_TRACK, /* metadata is buffered */ | ||
126 | Q_AUDIO_HANDLE_FINISHED, /* some other type is buffered */ | ||
127 | |||
128 | /* codec -> audio (*) */ | ||
129 | Q_AUDIO_CODEC_SEEK_COMPLETE, | ||
130 | Q_AUDIO_CODEC_COMPLETE, | ||
131 | |||
132 | /* audio -> codec */ | ||
112 | Q_CODEC_LOAD, | 133 | Q_CODEC_LOAD, |
113 | Q_CODEC_LOAD_DISK, | 134 | Q_CODEC_RUN, |
135 | Q_CODEC_PAUSE, | ||
136 | Q_CODEC_SEEK, | ||
137 | Q_CODEC_STOP, | ||
138 | Q_CODEC_UNLOAD, | ||
139 | |||
114 | 140 | ||
141 | /*- miscellanous -*/ | ||
115 | #ifdef AUDIO_HAVE_RECORDING | 142 | #ifdef AUDIO_HAVE_RECORDING |
116 | Q_AUDIO_LOAD_ENCODER, | 143 | /* -> codec */ |
117 | Q_ENCODER_LOAD_DISK, | 144 | Q_AUDIO_LOAD_ENCODER, /* load an encoder for recording */ |
118 | Q_ENCODER_RECORD, | ||
119 | #endif | 145 | #endif |
120 | 146 | /* -> codec */ | |
121 | Q_CODEC_DO_CALLBACK, | 147 | Q_CODEC_DO_CALLBACK, |
122 | Q_CODEC_ACK, | ||
123 | }; | ||
124 | 148 | ||
149 | |||
150 | /*- settings -*/ | ||
151 | |||
152 | #ifdef HAVE_DISK_STORAGE | ||
153 | /* -> audio */ | ||
154 | Q_AUDIO_UPDATE_WATERMARK, /* buffering watermark needs updating */ | ||
125 | #endif | 155 | #endif |
156 | /* -> audio */ | ||
157 | Q_AUDIO_REMAKE_AUDIO_BUFFER, /* buffer needs to be reinitialized */ | ||
158 | }; | ||
159 | |||
160 | /* (*) If you change these, you must check audio_clear_track_notifications | ||
161 | in playback.c for correctness */ | ||
162 | |||
163 | #endif /* _PLAYBACK_H */ | ||