diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-04-04 12:06:29 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-04-04 12:06:29 +0000 |
commit | 8a237a829e0f63b61536f315209a6d0ea1477e31 (patch) | |
tree | 1fe54329fe776aa7bc982a37203cb61c13244a48 /firmware/export | |
parent | ec4e9b8d600c53add3c8bf6eb7fe1975dba141a7 (diff) | |
download | rockbox-8a237a829e0f63b61536f315209a6d0ea1477e31.tar.gz rockbox-8a237a829e0f63b61536f315209a6d0ea1477e31.zip |
More audio code restructuring, mostly renaming functions so far
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6246 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/audio.h | 81 | ||||
-rw-r--r-- | firmware/export/mpeg.h | 56 |
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 | |||
36 | struct 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 | |||
60 | void audio_init(void); | ||
61 | void audio_play(int offset); | ||
62 | void audio_stop(void); | ||
63 | void audio_pause(void); | ||
64 | void audio_resume(void); | ||
65 | void audio_next(void); | ||
66 | void audio_prev(void); | ||
67 | int audio_status(void); | ||
68 | void audio_ff_rewind(int newtime); | ||
69 | void audio_flush_and_reload_tracks(void); | ||
70 | struct mp3entry* audio_current_track(void); | ||
71 | struct mp3entry* audio_next_track(void); | ||
72 | bool audio_has_changed_track(void); | ||
73 | void audio_get_debugdata(struct audio_debug *dbgdata); | ||
74 | void audio_set_buffer_margin(int seconds); | ||
75 | unsigned int audio_error(void); | ||
76 | void audio_error_clear(void); | ||
77 | int audio_get_file_pos(void); | ||
78 | void audio_beep(int duration); | ||
79 | void 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 | |||
49 | struct 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 | |||
73 | void mpeg_init(void); | ||
74 | void mpeg_play(int offset); | ||
75 | void mpeg_stop(void); | ||
76 | void mpeg_pause(void); | ||
77 | void mpeg_resume(void); | ||
78 | void mpeg_next(void); | ||
79 | void mpeg_prev(void); | ||
80 | void mpeg_ff_rewind(int newtime); | ||
81 | void mpeg_flush_and_reload_tracks(void); | ||
82 | struct mp3entry* mpeg_current_track(void); | ||
83 | struct mp3entry* mpeg_next_track(void); | ||
84 | bool mpeg_has_changed_track(void); | ||
85 | int mpeg_status(void); | ||
86 | #if (CONFIG_HWCODEC == MAS3587F) || defined(SIMULATOR) | 45 | #if (CONFIG_HWCODEC == MAS3587F) || defined(SIMULATOR) |
87 | void mpeg_init_recording(void); | 46 | void mpeg_init_recording(void); |
88 | void mpeg_init_playback(void); | ||
89 | void mpeg_record(const char *filename); | 47 | void mpeg_record(const char *filename); |
90 | void mpeg_new_file(const char *filename); | 48 | void mpeg_new_file(const char *filename); |
91 | void mpeg_set_recording_options(int frequency, int quality, | 49 | void mpeg_set_recording_options(int frequency, int quality, |
@@ -97,25 +55,11 @@ unsigned long mpeg_num_recorded_bytes(void); | |||
97 | void mpeg_pause_recording(void); | 55 | void mpeg_pause_recording(void); |
98 | void mpeg_resume_recording(void); | 56 | void mpeg_resume_recording(void); |
99 | #endif | 57 | #endif |
100 | void mpeg_get_debugdata(struct mpeg_debug *dbgdata); | ||
101 | void mpeg_set_buffer_margin(int seconds); | ||
102 | unsigned int mpeg_error(void); | ||
103 | void mpeg_error_clear(void); | ||
104 | int mpeg_get_file_pos(void); | ||
105 | unsigned long mpeg_get_last_header(void); | 58 | unsigned long mpeg_get_last_header(void); |
106 | void 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 */ |
109 | void rec_tick(void); | 61 | void rec_tick(void); |
110 | void playback_tick(void); /* FixMe: get rid of this, use mp3_get_playtime() */ | 62 | void playback_tick(void); /* FixMe: get rid of this, use mp3_get_playtime() */ |
111 | void mpeg_id3_options(bool _v1first); | 63 | void 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 |