summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/audio.h81
-rw-r--r--firmware/export/mpeg.h56
2 files changed, 81 insertions, 56 deletions
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
new file mode 100644
index 0000000000..b276490ab3
--- /dev/null
+++ b/firmware/export/audio.h
@@ -0,0 +1,81 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 by Linus Nielsen Feltzing
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#ifndef AUDIO_H
20#define AUDIO_H
21
22#include <stdbool.h>
23
24#ifdef SIMULATOR
25#define audio_play(x) sim_audio_play(x)
26#endif
27
28#define AUDIO_STATUS_PLAY 1
29#define AUDIO_STATUS_PAUSE 2
30#define AUDIO_STATUS_RECORD 4
31#define AUDIO_STATUS_PRERECORD 8
32#define AUDIO_STATUS_ERROR 16
33
34#define AUDIOERR_DISK_FULL 1
35
36struct audio_debug
37{
38 int mp3buflen;
39 int mp3buf_write;
40 int mp3buf_swapwrite;
41 int mp3buf_read;
42
43 int last_dma_chunk_size;
44
45 bool dma_on;
46 bool playing;
47 bool play_pending;
48 bool is_playing;
49 bool filling;
50 bool dma_underrun;
51
52 int unplayed_space;
53 int playable_space;
54 int unswapped_space;
55
56 int low_watermark_level;
57 int lowest_watermark_level;
58};
59
60void audio_init(void);
61void audio_play(int offset);
62void audio_stop(void);
63void audio_pause(void);
64void audio_resume(void);
65void audio_next(void);
66void audio_prev(void);
67int audio_status(void);
68void audio_ff_rewind(int newtime);
69void audio_flush_and_reload_tracks(void);
70struct mp3entry* audio_current_track(void);
71struct mp3entry* audio_next_track(void);
72bool audio_has_changed_track(void);
73void audio_get_debugdata(struct audio_debug *dbgdata);
74void audio_set_buffer_margin(int seconds);
75unsigned int audio_error(void);
76void audio_error_clear(void);
77int audio_get_file_pos(void);
78void audio_beep(int duration);
79void audio_init_playback(void);
80
81#endif
diff --git a/firmware/export/mpeg.h b/firmware/export/mpeg.h
index 479c5f2317..ca0de1f823 100644
--- a/firmware/export/mpeg.h
+++ b/firmware/export/mpeg.h
@@ -42,50 +42,8 @@
42/* For ID3 info and VBR header */ 42/* For ID3 info and VBR header */
43#define MPEG_RESERVED_HEADER_SPACE (4096 + 1500) 43#define MPEG_RESERVED_HEADER_SPACE (4096 + 1500)
44 44
45#ifdef SIMULATOR
46#define mpeg_play(x) sim_mpeg_play(x)
47#endif
48
49struct mpeg_debug
50{
51 int mp3buflen;
52 int mp3buf_write;
53 int mp3buf_swapwrite;
54 int mp3buf_read;
55
56 int last_dma_chunk_size;
57
58 bool dma_on;
59 bool playing;
60 bool play_pending;
61 bool is_playing;
62 bool filling;
63 bool dma_underrun;
64
65 int unplayed_space;
66 int playable_space;
67 int unswapped_space;
68
69 int low_watermark_level;
70 int lowest_watermark_level;
71};
72
73void mpeg_init(void);
74void mpeg_play(int offset);
75void mpeg_stop(void);
76void mpeg_pause(void);
77void mpeg_resume(void);
78void mpeg_next(void);
79void mpeg_prev(void);
80void mpeg_ff_rewind(int newtime);
81void mpeg_flush_and_reload_tracks(void);
82struct mp3entry* mpeg_current_track(void);
83struct mp3entry* mpeg_next_track(void);
84bool mpeg_has_changed_track(void);
85int mpeg_status(void);
86#if (CONFIG_HWCODEC == MAS3587F) || defined(SIMULATOR) 45#if (CONFIG_HWCODEC == MAS3587F) || defined(SIMULATOR)
87void mpeg_init_recording(void); 46void mpeg_init_recording(void);
88void mpeg_init_playback(void);
89void mpeg_record(const char *filename); 47void mpeg_record(const char *filename);
90void mpeg_new_file(const char *filename); 48void mpeg_new_file(const char *filename);
91void mpeg_set_recording_options(int frequency, int quality, 49void mpeg_set_recording_options(int frequency, int quality,
@@ -97,25 +55,11 @@ unsigned long mpeg_num_recorded_bytes(void);
97void mpeg_pause_recording(void); 55void mpeg_pause_recording(void);
98void mpeg_resume_recording(void); 56void mpeg_resume_recording(void);
99#endif 57#endif
100void mpeg_get_debugdata(struct mpeg_debug *dbgdata);
101void mpeg_set_buffer_margin(int seconds);
102unsigned int mpeg_error(void);
103void mpeg_error_clear(void);
104int mpeg_get_file_pos(void);
105unsigned long mpeg_get_last_header(void); 58unsigned long mpeg_get_last_header(void);
106void mpeg_beep(int duration);
107 59
108/* in order to keep the recording here, I have to expose this */ 60/* in order to keep the recording here, I have to expose this */
109void rec_tick(void); 61void rec_tick(void);
110void playback_tick(void); /* FixMe: get rid of this, use mp3_get_playtime() */ 62void playback_tick(void); /* FixMe: get rid of this, use mp3_get_playtime() */
111void mpeg_id3_options(bool _v1first); 63void mpeg_id3_options(bool _v1first);
112 64
113#define MPEG_STATUS_PLAY 1
114#define MPEG_STATUS_PAUSE 2
115#define MPEG_STATUS_RECORD 4
116#define MPEG_STATUS_PRERECORD 8
117#define MPEG_STATUS_ERROR 16
118
119#define MPEGERR_DISK_FULL 1
120
121#endif 65#endif