diff options
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 485efa8e00..89538423b4 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) { | |||
32 | } | 32 | } |
33 | 33 | ||
34 | int read_bmp_file(const char* filename,struct bitmap *bm, int maxsize,int format) { | 34 | int read_bmp_file(const char* filename,struct bitmap *bm, int maxsize,int format) { |
35 | if (!xapi->read_bmp_file) | 35 | if (!xapi->read_bmp_file) { |
36 | { | ||
37 | DEBUGF1("can't read bmp file! NULL api!\n"); | 36 | DEBUGF1("can't read bmp file! NULL api!\n"); |
38 | return -1; | 37 | return -1; |
39 | } | 38 | } |
@@ -84,7 +83,7 @@ int getstringsize(const unsigned char *str, int *w, int *h) { | |||
84 | return 1; | 83 | return 1; |
85 | } | 84 | } |
86 | 85 | ||
87 | void set_wpsstate(struct wpsstate state){ | 86 | void set_wpsstate(struct wpsstate state) { |
88 | sysfont.height = state.fontheight; | 87 | sysfont.height = state.fontheight; |
89 | sysfont.maxwidth = state.fontwidth; | 88 | sysfont.maxwidth = state.fontwidth; |
90 | global_settings.volume = state.volume; | 89 | global_settings.volume = state.volume; |
@@ -92,7 +91,10 @@ void set_wpsstate(struct wpsstate state){ | |||
92 | _audio_status = state.audio_status; | 91 | _audio_status = state.audio_status; |
93 | } | 92 | } |
94 | 93 | ||
95 | void set_trackstate(struct trackstate state){ | 94 | void set_trackstate(struct trackstate state) { |
95 | if (!(gui_wps[0].state) || | ||
96 | !(gui_wps[0].state->id3)) | ||
97 | return; | ||
96 | gui_wps[0].state->id3->title = state.title; | 98 | gui_wps[0].state->id3->title = state.title; |
97 | gui_wps[0].state->id3->artist = state.artist; | 99 | gui_wps[0].state->id3->artist = state.artist; |
98 | gui_wps[0].state->id3->album = state.album; | 100 | gui_wps[0].state->id3->album = state.album; |
@@ -100,8 +102,7 @@ void set_trackstate(struct trackstate state){ | |||
100 | gui_wps[0].state->id3->length = state.length; | 102 | gui_wps[0].state->id3->length = state.length; |
101 | } | 103 | } |
102 | 104 | ||
103 | void set_next_trackstate(struct trackstate state) | 105 | void set_next_trackstate(struct trackstate state) { |
104 | { | ||
105 | gui_wps[0].state->nid3->title = state.title; | 106 | gui_wps[0].state->nid3->title = state.title; |
106 | gui_wps[0].state->nid3->artist = state.artist; | 107 | gui_wps[0].state->nid3->artist = state.artist; |
107 | gui_wps[0].state->nid3->album = state.album; | 108 | gui_wps[0].state->nid3->album = state.album; |
@@ -110,21 +111,21 @@ void set_next_trackstate(struct trackstate state) | |||
110 | } | 111 | } |
111 | 112 | ||
112 | enum api_playmode playmodes[PLAYMODES_NUM] = { | 113 | enum api_playmode playmodes[PLAYMODES_NUM] = { |
113 | API_STATUS_PLAY, | 114 | API_STATUS_PLAY, |
114 | API_STATUS_STOP, | 115 | API_STATUS_STOP, |
115 | API_STATUS_PAUSE, | 116 | API_STATUS_PAUSE, |
116 | API_STATUS_FASTFORWARD, | 117 | API_STATUS_FASTFORWARD, |
117 | API_STATUS_FASTBACKWARD | 118 | API_STATUS_FASTBACKWARD |
118 | }; | 119 | }; |
119 | 120 | ||
120 | const char *playmodeNames[] = { | 121 | const char *playmodeNames[] = { |
121 | "Play", "Stop", "Pause", "FastForward", "FastBackward" | 122 | "Play", "Stop", "Pause", "FastForward", "FastBackward" |
122 | }; | 123 | }; |
123 | 124 | ||
124 | 125 | ||
125 | void set_audio_status(int status){ | 126 | void set_audio_status(int status) { |
126 | DEBUGF1("%s",playmodeNames[status]); | 127 | DEBUGF1("%s",playmodeNames[status]); |
127 | switch(status){ | 128 | switch (status) { |
128 | case API_STATUS_PLAY: | 129 | case API_STATUS_PLAY: |
129 | _audio_status = AUDIO_STATUS_PLAY; | 130 | _audio_status = AUDIO_STATUS_PLAY; |
130 | status_set_ffmode(STATUS_PLAY); | 131 | status_set_ffmode(STATUS_PLAY); |
@@ -203,8 +204,6 @@ int set_api(struct proxy_api* api) { | |||
203 | #else | 204 | #else |
204 | screens[0].is_color=false; | 205 | screens[0].is_color=false; |
205 | #endif | 206 | #endif |
206 | if (api->getwidth) | ||
207 | screens[0].getwidth = api->getwidth; | ||
208 | if (api->stop_scroll) | 207 | if (api->stop_scroll) |
209 | screens[0].stop_scroll=api->stop_scroll; | 208 | screens[0].stop_scroll=api->stop_scroll; |
210 | screens[0].scroll_stop = lcd_scroll_stop; | 209 | screens[0].scroll_stop = lcd_scroll_stop; |
@@ -266,3 +265,4 @@ int set_api(struct proxy_api* api) { | |||
266 | 265 | ||
267 | 266 | ||
268 | 267 | ||
268 | |||