[mythtv-users] User script that takes cutlist & runs project-x?

olx69 ope-linux at gmx.de
Wed Jul 14 18:28:13 UTC 2010


>>
> I've added a 'trunk' version of this script to the wiki.  I haven't
> tested it in trunk, but it does inverse cuts under fixes and should
> handle ac3 sound.
>
here is the part from my script which works also:

mythdb_recordedmarkup() {

    # [http://www.mythtv.org/wiki/Recordedmarkup_table]
    # MARK_CUT_END=0, MARK_CUT_START=1
    mythdb <<-EOF
    select mark, type from recordedmarkup where chanid = $chanid and
starttime = "$starttime" and type in (0,1) order by mark;
    EOF
}

projectx_cutlist() {

    local cut_list=$( mythdb_recordedmarkup )
    local line_cnt=1

    local first_frame=0
    local last_frame
    local mark; local type
    while read -r mark type; do  # FixMe: better way to get the last?
        last_frame=$mark
    done <<< "$cut_list"
   
    local mark_cut_end=0
    local mark_cut_start=1
    local prev_type
   
    local xcl=$(
        {
            echo "CollectionPanel.CutMode=2"
            while read -r mark type; do
                [[ $mark == $first_frame         && $type ==
$mark_cut_start ]] && { prev_type=$mark_cut_start; continue; }
                [[ $mark == $last_frame          && $type ==
$mark_cut_end   ]] && { prev_type=$mark_cut_end; continue; }
                [[ $prev_type == $mark_cut_start && $type ==
$mark_cut_end   ]] && { prev_type=$type; echo $mark; }
                [[ $prev_type == $mark_cut_end   && $type ==
$mark_cut_start ]] && { prev_type=$type; echo $mark; }
            done <<< "$cut_list"
        } 2>&1 )

    fcn_rval="$xcl"
}

Regards,
Olaf




More information about the mythtv-users mailing list