A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 67 lines 1.7 kB view raw
1#!/usr/bin/env perl 2############################################################################ 3# __________ __ ___. 4# Open \______ \ ____ ____ | | _\_ |__ _______ ___ 5# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 6# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 7# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 8# \/ \/ \/ \/ \/ 9# $Id$ 10# 11# Copyright (C) 2009 by Maurus Cuelenaere 12# 13# All files in this archive are subject to the GNU General Public License. 14# See the file COPYING in the source tree root for full license agreement. 15# 16# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 17# KIND, either express or implied. 18# 19############################################################################ 20 21$svnrev = '$Revision$'; 22 23print <<EOF 24#include <stdio.h> 25#include <stdbool.h> 26#include "button.h" 27 28struct button 29{ 30 char* name; 31 unsigned long value; 32}; 33 34static struct button buttons[] = { 35EOF 36; 37 38while(my $line = <STDIN>) 39{ 40 chomp($line); 41 if($line =~ /^#define (BUTTON_[^\s]+) (.+)$/) 42 { 43 printf "{\"%s\", %s},\n", $1, $2; 44 } 45} 46 47print <<EOF 48{"BUTTON_REL", BUTTON_REL}, 49{"BUTTON_REPEAT", BUTTON_REPEAT}, 50{"BUTTON_TOUCHSCREEN", BUTTON_TOUCHSCREEN}, 51}; 52 53int main(void) 54{ 55 unsigned int i; 56 printf("-- Don't change this file!\\n"); 57 printf("-- It is automatically generated of button.h \%s\\n", "$svnrev"); 58 printf("rb.buttons = {\\n"); 59 for(i=0; i<sizeof(buttons)/sizeof(struct button); i++) 60 printf("\\t\%s = \%ld,\\n", buttons[i].name, buttons[i].value); 61 printf("}\\n"); 62 63 return 0; 64} 65 66EOF 67;