m2vmp2cut-0.63-dev/ANNOUNCE m2vmp2cut-0.65-dev/ANNOUNCE
1Last committed: $Id: ANNOUNCE 2059 2008-05-09 20:24:28Z too $1Last committed: $Id: ANNOUNCE 2101 2008-05-26 19:57:03Z too $
22
3ANNOUNCE for m2vmp2cut 0.63 (Epic Fail):3ANNOUNCE for m2vmp2cut 0.65 (Faux pas):
44
5This is development release of m2vmp2cut -- frame accurate (currently PAL)5This is development release of m2vmp2cut -- frame accurate (currently PAL)
6mpeg2 video (m2v file) with accompanied mp2 audio (mp2 file) cutter.6mpeg2 video (m2v file) with accompanied mp2 audio (mp2 file) cutter.
1313
14This software is available currently at http://www.iki.fi/too/sw/m2vmp2cut/14This software is available currently at http://www.iki.fi/too/sw/m2vmp2cut/
15and is licensed under GNU Public License (GPL).15and is licensed under GNU Public License (GPL).
16
17Changes since 0.63 (r2069, Epic Fail):
18 Target size estimation
19 Keyboard control adjustments in gui
20 Bug fixes
1621
17Changes since 0.62 (r1256, Gender-neutral pronouns):22Changes since 0.62 (r1256, Gender-neutral pronouns):
18 Added graphical gui client for cutpoint selection.23 Added graphical gui client for cutpoint selection.

Only in m2vmp2cut-0.65-dev: HISTORY

m2vmp2cut-0.63-dev/INSTALL m2vmp2cut-0.65-dev/INSTALL
10After this find the location of 'projectx.jar' and symlink10After this find the location of 'projectx.jar' and symlink
11it to m2vmp2cut installation, like:11it to m2vmp2cut installation, like:
1212
13ln -s path/to/projectx.jar PREFIX/lib/m2vmpcut-0.63/bin/projectx.jar13ln -s path/to/projectx.jar PREFIX/lib/m2vmp2cut-0.65/bin/projectx.jar
1414

m2vmp2cut-0.63-dev/Makefile m2vmp2cut-0.65-dev/Makefile
33
4.PHONY: ALWAYS4.PHONY: ALWAYS
55
6install release chkprefix: VER=`sed -n '1s/ .*//p' VERSION`6install release chkprefix: VER=`sed -n '1s/ .*/-dev/p' VERSION`
7snapshot: VER=r`svnversion . | tr : +`-`sed -n '1s/ .*//p' VERSION`7snapshot: VER=`sed -n '1s/ .*//p' VERSION`+r`svnversion . | tr : =`
88
9all: ALWAYS9all: ALWAYS
10 cd src && make all10 cd src && make all
57chkrelease: SvnVersion_unmodified HISTORY57chkrelease: SvnVersion_unmodified HISTORY
58 rm -f SvnVersion58 rm -f SvnVersion
59 @case $(VER) in \59 @case $(VER) in \
60 *[1357]) ;; \60 *-dev) ;; [2468]) ;; \
61 *) echo Version $(VER) not suitable for release.; exit 1 ;; \61 *) echo Version $(VER) not suitable for release.; exit 1 ;; \
62 esac62 esac
63
64# XXX _dist depends on chkrelease. Parallel build would fail...
65.NOTPARALLEL:
6366
64release: chkrelease _dist67release: chkrelease _dist
6568
69 cd tools && sh tarlisted.c72 cd tools && sh tarlisted.c
7073
71_dist: tools/tarlisted74_dist: tools/tarlisted
72 version=m2vmp2cut-$(VER)-dev; { echo 755 root root . $$version /; \75 version=m2vmp2cut-$(VER); { echo 755 root root . $$version /; \
73 grep '^#,#' Makefile | while read _ f x; do p=755; d=$$f; \76 grep '^#,#' Makefile | while read _ f x; do p=755; d=$$f; \
74 test -d $$f && d=/ || case $$x in '') p=644;; esac; \77 test -d $$f && d=/ || case $$x in '') p=644;; esac; \
75 echo $$p root root . $$version/$$f $$d; done; } \78 echo $$p root root . $$version/$$f $$d; done; } \
97100
98#,# ANNOUNCE101#,# ANNOUNCE
99#,# COPYING102#,# COPYING
103#,# HISTORY
100#,# INSTALL104#,# INSTALL
101#,# m2vmp2cut x105#,# m2vmp2cut x
102#,# Makefile106#,# Makefile

m2vmp2cut-0.63-dev/README m2vmp2cut-0.65-dev/README
1Last committed: $Id: README 2068 2008-05-11 17:04:13Z too $1Last committed: $Id: README 2101 2008-05-26 19:57:03Z too $
22
3README for m2vmp2cut 0.63:3README for m2vmp2cut 0.65:
44
5m2vmp2cut is frame accurate (currently PAL) mpeg2 video (m2v file)5m2vmp2cut is frame accurate (currently PAL) mpeg2 video (m2v file)
6with accompanied mp2 audio (mp2 file) cutter.6with accompanied mp2 audio (mp2 file) cutter.
1818
19REQUIREMENTS:19REQUIREMENTS:
2020
21mjpegtools -- for mpeg2enc and mplex tools21Mjpegtools -- for mpeg2enc and mplex tools
22ProjecX (project-x.sourceforge.net) -- to demux source mpeg files22ProjecX (project-x.sourceforge.net) -- to demux source mpeg files
23Java runtime -- to run ProjectX23Java runtime -- to run ProjectX (some non-sun vm:s work also)
2424
25Uxterm -- for help and info windows...
25perl -- m2vmp2cut.pl (run frontend) is written in perl26Perl -- m2vmp2cut.pl (run frontend) is written in perl
26python -- some m2vmp2cut utilities are written in python27Bython -- some m2vmp2cut utilities are written in python
27bash/ksh -- /bin/sh may not be good enough for some shell script28Bash/ksh -- /bin/sh may not be good enough for some shell script
28 constructs used.29 constructs used.
2930
30C compiler -- there are some C utilities that needs to be compiled.31C compiler -- there are some C utilities that needs to be compiled
31Java Compiler -- if you need to compile ProjectX32Java compiler -- if you need to compile ProjectX
3233
33STRONGLY RECOMMENDED:34STRONGLY RECOMMENDED:
3435
35transcode -- for requantize option36Transcode -- for requantize option
3637
3738
3839

m2vmp2cut-0.63-dev/VERSION m2vmp2cut-0.65-dev/VERSION
10.63 (2008-05-09) "Epic Fail"10.65 (2008-05-26) "Faux pas"
22
3$Id: VERSION 2058 2008-05-09 19:46:48Z too $3$Id: VERSION 2101 2008-05-26 19:57:03Z too $
44
5-- use sed -n '1s/ .*//p' VERSION to read version number from this file --5-- use sed -n '1s/ .*//p' VERSION to read version number from this file --
66

m2vmp2cut-0.63-dev/bin/m2vmp2cut.pl m2vmp2cut-0.65-dev/bin/m2vmp2cut.pl
6# All rights reserved6# All rights reserved
7#7#
8# Created: Sun Sep 05 11:12:24 EEST 2004 too8# Created: Sun Sep 05 11:12:24 EEST 2004 too
9# Last modified: Fri May 09 20:17:59 EEST 2008 too9# Last modified: Mon May 26 19:57:49 EEST 2008 too
10#10#
11# This program is licensed under the GPL v2. See file COPYING for details.11# This program is licensed under the GPL v2. See file COPYING for details.
1212
215# find last line from scan output file -- it contains average bit rate.215# find last line from scan output file -- it contains average bit rate.
216216
217seek(I, -200, 2) || die "Seek failed: $!.\n";217seek(I, -200, 2) || die "Seek failed: $!.\n";
218my $avbr;218my ($allframes, $avbr);
219{219{
220 my $l;220 my $l;
221 $l = $_ while (<I>);221 $l = $_ while (<I>);
222 ($l =~ /frames\s+(\d+)\s.*abr\s+(\d+)/)
222 ($l =~ /abr\s+(\d+)/) || die "Incorrect index file format.\n";223 || die "Incorrect index file format.\n";
224 $allframes = $1;
223 $avbr = int($1 / 1000);225 $avbr = int($2 / 1000);
224}226}
227
225seek(I, 0, 0) || die "Seek failed: $!.\n";228seek(I, 0, 0) || die "Seek failed: $!.\n";
229
230my ($vsize, $asize) = ((stat $vfile)[7], (stat $afile)[7]);
231my $estimate = int(($vsize + $asize) * $frames / $allframes * 1.033);
232undef $vsize; undef $asize;
226233
227open SH, '>', "$wd/do.sh" || die "Can not create job script: $!\n";234open SH, '>', "$wd/do.sh" || die "Can not create job script: $!\n";
228chmod 0755, "$wd/do.sh";235chmod 0755, "$wd/do.sh";
239print SH << "EOF";246print SH << "EOF";
240247
241# This program is licensed under the GPL v2. See file COPYING for details.248# This program is licensed under the GPL v2. See file COPYING for details.
249
250LANG=C LC_ALL=C; export LANG LC_ALL
242251
243die () { echo "\$@" >&2; exit 1; }252die () { echo "\$@" >&2; exit 1; }
244253
253 */*) : ;; *) die mplex does not exist. please install mjpegtools ;;262 */*) : ;; *) die mplex does not exist. please install mjpegtools ;;
254esac263esac
255264
256test -d "$wd" || die Directory \\'$wd\\' does not exist.265test -d "$wd" || die Directory \\'$wd\\' does not exist '(changed working direct
ory?)'.
257vfile="$vfile"266vfile="$vfile"
258afile="$afile"267afile="$afile"
259for f in "\$vfile" "\$afile"268for f in "\$vfile" "\$afile"
446undef $s; undef $e;455undef $s; undef $e;
447$" = ',';456$" = ',';
448457
458close I;
459
449print STDERR "Related timecodes: @timecodes\n";460print STDERR "Related timecodes: @timecodes\n";
450461
451unless ($aonly)462unless ($aonly)
510 "mv -f \"$wd/incomplete.mp2\" \"$wd/out.mp2\"\n"; }521 "mv -f \"$wd/incomplete.mp2\" \"$wd/out.mp2\"\n"; }
511else { print SH "mv -f \"$wd/incomplete.mpg\" \"$wd/out.mpg\"\n"; }522else { print SH "mv -f \"$wd/incomplete.mpg\" \"$wd/out.mpg\"\n"; }
512523
513print SH "set +x\n", "ls -lrtac \"$wd\"\n; date; ls -l \"$wd/out.mpg\"\n\n";524print SH <<"EOF";
525set +x
526ls -lrtac "$wd"
527date
528EOF
529if (! $nomux) {
530 print SH "\n", 'numtune () { ', "\n";
531 print SH q( echo $1 | sed 's/\\(...\\)$/ \\1/; s/\\(...\\) / \\1 /; s/\\(
...\\) / \\1 /'; }), "\n\n";
532 print SH "echo; echo estimated size: `numtune $estimate` bytes\n";
533 print SH "size=`ls -l \"$wd\"/out.mpg | awk '{ print \$5 }'`\n";
534 print SH "echo target \"'$wd/out.mpg'\" size: `numtune \$size` bytes\n";
535 print SH "difference=`expr $estimate - \$size | tr -d -`\n";
536 print SH "echo difference: `numtune \$difference` bytes\n";
537} else {
538 print SH "ls -l \"$wd\"/out.*\n";
539}
540
541print SH "echo pictures: ", $frames, ", time: ", palframe2timecode($frames, 0),
542 "\n\n";
514543
515close SH;544close SH;
516545

m2vmp2cut-0.63-dev/bin/m2vmp2cut.sh m2vmp2cut-0.65-dev/bin/m2vmp2cut.sh
7# All rights reserved7# All rights reserved
8#8#
9# Created: Wed Apr 23 21:40:17 EEST 2008 too9# Created: Wed Apr 23 21:40:17 EEST 2008 too
10# Last modified: Sat May 10 00:24:46 EEST 2008 too10# Last modified: Mon May 19 18:37:22 EEST 2008 too
1111
12e2 () { echo "$@" >&2; }12e2 () { echo "$@" >&2; }
13die () { e2 "$@"; exit 1; }13die () { e2 "$@"; exit 1; }
51 e2 ProjectX jar file \'$pjxjar\' does not exist51 e2 ProjectX jar file \'$pjxjar\' does not exist
52 die Fix this or it\'s symbolic link reference \'$M2VMP2CUT_CMD_PATH/Pr52 die Fix this or it\'s symbolic link reference \'$M2VMP2CUT_CMD_PATH/Pr
ojectX.jar\'ojectX.jar\'
53 }53 }
54 set -x
54 dn=`dirname "$1"`; bn=`basename "$1"`55 dn=`dirname "$1"`; bn=`basename "$1"`
55 od=`echo $bn | sed 's/\.[^.]*$//'`.d56 od=`echo $bn | sed 's/\.[^.]*$//'`.d
56 test -d "$dn/$od/" && die "Directory '$dn/$od' is on the way".57 test -d "$dn/$od/" && die "Directory '$dn/$od' is on the way".
57 mkdir "$dn/$od/"58 mkdir "$dn/$od/"
58 ln -s "$1" "$dn/$od/$bn"59 ln -s "../$bn" "$dn/$od/$bn"
59 java -jar "$pjxjar" "$dn/$od/$bn"60 java -jar "$pjxjar" "$dn/$od/$bn"
60 cd "$dn/$od/"61 cd "$dn/$od/"
61 ln -s *.m2v video.m2v62 ln -s *.m2v video.m2v

m2vmp2cut-0.63-dev/bin/wrapper.sh m2vmp2cut-0.65-dev/bin/wrapper.sh
7# All rights reserved7# All rights reserved
8#8#
9# Created: Tue Apr 22 19:10:35 EEST 2008 too9# Created: Tue Apr 22 19:10:35 EEST 2008 too
10# Last modified: Fri May 09 20:21:52 EEST 2008 too10# Last modified: Wed May 14 17:35:56 EEST 2008 too
1111
12die () { echo "$@" >&2; exit 1; }12eae () { echo; echo Press ENTER to close this window '' | tr -d \\012; read _; e
xit $1; }
13
14die () { exec 1>&2; echo; echo "$@"; eae 1; }
15
16#numtune () { echo $1 | sed 's/\(...\)\(...\)\(...\)$/ \1 \2 \3/;
17# s/\(...\)\(...\)$/ \1 \2/; s/\(...\)$/ \1/'; }
18
19numtune () {
20 echo $1 | sed 's/\(...\)$/ \1/; s/\(...\) / \1 /; s/\(...\) / \1 /'
21}
22
23exec_xterm () {
24 geometry=$1
25 title=$2
26 font=-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
27 shift 2
28 exec uxterm -fg black -bg gray70 -g $geometry -T "$title" \
29 +sb -fn $font -u8 -e "$0" "$@"
30}
1331
14case $1 in32case $1 in
15 m2vcut_help)33 m2vcut_help)
16 # XXX common for utf-8 support is currently a problem. help! :)
17 exec xterm -g 76x28-0+0 -fn 10x20 -T 'M2vCut Help' +u8 -e "$0" m2vcut_ou34 exec_xterm 76x28-0+0 'M2vCut Help' m2vcut_outputhelp
tputhelp
18 ;;35 ;;
19 m2vcut_outputhelp)36 m2vcut_outputhelp)
20 f=`echo $LANG |sed 's/[^A-Za-z_].*//'`37 f=`echo $LANG |sed 's/[^A-Za-z_].*//'`
23 test -f "$helpprefix-$f" && cat "$helpprefix-$f" || cat "$helpprefix-def40 test -f "$helpprefix-$f" && cat "$helpprefix-$f" || cat "$helpprefix-def
ault"ault"
24 read line41 read line
25 ;;42 ;;
43 m2vcut_info)
44 shift
45 exec_xterm 76x20-0+0 'M2vCut Info' m2vcut_runinfo "$@"
46 ;;
47 m2vcut_runinfo)
48 #echo "$@" - $5
49 case $5 in [0-9]*) ;;
50 *) die usage: $1 videofile allframes cutframes alltime cuttime
51 ;; esac
52 shift; #set -x
53 test -f "$1" || die "'$1'": not a file.
54 fdn=`dirname "$1"` vbn=`basename "$1"`
55 case $vbn in
56 video.m2v) abn=audio.mp2 ;;
57 *.m2v) abn=`basename "$vbn" .m2v`.mp2 ;;
58 *) die File "'$vbn'" has unknown suffix. ;;
59 esac
60 test -f "$fdn/$abn" || die "'$fdn/$abn'": no such file.
61 vsize=`stat -L -c %s "$1"`
62 case $vsize in '') die File "'$1'" could not be read ;; esac
63 asize=`stat -L -c %s "$fdn/$abn"`
64 case $asize in '') die File "'$1'" could not be read ;; esac
65 echo
66 echo Input length: '' `echo $4 | sed 's/\..*//'` "($2 frames)"
67 echo Output length: `echo $5 | sed 's/\..*//'` "($3 frames)"
68 echo
69 echo Input video: $vbn '' `numtune $vsize` bytes
70 echo Input audio: $abn '' `numtune $asize` bytes
71 echo
72 tss=`expr $vsize + $asize`
73 echo Total source size: `numtune $tss` bytes
74 eds=`expr $tss \* $3 / $2`
75 echo Estimated target size: `numtune $eds` bytes
76 wmo=`expr $eds \* 1033 / 1000`
77 echo With estimated muxing '"overhead" (3.3%)': `numtune $wmo` bytes
78 #echo $fdn $vbn $abn $vsize $asize
79 eae 0
80 ;;
26 m2vcut_test)81 m2vcut_test)
27 shift82 shift
28 exec xterm -g 76x28-0+0 -fn 10x20 -T 'M2vCut Test' +u8 -e "$0" m2vcut_ru83 exec_xterm 76x28-0+0 'M2vCut Test' m2vcut_runtest "$@"
ntest "$@"
29 ;;84 ;;
30 m2vcut_runtest)85 m2vcut_runtest)
31 range=86 range=
39 mplayer "$vd"/m2vcut-test/out.mpg94 mplayer "$vd"/m2vcut-test/out.mpg
40 echo try again ?95 echo try again ?
41 read line96 read line
42 exit 097 case $line in *yes*) ;; *) exit 0 ;; esac
43 done98 done
44 ;;99 ;;
45 die)100 die)

m2vmp2cut-0.63-dev/doc/m2vcut_help-default m2vmp2cut-0.65-dev/doc/m2vcut_help-default
8Up Arrow: 1 gop (usually 1/2 sec) forward.8Up Arrow: 1 gop (usually 1/2 sec) forward.
9Down Arrow: 1 gop (usually 1/2 sec) backward.9Down Arrow: 1 gop (usually 1/2 sec) backward.
1010
11Page Up: 5 gops forward, after 7 jumps, 25 gops forward (*)11Page Up: 5 gops forward, after 20 jumps, 25 gops forward (*)
12Page Down: 5 gops backward, after 7 jumps, 25 gops forward (*)12Page Down: 5 gops backward, after 20 jumps, 25 gops forward (*)
1313
14(*) Changing Page Up/Down "direction", first time continue 25 gop.14(*) Changing Page Up/Down "direction", first time continue 25 gop.
15 jumps; after second change, go back to 5 gop jumps.15 jumps; after second change, go back to 5 gop jumps.
2424
25q: Quit, Saving cutpoints to file.25q: Quit, Saving cutpoints to file.
2626
27t: Test output around current/closest cutpoint.
28
29i: information (about estimated final file size).
2730
28Press ENTER to close this window31Press ENTER to close this window

m2vmp2cut-0.63-dev/doc/m2vcut_help-fi_FI m2vmp2cut-0.65-dev/doc/m2vcut_help-fi_FI
11
2Näppäimet:2Näppäimet:
33
4Vasen nuoli: 1 kuva taaksepäin4Vasen nuoli: 1 kuva taaksepäin
5Oikea nuoli: 1 kuva eteenpäin5Oikea nuoli: 1 kuva eteenpäin
66
7Ylänuoli: 1 gop (yleensä puoli sekuntia) eteenpäin7Ylänuoli: 1 gop (yleensä puoli sekuntia) eteenpäin
8Alanuoli: 1 gop (yleensä puoli sekuntia) taaksepäin8Alanuoli: 1 gop (yleensä puoli sekuntia) taaksepäin
99
10Page Up: 5 goppia eteenpäin, 7 hypyn jälkeen 25 goppia eteenpäin (*)10Page Up: 5 goppia eteenpäin, 20 hypyn jälkeen 25 goppia eteenpäin (*)
11Page Down: 5 goppia taaksepäin, 7 hypyn jälkeen 25 goppia taaksepäin (*)11Page Down: 5 goppia taaksepäin, 20 hypyn jälkeen 25 goppia taaksepäin (*)
1212
13(*) Vaihtaessa Page Up/Down -suuntaa, ensimmäisellä kerralla jatka 2513(*) Vaihtaessa Page Up/Down -suuntaa, ensimmäisellä kerralla jatka 25
14 gopin hyppyjä; toisen suunnan vaihdon jälkeen palaa 5 gopin hyppyihin.14 gopin hyppyjä; toisen suunnan vaihdon jälkeen palaa 5 gopin hyppyihin.
1515
16TAB: Merkitse leikkauspiste tämänhetkiseen kohtaan.16TAB: Merkitse leikkauspiste tämänhetkiseen kohtaan.
17BackSpace: Poista leikkauspiste mikäli ollaan leikkauspisteen "päällä".17BackSpace: Poista leikkauspiste mikäli ollaan leikkauspisteen "päällä".
1818
19, (pilkku): Siirry edelliseen leikkauspisteeseen nykypaikasta.19, (pilkku): Siirry edelliseen leikkauspisteeseen nykypaikasta.
20. (piste): Siirry seuraavaan leikkauspisteeseen nykypaikasta.20. (piste): Siirry seuraavaan leikkauspisteeseen nykypaikasta.
2121
22q: Lopeta, tallentaen leikkauspisteet tiedostoon.22q: Lopeta, tallentaen leikkauspisteet tiedostoon.
2323
24t: Testaa tulos lähimmän leikkauspisteen kohdalta.
25
26i: tietoa (lopullisesta tiedostokoosta).
27
24Paina ENTERiä sulkeaksesi tämän ikkunan28Paina ENTERiä sulkeaksesi tämän ikkunan

m2vmp2cut-0.63-dev/src/m2vcut-gui.c m2vmp2cut-0.65-dev/src/m2vcut-gui.c
21 * All rights reserved21 * All rights reserved
22 *22 *
23 * Created: Sun Dec 30 14:17:12 EET 2007 too23 * Created: Sun Dec 30 14:17:12 EET 2007 too
24 * Last modified: Sun May 11 18:40:11 EEST 2008 too24 * Last modified: Mon May 26 20:54:27 EEST 2008 too
25 */25 */
2626
27// later (maybe?) test, undo, append-cut/merge to file (w/htonl()))27// later (maybe?) test, undo, append-cut/merge to file (w/htonl()))
6262
63typedef unsigned int u_int; // c99 blocks this definition in <sys/types.h>63typedef unsigned int u_int; // c99 blocks this definition in <sys/types.h>
6464
65#if 165#if 0
66#define DEBUG 166#define DEBUG 1
67#define d2(x) do { printf("%d ", __LINE__); printf x; printf("\n"); } while (0)67#define d2(x) do { printf("%d ", __LINE__); printf x; printf("\n"); } while (0)
68#define d1(x) do { printf("%d ", __LINE__); printf x; printf("\n"); } while (0)68#define d1(x) do { printf("%d ", __LINE__); printf x; printf("\n"); } while (0)
1236 int h = frameno / (60 * 60 * 25); if (h >= 1000) h = 999;1236 int h = frameno / (60 * 60 * 25); if (h >= 1000) h = 999;
1237 int m = (frameno / (60 * 25)) % 60;1237 int m = (frameno / (60 * 25)) % 60;
1238 int s = (frameno / 25) % 60;1238 int s = (frameno / 25) % 60;
1239 int f = frameno % 25;1239 //int f = frameno % 25;
1240 int ms = frameno % 25 * 4;
12401241
1241 // XXX add 3rd hour digit.1242 // XXX add 3rd hour digit.
1242#if 01243#if 0
1247 utosl0(p + 0, h, 2);1248 utosl0(p + 0, h, 2);
1248 utosl0(p + 3, m, 2);1249 utosl0(p + 3, m, 2);
1249 utosl0(p + 6, s, 2);1250 utosl0(p + 6, s, 2);
1250 utosl0(p + 9, f, 2);1251 utosl0(p + 9, ms, 2);
12511252
1252 utosl(p + 12, frameno, 6);1253 utosl(p + 12, frameno, 6);
1253}1254}
1320 }1321 }
1321 label_frametime(W.labeltext + 71, frameno2);1322 label_frametime(W.labeltext + 71, frameno2);
1322 label_frametime(W.labeltext + 92, G.greenframes);1323 label_frametime(W.labeltext + 92, G.greenframes);
1324
1325 // FIXME: some info does not need to be updated always, like greenframes)
13231326
1324 int wxp = G.frame->pixwidth * G.frame->width;1327 int wxp = G.frame->pixwidth * G.frame->width;
1325 int hxp = G.frame->pixheight * G.frame->height;1328 int hxp = G.frame->pixheight * G.frame->height;
1595void previous_gop(int n)1598void previous_gop(int n)
1596{1599{
1597 if (G.currentindex == 0) return;1600 if (G.currentindex == 0) return;
1601 if (G.currentinner > 0) n--;
1598 n = G.currentindex - n;1602 n = G.currentindex - n;
1599 if (n < 0) n = 0;1603 if (n < 0) n = 0;
1600 show_iframe(n);1604 show_iframe(n);
1741 run_command(m2vmp2cut_command("wrapper.sh"), "m2vcut_help", null);1745 run_command(m2vmp2cut_command("wrapper.sh"), "m2vcut_help", null);
1742}1746}
17431747
1748static void show_info(void)
1749{
1750 char allframes[20], greenframes[20];
1751
1752 // XXX quick hack, tune label_frametime() interface
1753 memcpy(allframes, "00:00:00.00\0 0\0\0", 20);
1754 memcpy(greenframes, allframes, 20);
1755 label_frametime(allframes, G.lastframe);
1756 label_frametime(greenframes, G.greenframes);
1757
1758 char * afp = allframes + 12; while (isspace(*afp)) afp++;
1759 char * gfp = greenframes + 12; while (isspace(*gfp)) gfp++;
1760
1761 run_command(m2vmp2cut_command("wrapper.sh"), "m2vcut_info",
1762 M.mpeg2filename, afp, gfp, allframes, greenframes, null);
1763}
1764
1744gboolean main_window_delete_event(void * w, void * e, void * d)1765gboolean main_window_delete_event(void * w, void * e, void * d)
1745{1766{
1746 (void)w; (void)e; (void)d;1767 (void)w; (void)e; (void)d;
1790 case GDK_Page_Up:1811 case GDK_Page_Up:
1791 if (prevkey == GDK_Page_Up) {1812 if (prevkey == GDK_Page_Up) {
1792 keycount++;1813 keycount++;
1793 next_gop(keycount > 7? 25: 5);1814 next_gop(keycount > 20? 25: 5);
1794 break;1815 break;
1795 }1816 }
1796 else if (prevkey == GDK_Page_Down && keycount > 7) {1817 else if (prevkey == GDK_Page_Down && keycount > 20) {
1797 keycount += 10 * 1000 * 1000;1818 keycount += 10 * 1000 * 1000;
1798 if (keycount < 20 * 1000 * 1000) { next_gop(25); break; }1819 if (keycount < 20 * 1000 * 1000) { next_gop(25); break; }
1799 }1820 }
1801 case GDK_Page_Down:1822 case GDK_Page_Down:
1802 if (prevkey == GDK_Page_Down) {1823 if (prevkey == GDK_Page_Down) {
1803 keycount++;1824 keycount++;
1804 previous_gop(keycount > 7? 25: 5);1825 previous_gop(keycount > 20? 25: 5);
1805 break;1826 break;
1806 }1827 }
1807 else if (prevkey == GDK_Page_Up && keycount > 7) {1828 else if (prevkey == GDK_Page_Up && keycount > 20) {
1808 keycount += 10 * 1000 * 1000;1829 keycount += 10 * 1000 * 1000;
1809 if (keycount < 20 * 1000 * 1000) { previous_gop(25); break; }1830 if (keycount < 20 * 1000 * 1000) { previous_gop(25); break; }
1810 }1831 }
1817 case GDK_BackSpace: merge_here(); break;1838 case GDK_BackSpace: merge_here(); break;
18181839
1819 case GDK_h: show_help(); break;1840 case GDK_h: show_help(); break;
1820 1841 case GDK_i: show_info(); break;
1821 case GDK_t: test_cutpoint(); break;1842 case GDK_t: test_cutpoint(); break;
18221843
1823 case GDK_q: main_window_delete_event(null,null,null);1844 case GDK_q: main_window_delete_event(null,null,null);