<plugin resizable="true">
	<vbox spacing="4">
		<align hpos="0" fill="true">
			<hbox spacing="8" border="4" fill="false">
				<label text="labels.mode" />
				<combo id="mode" />
				
				<button text="actions.freeze" size="16" width="64" led="true" id="freeze" color="yellow" />
				
				<label text="labels.spectrogram" visibility=":mode ige 4" />
				<combo id="spm" visibility=":mode ige 4" />
				
				<label text="labels.channel" visibility=":mode ieq 4" />
				<label text="labels.channels" visibility=":mode band 1" />
				<hbox spacing="2">
					<combo id="spc0" width="32" visibility="(:mode ine 0) and (:mode ine 2)" />
					<combo id="spc1" width="32" visibility="(:mode ieq 1) or (:mode ieq 3) or (:mode ieq 5)" />
				</hbox>
				
				<label text="labels.log_scale" visibility=":mode ige 4" />
				<button id="splog" size="16" color="yellow" led="true" visibility=":mode ige 4" />
			</hbox>
		</align>
		
		<hbox expand="true">
			<vbox fill="true" expand="true" spacing="4">
				<!-- Analyzer, Mastering -->
				<graph width="640" height="360" expand="true" fill="true" visibility=":mode ilt 4">
					<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="+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 -->
					<marker value="-60 db" color="g_gray" basis="1" parallel="0" /> <!-- -60 dB -->
					
					<!-- Additional markers for zoom -->
					<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="-30 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -18 db" />
					<marker value="-42 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -18 db" />
					
					<marker value="-15 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -33 db" />
					<marker value="-21 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -33 db" />
					<marker value="-27 db" color="g_gray" basis="1" parallel="0" visibility=":zoom le -33 db" />
					<marker value="-33 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="0 db" color="g_yellow" basis="1" parallel="0" /> <!-- 0 dB -->
					<marker value="-24 db" color="g_yellow" basis="1" parallel="0" /> <!-- -24 dB -->
					<marker value="-48 db" color="g_yellow" basis="1" parallel="0" /> <!-- -48 dB -->
		
					<!-- Meshes -->
					<ui:for id="i" first="0" last="4">
						<mesh
							id="spd" x_index="0" y_index="${:i + 1}" width="3" hue_id="hue_${i}"
							visibility="(((:mode ieq 0) or (:mode ieq 2)) and (:on_${i})) or ((:mode ieq 1) or (:mode ieq 3) and ((:spc0 ieq ${i}) or (:spc1 ieq ${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" angle="0.0" color="g_white" logarithmic="true" />
					<axis min="-72 db / :zoom" max="24 db * :zoom" color="g_white" angle="0.5" logarithmic="true" /> <!-- -72..+24 dB -->
					<axis min="-1" max="1" visible="false" angle="0.5" />
					
					<!-- Marker -->
					<marker id="freq" color="g_red" basis="0" parallel="1" />
					<marker id="lvl" color="g_red" basis="1" parallel="0" />
					
					<!-- 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.1k" basis="0;2" coord="1000;0" halign="1" valign="1" />
					<text text="graph.values.10k" basis="0;2" coord="10000;0" 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="-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="-48" coord="10;-48 db" halign="1" valign="1" />
					<text text="-60" coord="10;-60 db" halign="1" valign="1" />
					<text text="graph.units.db" basis="0;2" coord="10;1" halign="1" valign="-1" />
					
					<!-- Additional text -->
					<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="-30" coord="10;-30 db" halign="1" valign="1" visibility=":zoom le -18 db" />
					<text text="-42" coord="10;-42 db" halign="1" valign="1" visibility=":zoom le -18 db" />
	
					<text text="-15" coord="10;-15 db" halign="1" valign="1" visibility=":zoom le -33 db" />
					<text text="-21" coord="10;-21 db" halign="1" valign="1" visibility=":zoom le -33 db" />
					<text text="-27" coord="10;-27 db" halign="1" valign="1" visibility=":zoom le -33 db" />
					<text text="-33" coord="10;-33 db" halign="1" valign="1" visibility=":zoom le -33 db" />
				</graph>
				
				<!-- Spectralizer (1 channel) -->
				<graph width="640" height="360" expand="true" fill="true" visibility=":mode ieq 4">
					<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" />
					
					<ui:for id="t" first="1" last="7" step="2"><marker value="${t}" color="g_gray" basis="1" parallel="0" /></ui:for>
					
					<!-- 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 -->
		
					<ui:for id="t" first="2" last="6" step="2"><marker value="${t}" color="g_yellow" basis="1" parallel="0" /></ui:for>

					<!-- Frame buffer -->
					<fbuffer id="fb0" width="1" height="1" hpos="-1" vpos="1" opacity="0.75" angle="0"
						mode=":spm" color="left_channel" hue_id="hue[spc0]" />
		
					<!-- Boundaries -->
					<marker value="8" color="g_white" basis="1" parallel="0" />
					<marker value="24000" color="g_white" basis="0" parallel="1" />
					
					<!-- Axis -->
					<axis min="10" max="24000" angle="0.0" color="g_white" logarithmic="true" />
					<axis min="0" max="8" color="g_white" angle="1.5" logarithmic="false" />
					
					<!-- Text -->
					<text text="graph.units.hz" basis="0;1" coord="10;8" halign="1" valign="1" />
					<text text="100" basis="0;1" coord="100;8" halign="1" valign="1" />
					<text text="graph.values.1k" basis="0;1" coord="1000;8" halign="1" valign="1" />
					<text text="graph.values.10k" basis="0;1" coord="10000;8" halign="1" valign="1" />
					
					<ui:for id="t" first="1" last="7"><text text="${t}" coord="10;${t}" halign="1" valign="1" /></ui:for>
					<text text="graph.axis.time" basis="0;1" coord="10;0" halign="1" valign="-1" />
				</graph>
				
				<!-- Spectralizer (2 channels) -->
				<graph width="800" height="360" expand="true" fill="true" visibility=":mode ieq 5">
					<center hpos="-1" vpos="1" visible="false" />
					<center hpos="0" vpos="1" visible="false" />
					
					<!-- Gray grid -->
					<ui:for id="f" first="20" last="90" step="10">
						<marker center="0" value="${f}" color="g_gray" basis="0" parallel="1" />
						<marker center="1" value="${f}" color="g_gray" basis="2" parallel="1" />
					</ui:for>
					<ui:for id="f" first="200" last="900" step="100">
						<marker center="0" value="${f}" color="g_gray" basis="0" parallel="1" />
						<marker center="1" value="${f}" color="g_gray" basis="2" parallel="1" />
					</ui:for>
					<ui:for id="f" first="2000" last="9000" step="1000">
						<marker center="0" value="${f}" color="g_gray" basis="0" parallel="1" />
						<marker center="1" value="${f}" color="g_gray" basis="2" parallel="1" />
					</ui:for>
					<marker center="0" value="20000" color="g_gray" basis="0" parallel="1" />
					<marker center="1" value="20000" color="g_gray" basis="2" parallel="1" />
					
					<ui:for id="t" first="1" last="7" step="2"><marker value="${t}" color="g_gray" basis="1" parallel="0" /></ui:for>
					
					<!-- Yellow grid -->
					<ui:for id="c" first="0" last="1" >
						<marker center="${c}" value="100" color="g_yellow" basis="0" parallel="1" /> <!-- 100 Hz -->
						<marker center="${c}" value="1000" color="g_yellow" basis="0" parallel="1" /> <!-- 1 kHz -->
						<marker center="${c}" value="10000" color="g_yellow" basis="0" parallel="1" /> <!-- 10 kHz -->
					</ui:for>
		
					<ui:for id="t" first="2" last="6" step="2"><marker value="${t}" color="g_yellow" basis="1" parallel="0" /></ui:for>

					<!-- Frame buffer -->
					<fbuffer id="fb0" width="0.5" height="1" hpos="-1" vpos="1" opacity="0.75" angle="0"
						mode=":spm" color="left_channel" hue_id="hue[spc0]" />
					<fbuffer id="fb1" width="0.5" height="1" hpos="0" vpos="1" opacity="0.75" angle="0"
						mode=":spm" color="left_channel" hue_id="hue[spc1]" />
		
					<!-- Boundaries -->
					<marker center="0" value="8" color="g_white" basis="1" parallel="0" />
					<marker center="0" value="24000" color="g_white" basis="0" parallel="1" />
					<marker center="1" value="24000" color="g_white" basis="2" parallel="1" />
					
					<!-- Axis -->
					<axis center="0" min="10" max="24000" length=":_a_width idiv 2" angle="0.0" color="g_white" logarithmic="true" />
					<axis center="0" min="0" max="8" color="g_white" angle="1.5" logarithmic="false" />
					<axis center="1" min="10" max="24000" length=":_a_width idiv 2" angle="0.0" color="g_white" logarithmic="true" />
					
					<!-- Text -->
					<ui:for id="c" first="0" last="1" >
						<text center="${c}" text="graph.units.hz" basis="0;1" coord="10;8" halign="1" valign="1" />
						<text center="${c}" text="100" basis="0;1" coord="100;8" halign="1" valign="1" />
						<text center="${c}" text="graph.values.1k" basis="0;1" coord="1000;8" halign="1" valign="1" />
						<text center="${c}" text="graph.values.10k" basis="0;1" coord="10000;8" halign="1" valign="1" />
						
						<ui:for id="t" first="1" last="7"><text center="${c}" text="${t}" coord="10;${t}" halign="1" valign="1" /></ui:for>
						<text center="${c}" text="graph.axis.time" basis="0;1" coord="10;0" halign="1" valign="-1" />
					</ui:for>
				</graph>
				
				<hbox spacing="8" border="4">
					<align pad_right="4" fill="true" hpos="0">
						<label text="labels.graphs.frequency" />
					</align>
					<label text="labels.fft.window" />
					<combo id="wnd" />
					<label text="labels.fft.tolerance" />
					<combo id="tol" />
					<label text="labels.fft.envelope" />
					<combo id="env" />
				</hbox>
			</vbox>
			
			<vbox visibility=":mode ilt 4">
				<label text="labels.zoom" />
				<fader id="zoom" angle="1" expand="true" />
				<value id="zoom" />
			</vbox>
		</hbox>
	
		<hbox spacing="4" visibility="(:mode ieq 0) or (:mode ieq 2)">
			<group text="groups.channels" expand="true">
				<grid rows="7" cols="5" transpose="true">
					<label text="labels.specials.num" />
					<label text="labels.chan.on" />
					<label text="labels.chan.solo_hold" />
					<label text="labels.chan.hue" />
					<label />
					<label text="labels.chan.shift" />
					<label text="labels.chan.:db" />
					
					<ui:for id="i" first="0" last="3">
						<label text="labels.specials.idx" text:id="${i}" />
						<button id="on_${i}" size="16" color="red" led="true" hue_id="hue_${i}" />
						
						<grid rows="2" cols="2" fill="false">
							<button id="solo_${i}" size="12" color="red" led="true" hue_id="hue_${i}" />
							<button id="frz_${i}" size="12" color="red" led="true" hue_id="hue_${i}" />
							<label text="labels.chan.S_olo" font_size="8" />
							<label text="labels.chan.H_old" font_size="8" />
						</grid> 
						
						<knob id="hue_${i}" scale_hue_id="hue_${i}" size="20" />
						<value id="hue_${i}" detailed="false" />
						<knob id="sh_${i}" scale_hue_id="hue_${i}" size="20" />
						<value id="sh_${i}" detailed="false" />
					</ui:for>
				</grid>
			</group>
			
			<group text="groups.metering" expand="true">
				<grid rows="5" cols="3" expand="true">
					<label text="labels.metering.channel" />
					<label text="labels.metering.frequency:hz" />
					<label text="labels.metering.level:db" />
					
					<combo id="chn" width="48" />
					<indicator id="freq" format="f6.1!" text_color="green" />
					<indicator id="lvl" format="+-f4.1!" text_color="green" />
				
					<label text="labels.metering.preamp" />
					<label text="labels.metering.selector" />
					<label text="labels.metering.reactivity" />
					
					<knob id="pamp" />
					<knob id="sel" />
					<knob id="react" />
					
					<value id="pamp" />
					<value id="sel" />
					<value id="react" />
				</grid>
			</group>
		</hbox>
		
		<group text="groups.channels" visibility="(:mode ine 0) and (:mode ine 2)">
			<grid rows="4" cols="20" transpose="true" fill="true">
				<ui:for id="i" first="0" last="3">
					<cell cols="3">
						<label text="labels.chan.channel_n" text:id="${i}" />
					</cell>
					<label text="labels.chan.hold" />
					<button id="frz_${i}" size="32" color="red" led="true" hue_id="hue_${i}" />
					<label />
					
					<label text="labels.chan.hue" />
					<knob id="hue_${i}" scale_hue_id="hue_${i}" size="20" />
					<value id="hue_${i}" detailed="false" />
					
					<label text="labels.chan.shift" />
					<knob id="sh_${i}" scale_hue_id="hue_${i}" size="20" />
					<value id="sh_${i}" same_line="true" />
	
					<cell rows="4" expand="false">
						<vsep />
					</cell>
				</ui:for>
				
				<label />
				<label text="labels.metering.preamp" />
				<knob id="pamp" />
				<value id="pamp" same_line="true" />

				<label />
				<label text="labels.metering.reactivity" />
				<knob id="react" />
				<value id="react" same_line="true" />
			</grid>
		</group>
	</vbox>
</plugin>