Menu

Multiple files selected and right-clic action

2010-08-21
2013-04-24
  • Patrice Reich

    Patrice Reich - 2010-08-21

    Hello,
    I am not at all a coder, but I have made this small script to convert midifiles to mp3 :

     #!/bin/sh
    function synthesize ()
    {
    SOURCE="$1"
    PARAMETRES="-ab 160k -ac 2 -ar 44100"
    WAVE="$1.wav"
    DESTINATION="${SOURCE%%.*}"
    timidity "$SOURCE" -Ow -o "$WAVE"
    ffmpeg -i "$WAVE" $PARAMETRES "$DESTINATION".mp3
    rm "$WAVE"
    }
    case $@ in
    *.mid|*.kar|*.midi|*.rmi)
    while [ "$1" ] ; do
    echo "synthesize"
    synthesize "$1"
    shift
    done
    exit 0
    ;;
    *)
    echo "Usage: midi2mp3 [nom du fichier ou *.* pour convertir tout le répertoire]. Extensions acceptées : .mid .midi .rmi .kar"
    exit 0
    ;;
    esac
    

    Unfortunately, it doesn't works when using it in Tux Commander (with a right-click actions defined in filetypes).

    However, I can convert midifiles one by one in Tux Commander by using this script :

     #!/bin/sh
    SOURCE="$*"
    PARAMETRES="-ab 160k -ac 2 -ar 44100"
    WAVE="$*.wav"
    DESTINATION=`basename "$SOURCE" .mid`
    timidity "$SOURCE" -Ow -o "$WAVE"
    ffmpeg -i "$WAVE" $PARAMETRES "$DESTINATION".mp3
    rm "$WAVE"
    exit 0
    

    I didn't manage to get several files as input for the right-click actions.

    Is that normal ?

    Best regards, Patrice Reich

     
  • Tomas Bzatek

    Tomas Bzatek - 2010-08-26

    Sending multiple selected files as a commandline argument is not supported yet, feel free to send a patch. All actions work only on currently focused file, no matter whether is selected or not.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.