Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Help with shntool ! (Read 11346 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Help with shntool !

Reply #25
To work as expected in Nautilus, the following code needed to be inserted:
This will prevent Nautilus to do its operations from $HOME as it usually does.
What remains unclear to me is that if Dolphin supports those kind of scripts or some magic...

The script needs to be executable and inside .gnome2/nautilus-scripts

Code: [Select]
#!/usr/bin/env bash

            # Go to file's directory if it's a file, for Nautilus

            if [ ! -d "$destination" ]; then
                destination="`dirname "$destination"`"
            fi
      
FILE=`basename $1`
FILENOEXT=`basename $1 .flac`

sox -S -V $destination/$FILE -c 2 stereo.wav

shntool split -l 5:00 stereo.wav

shntool cue split-track*.wav >> $FILENOEXT.cue

rm split-track*.wav
rm stereo.wav

sed -i "s#joined.wav#$FILE#" $FILENOEXT.cue


Help with shntool !

Reply #26
dutch109:

how do I properly do a for loop here, getting $i from "TRACK" statement, but putting the TITLE and PERFORMER idented and after INDEXes statements?

Code: [Select]
for i in $FILENOEXT.cue do
sed -i "s/^\([ \t]*\)\(INDEX 01.*\)$/\1\2\n\1TITLE Part $i\n\1PERFORMER Conferencist/" $FILENOEXT.cue
done

Help with shntool !

Reply #27
Code: [Select]
konsole --title="Create CUESHEET" -e $SHELL -c "cd %d; mscd %f"


I found out that this statement will work in KDE/Dolphin when Opening the file with the associated script.

Now the issue is, file name with spaces... aren't being processed. Any tips would help!

Help with shntool !

Reply #28
A much better worked out version of the script:

Code: [Select]
#!/usr/bin/env bash

if [[ $1 = */* ]]; then cd "${1%/*}" || exit; fi


file=${1##*/}
base=${file%.*}

sox -S -V "$file" -c 2 stereo.wav

shntool split -l 5:00 stereo.wav

{
echo "REM DATE 2011";
echo "REM GENRE Rock";
echo "REM COMMENT CD-R";
echo "PERFORMER \"Band\"";
echo "TITLE \"Album\"";
shntool cue split-track*.wav | sed "s#joined.wav#$file#";
} > "$base.cue"

rm split-track*.wav
rm stereo.wav



Update: Found out a way to work with Nautilus launching on terminal, the custom command should be:

Code: [Select]
gnome-terminal --title="Creating Cuesheet for CD..." --hide-menubar -x mscd %f