├── gmu.bmp ├── gmu.png ├── gmu-unknown.sh ├── htdocs ├── bg.png ├── gmu.png ├── icon_next.png ├── icon_pause.png ├── icon_play.png ├── icon_prev.png └── icon_stop.png ├── gmu-pandora.sh ├── themes ├── default-modern │ ├── arrow-up.png │ ├── lvmiddle.png │ ├── symbols.png │ ├── arrow-down.png │ ├── display-tl.png │ ├── display-tm.png │ ├── display-tr.png │ ├── footer-tl.png │ ├── footer-tm.png │ ├── footer-tr.png │ ├── letters_lcd.png │ ├── textarea-m.png │ ├── letters_lcd_1.png │ ├── letters_lcd_2.png │ ├── letters_small_1.png │ ├── letters_lcd_black.png │ ├── letters_small_blue.png │ ├── letters_small_black.png │ ├── letters_small_orange.png │ ├── letters_small_white.png │ └── theme.conf ├── default-modern-large │ ├── symbols.png │ ├── arrow-down.png │ ├── arrow-up.png │ ├── display-tl.png │ ├── display-tm.png │ ├── display-tr.png │ ├── footer-tl.png │ ├── footer-tm.png │ ├── footer-tr.png │ ├── lvmiddle.png │ ├── textarea-m.png │ ├── letters_lcd.png │ ├── letters_lcd_1.png │ ├── letters_lcd_2.png │ ├── letters_lcd_black.png │ ├── letters_large_blue.png │ ├── letters_large_white.png │ └── theme.conf └── default-modern-large-ttf │ ├── arrow-up.png │ ├── lvmiddle.png │ ├── symbols.png │ ├── arrow-down.png │ ├── display-tl.png │ ├── display-tm.png │ ├── display-tr.png │ ├── footer-tl.png │ ├── footer-tm.png │ ├── footer-tr.png │ ├── textarea-m.png │ ├── letters_lcd_2.png │ ├── NotoSans-Regular.ttf │ └── theme.conf ├── gmu.dge ├── gmu-nanonote.sh ├── gmu-gp2x.gpu ├── gmu-wiz.gpu ├── gmu-caanoo.gpu ├── gmu-z2.sh ├── .gitignore ├── gmu.desktop ├── gmuinput.dingux.conf ├── src ├── consts.h ├── dirparser.h ├── pthread_helper.h ├── frontends │ ├── web │ │ ├── base64.h │ │ ├── sha1.h │ │ ├── websocket.h │ │ ├── net.h │ │ ├── queue.h │ │ ├── base64.c │ │ ├── net.c │ │ ├── json.h │ │ └── httpd.h │ ├── sdl │ │ ├── about.h │ │ ├── help.h │ │ ├── inputconfig.h │ │ ├── question.h │ │ ├── playerdisplay.h │ │ ├── textbrowser.h │ │ ├── plmanager.h │ │ ├── setup.h │ │ ├── plbrowser.h │ │ ├── filebrowser.h │ │ ├── question.c │ │ ├── coverimg.h │ │ ├── gmuwidget.h │ │ ├── textrenderer.h │ │ ├── coverviewer.h │ │ ├── kam.h │ │ └── about.c │ └── lirc.c ├── fmath.c ├── metadatareader.h ├── imgsize.h ├── nethelper.h ├── pthread_helper.c ├── fmath.h ├── pbstatus.h ├── debug.h ├── gmuerror.h ├── oss_mixer.h ├── id3.h ├── fallthrough.h ├── bmp.h ├── png.h ├── jpeg.h ├── medialibsql.h ├── hw_zipit-z2.h ├── gmuerror.c ├── hw_pandora.h ├── hw_unknown.h ├── gmuevent.h ├── hw_dingux.h ├── hw_nanonote.h ├── hw_caanoo.h ├── hw_pre.h ├── tools │ ├── window.h │ ├── listwidget.h │ └── ui.h ├── feloader.h ├── debug.c ├── pls.h ├── decloader.h ├── ringbuffer.h ├── hw_gp2xwiz.h ├── m3u.h ├── fileplayer.h ├── hw_caanoo.c ├── hw_pandora.c ├── eventqueue.h ├── gmufrontend.h ├── hw_pre.c ├── hw_unknown.c ├── audio.h ├── dirparser.c ├── dir.h ├── metadatareader.c ├── hw_nanonote.c ├── charset.h ├── medialib.h ├── reader.h ├── wejconfig.h ├── nethelper.c ├── hw_zipit-z2.c ├── png.c ├── hw_dingux.c ├── oss_mixer.c └── bmp.c ├── gmuinput.gp2x.conf ├── gmuinput.wiz.conf ├── gmuinput.caanoo.conf ├── .github └── ISSUE_TEMPLATE │ └── bug_report.md ├── no_stick.keymap ├── links-alike.keymap ├── gmu.zipit-z2.conf ├── pagescroll.keymap ├── gp2x-f100.keymap ├── dingux.keymap ├── wiz.keymap ├── gp2x-f200.keymap ├── caanoo.keymap ├── gp2x.keymap ├── zipit-z2.keymap ├── gmu.pre.conf ├── gmu.wiz.conf ├── nanonote.keymap ├── pre.keymap ├── gmu.caanoo.conf ├── gmuinput.nanonote.conf ├── pandora.keymap ├── gmu.nanonote.conf ├── gmuinput.pandora.conf ├── gmu.dingux.conf ├── gmu.gp2x.conf ├── default.keymap ├── gmuinput.zipit-z2.conf ├── gmu.pandora.conf ├── gmu.unknown.conf ├── gmuinput.pre.conf ├── unknown.keymap ├── gmuinput.conf └── gmuinput.unknown.conf /gmu.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/gmu.bmp -------------------------------------------------------------------------------- /gmu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/gmu.png -------------------------------------------------------------------------------- /gmu-unknown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ./gmu.bin -c gmu.unknown.conf 3 | -------------------------------------------------------------------------------- /htdocs/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/htdocs/bg.png -------------------------------------------------------------------------------- /htdocs/gmu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/htdocs/gmu.png -------------------------------------------------------------------------------- /htdocs/icon_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/htdocs/icon_next.png -------------------------------------------------------------------------------- /htdocs/icon_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/htdocs/icon_pause.png -------------------------------------------------------------------------------- /htdocs/icon_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/htdocs/icon_play.png -------------------------------------------------------------------------------- /htdocs/icon_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/htdocs/icon_prev.png -------------------------------------------------------------------------------- /htdocs/icon_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/htdocs/icon_stop.png -------------------------------------------------------------------------------- /gmu-pandora.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd `dirname $0` 3 | LD_LIBRARY_PATH=libs.pandora/ ./gmu.bin -c gmu.pandora.conf 4 | -------------------------------------------------------------------------------- /themes/default-modern/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/arrow-up.png -------------------------------------------------------------------------------- /themes/default-modern/lvmiddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/lvmiddle.png -------------------------------------------------------------------------------- /themes/default-modern/symbols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/symbols.png -------------------------------------------------------------------------------- /gmu.dge: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd `dirname $0` 3 | SDL_NOMOUSE=1 LD_LIBRARY_PATH=libs.dingoo/ ./gmu.bin -c gmu.dingux.conf 4 | -------------------------------------------------------------------------------- /themes/default-modern/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/arrow-down.png -------------------------------------------------------------------------------- /themes/default-modern/display-tl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/display-tl.png -------------------------------------------------------------------------------- /themes/default-modern/display-tm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/display-tm.png -------------------------------------------------------------------------------- /themes/default-modern/display-tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/display-tr.png -------------------------------------------------------------------------------- /themes/default-modern/footer-tl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/footer-tl.png -------------------------------------------------------------------------------- /themes/default-modern/footer-tm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/footer-tm.png -------------------------------------------------------------------------------- /themes/default-modern/footer-tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/footer-tr.png -------------------------------------------------------------------------------- /themes/default-modern/letters_lcd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/letters_lcd.png -------------------------------------------------------------------------------- /themes/default-modern/textarea-m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/textarea-m.png -------------------------------------------------------------------------------- /themes/default-modern-large/symbols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/symbols.png -------------------------------------------------------------------------------- /themes/default-modern/letters_lcd_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/letters_lcd_1.png -------------------------------------------------------------------------------- /themes/default-modern/letters_lcd_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/letters_lcd_2.png -------------------------------------------------------------------------------- /themes/default-modern-large/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/arrow-down.png -------------------------------------------------------------------------------- /themes/default-modern-large/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/arrow-up.png -------------------------------------------------------------------------------- /themes/default-modern-large/display-tl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/display-tl.png -------------------------------------------------------------------------------- /themes/default-modern-large/display-tm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/display-tm.png -------------------------------------------------------------------------------- /themes/default-modern-large/display-tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/display-tr.png -------------------------------------------------------------------------------- /themes/default-modern-large/footer-tl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/footer-tl.png -------------------------------------------------------------------------------- /themes/default-modern-large/footer-tm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/footer-tm.png -------------------------------------------------------------------------------- /themes/default-modern-large/footer-tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/footer-tr.png -------------------------------------------------------------------------------- /themes/default-modern-large/lvmiddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/lvmiddle.png -------------------------------------------------------------------------------- /themes/default-modern-large/textarea-m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/textarea-m.png -------------------------------------------------------------------------------- /themes/default-modern/letters_small_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/letters_small_1.png -------------------------------------------------------------------------------- /gmu-nanonote.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd `dirname $0` 3 | SDL_NOMOUSE=1 LD_LIBRARY_PATH=libs.nanonote/ ./gmu.bin -c gmu.nanonote.conf 4 | -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/arrow-up.png -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/lvmiddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/lvmiddle.png -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/symbols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/symbols.png -------------------------------------------------------------------------------- /themes/default-modern-large/letters_lcd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/letters_lcd.png -------------------------------------------------------------------------------- /themes/default-modern/letters_lcd_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/letters_lcd_black.png -------------------------------------------------------------------------------- /themes/default-modern/letters_small_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/letters_small_blue.png -------------------------------------------------------------------------------- /gmu-gp2x.gpu: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd `dirname $0` 3 | LD_LIBRARY_PATH=libs.gp2xwiz/ ./gmu -c gmu.gp2x.conf 4 | cd /usr/gp2x 5 | ./gp2xmenu 6 | -------------------------------------------------------------------------------- /gmu-wiz.gpu: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd `dirname $0` 3 | LD_LIBRARY_PATH=libs.gp2xwiz/ ./gmu.bin -c gmu.wiz.conf 4 | cd /usr/gp2x 5 | ./gp2xmenu 6 | -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/arrow-down.png -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/display-tl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/display-tl.png -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/display-tm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/display-tm.png -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/display-tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/display-tr.png -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/footer-tl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/footer-tl.png -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/footer-tm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/footer-tm.png -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/footer-tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/footer-tr.png -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/textarea-m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/textarea-m.png -------------------------------------------------------------------------------- /themes/default-modern-large/letters_lcd_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/letters_lcd_1.png -------------------------------------------------------------------------------- /themes/default-modern-large/letters_lcd_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/letters_lcd_2.png -------------------------------------------------------------------------------- /themes/default-modern/letters_small_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/letters_small_black.png -------------------------------------------------------------------------------- /themes/default-modern/letters_small_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/letters_small_orange.png -------------------------------------------------------------------------------- /themes/default-modern/letters_small_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern/letters_small_white.png -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/letters_lcd_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/letters_lcd_2.png -------------------------------------------------------------------------------- /themes/default-modern-large/letters_lcd_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/letters_lcd_black.png -------------------------------------------------------------------------------- /gmu-caanoo.gpu: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd `dirname $0` 3 | LD_LIBRARY_PATH=./libs.caanoo/ ./gmu.bin -c gmu.caanoo.conf 4 | cd /usr/gp2x 5 | ./gp2xmenu 6 | -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/NotoSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large-ttf/NotoSans-Regular.ttf -------------------------------------------------------------------------------- /themes/default-modern-large/letters_large_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/letters_large_blue.png -------------------------------------------------------------------------------- /themes/default-modern-large/letters_large_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhe2/gmu/HEAD/themes/default-modern-large/letters_large_white.png -------------------------------------------------------------------------------- /gmu-z2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd `dirname $0` 3 | SDL_AUDIODRIVER=dsp SDL_NOMOUSE=1 SDL_VIDEO_FBCON_ROTATION="CCW" LD_LIBRARY_PATH=libs.zipit-z2/ ./gmu.bin -c gmu.zipit-z2.conf 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.ogg 3 | *.mp3 4 | *.flac 5 | *.bak 6 | *.m3u 7 | *.log 8 | *.tmp 9 | *.zip 10 | *.tar.gz 11 | tmp 12 | config.mk 13 | decoders/* 14 | frontends/* 15 | gmu.bin 16 | gmuc 17 | -------------------------------------------------------------------------------- /gmu.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Name=Gmu Music Player 4 | Comment=A multi-format music player 5 | Exec=gmu 6 | Terminal=false 7 | Type=Application 8 | Icon=gmu 9 | Categories=Multimedia;Audio; 10 | StartupNotify=false 11 | GenericName= 12 | -------------------------------------------------------------------------------- /gmuinput.dingux.conf: -------------------------------------------------------------------------------- 1 | FullKeyboard=no 2 | Button-0=273,Up 3 | Button-1=274,Down 4 | Button-2=276,Left 5 | Button-3=275,Right 6 | Button-4=27,Select 7 | Button-5=13,Start 8 | Button-6=306,A 9 | Button-7=308,B 10 | Button-8=304,Y 11 | Button-9=32,X 12 | Button-10=8,R 13 | Button-11=9,L 14 | Button-12=19,Lock 15 | Button-13=19,Unlock,R 16 | -------------------------------------------------------------------------------- /src/consts.h: -------------------------------------------------------------------------------- 1 | #ifndef WEJ_CONSTS_H 2 | #define WEJ_CONSTS_H 3 | 4 | /* Total maximum length for a file path */ 5 | #define PATH_LEN_MAX 512 6 | /* Maximum legth of the filename part of a file path */ 7 | #define PATH_LEN_FILENAME_MAX 255 8 | /* Maximum length of the directory part of a file path */ 9 | #define PATH_LEN_DIR_MAX 255 10 | #endif 11 | -------------------------------------------------------------------------------- /gmuinput.gp2x.conf: -------------------------------------------------------------------------------- 1 | FullKeyboard=no 2 | JoyButton-0=0,Up 3 | JoyButton-1=4,Down 4 | JoyButton-2=2,Left 5 | JoyButton-3=6,Right 6 | JoyButton-4=8,Start 7 | JoyButton-5=9,Select 8 | JoyButton-6=12,A 9 | JoyButton-7=13,B 10 | JoyButton-8=15,Y 11 | JoyButton-9=14,X 12 | JoyButton-10=10,L 13 | JoyButton-11=11,R 14 | JoyButton-12=16,VolUp 15 | JoyButton-13=17,VolDown 16 | JoyButton-14=18,StickClick 17 | -------------------------------------------------------------------------------- /gmuinput.wiz.conf: -------------------------------------------------------------------------------- 1 | FullKeyboard=no 2 | JoyButton-0=0,Up 3 | JoyButton-1=4,Down 4 | JoyButton-2=2,Left 5 | JoyButton-3=6,Right 6 | JoyButton-4=8,Menu 7 | JoyButton-5=9,Select 8 | JoyButton-6=12,A 9 | JoyButton-7=13,B 10 | JoyButton-8=14,X 11 | JoyButton-9=15,Y 12 | JoyButton-10=10,L 13 | JoyButton-11=11,R 14 | JoyButton-12=16,VolUp 15 | JoyButton-13=17,VolDown 16 | JoyButton-14=18,StickClick 17 | -------------------------------------------------------------------------------- /gmuinput.caanoo.conf: -------------------------------------------------------------------------------- 1 | FullKeyboard=no 2 | JoyButton-0=0,A 3 | JoyButton-1=1,X 4 | JoyButton-2=2,B 5 | JoyButton-3=3,Y 6 | JoyButton-4=7,Lock 7 | JoyButton-5=8,HelpI 8 | JoyButton-6=9,HelpII 9 | JoyButton-7=10,StickClick 10 | JoyButton-8=4,L 11 | JoyButton-9=5,R 12 | JoyButton-10=6,Home 13 | JoyButton-11=7,Unlock,R 14 | JoyAxis-0=-1,Left 15 | JoyAxis-1=1,Right 16 | JoyAxis-2=-2,Up 17 | JoyAxis-3=2,Down 18 | 19 | -------------------------------------------------------------------------------- /src/dirparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2014 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: dirparser.h Created: 130702 7 | * 8 | * Description: Directory parser 9 | */ 10 | #ifndef WEJ_DIRPARSER_H 11 | #define WEJ_DIRPARSER_H 12 | 13 | #define DIRPARSER_MAX_DEPTH (10) 14 | 15 | int dirparser_walk_through_directory_tree(const char *directory, int (fn(void *arg, const char *filename)), void *arg, int dir_depth); 16 | #endif 17 | -------------------------------------------------------------------------------- /src/pthread_helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2016 Johannes Heimansberg (wej.k.vu) 5 | * 6 | * File: pthread_helper.h Created: 160612 7 | * 8 | * Description: pthread related functions 9 | */ 10 | #ifndef PTHREAD_HELPER_H 11 | #define PTHREAD_HELPER_H 12 | #include 13 | 14 | int pthread_create_with_stack_size( 15 | pthread_t *thread, const size_t stack_size, 16 | void *(*start_routine) (void *), void *arg 17 | ); 18 | #endif 19 | -------------------------------------------------------------------------------- /src/frontends/web/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2012 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: base64.h Created: 120118 7 | * 8 | * Description: base64 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef GMU_BASE64_H 17 | #define GMU_BASE64_H 18 | void base64_encode_data(unsigned char *in, int in_len, char *out, int out_max_len); 19 | #endif 20 | -------------------------------------------------------------------------------- /src/fmath.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2011 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: fmath.c Created: 110511 7 | * 8 | * Description: Integer math stuff 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "fmath.h" 18 | #include "fmath_tables.h" 19 | 20 | int fsin(int x) 21 | { 22 | return _sin[x % 6283]; 23 | } 24 | 25 | int fcos(int x) 26 | { 27 | return _cos[x % 6283]; 28 | } 29 | -------------------------------------------------------------------------------- /src/metadatareader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2013 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: metadatareader.h Created: 130709 7 | * 8 | * Description: Meta data reader; Reads meta data from audio files into 9 | * TrackInfo struct 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU General Public License 13 | * as published by the Free Software Foundation; version 2 of 14 | * the License. See the file COPYING in the Gmu's main directory 15 | * for details. 16 | */ 17 | 18 | #include "trackinfo.h" 19 | 20 | int metadatareader_read(const char *file, const char *file_type, TrackInfo *ti); 21 | -------------------------------------------------------------------------------- /src/frontends/web/sha1.h: -------------------------------------------------------------------------------- 1 | /* public api for steve reid's public domain SHA-1 implementation */ 2 | /* this file is in the public domain */ 3 | 4 | #ifndef __SHA1_H 5 | #define __SHA1_H 6 | #include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | typedef struct { 13 | uint32_t state[5]; 14 | uint32_t count[2]; 15 | uint8_t buffer[64]; 16 | } SHA1_CTX; 17 | 18 | #define SHA1_DIGEST_SIZE 20 19 | 20 | void SHA1_Init(SHA1_CTX* context); 21 | void SHA1_Update(SHA1_CTX* context, uint8_t* data, const size_t len); 22 | void SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE]); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif /* __SHA1_H */ 29 | -------------------------------------------------------------------------------- /src/imgsize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: imgsize.h Created: 070614 7 | * 8 | * Description: Image size struct (used by jpeg.c and png.c) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #ifndef _IMGSIZE_H 18 | #define _IMGSIZE_H 19 | typedef struct _ImageSize 20 | { 21 | int file; 22 | FILE *infile; 23 | char *memptr; 24 | int memsize; 25 | } ImageSize; 26 | #endif 27 | -------------------------------------------------------------------------------- /src/nethelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2013 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: nethelper.h Created: 130202 7 | * 8 | * Description: Helper functions for network communication 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef GMU_NETHELPER_H 17 | #define GMU_NETHELPER_H 18 | 19 | /* Returns a file descriptor on success, or 0 or a negative number otherwise */ 20 | int nethelper_tcp_connect_to_host(char *hostname, int port, int flags); 21 | #endif 22 | -------------------------------------------------------------------------------- /src/pthread_helper.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2016 Johannes Heimansberg (wej.k.vu) 5 | * 6 | * File: pthread_helper.c Created: 160612 7 | * 8 | * Description: pthread related functions 9 | */ 10 | #include 11 | #include "pthread_helper.h" 12 | 13 | int pthread_create_with_stack_size( 14 | pthread_t *thread, const size_t stack_size, 15 | void *(*start_routine) (void *), void *arg 16 | ) 17 | { 18 | int res = -1; 19 | static pthread_attr_t attr; 20 | 21 | if (pthread_attr_init(&attr) == 0) { 22 | if (pthread_attr_setstacksize(&attr, stack_size) == 0) { 23 | res = pthread_create(thread, &attr, start_routine, arg); 24 | } 25 | pthread_attr_destroy(&attr); 26 | } 27 | return res; 28 | } 29 | -------------------------------------------------------------------------------- /src/fmath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2011 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: fmath.h Created: 110511 7 | * 8 | * Description: Integer math stuff 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | 17 | #ifndef _FMATH_H 18 | #define _FMATH_H 19 | 20 | #define F_PI2 6283 21 | #define F_PI 3142 22 | 23 | /* Functions return results as value multiplied by 10000, 24 | * Arguments have to be multiplied by 1000 */ 25 | int fsin(int x); 26 | int fcos(int x); 27 | #endif 28 | -------------------------------------------------------------------------------- /src/pbstatus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2014 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: pbstatus.h Created: ? 7 | * 8 | * Description: playback status enumeration 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _PBSTATUS_H 17 | #define _PBSTATUS_H 18 | enum _PB_Status { STOPPED, PLAYING, PAUSED, FINISHED }; 19 | 20 | typedef enum _PB_Status PB_Status; 21 | 22 | typedef enum _PB_Status_Request { 23 | PBRQ_NONE, PBRQ_STOP, PBRQ_PLAY, PBRQ_PAUSE 24 | } PB_Status_Request; 25 | #endif 26 | -------------------------------------------------------------------------------- /src/frontends/sdl/about.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2023 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: about.h Created: 061223 7 | * 8 | * Description: Program info 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include "kam.h" 17 | #include "textbrowser.h" 18 | 19 | #ifndef _ABOUT_H 20 | #define _ABOUT_H 21 | int about_process_action(TextBrowser *tb_about, View *view, View old_view, int user_key_action); 22 | void about_init(TextBrowser *tb_about, Skin *skin, const char *decoders); 23 | #endif 24 | -------------------------------------------------------------------------------- /src/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2011 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: debug.h Created: 110107 7 | * 8 | * Description: Debug output 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _DEBUG_H 17 | #define _DEBUG_H 18 | typedef enum Verbosity { 19 | V_SILENT = 0, V_FATAL = 1, V_ERROR = 2, V_WARNING = 3, V_INFO = 4, V_DEBUG = 5 20 | } Verbosity; 21 | 22 | void wdprintf_set_verbosity(Verbosity v); 23 | int wdprintf(Verbosity v, const char *module, const char *fmt, ...); 24 | #endif 25 | -------------------------------------------------------------------------------- /src/frontends/web/websocket.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2012 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File:websocket.h Created: 120930 7 | * 8 | * Description: Websocket functions 9 | */ 10 | 11 | #ifndef WEBSOCKET_H 12 | #define WEBSOCKET_H 13 | char *websocket_unmask_message_alloc(const char *msgbuf, int msgbuf_size); 14 | char *websocket_prepare_message_from_str_alloc(const char *str, int mask); 15 | char *websocket_client_generate_sec_websocket_key_alloc(void); 16 | int websocket_send_str(int sock, const char *str, int mask); 17 | int websocket_calculate_payload_size(const char *websocket_packet_header); 18 | const char *websocket_get_payload(const char *websocket_packet); 19 | int websocket_calculate_packet_size(const char *websocket_packet); 20 | #endif 21 | -------------------------------------------------------------------------------- /src/gmuerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2014 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: gmuerror.h Created: 140822 7 | * 8 | * Description: Gmu errors header file 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | 17 | #ifndef _GMUERROR_H 18 | #define _GMUERROR_H 19 | typedef enum GmuError { 20 | GMU_ERROR_UNKNOWN = 0, 21 | GMU_ERROR_CANNOT_OPEN_AUDIO_DEVICE, GMU_ERROR_CANNOT_OPEN_FILE, 22 | GMU_ERROR_END_MARKER 23 | } GmuError; 24 | 25 | const char *gmu_error_get_message(GmuError error); 26 | #endif 27 | -------------------------------------------------------------------------------- /src/frontends/sdl/help.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu GP2X Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: help.h Created: 100404 7 | * 8 | * Description: Program info 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include "kam.h" 17 | #include "textbrowser.h" 18 | #include "core.h" 19 | 20 | #ifndef _HELP_H 21 | #define _HELP_H 22 | void help_init(TextBrowser *tb_help, Skin *skin, KeyActionMapping *kam); 23 | int help_process_action(TextBrowser *tb_help, View *view, View old_view, int user_key_action); 24 | #endif 25 | -------------------------------------------------------------------------------- /src/oss_mixer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2016 Johannes Heimansberg (wej.k.vu) 5 | * 6 | * File: oss_mixer.h Created: 090630 7 | * 8 | * Description: OSS audio mixer functions 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef GMU_OSS_MIXER_H 17 | #define GMU_OSS_MIXER_H 18 | int oss_mixer_open(void); 19 | void oss_mixer_close(void); 20 | void oss_mixer_set_volume(unsigned int mixer, int volume); 21 | int oss_mixer_get_volume(unsigned int mixer); 22 | int oss_mixer_is_mixer_available(unsigned int mixer); 23 | #endif 24 | -------------------------------------------------------------------------------- /src/id3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: id3.h Created: 061030 7 | * 8 | * Description: Wejp's ID3 parser 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _ID3_H 17 | #define _ID3_H 18 | #include 19 | #include "trackinfo.h" 20 | 21 | int id3_read_id3v1(FILE *file, TrackInfo *ti, const char *file_type); 22 | int id3_read_id3v2(FILE *file, TrackInfo *ti, const char *file_type); 23 | int id3_read_tag(const char *filename, TrackInfo *ti, const char *file_type); 24 | #endif 25 | -------------------------------------------------------------------------------- /src/frontends/web/net.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2015 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: net.h Created: 121005 7 | * 8 | * Description: Network helper functions 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | 17 | #ifndef WEJ_NET_H 18 | #define WEJ_NET_H 19 | /* Send data of specified length 'size' to the client socket */ 20 | int net_send_block(int sock, const unsigned char *buf, size_t size); 21 | /* Send a null-terminated string of arbitrary length to the client socket */ 22 | int net_send_buf(int sock, const char *buf); 23 | #endif 24 | -------------------------------------------------------------------------------- /src/fallthrough.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2025 Johannes Heimansberg (wej.k.vu) 5 | * 6 | * File: fallthrough.h Created: 251116 7 | * 8 | * Description: General purpose ring buffer 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _FALLTHROUGH_H 17 | #define _FALLTHROUGH_H 18 | 19 | #ifdef __has_attribute 20 | # if __has_attribute(__fallthrough__) 21 | # define fallthrough() __attribute__((__fallthrough__)) 22 | # endif 23 | #endif 24 | #ifndef fallthrough 25 | # define fallthrough() do {} while (0) /* fallthrough */ 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **System (please complete the following information):** 27 | - Hardware: [e.g. Foo Handheld, CPU: ARM Cortex A53 in 32 bit mode, RAM: 1024 MB] 28 | - OS: [e.g. Linux 5.12.19 with glibc 2.24+busybox userland running Xorg with Openbox] 29 | 30 | **Additional context** 31 | Add any other context about the problem here. 32 | -------------------------------------------------------------------------------- /src/bmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2015 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: bmp.h Created: 070616 7 | * 8 | * Description: bmp image dimensions detector 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "imgsize.h" 18 | #ifndef _BMP_H 19 | #define _BMP_H 20 | /* functions return 1 if a valid bmp header was found, otherwise 0 */ 21 | int bmp_get_dimensions_from_file(ImageSize *is, char *filename, unsigned int *width, unsigned int *height); 22 | int bmp_get_dimensions_from_memory(ImageSize *is, char *mem, unsigned int memsize, unsigned int *width, unsigned int *height); 23 | #endif 24 | -------------------------------------------------------------------------------- /src/png.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: png.h Created: 070605 7 | * 8 | * Description: png image dimensions detector 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "imgsize.h" 18 | #ifndef _PNG_H 19 | #define _PNG_H 20 | /* functions return 1 if a valid png header was found, otherwise 0 */ 21 | int png_get_dimensions_from_file(ImageSize *is, char *filename, unsigned int *width, unsigned int *height); 22 | int png_get_dimensions_from_memory(ImageSize *is, char *mem, unsigned int memsize, unsigned int *width, unsigned int *height); 23 | #endif 24 | -------------------------------------------------------------------------------- /src/jpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: jpeg.h Created: 070605 7 | * 8 | * Description: jpeg image dimensions detector 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "imgsize.h" 18 | #ifndef _JPEG_H 19 | #define _JPEG_H 20 | /* functions return 1 if a valid jpeg header was found, otherwise 0 */ 21 | int jpeg_get_dimensions_from_file(ImageSize *is, char *filename, unsigned int *width, unsigned int *height); 22 | int jpeg_get_dimensions_from_memory(ImageSize *is, char *mem, unsigned int memsize, unsigned int *width, unsigned int *height); 23 | #endif 24 | -------------------------------------------------------------------------------- /src/medialibsql.h: -------------------------------------------------------------------------------- 1 | const char *medialib_sql = 2 | "CREATE TABLE track \ 3 | ( \ 4 | id integer primary key, \ 5 | file varchar(255), \ 6 | length integer, \ 7 | artist varchar(255), \ 8 | title varchar(255), \ 9 | album varchar(255), \ 10 | label varchar(64), \ 11 | comment varchar(128), \ 12 | rating_explicit integer, \ 13 | rating_implicit integer, \ 14 | date timestamp, \ 15 | genre varchar(64), \ 16 | tempo integer, \ 17 | license varchar(32), \ 18 | type integer, \ 19 | play_count integer, \ 20 | skip_count integer, \ 21 | file_missing integer \ 22 | ); \ 23 | \ 24 | CREATE TABLE aditional_trackinfo \ 25 | ( \ 26 | track_id integer, \ 27 | key varchar(32), \ 28 | value varchar(255) \ 29 | ); \ 30 | \ 31 | CREATE TABLE similarity \ 32 | ( \ 33 | track_id_a integer, \ 34 | track_id_b integer, \ 35 | similarity integer \ 36 | ); \ 37 | \ 38 | CREATE TABLE path \ 39 | ( \ 40 | id integer primary key, \ 41 | path varchar(255), \ 42 | date timestamp \ 43 | );"; 44 | -------------------------------------------------------------------------------- /src/hw_zipit-z2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_zipit-z2.h Created: 100821 7 | * 8 | * Description: Hardware specific header file for the Zipit Z2 handheld 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #ifndef _HW_ZIPIT_Z2_H 18 | #define _HW_ZIPIT_Z2_H 19 | 20 | #define SAMPLE_BUFFER_SIZE 4096 21 | 22 | int hw_open_mixer(int mixer_channel); 23 | void hw_close_mixer(void); 24 | void hw_set_volume(int volume); 25 | void hw_display_off(void); 26 | void hw_display_on(void); 27 | void hw_detect_device_model(void); 28 | const char *hw_get_device_model_name(void); 29 | #endif 30 | -------------------------------------------------------------------------------- /src/gmuerror.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2014 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: gmuerror.h Created: 140822 7 | * 8 | * Description: Gmu errors header file 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | 17 | #include 18 | #include "gmuerror.h" 19 | 20 | /* 21 | * The number of error message strings must match the number of items 22 | * in GmuError enum in gmuerror.h minus one 23 | */ 24 | static const char *gmu_error_message[] = { 25 | "Unknown error", 26 | "ERROR: Cannot open audio device", 27 | "ERROR: Cannot open file" 28 | }; 29 | 30 | const char *gmu_error_get_message(GmuError error) 31 | { 32 | return error < GMU_ERROR_END_MARKER ? gmu_error_message[error] : NULL; 33 | } 34 | -------------------------------------------------------------------------------- /src/hw_pandora.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_pandora.h Created: 100626 7 | * 8 | * Description: Hardware specific header file for the Pandora handheld 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #ifndef _HW_PANDORA_H 18 | #define _HW_PANDORA_H 19 | 20 | #define SAMPLE_BUFFER_SIZE 4096 21 | 22 | #define SHOW_MOUSE_CURSOR 1 23 | 24 | int hw_open_mixer(int mixer_channel); 25 | void hw_close_mixer(void); 26 | void hw_set_volume(int volume); 27 | void hw_display_off(void); 28 | void hw_display_on(void); 29 | void hw_detect_device_model(void); 30 | const char *hw_get_device_model_name(void); 31 | #endif 32 | -------------------------------------------------------------------------------- /src/hw_unknown.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_unknown.h Created: 090629 7 | * 8 | * Description: Hardware specific header file for unknown devices (such as PCs) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #ifndef _HW_UNKNOWN_H 18 | #define _HW_UNKNOWN_H 19 | 20 | #define SAMPLE_BUFFER_SIZE 4096 21 | 22 | #define SHOW_MOUSE_CURSOR 1 23 | 24 | int hw_open_mixer(int mixer_channel); 25 | void hw_close_mixer(void); 26 | void hw_set_volume(int volume); 27 | void hw_display_off(void); 28 | void hw_display_on(void); 29 | void hw_detect_device_model(void); 30 | const char *hw_get_device_model_name(void); 31 | #endif 32 | -------------------------------------------------------------------------------- /src/gmuevent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2014 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: gmuevent.h Created: 110427 7 | * 8 | * Description: Gmu events header file 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | 17 | #ifndef _GMUEVENT_H 18 | #define _GMUEVENT_H 19 | typedef enum GmuEvent { 20 | GMU_NO_EVENT, 21 | GMU_PLAYLIST_CHANGE, GMU_QUEUE_CHANGE, GMU_PLAYLIST_CLEAR, 22 | GMU_TRACK_CHANGE, GMU_PLAYBACK_STATE_CHANGE, 23 | GMU_PLAYMODE_CHANGE, GMU_QUIT, GMU_VOLUME_CHANGE, 24 | GMU_TRACKINFO_CHANGE, GMU_BUFFER_EMPTY, 25 | GMU_FILE_ERROR, GMU_NETWORK_ERROR, 26 | GMU_BUFFERING, GMU_BUFFERING_FAILED, GMU_BUFFERING_DONE, 27 | GMU_PLAYBACK_TIME_CHANGE, GMU_MEDIALIB_REFRESH_DONE, 28 | GMU_MEDIALIB_SEARCH_START, GMU_MEDIALIB_SEARCH_DONE, 29 | GMU_ERROR, GMU_TICK 30 | } GmuEvent; 31 | #endif 32 | -------------------------------------------------------------------------------- /src/hw_dingux.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_dingoo.h Created: 090623 7 | * 8 | * Description: Dingoo specific stuff (button mapping etc.) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _HW_DINGOO_H 17 | #define _HW_DINGOO_H 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #define SAMPLE_BUFFER_SIZE 4096 27 | 28 | int hw_open_mixer(int mixer_channel); 29 | void hw_close_mixer(void); 30 | void hw_set_volume(int volume); 31 | void hw_display_off(void); 32 | void hw_display_on(void); 33 | void hw_detect_device_model(void); 34 | const char *hw_get_device_model_name(void); 35 | #endif 36 | -------------------------------------------------------------------------------- /src/hw_nanonote.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_nanonote.h Created: 100111 7 | * 8 | * Description: Ben NanoNote specific stuff (button mapping etc.) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _HW_NANONOTE_H 17 | #define _HW_NANONOTE_H 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #define SAMPLE_BUFFER_SIZE 4096 27 | 28 | int hw_open_mixer(int mixer_channel); 29 | void hw_close_mixer(void); 30 | void hw_set_volume(int volume); 31 | void hw_display_off(void); 32 | void hw_display_on(void); 33 | void hw_detect_device_model(void); 34 | const char *hw_get_device_model_name(void); 35 | #endif 36 | -------------------------------------------------------------------------------- /src/hw_caanoo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2013 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_caanoo.h Created: 130214 7 | * 8 | * Description: Hardware specific header file for the Caanoo 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #ifndef _HW_CAANOO_H 18 | #define _HW_CAANOO_H 19 | 20 | #define HW_COLOR_DEPTH 32 21 | #define HW_SCREEN_WIDTH 320 22 | #define HW_SCREEN_HEIGHT 240 23 | 24 | #define SAMPLE_BUFFER_SIZE 4096 25 | 26 | #define SHOW_MOUSE_CURSOR 0 27 | 28 | int hw_open_mixer(int mixer_channel); 29 | void hw_close_mixer(void); 30 | void hw_set_volume(int volume); 31 | void hw_display_off(void); 32 | void hw_display_on(void); 33 | void hw_detect_device_model(void); 34 | const char *hw_get_device_model_name(void); 35 | #endif 36 | -------------------------------------------------------------------------------- /src/frontends/sdl/inputconfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2015 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: inputconfig.h Created: 100306 7 | * 8 | * Description: Input devices configuration 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #ifndef _INPUTCONFIG_H 22 | #define _INPUTCONFIG_H 23 | 24 | #define MAX_BUTTONS 256 25 | 26 | typedef enum InputType { INPUT_KEYBOARD, INPUT_JOYSTICK } InputType; 27 | typedef enum ActivateMethod { ACTIVATE_PRESS, ACTIVATE_RELEASE, ACTIVATE_JOYAXIS_MOVE } ActivateMethod; 28 | 29 | int input_config_init(char *inputconf_file); 30 | char *input_config_get_button_name(int val, InputType type); 31 | int input_config_get_val(char *button_name, ActivateMethod *am); 32 | int input_config_has_joystick(void); 33 | void input_config_free(void); 34 | #endif 35 | -------------------------------------------------------------------------------- /src/frontends/web/queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2014 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: queue.h Created: 120212 7 | * 8 | * Description: A queue for storing strings 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | 18 | #ifndef GMU_QUEUE_H 19 | #define GMU_QUEUE_H 20 | typedef struct _QueueEntry QueueEntry; 21 | 22 | struct _QueueEntry 23 | { 24 | QueueEntry *next; 25 | char *str; 26 | }; 27 | 28 | struct _Queue 29 | { 30 | QueueEntry *first, *last; 31 | pthread_mutex_t mutex, mutex_cond; 32 | pthread_cond_t cond; 33 | }; 34 | 35 | typedef struct _Queue Queue; 36 | 37 | void queue_init(Queue *q); 38 | int queue_push(Queue *q, const char *str); 39 | char *queue_pop_alloc(Queue *q); 40 | void queue_clear(Queue *q); 41 | int queue_is_empty(Queue *q); 42 | void queue_free(Queue *q); 43 | #endif 44 | -------------------------------------------------------------------------------- /src/frontends/sdl/question.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: question.h Created: 061130 7 | * 8 | * Description: Question dialog 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include "kam.h" 17 | #include "textrenderer.h" 18 | #include "skin.h" 19 | #ifndef _QUESTION_H 20 | #define _QUESTION_H 21 | typedef struct Question { 22 | char *question; 23 | View return_view; 24 | View *view; 25 | Skin *skin; 26 | void (*positive_result_func)(void *); 27 | void *arg; 28 | } Question; 29 | 30 | void question_init(Question *dlg, Skin *skin); 31 | int question_process_action(Question *dlg, int user_key_action); 32 | void question_draw(Question *dlg, SDL_Surface *sdl_target); 33 | void question_set(Question *dlg, View return_view, View *view, char *question, 34 | void (*positive_result_func)(void *), void *arg); 35 | #endif 36 | -------------------------------------------------------------------------------- /src/hw_pre.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_unknown.h Created: 090629 7 | * 8 | * Description: Hardware specific header file for unknown devices (such as PCs) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #ifndef _HW_PRE_H 18 | #define _HW_PRE_H 19 | 20 | #define SAMPLE_BUFFER_SIZE 4096 21 | 22 | #define SHOW_MOUSE_CURSOR 1 23 | 24 | int hw_open_mixer(int mixer_channel); 25 | void hw_close_mixer(void); 26 | void hw_set_volume(int volume); 27 | void hw_display_off(void); 28 | void hw_display_on(void); 29 | void hw_detect_device_model(void); 30 | const char *hw_get_device_model_name(void); 31 | #define HW_INIT_DEVICE 1 32 | void hw_init_device(void); 33 | #define HW_SDL_POST_INIT 1 34 | void hw_sdl_post_init(void); 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tools/window.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2012 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: window.h Created: 121028 7 | * 8 | * Description: Window widget for Ncurses Gmu text client 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef WEJ_WINDOW_H 17 | #define WEJ_WINDOW_H 18 | typedef enum WindowType { WIN_CMD, WIN_PL, WIN_TI, WIN_FB, WIN_LIB } WindowType; 19 | 20 | typedef struct Window 21 | { 22 | WINDOW *win, *win_outer; 23 | char *title; 24 | int width, height; 25 | } Window; 26 | 27 | Window *window_create(int height, int width, int starty, int startx, char *title); 28 | int window_update_title(Window *win, char *title); 29 | void window_resize(Window *win, int height, int width); 30 | int window_get_width(Window *win); 31 | int window_get_height(Window *win); 32 | int window_refresh(Window *win); 33 | void window_destroy(Window *win); 34 | #endif 35 | -------------------------------------------------------------------------------- /src/frontends/sdl/playerdisplay.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2012 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: playerdisplay.h Created: 061109 7 | * 8 | * Description: Gmu's display 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "textrenderer.h" 18 | #include "trackinfo.h" 19 | #include "pbstatus.h" 20 | 21 | #ifndef _PLAYERDISPLAY_H 22 | #define _PLAYERDISPLAY_H 23 | 24 | enum { SCROLL_AUTO, SCROLL_ALWAYS, SCROLL_NEVER }; 25 | 26 | int player_display_init(void); 27 | void player_display_free(void); 28 | void player_display_draw( 29 | TextRenderer *tr, TrackInfo *ti,PB_Status player_status, 30 | int ptime_msec, int ptime_remaining, int volume, 31 | int busy, char shutdown_time, SDL_Surface *buffer 32 | ); 33 | void player_display_set_notice_message(const char *message, int timeout); 34 | void player_display_set_scrolling(int s); 35 | void player_display_set_playback_symbol_blinking(int blink); 36 | #endif 37 | -------------------------------------------------------------------------------- /src/feloader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2014 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: feloader.h Created: 081228 7 | * 8 | * Description: Shared object decoader loader for Gmu frontend plugins 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _FELOADER_H 17 | #define _FELOADER_H 18 | #include "gmufrontend.h" 19 | 20 | typedef struct _FrontendChainElement FrontendChainElement; 21 | 22 | struct _FrontendChainElement { 23 | FrontendChainElement *next; 24 | GmuFrontend *gf; 25 | }; 26 | 27 | GmuFrontend *feloader_load_frontend(char *so_file); 28 | /* Loads a frontend and adds it to the frontend chain: */ 29 | int feloader_load_single_frontend(char *so_file); 30 | int feloader_load_all(char *directory); 31 | GmuFrontend *feloader_frontend_list_get_next_frontend(int getfirst); 32 | void feloader_free(void); 33 | int feloader_unload_frontend(GmuFrontend *gf); 34 | int feloader_load_builtin_frontends(void); 35 | #endif 36 | -------------------------------------------------------------------------------- /src/debug.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2020 Johannes Heimansberg (wej.k.vu) 5 | * 6 | * File: debug.h Created: 110107 7 | * 8 | * Description: Debug output 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include "debug.h" 22 | 23 | static Verbosity wdprintf_verbosity = V_DEBUG; 24 | 25 | void wdprintf_set_verbosity(Verbosity v) 26 | { 27 | wdprintf_verbosity = v; 28 | } 29 | 30 | int wdprintf(Verbosity v, const char *module, const char *fmt, ...) 31 | { 32 | va_list ap; 33 | char timestr[200]; 34 | time_t t; 35 | struct tm *lt; 36 | 37 | if (v <= wdprintf_verbosity) { 38 | t = time(NULL); 39 | lt = localtime(&t); 40 | if (lt && strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S", lt) > 0) 41 | printf("%s ", timestr); 42 | if (module) printf("%s: ", module); 43 | va_start(ap, fmt); 44 | vprintf(fmt, ap); 45 | va_end(ap); 46 | } 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /src/pls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2015 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: pls.h Created: 110420 7 | * 8 | * Description: wejp's pls parser 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _PLS_H 17 | #define _PLS_H 18 | #include 19 | #include "consts.h" 20 | 21 | #define MAX_LINE_LENGTH 256 22 | 23 | typedef struct PLS 24 | { 25 | FILE *pl_file; 26 | char pls_path[PATH_LEN_DIR_MAX]; 27 | short version; 28 | char current_item_title[MAX_LINE_LENGTH]; 29 | char current_item_filename[PATH_LEN_FILENAME_MAX]; 30 | char current_item_path[PATH_LEN_MAX]; 31 | size_t current_item_length; 32 | } PLS; 33 | 34 | int pls_open_file(PLS *pls, const char *filename); 35 | void pls_close_file(PLS *pls); 36 | int pls_read_next_item(PLS *pls); 37 | char *pls_current_item_get_title(PLS *pls); 38 | char *pls_current_item_get_filename(PLS *pls); 39 | char *pls_current_item_get_full_path(PLS *pls); 40 | size_t pls_current_item_get_length(PLS *pls); 41 | #endif 42 | -------------------------------------------------------------------------------- /src/decloader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2014 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: decloader.h Created: 081022 7 | * 8 | * Description: Shared object decoader loader for Gmu audio decoders 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _DECLOADER_H 17 | #define _DECLOADER_H 18 | #include "gmudecoder.h" 19 | 20 | typedef struct _DecoderChain DecoderChain; 21 | 22 | struct _DecoderChain { 23 | DecoderChain *next; 24 | GmuDecoder *gd; 25 | }; 26 | 27 | GmuDecoder *decloader_load_decoder(const char *so_file); 28 | int decloader_load_all(const char *directory); 29 | GmuDecoder *decloader_get_decoder_for_extension(const char *file_extension); 30 | GmuDecoder *decloader_get_decoder_for_mime_type(const char *mime_type); 31 | GmuDecoder *decloader_get_decoder_for_data_chunk(const char *data, size_t size); 32 | char *decloader_get_all_extensions(void); 33 | GmuDecoder *decloader_decoder_list_get_next_decoder(int getfirst); 34 | void decloader_free(void); 35 | int decloader_load_builtin_decoders(void); 36 | #endif 37 | -------------------------------------------------------------------------------- /src/ringbuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2025 Johannes Heimansberg (wej.k.vu) 5 | * 6 | * File: ringbuffer.h Created: 060928 7 | * 8 | * Description: General purpose ring buffer 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef WEJ_RINGBUFFER_H 17 | #define WEJ_RINGBUFFER_H 18 | #include 19 | 20 | struct _RingBuffer { 21 | size_t size; 22 | char *buffer; 23 | size_t read_ptr, write_ptr, buffer_fill, unread_fill; 24 | ssize_t unread_ptr; 25 | }; 26 | 27 | typedef struct _RingBuffer RingBuffer; 28 | 29 | int ringbuffer_init(RingBuffer *rb, size_t size); 30 | void ringbuffer_free(RingBuffer *rb); 31 | int ringbuffer_write(RingBuffer *rb, const char *data, size_t size); 32 | int ringbuffer_read(RingBuffer *rb, char *target, size_t size); 33 | size_t ringbuffer_get_fill(RingBuffer *rb); 34 | size_t ringbuffer_get_free(RingBuffer *rb); 35 | void ringbuffer_clear(RingBuffer *rb); 36 | size_t ringbuffer_get_size(RingBuffer *rb); 37 | void ringbuffer_set_unread_pos(RingBuffer *rb); 38 | int ringbuffer_unread(RingBuffer *rb); 39 | #endif 40 | -------------------------------------------------------------------------------- /src/hw_gp2xwiz.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_gp2x.h Created: ? 7 | * 8 | * Description: GP2X specific stuff (button mapping etc.) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _HW_GP2X_H 17 | #define _HW_GP2X_H 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #define SAMPLE_BUFFER_SIZE 4096 28 | 29 | typedef enum GP2XModel { MODEL_UNKNOWN, MODEL_F100, MODEL_F200, MODEL_WIZ } GP2XModel; 30 | 31 | void gp2x_set_cpu_clock(unsigned int MHz); 32 | unsigned char gp2x_init_phys(void); 33 | void gp2x_close_phys(void); 34 | GP2XModel gp2x_get_model(void); 35 | 36 | int hw_open_mixer(int mixer_channel); 37 | void hw_close_mixer(void); 38 | void hw_set_volume(int volume); 39 | void hw_display_off(void); 40 | void hw_display_on(void); 41 | void hw_detect_device_model(void); 42 | const char *hw_get_device_model_name(void); 43 | #endif 44 | -------------------------------------------------------------------------------- /no_stick.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | Modifier=L 7 | # Global mappings: 8 | Left=STICK_LEFT 9 | Right=STICK_RIGHT 10 | Up=STICK_UP 11 | Down=STICK_DOWN 12 | IncreaseVolume=VOL+ 13 | DecreaseVolume=VOL- 14 | ToggleTime=Mod+VOL- 15 | Pause=START 16 | Stop=X 17 | ToggleView=SELECT 18 | #PreviousTrack=L 19 | NextTrack=R 20 | Hold=Mod+SELECT 21 | Exit=Mod+START 22 | # Program info mappings: 23 | ProgramInfo=Mod+A 24 | ProgramInfoOkay=B 25 | # File browser mappings: 26 | #FileBrowserDirUp=STICK_LEFT 27 | #FileBrowserChDir=STICK_RIGHT 28 | FileBrowserPlayFile=A 29 | FileBrowserAddFileToPlaylistOrChDir=B 30 | FileBrowserAddDirToPlaylist=Y 31 | FileBrowserInsertFileIntoPlaylist=Mod+B 32 | #FileBrowserDeleteFile=Mod+X 33 | # Playlist mappings: 34 | PlaylistPlayItem=B 35 | PlaylistToggleRandomMode=A 36 | PlaylistRemoveItem=Y 37 | PlaylistClear=Mod+Y 38 | PlaylistSave=Mod+B 39 | # Playlist save dialog: 40 | PlaylistSaveSelect=B 41 | PlaylistSaveCancel=A 42 | #PlaylistDeleteFile=Mod+X 43 | # Track info mappings: 44 | TrackInfoToggleCover=A 45 | TrackInfoToggleText=B 46 | # Question dialog mappings: 47 | QuestionYes=B 48 | QuestionNo=A 49 | # Setup mappings: 50 | SetupSelect=B 51 | SetupSaveAndExit=X 52 | SetupSaveAndRunGmu=Y 53 | SetupFileBrowserSelect=B 54 | SetupFileBrowserChDir=A 55 | SetupFileBrowserCancel=X 56 | 57 | -------------------------------------------------------------------------------- /links-alike.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | Modifier=STICK_CLICK 7 | # Global mappings: 8 | Left=STICK_LEFT 9 | Right=STICK_RIGHT 10 | Up=STICK_UP 11 | Down=STICK_DOWN 12 | IncreaseVolume=VOL+ 13 | DecreaseVolume=VOL- 14 | ToggleTime=Mod+VOL- 15 | Pause=START 16 | Stop=X 17 | ToggleView=SELECT 18 | PreviousTrack=L 19 | NextTrack=R 20 | Hold=Mod+SELECT 21 | Exit=Mod+START 22 | # Program info mappings: 23 | ProgramInfo=Mod+A 24 | ProgramInfoOkay=B 25 | # File browser mappings: 26 | FileBrowserDirUp=STICK_LEFT 27 | FileBrowserChDir=STICK_RIGHT 28 | FileBrowserPlayFile=A 29 | FileBrowserAddFileToPlaylistOrChDir=B 30 | FileBrowserAddDirToPlaylist=Y 31 | FileBrowserInsertFileIntoPlaylist=Mod+B 32 | #FileBrowserDeleteFile=Mod+X 33 | # Playlist mappings: 34 | PlaylistPlayItem=B 35 | PlaylistToggleRandomMode=A 36 | PlaylistRemoveItem=Y 37 | PlaylistClear=Mod+Y 38 | PlaylistSave=Mod+B 39 | # Playlist save dialog: 40 | PlaylistSaveSelect=B 41 | PlaylistSaveCancel=A 42 | #PlaylistDeleteFile=Mod+X 43 | # Track info mappings: 44 | TrackInfoToggleCover=A 45 | TrackInfoToggleText=B 46 | # Question dialog mappings: 47 | QuestionYes=B 48 | QuestionNo=A 49 | # Setup mappings: 50 | SetupSelect=B 51 | SetupSaveAndExit=X 52 | SetupSaveAndRunGmu=Y 53 | SetupFileBrowserSelect=B 54 | SetupFileBrowserChDir=A 55 | SetupFileBrowserCancel=X 56 | 57 | -------------------------------------------------------------------------------- /src/m3u.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2014 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: m3u.h Created: 061018 7 | * 8 | * Description: Wejp's m3u parser 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _M3U_H 17 | #define _M3U_H 18 | #include 19 | #include "consts.h" 20 | 21 | typedef struct M3u 22 | { 23 | FILE *pl_file; 24 | char m3u_path[PATH_LEN_DIR_MAX]; 25 | short extended; 26 | char current_item_title[256]; 27 | char current_item_filename[PATH_LEN_FILENAME_MAX]; 28 | char current_item_path[PATH_LEN_MAX]; 29 | size_t current_item_length; 30 | } M3u; 31 | 32 | int m3u_open_file(M3u *m3u, const char *filename); 33 | void m3u_close_file(M3u *m3u); 34 | int m3u_read_next_item(M3u *m3u); 35 | char *m3u_current_item_get_title(M3u *m3u); 36 | char *m3u_current_item_get_filename(M3u *m3u); 37 | char *m3u_current_item_get_full_path(M3u *m3u); 38 | size_t m3u_current_item_get_length(M3u *m3u); 39 | int m3u_is_extended(M3u *m3u); 40 | int m3u_export_file(M3u *m3u, const char *filename); 41 | int m3u_export_write_entry(M3u *m3u, const char *file, const char *title, int length); 42 | void m3u_export_close_file(M3u *m3u); 43 | #endif 44 | -------------------------------------------------------------------------------- /src/frontends/sdl/textbrowser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: textbrowser.h Created: 061104 7 | * 8 | * Description: A simple text browser 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include "skin.h" 17 | 18 | #ifndef _TEXTBROWSER_H 19 | #define _TEXTBROWSER_H 20 | typedef struct _TextBrowser { 21 | const char *text, *title; 22 | int text_length; 23 | int offset_x; 24 | int pos_x, pos_y, chars_per_line; 25 | int char_offset; 26 | int end_reached; 27 | int longest_line_so_far; 28 | const Skin *skin; 29 | } TextBrowser; 30 | 31 | void text_browser_init(TextBrowser *tb, const Skin *skin); 32 | int text_browser_set_text(TextBrowser *tb, const char *text, const char *title); 33 | void text_browser_set_pos_x(TextBrowser *tb, int x); 34 | void text_browser_set_chars_per_line(TextBrowser *tb, int chars); 35 | void text_browser_draw(TextBrowser *tb, SDL_Surface *sdl_target); 36 | void text_browser_scroll_left(TextBrowser *tb); 37 | void text_browser_scroll_right(TextBrowser *tb); 38 | void text_browser_scroll_down(TextBrowser *tb); 39 | void text_browser_scroll_up(TextBrowser *tb); 40 | #endif 41 | -------------------------------------------------------------------------------- /gmu.zipit-z2.conf: -------------------------------------------------------------------------------- 1 | Gmu.AutoPlayOnProgramStart=no 2 | Gmu.DefaultFileBrowserPath=. 3 | Gmu.DefaultPlayMode=continue 4 | Gmu.DeviceCloseASAP=yes 5 | Gmu.FadeOutOnSkip=no 6 | Gmu.FileBrowserFoldersFirst=yes 7 | Gmu.FileSystemCharset=UTF-8 8 | Gmu.FirstRun=yes 9 | gmuhttp.BaseDir=/ 10 | gmuhttp.DisableLocalPassword=yes 11 | gmuhttp.Listen=Local 12 | gmuhttp.Password=change.me 13 | Gmu.LastPlayedPlaylistItem=None 14 | Gmu.LastPlayedPlaylistItemTime=0 15 | Gmu.PlaylistSavePresets=playlist1.m3u;playlist2.m3u;playlist3.m3u;playlist4.m3u 16 | Gmu.ReaderCache=512 17 | Gmu.ReaderCachePrebufferSize=256 18 | Gmu.RememberLastPlaylist=yes 19 | Gmu.RememberSettings=yes 20 | Gmu.ResumePlayback=no 21 | Gmu.TimeDisplay=remaining 22 | Gmu.Volume=13 23 | Gmu.VolumeControl=Software 24 | Gmu.VolumeHardwareMixerChannel=0 25 | Log.Enable=no 26 | Log.File=gmutracks.log 27 | Log.MinimumPlaytimePercent=50 28 | Log.MinimumPlaytimeSec=30 29 | SDL.AllowVolumeControlInHoldState=yes 30 | SDL.AutoSelectCurrentPlaylistItem=no 31 | SDL.BacklightPowerOnOnTrackChange=no 32 | SDL.CoverArtworkFilePattern=*.jpg 33 | SDL.CoverArtworkLarge=no 34 | SDL.DefaultSkin=default-modern 35 | SDL.EnableCoverArtwork=yes 36 | SDL.Fullscreen=no 37 | SDL.Height=240 38 | SDL.KeyMap=zipit-z2.keymap 39 | SDL.LoadEmbeddedCoverArtwork=first 40 | SDL.LyricsFilePattern=$.txt;*.txt;*.nfo 41 | SDL.MaxCoverImageKPixels=16000 42 | SDL.Scroll=always 43 | SDL.SecondsUntilBacklightPowerOff=0 44 | SDL.SmallCoverArtworkAlignment=right 45 | SDL.TimeDisplay=elapsed 46 | SDL.Width=320 47 | -------------------------------------------------------------------------------- /pagescroll.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | Modifier=STICK_CLICK 7 | # Global mappings: 8 | #Left=STICK_LEFT 9 | #Right=STICK_RIGHT 10 | PageDown=STICK_RIGHT 11 | PageUp=STICK_LEFT 12 | Up=STICK_UP 13 | Down=STICK_DOWN 14 | IncreaseVolume=VOL+ 15 | DecreaseVolume=VOL- 16 | ToggleTime=Mod+VOL- 17 | Pause=START 18 | Stop=X 19 | ToggleView=SELECT 20 | PreviousTrack=L 21 | NextTrack=R 22 | Hold=Mod+SELECT 23 | Exit=Mod+START 24 | # Program info mappings: 25 | ProgramInfo=Mod+A 26 | ProgramInfoOkay=B 27 | # File browser mappings: 28 | #FileBrowserDirUp=STICK_LEFT 29 | #FileBrowserChDir=STICK_RIGHT 30 | FileBrowserPlayFile=A 31 | FileBrowserAddFileToPlaylistOrChDir=B 32 | FileBrowserAddDirToPlaylist=Y 33 | FileBrowserInsertFileIntoPlaylist=Mod+B 34 | #FileBrowserDeleteFile=Mod+X 35 | # Playlist mappings: 36 | PlaylistPlayItem=B 37 | PlaylistToggleRandomMode=A 38 | PlaylistRemoveItem=Y 39 | PlaylistClear=Mod+Y 40 | PlaylistSave=Mod+B 41 | # Playlist save dialog: 42 | PlaylistSaveSelect=B 43 | PlaylistSaveCancel=A 44 | #PlaylistDeleteFile=Mod+X 45 | # Track info mappings: 46 | TrackInfoToggleCover=A 47 | TrackInfoToggleText=B 48 | # Question dialog mappings: 49 | QuestionYes=B 50 | QuestionNo=A 51 | # Setup mappings: 52 | SetupSelect=B 53 | SetupSaveAndExit=X 54 | SetupSaveAndRunGmu=Y 55 | SetupFileBrowserSelect=B 56 | SetupFileBrowserChDir=A 57 | SetupFileBrowserCancel=X 58 | 59 | -------------------------------------------------------------------------------- /src/fileplayer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2014 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: fileplayer.h Created: 070107 7 | * 8 | * Description: Functions for audio file playback 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _FILEPLAYER_H 17 | #define _FILEPLAYER_H 18 | #include "trackinfo.h" 19 | #include "pbstatus.h" 20 | 21 | int file_player_check_shutdown(void); 22 | void file_player_set_lyrics_file_pattern(const char *pattern); 23 | size_t file_player_playback_get_time(void); 24 | PB_Status file_player_get_item_status(void); 25 | void file_player_stop_playback(void); 26 | int file_player_play_file(char *file, int skip_current, int fade_out_on_skip); 27 | int file_player_read_tags(char *file, char *file_type, TrackInfo *ti); 28 | int file_player_seek(long offset); 29 | int file_player_is_thread_running(void); 30 | void file_player_shutdown(void); 31 | void file_player_set_filename(char *filename); 32 | void file_player_start_playback(void); 33 | int file_player_init(TrackInfo *ti_ref, int device_close_asap); 34 | TrackInfo *file_player_get_trackinfo_ref(void); 35 | int file_player_request_playback_state_change(PB_Status_Request request); 36 | #endif 37 | -------------------------------------------------------------------------------- /src/frontends/sdl/plmanager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: plmanager.h Created: 061223 7 | * 8 | * Description: Playlist save dialog 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "kam.h" 18 | #include "skin.h" 19 | #ifndef _PLMANAGER_H 20 | #define _PLMANAGER_H 21 | #define PLMANAGER_MAX_ITEMS 32 22 | #define PLMANAGER_MAX_ITEM_SIZE 256 23 | typedef struct PlaylistManager 24 | { 25 | Skin *skin; 26 | int selection; 27 | int items; 28 | int flag; 29 | char filenames[PLMANAGER_MAX_ITEMS][PLMANAGER_MAX_ITEM_SIZE]; 30 | } PlaylistManager; 31 | 32 | enum { PLMANAGER_NOTHING, PLMANAGER_SAVE_LIST, PLMANAGER_LOAD_LIST, PLMANAGER_APPEND_LIST }; 33 | 34 | int plmanager_get_flag(PlaylistManager *ps); 35 | void plmanager_reset_flag(PlaylistManager *ps); 36 | int plmanager_process_action(PlaylistManager *ps, View *view, int user_key_action); 37 | void plmanager_draw(PlaylistManager *ps, SDL_Surface *sdl_target); 38 | void plmanager_init(PlaylistManager *ps, char *filenames_list, Skin *skin); 39 | char *plmanager_get_selection(PlaylistManager *ps); 40 | void plmanager_move_selection_down(PlaylistManager *ps); 41 | void plmanager_move_selection_up(PlaylistManager *ps); 42 | #endif 43 | -------------------------------------------------------------------------------- /gp2x-f100.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | Modifier=STICK_CLICK 7 | # Global mappings: 8 | Left=LEFT 9 | Right=RIGHT 10 | Up=UP 11 | Down=DOWN 12 | IncreaseVolume=VOL+ 13 | DecreaseVolume=VOL- 14 | ToggleTime=Mod+VOL- 15 | Pause=X 16 | Stop=Mod+X 17 | ToggleView=SELECT 18 | PreviousTrack=L 19 | NextTrack=R 20 | SeekForward=Mod+R 21 | SeekBackward=Mod+L 22 | Hold=Mod+START 23 | Exit=Mod+SELECT 24 | # Program info mappings: 25 | ProgramInfo=Mod+A 26 | ProgramInfoOkay=B 27 | # File browser mappings: 28 | #FileBrowserDirUp=LEFT 29 | #FileBrowserChDir=RIGHT 30 | 31 | FileBrowserPlayFile=A 32 | FileBrowserAddFileToPlaylistOrChDir=B 33 | FileBrowserAddDirToPlaylist=Y 34 | FileBrowserInsertFileIntoPlaylist=Mod+B 35 | FileBrowserNewPlFromDir=Mod+Y 36 | #FileBrowserDeleteFile=Mod+X 37 | # Playlist mappings: 38 | PlaylistPlayItem=B 39 | PlaylistToggleRandomMode=A 40 | PlaylistRemoveItem=Y 41 | PlaylistClear=Mod+Y 42 | PlaylistSave=Mod+B 43 | # Playlist save dialog: 44 | PlaylistSaveSelect=B 45 | PlaylistSaveCancel=A 46 | PlaylistSaveLoadList=Y 47 | PlaylistSaveAppendList=Mod+Y 48 | #PlaylistDeleteFile=Mod+X 49 | PlaylistQueue=Mod+VOL+ 50 | # Track info mappings: 51 | TrackInfoToggleCover=A 52 | TrackInfoToggleText=B 53 | # Question dialog mappings: 54 | QuestionYes=B 55 | QuestionNo=A 56 | # Setup mappings: 57 | SetupSelect=B 58 | SetupSaveAndExit=X 59 | SetupSaveAndRunGmu=Y 60 | SetupFileBrowserSelect=B 61 | SetupFileBrowserChDir=A 62 | SetupFileBrowserCancel=X 63 | -------------------------------------------------------------------------------- /src/hw_caanoo.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2013 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_caanoo.c Created: 130214 7 | * 8 | * Description: Hardware specific header file for unknown devices (such as PCs) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "oss_mixer.h" 18 | #include "debug.h" 19 | #include "hw_unknown.h" 20 | 21 | static int selected_mixer = -1; 22 | 23 | void hw_display_off(void) 24 | { 25 | wdprintf(V_DEBUG, "hw_caanoo", "Display off requested.\n"); 26 | } 27 | 28 | void hw_display_on(void) 29 | { 30 | wdprintf(V_DEBUG, "hw_caanoo", "Display on requested.\n"); 31 | } 32 | 33 | int hw_open_mixer(int mixer_channel) 34 | { 35 | int res = oss_mixer_open(); 36 | selected_mixer = mixer_channel; 37 | wdprintf(V_INFO, "hw_caanoo", "Selected mixer: %d\n", selected_mixer); 38 | return res; 39 | } 40 | 41 | void hw_close_mixer(void) 42 | { 43 | oss_mixer_close(); 44 | } 45 | 46 | void hw_set_volume(int volume) 47 | { 48 | if (selected_mixer >= 0) { 49 | if (volume >= 0) oss_mixer_set_volume(selected_mixer, volume); 50 | } else { 51 | wdprintf(V_INFO, "hw_caanoo", "No suitable mixer available.\n"); 52 | } 53 | } 54 | 55 | void hw_detect_device_model(void) 56 | { 57 | } 58 | 59 | const char *hw_get_device_model_name(void) 60 | { 61 | return "GPH Caanoo"; 62 | } 63 | -------------------------------------------------------------------------------- /src/hw_pandora.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_pandora.c Created: 100626 7 | * 8 | * Description: Hardware specific header file for the Pandora handheld 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "oss_mixer.h" 18 | #include "debug.h" 19 | #include "hw_pandora.h" 20 | 21 | static int selected_mixer = -1; 22 | 23 | void hw_display_off(void) 24 | { 25 | wdprintf(V_DEBUG, "hw_pandora", "Display off requested.\n"); 26 | } 27 | 28 | void hw_display_on(void) 29 | { 30 | wdprintf(V_DEBUG, "hw_pandora", "Display on requested.\n"); 31 | } 32 | 33 | int hw_open_mixer(int mixer_channel) 34 | { 35 | int res = oss_mixer_open(); 36 | selected_mixer = mixer_channel; 37 | wdprintf(V_INFO, "hw_pandora", "Selected mixer: %d\n", selected_mixer); 38 | return res; 39 | } 40 | 41 | void hw_close_mixer(void) 42 | { 43 | oss_mixer_close(); 44 | } 45 | 46 | void hw_set_volume(int volume) 47 | { 48 | if (selected_mixer >= 0) { 49 | if (volume >= 0) oss_mixer_set_volume(selected_mixer, volume); 50 | } else { 51 | wdprintf(V_INFO, "hw_pandora", "No suitable mixer available.\n"); 52 | } 53 | } 54 | 55 | void hw_detect_device_model(void) 56 | { 57 | } 58 | 59 | const char *hw_get_device_model_name(void) 60 | { 61 | return "Pandora handheld"; 62 | } 63 | -------------------------------------------------------------------------------- /dingux.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | Modifier=Select 7 | # Global mappings: 8 | #Left=Left 9 | #Right=Right 10 | Up=Up 11 | Down=Down 12 | ShutdownTimer=Mod+Down 13 | IncreaseVolume=Right 14 | DecreaseVolume=Left 15 | ToggleTime=Mod+Left 16 | Pause=X 17 | Stop=Mod+X 18 | ToggleView=Start 19 | PreviousTrack=L 20 | NextTrack=R 21 | SeekForward=Mod+R 22 | SeekBackward=Mod+L 23 | Lock=Lock 24 | Unlock=Unlock 25 | Exit=Mod+Start 26 | Help=Mod+Up 27 | 28 | # Program info mappings: 29 | ProgramInfo=Mod+A 30 | ProgramInfoOkay=A 31 | # File browser mappings: 32 | #FileBrowserDirUp=Left 33 | #FileBrowserChDir=Right 34 | 35 | FileBrowserPlayFile=B 36 | FileBrowserAddFileToPlaylistOrChDir=A 37 | FileBrowserAddDirToPlaylist=Y 38 | FileBrowserInsertFileIntoPlaylist=Mod+A 39 | FileBrowserNewPlFromDir=Mod+Y 40 | #FileBrowserDeleteFile=Mod+X 41 | # Playlist mappings: 42 | PlaylistPlayItem=A 43 | PlaylistToggleRandomMode=B 44 | PlaylistRemoveItem=Y 45 | PlaylistClear=Mod+Y 46 | PlaylistSave=Mod+B 47 | # Playlist save dialog: 48 | PlaylistSaveSelect=A 49 | PlaylistSaveCancel=B 50 | PlaylistSaveLoadList=Y 51 | PlaylistSaveAppendList=Mod+Y 52 | #PlaylistDeleteFile=Mod+X 53 | PlaylistQueue=Mod+Right 54 | # Track info mappings: 55 | TrackInfoToggleCover=A 56 | TrackInfoToggleText=B 57 | # Question dialog mappings: 58 | QuestionYes=A 59 | QuestionNo=B 60 | # Setup mappings: 61 | SetupSelect=A 62 | SetupSaveAndExit=X 63 | SetupSaveAndRunGmu=Y 64 | SetupFileBrowserSelect=A 65 | SetupFileBrowserChDir=A 66 | SetupFileBrowserCancel=B 67 | -------------------------------------------------------------------------------- /wiz.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | Modifier=Menu 7 | # Global mappings: 8 | #Left=Left 9 | #Right=Right 10 | Up=Up 11 | Down=Down 12 | ShutdownTimer=Mod+Down 13 | IncreaseVolume=VolUp 14 | DecreaseVolume=VolDown 15 | ToggleTime=Mod+Left 16 | Pause=X 17 | Stop=Mod+X 18 | ToggleView=Select 19 | PreviousTrack=L 20 | NextTrack=R 21 | SeekForward=Mod+R 22 | SeekBackward=Mod+L 23 | Lock=Mod+Up 24 | Unlock=Mod+Up 25 | Exit=Mod+Select 26 | Help=Mod+VolDown 27 | # Program info mappings: 28 | ProgramInfo=Mod+A 29 | ProgramInfoOkay=B 30 | # File browser mappings: 31 | #FileBrowserDirUp=Left 32 | #FileBrowserChDir=Right 33 | 34 | FileBrowserPlayFile=A 35 | FileBrowserAddFileToPlaylistOrChDir=B 36 | FileBrowserAddDirToPlaylist=Y 37 | FileBrowserInsertFileIntoPlaylist=Mod+B 38 | FileBrowserNewPlFromDir=Mod+Y 39 | #FileBrowserDeleteFile=Mod+X 40 | # Playlist mappings: 41 | PlaylistPlayItem=B 42 | PlaylistToggleRandomMode=A 43 | PlaylistRemoveItem=Y 44 | PlaylistClear=Mod+Y 45 | PlaylistSave=Mod+B 46 | # Playlist save dialog: 47 | PlaylistSaveSelect=B 48 | PlaylistSaveCancel=A 49 | PlaylistSaveLoadList=Y 50 | PlaylistSaveAppendList=Mod+Y 51 | #PlaylistDeleteFile=Mod+X 52 | PlaylistQueue=Mod+Right 53 | # Track info mappings: 54 | TrackInfoToggleCover=A 55 | TrackInfoToggleText=B 56 | # Question dialog mappings: 57 | QuestionYes=B 58 | QuestionNo=A 59 | # Setup mappings: 60 | SetupSelect=B 61 | SetupSaveAndExit=X 62 | SetupSaveAndRunGmu=Y 63 | SetupFileBrowserSelect=B 64 | SetupFileBrowserChDir=A 65 | SetupFileBrowserCancel=X 66 | -------------------------------------------------------------------------------- /gp2x-f200.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | Modifier=L 7 | # Global mappings: 8 | Left=Left 9 | Right=Right 10 | Up=Up 11 | Down=Down 12 | PageDown=Mod+Down 13 | IncreaseVolume=VolUp 14 | DecreaseVolume=VolDown 15 | #ToggleTime=Mod+VolDown 16 | Pause=Start 17 | Stop=X 18 | ToggleView=Select 19 | #PreviousTrack=L 20 | NextTrack=R 21 | SeekForward=Mod+R 22 | SeekBackward=Mod+L 23 | Lock=Mod+Select 24 | Unlock=Mod+Select 25 | Exit=Mod+Start 26 | Help=Mod+VolDown 27 | # Program info mappings: 28 | ProgramInfo=Mod+A 29 | ProgramInfoOkay=B 30 | # File browser mappings: 31 | #FileBrowserDirUp=Left 32 | #FileBrowserChDir=Right 33 | 34 | FileBrowserPlayFile=A 35 | FileBrowserAddFileToPlaylistOrChDir=B 36 | FileBrowserAddDirToPlaylist=Y 37 | FileBrowserInsertFileIntoPlaylist=Mod+B 38 | FileBrowserNewPlFromDir=Mod+Y 39 | #FileBrowserDeleteFile=Mod+X 40 | # Playlist mappings: 41 | PlaylistPlayItem=B 42 | PlaylistToggleRandomMode=A 43 | PlaylistRemoveItem=Y 44 | PlaylistClear=Mod+Y 45 | PlaylistSave=Mod+B 46 | # Playlist save dialog: 47 | PlaylistSaveSelect=B 48 | PlaylistSaveCancel=A 49 | PlaylistSaveLoadList=Y 50 | PlaylistSaveAppendList=Mod+Y 51 | #PlaylistDeleteFile=Mod+X 52 | PlaylistQueue=Mod+VolUp 53 | # Track info mappings: 54 | TrackInfoToggleCover=A 55 | TrackInfoToggleText=B 56 | # Question dialog mappings: 57 | QuestionYes=B 58 | QuestionNo=A 59 | # Setup mappings: 60 | SetupSelect=B 61 | SetupSaveAndExit=X 62 | SetupSaveAndRunGmu=Y 63 | SetupFileBrowserSelect=B 64 | SetupFileBrowserChDir=A 65 | SetupFileBrowserCancel=X 66 | -------------------------------------------------------------------------------- /caanoo.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | Modifier=HelpII 7 | # Global mappings: 8 | Left=Left 9 | Right=Right 10 | Up=Up 11 | Down=Down 12 | IncreaseVolume=Mod+Right 13 | DecreaseVolume=Mod+Left 14 | #ToggleTime=Mod+VolDown 15 | Pause=Y 16 | Stop=X 17 | ToggleView=Home 18 | PreviousTrack=L 19 | NextTrack=R 20 | SeekForward=Mod+R 21 | SeekBackward=Mod+L 22 | Lock=Lock 23 | Unlock=Unlock 24 | Exit=Mod+Home 25 | #Help=Mod+VolDown 26 | Help=HelpI 27 | # Program info mappings: 28 | ProgramInfo=Mod+A 29 | ProgramInfoOkay=B 30 | # File browser mappings: 31 | #FileBrowserDirUp=Left 32 | #FileBrowserChDir=Right 33 | FileBrowserPlayFile=A 34 | FileBrowserAddFileToPlaylistOrChDir=B 35 | FileBrowserAddDirToPlaylist=Y 36 | FileBrowserInsertFileIntoPlaylist=Mod+B 37 | FileBrowserNewPlFromDir=Mod+Y 38 | #FileBrowserDeleteFile=Mod+X 39 | # Playlist mappings: 40 | PlaylistPlayItem=B 41 | PlaylistToggleRandomMode=A 42 | PlaylistRemoveItem=Y 43 | PlaylistClear=Mod+Y 44 | PlaylistSave=Mod+B 45 | # Playlist save dialog: 46 | PlaylistSaveSelect=B 47 | PlaylistSaveCancel=A 48 | PlaylistSaveLoadList=Y 49 | PlaylistSaveAppendList=Mod+Y 50 | #PlaylistDeleteFile=Mod+X 51 | #PlaylistQueue=Mod+VOL+ 52 | PlaylistQueue=Mod+Up 53 | # Track info mappings: 54 | TrackInfoToggleCover=A 55 | TrackInfoToggleText=B 56 | # Question dialog mappings: 57 | QuestionYes=B 58 | QuestionNo=A 59 | # Setup mappings: 60 | SetupSelect=B 61 | SetupSaveAndExit=X 62 | SetupSaveAndRunGmu=Y 63 | SetupFileBrowserSelect=B 64 | SetupFileBrowserChDir=A 65 | SetupFileBrowserCancel=X 66 | -------------------------------------------------------------------------------- /gp2x.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | Modifier=StickClick 7 | # Global mappings: 8 | Left=Left 9 | Right=Right 10 | Up=Up 11 | Down=Down 12 | PageDown=Mod+Down 13 | IncreaseVolume=VolUp 14 | DecreaseVolume=VolDown 15 | #ToggleTime=Mod+VolDown 16 | Pause=Start 17 | Stop=X 18 | ToggleView=Select 19 | PreviousTrack=L 20 | NextTrack=R 21 | SeekForward=Mod+R 22 | SeekBackward=Mod+L 23 | Lock=Mod+Select 24 | Unlock=Mod+Select 25 | Exit=Mod+Start 26 | Help=Mod+VolDown 27 | # Program info mappings: 28 | ProgramInfo=Mod+A 29 | ProgramInfoOkay=B 30 | # File browser mappings: 31 | #FileBrowserDirUp=Left 32 | #FileBrowserChDir=Right 33 | 34 | FileBrowserPlayFile=A 35 | FileBrowserAddFileToPlaylistOrChDir=B 36 | FileBrowserAddDirToPlaylist=Y 37 | FileBrowserInsertFileIntoPlaylist=Mod+B 38 | FileBrowserNewPlFromDir=Mod+Y 39 | #FileBrowserDeleteFile=Mod+X 40 | # Playlist mappings: 41 | PlaylistPlayItem=B 42 | PlaylistToggleRandomMode=A 43 | PlaylistRemoveItem=Y 44 | PlaylistClear=Mod+Y 45 | PlaylistSave=Mod+B 46 | # Playlist save dialog: 47 | PlaylistSaveSelect=B 48 | PlaylistSaveCancel=A 49 | PlaylistSaveLoadList=Y 50 | PlaylistSaveAppendList=Mod+Y 51 | #PlaylistDeleteFile=Mod+X 52 | PlaylistQueue=Mod+VolUp 53 | # Track info mappings: 54 | TrackInfoToggleCover=A 55 | TrackInfoToggleText=B 56 | # Question dialog mappings: 57 | QuestionYes=B 58 | QuestionNo=A 59 | # Setup mappings: 60 | SetupSelect=B 61 | SetupSaveAndExit=X 62 | SetupSaveAndRunGmu=Y 63 | SetupFileBrowserSelect=B 64 | SetupFileBrowserChDir=A 65 | SetupFileBrowserCancel=X 66 | -------------------------------------------------------------------------------- /zipit-z2.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | # Buttons names are defined in gmuinput.conf. 7 | 8 | Modifier=Alt 9 | # Global mappings: 10 | Left=Left 11 | Right=Right 12 | Up=Up 13 | Down=Down 14 | IncreaseVolume=Volume+ 15 | DecreaseVolume=Volume- 16 | ToggleTime=T 17 | Pause=P 18 | Stop=X 19 | ToggleView=Space 20 | PreviousTrack=Comma 21 | NextTrack=Dot 22 | SeekForward=M 23 | SeekBackward=N 24 | Hold=Mod+Up 25 | Exit=ESC 26 | ShutdownTimer=Mod+Down 27 | Help=H 28 | 29 | # Program info mappings: 30 | ProgramInfo=I 31 | ProgramInfoOkay=Enter 32 | # File browser mappings: 33 | #FileBrowserDirUp=LEFT 34 | #FileBrowserChDir=RIGHT 35 | 36 | FileBrowserPlayFile=A 37 | FileBrowserAddFileToPlaylistOrChDir=Enter 38 | FileBrowserAddDirToPlaylist=Y 39 | FileBrowserInsertFileIntoPlaylist=Mod+B 40 | FileBrowserNewPlFromDir=Mod+Y 41 | #FileBrowserDeleteFile=Mod+X 42 | # Playlist mappings: 43 | PlaylistPlayItem=Enter 44 | PlaylistToggleRandomMode=R 45 | PlaylistRemoveItem=Y 46 | PlaylistClear=Mod+C 47 | PlaylistSave=S 48 | # Playlist save dialog: 49 | PlaylistSaveSelect=Enter 50 | PlaylistSaveCancel=C 51 | PlaylistSaveLoadList=L 52 | PlaylistSaveAppendList=Mod+Y 53 | #PlaylistDeleteFile=Mod+X 54 | PlaylistQueue=Q 55 | # Track info mappings: 56 | TrackInfoToggleCover=A 57 | TrackInfoToggleText=B 58 | # Question dialog mappings: 59 | QuestionYes=Enter 60 | QuestionNo=C 61 | # Setup mappings: 62 | RunSetup=S 63 | SetupSelect=Enter 64 | SetupClose=X 65 | SetupFileBrowserSelect=Enter 66 | SetupFileBrowserChDir=A 67 | SetupFileBrowserCancel=X 68 | -------------------------------------------------------------------------------- /gmu.pre.conf: -------------------------------------------------------------------------------- 1 | Gmu.AutoPlayOnProgramStart=no 2 | Gmu.DefaultFileBrowserPath=/media/internal 3 | Gmu.DefaultPlayMode=continue 4 | Gmu.DeviceCloseASAP=yes 5 | Gmu.FadeOutOnSkip=no 6 | Gmu.FileBrowserFoldersFirst=yes 7 | Gmu.FileSystemCharset=UTF-8 8 | Gmu.FirstRun=yes 9 | gmuhttp.BaseDir=/ 10 | gmuhttp.DisableLocalPassword=yes 11 | gmuhttp.Listen=Local 12 | gmuhttp.Password=change.me 13 | Gmu.LastPlayedPlaylistItem=None 14 | Gmu.LastPlayedPlaylistItemTime=0 15 | Gmu.PlaylistSavePresets=rock.m3u;pop.m3u;electronic.m3u;classic.m3u;alternative.m3u;soundtrack.m3u;chiptunes.m3u;playlist1.m3u;playlist2.m3u;playlist3.m3u;playlist4.m3u;playlist5.m3u;playlist6.m3u;playlist7.m3u;playlist8.m3u;playlist9.m3u;playlist10.m3u 16 | Gmu.ReaderCache=512 17 | Gmu.ReaderCachePrebufferSize=256 18 | Gmu.RememberLastPlaylist=yes 19 | Gmu.RememberSettings=yes 20 | Gmu.ResumePlayback=yes 21 | Gmu.Shutdown=0 22 | Gmu.ShutdownCommand=/bin/true 23 | Gmu.Volume=15 24 | Gmu.VolumeControl=Software 25 | Gmu.VolumeHardwareMixerChannel=0 26 | Log.Enable=no 27 | Log.MinimumPlaytimePercent=50 28 | Log.MinimumPlaytimeSec=30 29 | SDL.AllowVolumeControlInHoldState=no 30 | SDL.AutoSelectCurrentPlaylistItem=yes 31 | SDL.BacklightPowerOnOnTrackChange=no 32 | SDL.CoverArtworkFilePattern=cover.jpg;cover.png;front.jpg;*.jpg;*.png 33 | SDL.CoverArtworkLarge=no 34 | SDL.DefaultSkin=default-modern 35 | SDL.EnableCoverArtwork=yes 36 | SDL.Fullscreen=yes 37 | SDL.InputConfigFile=gmuinput.pre.conf 38 | SDL.KeyMap=pre.keymap 39 | SDL.LoadEmbeddedCoverArtwork=first 40 | SDL.LyricsFilePattern=$.txt;*.txt;*.nfo 41 | SDL.Scroll=always 42 | SDL.SecondsUntilBacklightPowerOff=0 43 | SDL.SmallCoverArtworkAlignment=right 44 | SDL.TimeDisplay=remaining 45 | -------------------------------------------------------------------------------- /src/eventqueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: eventqueue.h Created: 090131 7 | * 8 | * Description: Gmu event queue 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "gmufrontend.h" 18 | 19 | #ifndef _EVENTQUEUE_H 20 | #define _EVENTQUEUE_H 21 | typedef struct _EventQueueEntry EventQueueEntry; 22 | 23 | struct _EventQueueEntry 24 | { 25 | EventQueueEntry *next; 26 | GmuEvent event; 27 | int param; 28 | }; 29 | 30 | struct _EventQueue 31 | { 32 | EventQueueEntry *first, *last; 33 | pthread_mutex_t mutex, mutex_cond; 34 | pthread_cond_t cond; 35 | }; 36 | 37 | typedef struct _EventQueue EventQueue; 38 | 39 | int event_queue_init(EventQueue *eq); 40 | int event_queue_push(EventQueue *eq, GmuEvent ev); 41 | int event_queue_push_with_parameter(EventQueue *eq, GmuEvent ev, int param); 42 | /* Function to fetch the (optional) parameter that can be pushed with an event. 43 | * To be called before popping the actual event! */ 44 | int event_queue_get_parameter(EventQueue *eq); 45 | GmuEvent event_queue_pop(EventQueue *eq); 46 | void event_queue_clear(EventQueue *eq); 47 | int event_queue_is_event_waiting(EventQueue *eq); 48 | void event_queue_wait_for_event(EventQueue *eq, int with_timeout); 49 | void event_queue_free(EventQueue *eq); 50 | #endif 51 | -------------------------------------------------------------------------------- /gmu.wiz.conf: -------------------------------------------------------------------------------- 1 | Gmu.AutoPlayOnProgramStart=no 2 | Gmu.DefaultFileBrowserPath=. 3 | Gmu.DefaultPlayMode=continue 4 | Gmu.DeviceCloseASAP=yes 5 | Gmu.FadeOutOnSkip=no 6 | Gmu.FileBrowserFoldersFirst=yes 7 | Gmu.FileSystemCharset=UTF-8 8 | Gmu.FirstRun=yes 9 | gmuhttp.BaseDir=/ 10 | gmuhttp.DisableLocalPassword=yes 11 | gmuhttp.Listen=Local 12 | gmuhttp.Password=change.me 13 | Gmu.LastPlayedPlaylistItem=None 14 | Gmu.LastPlayedPlaylistItemTime=0 15 | Gmu.PlaylistSavePresets=rock.m3u;pop.m3u;electronic.m3u;classic.m3u;alternative.m3u;soundtrack.m3u;chiptunes.m3u;playlist1.m3u;playlist2.m3u;playlist3.m3u;playlist4.m3u;playlist5.m3u;playlist6.m3u;playlist7.m3u;playlist8.m3u;playlist9.m3u;playlist10.m3u 16 | Gmu.ReaderCache=512 17 | Gmu.ReaderCachePrebufferSize=256 18 | Gmu.RememberLastPlaylist=yes 19 | Gmu.RememberSettings=yes 20 | Gmu.ResumePlayback=yes 21 | Gmu.TimeDisplay=remaining 22 | Gmu.Volume=78 23 | Gmu.VolumeControl=Software+Hardware 24 | Gmu.VolumeHardwareMixerChannel=0 25 | Log.Enable=no 26 | Log.MinimumPlaytimePercent=50 27 | Log.MinimumPlaytimeSec=30 28 | SDL.AllowVolumeControlInHoldState=no 29 | SDL.AutoSelectCurrentPlaylistItem=yes 30 | SDL.BacklightPowerOnOnTrackChange=no 31 | SDL.CoverArtworkFilePattern=cover.jpg;cover.png;front.jpg;*.jpg;*.png 32 | SDL.CoverArtworkLarge=no 33 | SDL.DefaultSkin=default-modern 34 | SDL.EnableCoverArtwork=yes 35 | SDL_frontend.FileBrowserSelectNextAfterAdd=yes 36 | SDL.InputConfigFile=gmuinput.wiz.conf 37 | SDL.KeyMap=wiz.keymap 38 | SDL.LoadEmbeddedCoverArtwork=first 39 | SDL.LyricsFilePattern=$.txt;*.txt;*.nfo 40 | SDL.Scroll=always 41 | SDL.SecondsUntilBacklightPowerOff=30 42 | SDL.SmallCoverArtworkAlignment=right 43 | Shutdown=0 44 | ShutdownCommand=/sbin/poweroff 45 | -------------------------------------------------------------------------------- /nanonote.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | # Buttons names are defined in gmuinput.conf. 7 | 8 | Modifier=Alt 9 | # Global mappings: 10 | Left=Left 11 | Right=Right 12 | Up=Up 13 | Down=Down 14 | IncreaseVolume=Vol+ 15 | DecreaseVolume=Vol- 16 | ToggleTime=T 17 | Pause=P 18 | Stop=Mod+X 19 | ToggleView=Tab 20 | PreviousTrack=N 21 | NextTrack=M 22 | SeekForward=Mod+M 23 | SeekBackward=Mod+N 24 | Lock=Mod+Up 25 | Unlock=Mod+Up 26 | Exit=Mod+Q 27 | ShutdownTimer=Mod+T 28 | Help=F1 29 | 30 | # Program info mappings: 31 | ProgramInfo=Mod+A 32 | ProgramInfoOkay=Enter 33 | # File browser mappings: 34 | #FileBrowserDirUp=LEFT 35 | #FileBrowserChDir=RIGHT 36 | 37 | FileBrowserPlayFile=A 38 | FileBrowserAddFileToPlaylistOrChDir=Enter 39 | FileBrowserAddDirToPlaylist=Y 40 | FileBrowserInsertFileIntoPlaylist=Mod+Enter 41 | FileBrowserNewPlFromDir=Mod+Y 42 | #FileBrowserDeleteFile=Mod+X 43 | # Playlist mappings: 44 | PlaylistPlayItem=Enter 45 | PlaylistToggleRandomMode=R 46 | PlaylistRemoveItem=Y 47 | PlaylistClear=Mod+Y 48 | PlaylistSave=S 49 | # Playlist save dialog: 50 | PlaylistSaveSelect=Enter 51 | PlaylistSaveCancel=A 52 | PlaylistSaveLoadList=Y 53 | PlaylistSaveAppendList=Mod+Y 54 | #PlaylistDeleteFile=Mod+X 55 | PlaylistQueue=Q 56 | # Track info mappings: 57 | TrackInfoToggleCover=A 58 | TrackInfoToggleText=B 59 | # Question dialog mappings: 60 | QuestionYes=Enter 61 | QuestionNo=ESC 62 | # Setup mappings: 63 | SetupSelect=B 64 | SetupSaveAndExit=X 65 | SetupSaveAndRunGmu=Y 66 | SetupFileBrowserSelect=B 67 | SetupFileBrowserChDir=A 68 | SetupFileBrowserCancel=X 69 | -------------------------------------------------------------------------------- /pre.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | # Buttons names are defined in gmuinput.conf. 7 | 8 | Modifier=Shift 9 | # Global mappings: 10 | Left=H 11 | Right=L 12 | Up=K 13 | Down=J 14 | IncreaseVolume=0 15 | DecreaseVolume=9 16 | ToggleTime=T 17 | Pause=P 18 | Stop=X 19 | ToggleView=Space 20 | PreviousTrack=N 21 | NextTrack=M 22 | SeekForward=, 23 | SeekBackward=B 24 | #Lock=Mod+L 25 | #Unlock=Mod+L 26 | Exit=Mod+Q 27 | ShutdownTimer=S 28 | Help=G 29 | #ToggleFullscreen=F 30 | 31 | # Program info mappings: 32 | ProgramInfo=I 33 | ProgramInfoOkay=Enter 34 | # File browser mappings: 35 | #FileBrowserDirUp=LEFT 36 | #FileBrowserChDir=RIGHT 37 | 38 | FileBrowserPlayFile=A 39 | FileBrowserAddFileToPlaylistOrChDir=Enter 40 | FileBrowserAddDirToPlaylist=(Y) 41 | FileBrowserInsertFileIntoPlaylist=Mod+Enter 42 | FileBrowserNewPlFromDir=Mod+Y 43 | #FileBrowserDeleteFile=Mod+X 44 | # Playlist mappings: 45 | PlaylistPlayItem=Enter 46 | PlaylistToggleRandomMode=R 47 | PlaylistRemoveItem=D 48 | PlaylistClear=C 49 | PlaylistSave=S 50 | # Playlist save dialog: 51 | PlaylistSaveSelect=Enter 52 | PlaylistSaveCancel=ESC 53 | PlaylistSaveLoadList=L 54 | PlaylistSaveAppendList=Mod+L 55 | #PlaylistDeleteFile=Mod+X 56 | PlaylistQueue=Q 57 | # Track info mappings: 58 | TrackInfoToggleCover=A 59 | TrackInfoToggleText=B 60 | # Question dialog mappings: 61 | QuestionYes=Enter 62 | QuestionNo=ESC 63 | # Setup mappings: 64 | SetupSelect=(B) 65 | SetupSaveAndExit=(X) 66 | SetupSaveAndRunGmu=(Y) 67 | SetupFileBrowserSelect=(B) 68 | SetupFileBrowserChDir=(A) 69 | SetupFileBrowserCancel=(X) 70 | -------------------------------------------------------------------------------- /gmu.caanoo.conf: -------------------------------------------------------------------------------- 1 | Gmu.AutoPlayOnProgramStart=no 2 | Gmu.DefaultFileBrowserPath=. 3 | Gmu.DefaultPlayMode=continue 4 | Gmu.DeviceCloseASAP=yes 5 | Gmu.FadeOutOnSkip=no 6 | Gmu.FileBrowserFoldersFirst=yes 7 | Gmu.FileSystemCharset=UTF-8 8 | Gmu.FirstRun=yes 9 | gmuhttp.BaseDir=/mnt/ 10 | gmuhttp.DisableLocalPassword=yes 11 | gmuhttp.Listen=Local 12 | gmuhttp.Password=change.me 13 | Gmu.LastPlayedPlaylistItem=None 14 | Gmu.LastPlayedPlaylistItemTime=0 15 | Gmu.PlaylistSavePresets=rock.m3u;pop.m3u;electronic.m3u;classic.m3u;alternative.m3u;soundtrack.m3u;chiptunes.m3u;playlist1.m3u;playlist2.m3u;playlist3.m3u;playlist4.m3u;playlist5.m3u;playlist6.m3u;playlist7.m3u;playlist8.m3u;playlist9.m3u;playlist10.m3u 16 | Gmu.ReaderCache=512 17 | Gmu.ReaderCachePrebufferSize=256 18 | Gmu.RememberLastPlaylist=yes 19 | Gmu.RememberSettings=yes 20 | Gmu.ResumePlayback=yes 21 | Gmu.Volume=10 22 | Gmu.VolumeControl=Software 23 | Gmu.VolumeHardwareMixerChannel=4 24 | Log.Enable=no 25 | Log.MinimumPlaytimePercent=50 26 | Log.MinimumPlaytimeSec=30 27 | SDL.AllowVolumeControlInHoldState=no 28 | SDL.AutoSelectCurrentPlaylistItem=yes 29 | SDL.BacklightPowerOnOnTrackChange=no 30 | SDL.CoverArtworkFilePattern=cover.jpg;cover.png;front.jpg;*.jpg;*.png 31 | SDL.CoverArtworkLarge=no 32 | SDL.DefaultSkin=default-modern 33 | SDL.EnableCoverArtwork=yes 34 | SDL.FileBrowserSelectNextAfterAdd=yes 35 | SDL.Fullscreen=yes 36 | SDL.Height=240 37 | SDL.InputConfigFile=gmuinput.caanoo.conf 38 | SDL.KeyMap=caanoo.keymap 39 | SDL.LoadEmbeddedCoverArtwork=first 40 | SDL.LyricsFilePattern=$.txt;*.txt;*.nfo 41 | SDL.Scroll=always 42 | SDL.SecondsUntilBacklightPowerOff=30 43 | SDL.SmallCoverArtworkAlignment=right 44 | SDL.TimeDisplay=remaining 45 | SDL.Width=320 46 | -------------------------------------------------------------------------------- /src/frontends/web/base64.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2012 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: base64.c Created: 120118 7 | * 8 | * Description: base64 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include 18 | #include "base64.h" 19 | 20 | static const char cb64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 21 | 22 | static void base64_encode_block(unsigned char in[3], char out[4], int len) 23 | { 24 | out[0] = cb64[ in[0] >> 2 ]; 25 | out[1] = cb64[ ((in[0] & 0x03) << 4) | ((in[1] & 0xf0) >> 4) ]; 26 | out[2] = (char) (len > 1 ? cb64[ ((in[1] & 0x0f) << 2) | ((in[2] & 0xc0) >> 6) ] : '='); 27 | out[3] = (char) (len > 2 ? cb64[ in[2] & 0x3f ] : '='); 28 | } 29 | 30 | void base64_encode_data(unsigned char *in, int in_len, char *out, int out_max_len) 31 | { 32 | int i, j, k, m; 33 | unsigned char in_buf[3]; 34 | char out_buf[4]; 35 | 36 | memset(in_buf, 0, 3); 37 | memset(out, 0, out_max_len); 38 | for (i = 0, j = 0, k = 0; i < in_len; i++, j++) { 39 | if (j >= 3) { 40 | j = 0; 41 | base64_encode_block(in_buf, out_buf, 3); 42 | memset(in_buf, 0, 3); 43 | for (m = 0; m < 4; m++) out[k+m < out_max_len ? k+m : 0] = out_buf[m]; 44 | k+=4; 45 | } 46 | in_buf[j] = in[i]; 47 | } 48 | base64_encode_block(in_buf, out_buf, in_len % 3); 49 | for (m = 0; m < 4; m++) out[k+m] = out_buf[m]; 50 | } 51 | -------------------------------------------------------------------------------- /gmuinput.nanonote.conf: -------------------------------------------------------------------------------- 1 | FullKeyboard=yes 2 | Button-0=13,Return 3 | Button-1=32,Space 4 | Button-2=13,Enter 5 | Button-3=97,A 6 | Button-4=98,B 7 | Button-5=99,C 8 | Button-6=100,D 9 | Button-7=101,E 10 | Button-8=102,F 11 | Button-9=103,G 12 | Button-10=104,H 13 | Button-11=105,I 14 | Button-12=106,J 15 | Button-13=107,K 16 | Button-14=108,L 17 | Button-15=109,M 18 | Button-16=110,N 19 | Button-17=111,O 20 | Button-18=112,P 21 | Button-19=113,Q 22 | Button-20=114,R 23 | Button-21=115,S 24 | Button-22=116,T 25 | Button-23=117,U 26 | Button-24=118,V 27 | Button-25=119,W 28 | Button-26=120,X 29 | Button-27=121,Y 30 | Button-28=122,Z 31 | Button-29=43,+ 32 | Button-30=45,- 33 | Button-31=32,Space 34 | Button-32=13,Enter 35 | Button-33=27,ESC 36 | Button-34=308,Alt 37 | Button-35=306,CTRL 38 | Button-36=305,CTRL_R 39 | Button-37=313,AltGr 40 | Button-38=304,ShiftL 41 | Button-39=303,ShiftR 42 | Button-40=8,Backspace 43 | Button-41=127,Delete 44 | Button-42=277,Insert 45 | Button-43=48,0 46 | Button-44=49,1 47 | Button-45=50,2 48 | Button-46=51,3 49 | Button-47=52,4 50 | Button-48=53,5 51 | Button-49=54,6 52 | Button-50=55,7 53 | Button-51=56,8 54 | Button-52=57,9 55 | Button-53=9,Tab 56 | Button-54=301,CapsLock 57 | Button-55=282,F1 58 | Button-56=283,F2 59 | Button-57=284,F3 60 | Button-58=285,F4 61 | Button-59=286,F5 62 | Button-60=287,F6 63 | Button-61=288,F7 64 | Button-62=289,F8 65 | Button-63=290,F9 66 | Button-64=291,F10 67 | Button-65=292,F11 68 | Button-66=293,F12 69 | Button-67=46,Dot 70 | Button-68=44,Comma 71 | Button-69=273,Up 72 | Button-70=274,Down 73 | Button-71=276,Left 74 | Button-72=275,Right 75 | Button-73=280,PageUp 76 | Button-74=281,PageDown 77 | Button-75=292,Vol+ 78 | Button-76=293,Vol- 79 | Button-77=9,Tab 80 | -------------------------------------------------------------------------------- /pandora.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | # Buttons names are defined in gmuinput.conf. 7 | 8 | Modifier=Alt 9 | # Global mappings: 10 | Left=Left 11 | Right=Right 12 | Up=Up 13 | Down=Down 14 | IncreaseVolume=0 15 | DecreaseVolume=9 16 | ToggleTime=T 17 | Pause=P 18 | Stop=(X) 19 | ToggleView=Space 20 | PreviousTrack=(L) 21 | NextTrack=(R) 22 | SeekForward=M 23 | SeekBackward=N 24 | Lock=L 25 | Unlock=L 26 | Exit=Mod+Enter 27 | ShutdownTimer=Mod+DOWN 28 | Help=F1 29 | ToggleFullscreen=F 30 | 31 | # Program info mappings: 32 | ProgramInfo=I 33 | ProgramInfoOkay=Enter 34 | # File browser mappings: 35 | #FileBrowserDirUp=LEFT 36 | #FileBrowserChDir=RIGHT 37 | 38 | FileBrowserPlayFile=(A) 39 | FileBrowserAddFileToPlaylistOrChDir=Enter 40 | FileBrowserAddDirToPlaylist=(Y) 41 | FileBrowserInsertFileIntoPlaylist=Mod+(B) 42 | FileBrowserNewPlFromDir=Mod+(Y) 43 | #FileBrowserDeleteFile=Mod+X 44 | # Playlist mappings: 45 | PlaylistPlayItem=Enter 46 | PlaylistToggleRandomMode=R 47 | PlaylistRemoveItem=(Y) 48 | PlaylistClear=Mod+C 49 | PlaylistSave=S 50 | # Playlist save dialog: 51 | PlaylistSaveSelect=Enter 52 | PlaylistSaveCancel=(A) 53 | PlaylistSaveLoadList=S 54 | PlaylistSaveAppendList=Mod+Y 55 | #PlaylistDeleteFile=Mod+X 56 | PlaylistQueue=Q 57 | # Track info mappings: 58 | TrackInfoToggleCover=(A) 59 | TrackInfoToggleText=(B) 60 | # Question dialog mappings: 61 | QuestionYes=Enter 62 | QuestionNo=ESC 63 | # Setup mappings: 64 | SetupSelect=(B) 65 | SetupSaveAndExit=(X) 66 | SetupSaveAndRunGmu=(Y) 67 | SetupFileBrowserSelect=(B) 68 | SetupFileBrowserChDir=(A) 69 | SetupFileBrowserCancel=(X) 70 | -------------------------------------------------------------------------------- /gmu.nanonote.conf: -------------------------------------------------------------------------------- 1 | Gmu.AutoPlayOnProgramStart=no 2 | Gmu.DefaultFileBrowserPath=. 3 | Gmu.DefaultPlayMode=continue 4 | Gmu.DeviceCloseASAP=yes 5 | Gmu.FadeOutOnSkip=no 6 | Gmu.FileBrowserFoldersFirst=yes 7 | Gmu.FileSystemCharset=UTF-8 8 | Gmu.FirstRun=yes 9 | gmuhttp.BaseDir=/media/ 10 | gmuhttp.DisableLocalPassword=yes 11 | gmuhttp.Listen=Local 12 | gmuhttp.Password=change.me 13 | Gmu.LastPlayedPlaylistItem=None 14 | Gmu.LastPlayedPlaylistItemTime=0 15 | Gmu.PlaylistSavePresets=rock.m3u;pop.m3u;electronic.m3u;classic.m3u;alternative.m3u;soundtrack.m3u;chiptunes.m3u;playlist1.m3u;playlist2.m3u;playlist3.m3u;playlist4.m3u;playlist5.m3u;playlist6.m3u;playlist7.m3u;playlist8.m3u;playlist9.m3u;playlist10.m3u 16 | Gmu.ReaderCache=512 17 | Gmu.ReaderCachePrebufferSize=256 18 | Gmu.RememberLastPlaylist=yes 19 | Gmu.RememberSettings=yes 20 | Gmu.ResumePlayback=yes 21 | Gmu.Shutdown=0 22 | Gmu.ShutdownCommand=/sbin/poweroff 23 | Gmu.Volume=7 24 | Gmu.VolumeControl=Software 25 | Gmu.VolumeHardwareMixerChannel=0 26 | Log.Enable=no 27 | Log.MinimumPlaytimePercent=50 28 | Log.MinimumPlaytimeSec=30 29 | SDL.AllowVolumeControlInHoldState=no 30 | SDL.AutoPlayOnProgramStart=no 31 | SDL.AutoSelectCurrentPlaylistItem=yes 32 | SDL.BacklightPowerOnOnTrackChange=no 33 | SDL.CoverArtworkFilePattern=cover.jpg;cover.png;front.jpg;*.jpg;*.png 34 | SDL.CoverArtworkLarge=no 35 | SDL.DefaultSkin=default-modern 36 | SDL.EnableCoverArtwork=yes 37 | SDL.FileBrowserFoldersFirst=yes 38 | SDL.InputConfigFile=gmuinput.nanonote.conf 39 | SDL.KeyMap=nanonote.keymap 40 | SDL.LoadEmbeddedCoverArtwork=first 41 | SDL.LyricsFilePattern=$.txt;*.txt;*.nfo 42 | SDL.Scroll=always 43 | SDL.SecondsUntilBacklightPowerOff=30 44 | SDL.SmallCoverArtworkAlignment=right 45 | SDL.TimeDisplay=remaining 46 | -------------------------------------------------------------------------------- /gmuinput.pandora.conf: -------------------------------------------------------------------------------- 1 | FullKeyboard=yes 2 | Button-0=13,Return 3 | Button-1=32,Space 4 | Button-2=13,Enter 5 | Button-3=97,A 6 | Button-4=98,B 7 | Button-5=99,C 8 | Button-6=100,D 9 | Button-7=101,E 10 | Button-8=102,F 11 | Button-9=103,G 12 | Button-10=104,H 13 | Button-11=105,I 14 | Button-12=106,J 15 | Button-13=107,K 16 | Button-14=108,L 17 | Button-15=109,M 18 | Button-16=110,N 19 | Button-17=111,O 20 | Button-18=112,P 21 | Button-19=113,Q 22 | Button-20=114,R 23 | Button-21=115,S 24 | Button-22=116,T 25 | Button-23=117,U 26 | Button-24=118,V 27 | Button-25=119,W 28 | Button-26=120,X 29 | Button-27=121,Y 30 | Button-28=122,Z 31 | Button-29=43,+ 32 | Button-30=45,- 33 | Button-31=32,Space 34 | Button-32=13,Enter 35 | Button-33=27,ESC 36 | Button-34=308,Alt 37 | Button-35=306,CTRL 38 | Button-36=305,CTRL_R 39 | Button-37=313,AltGr 40 | Button-38=304,ShiftL 41 | Button-39=303,ShiftR 42 | Button-40=8,Backspace 43 | Button-41=127,Delete 44 | Button-42=277,Insert 45 | Button-43=48,0 46 | Button-44=49,1 47 | Button-45=50,2 48 | Button-46=51,3 49 | Button-47=52,4 50 | Button-48=53,5 51 | Button-49=54,6 52 | Button-50=55,7 53 | Button-51=56,8 54 | Button-52=57,9 55 | Button-53=9,Tab 56 | Button-54=301,CapsLock 57 | Button-55=282,F1 58 | Button-56=283,F2 59 | Button-57=284,F3 60 | Button-58=285,F4 61 | Button-59=286,F5 62 | Button-60=287,F6 63 | Button-61=288,F7 64 | Button-62=289,F8 65 | Button-63=290,F9 66 | Button-64=291,F10 67 | Button-65=292,F11 68 | Button-66=293,F12 69 | Button-67=44,< 70 | Button-68=46,> 71 | Button-69=273,Up 72 | Button-70=274,Down 73 | Button-71=276,Left 74 | Button-72=275,Right 75 | Button-73=280,(Y) 76 | Button-74=281,(X) 77 | Button-75=279,(B) 78 | Button-76=278,(A) 79 | Button-75=9,Tab 80 | Button-76=303,(L) 81 | Button-77=305,(R) 82 | -------------------------------------------------------------------------------- /gmu.dingux.conf: -------------------------------------------------------------------------------- 1 | Gmu.AutoPlayOnProgramStart=no 2 | Gmu.DefaultFileBrowserPath=. 3 | Gmu.DefaultPlayMode=continue 4 | Gmu.DeviceCloseASAP=yes 5 | Gmu.FadeOutOnSkip=no 6 | Gmu.FileBrowserFoldersFirst=yes 7 | Gmu.FileSystemCharset=UTF-8 8 | Gmu.FirstRun=yes 9 | gmuhttp.BaseDir=/mnt/ 10 | gmuhttp.DisableLocalPassword=yes 11 | gmuhttp.Listen=Local 12 | gmuhttp.Password=change.me 13 | Gmu.LastPlayedPlaylistItem=None 14 | Gmu.LastPlayedPlaylistItemTime=0 15 | Gmu.PlaylistSavePresets=rock.m3u;pop.m3u;electronic.m3u;classic.m3u;alternative.m3u;soundtrack.m3u;chiptunes.m3u;playlist1.m3u;playlist2.m3u;playlist3.m3u;playlist4.m3u;playlist5.m3u;playlist6.m3u;playlist7.m3u;playlist8.m3u;playlist9.m3u;playlist10.m3u 16 | Gmu.ReaderCache=512 17 | Gmu.ReaderCachePrebufferSize=256 18 | Gmu.RememberLastPlaylist=yes 19 | Gmu.RememberSettings=yes 20 | Gmu.ResumePlayback=yes 21 | Gmu.Shutdown=0 22 | Gmu.ShutdownCommand=/sbin/poweroff 23 | Gmu.Volume=15 24 | Gmu.VolumeControl=Software 25 | Gmu.VolumeHardwareMixerChannel=0 26 | Log.Enable=no 27 | Log.MinimumPlaytimePercent=50 28 | Log.MinimumPlaytimeSec=30 29 | SDL.AllowVolumeControlInHoldState=no 30 | SDL.AutoSelectCurrentPlaylistItem=yes 31 | SDL.BacklightPowerOnOnTrackChange=no 32 | SDL.CoverArtworkFilePattern=cover.jpg;cover.png;front.jpg;*.jpg;*.png 33 | SDL.CoverArtworkLarge=no 34 | SDL.DefaultSkin=default-modern 35 | SDL.EnableCoverArtwork=yes 36 | SDL.FileBrowserSelectNextAfterAdd=yes 37 | SDL.Fullscreen=yes 38 | SDL.Height=240 39 | SDL.InputConfigFile=gmuinput.dingux.conf 40 | SDL.KeyMap=dingux.keymap 41 | SDL.LoadEmbeddedCoverArtwork=first 42 | SDL.LyricsFilePattern=$.txt;*.txt;*.nfo 43 | SDL.Scroll=always 44 | SDL.SecondsUntilBacklightPowerOff=30 45 | SDL.SmallCoverArtworkAlignment=right 46 | SDL.TimeDisplay=remaining 47 | SDL.Width=320 48 | -------------------------------------------------------------------------------- /themes/default-modern/theme.conf: -------------------------------------------------------------------------------- 1 | # Gmu Theme file 2 | FormatVersion=2 3 | 4 | #Fontsize=10 5 | Font1Type=bitmap 6 | Font1=letters_small_white.png 7 | Font1CharWidth=5 8 | Font1CharHeight=7 9 | 10 | Font2Type=bitmap 11 | Font2=letters_small_blue.png 12 | Font2CharWidth=5 13 | Font2CharHeight=7 14 | 15 | Icon.ArrowUp=arrow-up.png 16 | Icon.ArrowDown=arrow-down.png 17 | 18 | Header.ImagePrefix=footer 19 | Header.PosX1=0 20 | Header.PosY1=38 21 | Header.PosX2=0 22 | Header.PosY2=51 23 | 24 | ListView.ImagePrefix=textarea 25 | ListView.PosX1=0 26 | ListView.PosY1=51 27 | ListView.PosX2=0 28 | ListView.PosY2=-13 29 | 30 | Footer.ImagePrefix=footer 31 | Footer.PosX1=0 32 | Footer.PosY1=-13 33 | Footer.PosX2=0 34 | Footer.PosY2=0 35 | 36 | Display.ImagePrefix=display 37 | Display.PosX1=0 38 | Display.PosY1=0 39 | Display.PosX2=0 40 | Display.PosY2=38 41 | 42 | #Display.Fontsize=12 43 | Display.FontType=bitmap 44 | Display.Font=letters_lcd_2.png 45 | Display.FontCharWidth=10 46 | Display.FontCharHeight=14 47 | 48 | Display.FontUpperCaseOnly=yes 49 | 50 | Display.Symbols=symbols.png 51 | Display.SymbolsWidth=16 52 | Display.SymbolsHeight=16 53 | Display.Symbol.Play.OffsetX=0 54 | Display.Symbol.Play.OffsetY=2 55 | Display.Symbol.Pause.OffsetX=13 56 | Display.Symbol.Pause.OffsetY=2 57 | Display.Symbol.Stereo.OffsetX=6 58 | Display.Symbol.Stereo.OffsetY=20 59 | 60 | Display.TitleScrollerOffsetY=4 61 | Display.TitleScrollerOffsetX1=28 62 | Display.TitleScrollerOffsetX2=0 63 | Display.PlayPauseOffsetX=5 64 | Display.PlayPauseOffsetY=3 65 | Display.VolumeOffsetX=3 66 | Display.VolumeOffsetY=20 67 | Display.BitrateOffsetX=28 68 | Display.BitrateOffsetY=21 69 | Display.FrequencyOffsetX=138 70 | Display.FrequencyOffsetY=21 71 | Display.TimeOffsetX=248 72 | Display.TimeOffsetY=21 73 | -------------------------------------------------------------------------------- /gmu.gp2x.conf: -------------------------------------------------------------------------------- 1 | Gmu.AutoPlayOnProgramStart=no 2 | Gmu.DefaultFileBrowserPath=. 3 | Gmu.DefaultPlayMode=continue 4 | Gmu.DeviceCloseASAP=yes 5 | Gmu.FadeOutOnSkip=no 6 | Gmu.FileBrowserFoldersFirst=yes 7 | Gmu.FileSystemCharset=UTF-8 8 | Gmu.FirstRun=yes 9 | gmuhttp.BaseDir=/mnt/ 10 | gmuhttp.DisableLocalPassword=yes 11 | gmuhttp.Listen=Local 12 | gmuhttp.Password=change.me 13 | Gmu.LastPlayedPlaylistItem=None 14 | Gmu.LastPlayedPlaylistItemTime=0 15 | Gmu.PlaylistSavePresets=rock.m3u;pop.m3u;electronic.m3u;classic.m3u;alternative.m3u;soundtrack.m3u;chiptunes.m3u;playlist1.m3u;playlist2.m3u;playlist3.m3u;playlist4.m3u;playlist5.m3u;playlist6.m3u;playlist7.m3u;playlist8.m3u;playlist9.m3u;playlist10.m3u 16 | Gmu.ReaderCache=512 17 | Gmu.ReaderCachePrebufferSize=256 18 | Gmu.RememberLastPlaylist=yes 19 | Gmu.RememberSettings=yes 20 | Gmu.ResumePlayback=yes 21 | Gmu.Shutdown=0 22 | Gmu.ShutdownCommand=/sbin/poweroff 23 | Gmu.Volume=78 24 | Gmu.VolumeControl=Software+Hardware 25 | Gmu.VolumeHardwareMixerChannel=4 26 | Log.Enable=no 27 | Log.MinimumPlaytimePercent=50 28 | Log.MinimumPlaytimeSec=30 29 | SDL.AllowVolumeControlInHoldState=no 30 | SDL.AutoSelectCurrentPlaylistItem=yes 31 | SDL.BacklightPowerOnOnTrackChange=no 32 | SDL.CoverArtworkFilePattern=cover.jpg;cover.png;front.jpg;*.jpg;*.png 33 | SDL.CoverArtworkLarge=no 34 | SDL.DefaultSkin=default-modern 35 | SDL.EnableCoverArtwork=yes 36 | SDL.FileBrowserSelectNextAfterAdd=yes 37 | SDL.Fullscreen=yes 38 | SDL.Height=240 39 | SDL.InputConfigFile=gmuinput.gp2x.conf 40 | SDL.KeyMap=gp2x.keymap 41 | SDL.LoadEmbeddedCoverArtwork=first 42 | SDL.LyricsFilePattern=$.txt;*.txt;*.nfo 43 | SDL.Scroll=always 44 | SDL.SecondsUntilBacklightPowerOff=30 45 | SDL.SmallCoverArtworkAlignment=right 46 | SDL.TimeDisplay=remaining 47 | SDL.Width=320 48 | -------------------------------------------------------------------------------- /themes/default-modern-large/theme.conf: -------------------------------------------------------------------------------- 1 | # Gmu Theme file 2 | FormatVersion=2 3 | 4 | #Fontsize=10 5 | Font1Type=bitmap 6 | Font1=letters_large_white.png 7 | Font1CharWidth=10 8 | Font1CharHeight=14 9 | 10 | Font2Type=bitmap 11 | Font2=letters_large_blue.png 12 | Font2CharWidth=10 13 | Font2CharHeight=14 14 | 15 | Icon.ArrowUp=arrow-up.png 16 | Icon.ArrowDown=arrow-down.png 17 | 18 | Header.ImagePrefix=footer 19 | Header.PosX1=0 20 | Header.PosY1=38 21 | Header.PosX2=0 22 | Header.PosY2=64 23 | 24 | ListView.ImagePrefix=textarea 25 | ListView.PosX1=0 26 | ListView.PosY1=65 27 | ListView.PosX2=0 28 | ListView.PosY2=-26 29 | 30 | Footer.ImagePrefix=footer 31 | Footer.PosX1=0 32 | Footer.PosY1=-26 33 | Footer.PosX2=0 34 | Footer.PosY2=0 35 | 36 | Display.ImagePrefix=display 37 | Display.PosX1=0 38 | Display.PosY1=0 39 | Display.PosX2=0 40 | Display.PosY2=38 41 | 42 | #Display.Fontsize=12 43 | Display.FontType=bitmap 44 | Display.Font=letters_lcd_2.png 45 | Display.FontCharWidth=10 46 | Display.FontCharHeight=14 47 | 48 | Display.FontUpperCaseOnly=yes 49 | 50 | Display.Symbols=symbols.png 51 | Display.SymbolsWidth=16 52 | Display.SymbolsHeight=16 53 | Display.Symbol.Play.OffsetX=0 54 | Display.Symbol.Play.OffsetY=2 55 | Display.Symbol.Pause.OffsetX=13 56 | Display.Symbol.Pause.OffsetY=2 57 | Display.Symbol.Stereo.OffsetX=6 58 | Display.Symbol.Stereo.OffsetY=20 59 | 60 | Display.TitleScrollerOffsetY=4 61 | Display.TitleScrollerOffsetX1=28 62 | Display.TitleScrollerOffsetX2=-5 63 | Display.PlayPauseOffsetX=5 64 | Display.PlayPauseOffsetY=3 65 | Display.VolumeOffsetX=3 66 | Display.VolumeOffsetY=20 67 | Display.BitrateOffsetX=26 68 | Display.BitrateOffsetY=21 69 | Display.FrequencyOffsetX=136 70 | Display.FrequencyOffsetY=21 71 | Display.TimeOffsetX=248 72 | Display.TimeOffsetY=21 73 | -------------------------------------------------------------------------------- /default.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | # Buttons names are defined in gmuinput.conf. 7 | 8 | Modifier=Alt 9 | # Global mappings: 10 | Left=Left 11 | Right=Right 12 | Up=Up 13 | Down=Down 14 | IncreaseVolume=+ 15 | DecreaseVolume=- 16 | ToggleTime=Mod+T 17 | Pause=P 18 | Stop=Mod+X 19 | ToggleView=Tab 20 | PreviousTrack=PageDown 21 | NextTrack=PageUp 22 | SeekForward=Mod+PageUp 23 | SeekBackward=Mod+PageDown 24 | Lock=Mod+Up 25 | Unlock=Mod+Up 26 | Exit=Mod+Enter 27 | ShutdownTimer=Mod+Down 28 | Help=F1 29 | ToggleFullscreen=F 30 | 31 | # Program info mappings: 32 | ProgramInfo=Mod+A 33 | ProgramInfoOkay=Enter 34 | # File browser mappings: 35 | #FileBrowserDirUp=LEFT 36 | #FileBrowserChDir=RIGHT 37 | 38 | FileBrowserPlayFile=A 39 | FileBrowserAddFileToPlaylistOrChDir=Enter 40 | FileBrowserAddDirToPlaylist=Y 41 | FileBrowserAddFileToPlaylist=J 42 | FileBrowserInsertFileIntoPlaylist=Mod+B 43 | FileBrowserNewPlFromDir=Mod+Y 44 | #FileBrowserDeleteFile=Mod+X 45 | # Playlist mappings: 46 | PlaylistPlayItem=Enter 47 | PlaylistToggleRandomMode=M 48 | PlaylistRemoveItem=Y 49 | PlaylistClear=Mod+Y 50 | PlaylistSave=Mod+B 51 | # Playlist save dialog: 52 | PlaylistSaveSelect=Enter 53 | PlaylistSaveCancel=A 54 | PlaylistSaveLoadList=Y 55 | PlaylistSaveAppendList=Mod+Y 56 | #PlaylistDeleteFile=Mod+X 57 | PlaylistQueue=Q 58 | # Track info mappings: 59 | TrackInfoToggleCover=A 60 | TrackInfoToggleText=B 61 | # Question dialog mappings: 62 | QuestionYes=Enter 63 | QuestionNo=ESC 64 | # Setup mappings: 65 | RunSetup=S 66 | SetupSelect=Enter 67 | SetupClose=X 68 | SetupFileBrowserSelect=Enter 69 | SetupFileBrowserChDir=A 70 | SetupFileBrowserCancel=X 71 | -------------------------------------------------------------------------------- /src/gmufrontend.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: gmufrontend.h Created: 081228 7 | * 8 | * Description: Header file for Gmu frontend plugins 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | 17 | #ifndef _GMUFRONTEND_H 18 | #define _GMUFRONTEND_H 19 | #include "gmuevent.h" 20 | 21 | typedef struct _GmuFrontend { 22 | /* Short identifier such as "sdl_frontend" */ 23 | const char *identifier; 24 | /* Should return a human-readable name such as "SDL Frontend v1.0" */ 25 | const char * (*get_name)(void); 26 | /* Init function. Can be NULL if not neccessary. Will be called ONCE when 27 | * the decoder is loaded. */ 28 | int (*frontend_init)(void); 29 | /* Function to be called on unload, you should free/close everything 30 | * that is still allocated/opened at this point. Can be NULL. */ 31 | void (*frontend_shutdown)(void); 32 | /* Will be called on a regular basis (max. a few times per second) in 33 | * gmu-core's main loop */ 34 | void (*mainloop_iteration)(void); 35 | /* Will be called whenever Gmu's state has changed (e.g. playlist modified, 36 | * current track changed, ...) */ 37 | int (*event_callback)(GmuEvent event_type, int param); 38 | /* internal handle, do not use */ 39 | void *handle; 40 | } GmuFrontend; 41 | 42 | /* This function must be implemented by the frontend. It must return a valid 43 | * GmuFrontend object */ 44 | GmuFrontend *GMU_REGISTER_FRONTEND(void); 45 | #endif 46 | -------------------------------------------------------------------------------- /gmuinput.zipit-z2.conf: -------------------------------------------------------------------------------- 1 | FullKeyboard=yes 2 | Button-0=13,Return 3 | Button-1=32,Space 4 | Button-2=13,Enter 5 | Button-3=97,A 6 | Button-4=98,B 7 | Button-5=99,C 8 | Button-6=100,D 9 | Button-7=101,E 10 | Button-8=102,F 11 | Button-9=103,G 12 | Button-10=104,H 13 | Button-11=105,I 14 | Button-12=106,J 15 | Button-13=107,K 16 | Button-14=108,L 17 | Button-15=109,M 18 | Button-16=110,N 19 | Button-17=111,O 20 | Button-18=112,P 21 | Button-19=113,Q 22 | Button-20=114,R 23 | Button-21=115,S 24 | Button-22=116,T 25 | Button-23=117,U 26 | Button-24=118,V 27 | Button-25=119,W 28 | Button-26=120,X 29 | Button-27=121,Y 30 | Button-28=122,Z 31 | Button-29=43,+ 32 | Button-30=45,- 33 | Button-31=32,Space 34 | Button-32=13,Enter 35 | Button-33=27,ESC 36 | Button-34=308,Alt 37 | Button-35=306,CTRL 38 | Button-36=305,CTRL_R 39 | Button-37=313,AltGr 40 | Button-38=304,ShiftL 41 | Button-39=303,ShiftR 42 | Button-40=8,Backspace 43 | Button-41=127,Delete 44 | Button-42=277,Insert 45 | Button-43=48,0 46 | Button-44=49,1 47 | Button-45=50,2 48 | Button-46=51,3 49 | Button-47=52,4 50 | Button-48=53,5 51 | Button-49=54,6 52 | Button-50=55,7 53 | Button-51=56,8 54 | Button-52=57,9 55 | Button-53=9,Tab 56 | Button-54=301,CapsLock 57 | Button-55=282,F1 58 | Button-56=283,F2 59 | Button-57=284,F3 60 | Button-58=285,F4 61 | Button-59=286,F5 62 | Button-60=287,F6 63 | Button-61=288,F7 64 | Button-62=289,F8 65 | Button-63=290,F9 66 | Button-64=291,F10 67 | Button-65=292,F11 68 | Button-66=293,F12 69 | Button-67=44,< 70 | Button-68=46,> 71 | Button-69=273,Up 72 | Button-70=274,Down 73 | Button-71=276,Left 74 | Button-72=275,Right 75 | Button-73=280,Volume+ 76 | Button-74=281,Volume- 77 | Button-75=279,(B) 78 | Button-76=278,(A) 79 | Button-75=9,Tab 80 | Button-76=303,(L) 81 | Button-77=305,(R) 82 | Button-78=46,Dot 83 | Button-79=44,Comma 84 | -------------------------------------------------------------------------------- /gmu.pandora.conf: -------------------------------------------------------------------------------- 1 | Gmu.AutoPlayOnProgramStart=no 2 | Gmu.DefaultFileBrowserPath=/media 3 | Gmu.DefaultPlayMode=continue 4 | Gmu.DeviceCloseASAP=yes 5 | Gmu.FadeOutOnSkip=no 6 | Gmu.FileBrowserFoldersFirst=yes 7 | Gmu.FileSystemCharset=UTF-8 8 | Gmu.FirstRun=yes 9 | gmuhttp.BaseDir=/media/ 10 | gmuhttp.DisableLocalPassword=yes 11 | gmuhttp.Listen=Local 12 | gmuhttp.Password=change.me 13 | Gmu.LastPlayedPlaylistItem=None 14 | Gmu.LastPlayedPlaylistItemTime=0 15 | Gmu.PlaylistSavePresets=rock.m3u;pop.m3u;electronic.m3u;classic.m3u;alternative.m3u;soundtrack.m3u;chiptunes.m3u;playlist1.m3u;playlist2.m3u;playlist3.m3u;playlist4.m3u;playlist5.m3u;playlist6.m3u;playlist7.m3u;playlist8.m3u;playlist9.m3u;playlist10.m3u 16 | Gmu.ReaderCache=512 17 | Gmu.ReaderCachePrebufferSize=256 18 | Gmu.RememberLastPlaylist=yes 19 | Gmu.RememberSettings=yes 20 | Gmu.ResumePlayback=yes 21 | Gmu.Shutdown=0 22 | Gmu.ShutdownCommand=/sbin/poweroff 23 | Gmu.Volume=15 24 | Gmu.VolumeControl=Software 25 | Gmu.VolumeHardwareMixerChannel=0 26 | Log.Enable=no 27 | Log.MinimumPlaytimePercent=50 28 | Log.MinimumPlaytimeSec=30 29 | SDL.AllowVolumeControlInHoldState=no 30 | SDL.AutoPlayOnProgramStart=no 31 | SDL.AutoSelectCurrentPlaylistItem=yes 32 | SDL.BacklightPowerOnOnTrackChange=no 33 | SDL.CoverArtworkFilePattern=cover.jpg;cover.png;front.jpg;*.jpg;*.png 34 | SDL.CoverArtworkLarge=no 35 | SDL.DefaultSkin=default-modern-large 36 | SDL.EnableCoverArtwork=yes 37 | SDL.FileBrowserSelectNextAfterAdd=yes 38 | SDL.Fullscreen=no 39 | SDL.Height=410 40 | SDL.InputConfigFile=gmuinput.pandora.conf 41 | SDL.KeyMap=pandora.keymap 42 | SDL.LoadEmbeddedCoverArtwork=first 43 | SDL.LyricsFilePattern=$.txt;*.txt;*.nfo 44 | SDL.Scroll=always 45 | SDL.SecondsUntilBacklightPowerOff=0 46 | SDL.SmallCoverArtworkAlignment=right 47 | SDL.TimeDisplay=remaining 48 | SDL.Width=790 49 | -------------------------------------------------------------------------------- /src/hw_pre.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_unknown.c Created: 090629 7 | * 8 | * Description: Hardware specific header file for unknown devices (such as PCs) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "oss_mixer.h" 18 | #include "debug.h" 19 | #include "PDL.h" 20 | #include "hw_pre.h" 21 | 22 | static int selected_mixer = -1; 23 | 24 | void hw_display_off(void) 25 | { 26 | wdprintf(V_DEBUG, "hw_pre", "Display off requested.\n"); 27 | } 28 | 29 | void hw_display_on(void) 30 | { 31 | wdprintf(V_DEBUG, "hw_pre", "Display on requested.\n"); 32 | } 33 | 34 | int hw_open_mixer(int mixer_channel) 35 | { 36 | int res = oss_mixer_open(); 37 | selected_mixer = mixer_channel; 38 | wdprintf(V_INFO, "hw_pre", "Selected mixer: %d\n", selected_mixer); 39 | return res; 40 | } 41 | 42 | void hw_close_mixer(void) 43 | { 44 | oss_mixer_close(); 45 | } 46 | 47 | void hw_set_volume(int volume) 48 | { 49 | if (selected_mixer >= 0) { 50 | if (volume >= 0) oss_mixer_set_volume(selected_mixer, volume); 51 | } else { 52 | wdprintf(V_INFO, "hw_pre", "No suitable mixer available.\n"); 53 | } 54 | } 55 | 56 | void hw_detect_device_model(void) 57 | { 58 | } 59 | 60 | const char *hw_get_device_model_name(void) 61 | { 62 | return "Palm Pre"; 63 | } 64 | 65 | void hw_init_device(void) 66 | { 67 | PDL_Init(0); 68 | PDL_NotifyMusicPlaying(PDL_TRUE); 69 | } 70 | 71 | void hw_sdl_post_init(void) 72 | { 73 | PDL_ScreenTimeoutEnable(PDL_TRUE); 74 | } 75 | -------------------------------------------------------------------------------- /src/frontends/sdl/setup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2015 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: setup.h Created: 141102 7 | * 8 | * Description: Setup dialog 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include "kam.h" 17 | #include "wejconfig.h" 18 | 19 | #ifndef WEJ_SETUP_H 20 | #define WEJ_SETUP_H 21 | #define MAX_PRESETS_PER_KEY 7 22 | 23 | typedef struct SetupDialog { 24 | Skin *skin; 25 | ConfigFile *config; 26 | /** 27 | * Stores the available config keys (in position 0) and up to five 28 | * preset values for each key (in position 1 to 5). 29 | */ 30 | char *keys[MAXKEYS][MAX_PRESETS_PER_KEY]; 31 | /** 32 | * Stores the selected value as an integer offset, or -1 if no value 33 | * or an unknown value has been selected. 34 | */ 35 | int selected_value[MAXKEYS]; 36 | /** 37 | * Stores the actual number of keys. 38 | */ 39 | int key_count; 40 | /** 41 | * Stores the line offset for the viewport 42 | */ 43 | int offset; 44 | /** 45 | * Stores the cursor (selection) position 46 | */ 47 | int cursor_x, cursor_y; 48 | int visible_lines; 49 | } SetupDialog; 50 | 51 | int setup_process_action(SetupDialog *setup_dlg, View *view, View old_view, int user_key_action); 52 | void setup_init(SetupDialog *setup_dlg, Skin *skin); 53 | void setup_draw(SetupDialog *setup_dlg, SDL_Surface *sdl_target); 54 | void setup_cursor_move(SetupDialog *setup_dlg, int x_offset, int y_offset); 55 | void setup_shutdown(SetupDialog *setup_dlg); 56 | #endif 57 | -------------------------------------------------------------------------------- /gmu.unknown.conf: -------------------------------------------------------------------------------- 1 | Gmu.AutoPlayOnProgramStart=no 2 | Gmu.DefaultFileBrowserPath=. 3 | Gmu.DefaultPlayMode=continue 4 | Gmu.DeviceCloseASAP=yes 5 | Gmu.FadeOutOnSkip=no 6 | Gmu.FileBrowserFoldersFirst=yes 7 | Gmu.FileSystemCharset=UTF-8 8 | Gmu.FirstRun=yes 9 | gmuhttp.BaseDir=/media/ 10 | gmuhttp.DisableLocalPassword=yes 11 | gmuhttp.Listen=Local 12 | gmuhttp.Password=change.me 13 | Gmu.LastPlayedPlaylistItem=None 14 | Gmu.LastPlayedPlaylistItemTime=0 15 | Gmu.PlaylistSavePresets=rock.m3u;pop.m3u;electronic.m3u;classic.m3u;alternative.m3u;soundtrack.m3u;chiptunes.m3u;playlist1.m3u;playlist2.m3u;playlist3.m3u;playlist4.m3u;playlist5.m3u;playlist6.m3u;playlist7.m3u;playlist8.m3u;playlist9.m3u;playlist10.m3u 16 | Gmu.ReaderCache=512 17 | Gmu.ReaderCachePrebufferSize=256 18 | Gmu.RememberLastPlaylist=yes 19 | Gmu.RememberSettings=yes 20 | Gmu.ResumePlayback=yes 21 | Gmu.Shutdown=0 22 | Gmu.ShutdownCommand=echo "shutdown executed" 23 | Gmu.Volume=85 24 | Gmu.VolumeControl=Software+Hardware 25 | Gmu.VolumeHardwareMixerChannel=0 26 | Log.Enable=no 27 | Log.MinimumPlaytimePercent=5 28 | Log.MinimumPlaytimeSec=20 29 | SDL.AllowVolumeControlInHoldState=no 30 | SDL.AutoPlayOnProgramStart=no 31 | SDL.AutoSelectCurrentPlaylistItem=yes 32 | SDL.BacklightPowerOnOnTrackChange=no 33 | SDL.CoverArtworkFilePattern=cover.jpg;cover.png;front.jpg;*.jpg;*.png 34 | SDL.CoverArtworkLarge=no 35 | SDL.DefaultSkin=default-modern 36 | SDL.EnableCoverArtwork=yes 37 | SDL.FileBrowserFoldersFirst=yes 38 | SDL.FileBrowserSelectNextAfterAdd=yes 39 | SDL.Fullscreen=no 40 | SDL.Height=480 41 | SDL.InputConfigFile=gmuinput.unknown.conf 42 | SDL.KeyMap=unknown.keymap 43 | SDL.LoadEmbeddedCoverArtwork=first 44 | SDL.LyricsFilePattern=$.txt;*.txt;*.nfo 45 | SDL.Scroll=always 46 | SDL.SecondsUntilBacklightPowerOff=0 47 | SDL.SmallCoverArtworkAlignment=right 48 | SDL.TimeDisplay=elapsed 49 | SDL.Width=320 50 | -------------------------------------------------------------------------------- /src/hw_unknown.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2011 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_unknown.c Created: 090629 7 | * 8 | * Description: Hardware specific header file for unknown devices (such as PCs) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #ifndef GMU_DISABLE_OSS_MIXER 18 | #include "oss_mixer.h" 19 | #endif 20 | #include "debug.h" 21 | #include "hw_unknown.h" 22 | 23 | static int selected_mixer = -1; 24 | 25 | void hw_display_off(void) 26 | { 27 | wdprintf(V_DEBUG, "hw_unknown", "Display off requested.\n"); 28 | } 29 | 30 | void hw_display_on(void) 31 | { 32 | wdprintf(V_DEBUG, "hw_unknown", "Display on requested.\n"); 33 | } 34 | 35 | int hw_open_mixer(int mixer_channel) 36 | { 37 | #ifndef GMU_DISABLE_OSS_MIXER 38 | int res = oss_mixer_open(); 39 | selected_mixer = mixer_channel; 40 | wdprintf(V_INFO, "hw_unknown", "Selected mixer: %d\n", selected_mixer); 41 | return res; 42 | #else 43 | return 0; 44 | #endif 45 | } 46 | 47 | void hw_close_mixer(void) 48 | { 49 | #ifndef GMU_DISABLE_OSS_MIXER 50 | oss_mixer_close(); 51 | #endif 52 | } 53 | 54 | void hw_set_volume(int volume) 55 | { 56 | #ifndef GMU_DISABLE_OSS_MIXER 57 | if (selected_mixer >= 0) { 58 | if (volume >= 0) oss_mixer_set_volume((unsigned int)selected_mixer, volume); 59 | } else { 60 | wdprintf(V_INFO, "hw_unknown", "No suitable mixer available.\n"); 61 | } 62 | #endif 63 | } 64 | 65 | void hw_detect_device_model(void) 66 | { 67 | } 68 | 69 | const char *hw_get_device_model_name(void) 70 | { 71 | return "Unknown device"; 72 | } 73 | -------------------------------------------------------------------------------- /gmuinput.pre.conf: -------------------------------------------------------------------------------- 1 | FullKeyboard=yes 2 | Button-0=13,Return 3 | Button-1=32,Space 4 | Button-2=13,Enter 5 | Button-3=97,A 6 | Button-4=98,B 7 | Button-5=99,C 8 | Button-6=100,D 9 | Button-7=101,E 10 | Button-8=102,F 11 | Button-9=103,G 12 | Button-10=104,H 13 | Button-11=105,I 14 | Button-12=106,J 15 | Button-13=107,K 16 | Button-14=108,L 17 | Button-15=109,M 18 | Button-16=110,N 19 | Button-17=111,O 20 | Button-18=112,P 21 | Button-19=113,Q 22 | Button-20=114,R 23 | Button-21=115,S 24 | Button-22=116,T 25 | Button-23=117,U 26 | Button-24=118,V 27 | Button-25=119,W 28 | Button-26=120,X 29 | Button-27=121,Y 30 | Button-28=122,Z 31 | Button-29=43,+ 32 | Button-30=45,- 33 | Button-31=32,Space 34 | Button-32=13,Enter 35 | Button-33=27,ESC 36 | Button-34=308,Alt 37 | Button-35=306,CTRL 38 | Button-36=305,CTRL_R 39 | Button-37=313,AltGr 40 | Button-38=304,ShiftL 41 | Button-39=303,ShiftR 42 | Button-40=8,Backspace 43 | Button-41=127,Delete 44 | Button-42=277,Insert 45 | Button-43=48,0 46 | Button-44=49,1 47 | Button-45=50,2 48 | Button-46=51,3 49 | Button-47=52,4 50 | Button-48=53,5 51 | Button-49=54,6 52 | Button-50=55,7 53 | Button-51=56,8 54 | Button-52=57,9 55 | Button-53=9,Tab 56 | Button-54=301,CapsLock 57 | Button-55=282,F1 58 | Button-56=283,F2 59 | Button-57=284,F3 60 | Button-58=285,F4 61 | Button-59=286,F5 62 | Button-60=287,F6 63 | Button-61=288,F7 64 | Button-62=289,F8 65 | Button-63=290,F9 66 | Button-64=291,F10 67 | Button-65=292,F11 68 | Button-66=293,F12 69 | Button-67=46,Dot 70 | Button-68=44,Comma 71 | Button-69=273,Up 72 | Button-70=274,Down 73 | Button-71=276,Left 74 | Button-72=275,Right 75 | Button-73=280,PageUp 76 | Button-74=281,PageDown 77 | Button-75=9,Tab 78 | JoyButton-0=0,B1 79 | JoyButton-1=1,B2 80 | JoyButton-2=2,B3 81 | JoyButton-3=3,B4 82 | JoyButton-4=4,B5 83 | JoyButton-5=5,B6 84 | JoyButton-6=6,B7 85 | JoyButton-7=7,B8 86 | JoyButton-8=8,B9 87 | JoyButton-9=9,B10 88 | -------------------------------------------------------------------------------- /src/frontends/sdl/plbrowser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2013 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: plbrowser.h Created: 061025 7 | * 8 | * Description: The Gmu playlist browser 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include "charset.h" 17 | #include "skin.h" 18 | 19 | typedef struct PlaylistBrowser 20 | { 21 | int offset; 22 | int horiz_offset; 23 | int selection; 24 | int first_visible_item; 25 | const Skin *skin; 26 | Charset filenames_charset; 27 | int longest_line_so_far; 28 | } PlaylistBrowser; 29 | 30 | void pl_browser_init(PlaylistBrowser *pb, 31 | const Skin *skin, Charset filenames_charset); 32 | void pl_browser_draw(PlaylistBrowser *pb, SDL_Surface *sdl_target); 33 | void pl_browser_playlist_clear(PlaylistBrowser *pb); 34 | int pl_browser_are_selection_and_current_entry_equal(PlaylistBrowser *pb); 35 | int pl_browser_playlist_remove_selection(PlaylistBrowser *pb); 36 | int pl_browser_get_selection(PlaylistBrowser *pb); 37 | int pl_browser_set_selection(PlaylistBrowser *pb, int pos); 38 | void pl_brower_move_selection_down(PlaylistBrowser *pb); 39 | void pl_brower_move_selection_up(PlaylistBrowser *pb); 40 | void pl_brower_move_selection_n_items_down(PlaylistBrowser *pb, int n); 41 | void pl_brower_move_selection_n_items_up(PlaylistBrowser *pb, int n); 42 | void pl_browser_scroll_horiz(PlaylistBrowser *pb, int direction); 43 | Charset pl_browser_get_filenames_charset(PlaylistBrowser *pb); 44 | Entry *pl_browser_get_selected_entry(PlaylistBrowser *pb); 45 | -------------------------------------------------------------------------------- /unknown.keymap: -------------------------------------------------------------------------------- 1 | # Gmu key mappings 2 | # Required keys: Modifier, Up, 3 | # Down, Pause, ProgramInfo, Exit, 4 | # PlaylistPlayItem, PlaylistClear, 5 | # FileBrowserAddFileToPlaylistOrChDir 6 | # Button names are defined in gmuinput.conf. 7 | # Lines starting with a # sign are comments and will be ignored. 8 | 9 | Modifier=Alt 10 | # Global mappings: 11 | Left=Left 12 | Right=Right 13 | Up=Up 14 | Down=Down 15 | IncreaseVolume=+ 16 | DecreaseVolume=- 17 | ToggleTime=Mod+T 18 | Pause=P 19 | Stop=Mod+X 20 | ToggleView=Tab 21 | PreviousTrack=PageDown 22 | NextTrack=PageUp 23 | SeekForward=Mod+PageUp 24 | SeekBackward=Mod+PageDown 25 | Lock=Mod+Up 26 | Unlock=Mod+Up 27 | Exit=Mod+Enter 28 | ShutdownTimer=Mod+Down 29 | Help=F1 30 | ToggleFullscreen=F 31 | 32 | # Program info mappings: 33 | ProgramInfo=Mod+A 34 | ProgramInfoOkay=Enter 35 | # File browser mappings: 36 | #FileBrowserDirUp=LEFT 37 | #FileBrowserChDir=RIGHT 38 | 39 | # You probably want to use exactly one of the following two options: 40 | #FileBrowserPlayFile=A 41 | FileBrowserPlayFileOrChDir=A 42 | 43 | FileBrowserAddFileToPlaylistOrChDir=Enter 44 | FileBrowserAddDirToPlaylist=Y 45 | FileBrowserInsertFileIntoPlaylist=Mod+B 46 | FileBrowserNewPlFromDir=Mod+Y 47 | #FileBrowserDeleteFile=Mod+X 48 | # Playlist mappings: 49 | PlaylistPlayItem=Enter 50 | PlaylistToggleRandomMode=M 51 | PlaylistRemoveItem=Y 52 | PlaylistClear=Mod+Y 53 | PlaylistSave=Mod+B 54 | # Playlist save dialog: 55 | PlaylistSaveSelect=Enter 56 | PlaylistSaveCancel=A 57 | PlaylistSaveLoadList=Y 58 | PlaylistSaveAppendList=Mod+Y 59 | #PlaylistDeleteFile=Mod+X 60 | PlaylistQueue=Q 61 | # Track info mappings: 62 | TrackInfoToggleCover=A 63 | TrackInfoToggleText=B 64 | # Question dialog mappings: 65 | QuestionYes=Enter 66 | QuestionNo=ESC 67 | # Setup mappings: 68 | RunSetup=A 69 | SetupSelect=B 70 | SetupClose=X 71 | SetupFileBrowserSelect=B 72 | SetupFileBrowserChDir=A 73 | SetupFileBrowserCancel=X 74 | -------------------------------------------------------------------------------- /themes/default-modern-large-ttf/theme.conf: -------------------------------------------------------------------------------- 1 | # Gmu Theme file 2 | FormatVersion=2 3 | 4 | Font1Size=12 5 | Font1Type=truetype 6 | Font1=NotoSans-Regular.ttf 7 | # In case of a true type font, this is an average character width, used 8 | # for positioning of textual elements: 9 | Font1CharWidth=6 10 | #Font1CharHeight=7 11 | 12 | Font2Size=12 13 | Font2Type=truetype 14 | Font2=NotoSans-Regular.ttf 15 | Font2CharWidth=6 16 | #Font2CharHeight=7 17 | Font2Color=#3e76ff 18 | 19 | Icon.ArrowUp=arrow-up.png 20 | Icon.ArrowDown=arrow-down.png 21 | 22 | Header.ImagePrefix=footer 23 | Header.PosX1=0 24 | Header.PosY1=38 25 | Header.PosX2=0 26 | Header.PosY2=64 27 | 28 | ListView.ImagePrefix=textarea 29 | ListView.PosX1=0 30 | ListView.PosY1=65 31 | ListView.PosX2=0 32 | ListView.PosY2=-26 33 | 34 | Footer.ImagePrefix=footer 35 | Footer.PosX1=0 36 | Footer.PosY1=-26 37 | Footer.PosX2=0 38 | Footer.PosY2=0 39 | 40 | Display.ImagePrefix=display 41 | Display.PosX1=0 42 | Display.PosY1=0 43 | Display.PosX2=0 44 | Display.PosY2=38 45 | 46 | #Display.Fontsize=12 47 | Display.FontType=bitmap 48 | Display.Font=letters_lcd_2.png 49 | Display.FontCharWidth=10 50 | Display.FontCharHeight=14 51 | 52 | Display.FontUpperCaseOnly=yes 53 | 54 | Display.Symbols=symbols.png 55 | Display.SymbolsWidth=16 56 | Display.SymbolsHeight=16 57 | Display.Symbol.Play.OffsetX=0 58 | Display.Symbol.Play.OffsetY=2 59 | Display.Symbol.Pause.OffsetX=13 60 | Display.Symbol.Pause.OffsetY=2 61 | Display.Symbol.Stereo.OffsetX=6 62 | Display.Symbol.Stereo.OffsetY=20 63 | 64 | Display.TitleScrollerOffsetY=4 65 | Display.TitleScrollerOffsetX1=28 66 | Display.TitleScrollerOffsetX2=-5 67 | Display.PlayPauseOffsetX=5 68 | Display.PlayPauseOffsetY=3 69 | Display.VolumeOffsetX=3 70 | Display.VolumeOffsetY=20 71 | Display.BitrateOffsetX=26 72 | Display.BitrateOffsetY=21 73 | Display.FrequencyOffsetX=136 74 | Display.FrequencyOffsetY=21 75 | Display.TimeOffsetX=248 76 | Display.TimeOffsetY=21 77 | -------------------------------------------------------------------------------- /src/frontends/sdl/filebrowser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2012 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: filebrowser.h Created: 061011 7 | * 8 | * Description: The Gmu file browser 9 | */ 10 | #include "dir.h" 11 | #include "charset.h" 12 | #include "skin.h" 13 | 14 | #ifndef _FILEBROWSER_H 15 | #define _FILEBROWSER_H 16 | typedef struct FileBrowser 17 | { 18 | int offset; 19 | int horiz_offset; 20 | int selection; 21 | Dir *dir; 22 | const Skin *skin; 23 | Charset charset; 24 | int directories_first; 25 | int longest_line_so_far; 26 | int select_next_after_add; 27 | } FileBrowser; 28 | 29 | void file_browser_init(FileBrowser *fb, const Skin *skin, Charset charset, const char *base_dir); 30 | void file_browser_free(FileBrowser *fb); 31 | int file_browser_set_selection(FileBrowser *fb, int selection); 32 | int file_browser_get_selection(FileBrowser *fb); 33 | void file_browser_move_selection_down(FileBrowser *fb); 34 | void file_browser_move_selection_up(FileBrowser *fb); 35 | void file_browser_move_selection_n_items_down(FileBrowser *fb, int n); 36 | void file_browser_move_selection_n_items_up(FileBrowser *fb, int n); 37 | char *file_browser_get_selected_file(FileBrowser *fb); 38 | char *file_browser_get_selected_file_full_path_alloc(FileBrowser *fb); 39 | int file_browser_change_dir(FileBrowser *fb, const char *new_dir); 40 | int file_browser_selection_is_dir(FileBrowser *fb); 41 | void file_browser_draw(FileBrowser *fb, SDL_Surface *sdl_target); 42 | void file_browser_scroll_horiz(FileBrowser *fb, int direction); 43 | Charset file_browser_get_filenames_charset(FileBrowser *fb); 44 | void file_browser_set_directories_first(FileBrowser *fb, int value); 45 | void file_browser_select_next_after_add(FileBrowser *fb, int select); 46 | int file_browser_is_select_next_after_add(FileBrowser *fb); 47 | #endif 48 | -------------------------------------------------------------------------------- /gmuinput.conf: -------------------------------------------------------------------------------- 1 | FullKeyboard=yes 2 | Button-0=13,Return 3 | Button-1=32,Space 4 | Button-2=13,Enter 5 | Button-3=97,A 6 | Button-4=98,B 7 | Button-5=99,C 8 | Button-6=100,D 9 | Button-7=101,E 10 | Button-8=102,F 11 | Button-9=103,G 12 | Button-10=104,H 13 | Button-11=105,I 14 | Button-12=106,J 15 | Button-13=107,K 16 | Button-14=108,L 17 | Button-15=109,M 18 | Button-16=110,N 19 | Button-17=111,O 20 | Button-18=112,P 21 | Button-19=113,Q 22 | Button-20=114,R 23 | Button-21=115,S 24 | Button-22=116,T 25 | Button-23=117,U 26 | Button-24=118,V 27 | Button-25=119,W 28 | Button-26=120,X 29 | Button-27=121,Y 30 | Button-28=122,Z 31 | Button-29=43,+ 32 | Button-30=45,- 33 | Button-31=32,Space 34 | Button-32=13,Enter 35 | Button-33=27,ESC 36 | Button-34=1073742050,Alt 37 | Button-35=1073742048,CTRL 38 | Button-36=1073742052,CTRL_R 39 | Button-37=1073742054,AltGr 40 | Button-38=1073742049,ShiftL 41 | Button-39=1073742053,ShiftR 42 | Button-40=8,Backspace 43 | Button-41=127,Delete 44 | Button-42=277,Insert 45 | Button-43=48,0 46 | Button-44=49,1 47 | Button-45=50,2 48 | Button-46=51,3 49 | Button-47=52,4 50 | Button-48=53,5 51 | Button-49=54,6 52 | Button-50=55,7 53 | Button-51=56,8 54 | Button-52=57,9 55 | Button-53=9,Tab 56 | Button-54=301,CapsLock 57 | Button-55=1073741882,F1 58 | Button-56=283,F2 59 | Button-57=284,F3 60 | Button-58=285,F4 61 | Button-59=286,F5 62 | Button-60=287,F6 63 | Button-61=288,F7 64 | Button-62=289,F8 65 | Button-63=290,F9 66 | Button-64=291,F10 67 | Button-65=292,F11 68 | Button-66=293,F12 69 | Button-67=46,Dot 70 | Button-68=44,Comma 71 | Button-69=1073741906,Up 72 | Button-70=1073741905,Down 73 | Button-71=1073741904,Left 74 | Button-72=1073741903,Right 75 | Button-73=1073741899,PageUp 76 | Button-74=1073741902,PageDown 77 | Button-75=9,Tab 78 | JoyButton-0=0,B1 79 | JoyButton-1=1,B2 80 | JoyButton-2=2,B3 81 | JoyButton-3=3,B4 82 | JoyButton-4=4,B5 83 | JoyButton-5=5,B6 84 | JoyButton-6=6,B7 85 | JoyButton-7=7,B8 86 | JoyButton-8=8,B9 87 | JoyButton-9=9,B10 88 | -------------------------------------------------------------------------------- /gmuinput.unknown.conf: -------------------------------------------------------------------------------- 1 | FullKeyboard=yes 2 | Button-0=13,Return 3 | Button-1=32,Space 4 | Button-2=13,Enter 5 | Button-3=97,A 6 | Button-4=98,B 7 | Button-5=99,C 8 | Button-6=100,D 9 | Button-7=101,E 10 | Button-8=102,F 11 | Button-9=103,G 12 | Button-10=104,H 13 | Button-11=105,I 14 | Button-12=106,J 15 | Button-13=107,K 16 | Button-14=108,L 17 | Button-15=109,M 18 | Button-16=110,N 19 | Button-17=111,O 20 | Button-18=112,P 21 | Button-19=113,Q 22 | Button-20=114,R 23 | Button-21=115,S 24 | Button-22=116,T 25 | Button-23=117,U 26 | Button-24=118,V 27 | Button-25=119,W 28 | Button-26=120,X 29 | Button-27=121,Y 30 | Button-28=122,Z 31 | Button-29=43,+ 32 | Button-30=45,- 33 | Button-31=32,Space 34 | Button-32=13,Enter 35 | Button-33=27,ESC 36 | Button-34=1073742050,Alt 37 | Button-35=1073742048,CTRL 38 | Button-36=1073742052,CTRL_R 39 | Button-37=1073742054,AltGr 40 | Button-38=1073742049,ShiftL 41 | Button-39=1073742053,ShiftR 42 | Button-40=8,Backspace 43 | Button-41=127,Delete 44 | Button-42=277,Insert 45 | Button-43=48,0 46 | Button-44=49,1 47 | Button-45=50,2 48 | Button-46=51,3 49 | Button-47=52,4 50 | Button-48=53,5 51 | Button-49=54,6 52 | Button-50=55,7 53 | Button-51=56,8 54 | Button-52=57,9 55 | Button-53=9,Tab 56 | Button-54=301,CapsLock 57 | Button-55=1073741882,F1 58 | Button-56=283,F2 59 | Button-57=284,F3 60 | Button-58=285,F4 61 | Button-59=286,F5 62 | Button-60=287,F6 63 | Button-61=288,F7 64 | Button-62=289,F8 65 | Button-63=290,F9 66 | Button-64=291,F10 67 | Button-65=292,F11 68 | Button-66=293,F12 69 | Button-67=46,Dot 70 | Button-68=44,Comma 71 | Button-69=1073741906,Up 72 | Button-70=1073741905,Down 73 | Button-71=1073741904,Left 74 | Button-72=1073741903,Right 75 | Button-73=1073741899,PageUp 76 | Button-74=1073741902,PageDown 77 | Button-75=9,Tab 78 | JoyButton-0=0,B1 79 | JoyButton-1=1,B2 80 | JoyButton-2=2,B3 81 | JoyButton-3=3,B4 82 | JoyButton-4=4,B5 83 | JoyButton-5=5,B6 84 | JoyButton-6=6,B7 85 | JoyButton-7=7,B8 86 | JoyButton-8=8,B9 87 | JoyButton-9=9,B10 88 | -------------------------------------------------------------------------------- /src/frontends/sdl/question.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2025 Johannes Heimansberg (wej.k.vu) 5 | * 6 | * File: question.c Created: 061130 7 | * 8 | * Description: Question dialog 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include "question.h" 17 | #include "skin.h" 18 | #include "debug.h" 19 | 20 | void question_init(Question *dlg, Skin *skin) 21 | { 22 | dlg->skin = skin; 23 | } 24 | 25 | int question_process_action(Question *dlg, int user_key_action) 26 | { 27 | int result = 0; 28 | switch (user_key_action) { 29 | case QUESTION_YES: 30 | wdprintf(V_DEBUG, "sdl_question", "Answer: YES\n"); 31 | dlg->positive_result_func(dlg->arg); 32 | result = 1; 33 | *(dlg->view) = dlg->return_view; 34 | break; 35 | case QUESTION_NO: 36 | wdprintf(V_DEBUG, "sdl_question", "Answer: NO\n"); 37 | *(dlg->view) = dlg->return_view; 38 | break; 39 | } 40 | return result; 41 | } 42 | 43 | void question_draw(Question *dlg, SDL_Surface *sdl_target) 44 | { 45 | skin_draw_header_text(dlg->skin, "Question"); 46 | textrenderer_draw_string( 47 | &dlg->skin->font1, dlg->question, sdl_target, 48 | gmu_widget_get_pos_x((GmuWidget *)&dlg->skin->lv, 1), 49 | gmu_widget_get_pos_y((GmuWidget *)&dlg->skin->lv, 1) + 50 | gmu_widget_get_height((GmuWidget *)&dlg->skin->lv, 1) / 2 - dlg->skin->font1_char_height 51 | ); 52 | } 53 | 54 | void question_set(Question *dlg, View return_view, View *view, char *question, 55 | void (*positive_result_func)(void *), void *arg) 56 | { 57 | dlg->view = view; 58 | dlg->return_view = return_view; 59 | dlg->question = question; 60 | dlg->positive_result_func = positive_result_func; 61 | dlg->arg = arg; 62 | } 63 | -------------------------------------------------------------------------------- /src/audio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2011 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: audio.h Created: 061110 7 | * 8 | * Description: Audio output functions 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #define MIN_BUFFER_FILL 32768 17 | #define AUDIO_MAX_SW_VOLUME 16 18 | #ifndef _AUDIO_H 19 | #define _AUDIO_H 20 | #include 21 | 22 | int audio_device_open(int samplerate, int channels); 23 | int audio_fill_buffer(char *data, size_t size); 24 | size_t audio_get_playtime(void); 25 | void audio_buffer_init(void); 26 | void audio_buffer_clear(void); 27 | void audio_buffer_free(void); 28 | void audio_device_close(void); 29 | size_t audio_buffer_get_fill(void); 30 | size_t audio_buffer_get_size(void); 31 | int audio_get_status(void); 32 | void audio_force_pause(int pause); 33 | int audio_set_pause(int pause_state); 34 | int audio_get_pause(void); 35 | void audio_set_volume(unsigned int vol); /* 0..15 */ 36 | unsigned int audio_get_volume(void); 37 | size_t audio_set_sample_counter(size_t sample); 38 | size_t audio_increase_sample_counter(size_t sample_offset); 39 | size_t audio_get_sample_count(void); 40 | void audio_wait_until_more_data_is_needed(void); 41 | void audio_set_done(void); 42 | void audio_set_fade_volume(unsigned int percent); 43 | int audio_fade_out_step(unsigned int step_size); 44 | void audio_reset_fade_volume(void); 45 | int audio_fade_out_in_progress(void); 46 | int16_t *audio_spectrum_get_current_amplitudes(void); 47 | void audio_spectrum_register_for_access(void); 48 | void audio_spectrum_unregister(void); 49 | int audio_spectrum_read_lock(void); 50 | void audio_spectrum_read_unlock(void); 51 | #endif 52 | -------------------------------------------------------------------------------- /src/dirparser.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2014 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: dirparser.c Created: 130702 7 | * 8 | * Description: Directory parser 9 | */ 10 | 11 | #include 12 | #include "debug.h" 13 | #include "util.h" 14 | #include "dir.h" 15 | #include "dirparser.h" 16 | #include "core.h" 17 | 18 | int dirparser_walk_through_directory_tree(const char *directory, int (fn(void *arg, const char *filename)), void *arg, int dir_depth) 19 | { 20 | Dir *dir; 21 | int i; 22 | char filetype[16]; 23 | int result = 1; 24 | 25 | wdprintf(V_INFO, "dirparser", "Parsing '%s'...\n", directory); 26 | 27 | dir = dir_init(); 28 | dir_set_base_dir(dir, "/"); 29 | dir_set_ext_filter(dir, gmu_core_get_file_extensions(), 1); 30 | if (dir_read(dir, directory, 1)) { 31 | for (i = 0; i < dir_get_number_of_files(dir); i++) { 32 | if (dir_get_flag(dir, i) == DIRECTORY) { 33 | if (dir_get_filename(dir, i)[0] != '.') { 34 | char *f = dir_get_filename_with_full_path_alloc(dir, i); 35 | if (f) { 36 | if (dir_depth < DIRPARSER_MAX_DEPTH) { 37 | dirparser_walk_through_directory_tree(f, fn, arg, dir_depth + 1); 38 | } else { 39 | wdprintf( 40 | V_WARNING, 41 | "dirparser", 42 | "Maximum directory depth of %d exceeded for directory: %s\n", 43 | DIRPARSER_MAX_DEPTH, 44 | f); 45 | } 46 | free(f); 47 | } 48 | } 49 | } else { 50 | char *filename_tmp = dir_get_filename(dir, i); 51 | const char *tmp = filename_tmp ? get_file_extension(filename_tmp) : NULL; 52 | char *f = dir_get_filename_with_full_path_alloc(dir, i); 53 | filetype[0] = '\0'; 54 | if (tmp != NULL) strtoupper(filetype, tmp, 15); 55 | if (f) { 56 | (*fn)(arg, f); 57 | free(f); 58 | } 59 | /*wdprintf(V_DEBUG, "dirparser", "[%4d] %s\n", i, dir_get_filename(dir, i));*/ 60 | } 61 | } 62 | } 63 | dir_free(dir); 64 | 65 | wdprintf(V_INFO, "dirparser", "Done parsing %s.\n", directory); 66 | return result; 67 | } 68 | -------------------------------------------------------------------------------- /src/frontends/sdl/coverimg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: coverimg.h Created: 070104 7 | * 8 | * Description: Cover image loader 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include 18 | 19 | #ifndef _COVERIMG_H 20 | #define _COVERIMG_H 21 | 22 | typedef enum MimeType { COVER_MIME_UNKNOWN, COVER_MIME_JPEG, COVER_MIME_PNG, COVER_MIME_BMP } MimeType; 23 | 24 | typedef struct CoverImage { 25 | SDL_Surface *image; 26 | int target_width, target_height; 27 | int visible_area_offset_x, visible_area_offset_y; 28 | int visible_area_width, visible_area_height; 29 | SDL_Thread *thread; 30 | SDL_mutex *mutex1, *mutex2; 31 | char filename[256]; 32 | char *image_data; 33 | int image_data_size; 34 | int *ready_flag; 35 | int loading; 36 | MimeType mime_type; 37 | int thread_running; 38 | SDL_mutex *mutex_image; 39 | } CoverImage; 40 | 41 | void cover_image_init(CoverImage *ci); 42 | void cover_image_free(CoverImage *ci); 43 | void cover_image_stop_thread(CoverImage *ci); 44 | void cover_image_load_image_from_file(CoverImage *ci, char *filename, int *ready_flag); 45 | void cover_image_load_image_from_memory(CoverImage *ci, char *image_data, int image_data_size, 46 | char *image_mime_type, int *ready_flag); 47 | SDL_Surface *cover_image_get_image(CoverImage *ci); 48 | void cover_image_lock_image(CoverImage *ci); 49 | void cover_image_unlock_image(CoverImage *ci); 50 | int cover_image_free_image(CoverImage *ci); 51 | void cover_image_set_target_size(CoverImage *ci, int width, int height); 52 | #endif 53 | -------------------------------------------------------------------------------- /src/dir.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2014 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: dir.h Created: 060929 7 | * 8 | * Description: Directory parser 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #define MAX_FILES 16384 17 | #define REG_FILE 2 18 | #define DIRECTORY 3 19 | #ifndef _DIR_H 20 | #define _DIR_H 21 | struct _Dir 22 | { 23 | struct dirent **ep; 24 | /* "entries" contains all fetched files, while "files" contains the number of visible files */ 25 | int entries, files; 26 | short flag_tmp[MAX_FILES]; 27 | short flag[MAX_FILES]; 28 | long filesize_tmp[MAX_FILES]; 29 | long filesize[MAX_FILES]; 30 | char *filename[MAX_FILES]; 31 | char path[256]; 32 | char base_dir[256]; 33 | char **dir_extensions; 34 | int show_directories; 35 | }; 36 | 37 | typedef struct _Dir Dir; 38 | 39 | Dir *dir_init(void); 40 | void dir_set_base_dir(Dir *dir, const char *base_dir); 41 | char *dir_get_base_dir(Dir *dir); 42 | /* dir_set_ext_filter() expects a pointer to a _statically_ allocated array of file extensions! */ 43 | void dir_set_ext_filter(Dir *dir, char **dir_exts, int show_dirs); 44 | int dir_read(Dir *dir, const char *path, int directories_first); 45 | void dir_clear(Dir *dir); 46 | void dir_free(Dir *dir); 47 | char *dir_get_filename(Dir *dir, int i); 48 | char *dir_get_filename_with_full_path_alloc(Dir *dir, int i); 49 | long dir_get_filesize(Dir *dir, int i); 50 | void dir_get_human_readable_filesize(Dir *dir, int i, 51 | char *target, int target_size); 52 | int dir_get_number_of_files(Dir *dir); 53 | int dir_get_flag(Dir *dir, int i); 54 | char *dir_get_path(Dir *dir); 55 | char *dir_get_new_dir_alloc(const char *current_dir, const char *new_dir); 56 | #endif 57 | -------------------------------------------------------------------------------- /src/metadatareader.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2013 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: metadatareader.c Created: 130709 7 | * 8 | * Description: Meta data reader; Reads meta data from audio files into 9 | * TrackInfo struct 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU General Public License 13 | * as published by the Free Software Foundation; version 2 of 14 | * the License. See the file COPYING in the Gmu's main directory 15 | * for details. 16 | */ 17 | 18 | #include "trackinfo.h" 19 | #include "gmudecoder.h" 20 | #include "util.h" 21 | #include "decloader.h" 22 | #include "metadatareader.h" 23 | 24 | int metadatareader_read(const char *file, const char *file_type, TrackInfo *ti) 25 | { 26 | int result = 0; 27 | GmuDecoder *gd = decloader_get_decoder_for_extension(file_type); 28 | GmuCharset charset = M_CHARSET_AUTODETECT; 29 | 30 | if (gd && *gd->meta_data_get_charset) 31 | charset = (*gd->meta_data_get_charset)(); 32 | 33 | trackinfo_clear(ti); 34 | if (gd && *gd->meta_data_load && (*gd->meta_data_load)(file)) { 35 | if (*gd->get_meta_data) { 36 | if ((*gd->get_meta_data)(GMU_META_ARTIST, 0)) 37 | strncpy_charset_conv(ti->artist, (*gd->get_meta_data)(GMU_META_ARTIST, 0), SIZE_ARTIST-1, 0, charset); 38 | if ((*gd->get_meta_data)(GMU_META_TITLE, 0)) 39 | strncpy_charset_conv(ti->title, (*gd->get_meta_data)(GMU_META_TITLE, 0), SIZE_TITLE-1, 0, charset); 40 | if ((*gd->get_meta_data)(GMU_META_ALBUM, 0)) 41 | strncpy_charset_conv(ti->album, (*gd->get_meta_data)(GMU_META_ALBUM, 0), SIZE_ALBUM-1, 0, charset); 42 | if ((*gd->get_meta_data)(GMU_META_TRACKNR, 0)) 43 | strncpy_charset_conv(ti->tracknr, (*gd->get_meta_data)(GMU_META_TRACKNR, 0), SIZE_TRACKNR-1, 0, charset); 44 | if ((*gd->get_meta_data)(GMU_META_DATE, 0)) 45 | strncpy_charset_conv(ti->date, (*gd->get_meta_data)(GMU_META_DATE, 0), SIZE_DATE-1, 0, charset); 46 | trackinfo_set_updated(ti); 47 | result = 1; 48 | } 49 | if (*gd->meta_data_close) (*gd->meta_data_close)(); 50 | } 51 | return result; 52 | } 53 | -------------------------------------------------------------------------------- /src/hw_nanonote.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_nanonote.c Created: 100111 7 | * 8 | * Description: Ben NanoNote specific stuff (button mapping etc.) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "hw_nanonote.h" 18 | #include "oss_mixer.h" 19 | #include "debug.h" 20 | 21 | static int selected_mixer = -1; 22 | 23 | int hw_open_mixer(int mixer_channel) 24 | { 25 | int res = oss_mixer_open(); 26 | selected_mixer = mixer_channel; 27 | wdprintf(V_INFO, "hw_nanonote", "Selected mixer: %d\n", selected_mixer); 28 | return res; 29 | } 30 | 31 | void hw_close_mixer(void) 32 | { 33 | oss_mixer_close(); 34 | } 35 | 36 | void hw_set_volume(int volume) 37 | { 38 | if (selected_mixer >= 0) { 39 | if (volume >= 0) oss_mixer_set_volume(selected_mixer, volume); 40 | } else { 41 | wdprintf(V_INFO, "hw_nanonote", "No suitable mixer available.\n"); 42 | } 43 | } 44 | 45 | void hw_display_off(void) 46 | { 47 | FILE *f; 48 | 49 | wdprintf(V_DEBUG, "hw_nanonote", "Display off requested.\n"); 50 | if ((f = fopen("/sys/class/lcd/gpm940b0-lcd/lcd_power", "w"))) { 51 | fprintf(f, "4\n"); 52 | fclose(f); 53 | } else if ((f = fopen("/sys/class/lcd/ili8960-lcd/lcd_power", "w"))) { /* Path has changed in some (newer?) Kernels */ 54 | fprintf(f, "4\n"); 55 | fclose(f); 56 | } 57 | } 58 | 59 | void hw_display_on(void) 60 | { 61 | FILE *f; 62 | 63 | wdprintf(V_DEBUG, "hw_nanonote", "Display on requested.\n"); 64 | if ((f = fopen("/sys/class/lcd/gpm940b0-lcd/lcd_power", "w"))) { 65 | fprintf(f, "0\n"); 66 | fclose(f); 67 | } else if ((f = fopen("/sys/class/lcd/ili8960-lcd/lcd_power", "w"))) { 68 | fprintf(f, "0\n"); 69 | fclose(f); 70 | } 71 | } 72 | 73 | void hw_detect_device_model(void) 74 | { 75 | } 76 | 77 | const char *hw_get_device_model_name(void) 78 | { 79 | return "Ben NanoNote"; 80 | } 81 | -------------------------------------------------------------------------------- /src/frontends/sdl/gmuwidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: gmuwidget.h Created: 100120 7 | * 8 | * Description: Gmu widget 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #ifndef _GMUWIDGET_H 18 | #define _GMUWIDGET_H 19 | 20 | typedef enum GmuWidgetImagePosition { 21 | LEFT, MIDDLE, RIGHT, 22 | TOP_LEFT, TOP_MIDDLE, TOP_RIGHT, 23 | BOTTOM_LEFT, BOTTOM_MIDDLE, BOTTOM_RIGHT 24 | } GmuWidgetImagePosition; 25 | 26 | typedef struct _GmuWidgetImage GmuWidgetImage; 27 | 28 | struct _GmuWidgetImage { 29 | SDL_Surface *image; 30 | GmuWidgetImagePosition position; 31 | GmuWidgetImage *next; 32 | }; 33 | 34 | typedef struct { 35 | GmuWidgetImage *first; 36 | int pos_x1, pos_y1; 37 | int pos_x2, pos_y2; 38 | int border_left, border_right, border_top, border_bottom; 39 | int actual_y1, actual_x2, actual_y2; 40 | } GmuWidget; 41 | 42 | /* Function to initialize a new widget. This one differs from the _init function 43 | * in that it automatically adds the necessary images, when the follow a predefined 44 | * naming scheme. Missing images are ignored silently */ 45 | void gmu_widget_new(GmuWidget *gw, char *images_prefix, int x1, int y1, int x2, int y2); 46 | /* if x2 and/or y2 are negative (or 0) the position is measured from the 47 | * right/bottom border of the window (instead of left/top when positive) */ 48 | void gmu_widget_init(GmuWidget *gw, int x1, int y1, int x2, int y2); 49 | void gmu_widget_free(GmuWidget *gw); 50 | void gmu_widget_draw(GmuWidget *gw, SDL_Surface *target); 51 | int gmu_widget_get_width(const GmuWidget *gw, int get_usable_size); 52 | int gmu_widget_get_height(const GmuWidget *gw, int get_usable_size); 53 | int gmu_widget_get_pos_x(const GmuWidget *gw, int get_usable_pos); 54 | int gmu_widget_get_pos_y(const GmuWidget *gw, int get_usable_pos); 55 | #endif 56 | -------------------------------------------------------------------------------- /src/charset.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2012 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: charset.h Created: 061115 7 | * 8 | * Description: Charset conversion functions (UTF-8/UTF-16/ISO-8859-1) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _CHARSET_H 17 | #define _CHARSET_H 18 | #define UNICODE_REPLACEMENT_CHAR 0x0000FFFD 19 | #define UNICODE_SUR_HIGH_START 0xD800 20 | #define UNICODE_SUR_HIGH_END 0xDBFF 21 | #define UNICODE_SUR_LOW_START 0xDC00 22 | #define UNICODE_SUR_LOW_END 0xDFFF 23 | typedef enum Charset { ASCII, ISO_8859_1, ISO_8859_15, UTF_8, UTF_16, UTF_16_BOM, UNKNOWN_CHARSET } Charset; 24 | typedef enum { BE, LE, BOM } ByteOrder; 25 | typedef unsigned long UCodePoint; 26 | 27 | int charset_utf8_to_iso8859_1(char *target, const char *source, size_t target_size); 28 | int charset_utf16_to_iso8859_1( 29 | char *target, 30 | size_t target_size, 31 | const char *source, 32 | size_t source_size, 33 | ByteOrder byte_order 34 | ); 35 | int charset_iso8859_1_to_utf8(char *target, const char *source, size_t target_size); 36 | int charset_utf16_to_utf8( 37 | char *target, 38 | size_t target_size, 39 | const char *source, 40 | size_t source_size, 41 | ByteOrder byte_order 42 | ); 43 | void charset_filename_set(Charset charset); 44 | char *charset_filename_convert_alloc(const char *filename); 45 | int charset_convert_string( 46 | const char *source, 47 | Charset source_charset, 48 | char *target, 49 | Charset target_charset, 50 | size_t target_size 51 | ); 52 | int charset_is_valid_utf8_string(const char *str); 53 | int charset_utf8_to_codepoints(UCodePoint *target, const char *source, size_t target_size); 54 | int charset_utf8_len(const char *str); 55 | /* Fiexes a broken UTF-8 string. If there is nothing to be fixed, 56 | * the string is left as is and 0 is returned, 1 otherwise */ 57 | int charset_fix_broken_utf8_string(char *str); 58 | #endif 59 | -------------------------------------------------------------------------------- /src/medialib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2015 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: medialib.h Created: 130627 7 | * 8 | * Description: Gmu media library 9 | */ 10 | #ifndef WEJ_MEDIALIB_H 11 | #define WEJ_MEDIALIB_H 12 | #ifdef GMU_MEDIALIB 13 | #include 14 | #endif 15 | #include "trackinfo.h" 16 | 17 | typedef struct GmuMedialib { 18 | #ifdef GMU_MEDIALIB 19 | sqlite3 *db; 20 | sqlite3_stmt *pp_stmt_search, *pp_stmt_browse, *pp_stmt_path_list; 21 | #endif 22 | int refresh_in_progress; 23 | } GmuMedialib; 24 | 25 | typedef enum { 26 | GMU_MLIB_ANY, GMU_MLIB_ARTIST, GMU_MLIB_TITLE, GMU_MLIB_ALBUM 27 | } GmuMedialibDataType; 28 | 29 | int medialib_create_db_and_open(GmuMedialib *gm); 30 | int medialib_open(GmuMedialib *gm); 31 | void medialib_close(GmuMedialib *gm); 32 | int medialib_start_refresh(GmuMedialib *gm, void (*finished_callback)(void)); 33 | int medialib_is_refresh_in_progress(GmuMedialib *gm); 34 | void medialib_flag_track_as_bad(GmuMedialib *gm, unsigned int id, int bad); 35 | void medialib_refresh(GmuMedialib *gm); 36 | int medialib_add_file(GmuMedialib *gm, const char *file); 37 | void medialib_path_add(GmuMedialib *gm, const char *path); 38 | void medialib_path_remove(GmuMedialib *gm, const char *path); 39 | void medialib_path_remove_with_id(GmuMedialib *gm, unsigned int id); 40 | /* Search the medialib; Returns the number of results */ 41 | int medialib_search_find(GmuMedialib *gm, GmuMedialibDataType type, const char *str); 42 | TrackInfo medialib_search_fetch_next_result(GmuMedialib *gm); 43 | void medialib_search_finish(GmuMedialib *gm); 44 | int medialib_browse(GmuMedialib *gm, const char *sel_column, ...); 45 | const char *medialib_browse_fetch_next_result(GmuMedialib *gm); 46 | void medialib_browse_finish(GmuMedialib *gm); 47 | TrackInfo medialib_get_data_for_id(GmuMedialib *gm, int id); 48 | /* Increase/decrease/set rating for a given track */ 49 | int medialib_rate_track_up(GmuMedialib *gm, int id); 50 | int medialib_rate_track_down(GmuMedialib *gm, int id); 51 | int medialib_rate_track(GmuMedialib *gm, int id, int rating); 52 | int medialib_path_list(GmuMedialib *gm); 53 | const char *medialib_path_list_fetch_next_result(GmuMedialib *gm); 54 | void medialib_path_list_finish(GmuMedialib *gm); 55 | #endif 56 | -------------------------------------------------------------------------------- /src/frontends/web/net.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2015 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: net.c Created: 121005 7 | * 8 | * Description: Network helper functions 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include "net.h" 22 | #include "debug.h" 23 | 24 | /* 25 | * Send data of specified length 'size' to the client socket 26 | * Returns 1 on success, 0 on error 27 | */ 28 | int net_send_block(int sock, const unsigned char *buf, size_t size) 29 | { 30 | const unsigned char *r = buf; 31 | ssize_t len = 0; 32 | int res = 1, tries = 3; 33 | 34 | while (size > 0 && tries > 0) { 35 | errno = 0; 36 | len = send(sock, r, size, 0); 37 | if (len == -1) { 38 | tries--; 39 | if (errno == EWOULDBLOCK || errno == EAGAIN) { 40 | struct pollfd ufds[1]; 41 | int rv; 42 | 43 | wdprintf(V_DEBUG, "net", "Socket %d does not accept more data. Retrying %d more time(s)...\n", sock, tries); 44 | ufds[0].fd = sock; 45 | ufds[0].events = POLLOUT; 46 | rv = poll(ufds, 1, 500); 47 | if (rv == -1) { 48 | res = 0; 49 | break; 50 | } 51 | } else { 52 | wdprintf(V_DEBUG, "net", "Error on socket %d: %s\n", sock, strerror(errno)); 53 | res = 0; 54 | break; 55 | } 56 | } else if (len > 0) { 57 | size -= len; 58 | r += len; 59 | } else { 60 | tries--; 61 | } 62 | } 63 | if (tries <= 0) res = 0; 64 | return res; 65 | } 66 | 67 | /* 68 | * Send a null-terminated string of arbitrary length to the client socket 69 | * Returns 1 on success, 0 on error 70 | */ 71 | int net_send_buf(int sock, const char *buf) 72 | { 73 | const char *r = buf; 74 | ssize_t len = 0; 75 | size_t rlen = strlen(buf); 76 | 77 | if (sock) { 78 | while (rlen > 0) { 79 | if ((len = send(sock, r, strlen(r), 0)) == -1) 80 | return 0; 81 | rlen -= len; 82 | r += len; 83 | } 84 | } 85 | return 1; 86 | } 87 | -------------------------------------------------------------------------------- /src/reader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2021 Johannes Heimansberg (wej.k.vu) 5 | * 6 | * File: reader.h Created: 110406 7 | * 8 | * Description: File/Stream reader functions 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _READER_H 17 | #define _READER_H 18 | #define MINIMUM_HTTP_READ 1024 19 | #include 20 | #include 21 | #include "ringbuffer.h" 22 | #include "wejconfig.h" 23 | 24 | #define HTTP_CACHE_SIZE_MIN_KB 256 25 | #define HTTP_CACHE_SIZE_MAX_KB 4096 26 | 27 | typedef struct 28 | { 29 | FILE *file; 30 | int eof; 31 | int seekable; 32 | size_t file_size; 33 | 34 | int sockfd; 35 | 36 | char *buf; /* Dynamic read buffer */ 37 | size_t buf_size; 38 | size_t buf_data_size; 39 | 40 | ConfigFile *streaminfo; 41 | 42 | RingBuffer rb_http; 43 | pthread_mutex_t mutex; 44 | pthread_t thread; 45 | 46 | size_t stream_pos; 47 | 48 | int is_ready; 49 | } Reader; 50 | 51 | /* Opens a local file or HTTP URL for reading */ 52 | size_t reader_set_cache_size_kb(size_t size, size_t prebuffer_size); 53 | size_t reader_get_cache_fill(Reader *r); 54 | Reader *reader_open(const char *url); 55 | int reader_close(Reader *r); 56 | int reader_is_ready(Reader *r); 57 | int reader_is_eof(Reader *r); 58 | char reader_read_byte(Reader *r); 59 | int reader_read_bytes(Reader *r, size_t size); 60 | char *reader_get_buffer(Reader *r); 61 | size_t reader_get_number_of_bytes_in_buffer(Reader *r); 62 | /* Resets the stream to the beginning (if possible), returns 1 on success, 0 otherwise */ 63 | int reader_reset_stream(Reader *r); 64 | int reader_is_seekable(Reader *r); 65 | int reader_seek_whence(Reader *r, ssize_t byte_offset, int whence); 66 | int reader_seek(Reader *r, ssize_t byte_offset); 67 | size_t reader_get_file_size(Reader *r); 68 | size_t reader_get_stream_position(Reader *r); 69 | /* Sets number of bytes in buffer to 0 */ 70 | void reader_clear_buffer(Reader *r); 71 | #endif 72 | -------------------------------------------------------------------------------- /src/frontends/sdl/textrenderer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2025 Johannes Heimansberg (wej.k.vu) 5 | * 6 | * File: textrenderer.h Created: 060929 7 | * 8 | * Description: Bitmap/TrueType font renderer 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include 18 | #ifndef SDLFE_WITHOUT_SDL_TTF 19 | #include 20 | #endif 21 | #include "charset.h" 22 | 23 | #ifndef GMU_TEXTRENDERER_H 24 | #define GMU_TEXTRENDERER_H 25 | typedef enum { RENDERER_BITMAP, RENDERER_TRUETYPE } Renderer_Type; 26 | 27 | struct _TextRenderer 28 | { 29 | Renderer_Type renderer_type; 30 | SDL_Surface *chars; 31 | int chwidth, chheight; 32 | #ifndef SDLFE_WITHOUT_SDL_TTF 33 | TTF_Font *ttf_font; 34 | SDL_Color ttf_color; 35 | int ttf_size; 36 | int line_height; 37 | #endif 38 | }; 39 | 40 | typedef struct _TextRenderer TextRenderer; 41 | 42 | typedef enum { RENDER_DEFAULT, RENDER_CROP, RENDER_ARROW } Render_Mode; 43 | 44 | int textrenderer_init( 45 | TextRenderer *tr, const char *chars_file, 46 | int chwidth, int chheight 47 | ); 48 | int textrenderer_init_ttf( 49 | TextRenderer *tr, const char *ttf_file, 50 | int fontsize_points, SDL_Color ttf_color 51 | ); 52 | void textrenderer_free(TextRenderer *tr); 53 | void textrenderer_draw_char( 54 | const TextRenderer *tr, UCodePoint ch, SDL_Surface *target, 55 | int target_x, int target_y 56 | ); 57 | void textrenderer_draw_string_codepoints( 58 | const TextRenderer *tr, const UCodePoint *str, 59 | int str_len, SDL_Surface *target, 60 | int target_x, int target_y 61 | ); 62 | void textrenderer_draw_string( 63 | const TextRenderer *tr, const char *str, SDL_Surface *target, 64 | int target_x, int target_y 65 | ); 66 | void textrenderer_draw_string_with_highlight( 67 | const TextRenderer *tr1, const TextRenderer *tr2, 68 | const char *str, int str_offset, 69 | SDL_Surface *target, int target_x, int target_y, 70 | int max_length, Render_Mode rm 71 | ); 72 | int textrenderer_get_string_length(const char *str); 73 | int textrenderer_get_line_height(const TextRenderer *tr); 74 | #endif 75 | -------------------------------------------------------------------------------- /src/wejconfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * wej's config file parser 3 | * 4 | * File: wejconfig.h 5 | * 6 | * Copyright (c) 2003-2015 Johannes Heimansberg 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License version 2 as 10 | * published by the Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | */ 21 | 22 | #ifndef WEJCONFIG_H 23 | #define WEJCONFIG_H 24 | #define MAXKEYS 128 25 | #define CFG_OUT_OF_MEMORY -2 26 | #define CFG_ERROR -1 27 | #define CFG_SUCCESS 0 28 | 29 | typedef struct 30 | { 31 | char *key[MAXKEYS]; 32 | char *value[MAXKEYS]; 33 | char **presets[MAXKEYS]; 34 | size_t lastkey; 35 | char *file; 36 | } ConfigFile; 37 | 38 | ConfigFile *cfg_init(void); 39 | void cfg_free(ConfigFile *cf); 40 | int cfg_add_key(ConfigFile *cf, const char *key, const char *value); 41 | int cfg_key_add_presets(ConfigFile *cf, const char *key, ...); 42 | int cfg_read_config_file(ConfigFile *cf, const char *filename); 43 | int cfg_set_output_config_file(ConfigFile *cf, const char *filename); 44 | int cfg_write_config_file(ConfigFile *cf, const char *filename); 45 | char *cfg_get_key_value(ConfigFile *cf, const char *key); 46 | char *cfg_get_key_value_ignore_case(ConfigFile *cf, const char *key); 47 | int cfg_get_boolean_value(ConfigFile *cf, const char *key); 48 | int cfg_get_int_value(ConfigFile *cf, const char *key); 49 | int cfg_get_int_value_or_default(ConfigFile *cf, const char *key, int default_value); 50 | int cfg_compare_value(ConfigFile *cf, const char *key, const char *cmp_val, int ignore_case); 51 | int cfg_check_config_file(const char *filename); 52 | char *cfg_get_path_to_config_file(const char *filename); 53 | int cfg_is_key_available(ConfigFile *cf, const char *key); 54 | int cfg_add_key_if_not_present(ConfigFile *cf, const char *key, const char *value); 55 | char **cfg_key_get_presets(ConfigFile *cf, const char *key); 56 | char *cfg_get_key(ConfigFile *cf, size_t n); 57 | #endif 58 | -------------------------------------------------------------------------------- /src/frontends/sdl/coverviewer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2021 Johannes Heimansberg (wej.k.vu) 5 | * 6 | * File: coverviewer.h Created: 061030 7 | * 8 | * Description: Cover and track info viewer 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "textrenderer.h" 18 | #include "skin.h" 19 | #include "trackinfo.h" 20 | #include "textbrowser.h" 21 | #include "coverimg.h" 22 | 23 | #ifndef _COVERVIEWER_H 24 | #define _COVERVIEWER_H 25 | 26 | #define SIZE_TRACKINFO_TEXT 16384 27 | 28 | enum { EMBEDDED_COVER_NO, EMBEDDED_COVER_FIRST, EMBEDDED_COVER_LAST }; 29 | 30 | typedef enum _CoverAlign { ALIGN_LEFT, ALIGN_RIGHT } CoverAlign; 31 | 32 | typedef struct CoverViewer { 33 | const Skin *skin; 34 | TextBrowser tb; 35 | int large; 36 | CoverAlign small_cover_align; 37 | int try_to_load_embedded_cover; 38 | int y_offset; 39 | int hide_cover, hide_text; 40 | char track_info_text[SIZE_TRACKINFO_TEXT]; 41 | CoverImage ci; 42 | int spectrum_analyzer; 43 | int image_updated; 44 | SDL_Surface *cover; 45 | } CoverViewer; 46 | 47 | void cover_viewer_init(CoverViewer *cv, const Skin *skin, int large, 48 | CoverAlign align, int embedded_cover); 49 | void cover_viewer_free(CoverViewer *cv); 50 | void cover_viewer_load_artwork( 51 | CoverViewer *cv, 52 | TrackInfo *ti, 53 | const char *audio_file, 54 | const char *image_file_pattern, 55 | int *ready_flag 56 | ); 57 | /* Returns 1 if updated data contains cover image, 0 otherwise */ 58 | int cover_viewer_update_data(CoverViewer *cv, TrackInfo *ti); 59 | void cover_viewer_show(CoverViewer *cv, SDL_Surface *target, int with_image); 60 | void cover_viewer_scroll_down(CoverViewer *cv); 61 | void cover_viewer_scroll_up(CoverViewer *cv); 62 | void cover_viewer_scroll_left(CoverViewer *cv); 63 | void cover_viewer_scroll_right(CoverViewer *cv); 64 | int cover_viewer_cycle_cover_and_spectrum_visibility(CoverViewer *cv); 65 | int cover_viewer_toggle_text_visible(CoverViewer *cv); 66 | int cover_viewer_is_spectrum_analyzer_enabled(CoverViewer *cv); 67 | void cover_viewer_enable_spectrum_analyzer(CoverViewer *cv); 68 | void cover_viewer_disable_spectrum_analyzer(CoverViewer *cv); 69 | void cover_viewer_set_image_updated(CoverViewer *cv); 70 | #endif 71 | -------------------------------------------------------------------------------- /src/nethelper.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2013 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: nethelper.c Created: 130202 7 | * 8 | * Description: Helper functions for network communication 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include "debug.h" 29 | #include "nethelper.h" 30 | 31 | /* Returns a file descriptor on success, or 0 or a negative number otherwise */ 32 | int nethelper_tcp_connect_to_host(char *hostname, int port, int flags) 33 | { 34 | int fd = -1; 35 | if (hostname && port > 0) { 36 | struct addrinfo hints, *servinfo, *p; 37 | int rv; 38 | char port_str[6]; 39 | 40 | snprintf(port_str, 6, "%d", port); 41 | memset(&hints, 0, sizeof hints); 42 | hints.ai_family = AF_UNSPEC; 43 | hints.ai_socktype = SOCK_STREAM; 44 | 45 | if ((rv = getaddrinfo(hostname, port_str, &hints, &servinfo)) != 0) { 46 | wdprintf(V_ERROR, "nethelper", "getaddrinfo: %s\n", gai_strerror(rv)); 47 | } else { 48 | /* loop through all the results and connect to the first we can */ 49 | for (p = servinfo; p != NULL; p = p->ai_next) { 50 | int cur_flags; 51 | if ((fd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) { 52 | wdprintf(V_INFO, "nethelper", "socket: %s\n", strerror(errno)); 53 | continue; 54 | } else { /* Set socket timeout to 2 seconds */ 55 | struct timeval tv; 56 | tv.tv_sec = 2; 57 | tv.tv_usec = 0; 58 | if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof tv)) { 59 | wdprintf(V_INFO, "nethelper", "setsockopt: %s\n", strerror(errno)); 60 | } 61 | } 62 | 63 | cur_flags = fcntl(fd, F_GETFL, 0); 64 | if (flags != 0) fcntl(fd, F_SETFL, cur_flags | flags); 65 | if (connect(fd, p->ai_addr, p->ai_addrlen) == -1) { 66 | wdprintf(V_INFO, "nethelper", "connect: %s\n", strerror(errno)); 67 | if (errno == EINPROGRESS) { 68 | break; 69 | } else { 70 | close(fd); 71 | fd = -1; 72 | } 73 | continue; 74 | } 75 | break; 76 | } 77 | freeaddrinfo(servinfo); 78 | } 79 | } 80 | return fd; 81 | } 82 | -------------------------------------------------------------------------------- /src/tools/listwidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2012 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: listwidget.h Created: 121027 7 | * 8 | * Description: ListWidget for Ncurses Gmu text client 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | 17 | #ifndef WEJ_LISTWIDGET_H 18 | #define WEJ_LISTWIDGET_H 19 | typedef struct _ListCell ListCell; 20 | 21 | #define LW_MAX_TEXT_LENGTH 127 22 | 23 | #define LW_CURSOR_POS_START (0) 24 | #define LW_CURSOR_POS_END (-1) 25 | 26 | struct _ListCell { 27 | char text[LW_MAX_TEXT_LENGTH+1]; 28 | ListCell *next_column; 29 | }; 30 | 31 | typedef struct ListWidget { 32 | Window *win; 33 | int cols; /* Number of columns */ 34 | int *col_width; /* Ptr to array of int with each column's width */ 35 | int cursor_pos; /* Currently selected row */ 36 | ListCell **rows_ref; 37 | int rows; /* Row counter */ 38 | int first_visible_row; 39 | int pos_marker; 40 | } ListWidget; 41 | 42 | ListWidget *listwidget_new(int cols, char *title, int x, int y, int width, int height); 43 | int listwidget_set_col_width(ListWidget *lw, int col, int width); /* width = -1 means column will take all available space */ 44 | int listwidget_get_selection(ListWidget *lw); /* Returns the selected row number */ 45 | int listwidget_get_rows(ListWidget *lw); /* Returns number of rows in list */ 46 | char *listwidget_get_row_data(ListWidget *lw, int row, int col); 47 | int listwidget_delete_row(ListWidget *lw, int row); 48 | int listwidget_add_row(ListWidget *lw); /* Adds an empty row at the end of the list */ 49 | int listwidget_insert_row(ListWidget *lw, int after_row); /* Inserts empty row in list */ 50 | int listwidget_set_cell_data(ListWidget *lw, int row, int col, char *str); 51 | int listwidget_clear_all_rows(ListWidget *lw); /* Removes all rows from list */ 52 | int listwidget_draw(ListWidget *lw); 53 | void listwidget_refresh(ListWidget *lw); 54 | int listwidget_set_cursor(ListWidget *lw, int pos); 55 | int listwidget_move_cursor(ListWidget *lw, int offset); 56 | void listwidget_resize(ListWidget *lw, int height, int width); 57 | int listwidget_set_length(ListWidget *lw, int rows); /* Sets the number of rows (adds or removes rows as neccessary) */ 58 | int listwidget_free(ListWidget *lw); 59 | #endif 60 | -------------------------------------------------------------------------------- /src/frontends/web/json.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2015 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: json.h Created: 120811 7 | * 8 | * Description: A simple JSON parser and helper functions 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef JSON_H 17 | #define JSON_H 18 | 19 | /** 20 | * Definition of JSON data types. Since JSON does not distinguish between 21 | * integer and floating point numbers, the JSON_INTEGER and JSON_FLOAT 22 | * types are for internal use, e.g. to be able to fetch a a number as 23 | * either an integer or a float. When checking a JSON key for its type, 24 | * if it is numerical the result will always be JSON_NUMBER. 25 | */ 26 | typedef enum JSON_Key_Type { 27 | JSON_EMPTY, JSON_STRING, JSON_NUMBER, JSON_INTEGER, JSON_FLOAT, JSON_BOOLEAN, JSON_ARRAY, JSON_OBJECT 28 | } JSON_Key_Type; 29 | 30 | typedef struct _JSON_Key JSON_Key; 31 | typedef struct _JSON_Object JSON_Object; 32 | 33 | struct _JSON_Key { 34 | char *key_name; 35 | char *key_value_str; 36 | double key_value_number; 37 | int key_value_integer; 38 | int key_value_boolean; 39 | JSON_Object *key_value_array; 40 | JSON_Object *key_value_object; 41 | JSON_Key_Type type; 42 | JSON_Key *next; 43 | }; 44 | 45 | struct _JSON_Object { 46 | JSON_Key *first_key; 47 | JSON_Object *parent; 48 | JSON_Object *next; /* for array only */ 49 | int length; 50 | int parse_error; 51 | }; 52 | 53 | JSON_Object *json_object_new(JSON_Object *parent); 54 | JSON_Object *json_parse_alloc(const char *json_data); 55 | int json_object_has_parse_error(JSON_Object *jo); 56 | void json_keys_free(JSON_Key *first_key); 57 | void json_object_free(JSON_Object *object); 58 | void json_object_attach_key(JSON_Object *object, JSON_Key *key); 59 | JSON_Key *json_key_new(void); 60 | char *json_string_escape_alloc(const char *src); 61 | JSON_Key *json_get_key_object_for_key(JSON_Object *object, const char *key); 62 | char *json_get_string_value_for_key(JSON_Object *object, const char *key); 63 | double json_get_number_value_for_key(JSON_Object *object, const char *key); 64 | int json_get_integer_value_for_key(JSON_Object *object, const char *key); 65 | char *json_get_first_key_string(JSON_Object *object); 66 | JSON_Key_Type json_get_type_for_key(JSON_Object *object, const char *key); 67 | char *json_encode_message_alloc(JSON_Key_Type type_1, const char *key, ...); 68 | #endif 69 | -------------------------------------------------------------------------------- /src/hw_zipit-z2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_zipit-z2.c Created: 100821 7 | * 8 | * Description: Hardware specific header file for the Zipit Z2 handheld 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include 18 | #include "oss_mixer.h" 19 | #include "debug.h" 20 | #include "hw_zipit-z2.h" 21 | 22 | static int display_on_value = 100, keyboard_on_value = 100; 23 | static int selected_mixer = -1; 24 | 25 | void hw_display_off(void) 26 | { 27 | char tmp[5]; 28 | FILE *f; 29 | 30 | wdprintf(V_DEBUG, "hw_z2", "Display off requested.\n"); 31 | if ((f = fopen("/sys/class/backlight/pwm-backlight.0/brightness", "r"))) { /* Display */ 32 | int display_on_value_tmp = 0; 33 | if (fgets(tmp, 4, f)) display_on_value_tmp = atoi(tmp); 34 | fclose(f); 35 | if (display_on_value_tmp > 0) display_on_value = display_on_value_tmp; 36 | if ((f = fopen("/sys/class/backlight/pwm-backlight.0/brightness", "w"))) { 37 | fprintf(f, "0\n"); 38 | fclose(f); 39 | } 40 | } 41 | if ((f = fopen("/sys/class/backlight/pwm-backlight.1/brightness", "r"))) { /* Display */ 42 | if (fgets(tmp, 4, f)) keyboard_on_value = atoi(tmp); 43 | fclose(f); 44 | if ((f = fopen("/sys/class/backlight/pwm-backlight.1/brightness", "w"))) { 45 | fprintf(f, "0\n"); 46 | fclose(f); 47 | } 48 | } 49 | } 50 | 51 | void hw_display_on(void) 52 | { 53 | FILE *f; 54 | 55 | wdprintf(V_DEBUG, "hw_z2", "Display on requested.\n"); 56 | if (display_on_value > 0) { 57 | if ((f = fopen("/sys/class/backlight/pwm-backlight.0/brightness", "w"))) { 58 | fprintf(f, "%d\n", display_on_value); 59 | fclose(f); 60 | } 61 | } 62 | if ((f = fopen("/sys/class/backlight/pwm-backlight.1/brightness", "w"))) { 63 | fprintf(f, "%d\n", keyboard_on_value); 64 | fclose(f); 65 | } 66 | } 67 | 68 | int hw_open_mixer(int mixer_channel) 69 | { 70 | int res = oss_mixer_open(); 71 | selected_mixer = mixer_channel; 72 | wdprintf(V_INFO, "hw_z2", "Selected mixer: %d\n", selected_mixer); 73 | return res; 74 | } 75 | 76 | void hw_close_mixer(void) 77 | { 78 | oss_mixer_close(); 79 | } 80 | 81 | void hw_set_volume(int volume) 82 | { 83 | if (selected_mixer >= 0) { 84 | if (volume >= 0) oss_mixer_set_volume(selected_mixer, volume); 85 | } else { 86 | wdprintf(V_INFO, "hw_z2", "No suitable mixer available.\n"); 87 | } 88 | } 89 | 90 | void hw_detect_device_model(void) 91 | { 92 | } 93 | 94 | const char *hw_get_device_model_name(void) 95 | { 96 | return "Zipit Z2"; 97 | } 98 | -------------------------------------------------------------------------------- /src/png.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: png.c Created: 070605 7 | * 8 | * Description: png image dimensions detector 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include 18 | #include "png.h" 19 | #include "imgsize.h" 20 | 21 | static int read_1_byte(ImageSize *is) 22 | { 23 | int res = EOF; 24 | if (is->file) { 25 | res = fgetc(is->infile); 26 | } else if (is->memsize > 0) { 27 | res = (unsigned char)is->memptr++[0]; 28 | is->memsize--; 29 | } 30 | return res; 31 | } 32 | 33 | static int check_png_header(ImageSize *is) 34 | { 35 | size_t i; 36 | int res = 1; 37 | const unsigned char pngsig[] = { 137, 80, 78, 71, 13, 10, 26, 10 }; 38 | 39 | for (i = 0; i < 8; i++) { 40 | if (read_1_byte(is) != pngsig[i]) { 41 | res = 0; 42 | break; 43 | } 44 | } 45 | return res; 46 | } 47 | 48 | static int get_png_image_dimensions(ImageSize *is, unsigned int *width, unsigned int *height) 49 | { 50 | size_t i; 51 | int header_ok = 1; 52 | const unsigned char ihdr_header[] = { 73, 72, 68, 82 }; 53 | unsigned char size[4]; 54 | 55 | *width = *height = 0; 56 | 57 | if (check_png_header(is)) { 58 | for (i = 0; i < 4; i++) 59 | read_1_byte(is); 60 | for (i = 0; i < 4; i++) { 61 | if (read_1_byte(is) != ihdr_header[i]) { 62 | header_ok = 0; 63 | break; 64 | } 65 | } 66 | if (header_ok) { 67 | for (i = 0; i < 4; i++) size[i] = read_1_byte(is); /* width */ 68 | *width = size[0] * 256 * 256 * 256 + 69 | size[1] * 256 * 256 + size[2] * 256 + size[3]; 70 | for (i = 0; i < 4; i++) size[i] = read_1_byte(is); /* height */ 71 | *height = size[0] * 256 * 256 * 256 + 72 | size[1] * 256 * 256 + size[2] * 256 + size[3]; 73 | } 74 | } else { 75 | header_ok = 0; 76 | } 77 | return header_ok; 78 | } 79 | 80 | int png_get_dimensions_from_file(ImageSize *is, char *filename, unsigned int *width, unsigned int *height) 81 | { 82 | int res = 0; 83 | is->file = 1; 84 | is->infile = fopen(filename, "rb"); 85 | if (is->infile) { 86 | res = get_png_image_dimensions(is, width, height); 87 | fclose(is->infile); 88 | } 89 | return res; 90 | } 91 | 92 | int png_get_dimensions_from_memory(ImageSize *is, char *mem, unsigned int memsize, unsigned int *width, unsigned int *height) 93 | { 94 | int res = 0; 95 | is->memptr = mem; 96 | is->memsize = memsize; 97 | is->file = 0; 98 | if (is->memptr && is->memsize > 47) 99 | res = get_png_image_dimensions(is, width, height); 100 | return res; 101 | } 102 | -------------------------------------------------------------------------------- /src/hw_dingux.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: hw_dingoo.c Created: 090628 7 | * 8 | * Description: Dingoo specific stuff (button mapping etc.) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include "hw_dingux.h" 18 | #include "oss_mixer.h" 19 | #include "debug.h" 20 | 21 | static int display_on_value = 100; 22 | static int selected_mixer = -1; 23 | 24 | int hw_open_mixer(int mixer_channel) 25 | { 26 | int res = oss_mixer_open(); 27 | selected_mixer = mixer_channel; 28 | wdprintf(V_INFO, "hw_dingux", "Selected mixer: %d\n", selected_mixer); 29 | return res; 30 | } 31 | 32 | void hw_close_mixer(void) 33 | { 34 | oss_mixer_close(); 35 | } 36 | 37 | void hw_set_volume(int volume) 38 | { 39 | if (selected_mixer >= 0) { 40 | if (volume >= 0) oss_mixer_set_volume(selected_mixer, volume); 41 | } else { 42 | wdprintf(V_INFO, "hw_dingux", "No suitable mixer available.\n"); 43 | } 44 | } 45 | 46 | void hw_display_off(void) 47 | { 48 | char tmp[5]; 49 | FILE *f; 50 | int display_on_value_tmp = 0; 51 | 52 | wdprintf(V_DEBUG, "hw_dingux", "Display off requested.\n"); 53 | if ((f = fopen("/proc/jz/lcd_backlight", "r"))) { /* Old kernel */ 54 | if (fgets(tmp, 4, f)) display_on_value_tmp = atoi(tmp); 55 | fclose(f); 56 | if (display_on_value_tmp > 0) display_on_value = display_on_value_tmp; 57 | if ((f = fopen("/proc/jz/lcd_backlight", "w"))) { 58 | fprintf(f, "0\n"); 59 | fclose(f); 60 | } 61 | } else { /* new OpenDingux kernel */ 62 | if ((f = fopen("/sys/devices/platform/jz4740-slcd-fb/graphics/fb0/blank", "w"))) { 63 | fprintf(f, "1\n"); 64 | fclose(f); 65 | } else if ((f = fopen("/sys/class/graphics/fb0/blank", "w"))) { /* newer OpenDingux kernel */ 66 | fprintf(f, "1\n"); 67 | fclose(f); 68 | } 69 | display_on_value = -1; 70 | } 71 | } 72 | 73 | void hw_display_on(void) 74 | { 75 | FILE *f; 76 | 77 | wdprintf(V_DEBUG, "hw_dingux", "Display on requested.\n"); 78 | if (display_on_value > 0) { /* Old kernel */ 79 | if ((f = fopen("/proc/jz/lcd_backlight", "w"))) { 80 | fprintf(f, "%d\n", display_on_value); 81 | fclose(f); 82 | } 83 | } else { /* new OpenDingux kernel */ 84 | if ((f = fopen("/sys/devices/platform/jz4740-slcd-fb/graphics/fb0/blank", "w"))) { 85 | fprintf(f, "0\n"); 86 | fclose(f); 87 | } else if ((f = fopen("/sys/class/graphics/fb0/blank", "w"))) { /* newer OpenDingux kernel */ 88 | fprintf(f, "0\n"); 89 | fclose(f); 90 | } 91 | } 92 | } 93 | 94 | void hw_detect_device_model(void) 95 | { 96 | } 97 | 98 | const char *hw_get_device_model_name(void) 99 | { 100 | return "Dingoo A320"; 101 | } 102 | -------------------------------------------------------------------------------- /src/frontends/web/httpd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2015 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: httpd.h Created: 111209 7 | * 8 | * Description: Simple (single-threaded) HTTP server (with websocket support) 9 | */ 10 | #ifndef GMU_HTTPD_H 11 | #define GMU_HTTPD_H 12 | #include 13 | #include "../../ringbuffer.h" 14 | #include 15 | 16 | #define bool int 17 | #define true 1 18 | #define false 0 19 | #define SERVER_PORT (4680) 20 | #define HTTP_RINGBUFFER_BUFFER_SIZE (131072) 21 | 22 | #define VERBOSE (0) 23 | 24 | #define MAX_CONNECTIONS (100) 25 | #define CONNECTION_TYPE_HTTP (1) 26 | #define CONNECTION_TYPE_WEBSOCKET (2) 27 | #define CONNECTION_TIMEOUT_HTTP (10) 28 | #define CONNECTION_TIMEOUT_WEBSOCKET (30) 29 | #define CHUNK_SIZE (1300) 30 | 31 | typedef enum ConnectionState { 32 | CON_HTTP_NEW, CON_HTTP_IDLE, CON_HTTP_BUSY, CON_HTTP_CLOSED, 33 | CON_WEBSOCKET_CONNECTING, CON_WEBSOCKET_OPEN, CON_ERROR 34 | } ConnectionState; 35 | 36 | typedef struct ConnectionStruct Connection; 37 | 38 | struct ConnectionStruct { 39 | int fd; 40 | time_t connection_time; 41 | FILE *local_file; 42 | size_t total_size, remaining_bytes_to_send; 43 | ConnectionState state; 44 | char *http_request_header; 45 | RingBuffer rb_receive; 46 | int authentication_okay; 47 | char client_ip[INET6_ADDRSTRLEN+1]; 48 | Connection *prev, *next; 49 | }; 50 | 51 | typedef enum HTTPCommand { 52 | GET, HEAD, POST, UNKNOWN 53 | } HTTPCommand; 54 | 55 | typedef struct HTTPD_Init_Params { 56 | int local_only; 57 | const char *webserver_root; 58 | } HTTPD_Init_Params; 59 | 60 | void *httpd_run_server(void *webserver_root); 61 | void httpd_stop_server(void); 62 | void httpd_send_websocket_broadcast(const char *str); 63 | 64 | Connection *connection_init(int fd, const char *client_ip, Connection *prev); 65 | void connection_reset_timeout(Connection *c); 66 | int connection_is_valid(Connection *c); 67 | int connection_is_local(Connection *c); 68 | int connection_is_authenticated(Connection *c); 69 | int connection_authenticate(Connection *c, const char *password); 70 | void connection_close(Connection *c); 71 | void connection_free_request_header(Connection *c); 72 | int connection_is_timed_out(Connection *c); 73 | void connection_set_state(Connection *c, ConnectionState s); 74 | ConnectionState connection_get_state(Connection *c); 75 | int connection_file_is_open(Connection *c); 76 | int connection_file_open(Connection *c, const char *filename); 77 | void connection_file_close(Connection *c); 78 | int connection_get_number_of_bytes_to_send(Connection *c); 79 | int connection_file_read_chunk(Connection *c); 80 | 81 | void gmu_http_playlist_get_info(Connection *c); 82 | void gmu_http_playlist_get_item(int id, Connection *c); 83 | void gmu_http_send_initial_information(Connection *c); 84 | void gmu_http_get_current_trackinfo(Connection *c); 85 | void gmu_http_playmode_get_info(Connection *c); 86 | #endif 87 | -------------------------------------------------------------------------------- /src/oss_mixer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: oss_mixer.c Created: 090630 7 | * 8 | * Description: OSS audio mixer functions 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include "oss_mixer.h" 24 | #include "debug.h" 25 | 26 | static int mixer_device = 0; 27 | static int initial_volume_pcm = 0, initial_volume_master = 0; 28 | static int available_mixers[SOUND_MIXER_NRDEVICES]; 29 | 30 | int oss_mixer_open(void) 31 | { 32 | int result = 1; 33 | 34 | if ((mixer_device = open("/dev/mixer", O_RDWR)) < 0) { 35 | result = 0; 36 | wdprintf(V_ERROR, "oss_mixer", "Failed to open mixer.\n"); 37 | } else { 38 | int mask; 39 | 40 | if (ioctl(mixer_device, SOUND_MIXER_READ_DEVMASK, &mask) == -1) { 41 | wdprintf(V_WARNING, "oss_mixer", "No mixers available.\n"); 42 | } else { 43 | int i, p = 0; 44 | char *dn[] = SOUND_DEVICE_NAMES; 45 | 46 | wdprintf(V_INFO, "oss_mixer", "Available controls:\n"); 47 | for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) 48 | if (mask & (1 << i)) { 49 | wdprintf(V_INFO, "oss_mixer", "%s (%d)\n", dn[i], i); 50 | p = 1; 51 | available_mixers[i] = 1; 52 | } else { 53 | available_mixers[i] = 0; 54 | } 55 | if (!p) wdprintf(V_INFO, "oss_mixer", "None\n"); 56 | } 57 | ioctl(mixer_device, SOUND_MIXER_READ_PCM, &initial_volume_pcm); 58 | ioctl(mixer_device, SOUND_MIXER_READ_VOLUME, &initial_volume_master); 59 | wdprintf( 60 | V_DEBUG, 61 | "oss_mixer", 62 | "Volume settings: master=%d pcm=%d\n", 63 | initial_volume_master, 64 | initial_volume_pcm 65 | ); 66 | } 67 | return result; 68 | } 69 | 70 | void oss_mixer_close(void) 71 | { 72 | ioctl(mixer_device, SOUND_MIXER_WRITE_PCM, &initial_volume_pcm); 73 | close(mixer_device); 74 | } 75 | 76 | void oss_mixer_set_volume(unsigned int mixer, int volume) 77 | { 78 | int l = volume < 0 ? 0 : (volume > 100 ? 100 : volume); 79 | int r = volume < 0 ? 0 : (volume > 100 ? 100 : volume); 80 | 81 | l <<= 8; l |= r; 82 | if (1 || available_mixers[mixer]) { /* Ignore non-existance of mixers (Dingoo workaround) */ 83 | ioctl(mixer_device, MIXER_WRITE(mixer), &l); 84 | wdprintf(V_DEBUG, "oss_mixer", "mixer %d volume=%d\n", mixer, volume); 85 | } else { 86 | wdprintf(V_WARNING, "oss_mixer", "No such mixer: %d\n", mixer); 87 | } 88 | } 89 | 90 | int oss_mixer_get_volume(unsigned int mixer) 91 | { 92 | int val = 0; 93 | 94 | if (available_mixers[mixer]) 95 | ioctl(mixer_device, MIXER_READ(mixer), &val); 96 | return val; 97 | } 98 | 99 | int oss_mixer_is_mixer_available(unsigned int mixer) 100 | { 101 | return (mixer < SOUND_MIXER_NRDEVICES ? available_mixers[mixer] : 0); 102 | } 103 | -------------------------------------------------------------------------------- /src/frontends/sdl/kam.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: kam.h Created: 061102 7 | * 8 | * Description: Key mapping stuff 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #ifndef _KAM_H 17 | #define _KAM_H 18 | #include "inputconfig.h" 19 | 20 | typedef enum _View 21 | { 22 | ANY = 0, FILE_BROWSER = 1, PLAYLIST = 2, ABOUT = 4, HELP = 8, 23 | TRACK_INFO = 16, QUESTION = 32, SETUP = 64, 24 | SETUP_FILE_BROWSER = 128, PLAYLIST_SAVE = 256, EGG = 512 25 | } View; 26 | 27 | typedef enum _UserAction 28 | { 29 | FB_ADD_FILE_TO_PL_OR_CHDIR, 30 | FB_ADD_FILE_TO_PL, 31 | FB_ADD_DIR_TO_PL, 32 | FB_INSERT_FILE_INTO_PL, 33 | FB_PLAY_FILE, 34 | FB_PLAY_FILE_OR_CHDIR, 35 | FB_DELETE_FILE, 36 | FB_NEW_PL_FROM_DIR, 37 | PL_PLAY_ITEM, 38 | PL_REMOVE_ITEM, 39 | PL_CLEAR_PLAYLIST, 40 | PL_TOGGLE_RANDOM, 41 | PL_DELETE_FILE, 42 | PL_SAVE_PLAYLIST, 43 | PL_ENQUEUE, 44 | PLMANAGER_SELECT, 45 | PLMANAGER_LOAD, 46 | PLMANAGER_LOAD_APPEND, 47 | PLMANAGER_CANCEL, 48 | OKAY, 49 | RUN_SETUP, 50 | SETUP_SELECT, 51 | SETUP_CLOSE, 52 | SETUP_FB_SELECT, 53 | SETUP_FB_CHDIR, 54 | SETUP_FB_CANCEL, 55 | TRACKINFO_TOGGLE_COVER, 56 | TRACKINFO_TOGGLE_TEXT, 57 | TRACKINFO_DELETE_FILE, 58 | QUESTION_YES, 59 | QUESTION_NO, 60 | GLOBAL_PROGRAM_INFO, 61 | GLOBAL_HELP, 62 | GLOBAL_EXIT, 63 | GLOBAL_FULLSCREEN, 64 | GLOBAL_LOCK, 65 | GLOBAL_UNLOCK, 66 | GLOBAL_TOGGLE_VIEW, 67 | GLOBAL_PAUSE, 68 | GLOBAL_STOP, 69 | GLOBAL_NEXT, 70 | GLOBAL_PREV, 71 | GLOBAL_SEEK_FWD, 72 | GLOBAL_SEEK_BWD, 73 | GLOBAL_INC_VOLUME, 74 | GLOBAL_DEC_VOLUME, 75 | GLOBAL_TOGGLE_TIME, 76 | GLOBAL_SET_SHUTDOWN_TIMER, 77 | FB_DIR_UP, 78 | FB_CHDIR, 79 | MOVE_CURSOR_UP, 80 | MOVE_CURSOR_DOWN, 81 | MOVE_CURSOR_LEFT, 82 | MOVE_CURSOR_RIGHT, 83 | PAGE_UP, 84 | PAGE_DOWN, 85 | MODIFIER, 86 | LAST_ACTION 87 | } UserAction; 88 | 89 | #define BUTTON_NAME_MAX_LENGTH 32 90 | 91 | typedef struct KeyActionMapping 92 | { 93 | int button; 94 | ActivateMethod method; 95 | int modifier; 96 | View scope; 97 | char button_name[BUTTON_NAME_MAX_LENGTH]; 98 | char *description; 99 | } KeyActionMapping; 100 | 101 | void key_action_mapping_init(KeyActionMapping *kam); 102 | void key_action_mapping_set_defaults(KeyActionMapping *kam); 103 | int key_action_mapping_load_config(KeyActionMapping *kam, char *keymap_file); 104 | int key_action_mapping_get_action(KeyActionMapping *kam, int button, int modifier, View view, ActivateMethod amethod); 105 | char *key_action_mapping_get_button_name(KeyActionMapping *kam, UserAction action); 106 | char *key_action_mapping_get_full_button_name(KeyActionMapping *kam, UserAction action); 107 | int key_action_mapping_get_modifier(KeyActionMapping *kam, UserAction action); 108 | void key_action_mapping_generate_help_string(KeyActionMapping *kam, char *target, int target_size, int modifier, View view); 109 | #endif 110 | -------------------------------------------------------------------------------- /src/bmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2015 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: bmp.c Created: 070616 7 | * 8 | * Description: bmp image dimensions detector 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include 18 | #include 19 | #include "bmp.h" 20 | #include "imgsize.h" 21 | 22 | static int read_1_byte(ImageSize *is) 23 | { 24 | int res = EOF; 25 | if (is->file) { 26 | res = fgetc(is->infile); 27 | } else if (is->memsize > 0) { 28 | res = (unsigned char)is->memptr++[0]; 29 | is->memsize--; 30 | } 31 | return res; 32 | } 33 | 34 | static int check_bmp_header(ImageSize *is) 35 | { 36 | int i, res = 1; 37 | const unsigned char bmpsig[] = { 'B', 'M' }; 38 | for (i = 0; i < 2; i++) { 39 | if (read_1_byte(is) != bmpsig[i]) { 40 | res = 0; 41 | break; 42 | } 43 | } 44 | for (i = 0; i < 12; i++) 45 | read_1_byte(is); 46 | return res; 47 | } 48 | 49 | static int int_pow(int x, int y) 50 | { 51 | int i, r = x; 52 | for (i = 1; i < y; i++) 53 | r = r * x; 54 | if (y == 0) r = 1; 55 | return r; 56 | } 57 | 58 | static int calculate_int(unsigned char *four_bytes) 59 | { 60 | int i, j, res = 0; 61 | for (i = 3; i >= 0; i--) { 62 | for (j = 0; j < 8; j++) { 63 | int p = int_pow(2, j); 64 | /*printf("%d:%d:%d\n", i, j, four_bytes[i] & p);*/ 65 | if (i == 3 && (four_bytes[i] & 128)) 66 | res -= (four_bytes[i] & p); 67 | else 68 | res += (four_bytes[i] & p) * int_pow(256, i); 69 | } 70 | } 71 | return res; 72 | } 73 | 74 | static int get_bmp_image_dimensions(ImageSize *is, unsigned int *width, unsigned int *height) 75 | { 76 | size_t i; 77 | int header_ok = 1; 78 | unsigned char size[4]; 79 | 80 | *width = *height = 0; 81 | 82 | if (check_bmp_header(is)) { 83 | for (i = 0; i < 4; i++) 84 | read_1_byte(is); /* skip size info */ 85 | if (header_ok) { 86 | int h; 87 | for (i = 0; i < 4; i++) size[i] = read_1_byte(is); /* width */ 88 | *width = calculate_int(size); 89 | for (i = 0; i < 4; i++) size[i] = read_1_byte(is); /* height */ 90 | h = calculate_int(size); 91 | *height = h < 0 ? -h : h; 92 | } 93 | } else { 94 | header_ok = 0; 95 | } 96 | return header_ok; 97 | } 98 | 99 | int bmp_get_dimensions_from_file(ImageSize *is, char *filename, unsigned int *width, unsigned int *height) 100 | { 101 | int res = 0; 102 | is->file = 1; 103 | is->infile = fopen(filename, "rb"); 104 | if (is->infile) { 105 | res = get_bmp_image_dimensions(is, width, height); 106 | fclose(is->infile); 107 | } 108 | return res; 109 | } 110 | 111 | int bmp_get_dimensions_from_memory(ImageSize *is, char *mem, unsigned int memsize, unsigned int *width, unsigned int *height) 112 | { 113 | int res = 0; 114 | is->memptr = mem; 115 | is->memsize = memsize; 116 | is->file = 0; 117 | if (is->memptr && is->memsize > 47) 118 | res = get_bmp_image_dimensions(is, width, height); 119 | return res; 120 | } 121 | -------------------------------------------------------------------------------- /src/frontends/sdl/about.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2023 Johannes Heimansberg (wej.k.vu) 5 | * 6 | * File: about.c Created: 061223 7 | * 8 | * Description: Program info 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include "kam.h" 17 | #include "textbrowser.h" 18 | #include "about.h" 19 | #include "core.h" 20 | 21 | static const char *text_about_gmu = 22 | "Libraries used by this program:\n\n" 23 | "- SDL, SDL_Image, SDL_gfx (optional)\n\n" 24 | "The decoder plugins use additional\n" 25 | "libraries for decoding.\n\n" 26 | "Program written by\n" 27 | "Johannes Heimansberg (**wej.k.vu**)\n\n" 28 | "Please take a look at the README.md\n" 29 | "file for more details and\n" 30 | "configuration hints. You also might\n" 31 | "want to check the in-program help\n" 32 | "screen.\n\n" 33 | "Project website:\n" 34 | "**http://wej.k.vu/projects/gmu/**\n\n" 35 | "Gmu is free software: You can\n" 36 | "redistribute it and/or modify it under\n" 37 | "the terms of the GNU General Public\n" 38 | "License version 2.\n"; 39 | 40 | int about_process_action(TextBrowser *tb_about, View *view, View old_view, int user_key_action) 41 | { 42 | int update = 0; 43 | switch (user_key_action) { 44 | case OKAY: 45 | *view = old_view; 46 | update = 1; 47 | break; 48 | case RUN_SETUP: 49 | *view = SETUP; 50 | update = 1; 51 | break; 52 | case MOVE_CURSOR_DOWN: 53 | text_browser_scroll_down(tb_about); 54 | update = 1; 55 | break; 56 | case MOVE_CURSOR_UP: 57 | text_browser_scroll_up(tb_about); 58 | update = 1; 59 | break; 60 | case MOVE_CURSOR_LEFT: 61 | text_browser_scroll_left(tb_about); 62 | update = 1; 63 | break; 64 | case MOVE_CURSOR_RIGHT: 65 | text_browser_scroll_right(tb_about); 66 | update = 1; 67 | break; 68 | } 69 | return update; 70 | } 71 | 72 | void about_init(TextBrowser *tb_about, Skin *skin, const char *decoders) 73 | { 74 | static char txt[1024]; 75 | SDL_version compiled; 76 | SDL_version linked; 77 | 78 | SDL_VERSION(&compiled); 79 | SDL_GetVersion(&linked); 80 | 81 | snprintf( 82 | txt, 1023, "This is the Gmu music player.\n\n" 83 | "Version.........: **"VERSION_NUMBER"**\n" 84 | "Built on........: "__DATE__" "__TIME__"\n" 85 | "SDL version.....: %u.%u.%u (runtime: %u.%u.%u)\n" 86 | "Detected device.: %s\n" 87 | "Config directory: %s\n" 88 | "Config file.....: %s\n" 89 | "Command line....: %s\n\n" 90 | "Gmu supports various file formats\n" 91 | "through decoder plugins.\n\n" 92 | "%s decoders:\n\n%s\n" 93 | "%s", 94 | compiled.major, compiled.minor, compiled.patch, 95 | linked.major, linked.minor, linked.patch, 96 | gmu_core_get_device_model_name(), 97 | gmu_core_get_config_dir(), 98 | gmu_core_get_config_file_path(), 99 | gmu_core_get_command_line(), 100 | STATIC ? "Static build with built-in" : "Loaded", 101 | decoders, 102 | text_about_gmu 103 | ); 104 | 105 | text_browser_init(tb_about, skin); 106 | text_browser_set_text(tb_about, txt, "About Gmu"); 107 | } 108 | -------------------------------------------------------------------------------- /src/tools/ui.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2013 Johannes Heimansberg (wejp.k.vu) 5 | * 6 | * File: ui.h Created: 121209 7 | * 8 | * Description: Gmu command line tool 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | 17 | #ifndef WEJ_UI_H 18 | #define WEJ_UI_H 19 | 20 | #include 21 | #include "window.h" 22 | #include "listwidget.h" 23 | 24 | typedef enum { FUNC_NONE, FUNC_HELP, FUNC_NEXT_WINDOW, FUNC_PLAY, FUNC_PAUSE, 25 | FUNC_PLAY_PAUSE, FUNC_STOP, FUNC_NEXT, FUNC_PREVIOUS, 26 | FUNC_PLAYMODE, FUNC_PL_CLEAR, FUNC_PL_DEL_ITEM, FUNC_SEARCH, 27 | FUNC_FB_ADD, FUNC_TEXT_INPUT, FUNC_VOLUME_UP, FUNC_VOLUME_DOWN, 28 | FUNC_QUIT, FUNC_MLIB_REFRESH, FUNC_TOGGLE_TIME, 29 | FUNC_BROWSE_ARTISTS, FUNC_BROWSE_GENRES, FUNC_MLIB_PLAY_ITEM, 30 | FUNC_FB_MLIB_ADD_PATH 31 | } Function; 32 | 33 | typedef enum { 34 | MLIB_STATE_RESULTS, MLIB_STATE_BROWSE_ARTISTS, MLIB_STATE_BROWSE_GENRES 35 | } MLibState; 36 | 37 | typedef struct FooterButtons { 38 | char *button_name, *button_desc; 39 | Function func; 40 | wint_t key; 41 | int keycode; 42 | } FooterButtons; 43 | 44 | typedef struct UI { 45 | Window *win_cmd, *win_ti, *win_lib, *win_header, *win_footer; 46 | ListWidget *lw_pl, *lw_fb, *lw_mlib_search; 47 | ListWidget *lw_mlib_artists, *lw_mlib_genres; 48 | FooterButtons *fb_pl, *fb_fb, *fb_ti, *fb_lib, *fb_cmd; 49 | FooterButtons *fb_visible; 50 | int rows, cols; 51 | WindowType active_win; 52 | WINDOW *rootwin; 53 | int text_input_enabled; 54 | int color; 55 | /* Track information & playback status */ 56 | char ti_title[128], ti_artist[128], ti_album[128], ti_date[64]; 57 | int playlist_pos; /* Position in playlist or negative when not in playlist */ 58 | char status[32]; 59 | int pb_time, total_time, playmode, volume; 60 | int time_display_remaining; 61 | int busy; 62 | MLibState mlib_state; 63 | } UI; 64 | 65 | void ui_init(UI *ui, int color); 66 | void ui_draw_header(UI *ui); 67 | void ui_refresh_active_window(UI *ui); 68 | void ui_draw_footer(UI *ui); 69 | void ui_draw(UI *ui); 70 | void ui_update_trackinfo(UI *ui, char *title, char *artist, char *album, char *date); 71 | void ui_update_playlist_pos(UI *ui, int playlist_pos); 72 | void ui_update_playmode(UI *ui, int playmode); 73 | void ui_update_volume(UI *ui, int volume); 74 | void ui_update_playback_time(UI *ui, int time); 75 | void ui_update_playback_status(UI *ui, char *status); 76 | void ui_set_total_track_time(UI *ui, int seconds); 77 | void ui_draw_trackinfo(UI *ui); 78 | void ui_cursor_text_input(UI *ui, char *str); 79 | void ui_enable_text_input(UI *ui, int enable); 80 | void ui_resize(UI *ui); 81 | void ui_set_footer_buttons(UI *ui); 82 | void ui_active_win_next(UI *ui); 83 | void ui_active_win_set(UI *ui, WindowType aw); 84 | void ui_free(UI *ui); 85 | int ui_has_color(UI *ui); 86 | void ui_busy_indicator(UI *ui, int busy); 87 | void ui_toggle_time_display(UI *ui); 88 | void ui_mlib_set_state(UI *ui, MLibState state); 89 | MLibState ui_mlib_get_state(UI *ui); 90 | #endif 91 | -------------------------------------------------------------------------------- /src/frontends/lirc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Gmu Music Player 3 | * 4 | * Copyright (c) 2006-2016 Johannes Heimansberg (wej.k.vu) 5 | * 6 | * File: lirc.c Created: 100502 7 | * 8 | * Description: Gmu log bot client (for logging played tracks) 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 of 13 | * the License. See the file COPYING in the Gmu's main directory 14 | * for details. 15 | */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include "../gmufrontend.h" 24 | #include "../core.h" 25 | #include "../debug.h" 26 | #include "../pthread_helper.h" 27 | 28 | static pthread_t fe_thread; 29 | 30 | static const char *get_name(void) 31 | { 32 | return "Gmu LIRC Remote Control Frontend v0.1"; 33 | } 34 | 35 | static int run = 1; 36 | 37 | static void shut_down(void) 38 | { 39 | wdprintf(V_DEBUG, "lirc_frontend", "Shutting down.\n"); 40 | run = 0; 41 | pthread_join(fe_thread, NULL); 42 | wdprintf(V_INFO, "lirc_frontend", "All done.\n"); 43 | } 44 | 45 | static void *thread_func(void *arg) 46 | { 47 | struct lirc_config *config; 48 | int sock, flags; 49 | 50 | if ((sock = lirc_init("gmu", 1)) != -1) { 51 | fcntl(sock, F_SETOWN, getpid()); 52 | flags = fcntl(sock, F_GETFL, 0); 53 | if (flags != -1) fcntl(sock, F_SETFL, flags|O_NONBLOCK); 54 | if (lirc_readconfig(NULL, &config, NULL) == 0) { 55 | char *code, *c; 56 | int ret = 0; 57 | 58 | while (run && lirc_nextcode(&code) == 0) { 59 | if (code != NULL) { 60 | if ((ret = lirc_code2char(config, code, &c)) == 0 && c != NULL) { 61 | wdprintf(V_DEBUG, "lirc_frontend", "Got button press.\n"); 62 | if (strcmp(c, "play") == 0) 63 | gmu_core_play(); 64 | else if (strcmp(c, "pause") == 0) 65 | gmu_core_pause(); 66 | else if (strcmp(c, "stop") == 0) 67 | gmu_core_stop(); 68 | else if (strcmp(c, "toggle_pause") == 0) 69 | gmu_core_play_pause(); 70 | else if (strcmp(c, "toggle_play_pause") == 0) 71 | gmu_core_play_pause(); 72 | else if (strcmp(c, "next") == 0) 73 | gmu_core_next(); 74 | else if (strcmp(c, "prev") == 0) 75 | gmu_core_previous(); 76 | else if (strcmp(c, "volume_up") == 0) 77 | gmu_core_set_volume(gmu_core_get_volume()+1); 78 | else if (strcmp(c, "volume_down") == 0) 79 | gmu_core_set_volume(gmu_core_get_volume()-1); 80 | else 81 | wdprintf(V_WARNING, "lirc_frontend", "Unknown command: %s\n", c); 82 | c = NULL; 83 | } 84 | } 85 | usleep(400); 86 | free(code); 87 | if (ret == -1) break; 88 | } 89 | wdprintf(V_INFO, "lirc_frontend", "Exitting.\n"); 90 | lirc_freeconfig(config); 91 | } 92 | lirc_deinit(); 93 | } 94 | return NULL; 95 | } 96 | 97 | static int init(void) 98 | { 99 | int res = 0; 100 | if (pthread_create_with_stack_size(&fe_thread, DEFAULT_THREAD_STACK_SIZE, thread_func, NULL) == 0) 101 | res = 1; 102 | return res; 103 | } 104 | 105 | static GmuFrontend gf = { 106 | "lirc_frontend", 107 | get_name, 108 | init, 109 | shut_down, 110 | NULL, 111 | NULL, 112 | NULL 113 | }; 114 | 115 | GmuFrontend *GMU_REGISTER_FRONTEND(void) 116 | { 117 | return &gf; 118 | } 119 | --------------------------------------------------------------------------------