summaryrefslogtreecommitdiff
path: root/utils/wpseditor/libwps/src/dummies.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/wpseditor/libwps/src/dummies.c')
-rw-r--r--utils/wpseditor/libwps/src/dummies.c389
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
27struct user_settings global_settings;
28
29struct wps_state wps_state;
30struct gui_wps gui_wps[NB_SCREENS];
31struct wps_data wps_datas[NB_SCREENS];
32struct cuesheet *curr_cue;
33struct system_status global_status;
34struct gui_syncstatusbar statusbars;
35struct playlist_info current_playlist;
36struct font sysfont;
37int battery_percent = 100;
38struct mp3entry current_song, next_song;
39int _audio_status;
40
41charger_input_state_type charger_input_state;
42#if CONFIG_CHARGING >= CHARGING_MONITOR
43charge_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
48the current_tick variable */
49#define current_tick (signed)(USEC_TIMER/10000)
50#else
51volatile long current_tick;
52#endif
53
54
55void dummies_init(){
56 sysfont.height = 9;
57 sysfont.maxwidth = 6;
58 global_settings.statusbar=true;
59}
60
61int playlist_amount_ex(const struct playlist_info* playlist);
62void sound_set_volume(int value)
63{
64 DEBUGF3("sound_set_volume(int value=%d)",value);
65 global_settings.volume = value;
66}
67int sound_get_pitch(void)
68{
69 return 0;
70}
71int sound_min(int setting)
72{
73 DEBUGF3("sound_min(int setting=%d)",setting);
74 return -78; //audiohw_settings[setting].minval;
75}
76
77void sleep(int hz)
78{
79}
80
81void audio_init(void){}
82void audio_wait_for_init(void){}
83void audio_play(long offset){}
84void audio_stop(void){}
85void audio_pause(void){}
86void audio_resume(void){}
87void audio_next(void){}
88void audio_prev(void){}
89int audio_status(void)
90{
91 return _audio_status;
92}
93
94#if CONFIG_CODEC == SWCODEC
95int audio_track_count(void){return 0;} /* SWCODEC only */
96long audio_filebufused(void){return 0;} /* SWCODEC only */
97void audio_pre_ff_rewind(void){} /* SWCODEC only */
98#endif /* CONFIG_CODEC == SWCODEC */
99void audio_ff_rewind(long newtime){}
100void audio_flush_and_reload_tracks(void){}
101#ifdef HAVE_ALBUMART
102int audio_current_aa_hid(void){return -1;}
103#endif
104struct mp3entry* audio_current_track(void){return 0;}
105struct mp3entry* audio_next_track(void){return 0;}
106bool audio_has_changed_track(void)
107{
108 return false;
109}
110
111int get_sleep_timer(void){return 0;}
112
113
114int battery_level(void){return battery_percent;} /* percent */
115int battery_time(void){return 0;} /* minutes */
116unsigned int battery_adc_voltage(void){return 0;} /* voltage from ADC in millivolts */
117unsigned int battery_voltage(void){return 0;} /* filtered batt. voltage in millivolts */
118int get_radio_status(void){return 0;}
119
120
121/* returns full path of playlist (minus extension) */
122char *playlist_name(const struct playlist_info* playlist, char *buf,
123int 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}
142int playlist_get_display_index(void)
143{
144 return 1;
145}
146
147void gui_syncsplash(int ticks, const unsigned char *fmt, ...)
148{
149
150}
151
152void splash(int ticks, const unsigned char *fmt, ...)
153{
154
155}
156
157void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw){
158 DEBUGF3("gui_statusbar_draw");
159}
160
161void yield(void){}
162
163
164/* returns true if cuesheet support is initialised */
165bool cuesheet_is_enabled(void){return false;}
166
167/* allocates the cuesheet buffer */
168void cuesheet_init(void){}
169
170/* looks if there is a cuesheet file that has a name matching "trackpath" */
171bool look_for_cuesheet_file(const char *trackpath, char *found_cue_path){return false;}
172
173/* parse cuesheet "file" and store the information in "cue" */
174bool parse_cuesheet(char *file, struct cuesheet *cue){return false;}
175
176/* reads a cuesheet to find the audio track associated to it */
177bool get_trackname_from_cuesheet(char *filename, char *buf){return false;}
178
179/* display a cuesheet struct */
180void browse_cuesheet(struct cuesheet *cue){}
181
182/* display a cuesheet file after parsing and loading it to the plugin buffer */
183bool display_cuesheet_content(char* filename){return false;}
184
185/* finds the index of the current track played within a cuesheet */
186int 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 */
189void 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) */
192bool curr_cuesheet_skip(int direction, unsigned long curr_pos){return false;}
193
194#ifdef HAVE_LCD_BITMAP
195/* draw track markers on the progressbar */
196void cue_draw_markers(struct screen *screen, unsigned long tracklen,
197int x, int y, int w, int h){}
198#endif
199
200#ifdef HAVE_ALBUMART
201void 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.
265Return the length of the available linear data or < 0 for failure (handle
266not found).
267The caller is blocked until the requested amount of data is available.
268size is the amount of linear data requested. it can be 0 to get as
269much as possible.
270The guard buffer may be used to provide the requested size. This means it's
271unsafe to request more than the size of the guard buffer.
272*/
273size_t bufgetdata(int handle_id, size_t size, void **data)
274{
275
276
277 return size;
278}
279
280
281void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars,
282bool 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}
293void unload_wps_backdrop(void)
294{
295
296}
297void unload_remote_wps_backdrop(void)
298{
299
300}
301
302#if CONFIG_CODEC == SWCODEC
303int 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 */
319void rtc_init(void){}
320int rtc_read_datetime(unsigned char* buf){return 0;}
321int rtc_write_datetime(unsigned char* buf){return 0;}
322
323void backlight_on(void){}
324void backlight_off(void){}
325
326void remote_backlight_on(void){}
327void remote_backlight_off(void){}
328
329void debugf(const char *fmt, ...)
330{}
331void panicf( const char *fmt, ...)
332{
333}
334
335off_t filesize(int fd){return 0;}
336
337int playlist_amount(void)
338{
339 return playlist_amount_ex(NULL);
340}
341int playlist_amount_ex(const struct playlist_info* playlist)
342{
343 if (!playlist)
344 playlist = &current_playlist;
345
346 return playlist->amount;
347}
348
349int get_action(int context, int timeout)
350{
351 return 0;
352}
353
354void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width,
355 int height){}
356
357void pcm_calculate_rec_peaks(int *left, int *right)
358{
359}
360void pcm_calculate_peaks(int *left, int *right)
361{
362}
363bool led_read(int delayticks) /* read by status bar update */
364{
365 return false;
366}
367
368#ifndef HAS_BUTTON_HOLD
369bool is_keys_locked(void)
370{
371 return false;
372}
373#endif
374
375long default_event_handler_ex(long event, void (*callback)(void *), void *parameter)
376{
377 return 0;
378}
379
380long default_event_handler(long event)
381{
382 return default_event_handler_ex(event, NULL, NULL);
383}
384
385void ab_draw_markers(struct screen * screen, int capacity,
386 int x, int y, int w, int h)
387 {
388 }
389void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude){}