Linux-DVB-DVBT-Apps-QuartzPVR
view release on metacpan or search on metacpan
php/listings.php view on Meta::CPAN
{
$STATUS = array() ;
eval("$php") ;
$json = $this->_json_from_hash($json, $STATUS) ;
if (array_key_exists("BUSY", $STATUS))
{
if ($STATUS["BUSY"])
{
array_push($messages, "Adapter already busy, please try again later ") ;
}
}
}
else
{
$json = "{}" ;
}
$this->debug_log_msg(" + json=$json\n") ;
## Handle errors
scripts/dvbt-qpvr-scan view on Meta::CPAN
## die on *any* error, so there is no error checking in this script
##
my $dvb = Linux::DVB::DVBT->new(
'adapter' => $adap,
'scan_cb_start' => \&scan_cb,
'scan_cb_end' => \&scan_cb,
'scan_cb_loop_start' => \&scan_cb,
'scan_cb_loop_end' => \&scan_cb,
) ;
## see if frontend is currently busy
my $frontend_busy = $dvb->is_busy() ;
if ($frontend_busy)
{
print "Fontend busy!\n" ;
## Finish off
my %info = (
'complete' => 1,
'estimated_percent' => 0,
'busy' => 1,
) ;
write_log(\%info, 0) ;
exit 1 ;
}
# set options
$dvb->config_path($config) if $config ;
if ($clean)
{
$dvb->merge(0) ;
scripts/dvbt-qpvr-scan view on Meta::CPAN
#---------------------------------------------------------------------------------
sub write_log
{
my ($info_href, $append) = @_ ;
$info_href ||= {} ;
my $curr_freq = 0 ;
my $percent = 0 ;
my $busy = 0 ;
if (exists($info_href->{'estimated_percent'}))
{
$percent = $info_href->{'estimated_percent'} ;
}
if (exists($info_href->{'current_freq'}) && $info_href->{'current_freq'})
{
$curr_freq = $info_href->{'current_freq'} ;
}
if (exists($info_href->{'busy'}))
{
$busy = $info_href->{'busy'} ;
}
# Write out record - build in memory then write once
my @record = ($START_RECORD) ;
push @record, "PID = $$" ;
push @record, "BUSY = $busy" ;
push @record, "PERCENT = $percent" ;
push @record, "FREQ = $curr_freq" ;
if (exists($info_href->{'scan_info'}))
{
## Channels
if (exists($info_href->{'scan_info'}{'pr'}))
{
push @record, "CHANNELS:" ;
my $progs_href = $info_href->{'scan_info'}{'pr'} ;
( run in 0.295 second using v1.01-cache-2.11-cpan-87723dcf8b7 )