initial commit for a rework to put the fade on pause feature into the playback engine
[kugel-rb.git] / apps / playback.h
blobf82ae6589cc29bda224611071012487c9ebed47b
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2005 Miika Pekkarinen
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef _PLAYBACK_H
23 #define _PLAYBACK_H
25 #include <stdbool.h>
26 #include <stdlib.h>
27 #include "config.h"
29 #ifdef HAVE_ALBUMART
31 #include "bmp.h"
33 * Returns the handle id of the buffered albumart for the given slot id
34 **/
35 int playback_current_aa_hid(int slot);
38 * Hands out an albumart slot for buffering albumart using the size
39 * int the passed dim struct, it copies the data of dim in order to
40 * be safe to be reused for other code
42 * The slot may be reused if other code calls this with the same dimensions
43 * in dim, so if you change dim release and claim a new slot
45 * Save to call from other threads */
46 int playback_claim_aa_slot(struct dim *dim);
49 * Releases the albumart slot with given id
51 * Save to call from other threads */
52 void playback_release_aa_slot(int slot);
53 #endif
55 /* Functions */
56 void voice_wait(void);
57 bool audio_is_thread_ready(void);
58 int audio_track_count(void);
59 long audio_filebufused(void);
60 void audio_pre_ff_rewind(void);
61 void audio_skip(int direction);
62 void audio_hard_stop(void); /* Stops audio from serving playback */
63 #ifdef HAVE_CROSSFADE
64 void audio_set_crossfade(int enable);
65 #endif
66 void playback_fade_on_pause(bool fade_in, void (*update_func)(void));
68 enum
70 AUDIO_WANT_PLAYBACK = 0,
71 AUDIO_WANT_VOICE,
73 bool audio_restore_playback(int type); /* Restores the audio buffer to handle the requested playback */
74 size_t audio_get_filebuflen(void);
75 void audio_pcmbuf_position_callback(unsigned int time) ICODE_ATTR;
76 void audio_post_track_change(bool pcmbuf);
77 int get_audio_hid(void);
78 int *get_codec_hid(void);
79 void audio_set_prev_elapsed(unsigned long setting);
80 bool audio_buffer_state_trashed(void);
82 /* Define one constant that includes recording related functionality */
83 #if defined(HAVE_RECORDING) && !defined(SIMULATOR)
84 #define AUDIO_HAVE_RECORDING
85 #endif
87 enum {
88 Q_NULL = 0,
89 Q_AUDIO_PLAY = 1,
90 Q_AUDIO_STOP,
91 Q_AUDIO_PAUSE,
92 Q_AUDIO_SKIP,
93 Q_AUDIO_PRE_FF_REWIND,
94 Q_AUDIO_FF_REWIND,
95 Q_AUDIO_CHECK_NEW_TRACK,
96 Q_AUDIO_FLUSH,
97 Q_AUDIO_TRACK_CHANGED,
98 Q_AUDIO_DIR_SKIP,
99 Q_AUDIO_POSTINIT,
100 Q_AUDIO_FILL_BUFFER,
101 Q_AUDIO_FINISH_LOAD,
102 Q_CODEC_REQUEST_COMPLETE,
103 Q_CODEC_REQUEST_FAILED,
105 Q_CODEC_LOAD,
106 Q_CODEC_LOAD_DISK,
108 #ifdef AUDIO_HAVE_RECORDING
109 Q_ENCODER_LOAD_DISK,
110 Q_ENCODER_RECORD,
111 #endif
113 Q_CODEC_DO_CALLBACK,
116 #endif