Premise Control Sound Effects in Premise Browser

Motorola Premise

123

Senior Member
"Sound Effects" is enabled by default in Premise Browser. To have it disabled by default:
  1. In Premise Builder, click Modules in the Shortcut Bar.
  2. Navigate to: Modules > AutomationBrowser > Core > Classes > WebSessionEx > BrowserSounds
  3. In the Properties window, set DefaultValue to false.
Premise Browser's TaskList menu contains a command to enable/disable "Sound Effects". If you never use this function you can remove the command from the TaskList.
  1. In Premise Builder, click Modules in the Shortcut Bar.
  2. Navigate to: Modules > Plugins > Components > TaskList > CurrentItem > SoundEffects
  3. You will be deleting this item. If you ever want to restore it, you should Export it first. Right-click SoundEffects and select Export. Click OK and provide a suitable file name.
  4. Press the Delete key to eliminate the SoundEffects item.
PS
The "Dim Screen" menu item is located here as well. If you have no need for it, Export and delete it.
 
I'd like to add a custom sound to specific events (sndclickmenu), such as drilling down (i.e. Living Room->object->object). Not with voice, but a custom mp3/audio clip.
The themes let you change it overall, or for an area (task menu)

Oh, wise one - any ideas?
 
...add a custom sound to specific events ... such as drilling down (i.e. Living Room->object->object). ...
I had a quick look at how a Theme allows one to specify sound effects. Basically, it lets you define sound effects by class. For example, RoomList is a class that that defines what's seen in Premise Browser's grid. The SndGridItem property defines the sound file that is played when a grid item is clicked.

I don't see an easy way of defining sounds for specific Home objects and here's why:

In Themes, you can copy/paste and rename RoomList to something else, then change its TargetObject property to point to a desired class. TargetObject can point to Component or Selector classes. That appears to be promising until you discover that a Theme concerns itself with Selectors for classes that define the structure of Premise Browser (see the items listed in Explorer's treeview). It does not handle classes that define Home-level objects like LivingRoom, Bedroom, CoffeeMaker, etc.
 

Attachments

  • Themes___Sound_Effects.png
    Themes___Sound_Effects.png
    34.1 KB · Views: 21
Exactly. This appears to be a serious limitation with Premise, which means I will need a different HA solution :) (just kiddin' folks...I continue to be amazed that 1) The Premise Forum doesn't have thousands of members 2) How far ahead of it's time that Jim Hunter and company was and 3) How cheap it was/is compared to all of the other stuuf out there)

What I thought I might do is to disable sound effects, then for each object that I wish to have a sound effect for (okay, here's the deal, I've modified John's NewsReader module; have pulled in the Surfline Surf Report. When I select the image for the Surf Report, I'd like to have a wave.mp3 play. corny, I know)
I'd have 'OnPropertyChange' trigger the sound effect. I have yet to figure out how to do that....or maybe it's not possible?
 
...I'd have 'OnPropertyChange' trigger the sound effect. I have yet to figure out how to do that....or maybe it's not possible?
I suspect you'll have to alter the way Premise handles sound effects.

As it stands now, if you enable sound effects, AutomationBrowser will automatically add the following bit of code to an object's OnClick event:
onclick="psnd('/Sounds/GridItemGraphite.wav');"
where "psnd" is a Javascript function defined in "..\SYS\Web\Plugins\SYSConnector_default.htm".

Clicking on an object in Premise Browser will cause Internet Explorer to play the associated sound file ('GridItemGraphite.wav' in the example above). If you disable sound effects, AutomationBrowser ceases to include the call to psnd in the object's OnClick event.

So where exactly does all of this happen in AutomationBrowser? Go to: Modules > AutomationBrowser > ObjectGrid > GlobalScripts > RenderObjectsinGrid. Scroll down to line 100 and you'll see the following code:
Code:
if objectGrid.SndClickGridItem <> "" and sysevent.ClientSession.BrowserSounds = true  then
	Output = Output & "onclick=""psnd('" & objectGrid.SndClickGridItem & "');"" "
end if
In a nutshell: if a sound file (SndClickGridItem) has been defined and sound effects (BrowserSounds) are enabled, it adds the call to psnd to the OnClick event.

The simplest hack, to serve your needs, is to have the code check the current object's name. If it is "SurflineSurfReport" then it will automatically add the call to psnd along with the appropriate sound file. Replace lines 100-102 with this (ensure the object's name is spelled correctly and wave.mp3 is in SYS\web\sounds):
Code:
if objectGrid.SndClickGridItem <> "" and sysevent.ClientSession.BrowserSounds = true  then
	if obj.Name = "SurflineSurfReport" then
		' Sound effect for a specific object
		Output = Output & "onclick=""psnd('/Sounds/wave.mp3');"" "
	else ' All other objects
		Output = Output & "onclick=""psnd('" & objectGrid.SndClickGridItem & "');"" "
	end if
end if
It works on my test PC (Vista) using a light object; if I click "PorchLight" it plays the Jetsons doorbell.


PS
Be sure to export the AutomationBrowser before tinkering with its code!
 
Thanks 123! I have now surpassed my family's belief that I am a nutjob! ;)
 
Back
Top