FS#12737 by Jonas Häggqvist - update Danish translation.
[maemo-rb.git] / uisimulator / common / stubs.c
blob1404c1e21b9593fe98b0993686f25e836383aeb7
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Björn Stenberg <bjorn@haxx.se>
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #include <stdio.h>
22 #include <time.h>
23 #include <stdbool.h>
24 #include "debug.h"
26 #include "screens.h"
27 #include "button.h"
29 #include "string.h"
30 #include "lcd.h"
32 #include "power.h"
34 #include "ata.h" /* for volume definitions */
36 static bool storage_spinning = false;
38 #if CONFIG_CODEC != SWCODEC
39 #include "mp3_playback.h"
41 void audio_set_buffer_margin(int seconds)
43 (void)seconds;
46 /* firmware/target/sh/archos/audio-archos.c */
48 /* list of tracks in memory */
49 #define MAX_ID3_TAGS (1<<4) /* Must be power of 2 */
50 #define MAX_ID3_TAGS_MASK (MAX_ID3_TAGS - 1)
52 static bool paused; /* playback is paused */
53 static bool playing; /* We are playing an MP3 stream */
55 bool audio_is_initialized = false;
57 void mp3_init(int volume, int bass, int treble, int balance, int loudness,
58 int avc, int channel_config, int stereo_width,
59 int mdb_strength, int mdb_harmonics,
60 int mdb_center, int mdb_shape, bool mdb_enable,
61 bool superbass)
63 (void)volume;
64 (void)bass;
65 (void)treble;
66 (void)balance;
67 (void)loudness;
68 (void)avc;
69 (void)channel_config;
70 (void)stereo_width;
71 (void)mdb_strength;
72 (void)mdb_harmonics;
73 (void)mdb_center;
74 (void)mdb_shape;
75 (void)mdb_enable;
76 (void)superbass;
77 audio_is_initialized = true;
79 playing = false;
80 paused = true;
83 void mp3_play_pause(bool play)
85 (void)play;
88 void mp3_play_stop(void)
92 unsigned char* mp3_get_pos(void)
94 return NULL;
97 void mp3_play_data(const void* start, size_t size,
98 mp3_play_callback_t get_more)
100 (void)start; (void)size; (void)get_more;
103 void mp3_shutdown(void)
107 /* firmware/drivers/audio/mas35xx.c */
108 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
109 void audiohw_set_loudness(int value)
111 (void)value;
114 void audiohw_set_avc(int value)
116 (void)value;
119 void audiohw_set_mdb_strength(int value)
121 (void)value;
124 void audiohw_set_mdb_harmonics(int value)
126 (void)value;
129 void audiohw_set_mdb_center(int value)
131 (void)value;
134 void audiohw_set_mdb_shape(int value)
136 (void)value;
139 void audiohw_set_mdb_enable(int value)
141 (void)value;
144 void audiohw_set_superbass(int value)
146 (void)value;
149 void audiohw_set_pitch(unsigned long value)
151 (void)value;
153 #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
154 #endif /* CODEC != SWCODEC */
156 int fat_startsector(void)
158 return 63;
161 bool fat_ismounted(int volume)
163 (void)volume;
164 return true;
167 int storage_spinup_time(void)
169 return 0;
172 int storage_init(void)
174 return 1;
177 int storage_write_sectors(IF_MV2(int drive,)
178 unsigned long start,
179 int count,
180 const void* buf)
182 IF_MV((void)drive;)
183 int i;
185 for (i=0; i<count; i++ ) {
186 FILE* f;
187 char name[32];
189 sprintf(name,"sector%lX.bin",start+i);
190 f=fopen(name,"wb");
191 if (f) {
192 if(fwrite(buf,512,1,f) != 1) {
193 fclose(f);
194 return -1;
196 fclose(f);
198 else {
199 return -1;
202 return 0;
205 int storage_read_sectors(IF_MV2(int drive,)
206 unsigned long start,
207 int count,
208 void* buf)
210 IF_MV((void)drive;)
211 int i;
212 size_t ret;
214 for (i=0; i<count; i++ ) {
215 FILE* f;
216 char name[32];
218 DEBUGF("Reading sector %lX\n",start+i);
219 sprintf(name,"sector%lX.bin",start+i);
220 f=fopen(name,"rb");
221 if (f) {
222 ret = fread(buf,512,1,f);
223 fclose(f);
224 if (ret != 1)
225 return -1;
228 return 0;
231 void storage_spin(void)
233 storage_spinning = true;
236 void storage_sleep(void)
240 bool storage_disk_is_active(void)
242 return storage_spinning;
245 void storage_spindown(int s)
247 (void)s;
248 storage_spinning = false;
251 int rtc_read(int address)
253 return address ^ 0x55;
256 int rtc_write(int address, int value)
258 (void)address;
259 (void)value;
260 return 0;
263 #ifdef HAVE_RTC_ALARM
264 void rtc_get_alarm(int *h, int *m)
266 *h = 11;
267 *m = 55;
270 void rtc_set_alarm(int h, int m)
272 (void)h;
273 (void)m;
276 void rtc_enable_alarm(bool enable)
278 (void)enable;
281 extern bool sim_alarm_wakeup;
282 bool rtc_check_alarm_started(bool release_alarm)
284 (void)release_alarm;
285 return sim_alarm_wakeup;
288 bool rtc_check_alarm_flag(void)
290 return true;
292 #endif
294 #ifdef HAVE_HEADPHONE_DETECTION
295 bool headphones_inserted(void)
297 return true;
299 #endif
301 #ifdef HAVE_SPDIF_POWER
302 void spdif_power_enable(bool on)
304 (void)on;
307 bool spdif_powered(void)
309 return false;
311 #endif
313 #ifdef ARCHOS_PLAYER
314 bool is_new_player(void)
316 extern char having_new_lcd;
317 return having_new_lcd;
319 #endif
321 #ifdef HAVE_USB_POWER
322 bool usb_powered(void)
324 return false;
327 bool usb_charging_enable(bool on)
329 (void)on;
330 return false;
332 #endif
334 #ifndef USB_NONE
335 bool usb_inserted(void)
337 return false;
339 #endif
341 #ifdef HAVE_REMOTE_LCD_TICKING
342 void lcd_remote_emireduce(bool state)
344 (void)state;
346 #endif
348 void lcd_set_contrast( int x )
350 (void)x;
353 void mpeg_set_pitch(int pitch)
355 (void)pitch;
358 #ifdef HAVE_LCD_CHARCELLS
359 void lcd_clearrect (int x, int y, int nx, int ny)
361 /* Reprint char if you want to change anything */
362 (void)x;
363 (void)y;
364 (void)nx;
365 (void)ny;
368 void lcd_fillrect (int x, int y, int nx, int ny)
370 /* Reprint char if you want to change display anything */
371 (void)x;
372 (void)y;
373 (void)nx;
374 (void)ny;
376 #endif
378 void cpu_sleep(bool enabled)
380 (void)enabled;
383 #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
384 void touchpad_set_sensitivity(int level)
386 (void)level;
388 #endif