Android: Partly revert r29569 and only call the new getJavaEnvironment() when needed.
[maemo-rb.git] / apps / playback.h
blob76c394603f00fc13a65eacb8969bfe2fbf1a8699
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"
32 #include "metadata.h"
34 * Returns the handle id of the buffered albumart for the given slot id
35 **/
36 int playback_current_aa_hid(int slot);
39 * Hands out an albumart slot for buffering albumart using the size
40 * int the passed dim struct, it copies the data of dim in order to
41 * be safe to be reused for other code
43 * The slot may be reused if other code calls this with the same dimensions
44 * in dim, so if you change dim release and claim a new slot
46 * Save to call from other threads */
47 int playback_claim_aa_slot(struct dim *dim);
50 * Releases the albumart slot with given id
52 * Save to call from other threads */
53 void playback_release_aa_slot(int slot);
55 struct bufopen_bitmap_data {
56 struct dim *dim;
57 struct mp3_albumart *embedded_albumart;
60 #endif
62 /* Functions */
63 void voice_wait(void);
64 bool audio_is_thread_ready(void);
65 int audio_track_count(void);
66 long audio_filebufused(void);
67 void audio_pre_ff_rewind(void);
68 void audio_skip(int direction);
69 void audio_hard_stop(void); /* Stops audio from serving playback */
70 #ifdef HAVE_CROSSFADE
71 void audio_set_crossfade(int enable);
72 #endif
74 enum
76 AUDIO_WANT_PLAYBACK = 0,
77 AUDIO_WANT_VOICE,
79 bool audio_restore_playback(int type); /* Restores the audio buffer to handle the requested playback */
80 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);
86 bool audio_automatic_skip(void);
88 /* Define one constant that includes recording related functionality */
89 #if defined(HAVE_RECORDING) && !defined(SIMULATOR)
90 #define AUDIO_HAVE_RECORDING
91 #endif
93 enum {
94 Q_NULL = 0,
95 Q_AUDIO_PLAY = 1,
96 Q_AUDIO_STOP,
97 Q_AUDIO_PAUSE,
98 Q_AUDIO_SKIP,
99 Q_AUDIO_PRE_FF_REWIND,
100 Q_AUDIO_FF_REWIND,
101 Q_AUDIO_CHECK_NEW_TRACK,
102 Q_AUDIO_FLUSH,
103 Q_AUDIO_TRACK_CHANGED,
104 Q_AUDIO_SEEK_COMPLETE,
105 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,
112 Q_CODEC_LOAD,
113 Q_CODEC_LOAD_DISK,
115 #ifdef AUDIO_HAVE_RECORDING
116 Q_AUDIO_LOAD_ENCODER,
117 Q_ENCODER_LOAD_DISK,
118 Q_ENCODER_RECORD,
119 #endif
121 Q_CODEC_DO_CALLBACK,
122 Q_CODEC_ACK,
125 #endif