A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 113 lines 3.4 kB view raw
1/*************************************************************************** 2 * __________ __ ___. 3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 * \/ \/ \/ \/ \/ 8 * $Id$ 9 * 10 * Copyright (C) 2002 by Daniel Stenberg 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#ifndef BACKLIGHT_H 22#define BACKLIGHT_H 23 24#include "config.h" 25#include <stdbool.h> 26 27 28#if !defined(BOOTLOADER) 29/* The whole driver should be built */ 30#define BACKLIGHT_FULL_INIT 31#endif 32 33bool is_backlight_on(bool ignore_always_off); 34void backlight_on_ignore(bool value, int timeout); 35void backlight_on(void); 36void backlight_off(void); 37void backlight_set_timeout(int value); 38 39#ifdef HAVE_BACKLIGHT 40void backlight_init(void) INIT_ATTR; 41void backlight_close(void); 42int backlight_get_current_timeout(void); 43 44#if defined(HAVE_BACKLIGHT_FADING_INT_SETTING) 45void backlight_set_fade_in(int value); 46void backlight_set_fade_out(int value); 47#elif defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) 48void backlight_set_fade_in(bool value); 49void backlight_set_fade_out(bool value); 50#endif 51 52void backlight_set_timeout_plugged(int value); 53 54#ifdef HAS_BUTTON_HOLD 55void backlight_hold_changed(bool hold_button); 56#endif 57void backlight_set_on_button_hold(int index); 58 59#if defined(HAVE_LCD_SLEEP) && defined(HAVE_LCD_SLEEP_SETTING) 60void lcd_set_sleep_after_backlight_off(int timeout_seconds); 61#endif 62 63#ifdef HAVE_LCD_SLEEP 64void lcd_awake(void); 65#endif 66 67#else /* !HAVE_BACKLIGHT */ 68#define backlight_init() 69#endif /* !HAVE_BACKLIGHT */ 70 71#ifdef HAVE_REMOTE_LCD 72void remote_backlight_hw_on(void); 73void remote_backlight_hw_off(void); 74void remote_backlight_on(void); 75void remote_backlight_off(void); 76void remote_backlight_set_timeout(int value); 77void remote_backlight_set_timeout_plugged(int value); 78bool is_remote_backlight_on(bool ignore_always_off); 79int remote_backlight_get_current_timeout(void); 80 81#ifdef HAS_REMOTE_BUTTON_HOLD 82void remote_backlight_hold_changed(bool rc_hold_button); 83void remote_backlight_set_on_button_hold(int index); 84#endif 85#endif /* HAVE_REMOTE_LCD */ 86 87#ifdef SIMULATOR 88void sim_backlight(int value); 89void sim_remote_backlight(int value); 90#endif 91 92#ifdef HAVE_BACKLIGHT_BRIGHTNESS 93#ifdef BACKLIGHT_FULL_INIT 94extern int backlight_brightness; 95#else 96#define backlight_brightness DEFAULT_BRIGHTNESS_SETTING 97#endif 98void backlight_set_brightness(int val); 99#endif /* HAVE_BACKLIGHT_BRIGHTNESS */ 100 101void buttonlight_set_brightness(int val); 102 103void buttonlight_on_ignore(bool value, int timeout); 104void buttonlight_on(void); 105void buttonlight_off(void); 106void buttonlight_set_timeout(int value); 107 108/* Private API for use in target tree backlight code only */ 109#ifdef HAVE_BUTTON_LIGHT 110int buttonlight_get_current_timeout(void); 111#endif 112 113#endif /* BACKLIGHT_H */