summaryrefslogtreecommitdiff
path: root/apps/playback.h
blob: 6f3c4214a23c6069ba13c38f49e73b241a375e6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/***************************************************************************
 *             __________               __   ___.
 *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
 *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
 *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
 *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
 *                     \/            \/     \/    \/            \/
 * $Id$
 *
 * Copyright (C) 2005 Miika Pekkarinen
 *
 * All files in this archive are subject to the GNU General Public License.
 * See the file COPYING in the source tree root for full license agreement.
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 * KIND, either express or implied.
 *
 ****************************************************************************/

#ifndef _AUDIO_H
#define _AUDIO_H

#define AFMT_MPA_L1      0x0001  // MPEG Audio layer 1
#define AFMT_MPA_L2      0x0002  // MPEG Audio layer 2
#define AFMT_MPA_L3      0x0004  // MPEG Audio layer 3
  /* (MPEG-1, 2, 2.5 layers 1, 2 and 3 */
#define AFMT_PCM_WAV     0x0008  // Uncompressed PCM in a WAV file
#define AFMT_OGG_VORBIS  0x0010  // Ogg Vorbis
#define AFMT_FLAC        0x0020  // FLAC
#define AFMT_MPC         0x0040  // Musepack
#define AFMT_AAC         0x0080  // AAC
#define AFMT_APE         0x0100  // Monkey's Audio
#define AFMT_WMA         0x0200  // Windows Media Audio
#define AFMT_A52         0x0400  // A/52 (aka AC3) audio
#define AFMT_REAL        0x0800  // Realaudio
#define AFMT_UNKNOWN     0x1000  // Unknown file format

struct codec_api {
    off_t  filesize;
    off_t  curpos;
    size_t bitspersampe;
    
    /* For gapless mp3 */
    struct mp3entry *id3;
    struct mp3info *mp3data;
    bool *taginfo_ready;
    
    bool stop_codec;
    bool reload_codec;
    int seek_time;
    
    void* (*get_codec_memory)(size_t *size);
    bool (*audiobuffer_insert)(char *data, size_t length);
    void (*set_elapsed)(unsigned int value);
    
    size_t (*read_filebuf)(void *ptr, size_t size);
    void* (*request_buffer)(size_t *realsize, size_t reqsize);
    void (*advance_buffer)(size_t amount);
    void (*advance_buffer_loc)(void *ptr);
    bool (*seek_buffer)(off_t newpos);
    off_t (*mp3_get_filepos)(int newtime);
    bool (*request_next_track)(void);
};

#endif