CheatSheet

From Cinemar Wiki
Jump to: navigation, search

Cinemar Main Lobby Command, Examples and More This is an “unofficial” compilation of information and examples of Main Lobby commands, code, scripts and other such stuff

Introduction

Disclaimer This document is provided on an “at your own risk” basis. It is intended to assist in learning the complex MainLobby environment through example. Introductory Notes This document originally started as the “Mlcommands.txt” file compiled by “smoothtlk” or David Li. He graciously compiled many of his own notes into a document for all to use as examples, then added more elements from many sources as time went on. It is presented here with links to various headings by “gregoryx” or Gregory Keyes. Feel free to comment to David or Gregory if you have information that you have seen or compiled that you believe should be included. Enjoy! Header and references MainLobby Cheat Sheet Collected by Smoothtlk Updated 5/5/07 Deleted information now in CinemarWiki Basics / Defaults / Reference



GregoryX version that includes checking for Trailer: MLServeCmd.MLConditional|FileExists##d:\previews\<<FILE>>\Video_TS.ifo##Macro|MLZoomPlayer|EXIT!MLTheaterTek|EXIT!MLSlinke|projector:input1!MLGirder|MainVideo4!MLPause|3!MLFileOpen|"C:\Program Files\Zoom Player\zplayer.exe"~/z:2 /dvd "/queue:D:\previews\<<FILE>>" /play##Macro|MLCmd|Msg~htpc~ NO TRAILER~There is no preview for this movie.!MLZoomPlayer|EXIT!MLTheaterTek|EXIT!MLSlinke|projector:input1!MLGirder|MainVideo4!MLPause|3!MLFileOpen|"C:\Program Files\Zoom Player\zplayer.exe"~/z:2 /media "/queue:D:\previews\notrailer.bmp" /play


GregoryX 10/23/04 version: The actual Default Play Movie command is this: MLServeCmd.Macro|SetVariable|DVDChangerNumber~<<CHANGERNUMBER>>! SetVariable|DVDChangerLocation~<<CHANGERLOCATION>>! SetVariable|DVDFileName~<<FILE>>! SetVariable|DVDMovieTitle~<<TITLE>>! MLFileOpen|c:\program files\mlserver\playdvd.bat It merely transfers the variables, then calls the batch file that calls the command map. The batch file is one line: c:\progra~1\mlserver\mlserver.exe "AV.DVDLobby.PlayMovie" The command map that it calls ("AV.DVDLobby.PlayMovie") is - of course - where things get HUGE.

MLServeCmd.MLConditional|IsEqual##Template:DVDControlTemplate:DVDISOErrorTemplate:Projector power##ZOOM01##MLCmd|Msg~ALL~Movie Starting~Loading DVD from server to play Template:DVDMovieTitle shortly.~120## MLServeCmd.MLConditional|IsEqual##Template:DVDControlTemplate:DVDISOErrorTemplate:Projector power##ZOOM00##MLCmd|Msg~ALL~Movie Starting~Powering up the projector and loading the DVD from the server to play Template:DVDMovieTitle shortly.~120## MLServeCmd.MLConditional|IsEqual##Template:DVDControlTemplate:DVDISOError##ZOOM0##MLPause|15## MLServeCmd.MLConditional|IsEqual##Template:DVDControlTemplate:DVDISOError##ZOOM0##MLFileOpen|"C:\Program Files\Zoom Player\zplayer.exe"~/z:2 /dvd /cd:f /play## MLServeCmd.MLConditional|IsEqual##Template:DVDControlTemplate:DVDISOError##ZOOM0##MLPause|5## MLServeCmd.MLConditional|IsEqual##Template:DVDControlTemplate:DVDISOError##ZOOM0##MLZoomPlayer|TITLEMENU## MLServeCmd.MLConditional|IsEqual##Template:DVDControlTemplate:DVDISOError##ZOOM0##MLZoomPlayer|ROOTMENU## MLServeCmd.MLConditional|IsEqual##Template:DVDControlTemplate:DVDISOError##ZOOM0##MLFileOpen|c:\program files\mlserver\dvdcntrl.bat~ZOOM## MLServeCmd.MLConditional|IsEqual##Template:DVDControlTemplate:DVDISOError##ZOOM0##SetVariable|AVMainSourceName~HTPC DVD Video##


TheaterTek command lines: MLServeCmd.Macro|MLTheatertek|EXIT!MLPause|5! MLFileOpen|"C:\Program Files\Theatertek\Theatertek DVD.exe"~/PATH "V:\<<FILE>>\Video_TS" MLServeCmd.MLConditional|IsEqual##Template:Location##Theater##MLRedirect|HTPC1::5004::MLServeCmd.Macro|MLFileOpen|subst~Z: /D~0!MLFileOpen|subst~Z: "N:\Video\<<TITLE>>\Video_TS"~0!MLPause|.9!MLCommand~HTPC1~MLMinimize!MLFileOpen|"C:\Program Files\preMovie Manager\preMovie.exe"~"Z:\VIDEO_TS.IFO"!##MLRedirect|XPPro::5004::MLServeCmd.Macro|MLFileOpen|subst~Z: /D~0!MLFileOpen|subst~Z: "N:\Video\<<TITLE>>\Video_TS"~0!MLPause|.9!MLCommand~XPPro~MLminimize!MLPause|.2!MLFileOpen|"C:\Program Files\preMovie Manager\preMovie.exe"~ "Z:\VIDEO_TS.IFO"

Instructions: Then for your default MLServeCmd (PLAY MOVIE) you would use something like this also found in the dvdlobby help file: MLServeCmd.Macro|MLTheaterTek|EXIT!MLPause|1!MLFileOpen|C:\Program Files\TheaterTek\TheaterTek DVD.exe~/PATH "M:\Video\<<FIXEDTITLE>>\Video_TS"

FIXEDTITLE is the variable we are replacing with the name of the movie. Any unique characters such as: \ / : * ? " < > | would be replaced with an underscore "_".

Good: MLServeCmd.MLRedirect|Template:CLIENTNAME::5004::MLServeCmd.Macro|MLFileOpen|subst~Z: /D~0!MLFileOpen|subst~Z: "K:\Video\<<TITLE>>\Video_TS"~0

Conditional Redirect examples for Movie Launch: Syntax: MLServeCmd.MLConditional|IsEqual##Template:Location##Theater##<<What to execute if yes>>##<<What to execute if no>> Good: MLServeCmd.MLConditional|IsEqual##Template:Location##Theater##Macro|MLFileOpen|notepad.exe!MLPause|3!MLWindowFunctions|Notepad~SENDKEYS~TheaterChoice##MLConditional|IsEqual##Template:Location##Study;;Macro.MLFileOpen|notepad.exe!MLPause|3!MLWindowFunctions|Notepad~SENDKEYS~StudyChoice##Macro|MLFileOpen|notepad.exe!MLPause|3!MLWindowFunctions|Notepad~SENDKEYS~OtherChoice Good: MLServeCmd.SetVariable|Location~Theater

Good: MLServeCmd.MLConditional|IsEqual##Template:Location##Theater##MLRedirect|HTPC1::5004::MLServeCmd.Macro|MLFileOpen|subst~Z: /D~0!MLFileOpen|subst~Z: "N:\Video\<<TITLE>>\Video_TS"~0!MLPause|.5!MLFileOpen|C:\Program Files\Zoom Player\zplayer.exe~/DVD /PLAY##MLRedirect|XPPro::5004::MLServeCmd.Macro|MLFileOpen|subst~Z: /D~0!MLFileOpen|subst~Z: "N:\Video\<<TITLE>>\Video_TS"~0!MLPause|.5!MLFileOpen|C:\Program Files\Zoom Player\zplayer.exe~/DVD /PLAY

Sample statement would check if Zoom Player was running on the HTPC, if it was send a stop to it otherwise send a stop to the Slinke on the sending computer Good: MLServeCmd.MLRedirect|HTPC1::5004::MLServeCmd.MLConditional|IsRunning##Zoom Player##MLZoomPlayer|STOP##MLRedirect|SERVER1;;5004;;MLServeCmd.MLSlinke|dvd1stop


Good: MLServeCmd.MLConditional|IsEqual##Template:Location##Theater##MLRedirect|HTPC1::5004::MLServeCmd.Macro|MLFileOpen|subst~Z: /D~0!MLFileOpen|subst~Z: "N:\Video\<<TITLE>>\Video_TS"~0!MLPause|.5!MLFileOpen|C:\Program Files\Zoom Player\zplayer.exe~/DVD /PLAY##MLRedirect|XPPro::5004::MLServeCmd.Macro|MLFileOpen|subst~Z: /D~0!MLFileOpen|subst~Z: "N:\Video\<<TITLE>>\Video_TS"~0!MLPause|.5!MLFileOpen|C:\Program Files\Zoom Player\zplayer.exe~/DVD /PLAY MLServeCmd.MLConditional|IsEqual##Template:Location##Theater##MLRedirect|HTPC1::5004::MLServeCmd.Macro|MLFileOpen|subst~Z: /D~0!MLFileOpen|subst~Z: "N:\Video\<<TITLE>>\Video_TS"~0!MLPause|.5!MLFileOpen|C:\Program Files\Zoom Player\zplayer.exe~/DVD /PLAY##MLRedirect|XPPro::5004::MLServeCmd.Macro|MLFileOpen|subst~Z: /D~0!MLFileOpen|subst~Z: "N:\Video\<<TITLE>>\Video_TS"~0!MLPause|.5!MLCommand~XPPro~MLMinimize!MLPause|.5!MLFileOpen|"C:\Program Files\preMovie Manager\preMovie.exe"~ "Z:\VIDEO_TS.IFO" MLServeCmd.Macro.MLRedirect|HTPC1::5004::MLServeCmd.MLMatrixOrbitalMX2|WRITE~FINDING MOVIE~<<TITLE>>!MLServeCmd.MLRedirect|SERVER1::5004::MLServeCmd.MLSlinke|sonydvd1:poweron wait:150 stop wait:3500 sonydvd1:folderall wait:12500 sonydvd1:<<CHANGERLOCATION1>> wait:150 sonydvd1:<<CHANGERLOCATION2>> wait:150 sonydvd1:<<CHANGERLOCATION3>> wait:1000 sonydvd1:enter wait:3000 sonydvd1:enter wait:250 sonydvd1:play!MLServeCmd.Macro.MLRedirect|HTPC1::5004::MLServeCmd.MLMatrixOrbitalMX2|WRITE~PLAYING NOW~<<TITLE>>

Changer based Movie commands (courtesy of GregoryX) MOVIE CONDITIONAL: MLServeCmd.MLConditional|IsEqual##<<CHANGERNUMBER>>##1##Macro|MLCX777ES|PowerOn!MLPause|2!MLCX777ES|DiscDirect~<<CHANGERLOCATION>>~1~0~0!MLGirder|MainVideo3!MLSlinke|projector:input3##Macro|MLZoomPlayer|EXIT!MLTheaterTek|EXIT!MLFileOpen|"C:\Program Files\Daemon Tools\daemon.exe"~ -mount 0,"<<CUSTOM5>><<FILE>>.iso"!MLPause|5!MLFileOpen|"C:\Program Files\Zoom Player\zplayer.exe"~/z:2 /dvd "/queue:f:\ts_video\" /play!MLPause|5!MLZoomPlayer|ROOTMENU!MLGirder|MainVideo4!MLSlinke|projector:input1

THEATERTEK CONDITIONAL: MLServeCmd.MLConditional|IsEqual##<<CHANGERNUMBER>>##1##Macro|MLCX777ES|PowerOn!MLPause|2!MLCX777ES|DiscDirect~<<CHANGERLOCATION>>~1~0~0!MLGirder|MainVideo3!MLSlinke|projector:input3##Macro|MLZoomPlayer|EXIT!MLTheaterTek|EXIT!MLFileOpen|"C:\Program Files\Daemon Tools\daemon.exe"~ -mount 0,"<<CUSTOM5>><<FILE>>.iso"!MLPause|5!MLFileOpen|"C:\Program Files\TheaterTek\TheaterTek DVD.exe"~/path "F:\"!MLPause|8!MLTheaterTek|PLAY!MLPause|3!MLTheaterTek|ROOTMENU!MLGirder|MainVideo4!MLSlinke|projector:input1

CHANGER: MLServeCmd.Macro|MLCX777ES|PowerOn!MLSlinke|projector:input3!MLCX777ES|DiscDirect~<<CHANGERLOCATION>>~1~0~0!MLGirder|MainVideo3

ZoomPlayer (with ISO file mounting): MLServeCmd.Macro|MLZoomPlayer|EXIT!MLTheaterTek|EXIT!MLFileOpen|"C:\Program Files\Daemon Tools\daemon.exe"~ -mount 0,"y:\dvds\<<FILE>>.iso"!MLPause|5!MLFileOpen|"C:\Program Files\Zoom Player\zplayer.exe"~/z:2 /dvd "/queue:f:\ts_video\" /play!MLPause|3!MLZoomPlayer|ROOTMENU!MLSlinke|projector:input1!MLGirder|MainVideo4

THEATERTEK (with ISO file mounting): MLServeCmd.Macro|MLZoomPlayer|EXIT!MLTheaterTek|EXIT!MLFileOpen|"C:\Program Files\Daemon Tools\daemon.exe"~ -mount 0,"<<CUSTOM5>><<FILE>>.iso"!MLPause|5!MLFileOpen|"C:\Program Files\TheaterTek\TheaterTek DVD.exe"~/path "F:\"!MLPause|8!MLTheaterTek|PLAY!MLPause|3!MLTheaterTek|ROOTMENU!MLGirder|MainVideo4!MLSlinke|projector:input1

TRAILER CONDITIONAL: MLServeCmd.MLConditional|FileExists##d:\previews\<<FILE>>\Video_TS.ifo##Macro|MLZoomPlayer|EXIT!MLTheaterTek|EXIT!MLSlinke|projector:input1!MLGirder|MainVideo4!MLPause|3!MLFileOpen|"C:\Program Files\Zoom Player\zplayer.exe"~/z:2 /dvd "/queue:D:\previews\<<FILE>>" /play##Macro|MLCmd|Msg~htpc~ NO TRAILER~There is no preview for this movie.!MLZoomPlayer|EXIT!MLTheaterTek|EXIT!MLSlinke|projector:input1!MLGirder|MainVideo4!MLPause|3!MLFileOpen|"C:\Program Files\Zoom Player\zplayer.exe"~/z:2 /media "/queue:D:\previews\notrailer.bmp" /play

Kenwood changer sample command: MLServeCmd.MLFileOpen|C:\Program Files\Cinemar\kwd_5900_ctrl.exe~1 PLAYDISC <<COLLECTIONNUMBER>>~0

Substitution DOS command syntax: Associates a path with a drive letter. SUBST [drive1: [drive2:]path] SUBST drive1: /D drive1: Specifies a virtual drive to which you want to assign a path. [drive2:]path Specifies a physical drive and path you want to assign to a virtual drive. /D Deletes a substituted (virtual) drive. Type SUBST with no parameters to display a list of current virtual drives. EXAMPLES SUBST a: . Sets the directory you are in and subdirectories thereafter into the A: drive. So if you were to type A: after doing this command you would see everything in the directory that you typed this command in. If you were to reboot your computer this will clear the SUBST command and put your drives back to original letters (unless command placed into the autoexec.bat). You cannot subst network drives subst z: "k:\video\braveheart\video_ts" subst z: /D Message example: MLServeCmd.MLCmd|Msg~server1~Message~This movie is only available on disc...you're going to have to get up, find the disc, put it into the DVD drive, and press OK. Or hit cancel and pick a movie more suitable for someone of your considerable sloth

Special DVD Lobby Commands In the text field labeled MLcmd type DVDLobby. All variables are case-sensitive. Then in the var field below type the DVDLobby command you'd like assocated with that particular button. Below is a complete list of commands available: Var Command Description DLthumbnailPageUp Page up through thumbnails. DLthumbnailPageDown Page down through thumbnails. DLoverviewPageUp Scroll overview text up. DLoverviewPageDown Scroll overview text down. DLnextMovie View next movie. DLprevMovie View previous movie. DLplayMovie Play currently selected movie. DLoverviewMode Switch to Overview mode. DLthumbnailMode Switch to Thumbnail mode. DLgenreMode Switch to Genre mode. DLautoplay Toggle Autoplay of DVD Slideshow. DLsearchMode Open Search Panel. DLtransportControls Toggle Transport Control Remote Popup. DLsetupMode Enter Setup Mode DLfirstLetterMode Search by First letter of Movie DLsortMode Change sort sequence

Un-hiding buttons In the event you press the Hide Buttons checkbox and want to return to the default buttons used in DVDLobby, you may edit the dvdlobby3.ini file with Notepad. Change the variable hideButtons=true to hideButtons=false. Then restart MainLobby/DVDLobby. Your default buttons should now be restored.

Default keyboard buttons + Next Movie - Previous Movie p Play Movie o Overview Panel t Thumbnails Panel g Genre Panel m Toggle DVDLobby Menu a Autoplay (slideshow thru Movie Posters) s Search (type word(s) then ENTER) j Jump to any dvd number (press j, then collection number, then j) c Toggle Transport Controls

Note: MainLobby must be in LAUNCH mode for the DVDLobby Pro shortcuts to work. ADVANCED DVDLOBBY & MLSERVER: Launching Media Files from Multiple Clients using TheaterTek as the Player (on each Client) and a centrally stored Media Server and DVDLobby Database

Client1 MLServer Running, started and listening on Port 5004, but no configuration in MLDVDLobby is necessary MainLobby Settings in Options > Startup MLServer ClientID: Client1 Computer Name (Server): Name of Media Server's Computer (From the Media Server Computer goto: Start > Control Panel > System > Computer Name Tab) MLServer Port: 5004

With the button that launches DVDLobby or an added button, assign the following MLServeCmd to a button that you press before launching a movie for the first time: MLServeCmd.SetVariable|Location~Name of Client1's Computer (From the Client1 Computer goto: Start > Control Panel > System > Computer Name Tab)


Client2 MLServer Running, started and listening on Port 5004, but no configuration in MLDVDLobby is necessary MainLobby Settings in Options > Startup MLServer ClientID: Client2 Computer Name (Server): Name of Media Server's Computer (From the Media Server Computer goto: Start > Control Panel > System > Computer Name Tab MLServer Port: 5004

With the button that launches DVDLobby or an added button, assign the following MLServeCmd to a button that you press before launching a movie for the first time: MLServeCmd.SetVariable|Location~Name of Client2's Computer (From the Client2 Computer goto: Start > Control Panel > System > Computer Name Tab)


Media Server MainLobby doesn't need to be running on this machine MLServer running, started and listening on Port 5004 MLServer Media Titles Stored Here in MLDVDLobby Plugin) Add Media Files to your MLDVDLobby Plugin and browse your hard drive for the IFO format file for each Media File. Be sure to browse through "My Network Places" when locating the files and that each client can actually see the files when browsing using Explorer. Configure the Default Play Movie Command in the MLDVDLobby Plugin as: MLServeCmd.MLRedirect|Template:Location::5004::MLServeCmd.Macro|MLTheaterTek|EXIT!MLPause|5!MLFileOpen|<<FILE>>



MLMediaCenter (for MusicLobby 1) MainLobby can control the fundamental controls of J Rivers MediaCenter – a powerful media player. Default port: 7000 MLServeCmd.MLMediaCenter|<<command>>~<<Opt: parameters>> Example: MLServeCmd.MLMediaCenter|PAUSE Supported commands: PLAY PAUSE PREVIOUS NEXT STOP SHUFFLE MUTE VOLUMEDOWN VOLUMEUP SETVOLUME~<<0-100>> TOGGLECONTINUOUS TOGGLEEQ - turns on/off EQ for Zone 1 CLEARCURRENTPLAYLIST PLAYALBUM~<<filename>> APPENDALBUM~<<filename>> PLAYFILE~<<filename>> MLServeCmd.MLMediaCenter|NEXTZONE MLServeCmd.MLMediaCenter|PREVZONE





Music Lobby


MusicLobby Variables: Subject to change, but this is how you would do it if MusicLobby is in the BackgroundFX layer:

1) Create an button or textfield 2) Put this in the label field: Template:Root.backgroundFXpos.container.playlistLength Template:Root.backgroundFXpos.container.playlistPositionTemplate:Root.backgroundFXpos.container.title Template:Root.backgroundFXpos.container.artistalbum


Misc Stuff:


In a command map build: MLServeCmd.SetVariable|ClientRequesting~Template:Clientname MLServeCmd.MLCmd|MLCommand~Template:ClientRequesting~Web.Close or built into a macro: MLServeCmd.Macro|SetVariable|ClientRequesting~Template:Clientname!MLCmd|MLCommand~Template:ClientRequesting~Web.Close


Nested Variables Requires 2.75d or newer: MLServeCmd.MLGirder|{{Template:Clientnameuser}} to send the VALUE of a pseudo-local variable (eg, CLIENT1user to represent the current user on a particular client). The only client-specific code that is still necessary is for displaying the value of such a variable (because the Button Label field still does not support Nested Variables). It is also worth noting that 2.75d also supports sending a Macro with Multiple Mapped Commands, such as the following: MLServeCmd.Macro|VOLUME.MUTE!TV.Off

Run a batch file and pass parameters (DVD location in this example):

Files\Cinemar\fscommand\dvd2.bat~1 8 3~0

Passing Variables to other Programs Some programs allow you to pass on variables/parameters. You can pass along these parameters directly from MainLobby's Application text field. From the Button Properties panel of your selected button, browse to the .exe you'll be passing the variables to, then enter a "," (comma) without quotes and a space - then enter your parameters you are passing. Here are some examples: C:\Program Files\System32\wscript.exe,//Nologo X:\script.vbs seercmd.exe, /ex:a01on D:\Program Files\Girder\Girder.exe, -eventstring notepad

MLServeCmd.Macro|MLFileOpen|C:\Progra~1\Cinemar\Web1.bat~~6!MLPause|.5!MLCmd|ChangeScene~Template:PC~Weblobby1.mls

Command for setting dynamic variable in MainLobby Server MLServeCmd.SetVariable|<<NAME>>~<<VALUE>> Substitute any dynamic variable into MLServeCmd's by using a placeholder in the command, ie: MLServeCmd.MLFileOpen|Template:Source will substitute the current value of "source" into the command in place of Template:Source

Switching graphics via MLServecmds (requires ML 2.70h swf). MLServeCmd.SetVariable|lightstatus~skins\screeninterface7.jpg Coding with the Generic Serial Plugin: Dan Dreicher: Here I'll try and explain each piece of the script for reference. Windows includes a scripting engine that allows you to build scripts like this in Wordpad or Notepad. Go ahead and open up the .wsc file in either of those. The script is in XML format. Code: <?xml version="1.0"?> <component> <?component error="true" debug="false"?>


This is just the header - nothing that would be altered at all.

Code: <registration description="wscShell" progid="wscXantechVolume.plugin" version="1.00"/>


Here we enter the name of the plug-in in the progid area. Plus, we add ".plugin" to register the class to MLServer. Again, the only change here would be to name the plugin "x.plugin" where x equals the name of your .wsc file.

Code: <public> <method name="doReference"> <PARAMETER name="serverRef"/> </method> <method name="doSettings"/> <method name="doCommand"> <PARAMETER name="command"/> <PARAMETER name="client"/> </method> <property name="strAbout"/> </public>


Again, this would be unchanged. These functions are the necessary functions exposed to MLServer for it to recognize and communicate with the plug-in.

Code: <script language="VBScript"> <![CDATA[ Dim mlServer 'as object Dim strAbout


Again, remain unchanged. This just states that we're going to be using VBScript as our language, and creates two variables in the plug-in. A object pointing back to MLServer (named: mlServer) and the string (named: strAbout) that gets called when you click the 'About' button in MLServer.

Code: function doAbout() 'Edit these strings to reflect your plug-in 'This is what will show up on the form when a user 'selects 'About' from the plug-ins section

title = "Xantech Volume Conversion" version = "1.0.0" description = "Converts Xantech Volume command from MainLobby to 0-40" author = "Daniel Reicher" email = "dreicher@cinemaronline" syntax = "MLServeCmd.wscXantechVolume|<<command>>"

doAbout = title & "!" & version & "!" & description & "!" & author & "!" & email & "!" & syntax end function


This function just tells MLServer what to put in the 'About' box when selected form MLServer.

Code: function doReference(serverRef) 'Set a reference back to MLServer, this code must be here to allow 'communication back to the server Set mlServer = serverRef strAbout = doAbout

'Execute any commands you'd like to execute on startup of plug-in / MLServer

'This is how to set/change a variable in MLServer 'mlServer.setVariable "myPlugin","hello" 'This is how to send an MLServeCmd 'mlServer.cmdReceive "MLServeCmd.MLCommand|MLCmd~test" end function


This is the function that gets called from MLServer when it launches, basically initializing the plug-in. In this case, all we are doing is setting the reference back to MLServer and building the about string. Everything preceded by ' is disregarded comments.

Code: function doCommand(command,client) Dim vol

'This receives commands from MLServer for processing 'command = everything after | in the command 'client = name of the client that issued the command

'Use the incoming command to change variables, perform system actions, etc.

'This is how to set/change a variable in MLServer 'mlServer.setVariable "myPlugin","hello" 'This is how to send an MLServeCmd 'mlServer.cmdReceive "MLServeCmd.MLCommand|MLCmd~test"

vol = CInt(command*0.4) mlServer.setVariable "XantechVolume1", CStr(vol) mlServer.cmdReceive "MLServeCmd.MLGenericSerial|Send~!01" & vol & "+" end function


This is where all the magic happens. When you send a command: MLServer.PlugIn|whatever - "whatever" gets passed to "PlugIn" via this function. So, in our case: MLServeCmd.wscXantechVolume|40 comes in here as doCommand("40", initiating client) and "40" is stored in the variable command. So, anytime you want to reference what comes in you place command.

In the first line, we create a new variable (for the plug-in only) named "vol". Then a bunch of comments. In the next line of execution "vol = CInt(command*0.4)", we set vol equal to 40% of the incoming command value. The next two lines:

mlServer.setVariable "XantechVolume1", CStr(vol)

This uses the reference to MLServer to set a variable named "XantechVolume1" equal to the value of vol.

mlServer.cmdReceive "MLServeCmd.MLGenericSerial|Send~!01" & vol & "+"

This uses the reference to MLServer to issue an MLServeCmd to the Generic Serial plug-in substituting the value of vol into the command.

Code: function doSettings() 'This code executes when a user selects the plug-in and presses settings 'Nothing in this case end function


This is what happens when a user presses 'Settings' in MLServer. In this case, we're doing nothing.

Code: 'Here you can add any additional VBScript code or functions you want for your plugin for doCommand to utilize

]]> </script> </component>

Any additional code you want (functions/subroutines/etc.) in your plug-in goes here. And of course the closing tags. That's a pretty basic primer. There is a TON you can do with a very basic understanding of VBScript and MLServer, including: conversion, conditional processing, conditional logic, parsing of information, etc. Hope that was helpful to someone. Daniel Reicher

Toggle Graphic: Good: MLServeCmd.MLConditional|IsEqual##Template:Toggle2##1##SetVariable|toggle2~0##SetVariable|toggle2~1 Good: MLServeCMD.MLConditional|IsEqual##Template:Mlhsplugin z17##Off##Macro|MLHSPLugin|HS_ExecX10:z17~On!MLHSPLugin|HS_ExecX10:z17~On##MLHSPLugin|HS_ExecX10:z17~Off Sliders The sliders are pretty easy...just setup the label with the variable Template:Wavevolume and the command...MLServeCmd.MLVolume|SetWaveVolume~Template:Value and as you drag the slider, it will continuously shoot out MLServeCmd's with the correct value.

Plus, you can create buttons with labels like: Volume Template:Wavevolume and even hide the Template:Wavevolume value from showing up on the button. This is obviously better for things like "Mute", where the button can say "Mute" and show different colors based on the value of Template:Wavemute For sliders: MLServeCMD.MLHSPlugin|HS_ExecX10:a6~ddim~Template:Value Eliminates "bounce" of slider: MLServeCMD.Macro|Setvariable|mlhsplugin_h8~Template:Value!MLHSPlugin|HS_ExecX10:h8~DDIM~Template:Mlhsplugin h8

ToggleDevice (on / off): Good: MLServeCMD.MLHSPlugin|ToggleDevice:a6 Good: MLServeCmd.Macro|MLHSPlugin|ToggleDevice:v1!MLRedirect|Blue::5004::MLServeCmd.MLVolume|WaveToggleMute FreeText Field button: Load into an FX layer or place a button and then replace it with this SWF Pop up message box with timing

(requires ML 2.60 and MLS 1.30 or newer): MLServeCmd.MLCmd|Msg~[Client/All]~[Title]~[Text]~[Time]

Toggle Graphic Instructions: The newest feature is the option to hide or show any of the FX layers found in MainLobby. Two of probably the most unique commands are ToggleGraphic and ToggleSlinke. Here are two examples of how they work: 1) First, Add a button to the Stage, press Edit and then select the Button you just added. 2) Let's select the two graphics that we will toggle between. Select B0037 from the MainLobby Library scroll box. 3) Select ToggleGraphic from the MLcmd drop down 4) In the variable field type the ID of a graphic that you'd like to toggle between. For this example, type, "Button0037b" without the quotes. NOTE: The ID is found on the top of the Edit Properties Panel and is unique for each graphic, (ie Button0001) It is not the same name that is found in the Library scroll box. This is a label. More descriptive labels will be applied to each button in a subsequent release. These name changes will not affect your Scene files. 5) Now press OK. 6) Press Launch from the Menu and click on the button. If you followed all the steps, the button should toggle between the two graphics.

Toggle Custom Pic and device On / Of with clicking image

(requires 2.75 update)

MLServeCMD.MLConditional|IsEqual##Template:Mlhsplugin a6##Off##Macro|MLHSPLugin|HS_ExecX10:a6~On!MLHSPLugin|HS_ExecX10:a6~On!SetVariable|TVstatus~C:\Program Files\Cinemar\images\On06.jpg##Macro|SetVariable|TVstatus~C:\Program Files\Cinemar\images\Off06.jpg!MLHSPLugin|HS_ExecX10:a6~Off Button label: Template:Tvstatus


Using one button to turn On and Off a light with your Slinke In this example, you'll obviously need to own the Slinke available from Cinemar as well as a CM11A or similar device. 1) First, Add a button to the Stage, press Edit and then the select the Button you just added. 2) Select ToggleSlinke from the MLcmd drop down. 3) In the variable field, type the toggle script such as, "x10:off[a1]" NOTE: This assumes you have a device called X10 added in the Slinke Options 4) In the Slinke command line at the bottom of the Edit Properties Panel, type in "x10:on[a1]" 5) Now press OK. Assuming you are connected to the Slinke and your CM11A, the light A1 should alternate between On and Off when pressing the same button.


Flash SWF stuff: DVDLobby.swf plugin code: _root.client.MLServerSocket.send("MLServeCmd.MLDVDLobby|PLAYMOVIEUPC~"+_root.dvd[_parent.c-1][2]);

ML Flash: Just put this clip into an FX layer such as remoteFX. Then make sure MusicLobby is in the backgroundFX layer. This should scale it probably. It's two lines of code: setProperty("_parent.backgroundFXpos", _xscale, 100); setProperty("_parent.backgroundFXpos", _yscale, 100); 3/8/05: It really isn't possible to do much with the MLCmd from flash without providing the var field.

If the MLCmd doesn't require the var field then it would work such as MLBackScene.

_root.MLCmd("MLBackScene");


Tricks:


Please Wait trick (from mosleyh 11/08/05): In constructing My ML/DVDL setup, I've run into situations where a scene change occurs, but it takes a while after that for all of the MLServeCmds to finish firing. <> know to wait, but it has traumatized my technophobe wife on occasion. (I should also mention that I keep the scenes as simple as possible for her sake, as well)

I finally came up with a solution that uses the single-thread nature of ML as an advantage. I've posted the intro screen and the please wait screen below.

I have command maps set up to take care of the necessary configuration going into DVDLobby, the SACD scene, etc.

So here's what happens:

When you touch Watch a DVD from the Library for example, it fires this macro: Code: MLServeCmd.Macro|SetVariable|NextScene~dvdlobby3d.mls!SetVariable|NextCMAP~DVDLStartup!MLCmd|ChangeScene~ALL~Please wait.mls


which sets the NextScene variable to the scene that should come up after "Please Wait", and The NextCMAP variable that specifies the command map to fire.

Then the scene changes to "Please Wait", which fires this macro: Code: MLServeCmd.Macro|RunCmdMap|Template:NextCMAP!MLCmd|ChangeScene~ALL~Template:NextScene


Because Mainlobby can only do one thing at a time, the command map named in Template:NextCMAP has to complete before the scene changes from "Now Playing", and when it does, it changes to the scene specified in Template:NextScene.

This arrangement has the added benefit of using the same "Please Wait" for any menu choice. (And I finally found a use for the spinning globe! )


Passing Variables to other Programs Some programs allow you to pass on variables/parameters. You can pass along these parameters directly from MainLobby's Application text field. From the Button Properties panel of your selected button, browse to the .exe you'll be passing the variables to, then enter a "," (comma) without quotes and a space - then enter your parameters you are passing. Here are some examples: C:\Program Files\System32\wscript.exe,//Nologo X:\script.vbs seercmd.exe, /ex:a01on D:\Program Files\Girder\Girder.exe, -eventstring notepad

Web.NavigateURL

MLServeCmd.MLCmd|MLCommand~All~MLBackScene


WebLobbyStartupURL=file:///C:/Program Files/Cinemar/pigskinredirect.html&


ScreenSavers: Download the screensaver file, and put it in C:\ProgramFiles\Cinemar\screensavers. For whatever scene you want to use it: open the .mls in Mainlobby show the menu bar press the OPTIONS button in the menu bar press the DISPLAY button on the left of the screen that appears There is a field at the top labeled screensaver - browse to the file in the screensavers folder, then hit OK Then SAVE. That's all there is to it. When you run that scene from now on, the screen will dim after it has been running for a few minutes.

MLServeCmd with WebLobby: MLServeCmd.MLCmd|MLCommand~htpc2~Web.NavigateURL~http://www.cinemaronline.com


HomeSeer Stuff:

Base an event on the User # that armed/disarmed the system: From Baltas: Set the trigger to: Type: Napco Gemini Napco Event: Area Armed (or Area Disarmed) Area: Napco Area 1 Write a script similar to the one below: if hs.plugin("Napco Gemini").LastSecurityEvent("UserNumber") = "1" then hs.ExecX10 "A1","off",0,0 end if

Garage door From Rupp: I have an event that gets run when my garage door is being opened. G1 on. The event triggers on G1 On and in the script to run field I use &hs.setDeviceString "G1", "Door Open". Then you can create another event to do the opposite. G1 Off, and &hs.setDeviceString "G1", "Door Closed"

FAQs

Diagrams / Illustrations Software Architecture


Main Lobby Font Reference