diff options
author | stas <stas@FreeBSD.org> | 2008-04-13 16:16:47 +0800 |
---|---|---|
committer | stas <stas@FreeBSD.org> | 2008-04-13 16:16:47 +0800 |
commit | 40bffdd684410f55aca94265654b3e5ac29869b0 (patch) | |
tree | 4a7561e0a33d1dfa8ba23ec4492a78b8993f7acb /audio | |
parent | cb9c663b1fe5d4127f20f4a776541e4387b6d4e1 (diff) | |
download | freebsd-ports-gnome-40bffdd684410f55aca94265654b3e5ac29869b0.tar.gz freebsd-ports-gnome-40bffdd684410f55aca94265654b3e5ac29869b0.tar.zst freebsd-ports-gnome-40bffdd684410f55aca94265654b3e5ac29869b0.zip |
- Fix master site (project home page died, use my mirror instead)
- add mplayer support [1]
- use TMPDIR instead of hardcoded value [1]
- add check for possible race conditions with pipes [1]
- bump portrevision.
PR: ports/122142 [1]
Submitted by: Paul B. Mahol <onemda@gmail.com>
Diffstat (limited to 'audio')
-rw-r--r-- | audio/cplay/Makefile | 4 | ||||
-rw-r--r-- | audio/cplay/files/patch-cplay | 135 | ||||
-rw-r--r-- | audio/cplay/pkg-descr | 14 | ||||
-rw-r--r-- | audio/cplay/pkg-message | 10 |
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 * +* * ********************************************************************* |