diff options
Diffstat (limited to 'utils/wpseditor/libwps/src/dummies.c')
-rw-r--r-- | utils/wpseditor/libwps/src/dummies.c | 389 |
1 files changed, 0 insertions, 389 deletions
diff --git a/utils/wpseditor/libwps/src/dummies.c b/utils/wpseditor/libwps/src/dummies.c deleted file mode 100644 index faeba63ea7..0000000000 --- a/utils/wpseditor/libwps/src/dummies.c +++ /dev/null | |||
@@ -1,389 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2007 by Rostilav Checkan | ||
10 | * $Id$ | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include <string.h> | ||
23 | #include <stdio.h> | ||
24 | #include "dummies.h" | ||
25 | #include "proxy.h" | ||
26 | |||
27 | struct user_settings global_settings; | ||
28 | |||
29 | struct wps_state wps_state; | ||
30 | struct gui_wps gui_wps[NB_SCREENS]; | ||
31 | struct wps_data wps_datas[NB_SCREENS]; | ||
32 | struct cuesheet *curr_cue; | ||
33 | struct system_status global_status; | ||
34 | struct gui_syncstatusbar statusbars; | ||
35 | struct playlist_info current_playlist; | ||
36 | struct font sysfont; | ||
37 | int battery_percent = 100; | ||
38 | struct mp3entry current_song, next_song; | ||
39 | int _audio_status; | ||
40 | |||
41 | charger_input_state_type charger_input_state; | ||
42 | #if CONFIG_CHARGING >= CHARGING_MONITOR | ||
43 | charge_state_type charge_state; | ||
44 | #endif | ||
45 | |||
46 | #if defined(CPU_PP) && defined(BOOTLOADER) | ||
47 | /* We don't enable interrupts in the iPod bootloader, so we need to fake | ||
48 | the current_tick variable */ | ||
49 | #define current_tick (signed)(USEC_TIMER/10000) | ||
50 | #else | ||
51 | volatile long current_tick; | ||
52 | #endif | ||
53 | |||
54 | |||
55 | void dummies_init(){ | ||
56 | sysfont.height = 9; | ||
57 | sysfont.maxwidth = 6; | ||
58 | global_settings.statusbar=true; | ||
59 | } | ||
60 | |||
61 | int playlist_amount_ex(const struct playlist_info* playlist); | ||
62 | void sound_set_volume(int value) | ||
63 | { | ||
64 | DEBUGF3("sound_set_volume(int value=%d)",value); | ||
65 | global_settings.volume = value; | ||
66 | } | ||
67 | int sound_get_pitch(void) | ||
68 | { | ||
69 | return 0; | ||
70 | } | ||
71 | int sound_min(int setting) | ||
72 | { | ||
73 | DEBUGF3("sound_min(int setting=%d)",setting); | ||
74 | return -78; //audiohw_settings[setting].minval; | ||
75 | } | ||
76 | |||
77 | void sleep(int hz) | ||
78 | { | ||
79 | } | ||
80 | |||
81 | void audio_init(void){} | ||
82 | void audio_wait_for_init(void){} | ||
83 | void audio_play(long offset){} | ||
84 | void audio_stop(void){} | ||
85 | void audio_pause(void){} | ||
86 | void audio_resume(void){} | ||
87 | void audio_next(void){} | ||
88 | void audio_prev(void){} | ||
89 | int audio_status(void) | ||
90 | { | ||
91 | return _audio_status; | ||
92 | } | ||
93 | |||
94 | #if CONFIG_CODEC == SWCODEC | ||
95 | int audio_track_count(void){return 0;} /* SWCODEC only */ | ||
96 | long audio_filebufused(void){return 0;} /* SWCODEC only */ | ||
97 | void audio_pre_ff_rewind(void){} /* SWCODEC only */ | ||
98 | #endif /* CONFIG_CODEC == SWCODEC */ | ||
99 | void audio_ff_rewind(long newtime){} | ||
100 | void audio_flush_and_reload_tracks(void){} | ||
101 | #ifdef HAVE_ALBUMART | ||
102 | int audio_current_aa_hid(void){return -1;} | ||
103 | #endif | ||
104 | struct mp3entry* audio_current_track(void){return 0;} | ||
105 | struct mp3entry* audio_next_track(void){return 0;} | ||
106 | bool audio_has_changed_track(void) | ||
107 | { | ||
108 | return false; | ||
109 | } | ||
110 | |||
111 | int get_sleep_timer(void){return 0;} | ||
112 | |||
113 | |||
114 | int battery_level(void){return battery_percent;} /* percent */ | ||
115 | int battery_time(void){return 0;} /* minutes */ | ||
116 | unsigned int battery_adc_voltage(void){return 0;} /* voltage from ADC in millivolts */ | ||
117 | unsigned int battery_voltage(void){return 0;} /* filtered batt. voltage in millivolts */ | ||
118 | int get_radio_status(void){return 0;} | ||
119 | |||
120 | |||
121 | /* returns full path of playlist (minus extension) */ | ||
122 | char *playlist_name(const struct playlist_info* playlist, char *buf, | ||
123 | int buf_size) | ||
124 | { | ||
125 | char *sep; | ||
126 | |||
127 | if (!playlist) | ||
128 | return "no"; | ||
129 | |||
130 | snprintf(buf, buf_size, "%s", playlist->filename+playlist->dirlen); | ||
131 | |||
132 | if (!buf[0]) | ||
133 | return NULL; | ||
134 | |||
135 | /* Remove extension */ | ||
136 | sep = strrchr(buf, '.'); | ||
137 | if(sep) | ||
138 | *sep = 0; | ||
139 | |||
140 | return buf; | ||
141 | } | ||
142 | int playlist_get_display_index(void) | ||
143 | { | ||
144 | return 1; | ||
145 | } | ||
146 | |||
147 | void gui_syncsplash(int ticks, const unsigned char *fmt, ...) | ||
148 | { | ||
149 | |||
150 | } | ||
151 | |||
152 | void splash(int ticks, const unsigned char *fmt, ...) | ||
153 | { | ||
154 | |||
155 | } | ||
156 | |||
157 | void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw){ | ||
158 | DEBUGF3("gui_statusbar_draw"); | ||
159 | } | ||
160 | |||
161 | void yield(void){} | ||
162 | |||
163 | |||
164 | /* returns true if cuesheet support is initialised */ | ||
165 | bool cuesheet_is_enabled(void){return false;} | ||
166 | |||
167 | /* allocates the cuesheet buffer */ | ||
168 | void cuesheet_init(void){} | ||
169 | |||
170 | /* looks if there is a cuesheet file that has a name matching "trackpath" */ | ||
171 | bool look_for_cuesheet_file(const char *trackpath, char *found_cue_path){return false;} | ||
172 | |||
173 | /* parse cuesheet "file" and store the information in "cue" */ | ||
174 | bool parse_cuesheet(char *file, struct cuesheet *cue){return false;} | ||
175 | |||
176 | /* reads a cuesheet to find the audio track associated to it */ | ||
177 | bool get_trackname_from_cuesheet(char *filename, char *buf){return false;} | ||
178 | |||
179 | /* display a cuesheet struct */ | ||
180 | void browse_cuesheet(struct cuesheet *cue){} | ||
181 | |||
182 | /* display a cuesheet file after parsing and loading it to the plugin buffer */ | ||
183 | bool display_cuesheet_content(char* filename){return false;} | ||
184 | |||
185 | /* finds the index of the current track played within a cuesheet */ | ||
186 | int cue_find_current_track(struct cuesheet *cue, unsigned long curpos){return 0;} | ||
187 | |||
188 | /* update the id3 info to that of the currently playing track in the cuesheet */ | ||
189 | void cue_spoof_id3(struct cuesheet *cue, struct mp3entry *id3){} | ||
190 | |||
191 | /* skip to next track in the cuesheet towards "direction" (which is 1 or -1) */ | ||
192 | bool curr_cuesheet_skip(int direction, unsigned long curr_pos){return false;} | ||
193 | |||
194 | #ifdef HAVE_LCD_BITMAP | ||
195 | /* draw track markers on the progressbar */ | ||
196 | void cue_draw_markers(struct screen *screen, unsigned long tracklen, | ||
197 | int x, int y, int w, int h){} | ||
198 | #endif | ||
199 | |||
200 | #ifdef HAVE_ALBUMART | ||
201 | void draw_album_art(struct gui_wps *gwps, int handle_id, bool clear) | ||
202 | { | ||
203 | if (!gwps || !gwps->data || !gwps->display || handle_id < 0) | ||
204 | return; | ||
205 | |||
206 | struct wps_data *data = gwps->data; | ||
207 | |||
208 | #ifdef HAVE_REMOTE_LCD | ||
209 | /* No album art on RWPS */ | ||
210 | if (data->remote_wps) | ||
211 | return; | ||
212 | #endif | ||
213 | |||
214 | struct bitmap *bmp; | ||
215 | /* if (bufgetdata(handle_id, 0, (void *)&bmp) <= 0) | ||
216 | return;*/ | ||
217 | |||
218 | short x = data->albumart_x; | ||
219 | short y = data->albumart_y; | ||
220 | short width = bmp->width; | ||
221 | short height = bmp->height; | ||
222 | |||
223 | if (data->albumart_max_width > 0) | ||
224 | { | ||
225 | /* Crop if the bitmap is too wide */ | ||
226 | width = MIN(bmp->width, data->albumart_max_width); | ||
227 | |||
228 | /* Align */ | ||
229 | if (data->albumart_xalign & WPS_ALBUMART_ALIGN_RIGHT) | ||
230 | x += data->albumart_max_width - width; | ||
231 | else if (data->albumart_xalign & WPS_ALBUMART_ALIGN_CENTER) | ||
232 | x += (data->albumart_max_width - width) / 2; | ||
233 | } | ||
234 | |||
235 | if (data->albumart_max_height > 0) | ||
236 | { | ||
237 | /* Crop if the bitmap is too high */ | ||
238 | height = MIN(bmp->height, data->albumart_max_height); | ||
239 | |||
240 | /* Align */ | ||
241 | if (data->albumart_yalign & WPS_ALBUMART_ALIGN_BOTTOM) | ||
242 | y += data->albumart_max_height - height; | ||
243 | else if (data->albumart_yalign & WPS_ALBUMART_ALIGN_CENTER) | ||
244 | y += (data->albumart_max_height - height) / 2; | ||
245 | } | ||
246 | |||
247 | if (!clear) | ||
248 | { | ||
249 | /* Draw the bitmap */ | ||
250 | gwps->display->set_drawmode(DRMODE_FG); | ||
251 | gwps->display->bitmap_part((fb_data*)bmp->data, 0, 0, bmp->width, | ||
252 | x, y, width, height); | ||
253 | gwps->display->set_drawmode(DRMODE_SOLID); | ||
254 | } | ||
255 | else | ||
256 | { | ||
257 | /* Clear the bitmap */ | ||
258 | gwps->display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | ||
259 | gwps->display->fillrect(x, y, width, height); | ||
260 | gwps->display->set_drawmode(DRMODE_SOLID); | ||
261 | } | ||
262 | } | ||
263 | #endif | ||
264 | /* Update the "data" pointer to make the handle's data available to the caller. | ||
265 | Return the length of the available linear data or < 0 for failure (handle | ||
266 | not found). | ||
267 | The caller is blocked until the requested amount of data is available. | ||
268 | size is the amount of linear data requested. it can be 0 to get as | ||
269 | much as possible. | ||
270 | The guard buffer may be used to provide the requested size. This means it's | ||
271 | unsafe to request more than the size of the guard buffer. | ||
272 | */ | ||
273 | size_t bufgetdata(int handle_id, size_t size, void **data) | ||
274 | { | ||
275 | |||
276 | |||
277 | return size; | ||
278 | } | ||
279 | |||
280 | |||
281 | void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, | ||
282 | bool force_redraw) | ||
283 | { | ||
284 | #ifdef HAVE_LCD_BITMAP | ||
285 | if(!global_settings.statusbar) | ||
286 | return; | ||
287 | #endif /* HAVE_LCD_BITMAP */ | ||
288 | int i; | ||
289 | FOR_NB_SCREENS(i) { | ||
290 | gui_statusbar_draw( &(bars->statusbars[i]), force_redraw ); | ||
291 | } | ||
292 | } | ||
293 | void unload_wps_backdrop(void) | ||
294 | { | ||
295 | |||
296 | } | ||
297 | void unload_remote_wps_backdrop(void) | ||
298 | { | ||
299 | |||
300 | } | ||
301 | |||
302 | #if CONFIG_CODEC == SWCODEC | ||
303 | int get_replaygain_mode(bool have_track_gain, bool have_album_gain) | ||
304 | { | ||
305 | int type; | ||
306 | |||
307 | bool track = ((global_settings.replaygain_type == REPLAYGAIN_TRACK) | ||
308 | || ((global_settings.replaygain_type == REPLAYGAIN_SHUFFLE) | ||
309 | && global_settings.playlist_shuffle)); | ||
310 | |||
311 | type = (!track && have_album_gain) ? REPLAYGAIN_ALBUM | ||
312 | : have_track_gain ? REPLAYGAIN_TRACK : -1; | ||
313 | |||
314 | return type; | ||
315 | } | ||
316 | #endif | ||
317 | |||
318 | /* Common functions for all targets */ | ||
319 | void rtc_init(void){} | ||
320 | int rtc_read_datetime(unsigned char* buf){return 0;} | ||
321 | int rtc_write_datetime(unsigned char* buf){return 0;} | ||
322 | |||
323 | void backlight_on(void){} | ||
324 | void backlight_off(void){} | ||
325 | |||
326 | void remote_backlight_on(void){} | ||
327 | void remote_backlight_off(void){} | ||
328 | |||
329 | void debugf(const char *fmt, ...) | ||
330 | {} | ||
331 | void panicf( const char *fmt, ...) | ||
332 | { | ||
333 | } | ||
334 | |||
335 | off_t filesize(int fd){return 0;} | ||
336 | |||
337 | int playlist_amount(void) | ||
338 | { | ||
339 | return playlist_amount_ex(NULL); | ||
340 | } | ||
341 | int playlist_amount_ex(const struct playlist_info* playlist) | ||
342 | { | ||
343 | if (!playlist) | ||
344 | playlist = ¤t_playlist; | ||
345 | |||
346 | return playlist->amount; | ||
347 | } | ||
348 | |||
349 | int get_action(int context, int timeout) | ||
350 | { | ||
351 | return 0; | ||
352 | } | ||
353 | |||
354 | void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, | ||
355 | int height){} | ||
356 | |||
357 | void pcm_calculate_rec_peaks(int *left, int *right) | ||
358 | { | ||
359 | } | ||
360 | void pcm_calculate_peaks(int *left, int *right) | ||
361 | { | ||
362 | } | ||
363 | bool led_read(int delayticks) /* read by status bar update */ | ||
364 | { | ||
365 | return false; | ||
366 | } | ||
367 | |||
368 | #ifndef HAS_BUTTON_HOLD | ||
369 | bool is_keys_locked(void) | ||
370 | { | ||
371 | return false; | ||
372 | } | ||
373 | #endif | ||
374 | |||
375 | long default_event_handler_ex(long event, void (*callback)(void *), void *parameter) | ||
376 | { | ||
377 | return 0; | ||
378 | } | ||
379 | |||
380 | long default_event_handler(long event) | ||
381 | { | ||
382 | return default_event_handler_ex(event, NULL, NULL); | ||
383 | } | ||
384 | |||
385 | void ab_draw_markers(struct screen * screen, int capacity, | ||
386 | int x, int y, int w, int h) | ||
387 | { | ||
388 | } | ||
389 | void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude){} | ||