A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 80 lines 2.7 kB view raw
1/*************************************************************************** 2 * __________ __ ___. 3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 * \/ \/ \/ \/ \/ 8 * $Id$ 9 * 10 * Copyright (C) 200 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 22/* Button Code Definitions for <new> target */ 23 24#include "config.h" 25#include "action.h" 26#include "button.h" 27 28#define LAST_ITEM_IN_LIST { ACTION_NONE,BUTTON_NONE,BUTTON_NONE } 29/* {Action Code, Button code, Prereq button code } */ 30 31/** 32 This file is where all button mappings are defined. 33 In ../action.h there is an enum with all the used ACTION_ codes. 34 Ideally All the ACTION_STD_* and ACTION_WPS_* codes should be defined somehwere in this file. 35 36 Remeber to make a copy of this file and rename it to keymap-<targetname>.c and add it to apps/SOURCES 37 38 Good luck and thanks for porting a new target! :D 39 40**/ 41 42/* 43 * The format of the list is as follows 44 * { Action Code, Button code, Prereq button code } 45 * if there's no need to check the previous button's value, use BUTTON_NONE 46 * Insert LAST_ITEM_IN_LIST at the end of each mapping 47 */ 48static const struct button_mapping button_context_standard[] = { 49 50 LAST_ITEM_IN_LIST 51}; /* button_context_standard */ 52 53static const struct button_mapping button_context_wps[] = { 54 55 LAST_ITEM_IN_LIST 56}; /* button_context_wps */ 57 58 59 60/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */ 61const struct button_mapping* get_context_mapping(int context) 62{ 63 switch (context) 64 { 65 case CONTEXT_STD: 66 return button_context_standard; 67 case CONTEXT_WPS: 68 return button_context_wps; 69 70 case CONTEXT_TREE: 71 case CONTEXT_LIST: 72 case CONTEXT_MAINMENU: 73 74 case CONTEXT_SETTINGS: 75 case CONTEXT_SETTINGS|CONTEXT_REMOTE: 76 default: 77 return button_context_standard; 78 } 79 return button_context_standard; 80}