aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
Diffstat (limited to 'audio')
-rw-r--r--audio/xmms-nsf/Makefile3
-rw-r--r--audio/xmms-nsf/files/patch-src__nes__audiosys.c34
-rw-r--r--audio/xmms-nsf/files/patch-src__nes__audiosys.h11
-rw-r--r--audio/xmms-nsf/files/patch-src__nes__handler.c (renamed from audio/xmms-nsf/files/patch-src-nes-handler.c)4
-rw-r--r--audio/xmms-nsf/files/patch-src__nes__km6502__km6502cd.h (renamed from audio/xmms-nsf/files/patch-src-nes-km6502-km6502cd.h)4
-rw-r--r--audio/xmms-nsf/files/patch-src__nes__km6502__km6502ot.h (renamed from audio/xmms-nsf/files/patch-src-nes-km6502-km6502ot.h)4
-rw-r--r--audio/xmms-nsf/files/patch-src__xmms__callbacks.c20
-rw-r--r--audio/xmms-nsf/files/patch-src__xmms__interface.c11
-rw-r--r--audio/xmms-nsf/files/patch-src__xmms__nsf.c85
-rw-r--r--audio/xmms-nsf/files/patch-src__xmms__nsf.h11
-rw-r--r--audio/xmms-nsf/files/patch-src__xmms__nsflib.h15
11 files changed, 195 insertions, 7 deletions
diff --git a/audio/xmms-nsf/Makefile b/audio/xmms-nsf/Makefile
index 3111da8fc2fe..4cd18098331e 100644
--- a/audio/xmms-nsf/Makefile
+++ b/audio/xmms-nsf/Makefile
@@ -7,7 +7,7 @@
PORTNAME= xmms-nsf
PORTVERSION= 0.0.3
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= audio
MASTER_SITES= http://optronic.sourceforge.net/files/ \
http://critical.ch/distfiles/ \
@@ -21,6 +21,7 @@ RUN_DEPENDS= xmms:${PORTSDIR}/multimedia/xmms
GNU_CONFIGURE= yes
USE_X_PREFIX= yes
+USE_LDCONFIG= yes
ONLY_FOR_ARCHS= i386 amd64
diff --git a/audio/xmms-nsf/files/patch-src__nes__audiosys.c b/audio/xmms-nsf/files/patch-src__nes__audiosys.c
new file mode 100644
index 000000000000..17b39688c636
--- /dev/null
+++ b/audio/xmms-nsf/files/patch-src__nes__audiosys.c
@@ -0,0 +1,34 @@
+--- ./src/nes/audiosys.c.orig Sun Jan 7 05:17:57 2001
++++ ./src/nes/audiosys.c Wed Jan 10 20:10:34 2007
+@@ -8,8 +8,11 @@
+
+ static NES_AUDIO_HANDLER *nah = 0;
+ static NES_VOLUME_HANDLER *nvh = 0;
+-void NESAudioRender(Int16 *bufp, Uint buflen)
++Uint32 NESAudioRender(Int16 *bufp, Uint buflen)
+ {
++ Int16 x;
++ Uint32 count = 0;
++
+ while (buflen--)
+ {
+ NES_AUDIO_HANDLER *ph;
+@@ -31,9 +34,17 @@
+ else
+ output = accum;
+ output >>= 8;
+- *bufp++ = ((Int32)output) - 0x8000;
++ x = ((Int32)output) - 0x8000;
++ if (abs(x) < 96)
++ count++;
++ else
++ count = 0;
++
++ *bufp++ = x;
+ }
+ }
++
++ return count;
+ }
+
+ void NESVolume(Uint volume)
diff --git a/audio/xmms-nsf/files/patch-src__nes__audiosys.h b/audio/xmms-nsf/files/patch-src__nes__audiosys.h
new file mode 100644
index 000000000000..396adb8183f0
--- /dev/null
+++ b/audio/xmms-nsf/files/patch-src__nes__audiosys.h
@@ -0,0 +1,11 @@
+--- ./src/nes/audiosys.h.orig Sun Jan 7 05:17:56 2001
++++ ./src/nes/audiosys.h Wed Jan 10 20:10:34 2007
+@@ -21,7 +21,7 @@
+ } NES_VOLUME_HANDLER;
+
+
+-void NESAudioRender(Int16 *bufp, Uint buflen);
++Uint32 NESAudioRender(Int16 *bufp, Uint buflen);
+ void NESAudioHandlerInstall(NES_AUDIO_HANDLER *ph);
+ void NESAudioFrequencySet(Uint freq);
+ Uint NESAudioFrequencyGet(void);
diff --git a/audio/xmms-nsf/files/patch-src-nes-handler.c b/audio/xmms-nsf/files/patch-src__nes__handler.c
index 093d68df3402..8c28ac55d005 100644
--- a/audio/xmms-nsf/files/patch-src-nes-handler.c
+++ b/audio/xmms-nsf/files/patch-src__nes__handler.c
@@ -1,5 +1,5 @@
---- src/nes/handler.c.orig Sun Jan 7 05:17:57 2001
-+++ src/nes/handler.c Thu Aug 18 16:47:01 2005
+--- ./src/nes/handler.c.orig Sun Jan 7 05:17:57 2001
++++ ./src/nes/handler.c Wed Jan 10 20:10:34 2007
@@ -10,9 +10,9 @@
static NES_READ_HANDLER *(nprh[0x10]) = { 0, };
static NES_WRITE_HANDLER *(npwh[0x10]) = { 0, };
diff --git a/audio/xmms-nsf/files/patch-src-nes-km6502-km6502cd.h b/audio/xmms-nsf/files/patch-src__nes__km6502__km6502cd.h
index 577908f99da3..7dd3d0c0053c 100644
--- a/audio/xmms-nsf/files/patch-src-nes-km6502-km6502cd.h
+++ b/audio/xmms-nsf/files/patch-src__nes__km6502__km6502cd.h
@@ -1,5 +1,5 @@
---- src/nes/km6502/km6502cd.h.orig Sun Jan 7 05:18:05 2001
-+++ src/nes/km6502/km6502cd.h Thu Aug 18 16:47:34 2005
+--- ./src/nes/km6502/km6502cd.h.orig Sun Jan 7 05:18:05 2001
++++ ./src/nes/km6502/km6502cd.h Wed Jan 10 20:10:34 2007
@@ -361,27 +361,27 @@
/* --- ADC --- */
diff --git a/audio/xmms-nsf/files/patch-src-nes-km6502-km6502ot.h b/audio/xmms-nsf/files/patch-src__nes__km6502__km6502ot.h
index 84a16c209e5a..2c4cfc1376cf 100644
--- a/audio/xmms-nsf/files/patch-src-nes-km6502-km6502ot.h
+++ b/audio/xmms-nsf/files/patch-src__nes__km6502__km6502ot.h
@@ -1,5 +1,5 @@
---- src/nes/km6502/km6502ot.h.orig Sun Jan 7 05:18:05 2001
-+++ src/nes/km6502/km6502ot.h Thu Aug 18 16:47:59 2005
+--- ./src/nes/km6502/km6502ot.h.orig Sun Jan 7 05:18:05 2001
++++ ./src/nes/km6502/km6502ot.h Wed Jan 10 20:10:34 2007
@@ -1,35 +1,35 @@
#define OPxx(i)
#define OP__(i) \
diff --git a/audio/xmms-nsf/files/patch-src__xmms__callbacks.c b/audio/xmms-nsf/files/patch-src__xmms__callbacks.c
new file mode 100644
index 000000000000..b9f94ed7ac6c
--- /dev/null
+++ b/audio/xmms-nsf/files/patch-src__xmms__callbacks.c
@@ -0,0 +1,20 @@
+--- ./src/xmms/callbacks.c.orig Sun Jul 23 12:06:43 2000
++++ ./src/xmms/callbacks.c Wed Jan 10 20:10:34 2007
+@@ -219,7 +219,7 @@
+ widget = lookup_widget(GTK_WIDGET(button), "spinbutton1");
+ nsf_cfg.play_time = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
+ widget = lookup_widget(GTK_WIDGET(button), "spinbutton2");
+- nsf_cfg.fadeout_time = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
++ nsf_cfg.silence_time = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
+
+ filename = g_strconcat(g_get_home_dir(), "/.xmms/config", NULL);
+ cfg = xmms_cfg_open_file(filename);
+@@ -228,7 +228,7 @@
+ }
+
+ xmms_cfg_write_int(cfg, "NSF", "play_time",nsf_cfg.play_time);
+- xmms_cfg_write_int(cfg, "NSF", "fadeout_time",nsf_cfg.fadeout_time);
++ xmms_cfg_write_int(cfg, "NSF", "silence_time",nsf_cfg.silence_time);
+ xmms_cfg_write_file(cfg, filename);
+ xmms_cfg_free(cfg);
+ g_free(filename);
diff --git a/audio/xmms-nsf/files/patch-src__xmms__interface.c b/audio/xmms-nsf/files/patch-src__xmms__interface.c
new file mode 100644
index 000000000000..010a64d54b24
--- /dev/null
+++ b/audio/xmms-nsf/files/patch-src__xmms__interface.c
@@ -0,0 +1,11 @@
+--- ./src/xmms/interface.c.orig Sun Jul 23 11:41:14 2000
++++ ./src/xmms/interface.c Wed Jan 10 20:10:34 2007
+@@ -106,7 +106,7 @@
+ gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
+ gtk_misc_set_alignment (GTK_MISC (label2), 0, 0.5);
+
+- label3 = gtk_label_new ("Fadeout Time:");
++ label3 = gtk_label_new ("Silence Until Next Song:");
+ gtk_widget_ref (label3);
+ gtk_object_set_data_full (GTK_OBJECT (configure), "label3", label3,
+ (GtkDestroyNotify) gtk_widget_unref);
diff --git a/audio/xmms-nsf/files/patch-src__xmms__nsf.c b/audio/xmms-nsf/files/patch-src__xmms__nsf.c
new file mode 100644
index 000000000000..23a166e77a4f
--- /dev/null
+++ b/audio/xmms-nsf/files/patch-src__xmms__nsf.c
@@ -0,0 +1,85 @@
+--- ./src/xmms/nsf.c.orig Sun Jan 7 06:15:12 2001
++++ ./src/xmms/nsf.c Wed Jan 10 20:13:26 2007
+@@ -23,7 +23,8 @@
+
+ #define VERSION "0.0.3"
+ #define PLAYTIME 30
+-#define FADEOUTTIME 5
++#define SILENCETIME 5
++#define FREQ 44100
+
+ #include "nsf.h"
+
+@@ -328,7 +329,7 @@
+ widget = lookup_widget(nsf_configure_win, "spinbutton1");
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), nsf_cfg.play_time);
+ widget = lookup_widget(nsf_configure_win, "spinbutton2");
+- gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), nsf_cfg.fadeout_time);
++ gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), nsf_cfg.silence_time);
+
+ gtk_widget_show(nsf_configure_win);
+ }else{
+@@ -357,7 +358,7 @@
+ nsf_win->dock_window_list = NULL;
+
+ nsf_cfg.play_time = PLAYTIME; /* second */
+- nsf_cfg.fadeout_time = FADEOUTTIME; /* second */
++ nsf_cfg.silence_time = SILENCETIME; /* second */
+ nsf_cfg.player_shaded = FALSE;
+ nsf_cfg.easy_move = FALSE;
+
+@@ -365,7 +366,7 @@
+
+ if ((cfg = xmms_cfg_open_file(filename)) != 0){
+ xmms_cfg_read_int(cfg, "NSF", "play_time", &nsf_cfg.play_time);
+- xmms_cfg_read_int(cfg, "NSF", "fadeout_time", &nsf_cfg.fadeout_time);
++ xmms_cfg_read_int(cfg, "NSF", "silence_time", &nsf_cfg.silence_time);
+ xmms_cfg_free(cfg);
+ }
+ }
+@@ -439,10 +440,11 @@
+ {
+ char data[2048 * 2];
+ int bytes, blk_size, rate;
++ Uint32 c = 0, count = 0;
+
+ //setting NSF
+ NSFSetSongNo(nsf_file->current_song);
+- NESAudioFrequencySet(44100);
++ NESAudioFrequencySet(FREQ);
+ NESReset();
+
+ //16bit/8bit * 1channel * 512 sample = 1024byte
+@@ -460,7 +462,15 @@
+ }
+ if (bytes > 0){
+ //read 1024byte = 512 sample * 2byte
+- NESAudioRender(data, bytes/2);
++ c = NESAudioRender((Int16*)data, bytes/2);
++ if (c < 512)
++ count = 0;
++ else
++ count += c;
++ if (count > FREQ*nsf_cfg.silence_time) {
++ nsf_file->eos = 1;
++ count = 0;
++ }
+ nsf_ip.add_vis_pcm(nsf_ip.output->written_time(), (nsf_file->bits_per_sample == 16) ? FMT_S16_LE : FMT_U8,
+ nsf_file->channels, bytes, data);
+
+@@ -512,11 +522,14 @@
+ if (!(nsf_file->file = fopen(filename, "rb"))){
+ return;
+ }
++
++ nsf_about();
++
+ fseek(nsf_file->file, 0, SEEK_END);
+ count = ftell(nsf_file->file);
+ fseek(nsf_file->file, 0, SEEK_SET);
+
+- (void*)buffer = g_malloc0(count);
++ buffer = (void*)g_malloc0(count);
+ for(i=0;i<count;i++){
+ *(buffer+i) = fgetc(nsf_file->file);
+ }
diff --git a/audio/xmms-nsf/files/patch-src__xmms__nsf.h b/audio/xmms-nsf/files/patch-src__xmms__nsf.h
new file mode 100644
index 000000000000..e67712d5a676
--- /dev/null
+++ b/audio/xmms-nsf/files/patch-src__xmms__nsf.h
@@ -0,0 +1,11 @@
+--- ./src/xmms/nsf.h.orig Sun Jul 23 12:00:35 2000
++++ ./src/xmms/nsf.h Wed Jan 10 20:10:34 2007
+@@ -58,7 +58,7 @@
+ typedef struct
+ {
+ gint play_time;
+- gint fadeout_time;
++ gint silence_time;
+ // reserve
+ gint resolution;
+ gint channels;
diff --git a/audio/xmms-nsf/files/patch-src__xmms__nsflib.h b/audio/xmms-nsf/files/patch-src__xmms__nsflib.h
new file mode 100644
index 000000000000..548c7eb55c1a
--- /dev/null
+++ b/audio/xmms-nsf/files/patch-src__xmms__nsflib.h
@@ -0,0 +1,15 @@
+--- ./src/xmms/nsflib.h.orig Sun Jul 23 12:05:21 2000
++++ ./src/xmms/nsflib.h Wed Jan 10 20:10:34 2007
+@@ -1,10 +1,11 @@
+ typedef signed short Int16;
+ typedef unsigned int Uint;
++typedef unsigned int Uint32;
+ typedef unsigned char Uint8;
+
+ Uint NSFLoad(Uint8 *pData, Uint uSize);
+ void NSFSetSongNo(Uint uSongNo);
+ void NESAudioFrequencySet(Uint freq);
+ void NESReset(void);
+-void NESAudioRender(Int16 *bufp, Uint buflen);
++Uint32 NESAudioRender(Int16 *bufp, Uint buflen);
+ void NESTerminate(void);