annotate TOOLS/subsearch.sh @ 16018:bdf1b4ecb906

use stored dimensions instead of visible one when (vf_)get_image is called let's see where does the cola goes :)
author iive
date Wed, 20 Jul 2005 01:22:24 +0000
parents 46a8dc7bb562
children 4d8489f21983
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15587
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
1 #!/bin/sh
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
2 #
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
3 # Collects all the appropriate subtitle files in a given directory and
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
4 # it's subdirectories. No matter what the filename is.
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
5 # Use this together as: mplayer -sub `subsearch3.sh` movie
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
6 # Author: Alex
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
7 #
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
8
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
9 [ $1 ] && cd `dirname $1`
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
10
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
11 _sub_names=""
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
12
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
13 one_dir_search() {
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
14 for i in $dir/*
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
15 do
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
16 case "`echo $i | tr [:upper:] [:lower:]`" in
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
17 *.sub|*.srt|*.mps|*.txt) _sub_names="$i,$_sub_names" ;;
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
18 *) ;;
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
19 esac
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
20 done
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
21 }
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
22
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
23 dir="."
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
24 one_dir_search
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
25
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
26 # add subdirectories too
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
27 for dir in *
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
28 do
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
29 [ -d $dir ] && one_dir_search
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
30 done
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
31
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
32 _len="`echo $_sub_names | wc -c`"
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
33 _len=$((_len-2))
46a8dc7bb562 very dummy script, written for a friend
alex
parents:
diff changeset
34 echo $_sub_names | cut -b -"$_len"