aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Sedov <stas@FreeBSD.org>2008-04-13 08:16:47 +0000
committerStanislav Sedov <stas@FreeBSD.org>2008-04-13 08:16:47 +0000
commit33ee604830b0fc84a510e7de5aaf9341f8cdd3a0 (patch)
treed974ecd92a90bb9d1b47b87fcb95cfdef44a7054
parent6098818ed49960dcab9b68b012f0cc99491e75c8 (diff)
downloadports-33ee604830b0fc84a510e7de5aaf9341f8cdd3a0.tar.gz
ports-33ee604830b0fc84a510e7de5aaf9341f8cdd3a0.zip
Notes
-rw-r--r--audio/cplay/Makefile4
-rw-r--r--audio/cplay/files/patch-cplay135
-rw-r--r--audio/cplay/pkg-descr14
-rw-r--r--audio/cplay/pkg-message10
4 files changed, 152 insertions, 11 deletions
diff --git a/audio/cplay/Makefile b/audio/cplay/Makefile
index 0397a746ad0f..70a7ad4e0ae9 100644
--- a/audio/cplay/Makefile
+++ b/audio/cplay/Makefile
@@ -7,9 +7,9 @@
PORTNAME= cplay
PORTVERSION= 1.49
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= audio
-MASTER_SITES= http://mask.tf.hut.fi/~flu/hacks/cplay/
+MASTER_SITES= ftp://ftp.SpringDaemons.com/soft/
MAINTAINER= stas@FreeBSD.org
COMMENT= A curses based front-end for various audio players
diff --git a/audio/cplay/files/patch-cplay b/audio/cplay/files/patch-cplay
new file mode 100644
index 000000000000..e2cd60df74a4
--- /dev/null
+++ b/audio/cplay/files/patch-cplay
@@ -0,0 +1,135 @@
+
+--- cplay.orig 2003-12-05 09:20:56.000000000 +0100
++++ cplay 2008-03-27 00:36:13.000000000 +0100
+@@ -63,7 +63,7 @@
+
+ # ------------------------------------------
+ XTERM = re.search("rxvt|xterm", os.environ["TERM"])
+-CONTROL_FIFO = "/var/tmp/cplay_control"
++CONTROL_FIFO = "%s/cplay-control-%s" % (os.environ.get("TMPDIR", "/tmp"), os.environ["USER"])
+
+ # ------------------------------------------
+ def which(program):
+@@ -906,11 +906,20 @@
+
+ def command_change_viewpoint(self, klass=PlaylistEntry):
+ if not globals().get("ID3"):
++ global ID3, ogg, codecs
++ have_meta = 0
+ try:
+- global ID3, ogg, codecs
+- import ID3, ogg.vorbis, codecs
++ import ID3
++ have_meta = 1
++ except ImportError:
++ pass
++ try:
++ import ogg.vorbis, codecs
++ have_meta = 1
++ except ImportError:
++ pass
++ if have_meta:
+ klass.vps.append([_("metadata"), klass.vp_metadata])
+- except ImportError: pass
+ TagListWindow.command_change_viewpoint(self, klass)
+
+ def get_title(self):
+@@ -962,9 +971,11 @@
+ try:
+ if os.path.isdir(pathname):
+ app.status(_("Working..."))
+- self.add_dir(pathname)
++ self.add_dir(os.path.abspath(pathname))
+ elif VALID_PLAYLIST(pathname):
+ self.add_playlist(pathname)
++ elif os.path.isfile(pathname):
++ self.append(PlaylistEntry(os.path.abspath(pathname)))
+ else:
+ pathname = self.fix_url(pathname)
+ self.append(PlaylistEntry(pathname))
+@@ -1301,6 +1312,17 @@
+ self.set_position(head, head+tail, [head, tail])
+
+ # ------------------------------------------
++class MplayerOffsetPlayer(Player):
++ re_progress = re.compile("(\d+).*\sof (\d+)")
++
++ def parse_buf(self):
++ match = self.re_progress.search(self.buf)
++ if match:
++ s1, s2 = map(string.atoi, match.groups())
++ head, tail = s1, s2-s1
++ self.set_position(head, head+tail, [head,tail])
++
++# ------------------------------------------
+ class NoOffsetPlayer(Player):
+
+ def parse_buf(self):
+@@ -1334,8 +1356,6 @@
+ # ------------------------------------------
+ class FIFOControl:
+ def __init__(self):
+- try: self.fd = open(CONTROL_FIFO, "rb+", 0)
+- except: self.fd = None
+ self.commands = {"pause" : app.toggle_pause,
+ "next" : app.next_song,
+ "prev" : app.prev_song,
+@@ -1346,6 +1366,15 @@
+ "volup" : app.inc_volume,
+ "voldown" : app.dec_volume,
+ "quit" : app.quit}
++ self.fd = None
++ try:
++ if os.path.exists(CONTROL_FIFO):
++ os.unlink(CONTROL_FIFO)
++ os.mkfifo(CONTROL_FIFO, 0600)
++ self.fd = open(CONTROL_FIFO, "rb+", 0)
++ except IOError:
++ # warn that we're disabling the fifo because someone raced us?
++ return
+
+ def handle_command(self):
+ command = string.strip(self.fd.readline())
+@@ -1419,6 +1448,11 @@
+ XTERM and sys.stderr.write("\033]0;%s\a" % "xterm")
+ tty and tty.tcsetattr(sys.stdin.fileno(), tty.TCSADRAIN, self.tcattr)
+ print
++ # remove temporary files
++ try:
++ if os.path.exists(CONTROL_FIFO): os.unlink(CONTROL_FIFO)
++ except IOError:
++ pass
+
+ def run(self):
+ while 1:
+@@ -1615,7 +1649,7 @@
+ if opt == "-v": app.mixer("toggle")
+ if args or playlist:
+ for i in args or playlist:
+- app.win_playlist.add(os.path.abspath(i))
++ app.win_playlist.add(i)
+ app.win_tab.change_window()
+ app.run()
+ except SystemExit:
+@@ -1627,15 +1661,17 @@
+
+ # ------------------------------------------
+ PLAYERS = [
+- FrameOffsetPlayer("ogg123 -q -v -k %d %s", "\.ogg$"),
++ FrameOffsetPlayer("ogg123 -q -v -k %d %s", "\.(ogg|flac)$"),
+ FrameOffsetPlayer("splay -f -k %d %s", "(^http://|\.mp[123]$)", 38.28),
+ FrameOffsetPlayer("mpg123 -q -v -k %d %s", "(^http://|\.mp[123]$)", 38.28),
+ FrameOffsetPlayer("mpg321 -q -v -k %d %s", "(^http://|\.mp[123]$)", 38.28),
+ TimeOffsetPlayer("madplay -v --display-time=remaining -s %d %s", "\.mp[123]$"),
++ MplayerOffsetPlayer("mplayer -vo null -noconsolecontrols -ss %d %s", "\.(mp[123]|ogg|flac|wav|aiff|wma)$"),
+ NoOffsetPlayer("mikmod -q -p0 %s", "\.(mod|xm|fm|s3m|med|col|669|it|mtm)$"),
+ NoOffsetPlayer("xmp -q %s", "\.(mod|xm|fm|s3m|med|col|669|it|mtm|stm)$"),
+ NoOffsetPlayer("play %s", "\.(aiff|au|cdr|mp3|ogg|wav)$"),
+- NoOffsetPlayer("speexdec %s", "\.spx$")
++ NoOffsetPlayer("speexdec %s", "\.spx$"),
++ NoOffsetPlayer("mplayer -noconsolecontrols -playlist %s", "\.(ram|pls|asx)$")
+ ]
+
+ def VALID_SONG(name):
+
+
diff --git a/audio/cplay/pkg-descr b/audio/cplay/pkg-descr
index 26fe3811e5f9..7db430bbdea1 100644
--- a/audio/cplay/pkg-descr
+++ b/audio/cplay/pkg-descr
@@ -1,11 +1,11 @@
cplay is a curses based front-end to various audioplayers.
Supported players currently include:
- - mpg123
- - ogg123
- - madplay
- - mikmod
- - mpg321
- - splay
+- mpg123
+- ogg123
+- madplay
+- mikmod
+- mpg321
+- splay
-WWW: http://www.tf.hut.fi/~flu/cplay/
+Author: Ulf Betlehem <flu@iki.fi>
diff --git a/audio/cplay/pkg-message b/audio/cplay/pkg-message
index 5eba4532bd35..e3bc3296380d 100644
--- a/audio/cplay/pkg-message
+++ b/audio/cplay/pkg-message
@@ -2,6 +2,12 @@
* cplay is a front-end. To use it, you need to install one or more *
* of the following ports (audio players): *
* *
-* audio/mpg123, audio/mpg321, audio/vorbis-tools, audio/mikmod, *
-* audio/mad or audio/splay *
+* audio/mad *
+* audio/mikmod *
+* audio/mpg123 *
+* audio/mpg321 *
+* audio/splay *
+* audio/vorbis-tools *
+* multimedia/mplayer *
+* *
*********************************************************************