diff options
| author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-16 10:34:40 +0000 |
|---|---|---|
| committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-16 10:34:40 +0000 |
| commit | 23d9812273d9c74af72ccdc3aa4cfea971f220a4 (patch) | |
| tree | 8e60c3a2a41879f8b2a52516fa416b3ab906e239 /apps/plugins/mpegplayer/mpegplayer.c | |
| parent | 35677cbc54bbe400ebbff59b489dda7ca7f04916 (diff) | |
| download | rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.zip rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.gz rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.bz2 rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.xz | |
loader-initialized global plugin API:
struct plugin_api *rb is declared in PLUGIN_HEADER, and pointed to by
__header.api
the loader uses this pointer to initialize rb before calling entry_point
entry_point is no longer passed a pointer to the plugin API
all plugins, and pluginlib functions, are modified to refer to the
global rb
pluginlib functions which only served to copy the API pointer are
removed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19776 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer/mpegplayer.c')
| -rw-r--r-- | apps/plugins/mpegplayer/mpegplayer.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 0b5bb51..fbd3dc6 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c @@ -280,9 +280,7 @@ CONFIG_KEYPAD == SANSA_M200_PAD #endif #endif -const struct plugin_api* rb; - -CACHE_FUNCTION_WRAPPERS(rb); +CACHE_FUNCTION_WRAPPERS; /* One thing we can do here for targets with remotes is having a display * always on the remote instead of always forcing a popup on the main display */ @@ -622,7 +620,7 @@ static void wvs_backlight_on_video_mode(bool video_on) if (video_on) { /* Turn off backlight timeout */ /* backlight control in lib/helper.c */ - backlight_force_on(rb); + backlight_force_on(); #if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR) rb->lcd_set_enable_hook(NULL); #endif @@ -631,7 +629,7 @@ static void wvs_backlight_on_video_mode(bool video_on) rb->lcd_set_enable_hook(wvs_lcd_enable_hook); #endif /* Revert to user's backlight settings */ - backlight_use_settings(rb); + backlight_use_settings(); } } @@ -1625,7 +1623,7 @@ static void button_loop(void) rb->lcd_setfont(FONT_UI); } -enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) +enum plugin_status plugin_start(const void* parameter) { int status = PLUGIN_ERROR; /* assume failure */ int result; @@ -1634,17 +1632,15 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame if (parameter == NULL) { /* No file = GTFO */ - api->splash(HZ*2, "No File"); + rb->splash(HZ*2, "No File"); return PLUGIN_ERROR; } /* Disable all talking before initializing IRAM */ - api->talk_disable(true); + rb->talk_disable(true); /* Initialize IRAM - stops audio and voice as well */ - PLUGIN_IRAM_INIT(api) - - rb = api; + PLUGIN_IRAM_INIT(rb) #ifdef HAVE_LCD_COLOR rb->lcd_set_backdrop(NULL); |