]>
git.rmz.io Git - dotfiles.git/blob - bin/flaccue2flac
13 echo "This script will convert, split and tag FLAC files with an associated cue sheet"
16 echo "WARNING: THIS SCRIPT WILL AUTOMATICALLY INSTALL SOME NECESSARY PACKAGES IF NOT ALREADY INSTALLED"
22 # This will check if all packages needed are present in the system, and will install them if not.
26 echo "ERROR (Don't worry) ;-)"
27 echo "FLAC is not in your system, automatically installing..."
28 sudo aptitude update
&& sudo aptitude
install flac
-y
30 echo "OK NOW, PROCEEDING..."
34 CUE
= `which cuebreakpoints`
36 echo "ERROR (Wish every error were like this one...) ;-)"
38 echo "cuetools not present, automatically installing..."
39 sudo aptitude update
&& sudo aptitude
install cuetools
-y
41 echo "OK NOW, PROCEEDING..."
47 echo "ERROR (Not the end of the world, anyway) ;-)"
49 echo "shntool is not around here, let's get it..."
50 sudo aptitude update
&& sudo aptitude
install shntool
-y
52 echo "OK, PROCEEDING..."
58 echo "OH, MY GOD! ;-)"
60 echo "lltag is not in your computer, installing..."
61 sudo aptitude update
&& sudo aptitude
install lltag
-y
63 echo "AT LAST, PROCEEDING..."
67 # Now it will check if we have chosen a cue file
72 echo "Checking if file $i is a .cue file..." ;;
74 echo "Warning: File $i is not a .cue file. Aborting."
80 FILENAME
= " $(basename $i) "
81 FILENAME
= " ${FILENAME%.[cC][uU][eE]} "
83 echo "Splitting files..."
84 cuebreakpoints
$FILENAME .cue
85 shnsplit
-o flac
-f $FILENAME .cue
$FILENAME .flac
88 cuetag
$FILENAME .cue
split -track * .flac
90 # This will rename files using the strucure "track-number title", the one I like, but it can be easyly changed using common parameters. Please read lltag manual for more information.
92 echo "Renaming files..."
93 lltag
--yes --no-tagging --rename '%n %t' `ls split-track*.flac`