#!/bin/bash # vim: set expandtab tabstop=4 shiftwidth=4: # Create silence for the menus to use dd if=/dev/zero bs=4 count=1920 | toolame -b 128 -s 48 /dev/stdin menu_silence.ac3 # Function to build a menu buildMenu(){ M_PCX=$1 M_M2V=$2 M_MPG=$3 M_SPU=$4 M_FIN=$5 pcxtoppm < ${M_PCX} | ppmtoy4m -n 60 -I p -F 30000:1001 -r -A 10:11 -S 420mpeg2 | mpeg2enc -n p -f 8 -o ${M_M2V} mplex -f 8 -o ${M_MPG} ${M_M2V} menu_silence.ac3 spumux ${M_SPU} < ${M_MPG} > ${M_FIN} } # Build the menus for VER in wpdr orig do # First the main menu... buildMenu menu_${VER}_main_background.pcx \ menu_${VER}_main_background.m2v \ menu_${VER}_main.mpg \ menu_${VER}_main_spumux.xml \ menu_${VER}_main_final.mpg # ... and then the scene selections for MENU in scene1 scene2 scene3 scene4 do buildMenu menu_${VER}_${MENU}_background.pcx \ menu_${VER}_${MENU}_background.m2v \ menu_${VER}_${MENU}_main.mpg \ menu_${MENU}_spumux.xml \ menu_${VER}_${MENU}_final.mpg done done