A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 89 lines 2.8 kB view raw
1/*************************************************************************** 2 * __________ __ ___. 3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 * \/ \/ \/ \/ \/ 8 * $Id$ 9 * 10 * Copyright (C) 2002 Björn 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 _ONPLAY_H_ 22#define _ONPLAY_H_ 23 24#ifdef HAVE_HOTKEY 25#include "menu.h" 26#endif 27 28enum { 29 ONPLAY_NO_CUSTOMACTION, 30 ONPLAY_CUSTOMACTION_SHUFFLE_SONGS, 31 ONPLAY_CUSTOMACTION_FIRSTLETTER, 32}; 33 34int onplay(char* file, int attr, int from_context, bool hotkey, int customaction); 35int get_onplay_context(void); 36 37enum { 38 ONPLAY_MAINMENU = -1, 39 ONPLAY_OK = 0, 40 ONPLAY_RELOAD_DIR, 41 ONPLAY_START_PLAY, 42 ONPLAY_PLAYLIST, 43 ONPLAY_PLUGIN, 44#ifdef HAVE_HOTKEY 45 ONPLAY_FUNC_RETURN, /* for use in hotkey_assignment only */ 46#endif 47}; 48 49#ifdef HAVE_HOTKEY 50 51enum hotkey_action { 52 HOTKEY_OFF = 0, 53 HOTKEY_VIEW_PLAYLIST, 54 HOTKEY_PROPERTIES, 55 HOTKEY_PICTUREFLOW, 56 HOTKEY_SHOW_TRACK_INFO, 57 HOTKEY_PITCHSCREEN, 58 HOTKEY_OPEN_WITH, 59 HOTKEY_DELETE, 60 HOTKEY_BOOKMARK, 61 HOTKEY_PLUGIN, 62 HOTKEY_INSERT, 63 HOTKEY_INSERT_SHUFFLED, 64 HOTKEY_BOOKMARK_LIST, 65}; 66enum hotkey_flags { 67 HOTKEY_FLAG_NONE = 0x0, 68 HOTKEY_FLAG_WPS = 0x1, 69 HOTKEY_FLAG_TREE = 0x2, 70 HOTKEY_FLAG_NOSBS = 0x4, 71}; 72 73struct hotkey_assignment { 74 int action; /* hotkey_action */ 75 int lang_id; /* Language ID */ 76 struct menu_func_param func; /* Function to run if this entry is selected */ 77 int16_t return_code; /* What to return after the function is run. */ 78 uint16_t flags; /* Flags what context, display options */ 79}; /* (Pick ONPLAY_FUNC_RETURN to use function's return value) */ 80 81const struct hotkey_assignment *get_hotkey(int action); 82#endif 83 84/* needed for the playlist viewer.. eventually clean this up */ 85void onplay_show_playlist_cat_menu(const char* track_name, int attr, 86 void (*add_to_pl_cb)); 87void onplay_show_playlist_menu(const char* path, int attr, void (*playlist_insert_cb)); 88 89#endif