[mythtv-users] Flag to allow channel change script to know

auric auric at aanet.com.au
Sat Jan 15 02:37:59 UTC 2011

> Date: Thu, 13 Jan 2011 14:27:33 +0100
> From: Michael PARKER <michael.parker at st.com>
> Subject: [mythtv-users] Flag to allow channel change script to know
> 	whether you're watching Live TV?
> To: Discussion about MythTV <mythtv-users at mythtv.org>
> Message-ID:
> 	<A3BF01DB4A606149A4C20C4C4C808F6C2A2E29218F at SAFEX1MAIL1.st.com>
> Content-Type: text/plain; charset="us-ascii"
> Does anyone know of a convenient way for my channel change script to determine whether it has been invoked from a Live TV session?
> I'm trying to incorporate some functionality into my script to "clean up" any OSD elements (TV guide, favourites etc.) on my STB output before beginning a scheduled recording. Given that the detection and correction of unwanted elements takes a few seconds, I'm keen to only use it for scheduled recordings and not for every channel change in Live TV.
> I guess that looking for a Live TV start-up message in the backend log might suffice, but would appreciate thoughts etc. on a more elegant approach. Could a flag even be made available via the channel change call from Myth, much in the same way the channel.freqid is passed?
> There's a limit to how much TV you can watch through a minute PiP window because the wife inadvertantly pressed the Guide button on the remote before heading off to bed....
> Thanks in advance,
> Mike

Michael, Here's what I do. You can see the full script at
http://web.aanet.com.au/~auric/?q=node/9 which you can check to see how
CHANID and STARTTIME are found.

islivetv() {
local CHANID="$1"
local STARTTIME="$2"
        DATA=$(mysql --batch --skip-column-names --user=${DBUserName}
--password=${DBPassword} -h ${DBHostName} ${DBName} <<-EOF
        select count(*) from inuseprograms where chanid = $CHANID and
starttime = $STARTTIME and (recusage = "recorder" or recusage =
        [ "$DATA" = 2 ] && return 0 || return 1


More information about the mythtv-users mailing list