Changing to Last Channel Viewed

dsmithdsmith Junior MemberPosts: 28
Hello.

I would like press the "View Last Channel" buuton to my touch panel and the program remembers the current TV channel & switches back even if I change the channel. Also, my other problem my cablle system uses 2-999 for SD and 1000 and higher for HD. The length string command works for three digits but if but if I change the line to <5 then if adds another digit to the @TXT 1 box. I don't have an "enter" button on my panel, for the cable box changes when I stop pressing buttons. Thanks for the help.

My current code......
(******* THIS ARRAY IS DEFINED ABOVE IN DEFINE_VARIABLE SECTION *******************)
//NON_VOLATILE INTEGER TUNER_BTNS[] = {48,49,50,51,52,53,54,55,56,57}
(******* *******************)

BUTTON_EVENT[vdvTP,TUNER_BTNS] // ALL 10 TUNER BUTTONS (TUNER_BTNS IS AN ARRAY)
{
PUSH: // ACCUMULATE DATA AND DISPLAY IN BUTTON 1 ON PANEL
{
LOCAL_VAR BTN // DECLARE A LOCAL INTEGER VARIABLE (MUST BE *FIRST* UNDER PUSH)
BTN = (GET_LAST(TUNER_BTNS)) // GET_LAST GIVES ARRAY *POSITION* OF PUSHED BUTTON
PULSE[BUTTON.INPUT] // FEEDBACK TO BUTTON PUSHED
CH = "CH,ITOA(BTN)" // ADD NEW DIGIT
IF(LENGTH_STRING(CH) < 4) // 3 OR LESS DIGITS
{
SEND_COMMAND vdvTP,"'@TXT',1,CH" // UPDATE NUMBER IN TP BUTTON
CURRENT_CHANNEL = ATOI(CH)
}

ELSE // IMMEDIATE ERROR MESSAGE AND CLEAR VARIABLE
{
SEND_COMMAND vdvTP,'ADBEEP' // ERROR BEEPS
SEND_COMMAND vdvTP,"'@TXT',1,'ERROR'" // ERROR MESSAGE TO PANEL
WAIT 8
{
SEND_COMMAND vdvTP,'ADBEEP'
SEND_COMMAND vdvTP,"'@TXT',1,''" // CLEAR SCREEN
CH = '' // CLEAR VARIABLE
}
}
}
}

Comments

  • John NagyJohn Nagy CineTouch Product Manager Posts: 1,502
    This can be a long road to partial function.
    What if you hesitate while keying in "501" so you get 50, then 1? What's the last channel? What if you use channel up or down? What if you use the guide, scroll to new sections, and press select? What if the dvr changes the channel to record?

    Maybe you could put in a TiVo cable box, and send it the command for LAST CHANNEL?
  • dsmithdsmith Junior Member Posts: 28
    How would you do partial functionality?
  • ericmedleyericmedley Senior Member - 3709 Posts Posts: 4,156
    I personally think such a function fits into the category of 'good idea in theory but not-so-good in practice". John is bringing up a good point. The bottom line is that you have no way of knowing what the receiver is doing. So, you're trusting that things A) happened as you expected and B) nothing has changed due to causes outside the control system. In bot cases your expected result is going to be wrong from the user's eyes. When the system gets horsed up because of some anomaly such as the one described ny John, the system is going to think the 'last channel' was 50 when that is not what the user expected at all. The user's experience is that the cable vox just went crazy and went from my last channel(say 204) to channel 50 then to channel 1. When he hits the last channel button, the system will dutifully go back to channel 1. So, the user thinks the stupid control system just went to three wrong channels.

    I tend to not over promise functionality to clients if I cannot verify all parts of a particular system involved in making that functionality reliable. In my experience the client NEVER blames the gear hooks up to the control system. Their first scape goat is the control system.

    Just sayin...
  • dsmithdsmith Junior Member Posts: 28
    Guess I'm stuck looking at the TV (haha). Seriously, thanks for your responses.

    D Smith
  • pdabrowskipdabrowski Aussie Guy Posts: 184
    Another trap for young players on this is even if you utilise the STB or TV's LAST_CHANNEL command, it can get screwed up by the device itself.

    For example I have experienced some STB's only recalling the last channel directly entered via the number buttons. But not when changing with CH+/-

    In that case those channels cycled through with the CH+/- are not recalled with LAST_CHANNEL
Sign In or Register to comment.