View | Details | Raw Unified | Return to bug 38498
Collapse All | Expand All

(-)ripit.new/Makefile (+1 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	ripit
8
PORTNAME=	ripit
9
PORTVERSION=	2.0
9
PORTVERSION=	2.0
10
PORTREVISION=	1
10
CATEGORIES=	audio
11
CATEGORIES=	audio
11
MASTER_SITES=	http://www.initio.no/~oyvindmo/distfiles/
12
MASTER_SITES=	http://www.initio.no/~oyvindmo/distfiles/
12
13
(-)ripit.new/files/patch-aa (-26 / +95 lines)
Lines 1-6 Link Here
1
--- ripit-orig.pl	Sun Sep 23 14:12:08 2001
1
--- ripit.pl.orig	Sat Aug 25 18:20:06 2001
2
+++ ripit.pl	Sun Sep 23 14:12:09 2001
2
+++ ripit.pl	Fri May 24 14:16:20 2002
3
@@ -9,41 +9,43 @@
3
@@ -9,41 +9,47 @@
4
 #		Create an M3U file
4
 #		Create an M3U file
5
 #
5
 #
6
 # Options:
6
 # Options:
Lines 12-17 Link Here
12
+#	--halt			- powers off the machine when finished
12
+#	--halt			- powers off the machine when finished
13
+#				  if your configuration supports it
13
+#				  if your configuration supports it
14
+#	--bitrate [rate]	- Encode MP3 at this bitrate 
14
+#	--bitrate [rate]	- Encode MP3 at this bitrate 
15
+#	--quality [value]	- Encode Ogg at this quality setting
15
 #	--year [year]		- Tag MP3 with this year (included as CDDB
16
 #	--year [year]		- Tag MP3 with this year (included as CDDB
16
 #				  does not store this information)
17
 #				  does not store this information)
17
-#       --genre [genre]		- Overrides CDDB genre, e.g. rock,funk
18
-#       --genre [genre]		- Overrides CDDB genre, e.g. rock,funk
Lines 26-38 Link Here
26
+#	--numcpu [cpus]		- Number of parallel encoders to run
27
+#	--numcpu [cpus]		- Number of parallel encoders to run
27
 #
28
 #
28
 # Version 2.0 20/08/01 - Simon Quinn
29
 # Version 2.0 20/08/01 - Simon Quinn
30
+# Ripping via FreeBSD's "dd" command - Lars Eggert <larse@isi.edu>
31
+# May use Ogg's -q quality option - Øyvind Møll <oyvindmo@initio.no>
29
 #
32
 #
30
 # Usage: ripit.pl [--halt] [--bitrate rate] [--year year] [--genre genre]
33
-# Usage: ripit.pl [--halt] [--bitrate rate] [--year year] [--genre genre]
31
-#                 [--device cddevice] [--encopt options] [--encoder encoder]
34
-#                 [--device cddevice] [--encopt options] [--encoder encoder]
32
+#		  [--device cddevice] [--encopt options] [--encoder encoder]
35
-#		  [--cdripper cdripper] [--cdopt options] [--outputdir dir] 
33
 #		  [--cdripper cdripper] [--cdopt options] [--outputdir dir] 
34
-#	 	  [start_track]
36
-#	 	  [start_track]
35
+#		  [--numcpu cpus] [start_track]
37
+# Usage: ripit.pl [--halt] [--bitrate rate] [--quality value] [--year year]
38
+#		  [--genre genre] [--device cddevice] [--encopt options]
39
+#		  [--encoder encoder] [--cdripper cdripper] [--cdopt options]
40
+#		  [--outputdir dir] [--numcpu cpus] [start_track]
36
 ####################################################################
41
 ####################################################################
37
 #
42
 #
38
 # User configurable variables
43
 # User configurable variables
Lines 40-60 Link Here
40
 
45
 
41
 $cddev 		= "/dev/cdrom";		# CD Audio device
46
 $cddev 		= "/dev/cdrom";		# CD Audio device
42
-$outputdir 	= "/tmp/cdrip/";	# Where the MP3s should go, 
47
-$outputdir 	= "/tmp/cdrip/";	# Where the MP3s should go, 
43
+$outputdir 	= "/tmp/cdrip/";	# Where the MP3s should go,
48
-					# must have trailing /
44
 					# must have trailing /
49
+$outputdir 	= "/tmp/cdrip";		# Where the MP3s should go
45
 $bitrate	= 160;			# Bitrate for MP3s
50
 $bitrate	= 160;			# Bitrate for MP3s
46
-$encoder	= 0; 			# 0 - Lame, 1 - OggVorbis
51
-$encoder	= 0; 			# 0 - Lame, 1 - OggVorbis
52
+$quality	= 0;			# Quality setting for Ogg
47
+$encoder	= 0; 			# 0 - Lame, 1 - Gogo, 2 - OggVorbis
53
+$encoder	= 0; 			# 0 - Lame, 1 - Gogo, 2 - OggVorbis
48
 $encopt		= "";			# options for mp3 encoder
54
 $encopt		= "";			# options for mp3 encoder
49
 $cdripper	= 0;			# 0 - dagrab,
55
 $cdripper	= 0;			# 0 - dagrab,
50
 					# 1 - cdparanoia, 2 - cdda2wav,
56
 					# 1 - cdparanoia, 2 - cdda2wav,
51
 					# 3 - tosha, 4 - cdd
57
-					# 3 - tosha, 4 - cdd
58
+					# 3 - tosha, 4 - cdd,
59
+					# 5 - dd (FreeBSD-4.4 and higher)
52
 $cdopt		= "";			# options for cdaudio ripper
60
 $cdopt		= "";			# options for cdaudio ripper
53
+$numcpu		= 1;			# Number of parallel encoders to run
61
+$numcpu		= 1;			# Number of parallel encoders to run
54
 
62
 
55
 $CDDB_HOST	= "freedb.freedb.org";  # set cddb host
63
 $CDDB_HOST	= "freedb.freedb.org";  # set cddb host
56
 $CDDB_PORT	= 8880;                 # set cddb port
64
 $CDDB_PORT	= 8880;                 # set cddb port
57
@@ -77,6 +79,9 @@
65
@@ -77,6 +83,9 @@
58
 $nocddbinfo	= 1;    # Assume no CDDB info exists
66
 $nocddbinfo	= 1;    # Assume no CDDB info exists
59
 $trackselection = "";   # Passed from command line
67
 $trackselection = "";   # Passed from command line
60
 
68
 
Lines 64-70 Link Here
64
 ####################################################
72
 ####################################################
65
 # Do the following:
73
 # Do the following:
66
 #  1. Get command line parameters
74
 #  1. Get command line parameters
67
@@ -98,11 +103,16 @@
75
@@ -91,6 +100,7 @@
76
 # Get the parameters from the command line
77
 if ( ! &GetOptions("halt" => \$haltonfinish, 
78
                   "bitrate=i" => \$bitrate,
79
+                  "quality=i" => \$quality,
80
 		  "year=i" => \$year,
81
 		  "genre=s" => \$genre,
82
 		  "device=s" => \$cddev,
83
@@ -98,11 +108,16 @@
68
 		  "encoder=i" => \$encoder,
84
 		  "encoder=i" => \$encoder,
69
 		  "cdripper=i" => \$cdripper,
85
 		  "cdripper=i" => \$cdripper,
70
 		  "cdopt=s" => \$cdopt,
86
 		  "cdopt=s" => \$cdopt,
Lines 73-90 Link Here
73
+		  "outputdir=s" => \$outputdir,
89
+		  "outputdir=s" => \$outputdir,
74
+		  "numcpu=i" => \$numcpu ) ) {
90
+		  "numcpu=i" => \$numcpu ) ) {
75
+   print "
91
+   print "
76
+Usage: ripit.pl [--halt] [--bitrate rate] [--year year]
92
+Usage: ripit.pl [--halt] [--bitrate rate] [--quality value] [--year year]
77
                 [--device cddevice] [--encopt options] [--encoder encoder]
93
                 [--device cddevice] [--encopt options] [--encoder encoder]
78
 		[--cdripper cdripper] [--cdopt options] [--outputdir dir] 
94
 		[--cdripper cdripper] [--cdopt options] [--outputdir dir] 
79
-		[start_track]\n";
95
-		[start_track]\n";
80
+		[--numcpu cpus] [start_track]
96
+		[--numcpu cpus] [start_track]
81
+Rippers: 0 - dagrab, 1 - cdparanoia, 2 - cdda2wav, 3 - tosha, 4 - cdd
97
+Rippers: 0 - dagrab, 1 - cdparanoia, 2 - cdda2wav, 3 - tosha, 4 - cdd, 5 - dd
82
+Encoders: 0 - Lame, 1 - Gogo, 2 - OggVorbis
98
+Encoders: 0 - Lame, 1 - Gogo, 2 - OggVorbis
83
+";
99
+";
84
    exit 1;
100
    exit 1;
85
 }
101
 }
86
 
102
 
87
@@ -132,8 +142,8 @@
103
@@ -110,6 +125,9 @@
104
         print STDERR "Warning: year is not Y2K compliant - $year\n";
105
 }
106
 
107
+# Make sure outputdir ends with a slash
108
+$outputdir =~ s/(.*)\/?/$1\//;
109
+
110
 if ($haltonfinish == 1) {print "Will halt machine when finished.\n";}
111
 
112
 # Get starting track parameter if it has been given
113
@@ -132,8 +150,8 @@
88
 &create_dirs();				# Create directories MP3 files
114
 &create_dirs();				# Create directories MP3 files
89
 &rip_cd();				# Rip, Encode & Tag
115
 &rip_cd();				# Rip, Encode & Tag
90
 
116
 
Lines 95-101 Link Here
95
 
121
 
96
 &create_m3u();			# Create the M3U file for the MP3 files
122
 &create_m3u();			# Create the M3U file for the MP3 files
97
 
123
 
98
@@ -157,6 +167,10 @@
124
@@ -157,6 +175,10 @@
99
 
125
 
100
 exit;
126
 exit;
101
 
127
 
Lines 106-112 Link Here
106
 #
132
 #
107
 # Create the track selection from the parameters passed
133
 # Create the track selection from the parameters passed
108
 # on the command line
134
 # on the command line
109
@@ -336,31 +350,37 @@
135
@@ -280,7 +302,6 @@
136
 #
137
 sub create_dirs {
138
   # Directory created will be: /outputdir/Artist - Album/
139
-  # The value must end in /
140
 
141
   $mp3dir = $outputdir.$artist." - ".$album."/";
142
 
143
@@ -336,31 +357,37 @@
110
     $riptrackname = &get_trackname($_, $tracklist[$_ - 1]);
144
     $riptrackname = &get_trackname($_, $tracklist[$_ - 1]);
111
     $riptrackno = $_;
145
     $riptrackno = $_;
112
 
146
 
Lines 148-154 Link Here
148
       }
182
       }
149
     }
183
     }
150
     elsif ($cdripper == 4) {
184
     elsif ($cdripper == 4) {
151
@@ -369,6 +389,7 @@
185
@@ -369,9 +396,37 @@
152
       $cdd_dev =~ s/c$//;
186
       $cdd_dev =~ s/c$//;
153
       if (system("cdd -t $riptrackno -q -f $cdd_dev - 2>/dev/null | sox -t cdr -x - \"$riptrackname.rip\"")) {
187
       if (system("cdd -t $riptrackno -q -f $cdd_dev - 2>/dev/null | sox -t cdr -x - \"$riptrackname.rip\"")) {
154
         &printflush(RIPLOG,"cdd failed on $tracklist[$_ - 1]\n");
188
         &printflush(RIPLOG,"cdd failed on $tracklist[$_ - 1]\n");
Lines 156-162 Link Here
156
         die "cdd failed on $tracklist[$_ - 1]";
190
         die "cdd failed on $tracklist[$_ - 1]";
157
       }
191
       }
158
     }
192
     }
159
@@ -381,11 +402,13 @@
193
+    elsif ($cdripper == 5) {
194
+      # Rip via FreeBSD's "dd" command and the associated CDDA devices
195
+      # under /dev. Requires 4.4-RELEASE or higher.
196
+      my $cdd_dev = $cddev;
197
+      if ($cdd_dev =~ /^\/dev\/(.*)/) { $cdd_dev = $1; }
198
+      die "dd extraction only works with ATAPI devices" unless $cddev =~ /acd/;
199
+      # See if the device corresponding to the track already exists...
200
+      my $trackdev = $cdd_dev;
201
+      $trackdev =~ s/(.*)c/$1/;
202
+      $trackdev .= "t$riptrackno";
203
+      unless (-e "/dev/$trackdev") {
204
+	# ...no, it doesn't. Create it.
205
+	&printflush(RIPLOG, "CDDA track device /dev/$trackdev, doesn't ".
206
+		    "exist, creating...\n");
207
+	my $cwd = `pwd`;
208
+	chdir "/dev";
209
+	system("sh MAKEDEV $trackdev") == 0 or die "cannot make $trackdev";
210
+	chdir $cwd;
211
+      }
212
+      # Ready to extract the data. Also do endian conversion.
213
+      if (system("dd if=/dev/$trackdev conv=swab bs=2352 ".
214
+		 "of=\"$riptrackname.rip\" 2> /dev/null")) {
215
+	&printflush(RIPLOG,"dd failed on $tracklist[$_ - 1]\n");
216
+        kill 1, @encoders;
217
+	die "cannot rip track $riptrackno";
218
+      }
219
+    }
220
     else {
221
       die "No CD Ripper defined";
222
     }
223
@@ -381,11 +436,13 @@
160
     rename "$riptrackname.rip","$riptrackname.wav";
224
     rename "$riptrackname.rip","$riptrackname.wav";
161
 
225
 
162
     &printflush(RIPLOG,"Rip complete $tracklist[$_ - 1]\n");
226
     &printflush(RIPLOG,"Rip complete $tracklist[$_ - 1]\n");
Lines 174-180 Link Here
174
     }
238
     }
175
 
239
 
176
   }
240
   }
177
@@ -407,25 +430,33 @@
241
@@ -407,24 +464,37 @@
178
     $riptrackno = $_;
242
     $riptrackno = $_;
179
     $ncount++;
243
     $ncount++;
180
  
244
  
Lines 201-218 Link Here
201
       $enc = "lame $encopt -S -b $bitrate --tt \"$tracklist[$_ - 1]\" --ta \"$artist\" --tl \"$album\" --ty \"$year\" --tg \"$genre\" --tn $riptrackno --add-id3v2 \"$riptrackname.wav\" \"$riptrackname.mp3\"";
265
       $enc = "lame $encopt -S -b $bitrate --tt \"$tracklist[$_ - 1]\" --ta \"$artist\" --tl \"$album\" --ty \"$year\" --tg \"$genre\" --tn $riptrackno --add-id3v2 \"$riptrackname.wav\" \"$riptrackname.mp3\"";
202
     }
266
     }
203
     elsif ($encoder == 1) {
267
     elsif ($encoder == 1) {
268
-      $enc = "oggenc $encopt -b $bitrate -t \"$tracklist[$_ - 1]\" -a \"$artist\" -l \"$album\" -d \"$year\" -N $riptrackno -o \"$riptrackname.ogg\" \"$riptrackname.wav\"";
204
+      $enc = "gogo \"$riptrackname.wav\" \"$riptrackname.mp3\" $encopt -b $bitrate";
269
+      $enc = "gogo \"$riptrackname.wav\" \"$riptrackname.mp3\" $encopt -b $bitrate";
205
+    }
270
+    }
206
+    elsif ($encoder == 2) {
271
+    elsif ($encoder == 2) {
207
       $enc = "oggenc $encopt -b $bitrate -t \"$tracklist[$_ - 1]\" -a \"$artist\" -l \"$album\" -d \"$year\" -N $riptrackno -o \"$riptrackname.ogg\" \"$riptrackname.wav\"";
272
+      if ($quality > 0) {
208
     }
273
+	$oggenc_quality_option = "-q $quality";
274
+      } else {
275
+	$oggenc_quality_option = "-b $bitrate";
276
+      }
277
+      $enc = "oggenc $encopt $oggenc_quality_option -t \"$tracklist[$_ - 1]\" -a \"$artist\" -l \"$album\" -d \"$year\" -N $riptrackno -o \"$riptrackname.ogg\" \"$riptrackname.wav\"";
278
+    }
209
+    else {
279
+    else {
210
+      die "No encoder defined";
280
+      die "No encoder defined";
211
+    }
281
     }
212
 
282
 
213
     if ( ! system("$enc >$enclog 2>&1 </dev/null")) {
283
     if ( ! system("$enc >$enclog 2>&1 </dev/null")) {
214
  
284
@@ -438,7 +508,8 @@
215
@@ -438,7 +469,8 @@
216
       &printflush(RIPLOG,"MP3 Encoder Failed on $tracklist[$_ - 1]\n");
285
       &printflush(RIPLOG,"MP3 Encoder Failed on $tracklist[$_ - 1]\n");
217
       die "MP3 Encoder Failed on $tracklist[$_ - 1]";
286
       die "MP3 Encoder Failed on $tracklist[$_ - 1]";
218
     }
287
     }
Lines 222-228 Link Here
222
   }
291
   }
223
   exit ;
292
   exit ;
224
 }
293
 }
225
@@ -452,10 +484,10 @@
294
@@ -452,10 +523,10 @@
226
   $file="$artist.m3u";
295
   $file="$artist.m3u";
227
   if ($use_underscore == 1) { $file =~ s/ /_/g; }
296
   if ($use_underscore == 1) { $file =~ s/ /_/g; }
228
 
297
 
(-)ripit.new/pkg-descr (-3 / +2 lines)
Lines 5-14 Link Here
5
encoding and tagging MP3s or Ogg/Vorbis files from audio CDs. It
5
encoding and tagging MP3s or Ogg/Vorbis files from audio CDs. It
6
is a console program that needs no user intervention. It requires
6
is a console program that needs no user intervention. It requires
7
p5-CDDB for CDDB access. A track ripper program and an encoder are
7
p5-CDDB for CDDB access. A track ripper program and an encoder are
8
also needed, but are not installed automatically by this port,
8
also needed.
9
since users' preferences vary.
10
9
11
WWW: http://www.bigfoot.com/~simon.quinn/ripit.html
10
WWW: http://www.geocities.com/ukcave/ripit.html
12
11
13
--
12
--
14
Port by Oyvind Moll <oyvindmo@initio.no>
13
Port by Oyvind Moll <oyvindmo@initio.no>
(-)ripit.new/pkg-message (-6 / +4 lines)
Lines 1-7 Link Here
1
ripit can use a number of different programs to do the actual track
1
ripit can use a number of different programs to do the actual track
2
extraction and audio encoding. For ripit to be useful you need to
2
extraction and audio encoding. By default ripit uses dagrab and
3
have at least one extract program and one encoder program installed.
3
lame respectively, so this port depends on those two having been
4
However, since the choices are many and the users' needs and wants
4
installed. If you want ripit to use other helper utils, just install
5
are varied, none of these are automatically installed as part of
5
them and tell ripit which ones to use.
6
the ripit install. Remember to make sure you install the extractor(s)
7
and encoder(s) you want.

Return to bug 38498