diff options
author | William Wilgus <wilgus.william@gmail.com> | 2023-03-20 22:15:33 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2023-03-25 10:02:43 -0400 |
commit | a2e5d9563f9dec84907f4f2060af6dfad895c4ba (patch) | |
tree | e2c27f4fca350e1f1ce8ba2ef8fe30fbb341c3c0 /apps/plugin.h | |
parent | 2e99e2175b48cc00274b03bb4aecf5d01403110d (diff) | |
download | rockbox-a2e5d9563f9dec84907f4f2060af6dfad895c4ba.tar.gz rockbox-a2e5d9563f9dec84907f4f2060af6dfad895c4ba.zip |
[Feature] resume TSR plugins after interruption WIP
save tsr plugin path for later
resume tsr plugin when user stops the interrupting plugin
expand return of tsr_exit function to allow
continue, suspend, terminate
tsr plugins check parameter at start to determine if
the plugin is being resumed
Change-Id: I6fc70de664c7771e7dbc9a1af7a831e7b50b1d15
Diffstat (limited to 'apps/plugin.h')
-rw-r--r-- | apps/plugin.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/apps/plugin.h b/apps/plugin.h index c54ef180ec..3eb4101cbe 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -162,7 +162,7 @@ int plugin_open(const char *plugin, const char *parameter); | |||
162 | * when this happens please take the opportunity to sort in | 162 | * when this happens please take the opportunity to sort in |
163 | * any new functions "waiting" at the end of the list. | 163 | * any new functions "waiting" at the end of the list. |
164 | */ | 164 | */ |
165 | #define PLUGIN_API_VERSION 266 | 165 | #define PLUGIN_API_VERSION 267 |
166 | 166 | ||
167 | /* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ | 167 | /* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ |
168 | 168 | ||
@@ -179,6 +179,12 @@ enum plugin_status { | |||
179 | PLUGIN_ERROR = -1, | 179 | PLUGIN_ERROR = -1, |
180 | }; | 180 | }; |
181 | 181 | ||
182 | enum plugin_tsr_status { | ||
183 | PLUGIN_TSR_CONTINUE = 0, /* TSR continues running */ | ||
184 | PLUGIN_TSR_SUSPEND, /* TSR exits but will restart later */ | ||
185 | PLUGIN_TSR_TERMINATE, /* TSR exits and will not be restarted */ | ||
186 | }; | ||
187 | |||
182 | /* NOTE: To support backwards compatibility, only add new functions at | 188 | /* NOTE: To support backwards compatibility, only add new functions at |
183 | the end of the structure. Every time you add a new function, | 189 | the end of the structure. Every time you add a new function, |
184 | remember to increase PLUGIN_API_VERSION. If you make changes to the | 190 | remember to increase PLUGIN_API_VERSION. If you make changes to the |
@@ -195,6 +201,8 @@ struct plugin_api { | |||
195 | /* lcd */ | 201 | /* lcd */ |
196 | void (*splash)(int ticks, const char *str); | 202 | void (*splash)(int ticks, const char *str); |
197 | void (*splashf)(int ticks, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3); | 203 | void (*splashf)(int ticks, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3); |
204 | void (*splash_progress)(int current, int total, const char *fmt, ...) ATTRIBUTE_PRINTF(3, 4); | ||
205 | void (*splash_progress_set_delay)(long delay_ticks); | ||
198 | #ifdef HAVE_LCD_CONTRAST | 206 | #ifdef HAVE_LCD_CONTRAST |
199 | void (*lcd_set_contrast)(int x); | 207 | void (*lcd_set_contrast)(int x); |
200 | #endif | 208 | #endif |
@@ -488,6 +496,8 @@ struct plugin_api { | |||
488 | void (*set_dirfilter)(int l_dirfilter); | 496 | void (*set_dirfilter)(int l_dirfilter); |
489 | 497 | ||
490 | void (*onplay_show_playlist_menu)(const char* path, void (*playlist_insert_cb)); | 498 | void (*onplay_show_playlist_menu)(const char* path, void (*playlist_insert_cb)); |
499 | void (*onplay_show_playlist_cat_menu)(const char* track_name, int attr, | ||
500 | void (*add_to_pl_cb)); | ||
491 | bool (*browse_id3)(struct mp3entry *id3, | 501 | bool (*browse_id3)(struct mp3entry *id3, |
492 | int playlist_display_index, int playlist_amount, | 502 | int playlist_display_index, int playlist_amount, |
493 | struct tm *modified); | 503 | struct tm *modified); |
@@ -660,6 +670,7 @@ struct plugin_api { | |||
660 | void* (*buflib_get_data)(struct buflib_context* ctx, int handle); | 670 | void* (*buflib_get_data)(struct buflib_context* ctx, int handle); |
661 | 671 | ||
662 | /* sound */ | 672 | /* sound */ |
673 | void (*adjust_volume)(int steps); | ||
663 | void (*sound_set)(int setting, int value); | 674 | void (*sound_set)(int setting, int value); |
664 | int (*sound_current)(int setting); /*stub*/ | 675 | int (*sound_current)(int setting); /*stub*/ |
665 | int (*sound_default)(int setting); | 676 | int (*sound_default)(int setting); |
@@ -769,6 +780,7 @@ struct plugin_api { | |||
769 | bool (*tagcache_fill_tags)(struct mp3entry *id3, const char *filename); | 780 | bool (*tagcache_fill_tags)(struct mp3entry *id3, const char *filename); |
770 | #endif | 781 | #endif |
771 | #endif | 782 | #endif |
783 | bool (*tagtree_subentries_do_action)(bool (*action_cb)(const char *file_name)); | ||
772 | #endif /* HAVE_TAGCACHE */ | 784 | #endif /* HAVE_TAGCACHE */ |
773 | 785 | ||
774 | #ifdef HAVE_ALBUMART | 786 | #ifdef HAVE_ALBUMART |
@@ -782,6 +794,7 @@ struct plugin_api { | |||
782 | int (*playlist_resume)(void); | 794 | int (*playlist_resume)(void); |
783 | void (*playlist_resume_track)(int start_index, unsigned int crc, | 795 | void (*playlist_resume_track)(int start_index, unsigned int crc, |
784 | unsigned long elapsed, unsigned long offset); | 796 | unsigned long elapsed, unsigned long offset); |
797 | void (*playlist_set_modified)(struct playlist_info *playlist, bool modified); | ||
785 | void (*playlist_start)(int start_index, unsigned long elapsed, | 798 | void (*playlist_start)(int start_index, unsigned long elapsed, |
786 | unsigned long offset); | 799 | unsigned long offset); |
787 | int (*playlist_add)(const char *filename); | 800 | int (*playlist_add)(const char *filename); |
@@ -932,29 +945,20 @@ struct plugin_api { | |||
932 | void* (*plugin_get_buffer)(size_t *buffer_size); | 945 | void* (*plugin_get_buffer)(size_t *buffer_size); |
933 | void* (*plugin_get_audio_buffer)(size_t *buffer_size); | 946 | void* (*plugin_get_audio_buffer)(size_t *buffer_size); |
934 | void (*plugin_release_audio_buffer)(void); | 947 | void (*plugin_release_audio_buffer)(void); |
935 | void (*plugin_tsr)(bool (*exit_callback)(bool reenter)); | 948 | void (*plugin_tsr)(int (*exit_callback)(bool reenter)); |
936 | char* (*plugin_get_current_filename)(void); | 949 | char* (*plugin_get_current_filename)(void); |
937 | size_t (*plugin_reserve_buffer)(size_t buffer_size); | 950 | size_t (*plugin_reserve_buffer)(size_t buffer_size); |
938 | /* reboot and poweroff */ | 951 | /* reboot and poweroff */ |
939 | void (*sys_poweroff)(void); | 952 | void (*sys_poweroff)(void); |
940 | void (*sys_reboot)(void); | 953 | void (*sys_reboot)(void); |
941 | /* pathfuncs */ | 954 | /* pathfuncs */ |
955 | void (*fix_path_part)(char* path, int offset, int count); | ||
942 | #ifdef HAVE_MULTIVOLUME | 956 | #ifdef HAVE_MULTIVOLUME |
943 | int (*path_strip_volume)(const char *name, const char **nameptr, bool greedy); | 957 | int (*path_strip_volume)(const char *name, const char **nameptr, bool greedy); |
944 | #endif | 958 | #endif |
945 | /* new stuff at the end, sort into place next time | 959 | /* new stuff at the end, sort into place next time |
946 | the API gets incompatible */ | 960 | the API gets incompatible */ |
947 | 961 | ||
948 | void (*splash_progress)(int current, int total, const char *fmt, ...) ATTRIBUTE_PRINTF(3, 4); | ||
949 | void (*splash_progress_set_delay)(long delay_ticks); | ||
950 | void (*fix_path_part)(char* path, int offset, int count); | ||
951 | void (*onplay_show_playlist_cat_menu)(const char* track_name, int attr, | ||
952 | void (*add_to_pl_cb)); | ||
953 | #ifdef HAVE_TAGCACHE | ||
954 | bool (*tagtree_subentries_do_action)(bool (*action_cb)(const char *file_name)); | ||
955 | #endif | ||
956 | void (*adjust_volume)(int steps); | ||
957 | void (*playlist_set_modified)(struct playlist_info *playlist, bool modified); | ||
958 | }; | 962 | }; |
959 | 963 | ||
960 | /* plugin header */ | 964 | /* plugin header */ |