OK so what I started out with was 3 zones (Sunroom, Bedroom, and AllRooms) each with a copy of Winamp outputted to channels of my sound card (Kx drivers 0/1, 3/4 and 6/7, numbers may be off) I had a music screen and cycled thru the zones with the Zone Next command. We mainly stayed on the Sunroom zone.
I didn't want to change the look to much since my wife already know's how to work this setup.
For the sake of this post and so I don't get confused, from now on when I say Sources it is what XL calls Zones and what I call Zones are Rooms or outputs of my sound card.
Using Scalt's script worked fine but I could not get the toggle buttons to work right in the thin client (main touch screen used in the Sunroom). If I manually setup toggle buttons they work fine with the thin client, well kind of, I will explain later. What is cool about Scalt's script is the fact that you cannot accidentally play 2 sources to one zone/set of speakers.
My setup involves ALOT of events and is messy but works for me (so far), if someone has a suggestion on how to clean it up please let me know.
I have 3 sources:
Music Player 1
Music Player 2
Radio
Each of these is a copy of Winamp outputted to a Virtual Cable.
For right now until I can think of a better way, each Source has it's own page although Music Player 1 and 2 are identical. I changed the button that use to be "Next Zone" to "Sources" which pops up an overlay that shows each of the sources that takes you to the appropriate page. Each page also has a button which pops up another overlay that lists all of the zones. Clicking on them opens the Audio Repeater for that zone (using the script) and changes the toggle state to show a speaker next to it. Clicking the zone again closes that copy of the Audio Repeater and changes the toggle back to it's original state. Because of the script it keeps track of which Audio Repeater program was opened for each zone so it can close the right one.
This all worked fine for one source but I had to try to figure out how to play from the other sources without sending 2 audio streams to one speaker. The only way I could figure to do it was on each of the events to start the Audio Repeater I had it try to kill any other source instances for that zone (2 others in my case). So if I am playing a song in the Bedroom and Sunroom on Music Player 1 and want to listen to the radio in the Bedroom now, all I have to do is select what I want to listen to from the Radio source page and from the overlay on the radio screen pick the Bedroom zone and it will kill the Audio Repeater playing from Music Player 1 to the Bedroom zone (leaving the one from MP1 to Sunroom alone) and start one for the Radio to the Bedroom zone all without interrupting what is playing in the Sunroom.
My event to enable a zone looks like this for (Source) Music Player 1 to (Zone) Sunroom:
- Code: Select all
<event>
<name>MP1 Zone Sunroom Enable</name>
<serverevent>True</serverevent>
<commands>
<command>
<type>xlobby</type>
<execute>run event</execute>
<parameter>music</parameter>
<parameter>radio Zone Sunroom Disable</parameter>....Explained further down
</command>
<command>
<type>xlobby</type>
<execute>run event</execute>
<parameter>music</parameter>
<parameter>MP2 Zone Sunroom Disable</parameter>
</command>
<command>
<type>timer</type>
<execute>wait</execute>
<parameter>200</parameter>
</command>
<command>
<type>xlobby</type>
<execute>button state set</execute>
<parameter>MP1_sunroom_spkr</parameter>
<parameter>On</parameter>
</command>
<command>
<type>xlobby</type>
<execute>button set text</execute>
<parameter>MP1_sunroom_spkr</parameter>
<parameter>f</parameter>.........................this changes the image of a speaker to a speaker that is playing :)
</command>
<command>
<type>plugin</type>
<execute>command</execute>
<parameter>XScript</parameter>
<parameter>ExecScript</parameter>
<parameter>source.txt source_%zone>current% On</parameter>...sets the source player
</command>
<command>
<type>timer</type>
<execute>wait</execute>
<parameter>200</parameter>
</command>
<command>
<type>plugin</type>
<execute>command</execute>
<parameter>XScript</parameter>
<parameter>ExecScript</parameter>
<parameter>zones.txt zone_Sunroom On</parameter>....sets the output zone
</command>
</commands>
</event>
The zone disable command looks like this:
- Code: Select all
<event>
<name>MP1 Zone Sunroom Disable</name>
<commands>
<command>
<type>xlobby</type>
<execute>button state set</execute>
<parameter>MP1_sunroom_spkr</parameter>
<parameter>Off</parameter>
</command>
<command>
<type>xlobby</type>
<execute>button set text</execute>
<parameter>MP1_sunroom_spkr</parameter>
<parameter>e</parameter>
</command>
<command>
<type>plugin</type>
<execute>command</execute>
<parameter>XScript</parameter>
<parameter>ExecScript</parameter>
<parameter>zones.txt zone_Sunroom Off</parameter>
</command>
</commands>
</event>
The problem with this is I need these 2 events for each zone x sources =12 events so far, got to be a better way
Sorry if I jumped around a bit or did not explain fully, I took in a lot of info at one time and tried to explain it the best I could while I still had it in my head.
Let me know if I need to explain anything further.
I know this is a messy solution and I am going to be cleaning it up and simplifying what I can, hopefully from suggestions here. This is far from done.
This would work a lot better if Marbles "Feature Request" for Global Toggle Buttons would get added
This setup may or may not help anyone else but I just wanted to document what I have done so far.