Bug#387100: Please remove -H

2006-09-22 Thread Eduard Bloch
#include 
* Eugen Dedu [Fri, Sep 22 2006, 11:43:48AM]:
> Eduard Bloch wrote:
> >#include 
> >* Eugen Dedu [Thu, Sep 21 2006, 06:00:13PM]:
> >>Eduard Bloch wrote:
> >>>#include 
> >>>* Eugen Dedu [Thu, Sep 21 2006, 01:01:47PM]:
> Hi,
> 
> Also, I think it is better to have only one executable instead of two: 
> cdda2ogg and cdda2mp3, the other being a simbolic link.  There are only 
> 3 or 4 lines different, I can send you a patch if you agree.
> >>>Patch is welcome and consolidation makes sense. I even though about
> >>>doing that myself but was too lazy ATM.
> >>Here is cdda2ogg.  cdda2mp3 should be a link to cdda2ogg.  Do you agree 
> >>with the patch?
> >
> >Almost. I needed to apply stuff manually because you have not attached
> >it but apparently pasted into a stupid editor which screwed up the
> >formating. And it was not based on the current SVN. And it was not
> >fail-save WRT wrong/missing/uppercased suffix. I rewrote most of it.
> 
> Very well.
> 
> A few questions (the last ones :o)):
> 
> 1. Why do you put for example MPEG3 or Mp3 in the 'case' instruction? 
> If the user modifies the name, the script would not function anyway (or 
> should it function only if the name changes in cdda2Mp3, but not when 
> the name changes in cdda2mympeg3?!)  The user is not intented to modify 
> the name.  I propose to use only ogg and mp3.  If you agree, I think it 
> is better also to replace -c6- by -c6-9 during suffix initialisation.

Ack. Let's throw the cut away and use the matching of case construct
only.

> 2. Does MP_CODER really need to be exported?

No. Removed.

> 3. The line
> TRACK=`echo $(($TRACK+1))`
> is not necessary.

Indeed. And, btw, toolame is IIRC not an mp3 encoder but mp2.

Thanks,
Eduard.
-- 
 Und mal wieder ein paar Pakete, die sich nicht mal installieren
lassen
 Ich kanns nicht verstehen.
* Alfie . o O ( .. zumindest solange nicht, bis es mir mal passiert ist )


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#387100: Please remove -H

2006-09-22 Thread Eugen Dedu

Eduard Bloch wrote:

#include 
* Eugen Dedu [Thu, Sep 21 2006, 06:00:13PM]:

Eduard Bloch wrote:

#include 
* Eugen Dedu [Thu, Sep 21 2006, 01:01:47PM]:

Hi,

Also, I think it is better to have only one executable instead of two: 
cdda2ogg and cdda2mp3, the other being a simbolic link.  There are only 
3 or 4 lines different, I can send you a patch if you agree.

Patch is welcome and consolidation makes sense. I even though about
doing that myself but was too lazy ATM.
Here is cdda2ogg.  cdda2mp3 should be a link to cdda2ogg.  Do you agree 
with the patch?


Almost. I needed to apply stuff manually because you have not attached
it but apparently pasted into a stupid editor which screwed up the
formating. And it was not based on the current SVN. And it was not
fail-save WRT wrong/missing/uppercased suffix. I rewrote most of it.


Very well.

A few questions (the last ones :o)):

1. Why do you put for example MPEG3 or Mp3 in the 'case' instruction? 
If the user modifies the name, the script would not function anyway (or 
should it function only if the name changes in cdda2Mp3, but not when 
the name changes in cdda2mympeg3?!)  The user is not intented to modify 
the name.  I propose to use only ogg and mp3.  If you agree, I think it 
is better also to replace -c6- by -c6-9 during suffix initialisation.


2. Does MP_CODER really need to be exported?

3. The line
TRACK=`echo $(($TRACK+1))`
is not necessary.

Regards,
--
Eugen


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#387100: Please remove -H

2006-09-22 Thread Eduard Bloch
#include 
* Eugen Dedu [Thu, Sep 21 2006, 06:00:13PM]:
> Eduard Bloch wrote:
> >#include 
> >* Eugen Dedu [Thu, Sep 21 2006, 01:01:47PM]:
> >>Hi,
> >>
> >>In fact, I think users prefer to have info files about the CD.  If they 
> >>wish, they can remove them afterwards.  So please remove -H from the 
> >>"Looking for available tracks..." section.
> >
> >I disagree, sorry. I prefer the policy of not leaving garbage behind,
> >especially if the user is not told about what is happening there. And I
> >doubt that they have much value unless CDDB information is stored
> >inside. But for that kind of usage, there are IIRC more sophisticated
> >scripts available.
> >
> >And, after all, if the user wishes the data, she can run it manually
> >with -J and -H etc.pp.
> 
> Ok.
> 
> >>Also, I think it is better to have only one executable instead of two: 
> >>cdda2ogg and cdda2mp3, the other being a simbolic link.  There are only 
> >>3 or 4 lines different, I can send you a patch if you agree.
> >
> >Patch is welcome and consolidation makes sense. I even though about
> >doing that myself but was too lazy ATM.
> 
> Here is cdda2ogg.  cdda2mp3 should be a link to cdda2ogg.  Do you agree 
> with the patch?

Almost. I needed to apply stuff manually because you have not attached
it but apparently pasted into a stupid editor which screwed up the
formating. And it was not based on the current SVN. And it was not
fail-save WRT wrong/missing/uppercased suffix. I rewrote most of it.

Eduard.
-- 
Naja, Garbage Collector eben. Holt den Müll sogar vom Himmel.
   (Heise Trollforum über Java in der Flugzeugsteuerung)



Bug#387100: Please remove -H

2006-09-21 Thread Eugen Dedu

Eduard Bloch wrote:

#include 
* Eugen Dedu [Thu, Sep 21 2006, 01:01:47PM]:

Hi,

In fact, I think users prefer to have info files about the CD.  If they 
wish, they can remove them afterwards.  So please remove -H from the 
"Looking for available tracks..." section.


I disagree, sorry. I prefer the policy of not leaving garbage behind,
especially if the user is not told about what is happening there. And I
doubt that they have much value unless CDDB information is stored
inside. But for that kind of usage, there are IIRC more sophisticated
scripts available.

And, after all, if the user wishes the data, she can run it manually
with -J and -H etc.pp.


Ok.

Also, I think it is better to have only one executable instead of two: 
cdda2ogg and cdda2mp3, the other being a simbolic link.  There are only 
3 or 4 lines different, I can send you a patch if you agree.


Patch is welcome and consolidation makes sense. I even though about
doing that myself but was too lazy ATM.


Here is cdda2ogg.  cdda2mp3 should be a link to cdda2ogg.  Do you agree 
with the patch?


snoopy:~$ diff -u /usr/bin/cdda2ogg cdda2ogg
--- /usr/bin/cdda2ogg   2006-09-06 19:43:04.0 +0200
+++ cdda2ogg 2006-09-21 17:53:29.0 +0200
@@ -1,16 +1,9 @@
 #! /bin/sh
-# Demo script for processing all audio tracks with a mp3 decoder
+# Script for processing all audio tracks with an ogg or mp3 decoder
 # based on a news article by Tom Kludy
 # This variant uses named pipes in order to save space.
-# There is another variant of this script, which uses temporary
-# wav files (see cdda2mp3.new).
 #
-# usage: cdda2ogg 
-#
-# list_audio_tracks is a (symbolic) link to cdda2wav
-# and used to generate a list of audio track numbers and start
-# sectors, which in turn are used in a loop to spawn cdda2wav
-# and the post processor on a track by track basis.
+# usage: cdda2ogg 

 # specify the sampling program and its options
 # do not specify the track option here!
@@ -20,25 +13,30 @@
 # for normal use, comment out the next line
 #DEBUG='-d1'

+suffix=`basename $0 | cut -c6-`  # suffix: ogg or mp3
+
 # the post processor is fed through a pipe to avoid space waste
 # specify the post processing program and its options
-MP_CODER=${MP_CODER:-oggenc}
+if [ $suffix = "ogg" ]; then
+MP_CODER=${MP_CODER:-oggenc}
+else
+MP_CODER=${MP_CODER:-lame}
+fi
 MP_OPTIONS=${MP_OPTIONS:-''}

 export MP_CODER
 MP_CODER=$(which $MP_CODER 2>/dev/null)
 if [ ! -x "$MP_CODER" ] ; then
-   echo "Encoder not found. Install one first! (eg. vorbis-tools)"
+   echo "Encoder not found. Install one first! (eg. vorbis-tools or 
toolame)"

exit 1
 fi

 CDDA_DEVICE=${CDDA_DEVICE:-/dev/cdrw}
-export CDDA_DEVICE

 FILEPREFIX=${1:-audiotrack}

-if [ -e /etc/default/cdda2ogg ]; then
-   . /etc/default/cdda2ogg
+if [ -e /etc/default/cdda2$suffix ]; then
+   . /etc/default/cdda2$suffix
 fi

 if [ -z "$LIST" ] ; then
@@ -54,11 +52,14 @@
 echo Cancel with Ctrl-C, watch out for error messages.

 for TRACK in $LIST ; do
-   NAME="`printf "%02d" $TRACK`-$FILEPREFIX.ogg"
+   NAME="`printf "%02d" $TRACK`-$FILEPREFIX.$suffix"
echo
echo " Starting with Track Nr. $TRACK -> $NAME 
"

-  $CDDA2WAV $CDDA2WAV_OPTS -t$TRACK $DEBUG - | \
-  $MP_CODER $MP_OPTIONS - > "$NAME"
+   if [ $suffix = "ogg" ]; then
+   $CDDA2WAV $CDDA2WAV_OPTS -t$TRACK $DEBUG - | $MP_CODER 
$MP_OPTIONS - > "$NAME"

+   else
+   $CDDA2WAV $CDDA2WAV_OPTS -t$TRACK $DEBUG - | $MP_CODER 
$MP_OPTIONS - "$NAME"

+   fi

   # check result code
   RES=$?
@@ -66,6 +67,4 @@
 echo File $NAME failed \(result $RES\). Aborted. >&2
 break
   fi
-  TRACK=`echo $(($TRACK+1))`
 done
-

Friendly,
Eugen Dedu


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#387100: Please remove -H

2006-09-21 Thread Eduard Bloch
#include 
* Eugen Dedu [Thu, Sep 21 2006, 01:01:47PM]:
> Hi,
> 
> In fact, I think users prefer to have info files about the CD.  If they 
> wish, they can remove them afterwards.  So please remove -H from the 
> "Looking for available tracks..." section.

I disagree, sorry. I prefer the policy of not leaving garbage behind,
especially if the user is not told about what is happening there. And I
doubt that they have much value unless CDDB information is stored
inside. But for that kind of usage, there are IIRC more sophisticated
scripts available.

And, after all, if the user wishes the data, she can run it manually
with -J and -H etc.pp.

> Also, I think it is better to have only one executable instead of two: 
> cdda2ogg and cdda2mp3, the other being a simbolic link.  There are only 
> 3 or 4 lines different, I can send you a patch if you agree.

Patch is welcome and consolidation makes sense. I even though about
doing that myself but was too lazy ATM.

Eduard.

-- 
 moin
 hab irgednwie ein problem


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#387100: Please remove -H

2006-09-21 Thread Eugen Dedu

Hi,

In fact, I think users prefer to have info files about the CD.  If they 
wish, they can remove them afterwards.  So please remove -H from the 
"Looking for available tracks..." section.


Also, I think it is better to have only one executable instead of two: 
cdda2ogg and cdda2mp3, the other being a simbolic link.  There are only 
3 or 4 lines different, I can send you a patch if you agree.


Friendly,
--
Eugen Dedu


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]