Don't force double-buffering for sd devices. They apparently are not faster with...
[kugel-rb.git] / apps / plugins / lib / helper.c
blobc70d8264a5e398ce114ef72e16a56a8eafab53c5
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 by Peter D'Hoye
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 ****************************************************************************/
22 #include "plugin.h"
23 #include "helper.h"
25 /* Force the backlight on */
26 void backlight_force_on(void)
28 if(!rb)
29 return;
30 if (rb->global_settings->backlight_timeout > 0)
31 rb->backlight_set_timeout(0);
32 #if CONFIG_CHARGING
33 if (rb->global_settings->backlight_timeout_plugged > 0)
34 rb->backlight_set_timeout_plugged(0);
35 #endif /* CONFIG_CHARGING */
38 /* Reset backlight operation to its settings */
39 void backlight_use_settings(void)
41 if (!rb)
42 return;
43 rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
44 #if CONFIG_CHARGING
45 rb->backlight_set_timeout_plugged(rb->global_settings->
46 backlight_timeout_plugged);
47 #endif /* CONFIG_CHARGING */
50 #ifdef HAVE_REMOTE_LCD
51 /* Force the backlight on */
52 void remote_backlight_force_on(void)
54 if (!rb)
55 return;
56 if (rb->global_settings->remote_backlight_timeout > 0)
57 rb->remote_backlight_set_timeout(0);
58 #if CONFIG_CHARGING
59 if (rb->global_settings->remote_backlight_timeout_plugged > 0)
60 rb->remote_backlight_set_timeout_plugged(0);
61 #endif /* CONFIG_CHARGING */
64 /* Reset backlight operation to its settings */
65 void remote_backlight_use_settings(void)
67 if (!rb)
68 return;
69 rb->remote_backlight_set_timeout(rb->global_settings->
70 remote_backlight_timeout);
71 #if CONFIG_CHARGING
72 rb->remote_backlight_set_timeout_plugged(rb->global_settings->
73 remote_backlight_timeout_plugged);
74 #endif /* CONFIG_CHARGING */
76 #endif /* HAVE_REMOTE_LCD */
78 #ifdef HAVE_BUTTON_LIGHT
79 /* Force the buttonlight on */
80 void buttonlight_force_on(void)
82 if (!rb)
83 return;
84 if (rb->global_settings->buttonlight_timeout > 0)
85 rb->buttonlight_set_timeout(0);
88 /* Reset buttonlight operation to its settings */
89 void buttonlight_use_settings(void)
91 if (!rb)
92 return;
93 rb->buttonlight_set_timeout(rb->global_settings->buttonlight_timeout);
95 #endif /* HAVE_BUTTON_LIGHT */
97 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
98 void backlight_brightness_set(int brightness)
100 if (!rb)
101 return;
102 rb->backlight_set_brightness(brightness);
105 void backlight_brightness_use_setting(void)
107 if (!rb)
108 return;
109 rb->backlight_set_brightness(rb->global_settings->brightness);
111 #endif /* HAVE_BACKLIGHT_BRIGHTNESS */