head 1.4; access; symbols pkgsrc-2026Q1:1.4.0.154 pkgsrc-2026Q1-base:1.4 pkgsrc-2025Q4:1.4.0.152 pkgsrc-2025Q4-base:1.4 pkgsrc-2025Q3:1.4.0.150 pkgsrc-2025Q3-base:1.4 pkgsrc-2025Q2:1.4.0.148 pkgsrc-2025Q2-base:1.4 pkgsrc-2025Q1:1.4.0.146 pkgsrc-2025Q1-base:1.4 pkgsrc-2024Q4:1.4.0.144 pkgsrc-2024Q4-base:1.4 pkgsrc-2024Q3:1.4.0.142 pkgsrc-2024Q3-base:1.4 pkgsrc-2024Q2:1.4.0.140 pkgsrc-2024Q2-base:1.4 pkgsrc-2024Q1:1.4.0.138 pkgsrc-2024Q1-base:1.4 pkgsrc-2023Q4:1.4.0.136 pkgsrc-2023Q4-base:1.4 pkgsrc-2023Q3:1.4.0.134 pkgsrc-2023Q3-base:1.4 pkgsrc-2023Q2:1.4.0.132 pkgsrc-2023Q2-base:1.4 pkgsrc-2023Q1:1.4.0.130 pkgsrc-2023Q1-base:1.4 pkgsrc-2022Q4:1.4.0.128 pkgsrc-2022Q4-base:1.4 pkgsrc-2022Q3:1.4.0.126 pkgsrc-2022Q3-base:1.4 pkgsrc-2022Q2:1.4.0.124 pkgsrc-2022Q2-base:1.4 pkgsrc-2022Q1:1.4.0.122 pkgsrc-2022Q1-base:1.4 pkgsrc-2021Q4:1.4.0.120 pkgsrc-2021Q4-base:1.4 pkgsrc-2021Q3:1.4.0.118 pkgsrc-2021Q3-base:1.4 pkgsrc-2021Q2:1.4.0.116 pkgsrc-2021Q2-base:1.4 pkgsrc-2021Q1:1.4.0.114 pkgsrc-2021Q1-base:1.4 pkgsrc-2020Q4:1.4.0.112 pkgsrc-2020Q4-base:1.4 pkgsrc-2020Q3:1.4.0.110 pkgsrc-2020Q3-base:1.4 pkgsrc-2020Q2:1.4.0.106 pkgsrc-2020Q2-base:1.4 pkgsrc-2020Q1:1.4.0.86 pkgsrc-2020Q1-base:1.4 pkgsrc-2019Q4:1.4.0.108 pkgsrc-2019Q4-base:1.4 pkgsrc-2019Q3:1.4.0.104 pkgsrc-2019Q3-base:1.4 pkgsrc-2019Q2:1.4.0.102 pkgsrc-2019Q2-base:1.4 pkgsrc-2019Q1:1.4.0.100 pkgsrc-2019Q1-base:1.4 pkgsrc-2018Q4:1.4.0.98 pkgsrc-2018Q4-base:1.4 pkgsrc-2018Q3:1.4.0.96 pkgsrc-2018Q3-base:1.4 pkgsrc-2018Q2:1.4.0.94 pkgsrc-2018Q2-base:1.4 pkgsrc-2018Q1:1.4.0.92 pkgsrc-2018Q1-base:1.4 pkgsrc-2017Q4:1.4.0.90 pkgsrc-2017Q4-base:1.4 pkgsrc-2017Q3:1.4.0.88 pkgsrc-2017Q3-base:1.4 pkgsrc-2017Q2:1.4.0.84 pkgsrc-2017Q2-base:1.4 pkgsrc-2017Q1:1.4.0.82 pkgsrc-2017Q1-base:1.4 pkgsrc-2016Q4:1.4.0.80 pkgsrc-2016Q4-base:1.4 pkgsrc-2016Q3:1.4.0.78 pkgsrc-2016Q3-base:1.4 pkgsrc-2016Q2:1.4.0.76 pkgsrc-2016Q2-base:1.4 pkgsrc-2016Q1:1.4.0.74 pkgsrc-2016Q1-base:1.4 pkgsrc-2015Q4:1.4.0.72 pkgsrc-2015Q4-base:1.4 pkgsrc-2015Q3:1.4.0.70 pkgsrc-2015Q3-base:1.4 pkgsrc-2015Q2:1.4.0.68 pkgsrc-2015Q2-base:1.4 pkgsrc-2015Q1:1.4.0.66 pkgsrc-2015Q1-base:1.4 pkgsrc-2014Q4:1.4.0.64 pkgsrc-2014Q4-base:1.4 pkgsrc-2014Q3:1.4.0.62 pkgsrc-2014Q3-base:1.4 pkgsrc-2014Q2:1.4.0.60 pkgsrc-2014Q2-base:1.4 pkgsrc-2014Q1:1.4.0.58 pkgsrc-2014Q1-base:1.4 pkgsrc-2013Q4:1.4.0.56 pkgsrc-2013Q4-base:1.4 pkgsrc-2013Q3:1.4.0.54 pkgsrc-2013Q3-base:1.4 pkgsrc-2013Q2:1.4.0.52 pkgsrc-2013Q2-base:1.4 pkgsrc-2013Q1:1.4.0.50 pkgsrc-2013Q1-base:1.4 pkgsrc-2012Q4:1.4.0.48 pkgsrc-2012Q4-base:1.4 pkgsrc-2012Q3:1.4.0.46 pkgsrc-2012Q3-base:1.4 pkgsrc-2012Q2:1.4.0.44 pkgsrc-2012Q2-base:1.4 pkgsrc-2012Q1:1.4.0.42 pkgsrc-2012Q1-base:1.4 pkgsrc-2011Q4:1.4.0.40 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q3:1.4.0.38 pkgsrc-2011Q3-base:1.4 pkgsrc-2011Q2:1.4.0.36 pkgsrc-2011Q2-base:1.4 pkgsrc-2011Q1:1.4.0.34 pkgsrc-2011Q1-base:1.4 pkgsrc-2010Q4:1.4.0.32 pkgsrc-2010Q4-base:1.4 pkgsrc-2010Q3:1.4.0.30 pkgsrc-2010Q3-base:1.4 pkgsrc-2010Q2:1.4.0.28 pkgsrc-2010Q2-base:1.4 pkgsrc-2010Q1:1.4.0.26 pkgsrc-2010Q1-base:1.4 pkgsrc-2009Q4:1.4.0.24 pkgsrc-2009Q4-base:1.4 pkgsrc-2009Q3:1.4.0.22 pkgsrc-2009Q3-base:1.4 pkgsrc-2009Q2:1.4.0.20 pkgsrc-2009Q2-base:1.4 pkgsrc-2009Q1:1.4.0.18 pkgsrc-2009Q1-base:1.4 pkgsrc-2008Q4:1.4.0.16 pkgsrc-2008Q4-base:1.4 pkgsrc-2008Q3:1.4.0.14 pkgsrc-2008Q3-base:1.4 cube-native-xorg:1.4.0.12 cube-native-xorg-base:1.4 pkgsrc-2008Q2:1.4.0.10 pkgsrc-2008Q2-base:1.4 cwrapper:1.4.0.8 pkgsrc-2008Q1:1.4.0.6 pkgsrc-2008Q1-base:1.4 pkgsrc-2007Q4:1.4.0.4 pkgsrc-2007Q4-base:1.4 pkgsrc-2007Q3:1.4.0.2 pkgsrc-2007Q3-base:1.4 pkgsrc-2007Q2:1.2.0.22 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.20 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.18 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.16 pkgsrc-2006Q3-base:1.2 pkgsrc-2006Q2:1.2.0.14 pkgsrc-2006Q2-base:1.2 pkgsrc-2006Q1:1.2.0.12 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.2.0.10 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.2.0.8 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.6 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.2.0.4 pkgsrc-2005Q1-base:1.2 pkgsrc-2004Q4:1.2.0.2 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.1.1.1.0.6 pkgsrc-2004Q3-base:1.1.1.1 pkgsrc-2004Q2:1.1.1.1.0.4 pkgsrc-2004Q2-base:1.1.1.1 pkgsrc-2004Q1:1.1.1.1.0.2 pkgsrc-2004Q1-base:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.4 date 2007.09.29.11.35.11; author rillig; state Exp; branches; next 1.3; 1.3 date 2007.09.29.11.31.09; author rillig; state Exp; branches; next 1.2; 1.2 date 2004.12.03.13.02.18; author wiz; state Exp; branches; next 1.1; 1.1 date 2004.02.27.02.58.06; author snj; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.02.27.02.58.06; author snj; state Exp; branches; next ; desc @@ 1.4 log @Oops, I didn't want to touch patch-ab. @ text @$NetBSD: patch-ab,v 1.2 2004/12/03 13:02:18 wiz Exp $ --- src/linux/main_linux.c.orig Sat May 1 16:53:54 2004 +++ src/linux/main_linux.c Thu Dec 2 01:58:01 2004 @@@@ -3,6 +3,7 @@@@ UNIX systems */ #include +#include #include #include #include @@@@ -342,12 +343,59 @@@@ static void printsonginfo(int current_frame, int total_frames, int limited) { /*Why not printf directly? Our termios hijinks for input kills the output*/ + + /* + * Once again, the termios hijinks cause trouble for NetBSD. \r + * sometimes doesn't get printed. Following is a mostly complete + * rewrite of the text output section as presented in my NetBSD + * pkgsrc package for version 1.92i-mls. The fix was suggested by + * Bruce J.A. Nourish. I'm David Griffith. + */ + char *hi = (char *)malloc(255); char blank[82]; memset(blank, ' ', 80); blank[80] = '\r'; blank[81] = '\0'; + if (total_frames !=0) { + if (limited) { + snprintf(hi, 254, "\rPlaying track %d of %d, channels %c%c%c%c%c%c, %d/%d seconds, %d/%d frames\r", + nsf->current_song, nsf->num_songs, + enabled[0]?'1':'-', enabled[1]?'2':'-', + enabled[2]?'3':'-', enabled[3]?'4':'-', + enabled[4]?'5':'-', enabled[5]?'6':'-', + (int)((float)(current_frame + nsf->playback_rate - 1)/(float)nsf->playback_rate), + (int)((float)(total_frames + nsf->playback_rate - 1)/(float)nsf->playback_rate), + current_frame, + total_frames); + } else { + snprintf(hi, 254, "\rPlaying track %d of %d, channels %c%c%c%c%c%c, %d/? seconds, %d/? frames\r", + nsf->current_song, nsf->num_songs, + enabled[0]?'1':'-', enabled[1]?'2':'-', + enabled[2]?'3':'-', enabled[3]?'4':'-', + enabled[4]?'5':'-', enabled[5]?'6':'-', + (int)((float)(current_frame + nsf->playback_rate - 1)/(float)nsf->playback_rate), + current_frame); + } + } else { + snprintf(hi, 254, "\rPlaying track %d of %d, channels %c%c%c%c%c%c, %d seconds, %d frames\r", + nsf->current_song, nsf->num_songs, + enabled[0]?'1':'-', enabled[1]?'2':'-', + enabled[2]?'3':'-', enabled[3]?'4':'-', + enabled[4]?'5':'-', enabled[5]?'6':'-', + (int)((float)(current_frame + nsf->playback_rate - 1)/(float)nsf->playback_rate), + current_frame); + } + + +/* + * Not only does the following section do funny things to terminals, + * it's a good example of how to use the trinary operator to make your + * code very hard to understand. Please don't use the trinary operator + * when if-then-else will do. + */ +#ifdef __REALLY_BIG_COMMENT__ snprintf(hi, 254, total_frames != 0 ? "Playing track %d/%d, channels %c%c%c%c%c%c, %d/%d sec, %d/%d frames\r": @@@@ -363,9 +411,16 @@@@ current_frame, total_frames ); +#endif /* __REALLY_BIG_COMMENT__ */ + +/* + * I'm not sure what this is supposed to do. Under NetBSD it garbles + * the screen, but not to the degree as the above commented-out code. +/* if(!(current_frame%10)) write(STDOUT_FILENO, (void *)blank, strlen(blank)); +*/ write(STDOUT_FILENO, (void *)hi, strlen(hi)); free(hi); @ 1.3 log @Fixed gcc 4 error message. @ text @d3 2 a4 2 --- src/linux/main_linux.c.orig 2004-05-02 01:53:54.000000000 +0200 +++ src/linux/main_linux.c 2007-09-29 13:23:40.000000000 +0200 d13 1 a13 26 @@@@ -218,12 +219,12 @@@@ static void open_hardware(const char *de exit(1); } } - /* if it's not a char device and it's not /dev/dsp */ - /* The second check is because when run with esddsp, /dev/dsp + /* if it's not a char device and it's not /dev/sound */ + /* The second check is because when run with esddsp, /dev/sound doesn't show up as a char device. The original author (Matthew Conte) seems to have thought that esddsp should work without this hack. Is doing this bad? --Matthew Strait */ - if( !S_ISCHR(status.st_mode) && strcmp("/dev/dsp", device)) + if( !S_ISCHR(status.st_mode) && strcmp("/dev/sound", device)) { printf("%s is not a character device.\n", device); exit(1); @@@@ -305,7 +306,7 @@@@ static void show_help(void) printf("\t-h \tHelp\n"); printf("\t-v \tVersion information\n"); printf("\n\t-t x\tStart playing track x (default: 1)\n"); - printf("\n\t-d x\tUse device x (default: /dev/dsp)\n"); + printf("\n\t-d x\tUse device x (default: /dev/sound)\n"); printf("\t-s x\tPlay at x times the normal speed.\n"); printf("\t-f x\tUse x sampling rate (default: 44100)\n"); printf("\t-l x\tLimit total playing time to x seconds (0 = unlimited)\n"); @@@@ -342,12 +343,59 @@@@ static void show_info(void) d73 1 a73 1 @@@@ -363,9 +411,16 @@@@ static void printsonginfo(int current_fr a89 9 @@@@ -565,7 +620,7 @@@@ static void close_nsf_file(void) /* HAS ROOT PERMISSIONS -- BE CAREFUL */ int main(int argc, char **argv) { - char *device = "/dev/dsp"; + char *device = "/dev/sound"; char *filename; int track = 1; int done = 0; @ 1.2 log @Update to 2.3, provided by David Griffith in private mail. 2.3-mls (12 Aug 2004) Updated winamp plugin, thanks to K`rai. 2.2-mls (1 May 2004) Added README.cl-amp (taken from Eli's page). Added a fflush to nosefart for the benifit of gnosefart. 2.1-mls (23 April 2004) gnosefart updated to 1.0. 2.0-mls (16 April 2004) Added gnosefart 0.9, a GTK frontend for nosefart. Decided to be more confident about my version numbering. Nosefart now returns 0 if nothing went wrong. 1.92k-mls (4 April 2004) Fixed a bug in the UI that made it not refresh properly. Improved spec file. 1.92j-mls (21 March 2004) A few small tweaks to nsfinfo and the interface. Added spec file for building RPMs. @ text @d1 1 a1 1 $NetBSD$ d3 2 a4 2 --- src/linux/main_linux.c.orig Sat May 1 16:53:54 2004 +++ src/linux/main_linux.c Thu Dec 2 01:58:01 2004 d13 26 a38 1 @@@@ -342,12 +343,59 @@@@ d98 1 a98 1 @@@@ -363,9 +411,16 @@@@ d115 9 @ 1.1 log @Initial revision @ text @d3 2 a4 2 --- src/linux/main_linux.c.orig 2003-10-22 18:31:57.000000000 +0200 +++ src/linux/main_linux.c d13 3 a15 1 @@@@ -234,6 +235,50 @@@@ static void printsonginfo(int current_fr a16 2 char *hi = (char *)malloc(255); d19 5 a23 4 + * The new hijinks seem to cause trouble for NetBSD (\r sometimes + * doesn't get printed), so I'm adding \r to the beginning of these + * strings. Suggested by Bruce J.A Nourish, implemented by David + * Griffith. d26 6 d47 15 a61 15 + + enabled[2]?'3':'-', enabled[3]?'4':'-', + enabled[4]?'5':'-', enabled[5]?'6':'-', + (int)((float)(current_frame + nsf->playback_rate - 1)/(float)nsf->playback_rate), + current_frame); + } + } else { + snprintf(hi, 254, "\rPlaying track %d of %d, channels %c%c%c%c%c%c, %d seconds, %d frames\r", + nsf->current_song, nsf->num_songs, + enabled[0]?'1':'-', enabled[1]?'2':'-', + enabled[2]?'3':'-', enabled[3]?'4':'-', + enabled[4]?'5':'-', enabled[5]?'6':'-', + (int)((float)(current_frame + nsf->playback_rate - 1)/(float)nsf->playback_rate), + current_frame); + } d64 4 a67 1 + * This stuff doesn't seem to work. d69 1 a69 2 + +/* d72 2 a73 2 "Playing track %d of %d, channels %c%c%c%c%c%c, %d/%d seconds, %d/%d frames\r": @@@@ -249,7 +294,7 @@@@ static void printsonginfo(int current_fr d77 9 a85 1 - d87 1 a89 1 } @ 1.1.1.1 log @Initial import of nosefart, an NSF (NES (8-bit Nintendo) Sound Format) player. Packaged by David Griffith, modified by wiz@@ and me. @ text @@