<plugin resizable="true">
	<grid rows="2" cols="3" spacing="4">
		<vbox spacing="4" expand="true">
			<!-- Signal meters -->
			<hbox spacing="4">
				<meter expand="true"
					id="iml" id2="imr" visibility=":lstn ieq 0"
					stereo="true" type="rms_peak"
					angle="0"
					min="-36 db" max="+6 db" 
					color="left_channel" color2="right_channel"
				/>
				<meter expand="true"
					id="iml" id2="imr" visibility=":lstn ieq 1"
					stereo="true" type="rms_peak"
					angle="0" 
					min="-36 db" max="+6 db" 
					color="middle_channel" color2="side_channel"
				/>
				<label text="labels.input:db" />
				<void min_width="64" />
				<label text="labels.output:db" />
				<meter expand="true"
					id="sml" id2="smr" visibility=":lstn ieq 0"
					stereo="true" type="rms_peak"
					angle="0"
					min="-36 db" max="+6 db" 
					color="left_channel" color2="right_channel"
				/>
				<meter expand="true"
					id="sml" id2="smr" visibility=":lstn ieq 1"
					stereo="true" type="rms_peak"
					angle="0" 
					min="-36 db" max="+6 db" 
					color="middle_channel" color2="side_channel"
				/>
			</hbox>
			
			<!-- Graph -->
			<graph width="640" height="340" expand="true" fill="true">
				<center hpos="-1" vpos="-1" visible="false" />
				
				<!-- Gray grid -->
				<ui:for id="f" first="20" last="90" step="10"><marker value="${f}" color="g_gray" basis="0" parallel="1" /></ui:for>
				<ui:for id="f" first="200" last="900" step="100"><marker value="${f}" color="g_gray" basis="0" parallel="1" /></ui:for>
				<ui:for id="f" first="2000" last="9000" step="1000"><marker value="${f}" color="g_gray" basis="0" parallel="1" /></ui:for>
				<marker value="20000" color="g_gray" basis="0" parallel="1" />
				
				<marker value="+36 db" color="g_gray" basis="1" parallel="0" /> <!-- +36 dB -->
				<marker value="+12 db" color="g_gray" basis="1" parallel="0" /> <!-- +12 dB -->
				<marker value="-12 db" color="g_gray" basis="1" parallel="0" /> <!-- -12 dB -->
				<marker value="-36 db" color="g_gray" basis="1" parallel="0" /> <!-- -36 dB -->
				
				<!-- Additional markers for zoom -->
				<marker value="+18 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -18 db" />
				<marker value="+6 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -18 db" />
				<marker value="-6 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -18 db" />
				<marker value="-18 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -18 db" />
				
				<marker value="+9 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -33 db" />
				<marker value="+3 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -33 db" />
				<marker value="-3 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -33 db" />
				<marker value="-9 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -33 db" />
				
				<!-- Yellow grid -->
				<marker value="100" color="g_yellow" basis="0" parallel="1" /> <!-- 100 Hz -->
				<marker value="1000" color="g_yellow" basis="0" parallel="1" /> <!-- 1 kHz -->
				<marker value="10000" color="g_yellow" basis="0" parallel="1" /> <!-- 10 kHz -->

				<marker value="+24 db" color="g_yellow" basis="1" parallel="0" /> <!-- 24 dB -->
				<marker value="0 db" color="g_white" basis="1" parallel="0" /> <!-- 0 dB -->
				<marker value="-24 db" color="g_yellow" basis="1" parallel="0" /> <!-- -24 dB -->

				<!-- Meshes -->
				<ui:for id="i" first="0" last="31">
					<marker id="fm_${i}" basis="0" parallel="1" color="eq_base" hue_id="huem_${i}" visibility_id="fvm_${i}" />
					<marker id="fs_${i}" basis="0" parallel="1" color="eq_base" hue_id="hues_${i}" visibility_id="fvs_${i}" />
					<marker id="gm_${i}" basis="1" parallel="0" color="eq_base" hue_id="huem_${i}" visibility_id="fvm_${i}" />
					<marker id="gs_${i}" basis="1" parallel="0" color="eq_base" hue_id="hues_${i}" visibility_id="fvs_${i}" />
				</ui:for>
				<ui:for id="i" first="0" last="31">
					<mesh id="agfm_${i}" color="eq_base" width="2" hue_id="huem_${i}" visibility_id="fvm_${i}" fill="0.8" smooth="true" />
					<mesh id="agfs_${i}" color="eq_base" width="2" hue_id="hues_${i}" visibility_id="fvs_${i}" fill="0.8" smooth="true" />
				</ui:for>
				<mesh id="fftg_m" width="2" color="middle_channel" visibility_id="fftv_m" />
				<mesh id="fftg_s" width="2" color="side_channel" visibility_id="fftv_s" />
				<mesh id="ag_m" width="3" color="middle_channel" smooth="true" visibility_id="fftv_m" />
				<mesh id="ag_s" width="3" color="side_channel" smooth="true" visibility_id="fftv_s" />
				<ui:for id="i" first="0" last="31">
					<dot hpos_id="fm_${i}" vpos_id="gm_${i}" scroll_id="qm_${i}"
						editable="true" color="eq_base"
						hue_id="huem_${i}" visibility_id="fvm_${i}"
					/>
					<dot hpos_id="fs_${i}" vpos_id="gs_${i}" scroll_id="qs_${i}"
						editable="true" color="eq_base"
						hue_id="hues_${i}" visibility_id="fvs_${i}"
					/>
				</ui:for>
				
				<!-- Boundaries -->
				<marker value="1" color="g_white" basis="2" parallel="0" /> <!-- +48 dB -->
				<marker value="24000" color="g_white" basis="0" parallel="1" />
				
				<!-- Axis -->
				<axis min="10" max="24000" color="g_white" angle="0.0" logarithmic="true" />
				<axis min="-48 db / :zoom" max="48 db * :zoom" color="g_white" angle="0.5" logarithmic="true" /> <!-- -48..+48 dB -->
				<axis min="-1" max="1" visible="false" angle="0.5" />
				
				<!-- Text -->
				<text text="graph.units.hz" basis="0;2" coord="10;0" halign="1" valign="1" />
				<text text="100" basis="0;2" coord="100;0" halign="1" valign="1" />
				<text text="graph.values.x_k" text:value="1" basis="0;2" coord="1000;0" halign="1" valign="1" />
				<text text="graph.values.x_k" text:value="10" basis="0;2" coord="10000;0" halign="1" valign="1" />
				
				<text text="+36" coord="10;36 db" halign="1" valign="-1" />
				<text text="+24" coord="10;24 db" halign="1" valign="-1" />
				<text text="+12" coord="10;12 db" halign="1" valign="-1" />
				<text text="0" coord="10;0 db" halign="1" valign="1" />
				<text text="-12" coord="10;-12 db" halign="1" valign="1" />
				<text text="-24" coord="10;-24 db" halign="1" valign="1" />
				<text text="-36" coord="10;-36 db" halign="1" valign="1" />
				<text text="graph.units.db" basis="0;2" coord="10;1" halign="1" valign="-1" />
				
				<!-- Additional text -->
				<text text="+18" coord="10;18 db" halign="1" valign="-1" visibility=":zoom le -18 db" />
				<text text="+6" coord="10;6 db" halign="1" valign="-1" visibility=":zoom le -18 db" />
				<text text="-6" coord="10;-6 db" halign="1" valign="1" visibility=":zoom le -18 db" />
				<text text="-18" coord="10;-18 db" halign="1" valign="1" visibility=":zoom le -18 db" />

				<text text="+9" coord="10;9 db" halign="1" valign="-1" visibility=":zoom le -33 db" />
				<text text="+3" coord="10;3 db" halign="1" valign="-1" visibility=":zoom le -33 db" />
				<text text="-3" coord="10;-3 db" halign="1" valign="1" visibility=":zoom le -33 db" />
				<text text="-9" coord="10;-9 db" halign="1" valign="1" visibility=":zoom le -33 db" />
			</graph>
			<hbox spacing="4" >
				<label text="labels.mode" />
				<combo id="mode" />
				<align hpos="0.5" expand="true">
					<hbox spacing="4">
						<vbox>
							<hbox>
								<button id="fftv_m" size="16" color="middle_channel" led="true" />
								<label text="labels.chan.middle" />
							</hbox>
							<value id="gain_m" same_line="true" fill="true" halign="1" />
						</vbox>
						<knob id="gain_m" size="16" scale_color="middle_channel" />
						<vbox>
							<hbox>
								<button id="fftv_s" size="16" color="side_channel" led="true" />
								<label text="labels.chan.side"/>
							</hbox>
							<value id="gain_s" same_line="true" fill="true" halign="1" />
						</vbox>
						<knob id="gain_s" size="16" scale_color="side_channel" />
						<button id="lstn" size="16" color="yellow" led="true" />
						<label text="labels.listen" />
					</hbox>
				</align>
				<label text="labels.graphs.spectrum" />
			</hbox>
		</vbox>
		<vbox>
			<label text="labels.zoom" />
			<fader id="zoom" angle="1" expand="true" />
			<value id="zoom" />
		</vbox>
		<vbox spacing="4">
			<group text="groups.signal" expand="true">
				<grid rows="5" cols="2" hspacing="4">
					<knob id="g_in" />
					<vbox vfill="false">
						<label text="labels.input" halign="0" />
						<value id="g_in" same_line="true" halign="0" />
					</vbox>
					
					<knob id="g_out" />
					<vbox vfill="false">
						<label text="labels.output" expand="true" halign="0" />
						<value id="g_out" same_line="true" halign="0" />
					</vbox>
					
					<knob id="bal" balance="0.5" scale_color="yellow" />
					<vbox vfill="false">
						<label text="labels.balance" halign="0" />
						<value id="bal" same_line="true" halign="0" />
					</vbox>
					
					<knob id="frqs_m" scale_color="middle_channel" />
					<vbox vfill="false">
						<label text="labels.chan.pitch_mid" halign="0" />
						<value id="frqs_m" same_line="true" halign="0" />
					</vbox>
					<knob id="frqs_s" scale_color="side_channel" />
					<vbox vfill="false">
						<label text="labels.chan.pitch_side" halign="0" />
						<value id="frqs_s" same_line="true" halign="0" />
					</vbox>
				</grid>
			</group>
			<group text="groups.analysis" expand="true">
				<vbox>
					<label text="labels.fft.fft" halign="0" />
					<combo id="fft" fill="true" />
					
					<grid rows="2" cols="2" transpose="false" expand="true" hspacing="4" >
						<knob id="react" size="20" />
						<vbox vfill="false">
							<label text="labels.metering.reactivity" halign="0" />
							<value id="react" same_line="true" halign="0" />
						</vbox>
						
						<knob id="shift" size="20" />
						<vbox vfill="false">
							<label text="labels.metering.shift" halign="0" />
							<value id="shift" same_line="true" halign="0" />
						</vbox>
					</grid>
				</vbox>
			</group>
		</vbox>
		
		<cell cols="3">
			<cgroup id="fsel">
				<!-- 8 blocks of filters -->
				<ui:for id="blk" first="0" last="7">
					<ui:set id="chn" value="${(:blk mod 2) ? 'labels.chan.id_S_ide' : 'labels.chan.id_M_id'}" />
					<ui:set id="chp" value="${(:blk mod 2) ? 's' : 'm'}" />
					<ui:set id="f" value="${:blk idiv 2}" />
				
					<grid transpose="true" rows="8" cols="17" hspacing="2">
						<label text="labels.specials.num" fill="true" halign="0" />
						<label text="labels.filter" fill="true" halign="0" />
						<label text="labels.mode" fill="true" halign="0" />
						<label text="labels.slope" fill="true" halign="0" />
						<cell rows="2"><label text="labels.freq_gain:hz_db" halign="0" /></cell>
						<cell rows="2"><label text="labels.q_hue" halign="0" /></cell>
						
						<!-- Filters -->
						<ui:for id="i" first="${:f*8}" last="${:f*8+7}">
							<ui:set id="ch" value="${chp}_${i}" />
							<cell cols="2" ><label text="${chn}" text:id="${i}" /></cell>
							<cell cols="2" fill="true" pad_bottom="1"><combo id="ft${ch}" fill="true"  /></cell>
							<cell cols="2" fill="true"><combo id="fm${ch}" fill="true"  /></cell>
							<combo id="s${ch}" fill="true" />
							<knob id="f${ch}" scale_hue_id="hue${ch}" size="20" />
							<value id="f${ch}" detailed="false" precision="1" />
							<knob id="q${ch}" scale_hue_id="hue${ch}" size="20" />
							<value id="q${ch}" detailed="false" />
							<grid rows="2" cols="2" fill="false">
								<button id="xs${ch}" led="true" size="12" color="green" />
								<button id="xm${ch}" led="true" size="12" color="red" />
								<label text="labels.chan.S_olo" font_size="8" />
								<label text="labels.chan.M_ute" font_size="8" />
							</grid>
							<knob id="g${ch}" scale_hue_id="hue${ch}" size="20" />
							<value id="g${ch}" detailed="false" />
							<knob id="hue${ch}" scale_hue_id="hue${ch}" size="16" />
							<value id="hue${ch}" detailed="false" />
						</ui:for>
					</grid>
				</ui:for>
			</cgroup>
		</cell>
	</grid>
</plugin>
