while test $# -gt 0; do DO_SHIFT=: case "$1" in "-files" ) CUR_INDEX=${#FILES[@]} shift unset x get_listargs "$@" for f in ${!ARGS_ARRAY[@]}; do FILES[f+CUR_INDEX]="$(abspath "${ARGS_ARRAY[f]}")" done ts_end=$(( ts_start + ${#ARGS_ARRAY[@]} - 1 )) titleset_indexes=( ${titleset_indexes[@]} ${ts_start}-${ts_end} ) (( titleset > 0 )) && DO_TITLESETS=: let titleset=titleset+1 let ts_start=ts_start+${#ARGS_ARRAY[@]} ;; function titleset_mode() # call todisc recursively in order to allow titlesets { # for file in BACKGROUND SHOWCASE_FILE BG_AUDIO; do if [[ -n $BACKGROUND && ! -e $BACKGROUND ]]; then if [[ -e ../${BACKGROUND##*/} ]]; then BACKGROUND=$(abspath ../${BACKGROUND##*/}); fi fi ! $GROUPING && mk_workdir cd "$WORK_DIR" echo "BACKGROUND is $BACKGROUND"; sleep 5 #FIXME DVDAUTHOR_XML=$WORK_DIR/dvdauthor.xml # make dvdauthor.xml ( cat < $(for ((i=1; i<=$titleset; i++)); do echo " "; done) EOF ) |sed '/^ *$/d' >> "$DVDAUTHOR_XML" arguments=( $( sed 's/-files\( *[^- ][^ ]*\)*//g;s/-titles\( *[^- ][^ ]*\)*//g' <<< "${args[@]}") ) for tset in ${!titleset_indexes[@]}; do for ((i=${titleset_indexes[tset]%%-*}; i<=${titleset_indexes[tset]##*-}; i++)); do Files=( "${Files[@]}" "${FILES[i]}" ) Titles=( "${Titles[@]}" "${TITLES[i]}" ) done if [[ -z ${VMGM_TITLES[@]} ]]; then for ((t=0; t" >> "$DVDAUTHOR_XML" yecho "Running dvdauthor to create final DVD structure" dvdauthor -x "$DVDAUTHOR_XML" 2>&1 | tee -a "$LOG_FILE" if [[ ${PIPESTATUS[0]} -ne 0 ]]; then runtime_error "There was a problem creating the DVD structure" fi yecho "Your new DVD should be in $OUT_DIR" cleanup }