My DVDLobby HomeSeer Script - UPDATED

Tell others how you're using DVDLobby
User avatar
jrfuda
Expert
Expert
Posts: 943
Joined: Mon Oct 06, 2003 5:59 pm
Location: San Antonio, TX, USA
Contact:

My DVDLobby HomeSeer Script - UPDATED

Postby jrfuda » Thu Jan 20, 2005 2:35 pm

As some of y'all may have been following. I've been perfecting my method of getting DVDLobby and a hybrid CX777ES/HDD system to work seamlessly. Well, after some advice from you folks, purusing MSDN, and lookin at other HS scripts, I came up with this combination of MLServecmds and HS script. This script will launch a trailer from the HTPC based upon the movie's soundtrack, and then lanuch the movie from the appropriate source (777 or HDD) or switch the inputs for an offline movie (DVD or VCR).

Here's my default play movie command:

Code: Select all

MLServeCmd.Macro|MLHSPLugin|HS_Speak:Please standby!SetVariable|CHANGERLOC~<<CHANGERLOCATION>>!SetVariable|FILENAME~<<FILE>>!SetVariable|TITLE~<<TITLE>>!SetVariable|FIXEDTITLE~<<FIXEDTITLE>>!SetVariable|COLLNUMBER~<<COLLECTIONNUMBER>>!SetVariable|CHANGER~<<CHANGERNUMBER>>!SetVariable|SOUNDTRACK~<<CUSTOM1>>!SetVariable|PREFIX~<<CUSTOM2>>!MLPause|1!MLHSPLugin|HS_SetDeviceString:T2~{{TITLE}}!MLHSPLugin|HS_SetDeviceString:T3~{{FIXEDTITLE}}!MLHSPLugin|HS_SetDeviceString:T4~{{CHANGERLOC}}!MLHSPLugin|HS_SetDeviceString:T5~{{FILENAME}}!MLHSPLugin|HS_SetDeviceString:T6~{{COLLNUMBER}}!MLHSPLugin|HS_SetDeviceString:T7~{{CHANGER}}!MLHSPLugin|HS_SetDeviceString:T8~{{PREFIX}}!MLHSPLugin|HS_SetDeviceString:T9~{{SOUNDTRACK}}!MLPause|3!MLHSPlugin|HS_Run:DVDLobby.txt
And here is my HS script (I know I could havestreamliined it a bit by reusing code, but I don't know how to do that yet) I now have all the required trailers (or suitable substitutions) so I have the timings for each playlist (as reported in ZoomPlayer's playlist dialog) down, plus I've added 5 seconds to each one for opening/closing/transition/etc. Here is the code:

Code: Select all

sub main()
   Dim TITLE
   Dim FIXEDTITLE
   Dim CHANGERLOC
   Dim FILENAME
   Dim COLLNUMBER
   Dim CHANGER
   Dim PREFIX
   Dim SOUNDTRACK
   Dim PLAYER
   Dim TRAILERLENGTH
   Dim LAUNCHPAUSE
   Dim TRAILERCOMMAND
   Dim MOVIECOMMAND
   Dim ASPECT 'future use to set AR on Zoomplayer for HDD movies (a fix for 4:3 material) /AR:4=16:9, /AR:3=4:3 use CUSTOM3 in DVDL, currently all HDD movies ARE 4:3, so I'll just include /AR:3 in MOVIECOMMAND

'***Give MLServer time to populate devices***
   hs.WaitSecs 1

'***Get Device Strings***
   TITLE=hs.DeviceString("T2")
   FIXEDTITLE=hs.DeviceString("T3")
   CHANGERLOC=hs.DeviceString("T4")
   FILENAME=hs.DeviceString("T5")
   COLLNUMBER=hs.DeviceString("T6")
   CHANGER=hs.DeviceString("T7")
   PREFIX=hs.DeviceString("T8")
   SOUNDTRACK=hs.DeviceString("T9")

'***Close uneccessary programs and minimize everything***
   hs.plugin("MLHSPlugin").MLServeCMD "MLWindowFunctions|Media Center~CLOSE" 'just in case mediacenter is running
   hs.plugin("MLHSPlugin").MLServeCMD "MLZoomPlayer|EXIT" 'just in case Zoom is already playing something (like a trivia playlist)
   hs.Launch "C:\show desktop.scf" 'minimize everything on the desktop

'***Determine method of playback***
   if PREFIX="C" then PLAYER = "D V D Changer"
   if PREFIX="H" then PLAYER = "H T P C"
   if PREFIX="O" then PLAYER = "Single D V D Player"
   if PREFIX="V" then PLAYER=  "V C R"

'***Announce movie and method of playback***
   Set fs = hs.CreateStringClass
   fs.Add "Launching "
   fs.Add FIXEDTITLE
   fs.Add " from the "
   fs.Add PLAYER
   system.speak fs.Value
   fs.Reset

'***Determine Trailer Length***
   if SOUNDTRACK="DD" then TRAILERLENGTH = "33" 'Generic DD (too short)
   if SOUNDTRACK="DDEX" then TRAILERLENGTH = "50" 'Generic DDEX
   if SOUNDTRACK="DTS" then TRAILERLENGTH = "105" 'Generic DTS (too long)
   if SOUNDTRACK="DTSEX" then TRAILERLENGTH = "105" 'Still need a trailer (too long)
   if SOUNDTRACK="DPL" then TRAILERLENGTH = "33" 'Generic DPL, will add something for length (maybe THX) (too short)
   if SOUNDTRACK="MONO" then TRAILERLENGTH = "81" 'Flying Cubes
   if SOUNDTRACK="STEREO" then TRAILERLENGTH = "76" 'DDStereo Train
   if SOUNDTRACK="DDCANYON" then TRAILERLENGTH = "64" 'DD for some action/adventure-type movies
   if SOUNDTRACK="DDCITY" then TRAILERLENGTH = "60" 'DD for comedy, crime
   if SOUNDTRACK="DDEGYPT" then TRAILERLENGTH = "63" 'DD for some action/adventure movies
   if SOUNDTRACK="DDSF" then TRAILERLENGTH = "63" 'DD for space-based movies (DD Aurora Trailer)
   if SOUNDTRACK="DDDRAMA" then TRAILERLENGTH = "60" 'DD for Dramas (DD Rain Trailer)
   if SOUNDTRACK="DDSTARWARS" then TRAILERLENGTH = "80" 'DD for Star Wars series (SWTHX trailer + DD Enlighten Trailer)
   if SOUNDTRACK="DDANIM" then TRAILERLENGTH = "78" 'For animated features

'***Determine LAUNCHPAUSE***
   LAUNCHPAUSE = cstr(TRAILERLENGTH)- 27

'***Determine TRAILERCOMMAND***
   TRAILERCOMMAND = """C:\Program Files\Zoom Player\zplayer.exe""," & " ""/ADD:G:\Video\PLAYLISTS\" &cstr(SOUNDTRACK) &".ZPL /AR:4 /SPEAKER:0 /LOCKFS /VOL:90 /DVD /PLAY /MOUSEOFF /Q"""

'***Determine MOVIECOMMAND***
   MOVIECOMMAND = """C:\Program Files\Zoom Player\zplayer.exe""," & " ""/ADD:G:\Video\" &cstr(FIXEDTITLE) &" /AR:3 /SPEAKER:0 /LOCKFS /VOL:90 /DVD /PLAY /MOUSEOFF /Q"""

'***Determine ASPECT***

'***Launch Movie from Changer***
   if PREFIX="C" then
      hs.WriteLog "DVDL", "Launching from DVD Changer"
      hs.plugin("MLHSPlugin").MLServeCMD "MLServeCmd.MLCX777ES|PowerOn" 'turn-on CX777ES
      hs.WriteLog "DVDL", "CX777ES Powered-on"
      hs.WriteLog "DVDL", "Switching components for HTPC trailers"
      hs.SendIR "TV_Panasonic,Volume_Down,,TV_Panasonic,Mute,,TV_Panasonic,Channel_Up,,,Receiver_Yamaha,Power,TV_Panasonic,RGB_In,,,Receiver_Yamaha,MD-in,TV_Panasonic,TV/Video,,,TV_Panasonic,TV/Video,,,TV_Panasonic,Volume_Down" 'sets components for HTPC
      hs.WriteLog "DVDL", "Components set for HTPC Trailers"
      hs.WaitSecs 7
      'New Trailer Command follows
      hs.launch "C:\Program Files\Zoom Player\zplayer.exe", "/ADD:G:\Video\PLAYLISTS\" &cstr(SOUNDTRACK) &".ZPL /AR:4 /SPEAKER:0 /LOCKFS /VOL:90 /PLAY /MOUSEOFF /Q"
      hs.WriteLog "DVDL", "Trailer command= " &cstr(TRAILERCOMMAND)
      hs.WriteLog "DVDL", "Pausing "&cstr(TRAILERLENGTH) & " seconds for trailer viewing"
      hs.triggerevent "DVDStop"
      hs.WaitSecs 27
      hs.triggerevent "DVDLPlayChangerMovie"
      hs.WriteLog "DVDL", "Launch pause= " &cstr(LAUNCHPAUSE)
      hs.WaitSecs cstr(LAUNCHPAUSE)
      hs.WaitSecs 1
      hs.WriteLog "DVDL", "Switching components for Sony DVP-CX777ES"
      hs.SendIR "TV_Panasonic,Volume_Down,,TV_Panasonic,Mute,,TV_Panasonic,Channel_Up,,,Receiver_Yamaha,Power,TV_Panasonic,TV/Video,,,Receiver_Yamaha,DVD-in_(DVDM),TV_Panasonic,TV/Video,,,TV_Panasonic,TV/Video,,,TV_Panasonic,TV/Video,,,TV_Panasonic,Volume_Down" 'sets components for the CX777ES
      hs.WriteLog "DVDL", "Components set for DVP-CX777ES"
      hs.plugin("MLHSPlugin").MLServeCMD "MLZoomPlayer|EXIT" 'just in case Zoom got hung playing something in the playlist
      hs.triggerevent "DVDBack"
      hs.WriteLog "DVDL", "Launch from changer complete"

'***Launch Movie from HDD***
   elseif PREFIX="H" then
      hs.WriteLog "DVDL", "Launching from HDD"
      hs.WriteLog "DVDL", "Switching components for HTPC"
      hs.SendIR "TV_Panasonic,Volume_Down,,TV_Panasonic,Mute,,TV_Panasonic,Channel_Up,,,Receiver_Yamaha,Power,TV_Panasonic,RGB_In,,,Receiver_Yamaha,MD-in,TV_Panasonic,TV/Video,,,TV_Panasonic,TV/Video,,,TV_Panasonic,Volume_Down" 'sets components for HTPC
      hs.WriteLog "DVDL", "Components set for HTPC"
      hs.WaitSecs 7
      'New Trailer Command Follows
      hs.launch "C:\Program Files\Zoom Player\zplayer.exe", "/ADD:G:\Video\PLAYLISTS\" &cstr(SOUNDTRACK) &".ZPL /AR:4 /SPEAKER:0 /LOCKFS /VOL:90 /PLAY /MOUSEOFF /Q"
      hs.WriteLog "DVDL", "Trailer command= " &cstr(TRAILERCOMMAND)
      hs.WriteLog "DVDL", "Pausing " &cstr(TRAILERLENGTH) & " seconds for trailer viewing"
      hs.WaitSecs cstr(TRAILERLENGTH)
      'hs.plugin("MLHSPlugin").MLServeCMD "MLZoomPlayer|EXIT" 'just in case Zoom got hung playing something in the playlist
      'hs.waitsecs 1
      hs.WriteLog "DVDL", "Movie command= " &cstr(MOVIECOMMAND)
      'New HDD Movie Command Follows
      hs.launch "C:\Program Files\Zoom Player\zplayer.exe", """/ADD:G:\Video\" &cstr(FIXEDTITLE)&""" /AR:3 /SPEAKER:0 /LOCKFS /VOL:90 /PLAY /MOUSEOFF"
      hs.writelog "DVDL", "Launch from HDD complete"

'***Movie is an offline DVD***
   elseif PREFIX="O" then
      hs.WriteLog "DVDL", "Preparing for Single DVD playback"
      hs.SendIR "DVD_Panasonic,Play"
      hs.WriteLog "DVDL", "A-310 Powered-On"
      hs.WriteLog "DVDL", "Switching components for HTPC trailers"
      hs.SendIR "TV_Panasonic,Volume_Down,,TV_Panasonic,Mute,,TV_Panasonic,Channel_Up,,,Receiver_Yamaha,Power,TV_Panasonic,RGB_In,,,Receiver_Yamaha,MD-in,TV_Panasonic,TV/Video,,,TV_Panasonic,TV/Video,,,TV_Panasonic,Volume_Down" 'sets components for HTPC
      hs.WriteLog "DVDL", "Components set for HTPC Trailers"
      hs.WaitSecs 7
      'New Trailer Command Follows
      hs.launch "C:\Program Files\Zoom Player\zplayer.exe", "/ADD:G:\Video\PLAYLISTS\" &cstr(SOUNDTRACK) &".ZPL /AR:4 /SPEAKER:0 /LOCKFS /VOL:90 /DVD /PLAY /MOUSEOFF /Q"
      hs.Launch cstr(TRAILERCOMMAND)
      hs.WriteLog "DVDL", "Trailer command= " &cstr(TRAILERCOMMAND)
      hs.WriteLog "DVDL", "Pausing "&cstr(TRAILERLENGTH) & " seconds for trailer viewing"
      hs.WaitSecs cstr(TRAILERLENGTH)
      hs.WriteLog "DVDL", "Switching components for Panasonic A-310"
      hs.SendIR "TV_Panasonic,Volume_Down,,TV_Panasonic,Mute,,TV_Panasonic,Channel_Up,,,Receiver_Yamaha,Power,TV_Panasonic,TV/Video,,,Receiver_Yamaha,DTV-in_(DVDS),TV_Panasonic,TV/Video,,,TV_Panasonic,TV/Video,,,TV_Panasonic,TV/Video,,,TV_Panasonic,Volume_Down"
      hs.WriteLog "DVDL", "Components set for Panasonic A-310"
      hs.plugin("MLHSPlugin").MLServeCMD "MLZoomPlayer|EXIT" 'just in case Zoom got hng playing something in the playlist
      hs.writelog "DVDL", "Launch from single-disk player complete"

'***Movie is an offline Video Cassette***
   elseif PREFIX="V" then
      hs.WriteLog "DVDL", "Preparing for VCR playback"
      hs.WriteLog "DVDL", "Switching components for HTPC trailers"
      hs.SendIR "TV_Panasonic,Volume_Down,,TV_Panasonic,Mute,,TV_Panasonic,Channel_Up,,,Receiver_Yamaha,Power,TV_Panasonic,RGB_In,,,Receiver_Yamaha,MD-in,TV_Panasonic,TV/Video,,,TV_Panasonic,TV/Video,,,TV_Panasonic,Volume_Down" 'sets components for HTPC
      hs.WriteLog "DVDL", "Components set for HTPC Trailers"
      hs.WaitSecs 7
      'New Trailer Command Follows
      hs.launch "C:\Program Files\Zoom Player\zplayer.exe", "/ADD:G:\Video\PLAYLISTS\" &cstr(SOUNDTRACK) &".ZPL /AR:4 /SPEAKER:0 /LOCKFS /VOL:90 /DVD /PLAY /MOUSEOFF /Q"
      hs.WriteLog "DVDL", "Trailer command= " &cstr(TRAILERCOMMAND)
      hs.WriteLog "DVDL", "Pausing "&cstr(TRAILERLENGTH) & " seconds for trailer viewing"
      hs.WaitSecs cstr(TRAILERLENGTH)
      hs.WriteLog "DVDL", "Switching components for the VCR"
      hs.SendIR "TV_Panasonic,Volume_Down,,TV_Panasonic,Mute,,TV_Panasonic,Channel_Up,,,Receiver_Yamaha,Power,TV_Panasonic,TV/Video,,,Receiver_Yamaha,VID1,TV_Panasonic,TV/Video,,,TV_Panasonic,Volume_Down"
      hs.WriteLog "DVDL", "Components set for VCR"
      hs.plugin("MLHSPlugin").MLServeCMD "MLZoomPlayer|EXIT" 'just in case Zoom got hung playing something in the playlist
      hs.writelog "DVDL", "Launch from VCR complete"
   else
   end if

'***End of script***
   hs.SendIR "TV_Panasonic,Volume_Up"
   hs.WriteLog "DVDL", "DVDL script complete"
end sub
EDIT: updated the trailer command for the changer (had the old one still in there)

EDIT2: 21 JAN 05, 08:54 - Fixed the trailer and HDD movie commands. HS did not like the old commands. The commands in the current state limit you to having all of your movies on a single HDD (although, perhaps one of DVDL's custom fields could be populated with a drive letter and that info be brought over to the HS script and use something like cstr(DRIVE) in place of 'G' like I have now. Another way would be to send the command back to MLServer, since it is more tolerant of odd characters in a variable and use {{FILENAME}} (a variable created in the existing default play command) and have HS kick-off an event with

Code: Select all

MLServeCmd.MLFileOpen|C:\Program Files\Zoom Player\zplayer.exe~/add:{{FILENAME}} /F /Q /PLAY /MOUSEOFF /DVD
or the like in the MLHSPlugin tab box (since launching a complex MLServe command from a HS script doesn't always seem to work for me). Might be the way to go for the trailer too (might be simpler in the long run)

EDIT3:uncommented a systemspeak
Last edited by jrfuda on Wed Feb 16, 2005 9:41 am, edited 4 times in total.

User avatar
gregoryx
Simply Incredible
Simply Incredible
Posts: 6599
Joined: Tue Sep 30, 2003 10:15 pm
Location: Newport Beach, CA
Contact:

Postby gregoryx » Thu Jan 20, 2005 4:19 pm

That is SO beautiful it brought tears to my eyes. :cry:

Great work! I look forward to borrowing liberally from it!

:D

User avatar
jrfuda
Expert
Expert
Posts: 943
Joined: Mon Oct 06, 2003 5:59 pm
Location: San Antonio, TX, USA
Contact:

Postby jrfuda » Thu Jan 20, 2005 4:32 pm

Glad you like it! :)

I need to double check. There may be a problem with

hs.Launch cstr(TRAILERCOMMAND)
and
hs.launch cstr(MOVIECOMMAND)

I need to do more testing. Another mistake in the script made me think they were working. I need to confirm...

User avatar
jrfuda
Expert
Expert
Posts: 943
Joined: Mon Oct 06, 2003 5:59 pm
Location: San Antonio, TX, USA
Contact:

Updated!

Postby jrfuda » Fri Jan 21, 2005 10:04 am

I fixed the problems with the script, and now it REALLY works. See the first post for the correct script and some suggestions for use on others' systems.

bwally
Intermediate
Intermediate
Posts: 364
Joined: Sat Aug 14, 2004 6:23 am
Location: ontario, canada
Contact:

Postby bwally » Fri Jan 21, 2005 1:36 pm

hey John!

this looks great!

just wondering, is there anything special that needs to be done to setup the playback of the trailers in DVDL ? Are you using DVDProfiler to get the info into DVDL ?

i just bought myself a CX777ES for christmas :)
i have put in 2 DVD's so far :shock:
this little treat of yours couldn't have come along at a better time.

steve

User avatar
jrfuda
Expert
Expert
Posts: 943
Joined: Mon Oct 06, 2003 5:59 pm
Location: San Antonio, TX, USA
Contact:

Postby jrfuda » Fri Jan 21, 2005 2:26 pm

Steve, you have HomeSeer, right?

The "trailers" I have playing are just playlists that play while the 777 is turning its wheels - They consist of 3 parts. A Welcome to our Theater" segment, a soundtrack segment, and a "feature presentation segment.

I have not recorded actual movie trailers yet. If I do, I will make a seperate script for it. I'll use the same MLserve play movie command, but I'd have the HS_Run part run a different script, say DVDTrailer.txt.

Remember, in DVDL you can specify both a default play movie and default play trailer command, so all you have to do is fill-in the box.

I forsee trailers having 3 posssible locations - changer (using the title trick I think gregoryx mentioned elsewhere) the HDD, and unavalable.

The "DVDTrailer.txt" script should look similair to my first script, but shorter (it will have 3 major "if/ifelse statements instead of 4, and only have a single play command - wheras the DVDLobby.txt script lauchnes a pre-move trailer and then the movie - this one will onlt launch one thing).

Another option, since the location of each trailer will vary soooo much, is to use the alternate play trailer command box that each DVD entry has. For example. Have it pop-up a "Trailer not available" message box for movies with no preview trailers. Have all the DVDs that actualy contain a trailer on them (and some even have some for other movies) use the disc direct command to start the disc in the proper title (I watched Shrek2 the other day which contained non-avoidable trailers for Shark Tale and Madagascar - there was so much junk at the beginning of that DVD that the actual movie was TITLE 10!!!!! - so perhaps I need to make one of the CUSTOM# entried a title entry for discs like this and add that variable into my play command - but that's another project)... anyway, that was to point-out how the title command could be used to star the disc in a certain spot.

EDIT: I manually entered all my DVD's using the multiple CTRL-A trick (opens up multiple add from internets so you can perform multiple searhes at once). I then tweak everything in MS access, which is much faster for "standardizing" everything.


Return to “How are you using DVDLobby?”

Who is online

Users browsing this forum: No registered users and 1 guest