aboutsummaryrefslogtreecommitdiff
path: root/audio/xmms-imms
diff options
context:
space:
mode:
authorBrian Feldman <green@FreeBSD.org>2004-02-12 01:42:22 +0000
committerBrian Feldman <green@FreeBSD.org>2004-02-12 01:42:22 +0000
commit9a9e76725aab77d31f446abadd862ce245cf40ee (patch)
tree15bb5b12ea9834725a3c4234d0dc81bd4024d59e /audio/xmms-imms
parent9950dbb3aea5d52ce69ecae72e0d19d2d178825e (diff)
downloadports-9a9e76725aab77d31f446abadd862ce245cf40ee.tar.gz
ports-9a9e76725aab77d31f446abadd862ce245cf40ee.zip
Add xmms-imms 1.0. IMMS is an XMMS plugin which replaces the standard
shuffle function with a smarter, weighted shuffle function based on how often you play/skip files and their sound contents. Development Status: 4 - Beta
Notes
Notes: svn path=/head/; revision=100734
Diffstat (limited to 'audio/xmms-imms')
-rw-r--r--audio/xmms-imms/Makefile35
-rw-r--r--audio/xmms-imms/distinfo1
-rw-r--r--audio/xmms-imms/files/patch-fetcher.cc17
-rw-r--r--audio/xmms-imms/files/patch-imms.cc34
-rw-r--r--audio/xmms-imms/files/patch-picker.cc24
-rw-r--r--audio/xmms-imms/files/patch-plugin.cc55
-rw-r--r--audio/xmms-imms/files/patch-plugin.h14
-rw-r--r--audio/xmms-imms/files/patch-rules.mk11
-rw-r--r--audio/xmms-imms/files/patch-spectrum.h14
-rw-r--r--audio/xmms-imms/files/patch-vars.mk.in19
-rw-r--r--audio/xmms-imms/pkg-descr9
-rw-r--r--audio/xmms-imms/pkg-plist1
12 files changed, 234 insertions, 0 deletions
diff --git a/audio/xmms-imms/Makefile b/audio/xmms-imms/Makefile
new file mode 100644
index 000000000000..8f864a6e47a8
--- /dev/null
+++ b/audio/xmms-imms/Makefile
@@ -0,0 +1,35 @@
+# New ports collection makefile for: xmms-imms
+# Date created: Wed Feb 11 17:11:37 EST 2004
+# Whom: Brian Feldman <green@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= imms
+PORTVERSION= 1.0
+CATEGORIES= audio
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= ${PORTNAME}
+PKGNAMEPREFIX= xmms-
+
+MAINTAINER= green@FreeBSD.org
+COMMENT= Automatic, weight-based playlist ordering plugin for XMMS
+
+LIB_DEPENDS= xmms.4:${PORTSDIR}/multimedia/xmms \
+ sqlite.2:${PORTSDIR}/databases/sqlite \
+ pcre.0:${PORTSDIR}/devel/pcre \
+ id3:${PORTSDIR}/audio/id3lib \
+ vorbis.2:${PORTSDIR}/audio/libvorbis
+
+USE_BZIP2= yes
+USE_X_PREFIX= yes
+USE_GNOME= gtk12
+USE_GMAKE= yes
+USE_AUTOCONF= yes
+USE_AUTOHEADER= yes
+WANT_AUTOCONF_VER= 257
+GNU_CONFIGURE= yes
+CONFIGURE_ENV= LIBS="-L${LOCALBASE}/lib" CFLAGS="-I${LOCALBASE}/include"
+INSTALLS_SHLIB= yes
+
+.include <bsd.port.mk>
diff --git a/audio/xmms-imms/distinfo b/audio/xmms-imms/distinfo
new file mode 100644
index 000000000000..213608fd0358
--- /dev/null
+++ b/audio/xmms-imms/distinfo
@@ -0,0 +1 @@
+MD5 (imms-1.0.tar.bz2) = 32b46ac3ae1775a8a5e09273664b5f25
diff --git a/audio/xmms-imms/files/patch-fetcher.cc b/audio/xmms-imms/files/patch-fetcher.cc
new file mode 100644
index 000000000000..502e6257a5b2
--- /dev/null
+++ b/audio/xmms-imms/files/patch-fetcher.cc
@@ -0,0 +1,17 @@
+--- fetcher.cc.orig Sun Jan 25 16:55:21 2004
++++ fetcher.cc Wed Feb 11 18:34:39 2004
+@@ -200,8 +200,12 @@
+ return identified;
+
+ // Erase the first occurrence of the artist
+- list<string>::iterator i = find(file_parts.begin(), file_parts.end(),
+- artist);
++ list<string>::iterator i = file_parts.begin();
++ while (i != file_parts.end()) {
++ if (*i == artist)
++ break;
++ i++;
++ }
+ if (i != file_parts.end())
+ file_parts.erase(i);
+
diff --git a/audio/xmms-imms/files/patch-imms.cc b/audio/xmms-imms/files/patch-imms.cc
new file mode 100644
index 000000000000..1c4779f1f948
--- /dev/null
+++ b/audio/xmms-imms/files/patch-imms.cc
@@ -0,0 +1,34 @@
+--- imms.cc.orig Wed Feb 11 17:47:21 2004
++++ imms.cc Wed Feb 11 18:03:41 2004
+@@ -1,7 +1,6 @@
+ #include <time.h>
+ #include <ctype.h>
+ #include <math.h>
+-#include <stdlib.h> // for (s)random
+
+ #include <iostream>
+ #include <iomanip>
+@@ -43,23 +42,6 @@
+ //////////////////////////////////////////////
+
+ string last_song;
+-
+-// Random
+-int imms_random(int max)
+-{
+- int rand_num;
+- static struct random_data rand_data;
+- static char rand_state[256];
+- static bool initialized = false;
+- if (!initialized)
+- {
+- initstate_r(time(0), rand_state, sizeof(rand_state), &rand_data);
+- initialized = true;
+- }
+- random_r(&rand_data, &rand_num);
+- double cof = rand_num / (RAND_MAX + 1.0);
+- return (int)(max * cof);
+-}
+
+ // Imms
+ Imms::Imms()
diff --git a/audio/xmms-imms/files/patch-picker.cc b/audio/xmms-imms/files/patch-picker.cc
new file mode 100644
index 000000000000..857e9a8dc4f5
--- /dev/null
+++ b/audio/xmms-imms/files/patch-picker.cc
@@ -0,0 +1,24 @@
+--- picker.cc.orig Sun Jan 25 16:55:21 2004
++++ picker.cc Wed Feb 11 18:47:20 2004
+@@ -1,4 +1,5 @@
+ #include <iostream>
++#include <math.h>
+
+ #include "picker.h"
+ #include "strmanip.h"
+@@ -31,9 +32,12 @@
+
+ SongData data(position, path);
+
+- if (find(candidates.begin(), candidates.end(), data)
+- != candidates.end())
+- return true;
++ Candidates::iterator i = candidates.begin();
++ while (i != candidates.end()) {
++ if (*i == data)
++ return true;
++ i++;
++ }
+
+ int cost = fetch_song_info(data);
+
diff --git a/audio/xmms-imms/files/patch-plugin.cc b/audio/xmms-imms/files/patch-plugin.cc
new file mode 100644
index 000000000000..4e841a6693c8
--- /dev/null
+++ b/audio/xmms-imms/files/patch-plugin.cc
@@ -0,0 +1,55 @@
+--- plugin.cc.orig Sun Jan 25 16:55:21 2004
++++ plugin.cc Wed Feb 11 18:51:51 2004
+@@ -5,6 +5,9 @@
+ #include <string>
+ #include <iostream>
+ #include <time.h>
++#include <unistd.h>
++#include <fcntl.h>
++#include <limits.h>
+
+ #include <xmms/plugin.h>
+ #include <xmms/xmmsctrl.h>
+@@ -21,6 +24,7 @@
+
+ // Local vars
+ static Imms *imms = NULL;
++static int urandom = -1;
+ unsigned int time_left = 1000, sloppy_skips = 0;
+ int last_plpos = -2, cur_plpos, pl_length = -1;
+ int good_length = 0, song_length = 0, delay = 0;
+@@ -39,6 +43,15 @@
+ FIND_NEXT = 2
+ } state;
+
++// Random
++int imms_random(int max)
++{
++ unsigned long rand_num;
++ (void)read(urandom, &rand_num, sizeof(rand_num));
++ double cof = rand_num / (ULONG_MAX + 1.0);
++ return (int)(max * cof);
++}
++
+ // Wrapper that frees memory
+ string imms_get_playlist_item(int at)
+ {
+@@ -62,14 +75,17 @@
+
+ void imms_init()
+ {
+- if (!imms)
++ if (!imms) {
+ imms = new Imms();
++ urandom = open("/dev/urandom", O_RDONLY);
++ }
+
+ state = IDLE;
+ }
+
+ void imms_cleanup(void)
+ {
++ close(urandom);
+ delete imms;
+ imms = 0;
+ }
diff --git a/audio/xmms-imms/files/patch-plugin.h b/audio/xmms-imms/files/patch-plugin.h
new file mode 100644
index 000000000000..543834c9d5d0
--- /dev/null
+++ b/audio/xmms-imms/files/patch-plugin.h
@@ -0,0 +1,14 @@
+--- plugin.h.orig Wed Feb 11 17:44:30 2004
++++ plugin.h Wed Feb 11 17:45:06 2004
+@@ -1,7 +1,11 @@
+ #ifndef __PLUGIN_H
+ #define __PLUGIN_H
+
++#if HAVE_STDINT_H
+ #include <stdint.h>
++#else
++#include <sys/types.h>
++#endif
+
+ #ifdef __cplusplus
+ extern "C" {
diff --git a/audio/xmms-imms/files/patch-rules.mk b/audio/xmms-imms/files/patch-rules.mk
new file mode 100644
index 000000000000..40906ef27c7e
--- /dev/null
+++ b/audio/xmms-imms/files/patch-rules.mk
@@ -0,0 +1,11 @@
+--- rules.mk.orig Sun Jan 25 16:55:21 2004
++++ rules.mk Wed Feb 11 18:43:22 2004
+@@ -57,7 +57,7 @@
+ $(warning Use 'make install-user' to install for the current user only.)
+
+ install-system: libimms.so
+- ${INSTALL_PROGRAM} libimms.so ${DESTDIR}`xmms-config --visualization-plugin-dir`
++ ${INSTALL_PROGRAM} libimms.so `xmms-config --visualization-plugin-dir`
+
+ user-message:
+ $(warning Defaulting to installing for current user only.)
diff --git a/audio/xmms-imms/files/patch-spectrum.h b/audio/xmms-imms/files/patch-spectrum.h
new file mode 100644
index 000000000000..75bdc23d775d
--- /dev/null
+++ b/audio/xmms-imms/files/patch-spectrum.h
@@ -0,0 +1,14 @@
+--- spectrum.h.orig Sun Jan 25 16:55:21 2004
++++ spectrum.h Wed Feb 11 17:45:20 2004
+@@ -1,7 +1,11 @@
+ #ifndef __SPECTRUM_H
+ #define __SPECTRUM_H
+
++#if HAVE_STDINT_H
+ #include <stdint.h>
++#else
++#include <sys/types.h>
++#endif
+ #include <time.h>
+ #include <sys/time.h>
+
diff --git a/audio/xmms-imms/files/patch-vars.mk.in b/audio/xmms-imms/files/patch-vars.mk.in
new file mode 100644
index 000000000000..6e85f6c1dbe5
--- /dev/null
+++ b/audio/xmms-imms/files/patch-vars.mk.in
@@ -0,0 +1,19 @@
+--- vars.mk.in.orig Sun Jan 25 16:55:21 2004
++++ vars.mk.in Wed Feb 11 18:40:43 2004
+@@ -4,14 +4,13 @@
+ INSTALL_PROGRAM = @INSTALL@
+ DESTDIR = @prefix@
+
+-SHELL = bash
+ XMMS_OBJ = plugin.o interface.o libimmscore.a
+ CORE_OBJ = imms.o immsdb.o fetcher.o picker.o spectrum.o sqldb.o \
+ songinfo.o regexx.o strmanip.o levenshtein.o xidle.o md5.o
+
+-CFLAGS = `xmms-config --cflags` @DEBUG_CFLAGS@ -Wall -fPIC -D_REENTRANT
++CFLAGS = `xmms-config --cflags` @CFLAGS@ -Wall -fPIC -D_REENTRANT
+ CPPFLAGS = ${CFLAGS} -pedantic -fno-rtti
+-LDFLAGS = `xmms-config --libs` @LIBS@
++LDFLAGS = `xmms-config --libs` -lc @LIBS@
+ ARFLAGS = rs
+
+ default: all
diff --git a/audio/xmms-imms/pkg-descr b/audio/xmms-imms/pkg-descr
new file mode 100644
index 000000000000..12938cd8c850
--- /dev/null
+++ b/audio/xmms-imms/pkg-descr
@@ -0,0 +1,9 @@
+IMMS is an intelligent playlist plug-in for XMMS that tracks your
+listening patterns and dynamically adapts to your taste. It is
+incredibly unobtrusive and easy to use as it requires no direct user
+interaction.
+
+WWW: http://www.luminal.org/wiki/index.php/IMMS/IMMS
+Author: Michael Grigoriev <mag@luminal.org>
+
+- Brian Feldman <green@FreeBSD.org>
diff --git a/audio/xmms-imms/pkg-plist b/audio/xmms-imms/pkg-plist
new file mode 100644
index 000000000000..83d0a34ca14a
--- /dev/null
+++ b/audio/xmms-imms/pkg-plist
@@ -0,0 +1 @@
+lib/xmms/Visualization/libimms.so