diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-04-27 03:08:23 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-04-27 03:08:23 +0000 |
commit | c537d5958e8b421ac4f9bef6c8b9e7425a6cf167 (patch) | |
tree | 7ed36518fb6524da7bbd913ba7619b85b5d15d23 /apps/playback.h | |
parent | dcf0f8de4a37ff1d2ea510aef75fa67977a8bdcc (diff) | |
download | rockbox-c537d5958e8b421ac4f9bef6c8b9e7425a6cf167.tar.gz rockbox-c537d5958e8b421ac4f9bef6c8b9e7425a6cf167.zip |
Commit FS#12069 - Playback rework - first stages. Gives as thorough as possible a treatment of codec management, track change and metadata logic as possible while maintaining fairly narrow focus and not rewriting everything all at once. Please see the rockbox-dev mail archive on 2011-04-25 (Playback engine rework) for a more thorough manifest of what was addressed. Plugins and codecs become incompatible.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29785 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playback.h')
-rw-r--r-- | apps/playback.h | 78 |
1 files changed, 58 insertions, 20 deletions
diff --git a/apps/playback.h b/apps/playback.h index 76c394603f..225946cfaf 100644 --- a/apps/playback.h +++ b/apps/playback.h @@ -26,6 +26,16 @@ #include <stdlib.h> #include "config.h" +#if CONFIG_CODEC == SWCODEC +/* Including the code for fast previews is entirely optional since it + does add two more mp3entry's - for certain targets it may be less + beneficial such as flash-only storage */ +#if MEMORYSIZE > 2 +#define AUDIO_FAST_SKIP_PREVIEW +#endif + +#endif /* CONFIG_CODEC == SWCODEC */ + #ifdef HAVE_ALBUMART #include "bmp.h" @@ -67,6 +77,8 @@ long audio_filebufused(void); void audio_pre_ff_rewind(void); void audio_skip(int direction); void audio_hard_stop(void); /* Stops audio from serving playback */ + +void audio_set_cuesheet(int enable); #ifdef HAVE_CROSSFADE void audio_set_crossfade(int enable); #endif @@ -78,11 +90,10 @@ enum }; bool audio_restore_playback(int type); /* Restores the audio buffer to handle the requested playback */ size_t audio_get_filebuflen(void); -void audio_pcmbuf_position_callback(unsigned int time) ICODE_ATTR; -void audio_post_track_change(bool pcmbuf); -int get_audio_hid(void); -void audio_set_prev_elapsed(unsigned long setting); bool audio_buffer_state_trashed(void); + +/* Automatic transition? Only valid to call during the track change events, + otherwise the result is undefined. */ bool audio_automatic_skip(void); /* Define one constant that includes recording related functionality */ @@ -91,35 +102,62 @@ bool audio_automatic_skip(void); #endif enum { - Q_NULL = 0, + Q_NULL = 0, /* reserved */ + + /* -> audio */ Q_AUDIO_PLAY = 1, Q_AUDIO_STOP, Q_AUDIO_PAUSE, Q_AUDIO_SKIP, Q_AUDIO_PRE_FF_REWIND, Q_AUDIO_FF_REWIND, - Q_AUDIO_CHECK_NEW_TRACK, Q_AUDIO_FLUSH, - Q_AUDIO_TRACK_CHANGED, - Q_AUDIO_SEEK_COMPLETE, Q_AUDIO_DIR_SKIP, - Q_AUDIO_POSTINIT, - Q_AUDIO_FILL_BUFFER, - Q_AUDIO_FINISH_LOAD, - Q_CODEC_REQUEST_COMPLETE, - Q_CODEC_REQUEST_FAILED, + /* pcmbuf -> audio */ + Q_AUDIO_TRACK_CHANGED, + + /* audio -> audio */ + Q_AUDIO_FILL_BUFFER, /* continue buffering next track */ + + /* buffering -> audio */ + Q_AUDIO_BUFFERING, /* some buffer event */ + Q_AUDIO_FINISH_LOAD_TRACK, /* metadata is buffered */ + Q_AUDIO_HANDLE_FINISHED, /* some other type is buffered */ + + /* codec -> audio (*) */ + Q_AUDIO_CODEC_SEEK_COMPLETE, + Q_AUDIO_CODEC_COMPLETE, + + /* audio -> codec */ Q_CODEC_LOAD, - Q_CODEC_LOAD_DISK, + Q_CODEC_RUN, + Q_CODEC_PAUSE, + Q_CODEC_SEEK, + Q_CODEC_STOP, + Q_CODEC_UNLOAD, + + /*- miscellanous -*/ #ifdef AUDIO_HAVE_RECORDING - Q_AUDIO_LOAD_ENCODER, - Q_ENCODER_LOAD_DISK, - Q_ENCODER_RECORD, + /* -> codec */ + Q_AUDIO_LOAD_ENCODER, /* load an encoder for recording */ #endif - + /* -> codec */ Q_CODEC_DO_CALLBACK, - Q_CODEC_ACK, -}; + + /*- settings -*/ + +#ifdef HAVE_DISK_STORAGE + /* -> audio */ + Q_AUDIO_UPDATE_WATERMARK, /* buffering watermark needs updating */ #endif + /* -> audio */ + Q_AUDIO_REMAKE_AUDIO_BUFFER, /* buffer needs to be reinitialized */ +}; + +/* (*) If you change these, you must check audio_clear_track_notifications + in playback.c for correctness */ + +#endif /* _PLAYBACK_H */ |