3 # Script to configure mplayer
4 # based on etherconf by John Goerzen <jgoerzen@progenylinux.com>
6 use Debconf
::Client
::ConfModule
qw(:all);
9 my $version = version
(2.0);
10 title
('MPlayer Configuration');
11 my $PRIORITY = 'high';
13 my $next = 'mainmenu';
18 checkupgrade
(); # Find out if we have to upgrade.
22 open(MCFG
, "</etc/mplayer/mplayer.conf") || return 1;
24 return 1 if ($line =~ /mplayer DEBCONF AREA/);
25 exit(0) if (input
($PRIORITY, 'mplayer/replace-existing-files') eq "question skipped");
27 if (get
('mplayer/replace-existing-files') eq 'false') {
28 input
($PRIORITY, 'mplayer/replace-existing-files-bail');
38 my @retval = &$next(@nextargs);
39 # if ($retval[0] eq 'BACK') {
40 # $retval[0] = $backups{$next};
42 ($next, @nextargs) = @retval;
43 } while ($next ne 'Exit');
52 subst
("mplayer/voutput", "vochoices", "xv, xmga, mga, x11, gl, sdl, xvidix");
53 # db_subst mplayer/output vo xc,xmga,mga,x11,gl,sdl
54 exit(0) if (input
($PRIORITY, "mplayer/voutput") eq "question skipped");
56 exit 0 unless (get
("mplayer/voutput") eq 'true');
62 go
(); # To catch spare things from before
64 'Video Output: ' . scalar(get
("mplayer/voutput")));
66 $choices = join(', ', @choices);
69 subst
('mplayer/mainmenu', 'choices', $choices);
70 input
($PRIORITY, 'mplayer/mainmenu');
73 my $selection = get
('mplayer/mainmenu');
74 if ($selection =~ /^Exit/) {
79 fset
('mplayer/mainmenu', 'isdefault', 'true');
83 return 'configure' if /^Video/;
84 # return 'aoutput' if /^Aoutput/;
90 return 'mainmenu' if $isediting;
95 my $template = shift @_;
97 fset
($template, 'isdefault', 'true');