aboutsummaryrefslogtreecommitdiffstats
path: root/audio/dcd
diff options
context:
space:
mode:
authorgahr <gahr@FreeBSD.org>2008-06-24 07:24:27 +0800
committergahr <gahr@FreeBSD.org>2008-06-24 07:24:27 +0800
commit6022166c52b9ad9e5c47105ff38965eb834c2de8 (patch)
tree8972a9ff3bd8a05156b819bb9a0d5431af64e64b /audio/dcd
parent527ebf34ce162dee75a818742202a576ccbbb8e5 (diff)
downloadfreebsd-ports-gnome-6022166c52b9ad9e5c47105ff38965eb834c2de8.tar.gz
freebsd-ports-gnome-6022166c52b9ad9e5c47105ff38965eb834c2de8.tar.zst
freebsd-ports-gnome-6022166c52b9ad9e5c47105ff38965eb834c2de8.zip
- Show currently played track time in directory view
Diffstat (limited to 'audio/dcd')
-rw-r--r--audio/dcd/Makefile1
-rw-r--r--audio/dcd/files/patch-libcdplay.c43
-rw-r--r--audio/dcd/files/patch-libcdplay.h12
-rw-r--r--audio/dcd/files/patch-screenop.c18
4 files changed, 48 insertions, 26 deletions
diff --git a/audio/dcd/Makefile b/audio/dcd/Makefile
index 94508e0fc919..d3cfe76f483e 100644
--- a/audio/dcd/Makefile
+++ b/audio/dcd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= dcd
PORTVERSION= 0.99.2
+PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= SF/dcdplayer
diff --git a/audio/dcd/files/patch-libcdplay.c b/audio/dcd/files/patch-libcdplay.c
index 38f805def96a..577c98c4446c 100644
--- a/audio/dcd/files/patch-libcdplay.c
+++ b/audio/dcd/files/patch-libcdplay.c
@@ -1,6 +1,6 @@
--- libcdplay.c.orig 2003-04-10 19:19:44.000000000 +0200
-+++ libcdplay.c 2008-06-20 22:38:39.000000000 +0200
-@@ -1,484 +1,179 @@
++++ libcdplay.c 2008-06-24 01:07:56.000000000 +0200
+@@ -1,484 +1,186 @@
-/* $Revision: 1.4 $ */
-/*
- * This is libcdplay, a Linux-specific CD-ROM playing library.
@@ -505,14 +505,28 @@
+{
+ return (info.disc_track[trknum-1].track_length.frames);
+}
-
--char *cd_discid(void) {
-- return discid;
++
+int
+cd_disc_length(void)
+{
+ return (info.disc_length.minutes * 60 +
+ info.disc_length.seconds);
++}
++
++int
++cd_track_length(u_char trknum)
++{
++ return (info.disc_track[trknum-1].track_length.minutes * 60 +
++ info.disc_track[trknum-1].track_length.seconds);
++}
+
+-char *cd_discid(void) {
+- return discid;
++int
++cd_track_time(void)
++{
++ cd_poll(cd_desc, &status);
++ return (status.status_track_time.minutes * 60 + status.status_track_time.seconds);
}
-static void int_cd_discid (void) {
@@ -568,20 +582,13 @@
- fprintf (stderr, "cd_discid returning %s\n", discid);
- #endif
+int
-+cd_track_length(u_char trknum)
++cd_data_track(u_char trknum)
+{
-+ return (info.disc_track[trknum-1].track_length.minutes * 60 +
-+ info.disc_track[trknum-1].track_length.seconds);
++ return (info.disc_track[trknum-1].track_type == CDAUDIO_TRACK_DATA);
}
-/* there used to be more stuff here, but it's been more-or-less
- subsumed by the musicbrainz crapulence. */
-+int
-+cd_data_track(u_char trknum)
-+{
-+ return (info.disc_track[trknum-1].track_type == CDAUDIO_TRACK_DATA);
-+}
-+
+u_char
+cd_first_track(void)
+{
@@ -593,7 +600,9 @@
+{
+ return (info.disc_total_tracks);
+}
-+
+
+-/* char *cd_discid(void); */
+-/* char *cd_subid(void); */
+int
+cd_active(void)
+{
@@ -627,9 +636,7 @@
+ snprintf(disc_id, sizeof(disc_id), "%0x", cddb_discid(cd_desc));
+ return (disc_id);
+}
-
--/* char *cd_discid(void); */
--/* char *cd_subid(void); */
++
+void
+dcd_stop(void)
+{
diff --git a/audio/dcd/files/patch-libcdplay.h b/audio/dcd/files/patch-libcdplay.h
index c6564b50ef62..ba0eae759963 100644
--- a/audio/dcd/files/patch-libcdplay.h
+++ b/audio/dcd/files/patch-libcdplay.h
@@ -1,5 +1,5 @@
--- libcdplay.h.orig 2003-01-04 03:15:49.000000000 +0100
-+++ libcdplay.h 2008-06-20 22:32:40.000000000 +0200
++++ libcdplay.h 2008-06-24 01:08:06.000000000 +0200
@@ -11,7 +11,8 @@
#define __CD_PLAYER_LIB
@@ -25,7 +25,15 @@
/* Informational operations */
-@@ -45,11 +46,11 @@
+@@ -38,6 +39,7 @@
+ /* rounded to the nearest second */
+ int cd_disc_length (void);
+ int cd_track_length (u_char trknum);
++int cd_track_time (void);
+ int cd_data_track (u_char trknum);
+
+ u_char cd_first_track(void); /* almost always `1' */
+@@ -45,11 +47,11 @@
/* Simple commands. */
diff --git a/audio/dcd/files/patch-screenop.c b/audio/dcd/files/patch-screenop.c
index a7a1f24080b6..4baa6707e224 100644
--- a/audio/dcd/files/patch-screenop.c
+++ b/audio/dcd/files/patch-screenop.c
@@ -1,12 +1,13 @@
--- screenop.c.orig 2003-08-28 01:42:36.000000000 +0200
-+++ screenop.c 2008-06-20 23:06:36.000000000 +0200
-@@ -15,23 +15,27 @@
++++ screenop.c 2008-06-24 01:21:54.000000000 +0200
+@@ -15,23 +15,32 @@
void disk_directory(void) {
u_char ct = cd_current_track();
-+ char *art_name, *trk_name;
- int tl;
+- int tl;
- char outline[80];
++ char *art_name, *trk_name;
++ int tl, tt;
int disc_length = cd_disc_length();
int i;
#ifdef DEBUG
@@ -29,8 +30,13 @@
- i, (tl/60), (tl%60), mbo_trackname(i));
- printf ("%s\n", outline);
+ trk_name = mbo_trackname(i);
-+ printf ("%s %2i %2i:%02i %-45s\n", (i==ct ? "*" : " "),
-+ i, (tl/60), (tl%60), trk_name);
++ if(i == ct && cd_active) {
++ tt = cd_track_time();
++ printf ("* %2i %2i:%02i %s [%i:%02i]\n", i, (tl/60), (tl%60),
++ trk_name, (tt/60), (tt%60));
++ } else
++ printf (" %2i %2i:%02i %s\n", i, (tl/60), (tl%60), trk_name);
++
+ free(trk_name);
} /* for */
}