summaryrefslogtreecommitdiff
path: root/apps/plugin.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2013-07-14 07:59:39 -0400
committerMichael Sevakis <jethead71@rockbox.org>2014-03-10 04:12:30 +0100
commit31b712286721dd606940c7b557d03e3f714b9604 (patch)
tree8c4a4cc32e9000ea721ebb23aa3c0129ca97bf53 /apps/plugin.h
parentdda54b85daa83b7803b4fb189ab45859f96ff3f9 (diff)
downloadrockbox-31b712286721dd606940c7b557d03e3f714b9604.tar.gz
rockbox-31b712286721dd606940c7b557d03e3f714b9604.zip
Implement time-based resume and playback start.
This complements offset-based resume and playback start funcionality. The implementation is global on both HWCODEC and SWCODEC. Basically, if either the specified elapsed or offset are non-zero, it indicates a mid-track resume. To resume by time only, set elapsed to nonzero and offset to zero. To resume by offset only, set offset to nonzero and elapsed to zero. Which one the codec uses and which has priority is up to the codec; however, using an elapsed time covers more cases: * Codecs not able to use an offset such as VGM or other atomic formats * Starting playback at a nonzero elapsed time from a source that contains no offset, such as a cuesheet The change re-versions pretty much everything from tagcache to nvram. Change-Id: Ic7aebb24e99a03ae99585c5e236eba960d163f38 Reviewed-on: http://gerrit.rockbox.org/516 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested: Michael Sevakis <jethead71@rockbox.org>
Diffstat (limited to 'apps/plugin.h')
-rw-r--r--apps/plugin.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/plugin.h b/apps/plugin.h
index 764af4a6b7..ffdfa8fb77 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -160,12 +160,12 @@ void* plugin_get_buffer(size_t *buffer_size);
160#define PLUGIN_MAGIC 0x526F634B /* RocK */ 160#define PLUGIN_MAGIC 0x526F634B /* RocK */
161 161
162/* increase this every time the api struct changes */ 162/* increase this every time the api struct changes */
163#define PLUGIN_API_VERSION 226 163#define PLUGIN_API_VERSION 227
164 164
165/* update this to latest version if a change to the api struct breaks 165/* update this to latest version if a change to the api struct breaks
166 backwards compatibility (and please take the opportunity to sort in any 166 backwards compatibility (and please take the opportunity to sort in any
167 new function which are "waiting" at the end of the function table) */ 167 new function which are "waiting" at the end of the function table) */
168#define PLUGIN_MIN_API_VERSION 226 168#define PLUGIN_MIN_API_VERSION 227
169 169
170/* plugin return codes */ 170/* plugin return codes */
171/* internal returns start at 0x100 to make exit(1..255) work */ 171/* internal returns start at 0x100 to make exit(1..255) work */
@@ -723,8 +723,10 @@ struct plugin_api {
723 /* playback control */ 723 /* playback control */
724 int (*playlist_amount)(void); 724 int (*playlist_amount)(void);
725 int (*playlist_resume)(void); 725 int (*playlist_resume)(void);
726 void (*playlist_resume_track)(int start_index, unsigned int crc, int offset); 726 void (*playlist_resume_track)(int start_index, unsigned int crc,
727 void (*playlist_start)(int start_index, int offset); 727 unsigned long elapsed, unsigned long offset);
728 void (*playlist_start)(int start_index, unsigned long elapsed,
729 unsigned long offset);
728 int (*playlist_add)(const char *filename); 730 int (*playlist_add)(const char *filename);
729 void (*playlist_sync)(struct playlist_info* playlist); 731 void (*playlist_sync)(struct playlist_info* playlist);
730 int (*playlist_remove_all_tracks)(struct playlist_info *playlist); 732 int (*playlist_remove_all_tracks)(struct playlist_info *playlist);
@@ -735,7 +737,7 @@ struct plugin_api {
735 const char *dirname, int position, bool queue, 737 const char *dirname, int position, bool queue,
736 bool recurse); 738 bool recurse);
737 int (*playlist_shuffle)(int random_seed, int start_index); 739 int (*playlist_shuffle)(int random_seed, int start_index);
738 void (*audio_play)(long offset); 740 void (*audio_play)(unsigned long elapsed, unsigned long offset);
739 void (*audio_stop)(void); 741 void (*audio_stop)(void);
740 void (*audio_pause)(void); 742 void (*audio_pause)(void);
741 void (*audio_resume)(void); 743 void (*audio_resume)(void);