#!/bin/bash #parse arguments OPTERR=0 while getopts ':c:l:T:F:hD' opt do case $opt in c) cffile="$OPTARG" ;; l) cliload="$OPTARG" ;; T) cliltimer="$OPTARG" ;; F) forceall+=("$OPTARG") ;; h) help exit 0 ;; D) (( debug++ )) ;; :) echo "-$OPTARG requires an argument" help exit 127 ;; *) echo "Unrecognized option: -$OPTARG" help exit 127 ;; esac done #parse config #check sanity getFiles() { : } getType() { : } getInfos::MP3() { : } getInfos::Ogg() { : } getInfos::FLAC() { : } getInfos::MPC() { : } getTags() { #getType #getInfos:: : } encodeFile::MP3() { #lame : } encodeFile::Ogg() { #oggenc : } transcodeFile() { #sox -> wav for format in $targets["format"] do #encodeFile::$format : done #signal and of encoding to parent } checkFinished() { #retrieve info from finished transcodeFile() #update counters / metadata : } checkLoad() { #if load > threshold # decrease concurrency #elif load < threshold # increase concurrency #fi : } readUserInput() { #read + / - / q(uit) / p(ause) #initiate shutdown / change load threshold / SIGSTOP all children / SIGCONT all children : } transcodeLauncher() { checkLoad checkFinished #until running processes < max processes #do checkLoad checkFinished readUserInput #done transcodeFile & #update counter / metadata } #UI # vim:set ts=8 sw=8: