diff options
| author | Dominik Wenger <domonoky@googlemail.com> | 2008-09-03 19:24:50 +0000 |
|---|---|---|
| committer | Dominik Wenger <domonoky@googlemail.com> | 2008-09-03 19:24:50 +0000 |
| commit | 254fa65c7b75f61147186d9f9146b89ee11b2b26 (patch) | |
| tree | bb5355f04275394ebfd2aa200abc44b188c08df9 /utils/wpseditor/libwps/src/api.c | |
| parent | ca0de82cec434fcd4af827ff1a1d473667249338 (diff) | |
| download | rockbox-254fa65c7b75f61147186d9f9146b89ee11b2b26.zip rockbox-254fa65c7b75f61147186d9f9146b89ee11b2b26.tar.gz rockbox-254fa65c7b75f61147186d9f9146b89ee11b2b26.tar.bz2 rockbox-254fa65c7b75f61147186d9f9146b89ee11b2b26.tar.xz | |
WpsEditor: commit FS#9344 by Rostislav Chekan - multitarget support (only colour targets for now)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18399 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/wpseditor/libwps/src/api.c')
| -rw-r--r-- | utils/wpseditor/libwps/src/api.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/utils/wpseditor/libwps/src/api.c b/utils/wpseditor/libwps/src/api.c index 485efa8..8953842 100644 --- a/utils/wpseditor/libwps/src/api.c +++ b/utils/wpseditor/libwps/src/api.c @@ -32,8 +32,7 @@ bool load_remote_wps_backdrop(char* filename) { } int read_bmp_file(const char* filename,struct bitmap *bm, int maxsize,int format) { - if (!xapi->read_bmp_file) - { + if (!xapi->read_bmp_file) { DEBUGF1("can't read bmp file! NULL api!\n"); return -1; } @@ -84,7 +83,7 @@ int getstringsize(const unsigned char *str, int *w, int *h) { return 1; } -void set_wpsstate(struct wpsstate state){ +void set_wpsstate(struct wpsstate state) { sysfont.height = state.fontheight; sysfont.maxwidth = state.fontwidth; global_settings.volume = state.volume; @@ -92,7 +91,10 @@ void set_wpsstate(struct wpsstate state){ _audio_status = state.audio_status; } -void set_trackstate(struct trackstate state){ +void set_trackstate(struct trackstate state) { + if (!(gui_wps[0].state) || + !(gui_wps[0].state->id3)) + return; gui_wps[0].state->id3->title = state.title; gui_wps[0].state->id3->artist = state.artist; gui_wps[0].state->id3->album = state.album; @@ -100,8 +102,7 @@ void set_trackstate(struct trackstate state){ gui_wps[0].state->id3->length = state.length; } -void set_next_trackstate(struct trackstate state) -{ +void set_next_trackstate(struct trackstate state) { gui_wps[0].state->nid3->title = state.title; gui_wps[0].state->nid3->artist = state.artist; gui_wps[0].state->nid3->album = state.album; @@ -110,21 +111,21 @@ void set_next_trackstate(struct trackstate state) } enum api_playmode playmodes[PLAYMODES_NUM] = { - API_STATUS_PLAY, - API_STATUS_STOP, - API_STATUS_PAUSE, - API_STATUS_FASTFORWARD, - API_STATUS_FASTBACKWARD -}; + API_STATUS_PLAY, + API_STATUS_STOP, + API_STATUS_PAUSE, + API_STATUS_FASTFORWARD, + API_STATUS_FASTBACKWARD + }; const char *playmodeNames[] = { - "Play", "Stop", "Pause", "FastForward", "FastBackward" -}; + "Play", "Stop", "Pause", "FastForward", "FastBackward" + }; -void set_audio_status(int status){ +void set_audio_status(int status) { DEBUGF1("%s",playmodeNames[status]); - switch(status){ + switch (status) { case API_STATUS_PLAY: _audio_status = AUDIO_STATUS_PLAY; status_set_ffmode(STATUS_PLAY); @@ -203,8 +204,6 @@ int set_api(struct proxy_api* api) { #else screens[0].is_color=false; #endif - if (api->getwidth) - screens[0].getwidth = api->getwidth; if (api->stop_scroll) screens[0].stop_scroll=api->stop_scroll; screens[0].scroll_stop = lcd_scroll_stop; @@ -266,3 +265,4 @@ int set_api(struct proxy_api* api) { + |