A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita
audio
rust
zig
deno
mpris
rockbox
mpd
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 Jonas Haggqvist
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#include "plugin.h"
22#include "lib/mul_id3.h" /* collect_dir_stats & display_dir_stats */
23
24enum plugin_status plugin_start(const void* parameter)
25{
26 (void)parameter;
27 int button, success;
28 static struct dir_stats stats;
29 stats.dirname[0] = '/';
30 stats.count_all = true;
31#ifdef HAVE_ADJUSTABLE_CPU_FREQ
32 rb->cpu_boost(true);
33#endif
34 display_dir_stats(&stats);
35 success = collect_dir_stats(&stats, NULL);
36#ifdef HAVE_ADJUSTABLE_CPU_FREQ
37 rb->cpu_boost(false);
38#endif
39 if (!success)
40 return PLUGIN_OK;
41
42 display_dir_stats(&stats);
43#ifdef HAVE_BACKLIGHT
44#ifdef HAVE_REMOTE_LCD
45 rb->remote_backlight_on();
46#endif
47 rb->backlight_on();
48#endif
49 rb->splash(HZ, "Done");
50 display_dir_stats(&stats);
51 while (1) {
52 switch (button = rb->get_action(CONTEXT_STD, TIMEOUT_BLOCK))
53 {
54 case ACTION_STD_CANCEL:
55 return PLUGIN_OK;
56 default:
57 if (rb->default_event_handler(button) == SYS_USB_CONNECTED)
58 return PLUGIN_USB_CONNECTED;
59 }
60 }
61 return PLUGIN_OK;
62}