
require './burner-lib.pl';

sub config_form
{
print "<tr> <td><b>$text{'config_cdrecord'}</b></td>\n";
printf "<td><input name=cdrecord size=30 value='%s'> %s</td> </tr>\n",
	$_[0]->{'cdrecord'}, &file_chooser_button("cdrecord");

print "<tr> <td><b>$text{'config_mkisofs'}</b></td>\n";
printf "<td><input name=mkisofs size=30 value='%s'> %s</td> </tr>\n",
	$_[0]->{'mkisofs'}, &file_chooser_button("mkisofs");

print "<tr> <td><b>$text{'config_mpg123'}</b></td>\n";
printf "<td><input name=mpg123 size=30 value='%s'> %s</td> </tr>\n",
	$_[0]->{'mpg123'}, &file_chooser_button("mpg123");

print "<tr> <td><b>$text{'config_sox'}</b></td>\n";
printf "<td><input name=sox size=30 value='%s'> %s</td> </tr>\n",
	$_[0]->{'sox'}, &file_chooser_button("sox");

print "<tr> <td><b>$text{'config_cdrdao'}</b></td>\n";
printf "<td><input name=cdrdao size=30 value='%s'> %s</td> </tr>\n",
	$_[0]->{'cdrdao'}, &file_chooser_button("cdrdao");

print "<tr> <td><b>$text{'config_temp'}</b></td> <td>\n";
printf "<input type=radio name=temp_def value=1 %s> %s\n",
	$_[0]->{'temp'} ? "" : "checked", $text{'config_temp_def'};
printf "<input type=radio name=temp_def value=0 %s>\n",
	$_[0]->{'temp'} ? "checked" : "";
printf "<input name=temp size=30 value='%s'></td> </tr>\n",
	$_[0]->{'temp'};
}

sub config_save
{
&has_command($in{'cdrecord'}) || &error($text{'config_ecdrecord'});
$_[0]->{'cdrecord'} = $in{'cdrecord'};

#&has_command($in{'mkisofs'}) || &error($text{'config_emkisofs'});
$_[0]->{'mkisofs'} = $in{'mkisofs'};

#&has_command($in{'mpg123'}) || &error($text{'config_empg123'});
$_[0]->{'mpg123'} = $in{'mpg123'};

#&has_command($in{'sox'}) || &error($text{'config_esox'});
$_[0]->{'sox'} = $in{'sox'};

#&has_command($in{'cdrdao'}) || &error($text{'config_ecdrdao'});
$_[0]->{'cdrdao'} = $in{'cdrdao'};

if ($in{'temp_def'}) {
	$_[0]->{'temp'} = undef;
	}
else {
	-d $in{'temp'} || &error($text{'config_etemp'});
	$_[0]->{'temp'} = $in{'temp'};
	}
}

