VoicerProxy


A place-holder for a Voicer. Created automatically when a Voicer is .gui'ed.


VoicerProxy makes it easy to replace the voicer represented in a particular GUI. There is no need to destroy GUI objects for one voicer and create new ones for the next. Simply assign a new voicer to the proxy, and the proxy takes responsibility for synchronizing the GUI.


A VoicerProxy may also be used to stand in for voicer everywhere the voicer may be used. For example, if you attach a voicer MIDI socket directly to the voicer, the socket belongs to that voicer. But if you attach the socket to a VoicerProxy, you can change the target voicer by updating the proxy, with no need to touch the socket.



A VoicerGUI cannot exist without a VoicerProxy. User actions in the GUI pass through the proxy before taking effect. For instance, if you click the "panic" button, the GUI tells the proxy to panic, whereupon the proxy sends the message along to the voicer.


Voicer ------- VoicerProxy ------- VoicerProxyGui



The GUI knows only about proxies for the GlobalControls, so that the gui objects can be reassigned easily. The control proxies may be addressed directly through aVoicerProxy.controlProxies[0...] -- the array matches the order of controls in the GUI. You can also clear out the control proxies using the clearControlProxies method.


VoicerProxyGui ------- [VoicerGCProxy]s ------- [VoicerGlobalControl]s



MIDI sockets can cling to one Voicer for dear life, or can be remapped through the proxy.


VoicerMIDISocket ------- Voicer

------- VoicerProxy


VoicerMIDIController ------- VoicerGlobalControl

------- VoicerGCProxy



Creation:


A VoicerProxy is created by:


aVoicer.gui;

aVoicer.proxify;


After these operations, the proxy can be accessed by aVoicer.proxy, or:


aProxy = aVoicer.proxify;


Proxify returns the existing proxy if it exists, or creates a new one if needed.


Assignment:


aProxy.voicer = aVoicer; // everything updates: gui, MIDI, controls, etc.


Freeing:


aProxy.free; // assigns the Voicer's proxy to nil (and global controls) and removes gui