Allright, I guess I'm going to explain a bit more in detail what I'm doing here so other people can implement this setup.
First of all, I'll put up a picture of what my screen looks like.
As you can see, on the left, I have my various sources. For each source I have a multistate button that is called "source_NAME" that has 2 states : On, Off. All the buttons start of in the Off state.
The ON state has the triggers the following event (Music Player 1 example)
- Code: Select all
<event>
<name>set music player 1</name>
<commands>
<command>
<type>plugin</type>
<execute>command</execute>
<parameter>XScript</parameter>
<parameter>ExecScript</parameter>
<parameter>source.txt source_player1 On</parameter>
</command>
</commands>
</event>
and the Off state
- Code: Select all
<event>
<name>unset music player 1</name>
<commands>
<command>
<type>plugin</type>
<execute>command</execute>
<parameter>XScript</parameter>
<parameter>ExecScript</parameter>
<parameter>source.txt source_player1 Off</parameter>
</command>
</commands>
</event>
As you can see in the sources.exe script, to make sure only one source is selected at a time, whenever a button is clicked to the ON state, it puts all the other buttons to OFF. Another thing that is done is that the name of the current source is saved to the Xlobby variable "selected_source". This variable is used by the zones.txt script to point the Audio Repeaters to the correct Virtual Audio Cables (VAC). If you click on the same source again, it turns if off by calling the second event listed above. What happens then is that it disables all the zones on the right side of the screen because no source is selected at that point.
So quick recap to setup the sources : First of all, make sure that your different sources (WinAmp instances, DVD player software, MPC, Zoom Player, etc..) point to a seperate Virtual Audio cable. Then create a button for each source with the ID "source_NAME". For each button, create 2 states : On and Off. The event for the On state should be like my "set music player 1" event : it should call the sources.txt script with the ID of the button as the first parameter and On as the second parameter. For the Off state, the event should be like my "unset music player 1". The only difference is the use of Off for the second parameter.
Now onto the zones. Each zone must have a button and an audio repeater. I will use for example my zone called "Den". The button for this zone is called "zone_den" and it has an audio repeater called "RepeaterDen.exe". This button has 3 states : NA, On and Off. NA is the default state and it has no event associated to it. Obviously, you don't want to start an Audio Repeater when no source is selected, because that is basicly what the zone buttons do : they start the appropriate instance of the audio repeaters with the correct VAC as input.
The Off state calls the following event which basically calls the zones.txt script and changes the text of the zone. The font used is HTPC from one of the skins on this site (i forget..sorry) that has a bunch of very useful icons for HTPC. It just to happens that "e" and "f" represent little speakers with sound coming (and not) out of them...
- Code: Select all
<event>
<name>zone den enable</name>
<commands>
<command>
<type>plugin</type>
<execute>command</execute>
<parameter>XScript</parameter>
<parameter>ExecScript</parameter>
<parameter>zones.txt zone_den On</parameter>
</command>
<command>
<type>xlobby</type>
<execute>button set text</execute>
<parameter>zone_den</parameter>
<parameter>f</parameter>
</command>
</commands>
</event>
The event for the On state is the following
- Code: Select all
<event>
<name>zone den disable</name>
<commands>
<command>
<type>plugin</type>
<execute>command</execute>
<parameter>XScript</parameter>
<parameter>ExecScript</parameter>
<parameter>zones.txt zone_den Off</parameter>
</command>
<command>
<type>xlobby</type>
<execute>button set text</execute>
<parameter>zone_den</parameter>
<parameter>e</parameter>
</command>
</commands>
</event>
The zones.txt script is pretty straight forward. The only thing worth mentionning is the addition of the "all" zone. Basicly, I use this to close all instances of the Audio Repeaters. It's usefull to call when Xlobby shuts down for example or if Xlobby crashes and you start it up again and forgot to close the instances.
I think this pretty much covers it all, if I forgot something don't hesitate.