Author Topic: looking for Help: changing channels in PseudoTV Live  (Read 5731 times)

0 Members and 2 Guests are viewing this topic.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
looking for Help: changing channels in PseudoTV Live
« on: January 11, 2015, 11:38:55 PM »
UPDATE: finished the PTVL changing channels by names group http://voxcommando.com/forum/index.php?topic=1959.msg16925#msg16925



looking for some help

I'm trying to redo the current way that i change to a specific channel in PseudoTV Live with VC.
right now i have a separate command for each channel

this one is for channel 301


what I'm trying to do is use a payload xml with the channel names and channel numbers so i can cut down on the amount of commands i need to change the channel,
I'm wondering if there would be another way to send 2 or 3 digits at the same time so i can carry them in a payload, instead of having to make a command for each channel?

any help would be great, thanks


EDIT: looks like I might be able to use SendKeys to change the channel with 2 and 3 digit numbers
« Last Edit: January 13, 2015, 03:49:17 PM by PegLegTV »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: looking for Help: changing channels in PseudoTV Live
« Reply #1 on: January 12, 2015, 08:01:44 AM »
Do you really need to send text instead of actual digits when using xjson.btn.kb. ?

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: looking for Help: changing channels in PseudoTV Live
« Reply #2 on: January 12, 2015, 12:30:13 PM »
Do you really need to send text instead of actual digits when using xjson.btn.kb. ?
yep,

I've tried remote.xml ,keyboard.xml and no keymap at all and they all gave me the same results with the numbers,
i need to send the numbers individually with text  ::confused

when I get done with my PTVL setup I'll make sure I upload it,  ;D

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: looking for Help: changing channels in PseudoTV Live
« Reply #3 on: January 12, 2015, 01:45:13 PM »
Try this test.

I can't get PseudoTV Live to work in Helix and I don't have anything else that seems to respond to pressing number keys.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.4-->
<command id="459" name="number keys" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>(\d)</param>
      <param />
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Input.ExecuteAction</param>
      <param>"action":"number{Match.{i}}"</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Input.ExecuteAction</param>
      <param>"action":"enter"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>sudo channel</phrase>
  <payloadList>123, 154</payloadList>
</command>

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: looking for Help: changing channels in PseudoTV Live
« Reply #4 on: January 12, 2015, 02:11:24 PM »
works great for the numbers, i had to change the enter action to xjson.btn.kb enter

the other enter action didn't work for me i also tried to switch enter to return but no luck

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.1.0-->
<command id="459" name="number keys" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>(\d)</param>
      <param />
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Input.ExecuteAction</param>
      <param>"action":"number{Match.{i}}"</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Input.ExecuteAction</param>
      <param>"action":"enter"</param>
    </params>
    <cmdRepeat>0</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Btn.KB</cmdType>
    <params>
      <param>enter</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>sudo channel</phrase>
  <payloadList>100, 154</payloadList>
</command>


 8) thanks for the command

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: looking for Help: changing channels in PseudoTV Live
« Reply #5 on: January 12, 2015, 05:49:39 PM »
it might work with

"action":"select"

actually you can look in keyboard.xml to see what valid actions are, but also on the kodi json rpc v6 docs.

...and if so, it is probably better to keep them all using the same method. 


http://kodi.wiki/view/JSON-RPC_API/v6#Input.Action

follow link and then click "show" just below the title that says "6.9.1 Input.Action"

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: looking for Help: changing channels in PseudoTV Live
« Reply #6 on: January 12, 2015, 07:17:55 PM »
thanks for the link,  ;D switching it to select worked

I'm setting up a command that will scrape settings2.xml for PTVL to add channel names and numbers to payload.xml

so far I have found that I will have to use "set channel name" for rule 1 on every channel that is created, (only a pain the first time around) now im working on eliminating the channels that are marked as "do not play"

will update when finished

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: looking for Help: changing channels in PseudoTV Live
« Reply #7 on: January 13, 2015, 03:46:57 PM »
Changing channels by channel name in Pseudo TV LIVE,


this group of commands is used to change channels based on channel names

the first command will use the settings2.xml from PTVL add-on to create a map table "PTVL" and a  PTVL.xml payload in your xbmc payloads folder

YOU NEED TO RENAME ALL CHANNELS WITH THE 1ST RULE IN THE PTVL CHANNEL CONFIGURATION

this will remove channels marked as "do not play" and channels that have been removed from your channel configuration but are still in your settings2.xml from the payload xml

the second command is used for changing the channels 

PTVL by channel name:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.1.0-->
<commandGroup open="True" name="PTVL by channel name" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="201" name="UPDATE PTVL " enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="&quot;5&quot; = channels that are marked as do not play &#xD;&#xA;&#xD;&#xA;&quot;9999&quot; = channels that have been removed ">
    <action>
      <cmdType>Map.DropTable</cmdType>
      <params>
        <param>PTVL</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.CreateTable</cmdType>
      <params>
        <param>PTVL</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>File.Read</cmdType>
      <params>
        <param>{Path.Appdata}\XBMC\userdata\addon_data\script.pseudotv.live\settings2.xml</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>Channel_(.*?)_rule_1_opt_1"\Wvalue="(.*?)"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Set</cmdType>
      <params>
        <param>PTVL</param>
        <param>{Match.{i}.1}</param>
        <param>{Match.{i}.2}</param>
      </params>
      <cmdRepeat>{#M}</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;"5"</ifParams>
      <then>
        <action>
          <cmdType>Results.RegEx</cmdType>
          <params>
            <param>Channel_(.*?)_rule_\d_id"\Wvalue="5"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Map.Query</cmdType>
          <params>
            <param>delete from PTVL where fromKey="{Match.{i}.1}"</param>
          </params>
          <cmdRepeat>{#M}</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;"9999"</ifParams>
      <then>
        <action>
          <cmdType>Results.RegEx</cmdType>
          <params>
            <param>Channel_(.*?)_type"\Wvalue="9999"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Map.Query</cmdType>
          <params>
            <param>delete from PTVL where fromKey="{Match.{i}.1}"</param>
          </params>
          <cmdRepeat>{#M}</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>Map.ExportPayloadXML</cmdType>
      <params>
        <param>{Path.VC}\XbmcPayloads\PTVL.xml</param>
        <param>PTVL</param>
        <param>True</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Update sudo TV live</phrase>
  </command>
  <command id="507" name="PTVL channels" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>changing to {PF.1} channel</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>(\d)</param>
        <param />
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Input.ExecuteAction</param>
        <param>"action":"number{Match.{i}}"</param>
      </params>
      <cmdRepeat>{#M}</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Input.ExecuteAction</param>
        <param>"action":"select"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Watch </phrase>
    <phrase optional="true">The</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\PTVL.xml</payloadFromXML>
    <phrase optional="true">Channel, Network</phrase>
  </command>
</commandGroup>

NOTE: If you use eventghost, PTVL has eventghost triggers that you could use to have your PTVL payload update every time you start or stop PTVL

thanks for the help with the numbers input jitterjames  ;D
« Last Edit: January 13, 2015, 06:40:16 PM by PegLegTV »