NAME
Linux::DVB::DVBT::Utils - DVBT utilities
SYNOPSIS
use Linux::DVB::DVBT::Utils ;
DESCRIPTION
Module provides a set of useful miscellaneous utility routines used by the DVBT module. You may use them in your own scripts if you wish to (I mainly use the time coversion functions in my scripts).
Functions
- time2mins($time)
-
Convert time (in HH:MM format) into minutes
- mins2time($mins)
-
Convert minutes into time (in HH:MM format)
- secs2time($secs)
-
Convert seconds into time (in HH:MM:SS format)
- duration($start, $end)
-
Calculate duration in minutes between start and end times (in HH:MM format)
- time2secs($time)
-
Convert time (in HH:MM, HH:MM:SS, or MM format) into seconds
- timesec2secs($time)
-
Convert time (in HH:MM, HH:MM:SS, or SS format) into seconds
(i.e. if integer value is specified, treat it as a time in seconds rather than minutes)
EPG Functions
- text($text)
-
(Used by EPG function)
Ensure text returned by epg() is formatted as text.
- genre($cat)
-
(Used by EPG function)
Convert category code into genre string.
- fix_title($title_ref, $synopsis_ref)
-
(Used by EPG function)
Fix title when title is truncated by ellipses and the synopsis continues the title.
For example:
title = Julian Fellowes Investigates... synopsis = ...a Most Mysterious Murder. The Case of xxxx
Returns:
title = Julian Fellowes Investigates a Most Mysterious Murder. synopsis = The Case of xxxx
- fix_synopsis($title_ref, $synopsis_ref, $new_prog_ref)
-
(Used by EPG function)
Checks the synopsis for any indication that this is a new program/series.
Examples of supported new program indication are:
New. Brand new ****. All new ****.
Also removes extraneous information like:
Also in HD.
- fix_episodes($title_ref, $synopsis_ref, $episode_ref, $num_episodes_ref)
-
(Used by EPG function)
Checks the synopsis for mention of episodes and removes this information if found (setting the $episode_ref and $num_episodes_ref refs accordingly).
Examples of supported episode descriptions are:
(part 1 of 7) 1/7 Episode 1 of 7
- fix_audio($title_ref, $synopsis_ref, $flags_href)
-
(Used by EPG function)
Searches the synopsis string and removes any audio information, adding the information to the $flags HASH reference.
The flags supported are:
'AD' => 'is_audio_described', 'S' => 'is_subtitled', 'SL' => 'is_deaf_signed',
- subtitle($synopsis_ref, $subtitle_ref, $genre_ref)
-
Extracts a sub-title from the synopsis. Looks for text of the format:
Some sort of subtitle: the rest of the synopsis....
And returns the sentence before the ':' i.e.
Some sort of subtitle
Returns empty string if not found.
NOTE: Not to be confused with subtitling for the hard of hearing!
- subtitle($synopsis)
-
Same as "subtitle($synopsis_ref, $subtitle_ref, $genre_ref)" but supports old-style interface.