diff options
author | Luis Medinas <metalgod@gentoo.org> | 2005-11-09 03:25:02 +0000 |
---|---|---|
committer | Luis Medinas <metalgod@gentoo.org> | 2005-11-09 03:25:02 +0000 |
commit | 7ac78e6521431aa043796b751d4260ad1f5b4ebc (patch) | |
tree | 686b308cba0f72a5f6c2c89a25b1eabc24838d33 /media-plugins/xmms-nsf/files | |
parent | Added ~amd64 keyword. Closes bug #111362. (diff) | |
download | gentoo-2-7ac78e6521431aa043796b751d4260ad1f5b4ebc.tar.gz gentoo-2-7ac78e6521431aa043796b751d4260ad1f5b4ebc.tar.bz2 gentoo-2-7ac78e6521431aa043796b751d4260ad1f5b4ebc.zip |
Added a patch to control window to display when an nsf song is played and change 'Fadeout' option to 'Silence Until Next Song' thanks to <qube99@hotmail.com>.
(Portage version: 2.0.53_rc7)
Diffstat (limited to 'media-plugins/xmms-nsf/files')
-rw-r--r-- | media-plugins/xmms-nsf/files/digest-xmms-nsf-0.0.3-r1 | 1 | ||||
-rw-r--r-- | media-plugins/xmms-nsf/files/xmms-nsf-0.0.3-about.patch | 188 |
2 files changed, 189 insertions, 0 deletions
diff --git a/media-plugins/xmms-nsf/files/digest-xmms-nsf-0.0.3-r1 b/media-plugins/xmms-nsf/files/digest-xmms-nsf-0.0.3-r1 new file mode 100644 index 000000000000..d462c5281aa9 --- /dev/null +++ b/media-plugins/xmms-nsf/files/digest-xmms-nsf-0.0.3-r1 @@ -0,0 +1 @@ +MD5 45c55a17d81cd82d36d59bdb231777df xmms-nsf-0.0.3.tar.gz 185683 diff --git a/media-plugins/xmms-nsf/files/xmms-nsf-0.0.3-about.patch b/media-plugins/xmms-nsf/files/xmms-nsf-0.0.3-about.patch new file mode 100644 index 000000000000..6c32699d977e --- /dev/null +++ b/media-plugins/xmms-nsf/files/xmms-nsf-0.0.3-about.patch @@ -0,0 +1,188 @@ +diff -ur xmms-nsf-0.0.3/src/nes/audiosys.c xmms-nsf-0.0.3.about/src/nes/audiosys.c +--- xmms-nsf-0.0.3/src/nes/audiosys.c 2001-01-06 23:17:57.000000000 -0500 ++++ xmms-nsf-0.0.3.about/src/nes/audiosys.c 2005-01-02 20:34:41.767192374 -0500 +@@ -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 -ur xmms-nsf-0.0.3/src/nes/audiosys.h xmms-nsf-0.0.3.about/src/nes/audiosys.h +--- xmms-nsf-0.0.3/src/nes/audiosys.h 2001-01-06 23:17:56.000000000 -0500 ++++ xmms-nsf-0.0.3.about/src/nes/audiosys.h 2005-01-02 20:42:51.457112634 -0500 +@@ -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 -ur xmms-nsf-0.0.3/src/xmms/callbacks.c xmms-nsf-0.0.3.about/src/xmms/callbacks.c +--- xmms-nsf-0.0.3/src/xmms/callbacks.c 2000-07-23 05:06:43.000000000 -0500 ++++ xmms-nsf-0.0.3.about/src/xmms/callbacks.c 2005-01-02 20:58:29.052175495 -0500 +@@ -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 -ur xmms-nsf-0.0.3/src/xmms/interface.c xmms-nsf-0.0.3.about/src/xmms/interface.c +--- xmms-nsf-0.0.3/src/xmms/interface.c 2000-07-23 04:41:14.000000000 -0500 ++++ xmms-nsf-0.0.3.about/src/xmms/interface.c 2005-01-02 20:55:32.754086347 -0500 +@@ -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 -ur xmms-nsf-0.0.3/src/xmms/nsf.c xmms-nsf-0.0.3.about/src/xmms/nsf.c +--- xmms-nsf-0.0.3/src/xmms/nsf.c 2001-01-07 00:15:12.000000000 -0500 ++++ xmms-nsf-0.0.3.about/src/xmms/nsf.c 2005-01-02 20:58:06.990044841 -0500 +@@ -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(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,6 +522,9 @@ + 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); +diff -ur xmms-nsf-0.0.3/src/xmms/nsf.h xmms-nsf-0.0.3.about/src/xmms/nsf.h +--- xmms-nsf-0.0.3/src/xmms/nsf.h 2000-07-23 05:00:35.000000000 -0500 ++++ xmms-nsf-0.0.3.about/src/xmms/nsf.h 2005-01-02 20:58:37.563297001 -0500 +@@ -58,7 +58,7 @@ + typedef struct + { + gint play_time; +- gint fadeout_time; ++ gint silence_time; + // reserve + gint resolution; + gint channels; +diff -ur xmms-nsf-0.0.3/src/xmms/nsflib.h xmms-nsf-0.0.3.about/src/xmms/nsflib.h +--- xmms-nsf-0.0.3/src/xmms/nsflib.h 2000-07-23 05:05:21.000000000 -0500 ++++ xmms-nsf-0.0.3.about/src/xmms/nsflib.h 2005-01-02 20:45:55.481496508 -0500 +@@ -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); |