Changing to Last Channel Viewed
dsmith
Posts: 30
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
}
}
}
}
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
}
}
}
}
0
Comments
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?
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...
D Smith
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