From 8a237a829e0f63b61536f315209a6d0ea1477e31 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Mon, 4 Apr 2005 12:06:29 +0000 Subject: More audio code restructuring, mostly renaming functions so far git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6246 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/audio.h | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ firmware/export/mpeg.h | 56 ---------------------------------- 2 files changed, 81 insertions(+), 56 deletions(-) create mode 100644 firmware/export/audio.h (limited to 'firmware/export') 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 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2005 by Linus Nielsen Feltzing + * + * 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 + +#include + +#ifdef SIMULATOR +#define audio_play(x) sim_audio_play(x) +#endif + +#define AUDIO_STATUS_PLAY 1 +#define AUDIO_STATUS_PAUSE 2 +#define AUDIO_STATUS_RECORD 4 +#define AUDIO_STATUS_PRERECORD 8 +#define AUDIO_STATUS_ERROR 16 + +#define AUDIOERR_DISK_FULL 1 + +struct audio_debug +{ + int mp3buflen; + int mp3buf_write; + int mp3buf_swapwrite; + int mp3buf_read; + + int last_dma_chunk_size; + + bool dma_on; + bool playing; + bool play_pending; + bool is_playing; + bool filling; + bool dma_underrun; + + int unplayed_space; + int playable_space; + int unswapped_space; + + int low_watermark_level; + int lowest_watermark_level; +}; + +void audio_init(void); +void audio_play(int offset); +void audio_stop(void); +void audio_pause(void); +void audio_resume(void); +void audio_next(void); +void audio_prev(void); +int audio_status(void); +void audio_ff_rewind(int newtime); +void audio_flush_and_reload_tracks(void); +struct mp3entry* audio_current_track(void); +struct mp3entry* audio_next_track(void); +bool audio_has_changed_track(void); +void audio_get_debugdata(struct audio_debug *dbgdata); +void audio_set_buffer_margin(int seconds); +unsigned int audio_error(void); +void audio_error_clear(void); +int audio_get_file_pos(void); +void audio_beep(int duration); +void audio_init_playback(void); + +#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 @@ /* For ID3 info and VBR header */ #define MPEG_RESERVED_HEADER_SPACE (4096 + 1500) -#ifdef SIMULATOR -#define mpeg_play(x) sim_mpeg_play(x) -#endif - -struct mpeg_debug -{ - int mp3buflen; - int mp3buf_write; - int mp3buf_swapwrite; - int mp3buf_read; - - int last_dma_chunk_size; - - bool dma_on; - bool playing; - bool play_pending; - bool is_playing; - bool filling; - bool dma_underrun; - - int unplayed_space; - int playable_space; - int unswapped_space; - - int low_watermark_level; - int lowest_watermark_level; -}; - -void mpeg_init(void); -void mpeg_play(int offset); -void mpeg_stop(void); -void mpeg_pause(void); -void mpeg_resume(void); -void mpeg_next(void); -void mpeg_prev(void); -void mpeg_ff_rewind(int newtime); -void mpeg_flush_and_reload_tracks(void); -struct mp3entry* mpeg_current_track(void); -struct mp3entry* mpeg_next_track(void); -bool mpeg_has_changed_track(void); -int mpeg_status(void); #if (CONFIG_HWCODEC == MAS3587F) || defined(SIMULATOR) void mpeg_init_recording(void); -void mpeg_init_playback(void); void mpeg_record(const char *filename); void mpeg_new_file(const char *filename); void mpeg_set_recording_options(int frequency, int quality, @@ -97,25 +55,11 @@ unsigned long mpeg_num_recorded_bytes(void); void mpeg_pause_recording(void); void mpeg_resume_recording(void); #endif -void mpeg_get_debugdata(struct mpeg_debug *dbgdata); -void mpeg_set_buffer_margin(int seconds); -unsigned int mpeg_error(void); -void mpeg_error_clear(void); -int mpeg_get_file_pos(void); unsigned long mpeg_get_last_header(void); -void mpeg_beep(int duration); /* in order to keep the recording here, I have to expose this */ void rec_tick(void); void playback_tick(void); /* FixMe: get rid of this, use mp3_get_playtime() */ void mpeg_id3_options(bool _v1first); -#define MPEG_STATUS_PLAY 1 -#define MPEG_STATUS_PAUSE 2 -#define MPEG_STATUS_RECORD 4 -#define MPEG_STATUS_PRERECORD 8 -#define MPEG_STATUS_ERROR 16 - -#define MPEGERR_DISK_FULL 1 - #endif -- cgit v1.2.3