set ::mp3::audiomp3 [$::auto::settings audiomp3] proc ::mp3::dequeue {q ts} { namespace import ::auto::log variable audiomp3 set tmp $::auto::tmp set file [file rootname [$ts get file]] if {[file exists $file.mp3]} { return {"OK" "Already done"} } if {[$ts flag "ODEncrypted"]} { return {"DEFER" "Not decrypted"} } if {[::auto::inuse $ts]} { return {"DEFER" "Recording in use"} } system startop mp3 [$ts get file] ::auto::dsc [$ts size] set mp3mode $audiomp3 if {"-mp2" in [$q get args]} { set mp3mode 0 } if {"-mp3" in [$q get args]} { set mp3mode 1 } ::auto::startclock log " MP3: $file" 0 log " Converting... [$::auto::settings \ audiomp3descr $mp3mode]" 0 if {[catch {set msg [$ts mkmp3 $mp3mode "$tmp/mp3"]} msg]} { system notify "$file - auto-mp3 - error $msg." system endop mp3 return [list "FAILED" $msg] } foreach line [split $msg "\n"] { log [string trim $line] 0 } set summary [::auto::endclock [$ts size]] system endop mp3 return [list "OK" $summary] } ::auto::register mp3 300