BeyondTV Integration Lessons Learned

title says it all

BeyondTV Integration Lessons Learned

Postby bobbo on Sun Jun 19, 2005 2:58 am

I've been working with integrating BeyondTV into XLobby for several months now, and I've learned a few things along the way. (Maybe I did this because I was too cheap to BeyondMedia, or maybe because I found Mediaplayer Classic was better at viewing wirelessly-networked video on my client laptop than BTV-Link. Mostly because I'm a tinkerer at heart.)

I've also put together a skin that mimics BTV's interface to increase the WAF. But don't ask me to post it, because most of the images come from Snapstream (look in "C:\Program Files\SnapStream Media\Beyond TV 3\FSMedia\Images"), and the rest from Colby. Anyway, here are my tips:

* BTV Command-line calls: http://www.snapstream.com/support/help_file/btv/commandlinecalls.htm

* Don't bother with the "exclusivefs" mode, once you switch active windows (including xmovewindow) it goes back to "windowed".

* Speaking of xmovewindow, I don't use it because there are no documented API commands. If someone wants to reverse-engineer these (spy or girder?), please post! Still not the best solution, because in my experience an undocumented API tends to change with the new versions.

* In BTV, I setup multiple recording folders (e.g. "Sports", "Dramas", "Kids" etc.) and select the appropriate folder when I select a show to record. Necessary step if you want some hiearchy to your shows (and easier for me than setting up DB filtering in my Xlobby skin).

* Here are the meta-masks you need to import your videos:

\\(?<folder>.*)\\(?<name>.*)-20(?<year>.*)-(?<month>.*)-(?<day>.*)-(?<part>.*)\..*mpg
\\(?<name>.*)-20(?<year>.*)-(?<month>.*)-(?<day>.*)-(?<part>.*)\..*mpg
(Import Type=custom, Folder=container)

* In my skin, the category is setup as:

database=videos
display=%name% %month%-%day%-%year%
layout=nocover default
(folders get two little dashes after them, but its more readable than plain old file names)

* BTV prevents any screen-saver or power-saver from coming on when the ViewScape is open, no way to override it. I added a timer event to shutdown the ViewScape at 2am (we're always asleep by then) so power-saver can kick in overnight. The "/closegui" switch does the trick.

* Once you're in BTV there's no shortcut back to Xlobby, so my trick uses my ATI RemoteWonder. I just map the "A" button to switch to Xlobby, and the "B" button to switch to BeyondTV using cmdow:

http://www.commandline.co.uk/cmdow/
A button: "c:\tools\cmdow.exe "xlobby" /ACT"
B button: "C:\Program Files\SnapStream Media\Beyond TV 3\BTVD3DShell.exe" (only one BTV GUI can run at a time, so you just call the executable and the GUI comes up, whether it's running or not)

* My laptop is a Xlobby fat client, so although the skin is the same between the server and client, you have to go in and change the directory of the "execute file" commands for BTV:

on server: "C:\Program Files\SnapStream Media\Beyond TV 3\BTVD3DShell.exe"
on client: "C:\Program Files\SnapStream Media\Beyond TV Link\BTVD3DShell.exe"

Hope someone finds my ramblings here useful.
bobbo
 
Posts: 5
Joined: Sat Jun 18, 2005 11:53 pm

Postby bobbo on Sun May 14, 2006 6:29 pm

A year later, I'm getting back around to working on BeyondTV integration. I had a breakthrough Friday night by attempting to reverse-engineer the ATI remote wonder plug-in:

* Using http://www.windows-spy.com/, I watched the messages coming to BeyondTV when I pressed remote buttons. Lo and behold, they looked just like keyboard events!

* Since BeyondTV is completely controllable by the keyboard, I looked up the virtual key ID's on MSDN.

* Using info from this post, I created a "send message" event in XLobby:

Class Name = Streamzap.WM.D3D
Window Name = Beyond TV
Message = WM_KEYDOWN
wParam = <integer number indicating the VK code>
iParam = 0

* For example, set wParam = 32 (that's the space bar), now you've got a Xlobby event that pauses BeyondTV. By the way, this method will work for any program that can be controlled by keyboard shortcuts.

* If you wanted to be really picky, you ought to send a WM_KEYDOWN, wait 100ms, then a WM_KEYUP to simulate a real key press. BTV doesn't seem to wait for the key up, so I didn't bother with that in my skin. (It might be necessary if your app had a shift+key combination.)

Below is my events code for BeyondTV control. Now I don't have to worry about switching focus between XL and BTV in my skin, plus now I can create a PPC remote skin to control BTV. Now I just need to find the time to finish the skin!

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<events>
 <event>
  <name>0</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>48</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>1</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>49</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>2</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>50</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>3</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>51</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>4</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>52</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>5</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>53</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>6</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>54</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>7</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>55</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>8</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>56</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>9</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>57</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>fast forward (right arrow)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>39</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>help (F1)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>112</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>info (I)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>73</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>launch beyondtv</name>
  <commands>
   <command>
    <type>music</type>
    <execute>pause</execute>
   </command>
   <command>
    <type>os</type>
    <execute>execute file</execute>
    <parameter>C:\Program Files\SnapStream Media\Beyond TV 3\BTVD3DShell.exe</parameter>
    <parameter>/startscreen livetv</parameter>
    <parameter></parameter>
    <parameter></parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>launch livetv</name>
  <commands>
   <command>
    <type>music</type>
    <execute>pause</execute>
   </command>
   <command>
    <type>os</type>
    <execute>execute file</execute>
    <parameter>C:\Program Files\SnapStream Media\Beyond TV 3\BTVD3DShell.exe</parameter>
    <parameter>/startscreen livetv</parameter>
    <parameter></parameter>
    <parameter></parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>mute (M)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>77</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>pause</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>81</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>play (P)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>80</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>previous (Esc)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>27</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>rewind (left arrow)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>37</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>select (Enter)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>13</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>show guide (F7)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>118</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>show home screen (Home)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>36</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>show library (F5)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>116</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>skip back (comma)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>188</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>skip forward (period)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>190</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>smartskip back (down arrow)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>40</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>smartskip forward (up arrow)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>38</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>stop (S)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>83</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>toggle sound effects (Q)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>81</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>toggle transparent guide (E)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>69</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>volume down (Z)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>90</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>volume up (A)</name>
  <commands>
   <command>
    <type>os</type>
    <execute>send message</execute>
    <parameter>Streamzap.WM.D3D</parameter>
    <parameter>Beyond TV</parameter>
    <parameter>WM_KEYDOWN</parameter>
    <parameter>65</parameter>
    <parameter>0</parameter>
   </command>
  </commands>
 </event>
 <event>
  <name>close viewscape</name>
  <commands>
   <command>
    <type>os</type>
    <execute>execute file</execute>
    <parameter>C:\Program Files\SnapStream Media\Beyond TV 3\BTVD3DShell.exe</parameter>
    <parameter>/closegui</parameter>
    <parameter></parameter>
    <parameter></parameter>
   </command>
  </commands>
 </event>
</events>
bobbo
 
Posts: 5
Joined: Sat Jun 18, 2005 11:53 pm

Postby doctor15 on Wed Jul 26, 2006 8:03 pm

Has anyone integrated with Beyond TV 4?

Is there anything I need to change?
doctor15
 
Posts: 5
Joined: Wed Jul 12, 2006 6:44 pm

Postby buymeapc on Tue Oct 31, 2006 1:38 pm

Well, I have sorta/kinda...

I used a somewhat different approach.

What I did was:
I created a TV page - linked from the main menu
Used XMoveWindow and linked it to BTV
Created some buttons - Go to Recorded Shows/Go to Live TV/Go to TV Guide/Make BTV window fullscreen
Created a script to display my upcoming recordings and their info
Created another script to toggle between xlobby and BTV so I can control both with the remote and still be able to use the buttons in the BTV GUI.

I also used Badabing's BONG skin - thanks Bada!

Here's a quick screenie

If anyone would like more detail, just let me know. :D
buymeapc
 
Posts: 59
Joined: Wed Mar 22, 2006 5:53 pm

Postby vicom on Tue Oct 31, 2006 2:47 pm

Just got BTV 4 and a Hauppage PVR 500MCE Dual Tuner card, need to integrate BTV 4 with XL ..please share the scripts..
vicom
 
Posts: 206
Joined: Tue Apr 20, 2004 6:16 am
Location: South Africa

Postby buymeapc on Tue Oct 31, 2006 3:10 pm

The scripts I created, I hard-coded paths into it for my htpc. They probably wouldn't work on anyone else's PC. :oops:

The only script that I have made useable by anyone is the one that displays the upcoming recordings from BTV.

If you would like that one, I could share it. I gotta find a file hosting site, though...

***EDIT*** See Plugin thread: here
buymeapc
 
Posts: 59
Joined: Wed Mar 22, 2006 5:53 pm