A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 116 lines 2.3 kB view raw
1/* 2 * Copyright (C) 1996-1998 Szeredi Miklos 3 * Email: mszeredi@inf.bme.hu 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. See the file COPYING. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * 19 */ 20 21#include "zxconfig.h" 22#include "zxmisc.h" 23#include "interf.h" 24 25#include <stdio.h> 26#include <ctype.h> 27 28#define MAXMSGLEN 2048 29 30char filenamebuf[MAXFILENAME]; 31char msgbuf[MAXMSGLEN]; 32 33char *spif_get_filename(void) 34{ 35 char *name=NULL; 36#if 0 37/* should be implemented when adding ability */ 38/* to open snapshots from within zxbox */ 39 char *name, *s; 40 41 s = get_filename_line(); 42 for(; *s && isspace((int) *s); s++); 43 name = s; 44 for(; *s && isgraph((int) *s); s++); 45 *s = '\0'; 46 47 if(name == s) { 48 printf("Canceled!\n"); 49 return NULL; 50 } 51#endif 52 return name; 53} 54 55char *spif_get_tape_fileinfo(int *startp, int *nump) 56{ 57 *startp=*nump=0; 58 char *name=NULL; 59#if 0 60/* should be implemented when adding ability */ 61/* to tapes snapshots from within zxbox */ 62 63 char *name, *s; 64 int res; 65 66 s = get_filename_line(); 67 for(; *s && isspace((int) *s); s++); 68 name = s; 69 for(; *s && isgraph((int) *s); s++); 70 71 if(name != s) res = 1; 72 else res = 0; 73 74 if(*s) { 75 *s = '\0'; 76 s++; 77 if(*s) { 78 int r1; 79 80 r1 = sscanf(s, "%d %d", startp, nump); 81 if(r1 > 0) res += r1; 82 } 83 } 84 85 if(res < 1) { 86 printf("Canceled!\n"); 87 return NULL; 88 } 89 90 if(res < 2) *startp = -1; 91 if(res < 3) *nump = -1; 92#endif 93 return name; 94} 95 96void put_msg(const char *msg) 97{ 98#ifndef USE_GREY 99 rb->splash (HZ/2, msg ); 100#else 101 LOGF(msg); 102 (void)msg; 103#endif 104} 105 106 107void put_tmp_msg(const char *msg) 108{ 109#ifndef USE_GREY 110 rb->splash (HZ/10, msg ); 111#else 112 LOGF(msg); 113 (void)msg; 114#endif 115} 116