(IR) Channel Number Macro

Share projects you have created or look at projects that others have made.
Post Reply
Posts: 26
Joined: Mon Jul 16, 2012 3:36 pm

(IR) Channel Number Macro

Post by gimbers » Wed Feb 05, 2014 11:07 am

Hello All,

Familiar situation - you have a template with some favourite channels and then either Sky move all the channels around, or you get a client that is Sport mad, not Movie mad, and you have to change three Commands to get the new channel number.

I thought, why not just change a Number? PEP2 used to have a Channel Macro feature like this so I thought I would try and re-create it.

Not as easy as it sounds for an idiot like me. I have spent hours working this out, many more hours than it would have taken me just to change those three Commands to get BBC1 on 141 and not have my clients watching BBC Alba on 143 and then pressing CH-, CH- for months! Nothing wrong with BBC Alba by the way.

So attached is a template that you should be able to adapt/copy as necessary to your means.
~ It is set up for portrait iPad using 2.138.
~ I have put two sources in the project so you can see how one macro can change the channel for Sky and TV - it could be any number of sources. Select a source before you press a channel. This is meant to mimic two source control on separate sub-pages.
~ The channel range is limited to 0-999, but could be adapted to four digits if you needed it.
~ I have included some Labels so you can see the channel number pressed, but these are not strictly neccessary and can be deleted.
~ The macro takes 1 second to complete to allow a slight pause between IR commands. This can be adjusted to your taste.

First of all some Questions that I have come across during development of this macro that DemoPad might like to comment on:

1. You cannot perform actions on a [Number] to set another [Number]. So you cannot set [Number A] to be [Number B][*]100. You have to set [Number A] to equal [Number B], then set [Number A] to be [*]100.

2. Suppose [Number A] is 651. If you set [Number A] to be [/]100 it does not equal 6 or 7, but somewhere in between, presumably 6.51?

3. But, if you then set [Number B] to be [Number A], [Number B] does equal 6, not 6.51. The decimal significance appears to be lost?

4. I have an IR device with a Command called "Digit_1". If you set [Number A] to be 1, you can't manually enter a Command "Digit_[Number A]".
You have to set up Custom Actions for the [Number]. So if [Number A] is between 1 and 1, send the Command Digit_1, etc... Could this count as a feature request?

Nitty Gritty:
In the project I have assumed that the channel number is 651. The Notes for each operation explain what is happening to that particular number.

So when you set [#ch] by pressing your favourite channel, it copies itself to [#ch_temp] and [#ch_100s]

The Macro performs the following functions:

[Number] Action Result
[#ch] 651
[#ch_temp] [#ch] 651
[#ch_100s] [#ch] 651
[#ch_100s] [/]100 6.51
[#ch_1st] [#ch_100s] 6
[#ch_100s] [#ch_1st] 6, not 6.51 (this step is necessary, as are they all!)
[#ch_100s] [*]100 600
[#ch_temp] [-][#ch_100s] Remainder=51
[#ch_10s] [#ch_temp] 51
[#ch_10s] [/]10 5.1
[#ch_2nd] [#ch_10s] 5
[#ch_10s] [#ch_2nd] 5, not 5.1 (as above)
[#ch_10s] [*]10 50
[#ch_temp] [-][#ch_10s] Remainder=1
[#ch_3rd] [#ch_temp] 1

There are then a couple of actions to reset the 3rd Digit and the Macro itself.

I hope someone finds this useful, and if there's an easier way to do it, I would love to know how!

You do not have the required permissions to view the files attached to this post.

Post Reply